From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 00:46:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9733B106566C; Sun, 26 Aug 2012 00:46:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A488FC0C; Sun, 26 Aug 2012 00:46:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q0kwS1025556; Sun, 26 Aug 2012 00:46:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q0kwg0025554; Sun, 26 Aug 2012 00:46:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260046.q7Q0kwg0025554@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 00:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239697 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 00:46:58 -0000 Author: gonzo Date: Sun Aug 26 00:46:57 2012 New Revision: 239697 URL: http://svn.freebsd.org/changeset/base/239697 Log: Merge fix for hang on ARM11 from NetBSD Modified: head/sys/arm/arm/cpufunc_asm_arm11.S Modified: head/sys/arm/arm/cpufunc_asm_arm11.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11.S Sat Aug 25 23:59:31 2012 (r239696) +++ head/sys/arm/arm/cpufunc_asm_arm11.S Sun Aug 26 00:46:57 2012 (r239697) @@ -44,9 +44,11 @@ __FBSDID("$FreeBSD$"); * addresses that are about to change. */ ENTRY(arm11_setttb) +#ifdef PMAP_CACHE_VIVT stmfd sp!, {r0, lr} bl _C_LABEL(armv5_idcache_wbinv_all) ldmfd sp!, {r0, lr} +#endif mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 00:53:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7280A1065670; Sun, 26 Aug 2012 00:53:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAB68FC0C; Sun, 26 Aug 2012 00:53:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q0r1j3026484; Sun, 26 Aug 2012 00:53:01 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q0r1WU026482; Sun, 26 Aug 2012 00:53:01 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260053.q7Q0r1WU026482@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 00:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239698 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 00:53:01 -0000 Author: gonzo Date: Sun Aug 26 00:53:00 2012 New Revision: 239698 URL: http://svn.freebsd.org/changeset/base/239698 Log: Call set_pcpu for ARMv6 architecture too Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Aug 26 00:46:57 2012 (r239697) +++ head/sys/arm/arm/machdep.c Sun Aug 26 00:53:00 2012 (r239698) @@ -791,7 +791,7 @@ fake_preload_metadata(struct arm_boot_pa void pcpu0_init(void) { -#if ARM_ARCH_7A || defined(CPU_MV_PJ4B) +#if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B) set_pcpu(pcpup); #endif pcpu_init(pcpup, 0, sizeof(struct pcpu)); From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 01:21:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31144106566C; Sun, 26 Aug 2012 01:21:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 113648FC0C; Sun, 26 Aug 2012 01:21:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q1L2iK031032; Sun, 26 Aug 2012 01:21:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q1L27W031021; Sun, 26 Aug 2012 01:21:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208260121.q7Q1L27W031021@svn.freebsd.org> From: Glen Barber Date: Sun, 26 Aug 2012 01:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239699 - in head/sys: amd64/conf arm/conf i386/conf pc98/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 01:21:03 -0000 Author: gjb (doc,ports committer) Date: Sun Aug 26 01:21:02 2012 New Revision: 239699 URL: http://svn.freebsd.org/changeset/base/239699 Log: Grammar fix: s/NIC's/NICs/ MFC after: 3 days Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/AVILA head/sys/arm/conf/AVILA.hints head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CAMBRIA.hints head/sys/i386/conf/GENERIC head/sys/i386/conf/PAE head/sys/pc98/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/amd64/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -270,7 +270,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/AVILA Sun Aug 26 01:21:02 2012 (r239699) @@ -119,7 +119,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI Modified: head/sys/arm/conf/AVILA.hints ============================================================================== --- head/sys/arm/conf/AVILA.hints Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/AVILA.hints Sun Aug 26 01:21:02 2012 (r239699) @@ -19,7 +19,7 @@ hint.uart.1.ier_rxbits=0x5d # NB: need U # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wired NIC's, requires ixpqmgr +# NPE wired NICs, requires ixpqmgr hint.npe.0.at="ixp0" hint.npe.0.npeid="B" hint.npe.0.mac="B" Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/CAMBRIA Sun Aug 26 01:21:02 2012 (r239699) @@ -122,7 +122,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI Modified: head/sys/arm/conf/CAMBRIA.hints ============================================================================== --- head/sys/arm/conf/CAMBRIA.hints Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/CAMBRIA.hints Sun Aug 26 01:21:02 2012 (r239699) @@ -28,7 +28,7 @@ hint.uart.0.ier_rxbits=0x5d # NB: need U # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wired NIC's, requires ixpqmgr +# NPE wired NICs, requires ixpqmgr hint.npe.0.at="ixp0" hint.npe.0.npeid="C" hint.npe.0.mac="C" Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/i386/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -282,7 +282,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/i386/conf/PAE Sun Aug 26 01:21:02 2012 (r239699) @@ -75,7 +75,7 @@ nodevice sn nodevice xe nodevice an -nodevice ath # Atheros pci/cardbus NIC's +nodevice ath # Atheros pci/cardbus NICs nodevice ath_pci nodevice ath_hal nodevice ath_rate_sample # SampleRate tx rate control for ath Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/pc98/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -207,7 +207,7 @@ options IEEE80211_SUPPORT_MESH # enable #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm #device an # Aironet 4500/4800 802.11 wireless NICs. -#device ath # Atheros NIC's +#device ath # Atheros NICs #device ath_pci # Atheros pci/cardbus glue #device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/sparc64/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -207,7 +207,7 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # Atheros HAL (Hardware Access Layer) options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 02:23:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A59FB1065673; Sun, 26 Aug 2012 02:23:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB408FC16; Sun, 26 Aug 2012 02:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q2NMGD040542; Sun, 26 Aug 2012 02:23:22 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q2NMv1040538; Sun, 26 Aug 2012 02:23:22 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260223.q7Q2NMv1040538@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 02:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239701 - in head/sys/arm: arm include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 02:23:22 -0000 Author: gonzo Date: Sun Aug 26 02:23:21 2012 New Revision: 239701 URL: http://svn.freebsd.org/changeset/base/239701 Log: Add support for ARM11 cpufunc Obtained from: NetBSD (partially) Added: head/sys/arm/arm/cpufunc_asm_armv6.S (contents, props changed) Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun Aug 26 01:41:41 2012 (r239700) +++ head/sys/arm/arm/cpufunc.c Sun Aug 26 02:23:21 2012 (r239701) @@ -968,6 +968,68 @@ struct cpu_functions fa526_cpufuncs = { }; #endif /* CPU_FA526 || CPU_FA626TE */ +#if defined(CPU_ARM11) +struct cpu_functions arm11_cpufuncs = { + /* CPU functions */ + + cpufunc_id, /* id */ + arm11_drain_writebuf, /* cpwait */ + + /* MMU functions */ + + cpufunc_control, /* control */ + cpufunc_domains, /* Domain */ + arm11_setttb, /* Setttb */ + cpufunc_faultstatus, /* Faultstatus */ + cpufunc_faultaddress, /* Faultaddress */ + + /* TLB functions */ + + arm11_tlb_flushID, /* tlb_flushID */ + arm11_tlb_flushID_SE, /* tlb_flushID_SE */ + arm11_tlb_flushI, /* tlb_flushI */ + arm11_tlb_flushI_SE, /* tlb_flushI_SE */ + arm11_tlb_flushD, /* tlb_flushD */ + arm11_tlb_flushD_SE, /* tlb_flushD_SE */ + + /* Cache operations */ + + armv6_icache_sync_all, /* icache_sync_all */ + armv6_icache_sync_range, /* icache_sync_range */ + + armv6_dcache_wbinv_all, /* dcache_wbinv_all */ + armv6_dcache_wbinv_range, /* dcache_wbinv_range */ + armv6_dcache_inv_range, /* dcache_inv_range */ + armv6_dcache_wb_range, /* dcache_wb_range */ + + armv6_idcache_wbinv_all, /* idcache_wbinv_all */ + armv6_idcache_wbinv_range, /* idcache_wbinv_range */ + + (void*)cpufunc_nullop, /* l2cache_wbinv_all */ + (void *)cpufunc_nullop, /* l2cache_wbinv_range */ + (void *)cpufunc_nullop, /* l2cache_inv_range */ + (void *)cpufunc_nullop, /* l2cache_wb_range */ + + /* Other functions */ + + cpufunc_nullop, /* flush_prefetchbuf */ + arm11_drain_writebuf, /* drain_writebuf */ + cpufunc_nullop, /* flush_brnchtgt_C */ + (void *)cpufunc_nullop, /* flush_brnchtgt_E */ + + arm11_sleep, /* sleep */ + + /* Soft functions */ + + cpufunc_null_fixup, /* dataabt_fixup */ + cpufunc_null_fixup, /* prefetchabt_fixup */ + + arm11_context_switch, /* context_switch */ + + arm11_setup /* cpu setup */ +}; +#endif /* CPU_ARM11 */ + #if defined(CPU_CORTEXA) struct cpu_functions cortexa_cpufuncs = { /* CPU functions */ @@ -1324,6 +1386,15 @@ set_cpufuncs() goto out; } #endif /* CPU_ARM10 */ +#ifdef CPU_ARM11 + cpufuncs = arm11_cpufuncs; + cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ + get_cachetype_cp15(); + + pmap_pte_init_mmu_v6(); + + goto out; +#endif /* CPU_ARM11 */ #ifdef CPU_CORTEXA if (cputype == CPU_ID_CORTEXA8R1 || cputype == CPU_ID_CORTEXA8R2 || @@ -2197,38 +2268,36 @@ void arm11_setup(args) char *args; { - int cpuctrl, cpuctrlmask; - - cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE - /* | CPU_CONTROL_BPRD_ENABLE */; - cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE - | CPU_CONTROL_ROM_ENABLE | CPU_CONTROL_BPRD_ENABLE - | CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE - | CPU_CONTROL_ROUNDROBIN | CPU_CONTROL_CPCLK; + int cpuctrl; + cpuctrl = CPU_CONTROL_MMU_ENABLE; #ifndef ARM32_DISABLE_ALIGNMENT_FAULTS cpuctrl |= CPU_CONTROL_AFLT_ENABLE; #endif - + cpuctrl |= CPU_CONTROL_DC_ENABLE; + cpuctrl |= (0xf << 3); cpuctrl = parse_cpu_options(args, arm11_options, cpuctrl); - #ifdef __ARMEB__ cpuctrl |= CPU_CONTROL_BEND_ENABLE; #endif + cpuctrl |= CPU_CONTROL_SYST_ENABLE; + cpuctrl |= CPU_CONTROL_BPRD_ENABLE; + cpuctrl |= CPU_CONTROL_IC_ENABLE; + if (vector_page == ARM_VECTORS_HIGH) + cpuctrl |= CPU_CONTROL_VECRELOC; + cpuctrl |= (0x5 << 16); + cpuctrl |= CPU_CONTROL_V6_EXTPAGE; - /* Clear out the cache */ + /* Make sure caches are clean. */ cpu_idcache_wbinv_all(); - - /* Now really make sure they are clean. */ - __asm __volatile ("mcr\tp15, 0, r0, c7, c7, 0" : : ); + cpu_l2cache_wbinv_all(); /* Set the control register */ + ctrl = cpuctrl; cpu_control(0xffffffff, cpuctrl); - /* And again. */ cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); } #endif /* CPU_ARM11 */ Added: head/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/cpufunc_asm_armv6.S Sun Aug 26 02:23:21 2012 (r239701) @@ -0,0 +1,140 @@ +/* $NetBSD: cpufunc_asm_armv6.S,v 1.4 2010/12/10 02:06:22 bsh Exp $ */ + +/* + * Copyright (c) 2002, 2005 ARM Limited + * Portions Copyright (c) 2007 Microsoft + * 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. The name of the company 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 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. + * + * ARMv6 assembly functions for manipulating caches. + * These routines can be used by any core that supports the mcrr address + * range operations. + */ + +/* + * $FreeBSD$ + */ + +#include + + .arch armv6 + +/* + * Functions to set the MMU Translation Table Base register + * + * We need to clean and flush the cache as it uses virtual + * addresses that are about to change. + */ +ENTRY(armv6_setttb) +#ifdef PMAP_CACHE_VIVT + mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ + mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D cache */ +#endif + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + + mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ + + mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ + RET + +/* + * Cache operations. + */ + +/* LINTSTUB: void armv6_icache_sync_range(vaddr_t, vsize_t); */ +ENTRY_NP(armv6_icache_sync_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c5 /* invalidate I cache range */ + mcrr p15, 0, r1, r0, c12 /* clean D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_icache_sync_all(void); */ +ENTRY_NP(armv6_icache_sync_all) + /* + * We assume that the code here can never be out of sync with the + * dcache, so that we can safely flush the Icache and fall through + * into the Dcache cleaning code. + */ + mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ + mcr p15, 0, r0, c7, c10, 0 /* Clean D cache */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_dcache_wb_range(vaddr_t, vsize_t); */ +ENTRY(armv6_dcache_wb_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c12 /* clean D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_dcache_wbinv_range(vaddr_t, vsize_t); */ +ENTRY(armv6_dcache_wbinv_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c14 /* clean and invaliate D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* + * Note, we must not invalidate everything. If the range is too big we + * must use wb-inv of the entire cache. + * + * LINTSTUB: void armv6_dcache_inv_range(vaddr_t, vsize_t); + */ +ENTRY(armv6_dcache_inv_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c6 /* invaliate D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_idcache_wbinv_range(vaddr_t, vsize_t); */ +ENTRY(armv6_idcache_wbinv_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c5 /* invaliate I cache range */ + mcrr p15, 0, r1, r0, c14 /* clean & invaliate D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_idcache_wbinv_all(void); */ +ENTRY_NP(armv6_idcache_wbinv_all) + /* + * We assume that the code here can never be out of sync with the + * dcache, so that we can safely flush the Icache and fall through + * into the Dcache purging code. + */ + mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ + /* Fall through to purge Dcache. */ + +/* LINTSTUB: void armv6_dcache_wbinv_all(void); */ +ENTRY(armv6_dcache_wbinv_all) + mcr p15, 0, r0, c7, c14, 0 /* clean & invalidate D cache */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sun Aug 26 01:41:41 2012 (r239700) +++ head/sys/arm/include/cpufunc.h Sun Aug 26 02:23:21 2012 (r239701) @@ -495,8 +495,15 @@ void pj4b_flush_brnchtgt_va (u_int); void pj4b_sleep (int); void armv6_icache_sync_all (void); +void armv6_icache_sync_range (vm_offset_t, vm_size_t); + void armv6_dcache_wbinv_all (void); +void armv6_dcache_wbinv_range (vm_offset_t, vm_size_t); +void armv6_dcache_inv_range (vm_offset_t, vm_size_t); +void armv6_dcache_wb_range (vm_offset_t, vm_size_t); + void armv6_idcache_wbinv_all (void); +void armv6_idcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_setttb (u_int); void armv7_tlb_flushID (void); From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 02:34:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6321B106566C; Sun, 26 Aug 2012 02:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E60D8FC08; Sun, 26 Aug 2012 02:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q2Y45F042245; Sun, 26 Aug 2012 02:34:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q2Y4Am042243; Sun, 26 Aug 2012 02:34:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260234.q7Q2Y4Am042243@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 02:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239702 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 02:34:04 -0000 Author: gonzo Date: Sun Aug 26 02:34:03 2012 New Revision: 239702 URL: http://svn.freebsd.org/changeset/base/239702 Log: Add ARM11 support for elf trampoline Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Sun Aug 26 02:23:21 2012 (r239701) +++ head/sys/arm/arm/elf_trampoline.c Sun Aug 26 02:34:03 2012 (r239702) @@ -63,6 +63,8 @@ void __startC(void); #define cpu_idcache_wbinv_all armv5_ec_idcache_wbinv_all #elif defined(CPU_ARM10) #define cpu_idcache_wbinv_all arm10_idcache_wbinv_all +#elif defined(CPU_ARM11) +#define cpu_idcache_wbinv_all armv6_idcache_wbinv_all #elif defined(CPU_SA110) || defined(CPU_SA1110) || defined(CPU_SA1100) || \ defined(CPU_IXP12X0) #define cpu_idcache_wbinv_all sa1_cache_purgeID From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 04:26:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85B9A106564A; Sun, 26 Aug 2012 04:26:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7161B8FC0A; Sun, 26 Aug 2012 04:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q4QQb2059922; Sun, 26 Aug 2012 04:26:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4QQ3B059920; Sun, 26 Aug 2012 04:26:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260426.q7Q4QQ3B059920@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239703 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:26:26 -0000 Author: adrian Date: Sun Aug 26 04:26:25 2012 New Revision: 239703 URL: http://svn.freebsd.org/changeset/base/239703 Log: Add EEPROM data hooks for the AR9287. Tested: * AP99 Reference board (AR7241 + AR9287) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Sun Aug 26 02:34:03 2012 (r239702) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Sun Aug 26 04:26:25 2012 (r239703) @@ -137,6 +137,13 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s ar5416InitState(AH5416(ah), devid, sc, st, sh, status); + if (eepromdata != AH_NULL) { + AH_PRIVATE(ah)->ah_eepromRead = ath_hal_EepromDataRead; + AH_PRIVATE(ah)->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + + /* XXX override with 9280 specific state */ /* override 5416 methods for our needs */ AH5416(ah)->ah_initPLL = ar9280InitPLL; From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 04:26:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42305106566B; Sun, 26 Aug 2012 04:26:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1D58FC14; Sun, 26 Aug 2012 04:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q4QosL060008; Sun, 26 Aug 2012 04:26:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4Qnvk060005; Sun, 26 Aug 2012 04:26:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260426.q7Q4Qnvk060005@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239704 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:26:50 -0000 Author: adrian Date: Sun Aug 26 04:26:49 2012 New Revision: 239704 URL: http://svn.freebsd.org/changeset/base/239704 Log: Move this magic check to only occur if no eeprom data is given. Tested on: * AP99 (AR7241+AR9287) Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sun Aug 26 04:26:25 2012 (r239703) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sun Aug 26 04:26:49 2012 (r239704) @@ -310,12 +310,12 @@ ath_hal_9287EepromAttach(struct ath_hal "%s Error reading Eeprom MAGIC\n", __func__); return HAL_EEREAD; } - } - HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", - __func__, magic); - if (magic != AR5416_EEPROM_MAGIC) { - HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n"); - return HAL_EEMAGIC; + HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", + __func__, magic); + if (magic != AR5416_EEPROM_MAGIC) { + HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n"); + return HAL_EEMAGIC; + } } ee = ath_hal_malloc(sizeof(HAL_EEPROM_9287)); From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 04:37:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84A8D106566B; Sun, 26 Aug 2012 04:37:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65AD38FC0C; Sun, 26 Aug 2012 04:37:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q4b0ib061596; Sun, 26 Aug 2012 04:37:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4b0xT061593; Sun, 26 Aug 2012 04:37:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260437.q7Q4b0xT061593@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239705 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:37:00 -0000 Author: adrian Date: Sun Aug 26 04:36:59 2012 New Revision: 239705 URL: http://svn.freebsd.org/changeset/base/239705 Log: Create a skeleton AR724x SoC board configuration for use by AR724x devices. Added: head/sys/mips/conf/AR724X_BASE (contents, props changed) head/sys/mips/conf/AR724X_BASE.hints (contents, props changed) Added: head/sys/mips/conf/AR724X_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR724X_BASE Sun Aug 26 04:36:59 2012 (r239705) @@ -0,0 +1,125 @@ +# +# AR724X -- Kernel configuration file for FreeBSD/MIPS for Atheros 724x systems +# +# This includes all the common drivers for the AR724x boards along with +# the usb, net80211 and atheros driver code. +# +# $FreeBSD$ +# + +machine mips mips +ident AR724X_BASE +cpu CPU_MIPS4KC +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 +options HWPMC_HOOKS + +files "../atheros/files.ar71xx" + +# For now, hints are per-board. + +hints "AR724X_BASE.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +# Build these as modules so small platform builds will have the +# modules already built. +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 # IPv6 + +# options NFS_CL #Network Filesystem Client + +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# options NFS_LEGACYRPC +# Debugging for use in -current +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS +options WITNESS_SKIPSPIN +options DEBUG_REDZONE +options DEBUG_MEMGUARD + +options FFS #Berkeley Fast Filesystem +# options SOFTUPDATES #Enable FFS soft updates support +# options UFS_ACL #Support for access control lists +# options UFS_DIRHASH #Improve performance on big directories +# options MSDOSFS # Read MSDOS filesystems; useful for USB/CF + +device pci +device ar724x_pci + +# 802.11 framework +options IEEE80211_DEBUG +options IEEE80211_ALQ +options IEEE80211_SUPPORT_MESH +# This option is currently broken for if_ath_tx. +options IEEE80211_SUPPORT_TDMA +options IEEE80211_AMPDU_AGE +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_xauth # 802.11 hostap support + +# Atheros wireless NICs +device ath # Atheros interface support +device ath_pci # Atheros PCI/Cardbus bus +options ATH_DEBUG +options ATH_DIAGAPI +options ATH_ENABLE_11N +options AH_DEBUG +options AH_DEBUG_ALQ +options ALQ +device ath_hal +option AH_SUPPORT_AR5416 +device ath_rate_sample +option AH_RXCFG_SDMAMW_4BYTES +option AH_AR5416_INTERRUPT_MITIGATION +# There's no DFS radar detection support yet so this won't actually +# detect radars. It however does enable the rest of the channel change +# machinery so DFS can be debugged. +option ATH_ENABLE_DFS + +device mii +device arge + +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this +device ehci + +device scbus +device umass +device da + +# On-board SPI flash +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +device uart + +device loop +device ether +device md +device bpf +device random +device if_bridge +device gif # ip[46] in ip[46] tunneling protocol +device gre # generic encapsulation - only for IPv4 in IPv4 though atm + +options ARGE_DEBUG # Enable if_arge debugging for now + +# Enable GPIO +device gpio +device gpioled Added: head/sys/mips/conf/AR724X_BASE.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR724X_BASE.hints Sun Aug 26 04:36:59 2012 (r239705) @@ -0,0 +1,66 @@ +# +# $FreeBSD$ +# +hint.apb.0.at="nexus0" +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# see atheros/uart_cpu_ar71xx.c why +3 +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +#ohci +hint.ohci.0.at="apb0" +hint.ohci.0.maddr=0x1c000000 +hint.ohci.0.msize=0x01000000 +hint.ohci.0.irq=6 + +#ehci +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000100 +hint.ehci.0.msize=0x01000000 +hint.ehci.0.irq=1 + +# pci +hint.pcib.0.at="nexus0" +hint.pcib.0.irq=0 + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 + +# phymask, media and fduplex depend upon the specific +# board. +# So each board will override the settings as needed. + +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" + +# GPIO +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x18040000 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 + +# Each board should override the GPIO bus pins with the configuration +# relevant to it. Thus no pins are defined here. + +# hwpmc device +hint.ar71xx_pmc.0.at="apb0" +hint.ar71xx_pmc.0.irq=5 From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 04:39:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAE5B106564A; Sun, 26 Aug 2012 04:39:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A67FD8FC1A; Sun, 26 Aug 2012 04:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q4dK5x061950; Sun, 26 Aug 2012 04:39:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4dKHU061948; Sun, 26 Aug 2012 04:39:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260439.q7Q4dKHU061948@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239706 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:39:20 -0000 Author: adrian Date: Sun Aug 26 04:39:20 2012 New Revision: 239706 URL: http://svn.freebsd.org/changeset/base/239706 Log: Ensure that BAR(0) is set for the PCI slot before the ath(4) PCI registers are written out. This allows EEPROM-less NICs on the AR7241 PCIe bus to be correctly initialised. Tested: * AP91 (AR7240+AR9285) - the existing board support didn't break; * AP99 (AR7241+AR9287) - this fixed the configuration of the AR9287 PCI. Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sun Aug 26 04:36:59 2012 (r239705) +++ head/sys/mips/atheros/ar724x_pci.c Sun Aug 26 04:39:20 2012 (r239706) @@ -270,6 +270,10 @@ ar724x_pci_fixup(device_t dev, long flas /* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */ bar0 = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_BAR(0), 4); + /* Write temporary BAR0 to map the NIC into a fixed location */ + ar724x_pci_write_config(dev, 0, 0, 0, PCIR_BAR(0), + AR71XX_PCI_MEM_BASE, 4); + val = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_COMMAND, 2); val |= (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); ar724x_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, val, 2); From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 05:11:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C688C106566B; Sun, 26 Aug 2012 05:11:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B18288FC15; Sun, 26 Aug 2012 05:11:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q5BrhE065876; Sun, 26 Aug 2012 05:11:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q5Brgh065872; Sun, 26 Aug 2012 05:11:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208260511.q7Q5Brgh065872@svn.freebsd.org> From: Warner Losh Date: Sun, 26 Aug 2012 05:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239707 - releng/9.1/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 05:11:54 -0000 Author: imp Date: Sun Aug 26 05:11:52 2012 New Revision: 239707 URL: http://svn.freebsd.org/changeset/base/239707 Log: MFS: r239148 r239148 | imp | 2012-08-08 14:21:33 -0600 (Wed, 08 Aug 2012) | 8 lines Make the addition of the d_gone binary compatible. This allows storage drivers compiled for 9.0 to work on 9.1 and preserves the ABI for disks. Reviewed by: scottl, ken Approved by: re@ (kensmith) MFS after: releng/9.1 gets sorted This change fixes the binary compatibility problems with additions to the disk(9) API. Disk drivers compiled against 9.0 will not work on 9.1-RC1, but should start working after this change or in 9.1-RC2 and later. Disk drivers should not be linked against 9.1-RC1 for distribution, except specifically for testing on RC1. This was planned for RC1, but it was delayed due to circumstancs beyond my control. Approved by: re@ (kensmith) Modified: releng/9.1/sys/geom/geom_disk.c releng/9.1/sys/geom/geom_disk.h Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/geom/geom_disk.c ============================================================================== --- releng/9.1/sys/geom/geom_disk.c Sun Aug 26 04:39:20 2012 (r239706) +++ releng/9.1/sys/geom/geom_disk.c Sun Aug 26 05:11:52 2012 (r239707) @@ -509,7 +509,14 @@ g_disk_providergone(struct g_provider *p dp = sc->dp; - if (dp->d_gone != NULL) + /* + * FreeBSD 9 started with VERSION_01 of the struct disk structure. + * However, g_gone was added in the middle of the branch. To + * cope with version being missing from struct disk, we set a flag + * in g_disk_create for VERSION_01 and avoid touching the d_gone + * field for old consumers. + */ + if (!(dp->d_flags & DISKFLAG_LACKS_GONE) && dp->d_gone != NULL) dp->d_gone(dp); } @@ -577,7 +584,7 @@ disk_alloc() void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_02) { + if (version != DISK_VERSION_02 && version != DISK_VERSION_01) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); @@ -585,6 +592,8 @@ disk_create(struct disk *dp, int version dp->d_name, dp->d_unit); return; } + if (version == DISK_VERSION_01) + dp->d_flags |= DISKFLAG_LACKS_GONE; KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); KASSERT(dp->d_name != NULL, ("disk_create need d_name")); KASSERT(*dp->d_name != 0, ("disk_create need d_name")); Modified: releng/9.1/sys/geom/geom_disk.h ============================================================================== --- releng/9.1/sys/geom/geom_disk.h Sun Aug 26 04:39:20 2012 (r239706) +++ releng/9.1/sys/geom/geom_disk.h Sun Aug 26 05:11:52 2012 (r239707) @@ -78,7 +78,6 @@ struct disk { disk_ioctl_t *d_ioctl; dumper_t *d_dump; disk_getattr_t *d_getattr; - disk_gone_t *d_gone; /* Info fields from driver to geom_disk.c. Valid when open */ u_int d_sectorsize; @@ -97,12 +96,16 @@ struct disk { /* Fields private to the driver */ void *d_drv1; + + /* new fields in stable - don't use if DISKFLAG_LACKS_GONE is set */ + disk_gone_t *d_gone; }; #define DISKFLAG_NEEDSGIANT 0x1 #define DISKFLAG_OPEN 0x2 #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 +#define DISKFLAG_LACKS_GONE 0x10 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 05:20:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D797106566B; Sun, 26 Aug 2012 05:20:33 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 182BC8FC08; Sun, 26 Aug 2012 05:20:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q5KWaL067047; Sun, 26 Aug 2012 05:20:32 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q5KWIt067044; Sun, 26 Aug 2012 05:20:32 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201208260520.q7Q5KWIt067044@svn.freebsd.org> From: "Andrey A. Chernov" Date: Sun, 26 Aug 2012 05:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239708 - stable/9/contrib/openresolv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 05:20:33 -0000 Author: ache Date: Sun Aug 26 05:20:32 2012 New Revision: 239708 URL: http://svn.freebsd.org/changeset/base/239708 Log: MFC r239477 According to resolvconf.conf(5) manpage and sources, there is no 'nameservers' option which used in examples in resolvconf.conf(5), it spelled 'name_servers', so fix examples. Modified: stable/9/contrib/openresolv/resolvconf.conf.5.in Directory Properties: stable/9/contrib/openresolv/ (props changed) Modified: stable/9/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- stable/9/contrib/openresolv/resolvconf.conf.5.in Sun Aug 26 05:11:52 2012 (r239707) +++ stable/9/contrib/openresolv/resolvconf.conf.5.in Sun Aug 26 05:20:32 2012 (r239708) @@ -113,7 +113,7 @@ This file tells dnsmasq which nameserver This file tells dnsmasq which nameservers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 dnsmasq_conf=/etc/dnsmasq-conf.conf .D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf .Pp @@ -129,7 +129,7 @@ Include this file in the named global sc This file tells named which nameservers to use for specific domains. .Pp Example resolvconf.conf for named: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 named_options=/etc/named-options.conf .D1 named_zones=/etc/named-zones.conf .Pp @@ -152,7 +152,7 @@ If this variable is not set then it's wr .Pa pdnsd_conf . .Pp Example resolvconf.conf for pdnsd: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 pdnsd_conf=/etc/pdnsd.conf .D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf .Pp @@ -171,7 +171,7 @@ Example pdnsd.conf: This file tells unbound about specific and global nameservers. .Pp Example resolvconf.conf for unbound: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 unbound_conf=/etc/unbound-resolvconf.conf .Pp Example unbound.conf: From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 09:22:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E757106566B; Sun, 26 Aug 2012 09:22:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7571B8FC0A; Sun, 26 Aug 2012 09:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q9M0GW096205; Sun, 26 Aug 2012 09:22:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q9M0S9096188; Sun, 26 Aug 2012 09:22:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208260922.q7Q9M0S9096188@svn.freebsd.org> From: Robert Watson Date: Sun, 26 Aug 2012 09:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239709 - in head/sys: dev/terasic/de4led mips/beri mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 09:22:00 -0000 Author: rwatson Date: Sun Aug 26 09:21:59 2012 New Revision: 239709 URL: http://svn.freebsd.org/changeset/base/239709 Log: Add terasic_de4led, a led(4) driver for the on-board 8-element LED on the Terasic DE-4 board. Allow LED configuration to be set using loader tunables, not just from userspace, and preconfigure LED 8 as a kernel heartbeat. For now, this is a Nexus-attached, BERI-only driver, but it could be used with other hard and soft cores on Altera FPGAs as well, in principle. Sponsored by: DARPA, AFRL Added: head/sys/dev/terasic/de4led/ head/sys/dev/terasic/de4led/terasic_de4led.c (contents, props changed) head/sys/dev/terasic/de4led/terasic_de4led.h (contents, props changed) head/sys/dev/terasic/de4led/terasic_de4led_nexus.c (contents, props changed) Modified: head/sys/mips/beri/files.beri head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT Added: head/sys/dev/terasic/de4led/terasic_de4led.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led.c Sun Aug 26 09:21:59 2012 (r239709) @@ -0,0 +1,188 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +static void +terasic_de4led_update(struct terasic_de4led_softc *sc) +{ + + TERASIC_DE4LED_LOCK_ASSERT(sc); + + bus_write_1(sc->tdl_res, TERASIC_DE4LED_OFF_LED, sc->tdl_bits); +} + +static void +led_update(struct terasic_de4led_softc *sc, int bit, int onoff) +{ + + TERASIC_DE4LED_LOCK(sc); + TERASIC_DE4LED_SETLED(sc, bit, onoff); + terasic_de4led_update(sc); + TERASIC_DE4LED_UNLOCK(sc); +} + +static void +led_0(void *arg, int onoff) +{ + + led_update(arg, 0, onoff); +} + +static void +led_1(void *arg, int onoff) +{ + + led_update(arg, 1, onoff); +} + +static void +led_2(void *arg, int onoff) +{ + + led_update(arg, 2, onoff); +} + +static void +led_3(void *arg, int onoff) +{ + + led_update(arg, 3, onoff); +} + +static void +led_4(void *arg, int onoff) +{ + + led_update(arg, 4, onoff); +} + +static void +led_5(void *arg, int onoff) +{ + + led_update(arg, 5, onoff); +} + +static void +led_6(void *arg, int onoff) +{ + + led_update(arg, 6, onoff); +} + +static void +led_7(void *arg, int onoff) +{ + + led_update(arg, 7, onoff); +} + +void +terasic_de4led_attach(struct terasic_de4led_softc *sc) +{ + const char *cmd; + + TERASIC_DE4LED_LOCK_INIT(sc); + + /* + * Clear the LED array before we start. + */ + TERASIC_DE4LED_LOCK(sc); + TERASIC_DE4LED_CLEARBAR(sc); + terasic_de4led_update(sc); + TERASIC_DE4LED_UNLOCK(sc); + + /* + * Register the LED array with led(4). + */ + sc->tdl_leds[0] = led_create(led_0, sc, "de4led_0"); + sc->tdl_leds[1] = led_create(led_1, sc, "de4led_1"); + sc->tdl_leds[2] = led_create(led_2, sc, "de4led_2"); + sc->tdl_leds[3] = led_create(led_3, sc, "de4led_3"); + sc->tdl_leds[4] = led_create(led_4, sc, "de4led_4"); + sc->tdl_leds[5] = led_create(led_5, sc, "de4led_5"); + sc->tdl_leds[6] = led_create(led_6, sc, "de4led_6"); + sc->tdl_leds[7] = led_create(led_7, sc, "de4led_7"); + + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_0_cmd", &cmd) == 0) + led_set("de4led_0", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_1_cmd", &cmd) == 0) + led_set("de4led_1", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_2_cmd", &cmd) == 0) + led_set("de4led_2", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_3_cmd", &cmd) == 0) + led_set("de4led_3", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_4_cmd", &cmd) == 0) + led_set("de4led_4", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_5_cmd", &cmd) == 0) + led_set("de4led_5", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_6_cmd", &cmd) == 0) + led_set("de4led_6", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_7_cmd", &cmd) == 0) + led_set("de4led_7", cmd); +} + +void +terasic_de4led_detach(struct terasic_de4led_softc *sc) +{ + int i; + + for (i = 0; i < 8; i++) { + led_destroy(sc->tdl_leds[i]); + sc->tdl_leds[i] = NULL; + } + TERASIC_DE4LED_LOCK(sc); + TERASIC_DE4LED_CLEARBAR(sc); + terasic_de4led_update(sc); + TERASIC_DE4LED_UNLOCK(sc); + TERASIC_DE4LED_LOCK_DESTROY(sc); +} Added: head/sys/dev/terasic/de4led/terasic_de4led.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led.h Sun Aug 26 09:21:59 2012 (r239709) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_TERASIC_DE4LED_H_ +#define _DEV_TERASIC_DE4LED_H_ + +#define TERASIC_DE4LED_NUMLEDS 8 +struct terasic_de4led_softc { + device_t tdl_dev; + int tdl_unit; + struct resource *tdl_res; + int tdl_rid; + struct mtx tdl_lock; + uint8_t tdl_bits; + struct cdev *tdl_leds[TERASIC_DE4LED_NUMLEDS]; +}; + +#define TERASIC_DE4LED_LOCK(sc) mtx_lock(&(sc)->tdl_lock) +#define TERASIC_DE4LED_LOCK_ASSERT(sc) mtx_assert(&(sc)->tdl_lock, MA_OWNED) +#define TERASIC_DE4LED_LOCK_DESTROY(sc) mtx_destroy(&(sc)->tdl_lock) +#define TERASIC_DE4LED_LOCK_INIT(sc) mtx_init(&(sc)->tdl_lock, \ + "terasic_de4led", NULL, MTX_DEF) +#define TERASIC_DE4LED_UNLOCK(sc) mtx_unlock(&(sc)->tdl_lock) + +/* + * Setting and clearing LEDs. tdl_bits is in the bit order preferred for I/O. + * The LED elements are labelled 1..8 on the DE-4, so bit 0 is LED 1, and so + * on. + */ +#define TERASIC_DE4LED_CLEARBAR(sc) do { \ + (sc)->tdl_bits = 0; \ +} while (0) +#define TERASIC_DE4LED_SETLED(sc, led, onoff) do { \ + (sc)->tdl_bits &= ~(1 << (led)); \ + (sc)->tdl_bits |= ((onoff != 0) ? 1 : 0) << (led); \ +} while (0) + +/* + * Only one offset matters for this device -- 0. + */ +#define TERASIC_DE4LED_OFF_LED 0 + +void terasic_de4led_attach(struct terasic_de4led_softc *sc); +void terasic_de4led_detach(struct terasic_de4led_softc *sc); + +#endif /* _DEV_TERASIC_DE4LED_H_ */ Added: head/sys/dev/terasic/de4led/terasic_de4led_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Sun Aug 26 09:21:59 2012 (r239709) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * Nexus bus attachment for the 8-element LED on the Terasic DE-4 FPGA board, + * which is hooked up to the processor via a memory-mapped Avalon bus. + */ +static int +terasic_de4led_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Terasic DE4 8-element LED"); + return (BUS_PROBE_DEFAULT); +} + +static int +terasic_de4led_nexus_attach(device_t dev) +{ + struct terasic_de4led_softc *sc; + + sc = device_get_softc(dev); + sc->tdl_dev = dev; + sc->tdl_unit = device_get_unit(dev); + sc->tdl_rid = 0; + sc->tdl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->tdl_rid, RF_ACTIVE); + if (sc->tdl_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + terasic_de4led_attach(sc); + return (0); +} + +static int +terasic_de4led_nexus_detach(device_t dev) +{ + struct terasic_de4led_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->tdl_res != NULL, ("%s: resources not allocated", + __func__)); + terasic_de4led_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->tdl_rid, sc->tdl_res); + return (0); +} + +static device_method_t terasic_de4led_nexus_methods[] = { + DEVMETHOD(device_probe, terasic_de4led_nexus_probe), + DEVMETHOD(device_attach, terasic_de4led_nexus_attach), + DEVMETHOD(device_detach, terasic_de4led_nexus_detach), + { 0, 0 } +}; + +static driver_t terasic_de4led_nexus_driver = { + "terasic_de4led", + terasic_de4led_nexus_methods, + sizeof(struct terasic_de4led_softc), +}; + +static devclass_t terasic_de4led_devclass; + +DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, + terasic_de4led_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/beri/files.beri Sun Aug 26 09:21:59 2012 (r239709) @@ -2,6 +2,8 @@ dev/altera/jtag_uart/altera_jtag_uart_cons.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart +dev/terasic/de4led/terasic_de4led.c optional terasic_de4led +dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led dev/terasic/mtl/terasic_mtl.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_pixel.c optional terasic_mtl Modified: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 09:21:59 2012 (r239709) @@ -25,6 +25,14 @@ hint.altera_sdcardc.0.maddr=0x7f008000 hint.altera_sdcardc.0.msize=0x400 # +# On-board DE4 8-element LED +# +hint.terasic_de4led.0.at="nexus0" +hint.terasic_de4led.0.maddr=0x7f006000 +hint.terasic_de4led.0.msize=1 +hint.terasic_de4led.0.de4led_0_cmd="f9" + +# # Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. # hint.terasic_mtl.0.at="nexus0" Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/conf/BERI_DE4_MDROOT Sun Aug 26 09:21:59 2012 (r239709) @@ -24,6 +24,7 @@ options ROOTDEVNAME=\"ufs:md0\" device altera_avgen device altera_jtag_uart device altera_sdcard +device terasic_de4led device terasic_mtl device isf Modified: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_SDROOT Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/conf/BERI_DE4_SDROOT Sun Aug 26 09:21:59 2012 (r239709) @@ -17,6 +17,7 @@ options ROOTDEVNAME=\"ufs:altera_sdcard device altera_avgen device altera_jtag_uart device altera_sdcard +device terasic_de4led device terasic_mtl device isf From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 09:54:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC0C106564A; Sun, 26 Aug 2012 09:54:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A96808FC08; Sun, 26 Aug 2012 09:54:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q9sBdu000652; Sun, 26 Aug 2012 09:54:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q9sBXI000649; Sun, 26 Aug 2012 09:54:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201208260954.q7Q9sBXI000649@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 26 Aug 2012 09:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239710 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 09:54:11 -0000 Author: glebius Date: Sun Aug 26 09:54:11 2012 New Revision: 239710 URL: http://svn.freebsd.org/changeset/base/239710 Log: Fix function name in keg_cachespread_init() assert. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Aug 26 09:21:59 2012 (r239709) +++ head/sys/vm/uma_core.c Sun Aug 26 09:54:11 2012 (r239710) @@ -1238,7 +1238,7 @@ keg_cachespread_init(uma_keg_t keg) keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; KASSERT(keg->uk_ipers <= uma_max_ipers, - ("keg_small_init: keg->uk_ipers too high(%d) increase max_ipers", + ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, keg->uk_ipers)); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 10:30:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D33F106564A; Sun, 26 Aug 2012 10:30:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF818FC14; Sun, 26 Aug 2012 10:30:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QAU1rE007187; Sun, 26 Aug 2012 10:30:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QAU1bl007184; Sun, 26 Aug 2012 10:30:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208261030.q7QAU1bl007184@svn.freebsd.org> From: Dimitry Andric Date: Sun, 26 Aug 2012 10:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239711 - in stable/9: lib/clang usr.bin/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 10:30:02 -0000 Author: dim Date: Sun Aug 26 10:30:01 2012 New Revision: 239711 URL: http://svn.freebsd.org/changeset/base/239711 Log: MFC r239614: Sprinkle a bit of style.Makefile(5) across various clang Makefiles. No functional changes. Modified: stable/9/lib/clang/clang.build.mk stable/9/lib/clang/clang.lib.mk stable/9/usr.bin/clang/clang.prog.mk Directory Properties: stable/9/lib/clang/ (props changed) stable/9/usr.bin/clang/ (props changed) Modified: stable/9/lib/clang/clang.build.mk ============================================================================== --- stable/9/lib/clang/clang.build.mk Sun Aug 26 09:54:11 2012 (r239710) +++ stable/9/lib/clang/clang.build.mk Sun Aug 26 10:30:01 2012 (r239711) @@ -1,39 +1,39 @@ # $FreeBSD$ -CLANG_SRCS=${LLVM_SRCS}/tools/clang +CLANG_SRCS= ${LLVM_SRCS}/tools/clang -CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ - -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ - -I${LLVM_SRCS}/../../lib/clang/include \ - -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ - -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG +CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ + -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ + -I${LLVM_SRCS}/../../lib/clang/include \ + -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG # Correct for gcc miscompilation when compiling on PPC with -O2 .if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -O1 -mminimal-toc +CFLAGS+= -O1 -mminimal-toc .endif TARGET_ARCH?= ${MACHINE_ARCH} CFLAGS+=-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd9.0\" .ifndef LLVM_REQUIRES_EH -CXXFLAGS+=-fno-exceptions +CXXFLAGS+= -fno-exceptions .else # If the library or program requires EH, it also requires RTTI. LLVM_REQUIRES_RTTI= .endif .ifndef LLVM_REQUIRES_RTTI -CXXFLAGS+=-fno-rtti +CXXFLAGS+= -fno-rtti .endif -CFLAGS+=-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" +CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" .PATH: ${LLVM_SRCS}/${SRCDIR} -TBLGEN?=tblgen -CLANG_TBLGEN?=clang-tblgen -TBLINC+=-I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target +TBLGEN?= tblgen +CLANG_TBLGEN?= clang-tblgen +TBLINC+= -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td ${TBLGEN} -I ${LLVM_SRCS}/lib/VMCore ${TBLINC} -gen-intrinsic \ Modified: stable/9/lib/clang/clang.lib.mk ============================================================================== --- stable/9/lib/clang/clang.lib.mk Sun Aug 26 09:54:11 2012 (r239710) +++ stable/9/lib/clang/clang.lib.mk Sun Aug 26 10:30:01 2012 (r239711) @@ -1,6 +1,6 @@ # $FreeBSD$ -LLVM_SRCS=${.CURDIR}/../../../contrib/llvm +LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm .include "clang.build.mk" Modified: stable/9/usr.bin/clang/clang.prog.mk ============================================================================== --- stable/9/usr.bin/clang/clang.prog.mk Sun Aug 26 09:54:11 2012 (r239710) +++ stable/9/usr.bin/clang/clang.prog.mk Sun Aug 26 10:30:01 2012 (r239711) @@ -1,14 +1,14 @@ # $FreeBSD$ -LLVM_SRCS=${.CURDIR}/../../../contrib/llvm +LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm .include "../../lib/clang/clang.build.mk" .for lib in ${LIBDEPS} -DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a +LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a .endfor -BINDIR?=/usr/bin +BINDIR?= /usr/bin .include From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 10:38:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D7DA106566C; Sun, 26 Aug 2012 10:38:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 788F88FC0A; Sun, 26 Aug 2012 10:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QAc3nD008201; Sun, 26 Aug 2012 10:38:03 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QAc3I7008199; Sun, 26 Aug 2012 10:38:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208261038.q7QAc3I7008199@svn.freebsd.org> From: Robert Watson Date: Sun, 26 Aug 2012 10:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239712 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 10:38:03 -0000 Author: rwatson Date: Sun Aug 26 10:38:02 2012 New Revision: 239712 URL: http://svn.freebsd.org/changeset/base/239712 Log: Add a altera_sdcardc(4) man page link for altera_sdcard(4), as that is the name that will appear in dmesg. Sponsored by: DARPA, AFRL Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Aug 26 10:30:01 2012 (r239711) +++ head/share/man/man4/Makefile Sun Aug 26 10:38:02 2012 (r239712) @@ -558,6 +558,7 @@ MLINKS+=age.4 if_age.4 MLINKS+=agp.4 agpgart.4 MLINKS+=alc.4 if_alc.4 MLINKS+=ale.4 if_ale.4 +MLINKS+=altera_sdcard.4 altera_sdcardc.4 MLINKS+=altq.4 ALTQ.4 MLINKS+=ath.4 if_ath.4 MLINKS+=ath_pci.4 if_ath_pci.4 From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 10:40:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81781106564A; Sun, 26 Aug 2012 10:40:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6F38FC0C; Sun, 26 Aug 2012 10:40:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QAeEup008489; Sun, 26 Aug 2012 10:40:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QAeERP008487; Sun, 26 Aug 2012 10:40:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208261040.q7QAeERP008487@svn.freebsd.org> From: Robert Watson Date: Sun, 26 Aug 2012 10:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239713 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 10:40:14 -0000 Author: rwatson Date: Sun Aug 26 10:40:13 2012 New Revision: 239713 URL: http://svn.freebsd.org/changeset/base/239713 Log: Expose DE4 buttons and switches via a de4bsw device, implemented using altera_avgen(4). Fix white space nit that must have arisen during the merge from Perforce. Submitted by: brooks Sponsored by: DARPA, AFRL Modified: head/sys/mips/conf/BERI_DE4.hints Modified: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 10:38:02 2012 (r239712) +++ head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 10:40:13 2012 (r239713) @@ -66,6 +66,16 @@ hint.altera_avgen.0.devname="berirom" #hint.altera_avgen.0.devname="de4flash" # +# Expose the DE4 buttons and switches via an Avalon "generic" device. +# +hint.altera_avgen.0.at="nexus0" +hint.altera_avgen.0.maddr=0x7f009000 +hint.altera_avgen.0.msize=2 +hint.altera_avgen.0.width=1 +hint.altera_avgen.0.fileio="r" +hint.altera_avgen.0.devname="de4bsw" + +# # General Intel StrataFlash driver # hint.isf.0.at="nexus0" @@ -73,7 +83,7 @@ hint.isf.0.maddr=0x74000000 hint.isf.0.msize=0x2000000 hint.isf.1.at="nexus0" hint.isf.1.maddr=0x76000000 -hint.isf.1.msize=0x2000000 +hint.isf.1.msize=0x2000000 # Reserved configuration blocks. Don't touch. hint.map.0.at="isf0" From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 12:07:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B76A106564A; Sun, 26 Aug 2012 12:07:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 266388FC0C; Sun, 26 Aug 2012 12:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QC7O43019562; Sun, 26 Aug 2012 12:07:24 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QC7NtI019560; Sun, 26 Aug 2012 12:07:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208261207.q7QC7NtI019560@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 26 Aug 2012 12:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239714 - stable/9/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 12:07:24 -0000 Author: pluknet Date: Sun Aug 26 12:07:23 2012 New Revision: 239714 URL: http://svn.freebsd.org/changeset/base/239714 Log: MFC r239468: Avoid segfault in the 'smpphylist' subcommand. Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Sun Aug 26 10:40:13 2012 (r239713) +++ stable/9/sbin/camcontrol/camcontrol.c Sun Aug 26 12:07:23 2012 (r239714) @@ -5458,6 +5458,7 @@ smpphylist(struct cam_device *device, in bzero(&(&ccb->ccb_h)[1], sizeof(union ccb) - sizeof(struct ccb_hdr)); + STAILQ_INIT(&devlist.dev_queue); rgrequest = malloc(sizeof(*rgrequest)); if (rgrequest == NULL) { @@ -5526,7 +5527,6 @@ smpphylist(struct cam_device *device, in goto bailout; } - STAILQ_INIT(&devlist.dev_queue); devlist.path_id = device->path_id; retval = buildbusdevlist(&devlist); From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 14:30:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39432106564A; Sun, 26 Aug 2012 14:30:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A11A8FC0A; Sun, 26 Aug 2012 14:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QEUE1X035678; Sun, 26 Aug 2012 14:30:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QEUEja035676; Sun, 26 Aug 2012 14:30:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208261430.q7QEUEja035676@svn.freebsd.org> From: Dimitry Andric Date: Sun, 26 Aug 2012 14:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239715 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 14:30:15 -0000 Author: dim Date: Sun Aug 26 14:30:14 2012 New Revision: 239715 URL: http://svn.freebsd.org/changeset/base/239715 Log: Add libc++ and libcxxrt related files to OptionalObsoleteFiles.inc. MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Aug 26 12:07:23 2012 (r239714) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Aug 26 14:30:14 2012 (r239715) @@ -3256,6 +3256,121 @@ OLD_FILES+=usr/share/man/man8/verify_krb # to be filled in #.endif +.if ${MK_LIBCPLUSPLUS} == no +OLD_LIBS+=lib/libcxxrt.so.1 +OLD_FILES+=usr/lib/libc++.a +OLD_FILES+=usr/lib/libc++_p.a +OLD_FILES+=usr/lib/libc++.so +OLD_LIBS+=usr/lib/libc++.so.1 +OLD_FILES+=usr/lib/libcxxrt.a +OLD_FILES+=usr/lib/libcxxrt.so +OLD_FILES+=usr/lib/libcxxrt_p.a +OLD_FILES+=usr/include/c++/v1/__bit_reference +OLD_FILES+=usr/include/c++/v1/__config +OLD_FILES+=usr/include/c++/v1/__debug +OLD_FILES+=usr/include/c++/v1/__functional_03 +OLD_FILES+=usr/include/c++/v1/__functional_base +OLD_FILES+=usr/include/c++/v1/__functional_base_03 +OLD_FILES+=usr/include/c++/v1/__hash_table +OLD_FILES+=usr/include/c++/v1/__locale +OLD_FILES+=usr/include/c++/v1/__mutex_base +OLD_FILES+=usr/include/c++/v1/__split_buffer +OLD_FILES+=usr/include/c++/v1/__sso_allocator +OLD_FILES+=usr/include/c++/v1/__std_stream +OLD_FILES+=usr/include/c++/v1/__tree +OLD_FILES+=usr/include/c++/v1/__tuple +OLD_FILES+=usr/include/c++/v1/__tuple_03 +OLD_FILES+=usr/include/c++/v1/__undef_min_max +OLD_FILES+=usr/include/c++/v1/algorithm +OLD_FILES+=usr/include/c++/v1/array +OLD_FILES+=usr/include/c++/v1/atomic +OLD_FILES+=usr/include/c++/v1/bitset +OLD_FILES+=usr/include/c++/v1/cassert +OLD_FILES+=usr/include/c++/v1/ccomplex +OLD_FILES+=usr/include/c++/v1/cctype +OLD_FILES+=usr/include/c++/v1/cerrno +OLD_FILES+=usr/include/c++/v1/cfenv +OLD_FILES+=usr/include/c++/v1/cfloat +OLD_FILES+=usr/include/c++/v1/chrono +OLD_FILES+=usr/include/c++/v1/cinttypes +OLD_FILES+=usr/include/c++/v1/ciso646 +OLD_FILES+=usr/include/c++/v1/climits +OLD_FILES+=usr/include/c++/v1/clocale +OLD_FILES+=usr/include/c++/v1/cmath +OLD_FILES+=usr/include/c++/v1/codecvt +OLD_FILES+=usr/include/c++/v1/complex +OLD_FILES+=usr/include/c++/v1/complex.h +OLD_FILES+=usr/include/c++/v1/condition_variable +OLD_FILES+=usr/include/c++/v1/csetjmp +OLD_FILES+=usr/include/c++/v1/csignal +OLD_FILES+=usr/include/c++/v1/cstdarg +OLD_FILES+=usr/include/c++/v1/cstdbool +OLD_FILES+=usr/include/c++/v1/cstddef +OLD_FILES+=usr/include/c++/v1/cstdint +OLD_FILES+=usr/include/c++/v1/cstdio +OLD_FILES+=usr/include/c++/v1/cstdlib +OLD_FILES+=usr/include/c++/v1/cstring +OLD_FILES+=usr/include/c++/v1/ctgmath +OLD_FILES+=usr/include/c++/v1/ctime +OLD_FILES+=usr/include/c++/v1/cwchar +OLD_FILES+=usr/include/c++/v1/cwctype +OLD_FILES+=usr/include/c++/v1/cxxabi.h +OLD_FILES+=usr/include/c++/v1/deque +OLD_FILES+=usr/include/c++/v1/exception +OLD_FILES+=usr/include/c++/v1/ext/__hash +OLD_FILES+=usr/include/c++/v1/ext/hash_map +OLD_FILES+=usr/include/c++/v1/ext/hash_set +OLD_FILES+=usr/include/c++/v1/forward_list +OLD_FILES+=usr/include/c++/v1/fstream +OLD_FILES+=usr/include/c++/v1/functional +OLD_FILES+=usr/include/c++/v1/future +OLD_FILES+=usr/include/c++/v1/initializer_list +OLD_FILES+=usr/include/c++/v1/iomanip +OLD_FILES+=usr/include/c++/v1/ios +OLD_FILES+=usr/include/c++/v1/iosfwd +OLD_FILES+=usr/include/c++/v1/iostream +OLD_FILES+=usr/include/c++/v1/istream +OLD_FILES+=usr/include/c++/v1/iterator +OLD_FILES+=usr/include/c++/v1/limits +OLD_FILES+=usr/include/c++/v1/list +OLD_FILES+=usr/include/c++/v1/locale +OLD_FILES+=usr/include/c++/v1/map +OLD_FILES+=usr/include/c++/v1/memory +OLD_FILES+=usr/include/c++/v1/mutex +OLD_FILES+=usr/include/c++/v1/new +OLD_FILES+=usr/include/c++/v1/numeric +OLD_FILES+=usr/include/c++/v1/ostream +OLD_FILES+=usr/include/c++/v1/queue +OLD_FILES+=usr/include/c++/v1/random +OLD_FILES+=usr/include/c++/v1/ratio +OLD_FILES+=usr/include/c++/v1/regex +OLD_FILES+=usr/include/c++/v1/scoped_allocator +OLD_FILES+=usr/include/c++/v1/set +OLD_FILES+=usr/include/c++/v1/sstream +OLD_FILES+=usr/include/c++/v1/stack +OLD_FILES+=usr/include/c++/v1/stdexcept +OLD_FILES+=usr/include/c++/v1/streambuf +OLD_FILES+=usr/include/c++/v1/string +OLD_FILES+=usr/include/c++/v1/strstream +OLD_FILES+=usr/include/c++/v1/system_error +OLD_FILES+=usr/include/c++/v1/tgmath.h +OLD_FILES+=usr/include/c++/v1/thread +OLD_FILES+=usr/include/c++/v1/tuple +OLD_FILES+=usr/include/c++/v1/type_traits +OLD_FILES+=usr/include/c++/v1/typeindex +OLD_FILES+=usr/include/c++/v1/typeinfo +OLD_FILES+=usr/include/c++/v1/unordered_map +OLD_FILES+=usr/include/c++/v1/unordered_set +OLD_FILES+=usr/include/c++/v1/unwind-arm.h +OLD_FILES+=usr/include/c++/v1/unwind-itanium.h +OLD_FILES+=usr/include/c++/v1/unwind.h +OLD_FILES+=usr/include/c++/v1/utility +OLD_FILES+=usr/include/c++/v1/valarray +OLD_FILES+=usr/include/c++/v1/vector +OLD_DIRS+=usr/include/c++/v1/ext +OLD_DIRS+=usr/include/c++/v1 +.endif + #.if ${MK_LIBTHR} == no # to be filled in #.endif From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 20:22:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C9A1065670; Sun, 26 Aug 2012 20:22:44 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84EF38FC08; Sun, 26 Aug 2012 20:22:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QKMiiF077982; Sun, 26 Aug 2012 20:22:44 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QKMiCI077979; Sun, 26 Aug 2012 20:22:44 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201208262022.q7QKMiCI077979@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 26 Aug 2012 20:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239716 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 20:22:44 -0000 Author: ray Date: Sun Aug 26 20:22:43 2012 New Revision: 239716 URL: http://svn.freebsd.org/changeset/base/239716 Log: Move AR71XX (MIPS SoCs family) options to options.mips file. PR: 170859 Submitted by: Luiz Otavio O Souza Approved by: adrian (mentor) Modified: head/sys/conf/options head/sys/conf/options.mips Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Aug 26 14:30:14 2012 (r239715) +++ head/sys/conf/options Sun Aug 26 20:22:43 2012 (r239716) @@ -906,11 +906,3 @@ RACCT opt_global.h # Resource Limits RCTL opt_global.h - -# At least one of the AR71XX ubiquiti boards has a Redboot configuration -# that "lies" about the amount of RAM it has. Until a cleaner method is -# defined, this option will suffice in overriding what Redboot says. -AR71XX_REALMEM opt_ar71xx.h -AR71XX_ENV_UBOOT opt_ar71xx.h -AR71XX_ENV_REDBOOT opt_ar71xx.h -AR71XX_ATH_EEPROM opt_ar71xx.h Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sun Aug 26 14:30:14 2012 (r239715) +++ head/sys/conf/options.mips Sun Aug 26 20:22:43 2012 (r239716) @@ -74,6 +74,16 @@ ARGE_DEBUG opt_arge.h ARGE_MDIO opt_arge.h # +# At least one of the AR71XX ubiquiti boards has a Redboot configuration +# that "lies" about the amount of RAM it has. Until a cleaner method is +# defined, this option will suffice in overriding what Redboot says. +# +AR71XX_REALMEM opt_ar71xx.h +AR71XX_ENV_UBOOT opt_ar71xx.h +AR71XX_ENV_REDBOOT opt_ar71xx.h +AR71XX_ATH_EEPROM opt_ar71xx.h + +# # Options that control the Ralink RT305xF Etherenet MAC. # IF_RT_DEBUG opt_if_rt.h From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 02:56:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F714106564A; Mon, 27 Aug 2012 02:56:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A79F8FC0C; Mon, 27 Aug 2012 02:56:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7R2uw19028054; Mon, 27 Aug 2012 02:56:58 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R2uwqI028050; Mon, 27 Aug 2012 02:56:58 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208270256.q7R2uwqI028050@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 27 Aug 2012 02:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239717 - stable/9/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 02:56:58 -0000 Author: pfg Date: Mon Aug 27 02:56:58 2012 New Revision: 239717 URL: http://svn.freebsd.org/changeset/base/239717 Log: MFC r239636: Add some basic definitions for a future htree implementation. Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Sun Aug 26 20:22:43 2012 (r239716) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Mon Aug 27 02:56:58 2012 (r239717) @@ -57,10 +57,12 @@ #define EXT2_COMPR 0x00000004 /* Compress file */ #define EXT2_SYNC 0x00000008 /* Synchronous updates */ #define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ -#define EXT2_APPEND 0x00000020 /* writes to file may only append */ +#define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ +#define EXT2_HTREE 0x00001000 /* HTree-indexed directory */ + /* * Definitions for nanosecond timestamps. * Ext3 inode versioning, 2006-12-13. Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sun Aug 26 20:22:43 2012 (r239716) +++ stable/9/sys/fs/ext2fs/ext2fs.h Mon Aug 27 02:56:58 2012 (r239717) @@ -210,6 +210,7 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_HTREE 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 03:09:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8607F1065670; Mon, 27 Aug 2012 03:09:40 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 706588FC1D; Mon, 27 Aug 2012 03:09:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7R39eDK029703; Mon, 27 Aug 2012 03:09:40 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R39erT029697; Mon, 27 Aug 2012 03:09:40 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208270309.q7R39erT029697@svn.freebsd.org> From: David Xu Date: Mon, 27 Aug 2012 03:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239718 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 03:09:40 -0000 Author: davidxu Date: Mon Aug 27 03:09:39 2012 New Revision: 239718 URL: http://svn.freebsd.org/changeset/base/239718 Log: In suspend_common(), don't wait for a thread which is in creation, because pthread_suspend_all_np() may have already suspended its parent thread. Add locking code in pthread_suspend_all_np() to only allow one thread to suspend other threads, this eliminates a deadlock where two or more threads try to suspend each others. Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_resume_np.c head/lib/libthr/thread/thr_sig.c head/lib/libthr/thread/thr_suspend_np.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_init.c Mon Aug 27 03:09:39 2012 (r239718) @@ -120,6 +120,10 @@ struct umutex _rwlock_static_lock = DEFA struct umutex _keytable_lock = DEFAULT_UMUTEX; struct urwlock _thr_list_lock = DEFAULT_URWLOCK; struct umutex _thr_event_lock = DEFAULT_UMUTEX; +struct umutex _suspend_all_lock = DEFAULT_UMUTEX; +struct pthread *_single_thread; +int _suspend_all_cycle; +int _suspend_all_waiters; int __pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); int __pthread_mutex_lock(pthread_mutex_t *); @@ -441,11 +445,14 @@ init_private(void) _thr_umutex_init(&_keytable_lock); _thr_urwlock_init(&_thr_atfork_lock); _thr_umutex_init(&_thr_event_lock); + _thr_umutex_init(&_suspend_all_lock); _thr_once_init(); _thr_spinlock_init(); _thr_list_init(); _thr_wake_addr_init(); _sleepq_init(); + _single_thread = NULL; + _suspend_all_waiters = 0; /* * Avoid reinitializing some things if they don't need to be, Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_private.h Mon Aug 27 03:09:39 2012 (r239718) @@ -721,6 +721,10 @@ extern struct umutex _rwlock_static_lock extern struct umutex _keytable_lock __hidden; extern struct urwlock _thr_list_lock __hidden; extern struct umutex _thr_event_lock __hidden; +extern struct umutex _suspend_all_lock __hidden; +extern int _suspend_all_waiters __hidden; +extern int _suspend_all_cycle __hidden; +extern struct pthread *_single_thread __hidden; /* * Function prototype definitions. @@ -777,6 +781,8 @@ int _thr_setscheduler(lwpid_t, int, cons void _thr_signal_prefork(void) __hidden; void _thr_signal_postfork(void) __hidden; void _thr_signal_postfork_child(void) __hidden; +void _thr_suspend_all_lock(struct pthread *) __hidden; +void _thr_suspend_all_unlock(struct pthread *) __hidden; void _thr_try_gc(struct pthread *, struct pthread *) __hidden; int _rtp_to_schedparam(const struct rtprio *rtp, int *policy, struct sched_param *param) __hidden; Modified: head/lib/libthr/thread/thr_resume_np.c ============================================================================== --- head/lib/libthr/thread/thr_resume_np.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_resume_np.c Mon Aug 27 03:09:39 2012 (r239718) @@ -63,7 +63,11 @@ _pthread_resume_all_np(void) { struct pthread *curthread = _get_curthread(); struct pthread *thread; + int old_nocancel; + old_nocancel = curthread->no_cancel; + curthread->no_cancel = 1; + _thr_suspend_all_lock(curthread); /* Take the thread list lock: */ THREAD_LIST_RDLOCK(curthread); @@ -77,6 +81,9 @@ _pthread_resume_all_np(void) /* Release the thread list lock: */ THREAD_LIST_UNLOCK(curthread); + _thr_suspend_all_unlock(curthread); + curthread->no_cancel = old_nocancel; + _thr_testcancel(curthread); } static void Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_sig.c Mon Aug 27 03:09:39 2012 (r239718) @@ -356,7 +356,8 @@ check_suspend(struct pthread *curthread) (THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED)) != THR_FLAGS_NEED_SUSPEND)) return; - + if (curthread == _single_thread) + return; if (curthread->force_exit) return; Modified: head/lib/libthr/thread/thr_suspend_np.c ============================================================================== --- head/lib/libthr/thread/thr_suspend_np.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_suspend_np.c Mon Aug 27 03:09:39 2012 (r239718) @@ -70,14 +70,48 @@ _pthread_suspend_np(pthread_t thread) } void +_thr_suspend_all_lock(struct pthread *curthread) +{ + int old; + + THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); + while (_single_thread != NULL) { + old = _suspend_all_cycle; + _suspend_all_waiters++; + THR_LOCK_RELEASE(curthread, &_suspend_all_lock); + _thr_umtx_wait_uint(&_suspend_all_cycle, old, NULL, 0); + THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); + _suspend_all_waiters--; + } + _single_thread = curthread; + THR_LOCK_RELEASE(curthread, &_suspend_all_lock); +} + +void +_thr_suspend_all_unlock(struct pthread *curthread) +{ + + THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); + _single_thread = NULL; + if (_suspend_all_waiters != 0) { + _suspend_all_cycle++; + _thr_umtx_wake(&_suspend_all_cycle, INT_MAX, 0); + } + THR_LOCK_RELEASE(curthread, &_suspend_all_lock); +} + +void _pthread_suspend_all_np(void) { struct pthread *curthread = _get_curthread(); struct pthread *thread; + int old_nocancel; int ret; + old_nocancel = curthread->no_cancel; + curthread->no_cancel = 1; + _thr_suspend_all_lock(curthread); THREAD_LIST_RDLOCK(curthread); - TAILQ_FOREACH(thread, &_thread_list, tle) { if (thread != curthread) { THR_THREAD_LOCK(curthread, thread); @@ -115,19 +149,24 @@ restart: THR_THREAD_UNLOCK(curthread, thread); } } - THREAD_LIST_UNLOCK(curthread); + _thr_suspend_all_unlock(curthread); + curthread->no_cancel = old_nocancel; + _thr_testcancel(curthread); } static int suspend_common(struct pthread *curthread, struct pthread *thread, int waitok) { - long tmp; + uint32_t tmp; while (thread->state != PS_DEAD && !(thread->flags & THR_FLAGS_SUSPENDED)) { thread->flags |= THR_FLAGS_NEED_SUSPEND; + /* Thread is in creation. */ + if (thread->tid == TID_TERMINATED) + return (1); tmp = thread->cycle; _thr_send_sig(thread, SIGCANCEL); THR_THREAD_UNLOCK(curthread, thread); From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 04:03:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21714106566C; Mon, 27 Aug 2012 04:03:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C1638FC15; Mon, 27 Aug 2012 04:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7R43neM035805; Mon, 27 Aug 2012 04:03:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R43nhJ035803; Mon, 27 Aug 2012 04:03:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208270403.q7R43nhJ035803@svn.freebsd.org> From: Warner Losh Date: Mon, 27 Aug 2012 04:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239719 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:03:50 -0000 Author: imp Date: Mon Aug 27 04:03:49 2012 New Revision: 239719 URL: http://svn.freebsd.org/changeset/base/239719 Log: Don't puprosely overclock the SD bus to 30MHz, make the user explicltly enable that. The driver chose to use 60MHz / 2 (30MHz) most of the time rather than 60MHz / 4 (15MHz) based on the Linux driver of the time. This pushes the spec a little in order to not suffer the penalty of running at 15MHz. However, when other bus masters are active in the system, and the user tries 4-wire mode, the internal bus arbitration would fail with data loss as a result. # Comments from PR were reworked to reflect my historical perspective PR: 155214 (partial) Submitted by: Ian Lepore Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 03:09:39 2012 (r239718) +++ head/sys/arm/at91/at91_mci.c Mon Aug 27 04:03:49 2012 (r239719) @@ -67,6 +67,53 @@ __FBSDID("$FreeBSD$"); #include "opt_at91.h" +/* + * About running the MCI bus at 30mhz... + * + * Historically, the MCI bus has been run at 30mhz on systems with a 60mhz + * master clock, due to a bug in the mantissa table in dev/mmc.c making it + * appear that the card's max speed was always 30mhz. Fixing that bug causes + * the mmc driver to request a 25mhz clock (as it should) and the logic in + * at91_mci_update_ios() picks the highest speed that doesn't exceed that limit. + * With a 60mhz MCK that would be 15mhz, and that's a real performance buzzkill + * when you've been getting away with 30mhz all along. + * + * By defining AT91_MCI_USE_30MHZ (or setting the 30mhz=1 device hint or + * sysctl) you can enable logic in at91_mci_update_ios() to overlcock the SD + * bus a little by running it at MCK / 2 when MCK is between greater than + * 50MHz and the requested speed is 25mhz. This appears to work on virtually + * all SD cards, since it is what this driver has been doing prior to the + * introduction of this option, where the overclocking vs underclocking + * decision was automaticly "overclock". Modern SD cards can run at + * 45mhz/1-bit in standard mode (high speed mode enable commands not sent) + * without problems. + * + * Speaking of high-speed mode, the rm9200 manual says the MCI device supports + * the SD v1.0 specification and can run up to 50mhz. This is interesting in + * that the SD v1.0 spec caps the speed at 25mhz; high speed mode was added in + * the v1.10 spec. Furthermore, high speed mode doesn't just crank up the + * clock, it alters the signal timing. The rm9200 MCI device doesn't support + * these altered timings. So while speeds over 25mhz may work, they only work + * in what the SD spec calls "default" speed mode, and it amounts to violating + * the spec by overclocking the bus. + * + * If you also enable 4-wire mode it's possible the 30mhz transfers will fail. + * On the AT91RM9200, due to bugs in the bus contention logic, if you have the + * USB host device and OHCI driver enabled will fail. Even underclocking to + * 15MHz, intermittant overrun and underrun errors occur. Note that you don't + * even need to have usb devices attached to the system, the errors begin to + * occur as soon as the OHCI driver sets the register bit to enable periodic + * transfers. It appears (based on brief investigation) that the usb host + * controller uses so much ASB bandwidth that sometimes the DMA for MCI + * transfers doesn't get a bus grant in time and data gets dropped. Adding + * even a modicum of network activity changes the symptom from intermittant to + * very frequent. Members of the AT91SAM9 family have corrected this problem, or + * are at least better about their use of the bus. + */ +#ifndef AT91_MCI_USE_30MHZ +#define AT91_MCI_USE_30MHZ 1 +#endif + #define BBSZ 512 struct at91_mci_softc { @@ -76,9 +123,10 @@ struct at91_mci_softc { #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ #define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ int flags; - int has_4wire; #define CMD_STARTED 1 #define STOP_STARTED 2 + int has_4wire; + int use_30mhz; struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; @@ -236,16 +284,33 @@ at91_mci_attach(device_t dev) if (sc->has_4wire) sc->sc_cap |= CAP_HAS_4WIRE; - sc->host.f_min = at91_master_clock / 512; +#if defined(AT91_MCI_USE_30MHZ) && AT91_MCI_USE_30MHZ != 0 + sc->use_30mhz = 1; +#endif + resource_int_value(device_get_name(dev), device_get_unit(dev), + "30mhz", &sc->use_30mhz); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "30mhz", + CTLFLAG_RW, &sc->use_30mhz, 0, "use 30mhz clock for 25mhz request"); + + /* Our real min freq is master_clock/512, but upper driver layers are + * going to set the min speed during card discovery, and the right speed + * for that is 400khz, so advertise a safe value just under that. + * + * For max speed, while the rm9200 manual says the max is 50mhz, it also + * says it supports only the SD v1.0 spec, which means the real limit is + * 25mhz. On the other hand, historical use has been to slightly violate + * the standard by running the bus at 30mhz. For more information on + * that, see the comments at the top of this file. + */ sc->host.f_min = 375000; sc->host.f_max = at91_master_clock / 2; - if (sc->host.f_max > 50000000) - sc->host.f_max = 50000000; /* Limit to 50MHz */ - + if (sc->host.f_max > 25000000) + sc->host.f_max = 25000000; /* Limit to 25MHz */ sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = 0; if (sc->sc_cap & CAP_HAS_4WIRE) sc->host.caps |= MMC_CAP_4_BIT_DATA; + child = device_add_child(dev, "mmc", 0); device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); @@ -338,23 +403,38 @@ static int at91_mci_update_ios(device_t brdev, device_t reqdev) { struct at91_mci_softc *sc; - struct mmc_host *host; struct mmc_ios *ios; uint32_t clkdiv; sc = device_get_softc(brdev); - host = &sc->host; - ios = &host->ios; - // bus mode? + ios = &sc->host.ios; + + /* + * Calculate our closest available clock speed that doesn't exceed the + * requested speed. + * + * If the master clock is greater than 50MHz and the requested bus + * speed is 25mhz and the use_30mhz flag is on, set clkdiv to zero to + * get a master_clock / 2 (25-30MHz) MMC/SD clock rather than settle for + * the next lower click (12-15MHz). See comments near the top of the + * file for more info. + * + * Whatever we come up with, store it back into ios->clock so that the + * upper layer drivers can report the actual speed of the bus. + */ if (ios->clock == 0) { WR4(sc, MCI_CR, MCI_CR_MCIDIS); clkdiv = 0; } else { - WR4(sc, MCI_CR, MCI_CR_MCIEN); - if ((at91_master_clock % (ios->clock * 2)) == 0) + WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); + if (sc->use_30mhz && ios->clock == 25000000 && + at91_master_clock > 50000000) + clkdiv = 0; + else if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; else clkdiv = (at91_master_clock / ios->clock) / 2; + ios->clock = at91_master_clock / ((clkdiv+1) * 2); } if (ios->bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 04:08:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C51DA106566B; Mon, 27 Aug 2012 04:08:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B08B28FC08; Mon, 27 Aug 2012 04:08:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7R48iOY036390; Mon, 27 Aug 2012 04:08:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R48iiO036387; Mon, 27 Aug 2012 04:08:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208270408.q7R48iiO036387@svn.freebsd.org> From: Warner Losh Date: Mon, 27 Aug 2012 04:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239720 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:08:44 -0000 Author: imp Date: Mon Aug 27 04:08:43 2012 New Revision: 239720 URL: http://svn.freebsd.org/changeset/base/239720 Log: Minor style(9) nit. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 04:03:49 2012 (r239719) +++ head/sys/arm/at91/at91_mci.c Mon Aug 27 04:08:43 2012 (r239720) @@ -292,7 +292,8 @@ at91_mci_attach(device_t dev) SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "30mhz", CTLFLAG_RW, &sc->use_30mhz, 0, "use 30mhz clock for 25mhz request"); - /* Our real min freq is master_clock/512, but upper driver layers are + /* + * Our real min freq is master_clock/512, but upper driver layers are * going to set the min speed during card discovery, and the right speed * for that is 400khz, so advertise a safe value just under that. * From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 04:30:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA194106566C; Mon, 27 Aug 2012 04:30:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94A978FC08; Mon, 27 Aug 2012 04:30:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7R4Urvj038885; Mon, 27 Aug 2012 04:30:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R4Urrt038883; Mon, 27 Aug 2012 04:30:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208270430.q7R4Urrt038883@svn.freebsd.org> From: Warner Losh Date: Mon, 27 Aug 2012 04:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239721 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:30:53 -0000 Author: imp Date: Mon Aug 27 04:30:53 2012 New Revision: 239721 URL: http://svn.freebsd.org/changeset/base/239721 Log: Add hint and sysctl support for 4 wire mode. PR: 155241 Submitted by: Ian Lapore Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 04:08:43 2012 (r239720) +++ head/sys/arm/at91/at91_mci.c Mon Aug 27 04:30:53 2012 (r239721) @@ -236,8 +236,10 @@ at91_mci_attach(device_t dev) device_t child; int err; - sc->dev = dev; + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); + sc->dev = dev; sc->sc_cap = 0; if (at91_is_rm92()) sc->sc_cap |= CAP_NEEDS_BYTESWAP; @@ -273,14 +275,18 @@ at91_mci_attach(device_t dev) goto out; } - sctx = device_get_sysctl_ctx(dev); - soid = device_get_sysctl_tree(dev); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", - CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); - -#ifdef AT91_MCI_HAS_4WIRE + /* + * Allow 4-wire to be initially set via #define. + * Allow a device hint to override that. + * Allow a sysctl to override that. + */ +#if defined(AT91_MCI_HAS_4WIRE) && AT91_MCI_HAS_4WIRE != 0 sc->has_4wire = 1; #endif + resource_int_value(device_get_name(dev), device_get_unit(dev), + "4wire", &sc->has_4wire); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", + CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); if (sc->has_4wire) sc->sc_cap |= CAP_HAS_4WIRE; From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 04:43:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 666E8106566B; Mon, 27 Aug 2012 04:43:31 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50FAD8FC17; Mon, 27 Aug 2012 04:43:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7R4hVGj040322; Mon, 27 Aug 2012 04:43:31 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R4hVoL040319; Mon, 27 Aug 2012 04:43:31 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201208270443.q7R4hVoL040319@svn.freebsd.org> From: Tim Kientzle Date: Mon, 27 Aug 2012 04:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239722 - head/sys/arm/ti/cpsw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:43:31 -0000 Author: kientzle Date: Mon Aug 27 04:43:30 2012 New Revision: 239722 URL: http://svn.freebsd.org/changeset/base/239722 Log: Correctly fetch the MAC address. Break down the bytes directly into the softc; the intermediate buffer isn't needed here. Break down the bytes in the correct order. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Aug 27 04:30:53 2012 (r239721) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Aug 27 04:43:30 2012 (r239722) @@ -216,13 +216,11 @@ cpsw_attach(device_t dev) struct cpsw_softc *sc; struct mii_softc *miisc; struct ifnet *ifp; - uint8_t mac_addr[ETHER_ADDR_LEN]; int i, error, phy; uint32_t reg; sc = device_get_softc(dev); sc->dev = dev; - memcpy(sc->mac_addr, mac_addr, ETHER_ADDR_LEN); sc->node = ofw_bus_get_node(dev); /* Get phy address from fdt */ @@ -279,17 +277,17 @@ cpsw_attach(device_t dev) IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - /* Get low part of MAC address from control module (mac_id0_lo) */ - ti_scm_reg_read_4(0x630, ®); - mac_addr[0] = (reg >> 8) & 0xFF; - mac_addr[1] = reg & 0xFF; - /* Get high part of MAC address from control module (mac_id0_hi) */ ti_scm_reg_read_4(0x634, ®); - mac_addr[2] = (reg >> 24) & 0xFF; - mac_addr[3] = (reg >> 16) & 0xFF; - mac_addr[4] = (reg >> 8) & 0xFF; - mac_addr[5] = reg & 0xFF; + sc->mac_addr[0] = reg & 0xFF; + sc->mac_addr[1] = (reg >> 8) & 0xFF; + sc->mac_addr[2] = (reg >> 16) & 0xFF; + sc->mac_addr[3] = (reg >> 24) & 0xFF; + + /* Get low part of MAC address from control module (mac_id0_lo) */ + ti_scm_reg_read_4(0x630, ®); + sc->mac_addr[4] = reg & 0xFF; + sc->mac_addr[5] = (reg >> 8) & 0xFF; ether_ifattach(ifp, sc->mac_addr); callout_init(&sc->wd_callout, 0); From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 07:52:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABEE3106564A; Mon, 27 Aug 2012 07:52:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 6EA7E8FC16; Mon, 27 Aug 2012 07:52:08 +0000 (UTC) Received: from localhost (dlk19.neoplus.adsl.tpnet.pl [83.24.40.19]) by mail.dawidek.net (Postfix) with ESMTPSA id D1C46E2E; Mon, 27 Aug 2012 09:51:26 +0200 (CEST) Date: Mon, 27 Aug 2012 09:51:59 +0200 From: Pawel Jakub Dawidek To: David Schultz Message-ID: <20120827075158.GA1370@garage.freebsd.pl> References: <201110210635.p9L6Zw2o010312@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <201110210635.p9L6Zw2o010312@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226604 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 07:52:09 -0000 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2011 at 06:35:58AM +0000, David Schultz wrote: > Author: das > Date: Fri Oct 21 06:35:58 2011 > New Revision: 226604 > URL: http://svn.freebsd.org/changeset/base/226604 >=20 > Log: > Add support for the 'x' mode option in fopen() as specified in the C1X > draft standard. The option is equivalent to O_EXCL. Apart from adding the 'x' mode option this change heavly modifies manual page. For example you removed information that the 'w' option truncates the file to zero length. I had to look at the code to figure it out. Why those changes to manual page were made? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlA7Jx4ACgkQForvXbEpPzT7WACdHog/uZ2RSR9qs5Mvt/QACaoh B8gAn1/R6PmOVvKyylyu51Gtus5eO53T =8hlH -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 10:59:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8BA0106564A; Mon, 27 Aug 2012 10:59:49 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C46E58FC1F; Mon, 27 Aug 2012 10:59:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RAxndn085269; Mon, 27 Aug 2012 10:59:49 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RAxnK7085267; Mon, 27 Aug 2012 10:59:49 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208271059.q7RAxnK7085267@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 27 Aug 2012 10:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239723 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 10:59:49 -0000 Author: pluknet Date: Mon Aug 27 10:59:49 2012 New Revision: 239723 URL: http://svn.freebsd.org/changeset/base/239723 Log: Typo in previous change: print half the theoretical maximum as maximum recommended amount. Reported by: Reviewed by: des Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Aug 27 04:43:30 2012 (r239722) +++ head/sys/vm/swap_pager.c Mon Aug 27 10:59:49 2012 (r239723) @@ -2135,7 +2135,7 @@ swapon_check_swzone(unsigned long npages if (npages > maxpages / 2) { printf("warning: total configured swap (%lu pages) " "exceeds maximum recommended amount (%lu pages).\n", - npages, maxpages); + npages, maxpages / 2); printf("warning: increase kern.maxswzone " "or reduce amount of swap.\n"); return (-1); From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 12:40:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6ED106566C; Mon, 27 Aug 2012 12:40:41 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D1BF8FC15; Mon, 27 Aug 2012 12:40:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RCef8F097368; Mon, 27 Aug 2012 12:40:41 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RCefJT097356; Mon, 27 Aug 2012 12:40:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271240.q7RCefJT097356@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 12:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239725 - in stable/9: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 12:40:41 -0000 Author: gavin Date: Mon Aug 27 12:40:40 2012 New Revision: 239725 URL: http://svn.freebsd.org/changeset/base/239725 Log: Merge r238766, r238774 from head: Update the list of devices supported by uplcom. Although this only adds one device (support for Motorola cables), this syncronises us with: OpenBSD src/sys/dev/usb/uplcom.c 1.56 NetBSD src/sys/dev/usb/uplcom.c 1.73 Linux kernel.org HEAD Modified: stable/9/share/man/man4/uplcom.4 stable/9/sys/dev/usb/serial/uplcom.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/uplcom.4 ============================================================================== --- stable/9/share/man/man4/uplcom.4 Mon Aug 27 11:59:04 2012 (r239724) +++ stable/9/share/man/man4/uplcom.4 Mon Aug 27 12:40:40 2012 (r239725) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2011 +.Dd July 25, 2012 .Dt UPLCOM 4 .Os .Sh NAME @@ -116,6 +116,8 @@ Microsoft Palm 700WX .It Mobile Action MA-620 Infrared Adapter .It +Motorola Cables +.It Nokia CA-42 Cable .It OTI DKU-5 cable Modified: stable/9/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uplcom.c Mon Aug 27 11:59:04 2012 (r239724) +++ stable/9/sys/dev/usb/serial/uplcom.c Mon Aug 27 12:40:40 2012 (r239725) @@ -279,6 +279,7 @@ static const STRUCT_USB_HOST_ID uplcom_d UPLCOM_DEV(PROLIFIC, DCU11), /* DCU-11 Phone Cable */ UPLCOM_DEV(PROLIFIC, HCR331), /* HCR331 Card Reader */ UPLCOM_DEV(PROLIFIC, MICROMAX_610U), /* Micromax 610U modem */ + UPLCOM_DEV(PROLIFIC, MOTOROLA), /* Motorola cable */ UPLCOM_DEV(PROLIFIC, PHAROS), /* Prolific Pharos */ UPLCOM_DEV(PROLIFIC, PL2303), /* Generic adapter */ UPLCOM_DEV(PROLIFIC, RSAQ2), /* I/O DATA USB-RSAQ2 */ Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Aug 27 11:59:04 2012 (r239724) +++ stable/9/sys/dev/usb/usbdevs Mon Aug 27 12:40:40 2012 (r239725) @@ -2646,6 +2646,7 @@ product PRIMAX HP_RH304AA 0x4d17 HP RH30 /* Prolific products */ product PROLIFIC PL2301 0x0000 PL2301 Host-Host interface product PROLIFIC PL2302 0x0001 PL2302 Host-Host interface +product PROLIFIC MOTOROLA 0x0307 Motorola Cable product PROLIFIC RSAQ2 0x04bb PL2303 Serial (IODATA USB-RSAQ2) product PROLIFIC ALLTRONIX_GPRS 0x0609 Alltronix ACM003U00 modem product PROLIFIC ALDIGA_AL11U 0x0611 AlDiga AL-11U modem From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 12:45:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1A0106564A; Mon, 27 Aug 2012 12:45:42 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DAA18FC12; Mon, 27 Aug 2012 12:45:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RCjgRT098075; Mon, 27 Aug 2012 12:45:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RCjfoU098071; Mon, 27 Aug 2012 12:45:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271245.q7RCjfoU098071@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 12:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239726 - in stable/8: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 12:45:42 -0000 Author: gavin Date: Mon Aug 27 12:45:41 2012 New Revision: 239726 URL: http://svn.freebsd.org/changeset/base/239726 Log: Merge r238766, r238774 from head: Update the list of devices supported by uplcom. Although this only adds one device (support for Motorola cables), this syncronises us with: OpenBSD src/sys/dev/usb/uplcom.c 1.56 NetBSD src/sys/dev/usb/uplcom.c 1.73 Linux kernel.org HEAD Modified: stable/8/share/man/man4/uplcom.4 stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/share/man/man4/uplcom.4 ============================================================================== --- stable/8/share/man/man4/uplcom.4 Mon Aug 27 12:40:40 2012 (r239725) +++ stable/8/share/man/man4/uplcom.4 Mon Aug 27 12:45:41 2012 (r239726) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2011 +.Dd July 25, 2012 .Dt UPLCOM 4 .Os .Sh NAME @@ -124,6 +124,8 @@ Microsoft Palm 700WX .It Mobile Action MA-620 Infrared Adapter .It +Motorola Cables +.It Nokia CA-42 Cable .It OTI DKU-5 cable Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Mon Aug 27 12:40:40 2012 (r239725) +++ stable/8/sys/dev/usb/serial/uplcom.c Mon Aug 27 12:45:41 2012 (r239726) @@ -279,6 +279,7 @@ static const STRUCT_USB_HOST_ID uplcom_d UPLCOM_DEV(PROLIFIC, DCU11), /* DCU-11 Phone Cable */ UPLCOM_DEV(PROLIFIC, HCR331), /* HCR331 Card Reader */ UPLCOM_DEV(PROLIFIC, MICROMAX_610U), /* Micromax 610U modem */ + UPLCOM_DEV(PROLIFIC, MOTOROLA), /* Motorola cable */ UPLCOM_DEV(PROLIFIC, PHAROS), /* Prolific Pharos */ UPLCOM_DEV(PROLIFIC, PL2303), /* Generic adapter */ UPLCOM_DEV(PROLIFIC, RSAQ2), /* I/O DATA USB-RSAQ2 */ Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Aug 27 12:40:40 2012 (r239725) +++ stable/8/sys/dev/usb/usbdevs Mon Aug 27 12:45:41 2012 (r239726) @@ -2634,6 +2634,7 @@ product PRIMAX HP_RH304AA 0x4d17 HP RH30 /* Prolific products */ product PROLIFIC PL2301 0x0000 PL2301 Host-Host interface product PROLIFIC PL2302 0x0001 PL2302 Host-Host interface +product PROLIFIC MOTOROLA 0x0307 Motorola Cable product PROLIFIC RSAQ2 0x04bb PL2303 Serial (IODATA USB-RSAQ2) product PROLIFIC ALLTRONIX_GPRS 0x0609 Alltronix ACM003U00 modem product PROLIFIC ALDIGA_AL11U 0x0611 AlDiga AL-11U modem From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 12:58:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34941106564A; Mon, 27 Aug 2012 12:58:55 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECDEC8FC1A; Mon, 27 Aug 2012 12:58:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RCwst4099775; Mon, 27 Aug 2012 12:58:54 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RCws1X099772; Mon, 27 Aug 2012 12:58:54 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271258.q7RCws1X099772@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 12:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239727 - stable/9/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 12:58:55 -0000 Author: gavin Date: Mon Aug 27 12:58:54 2012 New Revision: 239727 URL: http://svn.freebsd.org/changeset/base/239727 Log: Merge r236101, r236102 from head: Update to reflect various src and doc commit bits taken into safekeeping. Modified: stable/9/share/misc/committers-doc.dot stable/9/share/misc/committers-src.dot Directory Properties: stable/9/share/misc/ (props changed) Modified: stable/9/share/misc/committers-doc.dot ============================================================================== --- stable/9/share/misc/committers-doc.dot Mon Aug 27 12:45:41 2012 (r239726) +++ stable/9/share/misc/committers-doc.dot Mon Aug 27 12:58:54 2012 (r239727) @@ -32,15 +32,19 @@ node [color=grey62, style=filled, bgcolo ache [label="Andrey Chernov\nache@FreeBSD.org\n1997/06/13\n2010/12/11"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/22\n2009/09/13"] bvs [label="Vitaly Bogdanov\nbvs@FreeBSD.org\n2005/10/03\n2010/12/11"] +ceri [label="Ceri Davies\nceri@FreeBSD.org\n2002/03/17\n2012/02/29"] den [label="Denis Peplin\nden@FreeBSD.org\n2003/09/13\n2009/07/09"] garys [label="Gary W. Swearingen\ngarys@FreeBSD.org\n2005/08/21\n2008/03/02"] jcamou [label="Jesus R. Camou\njcamou@FreeBSD.org\n2005/03/02\n2008/12/20"] jesusr [label="Jesus Rodriguez Cuesta\njesusr@FreeBSD.org\n1998/12/10\n2010/12/11"] jim [label="Jim Mock\njim@FreeBSD.org\n1999/08/11\n2003/12/15"] josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/01/15\n2008/03/29"] +marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03\n2012/04/25"] mheinen [label="Martin Heinen\nmheinen@FreeBSD.org\n2002/10/04\n2006/04/26"] +murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2012/04/25"] nik [label="Nik Clayton\nnik@FreeBSD.org\n1998/02/26\n2008/12/20"] pgj [label="Gabor Pali\npgj@FreeBSD.org\n2008/04/21\n2010/12/01"] +roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14\n2012/02/29"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -51,7 +55,6 @@ bcr [label="Benedict Reuschling\nbcr@Fre blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] -ceri [label="Ceri Davies\nceri@FreeBSD.org\n2002/03/17"] chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] @@ -66,15 +69,12 @@ keramida [label="Giorgos Keramidas\nkera linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2004/03/31"] loader [label="Fukang Chen\nloader@FreeBSD.org\n2007/07/30"] manolis [label="Manolis Kiagias\nmanolis@FreeBSD.org\n2008/05/24"] -marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marck [label="Dmitry Morozovsky\nmarck@FreeBSD.org\n2004/08/10"] maxim [label="Maxim Konovalov\nmaxim@FreeBSD.org\n2002/02/07"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2007/10/26"] -murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] pav [label="Pav Lucistnik\npav@FreeBSD.org\n2005/08/12"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10/16"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] -roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14"] ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] Modified: stable/9/share/misc/committers-src.dot ============================================================================== --- stable/9/share/misc/committers-src.dot Mon Aug 27 12:45:41 2012 (r239726) +++ stable/9/share/misc/committers-src.dot Mon Aug 27 12:58:54 2012 (r239727) @@ -39,6 +39,7 @@ billf [label="Bill Fumerola\nbillf@FreeB bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] bmilekic [label="Bosko Milekic\nbmilekic@FreeBSD.org\n2000/09/21\n2008/11/10"] bushman [label="Michael Bushkov\nbushman@FreeBSD.org\n2007/03/10\n2010/04/29"] +ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07\n2012/03/07"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20\n2010/09/22"] dhartmei [label="Daniel Hartmeier\ndhartmei@FreeBSD.org\n2004/04/06\n2008/12/08"] @@ -58,18 +59,22 @@ jtc [label="J.T. Conklin\njtc@FreeBSD.or kbyanc [label="Kelly Yancey\nkbyanc@FreeBSD.org\n2000/07/11\n2006/07/25"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30\n2008/05/04"] +lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24\n2012/01/19"] mb [label="Maxim Bolotin\nmb@FreeBSD.org\n2000/04/06\n2003/03/08"] marks [label="Mark Santcroos\nmarks@FreeBSD.org\n2004/03/18\n2008/09/29"] mike [label="Mike Barcroft\nmike@FreeBSD.org\n2001/07/17\n2006/04/28"] msmith [label="Mike Smith\nmsmith@FreeBSD.org\n????/??/??\n2003/12/15"] murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2010/07/25"] +mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03\n2011/06/22"] nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/12\n2003/12/15"] njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] +randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20\n2012/05/10"] rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2003/03/08"] rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] robert [label="Robert Drehmel\nrobert@FreeBSD.org\n2001/08/23\n2006/05/13"] +rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25\n2010/12/03"] sah [label="Sam Hopkins\nsah@FreeBSD.org\n2004/12/15\n2008/11/10"] shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n2006/04/06"] @@ -81,6 +86,7 @@ tmm [label="Thomas Moestl\ntmm@FreeBSD.o toshi [label="Toshihiko Arai\ntoshi@FreeBSD.org\n2000/07/06\n2003/03/08"] tshiozak [label="Takuya SHIOZAKI\ntshiozak@FreeBSD.org\n2001/04/25\n2003/03/08"] uch [label="UCHIYAMA Yasushi\nuch@FreeBSD.org\n2000/06/21\n2002/04/24"] +yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25\n2012/05/23"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -110,7 +116,6 @@ brueffer [label="Christian Brueffer\nbru bruno [label="Bruno Ducrot\nbruno@FreeBSD.org\n2005/07/18"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] -ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] @@ -174,7 +179,6 @@ kib [label="Konstantin Belousov\nkib@Fre kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] -lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marius [label="Marius Strobl\nmarius@FreeBSD.org\n2004/04/17"] markm [label="Mark Murray\nmarkm@FreeBSD.org\n199?/??/??"] @@ -187,7 +191,6 @@ mdodd [label="Matthew N. Dodd\nmdodd@Fre mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"] mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] -mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] @@ -197,7 +200,7 @@ obrien [label="David E. O'Brien\nobrien@ olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] -philip [label="Philip Paeps\nphilip@FreBSD.org\n2004/01/21"] +philip [label="Philip Paeps\nphilip@FreeBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] @@ -205,14 +208,15 @@ pluknet [label="Sergey Kandaurov\nplukne ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"] -randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"] ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] rmacklem [label="Rick Macklem\nrmacklem@FreeBSD.org\n2009/03/27"] +rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/09/15"] roberto [label="Ollivier Robert\nroberto@FreeBSD.org\n1995/02/22"] +rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25"] rrs [label="Randall R Stewart\nrrs@FreeBSD.org\n2007/02/08"] rse [label="Ralf S. Engelschall\nrse@FreeBSD.org\n1997/07/31"] rstone [label="Ryan Stone\nrstone@FreeBSD.org\n2010/04/19"] @@ -249,7 +253,6 @@ wes [label="Wes Peters\nwes@FreeBSD.org\ wilko [label="Wilko Bulte\nwilko@FreeBSD.org\n2000/01/13"] wollman [label="Garrett Wollman\nwollman@FreeBSD.org\n????/??/??"] wsalamon [label="Wayne Salamon\nwsalamon@FreeBSD.org\n2005/06/25"] -yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25"] yongari [label="Pyun YongHyeon\nyongari@FreeBSD.org\n2004/08/01"] zack [label="Zack Kirsch\nzack@FreeBSD.org\n2010/11/05"] zec [label="Marko Zec\nzec@FreeBSD.org\n2008/06/22"] From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 13:04:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64A59106566B; Mon, 27 Aug 2012 13:04:46 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EB738FC08; Mon, 27 Aug 2012 13:04:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RD4khp000633; Mon, 27 Aug 2012 13:04:46 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RD4kLx000631; Mon, 27 Aug 2012 13:04:46 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271304.q7RD4kLx000631@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 13:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239728 - stable/9/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 13:04:46 -0000 Author: gavin Date: Mon Aug 27 13:04:45 2012 New Revision: 239728 URL: http://svn.freebsd.org/changeset/base/239728 Log: Merge r238396 from head: Update to reflect new core team. Modified: stable/9/share/misc/organization.dot Directory Properties: stable/9/share/misc/ (props changed) Modified: stable/9/share/misc/organization.dot ============================================================================== --- stable/9/share/misc/organization.dot Mon Aug 27 12:58:54 2012 (r239727) +++ stable/9/share/misc/organization.dot Mon Aug 27 13:04:45 2012 (r239728) @@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted -core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] +core [label="Core Team\ncore@FreeBSD.org\ntabthorpe, gavin, jhb, kib,\ntheraven, attilio, hrs,\npeter, miwi"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nkeramida"] From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 13:05:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F66106564A; Mon, 27 Aug 2012 13:05:16 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53B18FC0C; Mon, 27 Aug 2012 13:05:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RD5Ftb000746; Mon, 27 Aug 2012 13:05:15 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RD5FEL000744; Mon, 27 Aug 2012 13:05:15 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271305.q7RD5FEL000744@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 13:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239729 - stable/8/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 13:05:16 -0000 Author: gavin Date: Mon Aug 27 13:05:15 2012 New Revision: 239729 URL: http://svn.freebsd.org/changeset/base/239729 Log: Merge r238396 from head: Update to reflect new core team. Modified: stable/8/share/misc/organization.dot Directory Properties: stable/8/share/misc/ (props changed) Modified: stable/8/share/misc/organization.dot ============================================================================== --- stable/8/share/misc/organization.dot Mon Aug 27 13:04:45 2012 (r239728) +++ stable/8/share/misc/organization.dot Mon Aug 27 13:05:15 2012 (r239729) @@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted -core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] +core [label="Core Team\ncore@FreeBSD.org\ntabthorpe, gavin, jhb, kib,\ntheraven, attilio, hrs,\npeter, miwi"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\njoel"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nnik, blackend, hrs,\nkeramida"] From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 13:22:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E58AB1065670; Mon, 27 Aug 2012 13:22:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3108FC20; Mon, 27 Aug 2012 13:22:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RDMSgD002947; Mon, 27 Aug 2012 13:22:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RDMSEw002945; Mon, 27 Aug 2012 13:22:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208271322.q7RDMSEw002945@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 27 Aug 2012 13:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239730 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 13:22:29 -0000 Author: des Date: Mon Aug 27 13:22:27 2012 New Revision: 239730 URL: http://svn.freebsd.org/changeset/base/239730 Log: Parly revert r239255: reinstate a default maxswzone on i386, where KVA is scarce, but set it slightly higher so we can handle 8 GB of swap. Modified: head/sys/i386/include/param.h Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Mon Aug 27 13:05:15 2012 (r239729) +++ head/sys/i386/include/param.h Mon Aug 27 13:22:27 2012 (r239730) @@ -123,6 +123,20 @@ #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ /* + * Ceiling on amount of swblock kva space, can be changed via + * the kern.maxswzone /boot/loader.conf variable. + * + * 276 is sizeof(struct swblock), but we do not always have a definition + * in scope for struct swblock, so we have to hardcode it. Each struct + * swblock holds metadata for 32 pages, so in theory, this is enough for + * 16 GB of swap. In practice, however, the usable amount is considerably + * lower due to fragmentation. + */ +#ifndef VM_SWZONE_SIZE_MAX +#define VM_SWZONE_SIZE_MAX (276 * 128 * 1024) +#endif + +/* * Ceiling on size of buffer cache (really only effects write queueing, * the VM page cache is not effected), can be changed via * the kern.maxbcache /boot/loader.conf variable. From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 13:50:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C2B3106566B; Mon, 27 Aug 2012 13:50:02 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE04C8FC0A; Mon, 27 Aug 2012 13:50:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RDo1qe006184; Mon, 27 Aug 2012 13:50:01 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RDo1vn006182; Mon, 27 Aug 2012 13:50:01 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271350.q7RDo1vn006182@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 13:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239731 - stable/8/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 13:50:02 -0000 Author: gavin Date: Mon Aug 27 13:50:01 2012 New Revision: 239731 URL: http://svn.freebsd.org/changeset/base/239731 Log: Merge r238778 from head: The baud rate on CP1201/2/3 devices can be set in one of two ways: - The USLCOM_SET_BAUD_DIV command (0x01) - The USLCOM_SET_BAUD_RATE command (0x13) Devices based on the CP1204 will only accept the latter command, and ignore the former. As the latter command works on all chips that this driver supports, switch to always using it. A slight confusion here is that the previously used command was incorrectly named USLCOM_BAUD_RATE - even though we no longer use it, rename it to USLCOM_SET_BAUD_DIV to closer match the name used in the datasheet. This change reflects a similar change made in the Linux driver, which was submitted by preston.fick at silabs.com, and has been tested on all of the uslcom(4) devices I have to hand. Modified: stable/8/sys/dev/usb/serial/uslcom.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Mon Aug 27 13:22:27 2012 (r239730) +++ stable/8/sys/dev/usb/serial/uslcom.c Mon Aug 27 13:50:01 2012 (r239731) @@ -70,12 +70,13 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb /* Request codes */ #define USLCOM_UART 0x00 -#define USLCOM_BAUD_RATE 0x01 +#define USLCOM_SET_BAUD_DIV 0x01 #define USLCOM_DATA 0x03 #define USLCOM_BREAK 0x05 #define USLCOM_CTRL 0x07 #define USLCOM_RCTRL 0x08 #define USLCOM_SET_FLOWCTRL 0x13 +#define USLCOM_SET_BAUD_RATE 0x1e #define USLCOM_VENDOR_SPECIFIC 0xff /* USLCOM_UART values */ @@ -92,8 +93,8 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_CTRL_RI 0x0040 #define USLCOM_CTRL_DCD 0x0080 -/* USLCOM_BAUD_RATE values */ -#define USLCOM_BAUD_REF 0x384000 +/* USLCOM_SET_BAUD_DIV values */ +#define USLCOM_BAUD_REF 3686400 /* 3.6864 MHz */ /* USLCOM_DATA values */ #define USLCOM_STOP_BITS_1 0x00 @@ -511,19 +512,20 @@ uslcom_param(struct ucom_softc *ucom, st { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; - uint32_t flowctrl[4]; + uint32_t baudrate, flowctrl[4]; uint16_t data; DPRINTF("\n"); + baudrate = t->c_ospeed; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_BAUD_RATE; - USETW(req.wValue, USLCOM_BAUD_REF / t->c_ospeed); + req.bRequest = USLCOM_SET_BAUD_RATE; + USETW(req.wValue, 0); USETW(req.wIndex, USLCOM_PORT_NO); - USETW(req.wLength, 0); + USETW(req.wLength, sizeof(baudrate)); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000)) { + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, &baudrate, 0, 1000)) { DPRINTF("Set baudrate failed (ignored)\n"); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 14:44:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26BAD10657AD; Mon, 27 Aug 2012 14:44:41 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBCBB8FC22; Mon, 27 Aug 2012 14:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7REiegY012374; Mon, 27 Aug 2012 14:44:40 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7REiehL012372; Mon, 27 Aug 2012 14:44:40 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208271444.q7REiehL012372@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 27 Aug 2012 14:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239732 - stable/9/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 14:44:41 -0000 Author: gavin Date: Mon Aug 27 14:44:40 2012 New Revision: 239732 URL: http://svn.freebsd.org/changeset/base/239732 Log: Merge r238778 from head: The baud rate on CP1201/2/3 devices can be set in one of two ways: - The USLCOM_SET_BAUD_DIV command (0x01) - The USLCOM_SET_BAUD_RATE command (0x13) Devices based on the CP1204 will only accept the latter command, and ignore the former. As the latter command works on all chips that this driver supports, switch to always using it. A slight confusion here is that the previously used command was incorrectly named USLCOM_BAUD_RATE - even though we no longer use it, rename it to USLCOM_SET_BAUD_DIV to closer match the name used in the datasheet. This change reflects a similar change made in the Linux driver, which was submitted by preston.fick at silabs.com, and has been tested on all of the uslcom(4) devices I have to hand. Modified: stable/9/sys/dev/usb/serial/uslcom.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uslcom.c Mon Aug 27 13:50:01 2012 (r239731) +++ stable/9/sys/dev/usb/serial/uslcom.c Mon Aug 27 14:44:40 2012 (r239732) @@ -70,12 +70,13 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb /* Request codes */ #define USLCOM_UART 0x00 -#define USLCOM_BAUD_RATE 0x01 +#define USLCOM_SET_BAUD_DIV 0x01 #define USLCOM_DATA 0x03 #define USLCOM_BREAK 0x05 #define USLCOM_CTRL 0x07 #define USLCOM_RCTRL 0x08 #define USLCOM_SET_FLOWCTRL 0x13 +#define USLCOM_SET_BAUD_RATE 0x1e #define USLCOM_VENDOR_SPECIFIC 0xff /* USLCOM_UART values */ @@ -92,8 +93,8 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_CTRL_RI 0x0040 #define USLCOM_CTRL_DCD 0x0080 -/* USLCOM_BAUD_RATE values */ -#define USLCOM_BAUD_REF 0x384000 +/* USLCOM_SET_BAUD_DIV values */ +#define USLCOM_BAUD_REF 3686400 /* 3.6864 MHz */ /* USLCOM_DATA values */ #define USLCOM_STOP_BITS_1 0x00 @@ -511,19 +512,20 @@ uslcom_param(struct ucom_softc *ucom, st { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; - uint32_t flowctrl[4]; + uint32_t baudrate, flowctrl[4]; uint16_t data; DPRINTF("\n"); + baudrate = t->c_ospeed; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_BAUD_RATE; - USETW(req.wValue, USLCOM_BAUD_REF / t->c_ospeed); + req.bRequest = USLCOM_SET_BAUD_RATE; + USETW(req.wValue, 0); USETW(req.wIndex, USLCOM_PORT_NO); - USETW(req.wLength, 0); + USETW(req.wLength, sizeof(baudrate)); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000)) { + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, &baudrate, 0, 1000)) { DPRINTF("Set baudrate failed (ignored)\n"); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 14:51:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C22DA106566B; Mon, 27 Aug 2012 14:51:26 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC7F98FC14; Mon, 27 Aug 2012 14:51:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7REpQpq013161; Mon, 27 Aug 2012 14:51:26 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7REpQ6W013159; Mon, 27 Aug 2012 14:51:26 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201208271451.q7REpQ6W013159@svn.freebsd.org> From: Roman Divacky Date: Mon, 27 Aug 2012 14:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239733 - head/usr.sbin/nvram X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 14:51:26 -0000 Author: rdivacky Date: Mon Aug 27 14:51:26 2012 New Revision: 239733 URL: http://svn.freebsd.org/changeset/base/239733 Log: Dont cast from char* to struct chrp_header* which has a bigger alignment requirements. Copy it via union instead. Fixes a clang warning about alignment. Reviewed by: sobomax Modified: head/usr.sbin/nvram/nvram.c Modified: head/usr.sbin/nvram/nvram.c ============================================================================== --- head/usr.sbin/nvram/nvram.c Mon Aug 27 14:44:40 2012 (r239732) +++ head/usr.sbin/nvram/nvram.c Mon Aug 27 14:51:26 2012 (r239733) @@ -51,12 +51,16 @@ struct deletelist { struct deletelist *last; }; +union { + uint8_t buf[sizeof(struct chrp_header)]; + struct chrp_header header; +} conv; + int main(int argc, char **argv) { int opt, dump, fd, res, i, size; uint8_t buf[NVRAM_SIZE], *cp, *common; - struct chrp_header *header; struct deletelist *dl; dump = 0; @@ -116,9 +120,9 @@ main(int argc, char **argv) /* Locate common block */ size = 0; for (cp = buf; cp < buf + sizeof(buf); cp += size) { - header = (struct chrp_header *)cp; - size = header->length * 0x10; - if (strncmp(header->name, "common", 7) == 0) + memcpy(conv.buf, cp, sizeof(struct chrp_header)); + size = conv.header.length * 0x10; + if (strncmp(conv.header.name, "common", 7) == 0) break; } if (cp >= buf + sizeof(buf) || size <= (int)sizeof(struct chrp_header)) From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 15:47:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6946C1065670; Mon, 27 Aug 2012 15:47:47 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51CB78FC1C; Mon, 27 Aug 2012 15:47:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RFllQ4019536; Mon, 27 Aug 2012 15:47:47 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RFllPq019528; Mon, 27 Aug 2012 15:47:47 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271547.q7RFllPq019528@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 15:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239734 - in stable/9/sys/dev/isci: . scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 15:47:47 -0000 Author: jimharris Date: Mon Aug 27 15:47:46 2012 New Revision: 239734 URL: http://svn.freebsd.org/changeset/base/239734 Log: MFC r239545, r239665: Fix/add support for SCSI UNMAP to ATA DSM translation. This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. 4) Clear freeze bit in isci_remote_device_release_lun_queue() before calling xpt_release_devq to ensure that any ccbs which immediately start during the call to xpt_release_devq() see an accurate picture of the frozen_lun_mask. This code path is extensively exercised when tagged read/write commands mix with non-tagged DSM commands. Sponsored by: Intel Modified: stable/9/sys/dev/isci/isci.c stable/9/sys/dev/isci/isci.h stable/9/sys/dev/isci/isci_controller.c stable/9/sys/dev/isci/isci_remote_device.c stable/9/sys/dev/isci/scil/sati_unmap.c stable/9/sys/dev/isci/scil/scif_sas_sati_binding.h stable/9/sys/dev/isci/scil/scif_sas_stp_io_request.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/isci.c ============================================================================== --- stable/9/sys/dev/isci/isci.c Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/isci.c Mon Aug 27 15:47:46 2012 (r239734) @@ -185,6 +185,7 @@ isci_detach(device_t device) for (i = 0; i < isci->controller_count; i++) { struct ISCI_CONTROLLER *controller = &isci->controllers[i]; SCI_STATUS status; + void *unmap_buffer; if (controller->scif_controller_handle != NULL) { scic_controller_disable_interrupts( @@ -218,6 +219,13 @@ isci_detach(device_t device) if (controller->remote_device_memory != NULL) free(controller->remote_device_memory, M_ISCI); + + while (1) { + sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); + if (unmap_buffer == NULL) + break; + contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + } } /* The SCIF controllers have been stopped, so we can now Modified: stable/9/sys/dev/isci/isci.h ============================================================================== --- stable/9/sys/dev/isci/isci.h Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/isci.h Mon Aug 27 15:47:46 2012 (r239734) @@ -175,6 +175,7 @@ struct ISCI_CONTROLLER SCI_POOL_CREATE(remote_device_pool, struct ISCI_REMOTE_DEVICE *, SCI_MAX_REMOTE_DEVICES); SCI_POOL_CREATE(request_pool, struct ISCI_REQUEST *, SCI_MAX_IO_REQUESTS); SCI_POOL_CREATE(timer_pool, struct ISCI_TIMER *, SCI_MAX_TIMERS); + SCI_POOL_CREATE(unmap_buffer_pool, void *, SCI_MAX_REMOTE_DEVICES); }; struct ISCI_REQUEST Modified: stable/9/sys/dev/isci/isci_controller.c ============================================================================== --- stable/9/sys/dev/isci/isci_controller.c Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/isci_controller.c Mon Aug 27 15:47:46 2012 (r239734) @@ -145,6 +145,14 @@ void scif_cb_controller_stop_complete(SC isci_controller->is_started = FALSE; } +static void +isci_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + SCI_PHYSICAL_ADDRESS *phys_addr = arg; + + *phys_addr = seg[0].ds_addr; +} + /** * @brief This method will be invoked to allocate memory dynamically. * @@ -159,7 +167,29 @@ void scif_cb_controller_stop_complete(SC void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T *mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Note this routine is only used for buffers needed to translate + * SCSI UNMAP commands to ATA DSM commands for SATA disks. + * + * We first try to pull a buffer from the controller's pool, and only + * call contigmalloc if one isn't there. + */ + if (!sci_pool_empty(isci_controller->unmap_buffer_pool)) { + sci_pool_get(isci_controller->unmap_buffer_pool, + mde->virtual_address); + } else + mde->virtual_address = contigmalloc(PAGE_SIZE, + M_ISCI, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + mde->constant_memory_alignment, 0); + + if (mde->virtual_address != NULL) + bus_dmamap_load(isci_controller->buffer_dma_tag, + NULL, mde->virtual_address, PAGE_SIZE, + isci_single_map, &mde->physical_address, + BUS_DMA_NOWAIT); } /** @@ -176,7 +206,16 @@ void scif_cb_controller_allocate_memory( void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Put the buffer back into the controller's buffer pool, rather + * than invoking configfree. This helps reduce chance we won't + * have buffers available when system is under memory pressure. + */ + sci_pool_put(isci_controller->unmap_buffer_pool, + mde->virtual_address); } void isci_controller_construct(struct ISCI_CONTROLLER *controller, @@ -228,6 +267,8 @@ void isci_controller_construct(struct IS for ( int i = 0; i < SCI_MAX_TIMERS; i++ ) { sci_pool_put(controller->timer_pool, timer++); } + + sci_pool_initialize(controller->unmap_buffer_pool); } SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller) Modified: stable/9/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/9/sys/dev/isci/isci_remote_device.c Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/isci_remote_device.c Mon Aug 27 15:47:46 2012 (r239734) @@ -278,12 +278,12 @@ isci_remote_device_release_lun_queue(str if (remote_device->frozen_lun_mask & (1 << lun)) { struct cam_path *path; + remote_device->frozen_lun_mask &= ~(1 << lun); xpt_create_path(&path, xpt_periph, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); xpt_free_path(path); - remote_device->frozen_lun_mask &= ~(1 << lun); } } Modified: stable/9/sys/dev/isci/scil/sati_unmap.c ============================================================================== --- stable/9/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 15:47:46 2012 (r239734) @@ -335,8 +335,8 @@ SATI_STATUS sati_unmap_initial_processin sati_scsi_sense_data_construct( sequence, scsi_io, - SCSI_STATUS_CHECK_CONDITION, - SCSI_SENSE_ABORTED_COMMAND, + SCSI_STATUS_BUSY, + SCSI_SENSE_NO_SENSE, SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_NO_ADDITIONAL_SENSE ); Modified: stable/9/sys/dev/isci/scil/scif_sas_sati_binding.h ============================================================================== --- stable/9/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 15:47:46 2012 (r239734) @@ -183,22 +183,16 @@ extern "C" { { \ SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ - SCI_PHYSICAL_ADDRESS phys_addr; \ mde.virtual_address = NULL; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, length, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ scif_cb_controller_allocate_memory( \ fw_request->device->domain->controller, &mde \ ); \ - scic_cb_io_request_get_physical_address(fw_request->device->domain->controller, \ - NULL, \ - mde.virtual_address, \ - &phys_addr); \ *(virt_address) = mde.virtual_address; \ - *(phys_address_low) = sci_cb_physical_address_lower(phys_addr); \ - *(phys_address_high) = sci_cb_physical_address_upper(phys_addr); \ + *(phys_address_low) = sci_cb_physical_address_lower(mde.physical_address); \ + *(phys_address_high) = sci_cb_physical_address_upper(mde.physical_address); \ } #define sati_cb_free_dma_buffer(scsi_io, virt_address) \ @@ -206,7 +200,6 @@ extern "C" { SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ mde.virtual_address = virt_address; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, 0, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ Modified: stable/9/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- stable/9/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 14:51:26 2012 (r239733) +++ stable/9/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 15:47:46 2012 (r239734) @@ -171,6 +171,8 @@ SCI_STATUS scif_sas_stp_io_request_const ); } + sati_sequence_terminate(&fw_io->parent.stp.sequence, fw_io, fw_io); + return SCI_SUCCESS; } /** From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 15:52:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5A66106566B; Mon, 27 Aug 2012 15:52:09 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F1098FC08; Mon, 27 Aug 2012 15:52:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RFq9h5020067; Mon, 27 Aug 2012 15:52:09 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RFq9ZL020059; Mon, 27 Aug 2012 15:52:09 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271552.q7RFq9ZL020059@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 15:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239735 - in stable/8/sys/dev/isci: . scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 15:52:09 -0000 Author: jimharris Date: Mon Aug 27 15:52:09 2012 New Revision: 239735 URL: http://svn.freebsd.org/changeset/base/239735 Log: MFC r239545, r239665: Fix/add support for SCSI UNMAP to ATA DSM translation. (Note: scsi_da does not support BIO_DELETE->SCSI_UNMAP on this stable branch, but I am MFC'ing the changes to keep a consistent driver across all stable releases.) This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. 4) Clear freeze bit in isci_remote_device_release_lun_queue() before calling xpt_release_devq to ensure that any ccbs which immediately start during the call to xpt_release_devq() see an accurate picture of the frozen_lun_mask. This code path is extensively exercised when tagged read/write commands mix with non-tagged DSM commands. Sponsored by: Intel Modified: stable/8/sys/dev/isci/isci.c stable/8/sys/dev/isci/isci.h stable/8/sys/dev/isci/isci_controller.c stable/8/sys/dev/isci/isci_remote_device.c stable/8/sys/dev/isci/scil/sati_unmap.c stable/8/sys/dev/isci/scil/scif_sas_sati_binding.h stable/8/sys/dev/isci/scil/scif_sas_stp_io_request.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/isci/isci.c ============================================================================== --- stable/8/sys/dev/isci/isci.c Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/isci.c Mon Aug 27 15:52:09 2012 (r239735) @@ -185,6 +185,7 @@ isci_detach(device_t device) for (i = 0; i < isci->controller_count; i++) { struct ISCI_CONTROLLER *controller = &isci->controllers[i]; SCI_STATUS status; + void *unmap_buffer; if (controller->scif_controller_handle != NULL) { scic_controller_disable_interrupts( @@ -218,6 +219,13 @@ isci_detach(device_t device) if (controller->remote_device_memory != NULL) free(controller->remote_device_memory, M_ISCI); + + while (1) { + sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); + if (unmap_buffer == NULL) + break; + contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + } } /* The SCIF controllers have been stopped, so we can now Modified: stable/8/sys/dev/isci/isci.h ============================================================================== --- stable/8/sys/dev/isci/isci.h Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/isci.h Mon Aug 27 15:52:09 2012 (r239735) @@ -175,6 +175,7 @@ struct ISCI_CONTROLLER SCI_POOL_CREATE(remote_device_pool, struct ISCI_REMOTE_DEVICE *, SCI_MAX_REMOTE_DEVICES); SCI_POOL_CREATE(request_pool, struct ISCI_REQUEST *, SCI_MAX_IO_REQUESTS); SCI_POOL_CREATE(timer_pool, struct ISCI_TIMER *, SCI_MAX_TIMERS); + SCI_POOL_CREATE(unmap_buffer_pool, void *, SCI_MAX_REMOTE_DEVICES); }; struct ISCI_REQUEST Modified: stable/8/sys/dev/isci/isci_controller.c ============================================================================== --- stable/8/sys/dev/isci/isci_controller.c Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/isci_controller.c Mon Aug 27 15:52:09 2012 (r239735) @@ -145,6 +145,14 @@ void scif_cb_controller_stop_complete(SC isci_controller->is_started = FALSE; } +static void +isci_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + SCI_PHYSICAL_ADDRESS *phys_addr = arg; + + *phys_addr = seg[0].ds_addr; +} + /** * @brief This method will be invoked to allocate memory dynamically. * @@ -159,7 +167,29 @@ void scif_cb_controller_stop_complete(SC void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T *mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Note this routine is only used for buffers needed to translate + * SCSI UNMAP commands to ATA DSM commands for SATA disks. + * + * We first try to pull a buffer from the controller's pool, and only + * call contigmalloc if one isn't there. + */ + if (!sci_pool_empty(isci_controller->unmap_buffer_pool)) { + sci_pool_get(isci_controller->unmap_buffer_pool, + mde->virtual_address); + } else + mde->virtual_address = contigmalloc(PAGE_SIZE, + M_ISCI, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + mde->constant_memory_alignment, 0); + + if (mde->virtual_address != NULL) + bus_dmamap_load(isci_controller->buffer_dma_tag, + NULL, mde->virtual_address, PAGE_SIZE, + isci_single_map, &mde->physical_address, + BUS_DMA_NOWAIT); } /** @@ -176,7 +206,16 @@ void scif_cb_controller_allocate_memory( void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Put the buffer back into the controller's buffer pool, rather + * than invoking configfree. This helps reduce chance we won't + * have buffers available when system is under memory pressure. + */ + sci_pool_put(isci_controller->unmap_buffer_pool, + mde->virtual_address); } void isci_controller_construct(struct ISCI_CONTROLLER *controller, @@ -228,6 +267,8 @@ void isci_controller_construct(struct IS for ( int i = 0; i < SCI_MAX_TIMERS; i++ ) { sci_pool_put(controller->timer_pool, timer++); } + + sci_pool_initialize(controller->unmap_buffer_pool); } SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller) Modified: stable/8/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/8/sys/dev/isci/isci_remote_device.c Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/isci_remote_device.c Mon Aug 27 15:52:09 2012 (r239735) @@ -278,12 +278,12 @@ isci_remote_device_release_lun_queue(str if (remote_device->frozen_lun_mask & (1 << lun)) { struct cam_path *path; + remote_device->frozen_lun_mask &= ~(1 << lun); xpt_create_path(&path, xpt_periph, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); xpt_free_path(path); - remote_device->frozen_lun_mask &= ~(1 << lun); } } Modified: stable/8/sys/dev/isci/scil/sati_unmap.c ============================================================================== --- stable/8/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 15:52:09 2012 (r239735) @@ -335,8 +335,8 @@ SATI_STATUS sati_unmap_initial_processin sati_scsi_sense_data_construct( sequence, scsi_io, - SCSI_STATUS_CHECK_CONDITION, - SCSI_SENSE_ABORTED_COMMAND, + SCSI_STATUS_BUSY, + SCSI_SENSE_NO_SENSE, SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_NO_ADDITIONAL_SENSE ); Modified: stable/8/sys/dev/isci/scil/scif_sas_sati_binding.h ============================================================================== --- stable/8/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 15:52:09 2012 (r239735) @@ -183,22 +183,16 @@ extern "C" { { \ SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ - SCI_PHYSICAL_ADDRESS phys_addr; \ mde.virtual_address = NULL; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, length, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ scif_cb_controller_allocate_memory( \ fw_request->device->domain->controller, &mde \ ); \ - scic_cb_io_request_get_physical_address(fw_request->device->domain->controller, \ - NULL, \ - mde.virtual_address, \ - &phys_addr); \ *(virt_address) = mde.virtual_address; \ - *(phys_address_low) = sci_cb_physical_address_lower(phys_addr); \ - *(phys_address_high) = sci_cb_physical_address_upper(phys_addr); \ + *(phys_address_low) = sci_cb_physical_address_lower(mde.physical_address); \ + *(phys_address_high) = sci_cb_physical_address_upper(mde.physical_address); \ } #define sati_cb_free_dma_buffer(scsi_io, virt_address) \ @@ -206,7 +200,6 @@ extern "C" { SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ mde.virtual_address = virt_address; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, 0, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ Modified: stable/8/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- stable/8/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 15:47:46 2012 (r239734) +++ stable/8/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 15:52:09 2012 (r239735) @@ -171,6 +171,8 @@ SCI_STATUS scif_sas_stp_io_request_const ); } + sati_sequence_terminate(&fw_io->parent.stp.sequence, fw_io, fw_io); + return SCI_SUCCESS; } /** From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 15:54:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 442141065673; Mon, 27 Aug 2012 15:54:52 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CA188FC08; Mon, 27 Aug 2012 15:54:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RFsqE6020424; Mon, 27 Aug 2012 15:54:52 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RFspac020415; Mon, 27 Aug 2012 15:54:51 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271554.q7RFspac020415@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 15:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239736 - in stable/7/sys/dev/isci: . scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 15:54:52 -0000 Author: jimharris Date: Mon Aug 27 15:54:51 2012 New Revision: 239736 URL: http://svn.freebsd.org/changeset/base/239736 Log: MFC r239545, r239665: Fix/add support for SCSI UNMAP to ATA DSM translation. (Note: scsi_da does not support BIO_DELETE->SCSI_UNMAP on this stable branch, but I am MFC'ing the changes to keep a consistent driver across all stable releases.) This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. 4) Clear freeze bit in isci_remote_device_release_lun_queue() before calling xpt_release_devq to ensure that any ccbs which immediately start during the call to xpt_release_devq() see an accurate picture of the frozen_lun_mask. This code path is extensively exercised when tagged read/write commands mix with non-tagged DSM commands. Sponsored by: Intel Modified: stable/7/sys/dev/isci/isci.c stable/7/sys/dev/isci/isci.h stable/7/sys/dev/isci/isci_controller.c stable/7/sys/dev/isci/isci_remote_device.c stable/7/sys/dev/isci/scil/sati_unmap.c stable/7/sys/dev/isci/scil/scif_sas_sati_binding.h stable/7/sys/dev/isci/scil/scif_sas_stp_io_request.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/isci.c ============================================================================== --- stable/7/sys/dev/isci/isci.c Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/isci.c Mon Aug 27 15:54:51 2012 (r239736) @@ -185,6 +185,7 @@ isci_detach(device_t device) for (i = 0; i < isci->controller_count; i++) { struct ISCI_CONTROLLER *controller = &isci->controllers[i]; SCI_STATUS status; + void *unmap_buffer; if (controller->scif_controller_handle != NULL) { scic_controller_disable_interrupts( @@ -218,6 +219,13 @@ isci_detach(device_t device) if (controller->remote_device_memory != NULL) free(controller->remote_device_memory, M_ISCI); + + while (1) { + sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); + if (unmap_buffer == NULL) + break; + contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + } } /* The SCIF controllers have been stopped, so we can now Modified: stable/7/sys/dev/isci/isci.h ============================================================================== --- stable/7/sys/dev/isci/isci.h Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/isci.h Mon Aug 27 15:54:51 2012 (r239736) @@ -175,6 +175,7 @@ struct ISCI_CONTROLLER SCI_POOL_CREATE(remote_device_pool, struct ISCI_REMOTE_DEVICE *, SCI_MAX_REMOTE_DEVICES); SCI_POOL_CREATE(request_pool, struct ISCI_REQUEST *, SCI_MAX_IO_REQUESTS); SCI_POOL_CREATE(timer_pool, struct ISCI_TIMER *, SCI_MAX_TIMERS); + SCI_POOL_CREATE(unmap_buffer_pool, void *, SCI_MAX_REMOTE_DEVICES); }; struct ISCI_REQUEST Modified: stable/7/sys/dev/isci/isci_controller.c ============================================================================== --- stable/7/sys/dev/isci/isci_controller.c Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/isci_controller.c Mon Aug 27 15:54:51 2012 (r239736) @@ -145,6 +145,14 @@ void scif_cb_controller_stop_complete(SC isci_controller->is_started = FALSE; } +static void +isci_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + SCI_PHYSICAL_ADDRESS *phys_addr = arg; + + *phys_addr = seg[0].ds_addr; +} + /** * @brief This method will be invoked to allocate memory dynamically. * @@ -159,7 +167,29 @@ void scif_cb_controller_stop_complete(SC void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T *mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Note this routine is only used for buffers needed to translate + * SCSI UNMAP commands to ATA DSM commands for SATA disks. + * + * We first try to pull a buffer from the controller's pool, and only + * call contigmalloc if one isn't there. + */ + if (!sci_pool_empty(isci_controller->unmap_buffer_pool)) { + sci_pool_get(isci_controller->unmap_buffer_pool, + mde->virtual_address); + } else + mde->virtual_address = contigmalloc(PAGE_SIZE, + M_ISCI, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + mde->constant_memory_alignment, 0); + + if (mde->virtual_address != NULL) + bus_dmamap_load(isci_controller->buffer_dma_tag, + NULL, mde->virtual_address, PAGE_SIZE, + isci_single_map, &mde->physical_address, + BUS_DMA_NOWAIT); } /** @@ -176,7 +206,16 @@ void scif_cb_controller_allocate_memory( void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Put the buffer back into the controller's buffer pool, rather + * than invoking configfree. This helps reduce chance we won't + * have buffers available when system is under memory pressure. + */ + sci_pool_put(isci_controller->unmap_buffer_pool, + mde->virtual_address); } void isci_controller_construct(struct ISCI_CONTROLLER *controller, @@ -228,6 +267,8 @@ void isci_controller_construct(struct IS for ( int i = 0; i < SCI_MAX_TIMERS; i++ ) { sci_pool_put(controller->timer_pool, timer++); } + + sci_pool_initialize(controller->unmap_buffer_pool); } SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller) Modified: stable/7/sys/dev/isci/isci_remote_device.c ============================================================================== --- stable/7/sys/dev/isci/isci_remote_device.c Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/isci_remote_device.c Mon Aug 27 15:54:51 2012 (r239736) @@ -278,12 +278,12 @@ isci_remote_device_release_lun_queue(str if (remote_device->frozen_lun_mask & (1 << lun)) { struct cam_path *path; + remote_device->frozen_lun_mask &= ~(1 << lun); xpt_create_path(&path, xpt_periph, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); xpt_free_path(path); - remote_device->frozen_lun_mask &= ~(1 << lun); } } Modified: stable/7/sys/dev/isci/scil/sati_unmap.c ============================================================================== --- stable/7/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 15:54:51 2012 (r239736) @@ -335,8 +335,8 @@ SATI_STATUS sati_unmap_initial_processin sati_scsi_sense_data_construct( sequence, scsi_io, - SCSI_STATUS_CHECK_CONDITION, - SCSI_SENSE_ABORTED_COMMAND, + SCSI_STATUS_BUSY, + SCSI_SENSE_NO_SENSE, SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_NO_ADDITIONAL_SENSE ); Modified: stable/7/sys/dev/isci/scil/scif_sas_sati_binding.h ============================================================================== --- stable/7/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 15:54:51 2012 (r239736) @@ -183,22 +183,16 @@ extern "C" { { \ SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ - SCI_PHYSICAL_ADDRESS phys_addr; \ mde.virtual_address = NULL; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, length, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ scif_cb_controller_allocate_memory( \ fw_request->device->domain->controller, &mde \ ); \ - scic_cb_io_request_get_physical_address(fw_request->device->domain->controller, \ - NULL, \ - mde.virtual_address, \ - &phys_addr); \ *(virt_address) = mde.virtual_address; \ - *(phys_address_low) = sci_cb_physical_address_lower(phys_addr); \ - *(phys_address_high) = sci_cb_physical_address_upper(phys_addr); \ + *(phys_address_low) = sci_cb_physical_address_lower(mde.physical_address); \ + *(phys_address_high) = sci_cb_physical_address_upper(mde.physical_address); \ } #define sati_cb_free_dma_buffer(scsi_io, virt_address) \ @@ -206,7 +200,6 @@ extern "C" { SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ mde.virtual_address = virt_address; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, 0, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ Modified: stable/7/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- stable/7/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 15:52:09 2012 (r239735) +++ stable/7/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 15:54:51 2012 (r239736) @@ -171,6 +171,8 @@ SCI_STATUS scif_sas_stp_io_request_const ); } + sati_sequence_terminate(&fw_io->parent.stp.sequence, fw_io, fw_io); + return SCI_SUCCESS; } /** From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 15:57:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E300F106566B; Mon, 27 Aug 2012 15:57:33 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDB088FC25; Mon, 27 Aug 2012 15:57:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RFvX7E020802; Mon, 27 Aug 2012 15:57:33 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RFvX09020800; Mon, 27 Aug 2012 15:57:33 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271557.q7RFvX09020800@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 15:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239737 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 15:57:34 -0000 Author: jimharris Date: Mon Aug 27 15:57:33 2012 New Revision: 239737 URL: http://svn.freebsd.org/changeset/base/239737 Log: MFC r239655: Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local variable when determining various sizes related to SCSI UNMAP block descriptor lists. Sponsored by: Intel Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Mon Aug 27 15:54:51 2012 (r239736) +++ stable/9/sys/cam/scsi/scsi_da.c Mon Aug 27 15:57:33 2012 (r239737) @@ -1788,8 +1788,8 @@ dastart(struct cam_periph *periph, union softc->params.secsize > softc->unmap_max_lba) break; } while (1); - scsi_ulto2b(count * 16 + 6, &buf[0]); - scsi_ulto2b(count * 16, &buf[2]); + scsi_ulto2b(ranges * 16 + 6, &buf[0]); + scsi_ulto2b(ranges * 16, &buf[2]); scsi_unmap(&start_ccb->csio, /*retries*/da_retry_count, @@ -1797,7 +1797,7 @@ dastart(struct cam_periph *periph, union /*tag_action*/MSG_SIMPLE_Q_TAG, /*byte2*/0, /*data_ptr*/ buf, - /*dxfer_len*/ count * 16 + 8, + /*dxfer_len*/ ranges * 16 + 8, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 16:42:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52050106564A; Mon, 27 Aug 2012 16:42:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF268FC0C; Mon, 27 Aug 2012 16:42:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RGgX4K026014; Mon, 27 Aug 2012 16:42:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RGgX7q026012; Mon, 27 Aug 2012 16:42:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201208271642.q7RGgX7q026012@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 27 Aug 2012 16:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239738 - head/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 16:42:33 -0000 Author: luigi Date: Mon Aug 27 16:42:32 2012 New Revision: 239738 URL: http://svn.freebsd.org/changeset/base/239738 Log: use MALLOC_PRODUCTION for picobsd builds, be more frugal in memory usage. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Mon Aug 27 15:57:33 2012 (r239737) +++ head/release/picobsd/build/picobsd Mon Aug 27 16:42:32 2012 (r239738) @@ -7,6 +7,8 @@ # # picobsd [options] image_type [site_name] # +# CWARNFLAGS can be used to pass -Wall or similar options +# # Where image_type is a directory with the picobsd config info, # and ${image_type}/floppy.tree.${site_name} contains # optional site-specific configuration. @@ -164,7 +166,7 @@ create_includes_and_libraries2() { # opt log "create_includes_and_libraries2() for ${SRC} $1" if [ ${OSVERSION} -ge 600000 ] ; then no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" - no="$no -DWITHOUT_CLANG" + no="$no -DWITHOUT_CLANG -DMALLOC_PRODUCTION" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 17:15:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35D99106564A; Mon, 27 Aug 2012 17:15:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 213B58FC19; Mon, 27 Aug 2012 17:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RHFE3F029703; Mon, 27 Aug 2012 17:15:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RHFEO3029701; Mon, 27 Aug 2012 17:15:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271715.q7RHFEO3029701@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 17:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239739 - head/share/doc/smm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 17:15:15 -0000 Author: jhb Date: Mon Aug 27 17:15:14 2012 New Revision: 239739 URL: http://svn.freebsd.org/changeset/base/239739 Log: Don't build and install the 07.lpd doc if WITHOUT_LPR is set. MFC after: 1 week Modified: head/share/doc/smm/Makefile Modified: head/share/doc/smm/Makefile ============================================================================== --- head/share/doc/smm/Makefile Mon Aug 27 16:42:32 2012 (r239738) +++ head/share/doc/smm/Makefile Mon Aug 27 17:15:14 2012 (r239739) @@ -18,7 +18,7 @@ SUBDIR= title \ 04.quotas \ 05.fastfs \ 06.nfs \ - 07.lpd \ + ${_07.lpd} \ ${_08.sendmailop} \ 11.timedop \ 12.timed \ @@ -28,4 +28,8 @@ SUBDIR= title \ _08.sendmailop= 08.sendmailop .endif +.if ${MK_LPR} != "no" +_07.lpd= 07.lpd +.endif + .include From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 17:24:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38D10106566B; Mon, 27 Aug 2012 17:24:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232FC8FC15; Mon, 27 Aug 2012 17:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RHO8bJ030659; Mon, 27 Aug 2012 17:24:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RHO7R0030652; Mon, 27 Aug 2012 17:24:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271724.q7RHO7R0030652@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 17:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239740 - head/sys/dev/ida X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 17:24:08 -0000 Author: jhb Date: Mon Aug 27 17:24:07 2012 New Revision: 239740 URL: http://svn.freebsd.org/changeset/base/239740 Log: Rework the DMA handling in ida(4) and add locking to make this driver MPSAFE. - Preallocate a full set of QCBs during attach rather than allocating new ones on demand to avoid allocations in the I/O path. - Remove the explicit bus space tag/handle and use bus_*() on the relevant 'struct resource' instead. - Defer logical drive probing to an intrhook. - Fix ida_detach() to detach and delete child devices (logical drives). - Update the DMA handling to support EINPROGRESS by moving the work to submit a mapped request into the bus_dma callback routine as well as add support for freezing the queue when EINPROGRESS is encountered. Tested by: Marco Steinbach coco executive-computing de Modified: head/sys/dev/ida/ida.c head/sys/dev/ida/ida_disk.c head/sys/dev/ida/ida_eisa.c head/sys/dev/ida/ida_pci.c head/sys/dev/ida/idavar.h Modified: head/sys/dev/ida/ida.c ============================================================================== --- head/sys/dev/ida/ida.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida.c Mon Aug 27 17:24:07 2012 (r239740) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -56,17 +58,17 @@ __FBSDID("$FreeBSD$"); #include /* prototypes */ -static void ida_alloc_qcb(struct ida_softc *ida); -static void ida_construct_qcb(struct ida_softc *ida); -static void ida_start(struct ida_softc *ida); +static int ida_alloc_qcbs(struct ida_softc *ida); static void ida_done(struct ida_softc *ida, struct ida_qcb *qcb); +static void ida_start(struct ida_softc *ida); +static void ida_startio(struct ida_softc *ida); +static void ida_startup(void *arg); +static void ida_timeout(void *arg); static int ida_wait(struct ida_softc *ida, struct ida_qcb *qcb); -static void ida_timeout (void *arg); static d_ioctl_t ida_ioctl; static struct cdevsw ida_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_ioctl = ida_ioctl, .d_name = "ida", }; @@ -76,10 +78,16 @@ ida_free(struct ida_softc *ida) { int i; + if (ida->ih != NULL) + bus_teardown_intr(ida->dev, ida->irq, ida->ih); + + mtx_lock(&ida->lock); callout_stop(&ida->ch); + mtx_unlock(&ida->lock); + callout_drain(&ida->ch); if (ida->buffer_dmat) { - for (i = 0; i < ida->num_qcbs; i++) + for (i = 0; i < IDA_QCB_MAX; i++) bus_dmamap_destroy(ida->buffer_dmat, ida->qcbs[i].dmamap); bus_dma_tag_destroy(ida->buffer_dmat); } @@ -96,9 +104,6 @@ ida_free(struct ida_softc *ida) if (ida->qcbs != NULL) free(ida->qcbs, M_DEVBUF); - if (ida->ih != NULL) - bus_teardown_intr(ida->dev, ida->irq, ida->ih); - if (ida->irq != NULL) bus_release_resource(ida->dev, ida->irq_res_type, 0, ida->irq); @@ -109,6 +114,8 @@ ida_free(struct ida_softc *ida) if (ida->regs != NULL) bus_release_resource(ida->dev, ida->regs_res_type, ida->regs_res_id, ida->regs); + + mtx_destroy(&ida->lock); } /* @@ -130,14 +137,21 @@ ida_get_qcb(struct ida_softc *ida) if ((qcb = SLIST_FIRST(&ida->free_qcbs)) != NULL) { SLIST_REMOVE_HEAD(&ida->free_qcbs, link.sle); - } else { - ida_alloc_qcb(ida); - if ((qcb = SLIST_FIRST(&ida->free_qcbs)) != NULL) - SLIST_REMOVE_HEAD(&ida->free_qcbs, link.sle); + bzero(qcb->hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); } return (qcb); } +static __inline void +ida_free_qcb(struct ida_softc *ida, struct ida_qcb *qcb) +{ + + qcb->state = QCB_FREE; + qcb->buf = NULL; + qcb->error = 0; + SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); +} + static __inline bus_addr_t idahwqcbvtop(struct ida_softc *ida, struct ida_hardware_qcb *hwqcb) { @@ -155,42 +169,35 @@ idahwqcbptov(struct ida_softc *ida, bus_ return (hwqcb->qcb); } -/* - * XXX - * since we allocate all QCB space up front during initialization, then - * why bother with this routine? - */ -static void -ida_alloc_qcb(struct ida_softc *ida) +static int +ida_alloc_qcbs(struct ida_softc *ida) { struct ida_qcb *qcb; - int error; - - if (ida->num_qcbs >= IDA_QCB_MAX) - return; - - qcb = &ida->qcbs[ida->num_qcbs]; + int error, i; - error = bus_dmamap_create(ida->buffer_dmat, /*flags*/0, &qcb->dmamap); - if (error != 0) - return; + for (i = 0; i < IDA_QCB_MAX; i++) { + qcb = &ida->qcbs[i]; - qcb->flags = QCB_FREE; - qcb->hwqcb = &ida->hwqcbs[ida->num_qcbs]; - qcb->hwqcb->qcb = qcb; - qcb->hwqcb_busaddr = idahwqcbvtop(ida, qcb->hwqcb); - SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); - ida->num_qcbs++; + error = bus_dmamap_create(ida->buffer_dmat, /*flags*/0, &qcb->dmamap); + if (error != 0) + return (error); + + qcb->ida = ida; + qcb->flags = QCB_FREE; + qcb->hwqcb = &ida->hwqcbs[i]; + qcb->hwqcb->qcb = qcb; + qcb->hwqcb_busaddr = idahwqcbvtop(ida, qcb->hwqcb); + SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); + } + return (0); } int ida_init(struct ida_softc *ida) { - int error; - - ida->unit = device_get_unit(ida->dev); - ida->tag = rman_get_bustag(ida->regs); - ida->bsh = rman_get_bushandle(ida->regs); + struct ida_controller_info cinfo; + device_t child; + int error, i, unit; SLIST_INIT(&ida->free_qcbs); STAILQ_INIT(&ida->qcb_queue); @@ -219,8 +226,8 @@ ida_init(struct ida_softc *ida) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &ida->hwqcb_dmat); if (error) return (ENOMEM); @@ -258,26 +265,19 @@ ida_init(struct ida_softc *ida) bzero(ida->hwqcbs, IDA_QCB_MAX * sizeof(struct ida_hardware_qcb)); - ida_alloc_qcb(ida); /* allocate an initial qcb */ - - callout_init(&ida->ch, CALLOUT_MPSAFE); - - return (0); -} - -void -ida_attach(struct ida_softc *ida) -{ - struct ida_controller_info cinfo; - int error, i; + error = ida_alloc_qcbs(ida); + if (error) + return (error); + mtx_lock(&ida->lock); ida->cmd.int_enable(ida, 0); error = ida_command(ida, CMD_GET_CTRL_INFO, &cinfo, sizeof(cinfo), IDA_CONTROLLER, 0, DMA_DATA_IN); if (error) { + mtx_unlock(&ida->lock); device_printf(ida->dev, "CMD_GET_CTRL_INFO failed.\n"); - return; + return (error); } device_printf(ida->dev, "drives=%d firm_rev=%c%c%c%c\n", @@ -290,33 +290,68 @@ ida_attach(struct ida_softc *ida) error = ida_command(ida, CMD_START_FIRMWARE, &data, sizeof(data), IDA_CONTROLLER, 0, DMA_DATA_IN); if (error) { + mtx_unlock(&ida->lock); device_printf(ida->dev, "CMD_START_FIRMWARE failed.\n"); - return; + return (error); } } + + ida->cmd.int_enable(ida, 1); + ida->flags |= IDA_ATTACHED; + mtx_unlock(&ida->lock); + + for (i = 0; i < cinfo.num_drvs; i++) { + child = device_add_child(ida->dev, /*"idad"*/NULL, -1); + if (child != NULL) + device_set_ivars(child, (void *)(intptr_t)i); + } - ida->ida_dev_t = make_dev(&ida_cdevsw, ida->unit, + ida->ich.ich_func = ida_startup; + ida->ich.ich_arg = ida; + if (config_intrhook_establish(&ida->ich) != 0) { + device_delete_children(ida->dev); + device_printf(ida->dev, "Cannot establish configuration hook\n"); + return (error); + } + + unit = device_get_unit(ida->dev); + ida->ida_dev_t = make_dev(&ida_cdevsw, unit, UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, - "ida%d", ida->unit); + "ida%d", unit); ida->ida_dev_t->si_drv1 = ida; - ida->num_drives = 0; - for (i = 0; i < cinfo.num_drvs; i++) - device_add_child(ida->dev, /*"idad"*/NULL, -1); + return (0); +} + +static void +ida_startup(void *arg) +{ + struct ida_softc *ida; - bus_generic_attach(ida->dev); + ida = arg; - ida->cmd.int_enable(ida, 1); + config_intrhook_disestablish(&ida->ich); + + mtx_lock(&Giant); + bus_generic_attach(ida->dev); + mtx_unlock(&Giant); } int ida_detach(device_t dev) { struct ida_softc *ida; - int error = 0; + int error; ida = (struct ida_softc *)device_get_softc(dev); + error = bus_generic_detach(dev); + if (error) + return (error); + error = device_delete_children(dev); + if (error) + return (error); + /* * XXX * before detaching, we must make sure that the system is @@ -335,11 +370,25 @@ ida_detach(device_t dev) } static void -ida_setup_dmamap(void *arg, bus_dma_segment_t *segs, int nsegments, int error) +ida_data_cb(void *arg, bus_dma_segment_t *segs, int nsegments, int error) { - struct ida_hardware_qcb *hwqcb = (struct ida_hardware_qcb *)arg; + struct ida_hardware_qcb *hwqcb; + struct ida_softc *ida; + struct ida_qcb *qcb; + bus_dmasync_op_t op; int i; + qcb = arg; + ida = qcb->ida; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); + if (error) { + qcb->error = error; + ida_done(ida, qcb); + return; + } + + hwqcb = qcb->hwqcb; hwqcb->hdr.size = htole16((sizeof(struct ida_req) + sizeof(struct ida_sgb) * IDA_NSEG) >> 2); @@ -348,6 +397,47 @@ ida_setup_dmamap(void *arg, bus_dma_segm hwqcb->seg[i].length = htole32(segs[i].ds_len); } hwqcb->req.sgcount = nsegments; + if (qcb->flags & DMA_DATA_TRANSFER) { + switch (qcb->flags & DMA_DATA_TRANSFER) { + case DMA_DATA_TRANSFER: + op = BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE; + break; + case DMA_DATA_IN: + op = BUS_DMASYNC_PREREAD; + break; + default: + KASSERT((qcb->flags & DMA_DATA_TRANSFER) == + DMA_DATA_OUT, ("bad DMA data flags")); + op = BUS_DMASYNC_PREWRITE; + break; + } + bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); + } + bus_dmamap_sync(ida->hwqcb_dmat, ida->hwqcb_dmamap, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + + STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); + ida_start(ida); + ida->flags &= ~IDA_QFROZEN; +} + +static int +ida_map_qcb(struct ida_softc *ida, struct ida_qcb *qcb, void *data, + bus_size_t datasize) +{ + int error, flags; + + if (ida->flags & IDA_INTERRUPTS) + flags = BUS_DMA_WAITOK; + else + flags = BUS_DMA_NOWAIT; + error = bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, data, datasize, + ida_data_cb, qcb, flags); + if (error == EINPROGRESS) { + ida->flags |= IDA_QFROZEN; + error = 0; + } + return (error); } int @@ -356,105 +446,96 @@ ida_command(struct ida_softc *ida, int c { struct ida_hardware_qcb *hwqcb; struct ida_qcb *qcb; - bus_dmasync_op_t op; - int s, error; + int error; - s = splbio(); + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); qcb = ida_get_qcb(ida); - splx(s); if (qcb == NULL) { - printf("ida_command: out of QCBs"); + device_printf(ida->dev, "out of QCBs\n"); return (EAGAIN); } + qcb->flags = flags | IDA_COMMAND; hwqcb = qcb->hwqcb; - bzero(hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); - - bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, - (void *)data, datasize, ida_setup_dmamap, hwqcb, 0); - op = qcb->flags & DMA_DATA_IN ? - BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE; - bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); - hwqcb->hdr.drive = drive; hwqcb->req.blkno = htole32(pblkno); hwqcb->req.bcount = htole16(howmany(datasize, DEV_BSIZE)); hwqcb->req.command = command; - qcb->flags = flags | IDA_COMMAND; - - s = splbio(); - STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); - ida_start(ida); - error = ida_wait(ida, qcb); - splx(s); + error = ida_map_qcb(ida, qcb, data, datasize); + if (error == 0) { + error = ida_wait(ida, qcb); + /* Don't free QCB on a timeout in case it later completes. */ + if (error) + return (error); + error = qcb->error; + } /* XXX should have status returned here? */ /* XXX have "status pointer" area in QCB? */ + ida_free_qcb(ida, qcb); return (error); } void ida_submit_buf(struct ida_softc *ida, struct bio *bp) { + mtx_lock(&ida->lock); bioq_insert_tail(&ida->bio_queue, bp); - ida_construct_qcb(ida); - ida_start(ida); + ida_startio(ida); + mtx_unlock(&ida->lock); } static void -ida_construct_qcb(struct ida_softc *ida) +ida_startio(struct ida_softc *ida) { struct ida_hardware_qcb *hwqcb; struct ida_qcb *qcb; - bus_dmasync_op_t op; + struct idad_softc *drv; struct bio *bp; + int error; - bp = bioq_first(&ida->bio_queue); - if (bp == NULL) - return; /* no more buffers */ - - qcb = ida_get_qcb(ida); - if (qcb == NULL) - return; /* out of resources */ - - bioq_remove(&ida->bio_queue, bp); - qcb->buf = bp; - qcb->flags = bp->bio_cmd == BIO_READ ? DMA_DATA_IN : DMA_DATA_OUT; - - hwqcb = qcb->hwqcb; - bzero(hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); - - bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, - (void *)bp->bio_data, bp->bio_bcount, ida_setup_dmamap, hwqcb, 0); - op = qcb->flags & DMA_DATA_IN ? - BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE; - bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); + mtx_assert(&ida->lock, MA_OWNED); + for (;;) { + if (ida->flags & IDA_QFROZEN) + return; + bp = bioq_first(&ida->bio_queue); + if (bp == NULL) + return; /* no more buffers */ + + qcb = ida_get_qcb(ida); + if (qcb == NULL) + return; /* out of resources */ + + bioq_remove(&ida->bio_queue, bp); + qcb->buf = bp; + qcb->flags = bp->bio_cmd == BIO_READ ? DMA_DATA_IN : DMA_DATA_OUT; - { - struct idad_softc *drv = (struct idad_softc *)bp->bio_driver1; + hwqcb = qcb->hwqcb; + drv = bp->bio_driver1; hwqcb->hdr.drive = drv->drive; - } + hwqcb->req.blkno = bp->bio_pblkno; + hwqcb->req.bcount = howmany(bp->bio_bcount, DEV_BSIZE); + hwqcb->req.command = bp->bio_cmd == BIO_READ ? CMD_READ : CMD_WRITE; - hwqcb->req.blkno = bp->bio_pblkno; - hwqcb->req.bcount = howmany(bp->bio_bcount, DEV_BSIZE); - hwqcb->req.command = bp->bio_cmd == BIO_READ ? CMD_READ : CMD_WRITE; - - STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); + error = ida_map_qcb(ida, qcb, bp->bio_data, bp->bio_bcount); + if (error) { + qcb->error = error; + ida_done(ida, qcb); + } + } } -/* - * This routine will be called from ida_intr in order to queue up more - * I/O, meaning that we may be in an interrupt context. Hence, we should - * not muck around with spl() in this routine. - */ static void ida_start(struct ida_softc *ida) { struct ida_qcb *qcb; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); while ((qcb = STAILQ_FIRST(&ida->qcb_queue)) != NULL) { if (ida->cmd.fifo_full(ida)) break; @@ -465,7 +546,7 @@ ida_start(struct ida_softc *ida) */ /* Set a timeout. */ - if (!ida->qactive) + if (!ida->qactive && !dumping) callout_reset(&ida->ch, hz * 5, ida_timeout, ida); ida->qactive++; @@ -481,17 +562,23 @@ ida_wait(struct ida_softc *ida, struct i bus_addr_t completed; int delay; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); if (ida->flags & IDA_INTERRUPTS) { - if (tsleep(qcb, PRIBIO, "idacmd", 5 * hz)) + if (mtx_sleep(qcb, &ida->lock, PRIBIO, "idacmd", 5 * hz)) { + qcb->state = QCB_TIMEDOUT; return (ETIMEDOUT); + } return (0); } again: delay = 5 * 1000 * 100; /* 5 sec delay */ while ((completed = ida->cmd.done(ida)) == 0) { - if (delay-- == 0) + if (delay-- == 0) { + qcb->state = QCB_TIMEDOUT; return (ETIMEDOUT); + } DELAY(10); } @@ -511,8 +598,11 @@ ida_intr(void *data) ida = (struct ida_softc *)data; - if (ida->cmd.int_pending(ida) == 0) + mtx_lock(&ida->lock); + if (ida->cmd.int_pending(ida) == 0) { + mtx_unlock(&ida->lock); return; /* not our interrupt */ + } while ((completed = ida->cmd.done(ida)) != 0) { qcb = idahwqcbptov(ida, completed & ~3); @@ -527,7 +617,8 @@ ida_intr(void *data) qcb->hwqcb->req.error = CMD_REJECTED; ida_done(ida, qcb); } - ida_start(ida); + ida_startio(ida); + mtx_unlock(&ida->lock); } /* @@ -536,19 +627,35 @@ ida_intr(void *data) static void ida_done(struct ida_softc *ida, struct ida_qcb *qcb) { - int error = 0; + bus_dmasync_op_t op; + int active, error = 0; /* * finish up command */ - if (qcb->flags & DMA_DATA_TRANSFER) { - bus_dmasync_op_t op; - - op = qcb->flags & DMA_DATA_IN ? - BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); + active = (qcb->state != QCB_FREE); + if (qcb->flags & DMA_DATA_TRANSFER && active) { + switch (qcb->flags & DMA_DATA_TRANSFER) { + case DMA_DATA_TRANSFER: + op = BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE; + break; + case DMA_DATA_IN: + op = BUS_DMASYNC_POSTREAD; + break; + default: + KASSERT((qcb->flags & DMA_DATA_TRANSFER) == + DMA_DATA_OUT, ("bad DMA data flags")); + op = BUS_DMASYNC_POSTWRITE; + break; + } bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); bus_dmamap_unload(ida->buffer_dmat, qcb->dmamap); } + if (active) + bus_dmamap_sync(ida->hwqcb_dmat, ida->hwqcb_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); if (qcb->hwqcb->req.error & SOFT_ERROR) { if (qcb->buf) @@ -571,32 +678,37 @@ ida_done(struct ida_softc *ida, struct i error = 1; device_printf(ida->dev, "invalid request\n"); } + if (qcb->error) { + error = 1; + device_printf(ida->dev, "request failed to map: %d\n", qcb->error); + } if (qcb->flags & IDA_COMMAND) { if (ida->flags & IDA_INTERRUPTS) wakeup(qcb); + if (qcb->state == QCB_TIMEDOUT) + ida_free_qcb(ida, qcb); } else { KASSERT(qcb->buf != NULL, ("ida_done(): qcb->buf is NULL!")); if (error) qcb->buf->bio_flags |= BIO_ERROR; idad_intr(qcb->buf); + ida_free_qcb(ida, qcb); } + if (!active) + return; + ida->qactive--; /* Reschedule or cancel timeout */ if (ida->qactive) callout_reset(&ida->ch, hz * 5, ida_timeout, ida); else callout_stop(&ida->ch); - - qcb->state = QCB_FREE; - qcb->buf = NULL; - SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); - ida_construct_qcb(ida); } static void -ida_timeout (void *arg) +ida_timeout(void *arg) { struct ida_softc *ida; @@ -661,8 +773,10 @@ ida_ioctl (struct cdev *dev, u_long cmd, daddr = &data; len = sizeof(data); } + mtx_lock(&sc->lock); error = ida_command(sc, uc->command, daddr, len, uc->drive, uc->blkno, flags); + mtx_unlock(&sc->lock); break; default: error = ENOIOCTL; Modified: head/sys/dev/ida/ida_disk.c ============================================================================== --- head/sys/dev/ida/ida_disk.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida_disk.c Mon Aug 27 17:24:07 2012 (r239740) @@ -87,7 +87,6 @@ static void idad_strategy(struct bio *bp) { struct idad_softc *drv; - int s; drv = bp->bio_disk->d_drv1; if (drv == NULL) { @@ -104,9 +103,7 @@ idad_strategy(struct bio *bp) } bp->bio_driver1 = drv; - s = splbio(); ida_submit_buf(drv->controller, bp); - splx(s); return; bad: @@ -179,11 +176,12 @@ idad_attach(device_t dev) drv->dev = dev; drv->controller = (struct ida_softc *)device_get_softc(parent); drv->unit = device_get_unit(dev); - drv->drive = drv->controller->num_drives; - drv->controller->num_drives++; + drv->drive = (intptr_t)device_get_ivars(dev); + mtx_lock(&drv->controller->lock); error = ida_command(drv->controller, CMD_GET_LOG_DRV_INFO, &dinfo, sizeof(dinfo), drv->drive, 0, DMA_DATA_IN); + mtx_unlock(&drv->controller->lock); if (error) { device_printf(dev, "CMD_GET_LOG_DRV_INFO failed\n"); return (ENXIO); @@ -213,7 +211,6 @@ idad_attach(device_t dev) drv->disk->d_drv1 = drv; drv->disk->d_maxsize = DFLTPHYS; /* XXX guess? */ drv->disk->d_unit = drv->unit; - drv->disk->d_flags = DISKFLAG_NEEDSGIANT; disk_create(drv->disk, DISK_VERSION); return (0); Modified: head/sys/dev/ida/ida_eisa.c ============================================================================== --- head/sys/dev/ida/ida_eisa.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida_eisa.c Mon Aug 27 17:24:07 2012 (r239740) @@ -282,6 +282,8 @@ ida_eisa_attach(device_t dev) board = ida_eisa_match(eisa_get_id(dev)); ida->cmd = *board->accessor; ida->flags = board->flags; + mtx_init(&ida->lock, "ida", NULL, MTX_DEF); + callout_init_mtx(&ida->ch, &ida->lock, 0); ida->regs_res_type = SYS_RES_IOPORT; ida->regs_res_id = 0; @@ -293,7 +295,7 @@ ida_eisa_attach(device_t dev) } error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 0, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, @@ -323,7 +325,7 @@ ida_eisa_attach(device_t dev) return (ENOMEM); } - error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, + error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, NULL, ida_intr, ida, &ida->ih); if (error) { device_printf(dev, "can't setup interrupt\n"); @@ -337,9 +339,6 @@ ida_eisa_attach(device_t dev) return (error); } - ida_attach(ida); - ida->flags |= IDA_ATTACHED; - return (0); } Modified: head/sys/dev/ida/ida_pci.c ============================================================================== --- head/sys/dev/ida/ida_pci.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida_pci.c Mon Aug 27 17:24:07 2012 (r239740) @@ -236,23 +236,14 @@ ida_pci_attach(device_t dev) struct ida_board *board = ida_pci_match(dev); u_int32_t id = pci_get_devid(dev); struct ida_softc *ida; - u_int command; int error, rid; - command = pci_read_config(dev, PCIR_COMMAND, 1); - - /* - * it appears that this board only does MEMIO access. - */ - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Only memory mapped I/O is supported\n"); - return (ENXIO); - } - ida = (struct ida_softc *)device_get_softc(dev); ida->dev = dev; ida->cmd = *board->accessor; ida->flags = board->flags; + mtx_init(&ida->lock, "ida", NULL, MTX_DEF); + callout_init_mtx(&ida->ch, &ida->lock, 0); ida->regs_res_type = SYS_RES_MEMORY; ida->regs_res_id = IDA_PCI_MEMADDR; @@ -295,7 +286,7 @@ ida_pci_attach(device_t dev) ida_free(ida); return (ENOMEM); } - error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, + error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, NULL, ida_intr, ida, &ida->ih); if (error) { device_printf(dev, "can't setup interrupt\n"); @@ -308,8 +299,6 @@ ida_pci_attach(device_t dev) ida_free(ida); return (error); } - ida_attach(ida); - ida->flags |= IDA_ATTACHED; return (0); } Modified: head/sys/dev/ida/idavar.h ============================================================================== --- head/sys/dev/ida/idavar.h Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/idavar.h Mon Aug 27 17:24:07 2012 (r239740) @@ -34,18 +34,18 @@ #define _IDAVAR_H #define ida_inb(ida, port) \ - bus_space_read_1((ida)->tag, (ida)->bsh, port) + bus_read_1((ida)->regs, port) #define ida_inw(ida, port) \ - bus_space_read_2((ida)->tag, (ida)->bsh, port) + bus_read_2((ida)->regs, port) #define ida_inl(ida, port) \ - bus_space_read_4((ida)->tag, (ida)->bsh, port) + bus_read_4((ida)->regs, port) #define ida_outb(ida, port, val) \ - bus_space_write_1((ida)->tag, (ida)->bsh, port, val) + bus_write_1((ida)->regs, port, val) #define ida_outw(ida, port, val) \ - bus_space_write_2((ida)->tag, (ida)->bsh, port, val) + bus_write_2((ida)->regs, port, val) #define ida_outl(ida, port, val) \ - bus_space_write_4((ida)->tag, (ida)->bsh, port, val) + bus_write_4((ida)->regs, port, val) struct ida_hdr { u_int8_t drive; /* logical drive */ @@ -83,6 +83,7 @@ struct ida_hardware_qcb { typedef enum { QCB_FREE = 0x0000, QCB_ACTIVE = 0x0001, /* waiting for completion */ + QCB_TIMEDOUT = 0x0002, } qcb_state; #define DMA_DATA_IN 0x0001 @@ -93,8 +94,11 @@ typedef enum { #define IDA_QCB_MAX 256 #define IDA_CONTROLLER 0 /* drive "number" for controller */ +struct ida_softc; + struct ida_qcb { struct ida_hardware_qcb *hwqcb; + struct ida_softc *ida; qcb_state state; short flags; union { @@ -104,10 +108,9 @@ struct ida_qcb { bus_dmamap_t dmamap; bus_addr_t hwqcb_busaddr; struct bio *buf; /* bio associated with qcb */ + int error; }; -struct ida_softc; - struct ida_access { int (*fifo_full)(struct ida_softc *); void (*submit)(struct ida_softc *, struct ida_qcb *); @@ -122,10 +125,10 @@ struct ida_access { #define IDA_ATTACHED 0x01 /* attached */ #define IDA_FIRMWARE 0x02 /* firmware must be started */ #define IDA_INTERRUPTS 0x04 /* interrupts enabled */ +#define IDA_QFROZEN 0x08 /* request queue frozen */ struct ida_softc { device_t dev; - int unit; struct callout ch; struct cdev *ida_dev_t; @@ -138,8 +141,8 @@ struct ida_softc { struct resource *irq; void *ih; - bus_space_tag_t tag; - bus_space_handle_t bsh; + struct mtx lock; + struct intr_config_hook ich; /* various DMA tags */ bus_dma_tag_t parent_dmat; @@ -151,8 +154,6 @@ struct ida_softc { bus_dma_tag_t sg_dmat; - int num_drives; - int num_qcbs; int flags; int qactive; @@ -197,7 +198,6 @@ extern struct ida_softc *ida_alloc(devic int regs_type, int regs_id, bus_dma_tag_t parent_dmat); extern void ida_free(struct ida_softc *ida); extern int ida_init(struct ida_softc *ida); -extern void ida_attach(struct ida_softc *ida); extern int ida_command(struct ida_softc *ida, int command, void *data, int datasize, int drive, u_int32_t pblkno, int flags); extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp); From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 18:10:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0FA70106566B; Mon, 27 Aug 2012 18:10:26 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE2708FC1E; Mon, 27 Aug 2012 18:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RIAPqg036062; Mon, 27 Aug 2012 18:10:25 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RIAPT8036055; Mon, 27 Aug 2012 18:10:25 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271810.q7RIAPT8036055@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 18:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239741 - in releng/9.1/sys/dev/isci: . scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 18:10:26 -0000 Author: jimharris Date: Mon Aug 27 18:10:25 2012 New Revision: 239741 URL: http://svn.freebsd.org/changeset/base/239741 Log: MFC r239545: Fix/add isci(4) support for SCSI UNMAP to ATA DSM translation. This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. Sponsored by: Intel Approved by: re (kib) Modified: releng/9.1/sys/dev/isci/isci.c releng/9.1/sys/dev/isci/isci.h releng/9.1/sys/dev/isci/isci_controller.c releng/9.1/sys/dev/isci/scil/sati_unmap.c releng/9.1/sys/dev/isci/scil/scif_sas_sati_binding.h releng/9.1/sys/dev/isci/scil/scif_sas_stp_io_request.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/isci/isci.c ============================================================================== --- releng/9.1/sys/dev/isci/isci.c Mon Aug 27 17:24:07 2012 (r239740) +++ releng/9.1/sys/dev/isci/isci.c Mon Aug 27 18:10:25 2012 (r239741) @@ -185,6 +185,7 @@ isci_detach(device_t device) for (i = 0; i < isci->controller_count; i++) { struct ISCI_CONTROLLER *controller = &isci->controllers[i]; SCI_STATUS status; + void *unmap_buffer; if (controller->scif_controller_handle != NULL) { scic_controller_disable_interrupts( @@ -218,6 +219,13 @@ isci_detach(device_t device) if (controller->remote_device_memory != NULL) free(controller->remote_device_memory, M_ISCI); + + while (1) { + sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); + if (unmap_buffer == NULL) + break; + contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + } } /* The SCIF controllers have been stopped, so we can now Modified: releng/9.1/sys/dev/isci/isci.h ============================================================================== --- releng/9.1/sys/dev/isci/isci.h Mon Aug 27 17:24:07 2012 (r239740) +++ releng/9.1/sys/dev/isci/isci.h Mon Aug 27 18:10:25 2012 (r239741) @@ -175,6 +175,7 @@ struct ISCI_CONTROLLER SCI_POOL_CREATE(remote_device_pool, struct ISCI_REMOTE_DEVICE *, SCI_MAX_REMOTE_DEVICES); SCI_POOL_CREATE(request_pool, struct ISCI_REQUEST *, SCI_MAX_IO_REQUESTS); SCI_POOL_CREATE(timer_pool, struct ISCI_TIMER *, SCI_MAX_TIMERS); + SCI_POOL_CREATE(unmap_buffer_pool, void *, SCI_MAX_REMOTE_DEVICES); }; struct ISCI_REQUEST Modified: releng/9.1/sys/dev/isci/isci_controller.c ============================================================================== --- releng/9.1/sys/dev/isci/isci_controller.c Mon Aug 27 17:24:07 2012 (r239740) +++ releng/9.1/sys/dev/isci/isci_controller.c Mon Aug 27 18:10:25 2012 (r239741) @@ -145,6 +145,14 @@ void scif_cb_controller_stop_complete(SC isci_controller->is_started = FALSE; } +static void +isci_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + SCI_PHYSICAL_ADDRESS *phys_addr = arg; + + *phys_addr = seg[0].ds_addr; +} + /** * @brief This method will be invoked to allocate memory dynamically. * @@ -159,7 +167,29 @@ void scif_cb_controller_stop_complete(SC void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T *mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Note this routine is only used for buffers needed to translate + * SCSI UNMAP commands to ATA DSM commands for SATA disks. + * + * We first try to pull a buffer from the controller's pool, and only + * call contigmalloc if one isn't there. + */ + if (!sci_pool_empty(isci_controller->unmap_buffer_pool)) { + sci_pool_get(isci_controller->unmap_buffer_pool, + mde->virtual_address); + } else + mde->virtual_address = contigmalloc(PAGE_SIZE, + M_ISCI, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + mde->constant_memory_alignment, 0); + + if (mde->virtual_address != NULL) + bus_dmamap_load(isci_controller->buffer_dma_tag, + NULL, mde->virtual_address, PAGE_SIZE, + isci_single_map, &mde->physical_address, + BUS_DMA_NOWAIT); } /** @@ -176,7 +206,16 @@ void scif_cb_controller_allocate_memory( void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Put the buffer back into the controller's buffer pool, rather + * than invoking configfree. This helps reduce chance we won't + * have buffers available when system is under memory pressure. + */ + sci_pool_put(isci_controller->unmap_buffer_pool, + mde->virtual_address); } void isci_controller_construct(struct ISCI_CONTROLLER *controller, @@ -228,6 +267,8 @@ void isci_controller_construct(struct IS for ( int i = 0; i < SCI_MAX_TIMERS; i++ ) { sci_pool_put(controller->timer_pool, timer++); } + + sci_pool_initialize(controller->unmap_buffer_pool); } SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller) Modified: releng/9.1/sys/dev/isci/scil/sati_unmap.c ============================================================================== --- releng/9.1/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 17:24:07 2012 (r239740) +++ releng/9.1/sys/dev/isci/scil/sati_unmap.c Mon Aug 27 18:10:25 2012 (r239741) @@ -335,8 +335,8 @@ SATI_STATUS sati_unmap_initial_processin sati_scsi_sense_data_construct( sequence, scsi_io, - SCSI_STATUS_CHECK_CONDITION, - SCSI_SENSE_ABORTED_COMMAND, + SCSI_STATUS_BUSY, + SCSI_SENSE_NO_SENSE, SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_NO_ADDITIONAL_SENSE ); Modified: releng/9.1/sys/dev/isci/scil/scif_sas_sati_binding.h ============================================================================== --- releng/9.1/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 17:24:07 2012 (r239740) +++ releng/9.1/sys/dev/isci/scil/scif_sas_sati_binding.h Mon Aug 27 18:10:25 2012 (r239741) @@ -183,22 +183,16 @@ extern "C" { { \ SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ - SCI_PHYSICAL_ADDRESS phys_addr; \ mde.virtual_address = NULL; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, length, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ scif_cb_controller_allocate_memory( \ fw_request->device->domain->controller, &mde \ ); \ - scic_cb_io_request_get_physical_address(fw_request->device->domain->controller, \ - NULL, \ - mde.virtual_address, \ - &phys_addr); \ *(virt_address) = mde.virtual_address; \ - *(phys_address_low) = sci_cb_physical_address_lower(phys_addr); \ - *(phys_address_high) = sci_cb_physical_address_upper(phys_addr); \ + *(phys_address_low) = sci_cb_physical_address_lower(mde.physical_address); \ + *(phys_address_high) = sci_cb_physical_address_upper(mde.physical_address); \ } #define sati_cb_free_dma_buffer(scsi_io, virt_address) \ @@ -206,7 +200,6 @@ extern "C" { SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ mde.virtual_address = virt_address; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, 0, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ Modified: releng/9.1/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- releng/9.1/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 17:24:07 2012 (r239740) +++ releng/9.1/sys/dev/isci/scil/scif_sas_stp_io_request.c Mon Aug 27 18:10:25 2012 (r239741) @@ -171,6 +171,8 @@ SCI_STATUS scif_sas_stp_io_request_const ); } + sati_sequence_terminate(&fw_io->parent.stp.sequence, fw_io, fw_io); + return SCI_SUCCESS; } /** From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 18:12:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 873E11065677; Mon, 27 Aug 2012 18:12:08 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72BFE8FC16; Mon, 27 Aug 2012 18:12:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RIC8VI036315; Mon, 27 Aug 2012 18:12:08 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RIC8bq036313; Mon, 27 Aug 2012 18:12:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271812.q7RIC8bq036313@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 18:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239742 - releng/9.1/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 18:12:08 -0000 Author: jimharris Date: Mon Aug 27 18:12:08 2012 New Revision: 239742 URL: http://svn.freebsd.org/changeset/base/239742 Log: MFC r239655: Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local variable when determining various sizes related to SCSI UNMAP block descriptor lists. Sponsored by: Intel Approved by: re (kib) Modified: releng/9.1/sys/cam/scsi/scsi_da.c Directory Properties: releng/9.1/sys/ (props changed) Modified: releng/9.1/sys/cam/scsi/scsi_da.c ============================================================================== --- releng/9.1/sys/cam/scsi/scsi_da.c Mon Aug 27 18:10:25 2012 (r239741) +++ releng/9.1/sys/cam/scsi/scsi_da.c Mon Aug 27 18:12:08 2012 (r239742) @@ -1788,8 +1788,8 @@ dastart(struct cam_periph *periph, union softc->params.secsize > softc->unmap_max_lba) break; } while (1); - scsi_ulto2b(count * 16 + 6, &buf[0]); - scsi_ulto2b(count * 16, &buf[2]); + scsi_ulto2b(ranges * 16 + 6, &buf[0]); + scsi_ulto2b(ranges * 16, &buf[2]); scsi_unmap(&start_ccb->csio, /*retries*/da_retry_count, @@ -1797,7 +1797,7 @@ dastart(struct cam_periph *periph, union /*tag_action*/MSG_SIMPLE_Q_TAG, /*byte2*/0, /*data_ptr*/ buf, - /*dxfer_len*/ count * 16 + 8, + /*dxfer_len*/ ranges * 16 + 8, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 18:14:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8E8106566B; Mon, 27 Aug 2012 18:14:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 866748FC12; Mon, 27 Aug 2012 18:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RIEM1Z036595; Mon, 27 Aug 2012 18:14:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RIEMEh036592; Mon, 27 Aug 2012 18:14:22 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208271814.q7RIEMEh036592@svn.freebsd.org> From: Jim Harris Date: Mon, 27 Aug 2012 18:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239743 - releng/9.1/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 18:14:22 -0000 Author: jimharris Date: Mon Aug 27 18:14:22 2012 New Revision: 239743 URL: http://svn.freebsd.org/changeset/base/239743 Log: MFC r239665: Clear freeze bit before calling xpt_release_devq. This ensures that any ccbs which immediately start during the call to xpt_release_devq see an accurate picture of the frozen_lun_mask. Sponsored by: Intel Approved by: re (kib) Modified: releng/9.1/sys/dev/isci/isci_remote_device.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/isci/isci_remote_device.c ============================================================================== --- releng/9.1/sys/dev/isci/isci_remote_device.c Mon Aug 27 18:12:08 2012 (r239742) +++ releng/9.1/sys/dev/isci/isci_remote_device.c Mon Aug 27 18:14:22 2012 (r239743) @@ -278,12 +278,12 @@ isci_remote_device_release_lun_queue(str if (remote_device->frozen_lun_mask & (1 << lun)) { struct cam_path *path; + remote_device->frozen_lun_mask &= ~(1 << lun); xpt_create_path(&path, xpt_periph, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); xpt_free_path(path); - remote_device->frozen_lun_mask &= ~(1 << lun); } } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:08:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 424D410656DF; Mon, 27 Aug 2012 19:08:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DC738FC1C; Mon, 27 Aug 2012 19:08:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJ8mui043044; Mon, 27 Aug 2012 19:08:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJ8l79043041; Mon, 27 Aug 2012 19:08:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208271908.q7RJ8l79043041@svn.freebsd.org> From: Xin LI Date: Mon, 27 Aug 2012 19:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239744 - head/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:08:48 -0000 Author: delphij Date: Mon Aug 27 19:08:47 2012 New Revision: 239744 URL: http://svn.freebsd.org/changeset/base/239744 Log: Show error messages if nmount() failed. MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Aug 27 18:14:22 2012 (r239743) +++ head/usr.sbin/mountd/mountd.c Mon Aug 27 19:08:47 2012 (r239744) @@ -2461,11 +2461,11 @@ do_mount(struct exportlist *ep, struct g } if (errno == EPERM) { if (debug) - warnx("can't change attributes for %s", - dirp); + warnx("can't change attributes for %s: %s", + dirp, errmsg); syslog(LOG_ERR, - "can't change attributes for %s", - dirp); + "can't change attributes for %s: %s", + dirp, errmsg); ret = 1; goto error_exit; } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:20:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 052C2106566B; Mon, 27 Aug 2012 19:20:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E38528FC0C; Mon, 27 Aug 2012 19:20:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJKwML044457; Mon, 27 Aug 2012 19:20:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJKwhe044455; Mon, 27 Aug 2012 19:20:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208271920.q7RJKwhe044455@svn.freebsd.org> From: Martin Matuska Date: Mon, 27 Aug 2012 19:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239745 - vendor/illumos/dist/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:20:59 -0000 Author: mm Date: Mon Aug 27 19:20:58 2012 New Revision: 239745 URL: http://svn.freebsd.org/changeset/base/239745 Log: Add zpool-features.5 vendor manual page, revision 13753:2aba784c276b Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/man/man5/ vendor/illumos/dist/man/man5/zpool-features.5 Added: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/man/man5/zpool-features.5 Mon Aug 27 19:20:58 2012 (r239745) @@ -0,0 +1,173 @@ +'\" te +.\" Copyright (c) 2012 by Delphix. All rights reserved. +.\" The contents of this file are subject to the terms of the Common Development +.\" and Distribution License (the "License"). You may not use this file except +.\" in compliance with the License. You can obtain a copy of the license at +.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. +.\" +.\" See the License for the specific language governing permissions and +.\" limitations under the License. When distributing Covered Code, include this +.\" CDDL HEADER in each file and include the License file at +.\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this +.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your +.\" own identifying information: +.\" Portions Copyright [yyyy] [name of copyright owner] +.TH ZPOOL-FEATURES 5 "Mar 16, 2012" +.SH NAME +zpool\-features \- ZFS pool feature descriptions +.SH DESCRIPTION +.sp +.LP +ZFS pool on\-disk format versions are specified via "features" which replace +the old on\-disk format numbers (the last supported on\-disk format number is +28). To enable a feature on a pool use the \fBupgrade\fR subcommand of the +\fBzpool\fR(1M) command, or set the \fBfeature@\fR\fIfeature_name\fR property +to \fBenabled\fR. +.sp +.LP +The pool format does not affect file system version compatibility or the ability +to send file systems between pools. +.sp +.LP +Since most features can be enabled independently of each other the on\-disk +format of the pool is specified by the set of all features marked as +\fBactive\fR on the pool. If the pool was created by another software version +this set may include unsupported features. +.SS "Identifying features" +.sp +.LP +Every feature has a guid of the form \fIcom.example:feature_name\fR. The reverse +DNS name ensures that the feature's guid is unique across all ZFS +implementations. When unsupported features are encountered on a pool they will +be identified by their guids. Refer to the documentation for the ZFS +implementation that created the pool for information about those features. +.sp +.LP +Each supported feature also has a short name. By convention a feature's short +name is the portion of its guid which follows the ':' (e.g. +\fIcom.example:feature_name\fR would have the short name \fIfeature_name\fR), +however a feature's short name may differ across ZFS implementations if +following the convention would result in name conflicts. +.SS "Feature states" +.sp +.LP +Features can be in one of three states: +.sp +.ne 2 +.na +\fB\fBactive\fR\fR +.ad +.RS 12n +This feature's on\-disk format changes are in effect on the pool. Support for +this feature is required to import the pool in read\-write mode. If this +feature is not read-only compatible, support is also required to import the pool +in read\-only mode (see "Read\-only compatibility"). +.RE + +.sp +.ne 2 +.na +\fB\fBenabled\fR\fR +.ad +.RS 12n +An administrator has marked this feature as enabled on the pool, but the +feature's on\-disk format changes have not been made yet. The pool can still be +imported by software that does not support this feature, but changes may be made +to the on\-disk format at any time which will move the feature to the +\fBactive\fR state. Some features may support returning to the \fBenabled\fR +state after becoming \fBactive\fR. See feature\-specific documentation for +details. +.RE + +.sp +.ne 2 +.na +\fBdisabled\fR +.ad +.RS 12n +This feature's on\-disk format changes have not been made and will not be made +unless an administrator moves the feature to the \fBenabled\fR state. Features +cannot be disabled once they have been enabled. +.RE + +.sp +.LP +The state of supported features is exposed through pool properties of the form +\fIfeature@short_name\fR. +.SS "Read\-only compatibility" +.sp +.LP +Some features may make on\-disk format changes that do not interfere with other +software's ability to read from the pool. These features are referred to as +"read\-only compatible". If all unsupported features on a pool are read\-only +compatible, the pool can be imported in read\-only mode by setting the +\fBreadonly\fR property during import (see \fBzpool\fR(1M) for details on +importing pools). +.SS "Unsupported features" +.sp +.LP +For each unsupported feature enabled on an imported pool a pool property +named \fIunsupported@feature_guid\fR will indicate why the import was allowed +despite the unsupported feature. Possible values for this property are: + +.sp +.ne 2 +.na +\fB\fBinactive\fR\fR +.ad +.RS 12n +The feature is in the \fBenabled\fR state and therefore the pool's on\-disk +format is still compatible with software that does not support this feature. +.RE + +.sp +.ne 2 +.na +\fB\fBreadonly\fR\fR +.ad +.RS 12n +The feature is read\-only compatible and the pool has been imported in +read\-only mode. +.RE + +.SS "Feature dependencies" +.sp +.LP +Some features depend on other features being enabled in order to function +properly. Enabling a feature will automatically enable any features it +depends on. +.SH FEATURES +.sp +.LP +The following features are supported on this system: +.sp +.ne 2 +.na +\fB\fBasync_destroy\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.delphix:async_destroy +READ\-ONLY COMPATIBLE yes +DEPENDENCIES none +.TE + +Destroying a file system requires traversing all of its data in order to +return its used space to the pool. Without \fBasync_destroy\fR the file system +is not fully removed until all space has been reclaimed. If the destroy +operation is interrupted by a reboot or power outage the next attempt to open +the pool will need to complete the destroy operation synchronously. + +When \fBasync_destroy\fR is enabled the file system's data will be reclaimed +by a background process, allowing the destroy operation to complete without +traversing the entire file system. The background process is able to resume +interrupted destroys after the pool has been opened, eliminating the need +to finish interrupted destroys as part of the open operation. The amount +of space remaining to be reclaimed by the background process is available +through the \fBfreeing\fR property. + +This feature is only \fBactive\fR while \fBfreeing\fR is non\-zero. +.RE +.SH "SEE ALSO" +\fBzpool\fR(1M) From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:25:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39AB6106566C; Mon, 27 Aug 2012 19:25:21 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2010C8FC27; Mon, 27 Aug 2012 19:25:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJPKgt044995; Mon, 27 Aug 2012 19:25:20 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJPKhE044973; Mon, 27 Aug 2012 19:25:20 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208271925.q7RJPKhE044973@svn.freebsd.org> From: Martin Matuska Date: Mon, 27 Aug 2012 19:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239746 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zinject vendor/illumos/dist/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:25:21 -0000 Author: mm Date: Mon Aug 27 19:25:20 2012 New Revision: 239746 URL: http://svn.freebsd.org/changeset/base/239746 Log: Update vendor/illumos/dist and vendor/illumos-gate/dist to illumos-gate revision 13782:8f78aae28a63 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bpobj.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zinject/zinject.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/man/man5/zpool-features.5 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Mon Aug 27 19:25:20 2012 (r239746) @@ -153,4 +153,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_ASYNC_DESTROY, "com.delphix:async_destroy", "async_destroy", "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, + "com.delphix:empty_bpobj", "empty_bpobj", + "Snapshots use less space.", B_TRUE, B_FALSE, NULL); } Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Mon Aug 27 19:25:20 2012 (r239746) @@ -51,6 +51,7 @@ typedef int (zfeature_func_t)(zfeature_i enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURES } spa_feature_t; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Mon Aug 27 19:25:20 2012 (r239746) @@ -20,13 +20,61 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include #include #include #include +#include +#include + +/* + * Return an empty bpobj, preferably the empty dummy one (dp_empty_bpobj). + */ +uint64_t +bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx) +{ + zfeature_info_t *empty_bpobj_feat = + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; + spa_t *spa = dmu_objset_spa(os); + dsl_pool_t *dp = dmu_objset_pool(os); + + if (spa_feature_is_enabled(spa, empty_bpobj_feat)) { + if (!spa_feature_is_active(spa, empty_bpobj_feat)) { + ASSERT3U(dp->dp_empty_bpobj, ==, 0); + dp->dp_empty_bpobj = + bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); + VERIFY(zap_add(os, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, + &dp->dp_empty_bpobj, tx) == 0); + } + spa_feature_incr(spa, empty_bpobj_feat, tx); + ASSERT(dp->dp_empty_bpobj != 0); + return (dp->dp_empty_bpobj); + } else { + return (bpobj_alloc(os, blocksize, tx)); + } +} + +void +bpobj_decr_empty(objset_t *os, dmu_tx_t *tx) +{ + zfeature_info_t *empty_bpobj_feat = + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; + dsl_pool_t *dp = dmu_objset_pool(os); + + spa_feature_decr(dmu_objset_spa(os), empty_bpobj_feat, tx); + if (!spa_feature_is_active(dmu_objset_spa(os), empty_bpobj_feat)) { + VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, tx)); + VERIFY3U(0, ==, dmu_object_free(os, dp->dp_empty_bpobj, tx)); + dp->dp_empty_bpobj = 0; + } +} uint64_t bpobj_alloc(objset_t *os, int blocksize, dmu_tx_t *tx) @@ -53,6 +101,7 @@ bpobj_free(objset_t *os, uint64_t obj, d int epb; dmu_buf_t *dbuf = NULL; + ASSERT(obj != dmu_objset_pool(os)->dp_empty_bpobj); VERIFY3U(0, ==, bpobj_open(&bpo, os, obj)); mutex_enter(&bpo.bpo_lock); @@ -320,6 +369,12 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 ASSERT(bpo->bpo_havesubobj); ASSERT(bpo->bpo_havecomp); + ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj); + + if (subobj == dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj) { + bpobj_decr_empty(bpo->bpo_os, tx); + return; + } VERIFY3U(0, ==, bpobj_open(&subbpo, bpo->bpo_os, subobj)); VERIFY3U(0, ==, bpobj_space(&subbpo, &used, &comp, &uncomp)); @@ -388,6 +443,7 @@ bpobj_enqueue(bpobj_t *bpo, const blkptr blkptr_t *bparray; ASSERT(!BP_IS_HOLE(bp)); + ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj); /* We never need the fill count. */ stored_bp.blk_fill = 0; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Mon Aug 27 19:25:20 2012 (r239746) @@ -1236,15 +1236,6 @@ dmu_objset_is_dirty(objset_t *os, uint64 !list_is_empty(&os->os_free_dnodes[txg & TXG_MASK])); } -boolean_t -dmu_objset_is_dirty_anywhere(objset_t *os) -{ - for (int t = 0; t < TXG_SIZE; t++) - if (dmu_objset_is_dirty(os, t)) - return (B_TRUE); - return (B_FALSE); -} - static objset_used_cb_t *used_cbs[DMU_OST_NUMTYPES]; void Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Mon Aug 27 19:25:20 2012 (r239746) @@ -1210,6 +1210,17 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu } } +boolean_t +dsl_dataset_is_dirty(dsl_dataset_t *ds) +{ + for (int t = 0; t < TXG_SIZE; t++) { + if (txg_list_member(&ds->ds_dir->dd_pool->dp_dirty_datasets, + ds, t)) + return (B_TRUE); + } + return (B_FALSE); +} + /* * The unique space in the head dataset can be calculated by subtracting * the space used in the most recent snapshot, that is still being used @@ -3432,9 +3443,6 @@ dsl_dataset_set_quota_sync(void *arg1, v if (ds->ds_quota != effective_value) { dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_quota = effective_value; - - spa_history_log_internal_ds(ds, "set refquota", tx, - "refquota=%lld", (longlong_t)ds->ds_quota); } } @@ -3538,9 +3546,6 @@ dsl_dataset_set_reservation_sync(void *a dsl_dir_diduse_space(ds->ds_dir, DD_USED_REFRSRV, delta, 0, 0, tx); mutex_exit(&ds->ds_dir->dd_lock); - - spa_history_log_internal_ds(ds, "set refreservation", tx, - "refreservation=%lld", (longlong_t)effective_value); } int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Mon Aug 27 19:25:20 2012 (r239746) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -163,12 +163,49 @@ dsl_deadlist_free(objset_t *os, uint64_t for (zap_cursor_init(&zc, os, dlobj); zap_cursor_retrieve(&zc, &za) == 0; - zap_cursor_advance(&zc)) - bpobj_free(os, za.za_first_integer, tx); + zap_cursor_advance(&zc)) { + uint64_t obj = za.za_first_integer; + if (obj == dmu_objset_pool(os)->dp_empty_bpobj) + bpobj_decr_empty(os, tx); + else + bpobj_free(os, obj, tx); + } zap_cursor_fini(&zc); VERIFY3U(0, ==, dmu_object_free(os, dlobj, tx)); } +static void +dle_enqueue(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, + const blkptr_t *bp, dmu_tx_t *tx) +{ + if (dle->dle_bpobj.bpo_object == + dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { + uint64_t obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + bpobj_close(&dle->dle_bpobj); + bpobj_decr_empty(dl->dl_os, tx); + VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); + VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object, + dle->dle_mintxg, obj, tx)); + } + bpobj_enqueue(&dle->dle_bpobj, bp, tx); +} + +static void +dle_enqueue_subobj(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, + uint64_t obj, dmu_tx_t *tx) +{ + if (dle->dle_bpobj.bpo_object != + dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { + bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); + } else { + bpobj_close(&dle->dle_bpobj); + bpobj_decr_empty(dl->dl_os, tx); + VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); + VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object, + dle->dle_mintxg, obj, tx)); + } +} + void dsl_deadlist_insert(dsl_deadlist_t *dl, const blkptr_t *bp, dmu_tx_t *tx) { @@ -197,7 +234,7 @@ dsl_deadlist_insert(dsl_deadlist_t *dl, dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE); else dle = AVL_PREV(&dl->dl_tree, dle); - bpobj_enqueue(&dle->dle_bpobj, bp, tx); + dle_enqueue(dl, dle, bp, tx); } /* @@ -217,7 +254,7 @@ dsl_deadlist_add_key(dsl_deadlist_t *dl, dle = kmem_alloc(sizeof (*dle), KM_SLEEP); dle->dle_mintxg = mintxg; - obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); avl_add(&dl->dl_tree, dle); @@ -243,8 +280,7 @@ dsl_deadlist_remove_key(dsl_deadlist_t * dle = avl_find(&dl->dl_tree, &dle_tofind, NULL); dle_prev = AVL_PREV(&dl->dl_tree, dle); - bpobj_enqueue_subobj(&dle_prev->dle_bpobj, - dle->dle_bpobj.bpo_object, tx); + dle_enqueue_subobj(dl, dle_prev, dle->dle_bpobj.bpo_object, tx); avl_remove(&dl->dl_tree, dle); bpobj_close(&dle->dle_bpobj); @@ -302,7 +338,7 @@ dsl_deadlist_clone(dsl_deadlist_t *dl, u if (dle->dle_mintxg >= maxtxg) break; - obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, newobj, dle->dle_mintxg, obj, tx)); } @@ -400,7 +436,7 @@ dsl_deadlist_insert_bpobj(dsl_deadlist_t dle = avl_find(&dl->dl_tree, &dle_tofind, &where); if (dle == NULL) dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE); - bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); + dle_enqueue_subobj(dl, dle, obj, tx); } static int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Mon Aug 27 19:25:20 2012 (r239746) @@ -1050,9 +1050,6 @@ dsl_dir_set_quota_sync(void *arg1, void mutex_enter(&dd->dd_lock); dd->dd_phys->dd_quota = effective_value; mutex_exit(&dd->dd_lock); - - spa_history_log_internal_dd(dd, "set quota", tx, - "quota=%lld", (longlong_t)effective_value); } int @@ -1172,9 +1169,6 @@ dsl_dir_set_reservation_sync(void *arg1, DSL_PROP_CHECK_PREDICTION(dd, psa); dsl_dir_set_reservation_sync_impl(dd, value, tx); - - spa_history_log_internal_dd(dd, "set reservation", tx, - "reservation=%lld", (longlong_t)value); } int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Mon Aug 27 19:25:20 2012 (r239746) @@ -126,8 +126,6 @@ dsl_pool_open(dsl_pool_t *dp) dsl_dataset_t *ds; uint64_t obj; - ASSERT(!dmu_objset_is_dirty_anywhere(dp->dp_meta_objset)); - rw_enter(&dp->dp_config_rwlock, RW_WRITER); err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_ROOT_DATASET, sizeof (uint64_t), 1, @@ -184,6 +182,15 @@ dsl_pool_open(dsl_pool_t *dp) goto out; } + if (spa_feature_is_active(dp->dp_spa, + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) { + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, + &dp->dp_empty_bpobj); + if (err != 0) + goto out; + } + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_TMP_USERREFS, sizeof (uint64_t), 1, &dp->dp_tmp_userrefs_obj); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Aug 27 19:25:20 2012 (r239746) @@ -714,7 +714,7 @@ spa_change_guid_sync(void *arg1, void *a vdev_config_dirty(rvd); spa_config_exit(spa, SCL_STATE, FTAG); - spa_history_log_internal(spa, "guid change", tx, "old=%lld new=%lld", + spa_history_log_internal(spa, "guid change", tx, "old=%llu new=%llu", oldguid, *newguid); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bpobj.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bpobj.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bpobj.h Mon Aug 27 19:25:20 2012 (r239746) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_BPOBJ_H @@ -67,7 +68,9 @@ typedef struct bpobj { typedef int bpobj_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx); uint64_t bpobj_alloc(objset_t *mos, int blocksize, dmu_tx_t *tx); +uint64_t bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx); void bpobj_free(objset_t *os, uint64_t obj, dmu_tx_t *tx); +void bpobj_decr_empty(objset_t *os, dmu_tx_t *tx); int bpobj_open(bpobj_t *bpo, objset_t *mos, uint64_t object); void bpobj_close(bpobj_t *bpo); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Mon Aug 27 19:25:20 2012 (r239746) @@ -305,6 +305,7 @@ typedef void dmu_buf_evict_func_t(struct #define DMU_POOL_SCAN "scan" #define DMU_POOL_FREE_BPOBJ "free_bpobj" #define DMU_POOL_BPTREE_OBJ "bptree_obj" +#define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" /* * Allocate an object from this objset. The range of object numbers Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Mon Aug 27 19:25:20 2012 (r239746) @@ -152,7 +152,6 @@ timestruc_t dmu_objset_snap_cmtime(objse /* called from dsl */ void dmu_objset_sync(objset_t *os, zio_t *zio, dmu_tx_t *tx); boolean_t dmu_objset_is_dirty(objset_t *os, uint64_t txg); -boolean_t dmu_objset_is_dirty_anywhere(objset_t *os); objset_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx); int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Mon Aug 27 19:25:20 2012 (r239746) @@ -262,6 +262,7 @@ int dsl_dataset_space_written(dsl_datase uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); int dsl_dataset_space_wouldfree(dsl_dataset_t *firstsnap, dsl_dataset_t *last, uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); +boolean_t dsl_dataset_is_dirty(dsl_dataset_t *ds); int dsl_dsobj_to_dsname(char *pname, uint64_t obj, char *buf); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Mon Aug 27 19:25:20 2012 (r239746) @@ -88,6 +88,7 @@ typedef struct dsl_pool { uint64_t dp_tmp_userrefs_obj; bpobj_t dp_free_bpobj; uint64_t dp_bptree_obj; + uint64_t dp_empty_bpobj; struct dsl_scan *dp_scan; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h Mon Aug 27 19:25:20 2012 (r239746) @@ -300,6 +300,8 @@ int zap_increment_int(objset_t *os, uint /* Here the key is an int and the value is a different int. */ int zap_add_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t value, dmu_tx_t *tx); +int zap_update_int_key(objset_t *os, uint64_t obj, + uint64_t key, uint64_t value, dmu_tx_t *tx); int zap_lookup_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t *valuep); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c Mon Aug 27 19:25:20 2012 (r239746) @@ -1094,6 +1094,16 @@ zap_add_int_key(objset_t *os, uint64_t o } int +zap_update_int_key(objset_t *os, uint64_t obj, + uint64_t key, uint64_t value, dmu_tx_t *tx) +{ + char name[20]; + + (void) snprintf(name, sizeof (name), "%llx", (longlong_t)key); + return (zap_update(os, obj, name, 8, 1, &value, tx)); +} + +int zap_lookup_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t *valuep) { char name[20]; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Mon Aug 27 19:25:20 2012 (r239746) @@ -221,7 +221,12 @@ feature_get_refcount(objset_t *os, uint6 uint64_t refcount; uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj; - ASSERT(0 != zapobj); + /* + * If the pool is currently being created, the feature objects may not + * have been allocated yet. Act as though all features are disabled. + */ + if (zapobj == 0) + return (ENOTSUP); err = zap_lookup(os, zapobj, feature->fi_guid, sizeof (uint64_t), 1, &refcount); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Mon Aug 27 19:25:20 2012 (r239746) @@ -1831,9 +1831,9 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea /* * Evict cached data */ - if (dmu_objset_is_dirty_anywhere(zfsvfs->z_os)) - if (!(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)) - txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), 0); + if (dsl_dataset_is_dirty(dmu_objset_ds(zfsvfs->z_os)) && + !(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)) + txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), 0); (void) dmu_objset_evict_dbufs(zfsvfs->z_os); return (0); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Aug 27 19:25:20 2012 (r239746) @@ -641,8 +641,18 @@ zvol_last_close(zvol_state_t *zv) { zil_close(zv->zv_zilog); zv->zv_zilog = NULL; + dmu_buf_rele(zv->zv_dbuf, zvol_tag); zv->zv_dbuf = NULL; + + /* + * Evict cached data + */ + if (dsl_dataset_is_dirty(dmu_objset_ds(zv->zv_objset)) && + !(zv->zv_flags & ZVOL_RDONLY)) + txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); + (void) dmu_objset_evict_dbufs(zv->zv_objset); + dmu_objset_disown(zv->zv_objset, zvol_tag); zv->zv_objset = NULL; } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:25:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58EFE1065673; Mon, 27 Aug 2012 19:25:21 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 394858FC31; Mon, 27 Aug 2012 19:25:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJPKP7045003; Mon, 27 Aug 2012 19:25:20 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJPKRD044999; Mon, 27 Aug 2012 19:25:20 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208271925.q7RJPKRD044999@svn.freebsd.org> From: Martin Matuska Date: Mon, 27 Aug 2012 19:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239746 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zinject vendor/illumos/dist/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:25:21 -0000 Author: mm Date: Mon Aug 27 19:25:20 2012 New Revision: 239746 URL: http://svn.freebsd.org/changeset/base/239746 Log: Update vendor/illumos/dist and vendor/illumos-gate/dist to illumos-gate revision 13782:8f78aae28a63 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/cmd/zinject/zinject.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/man/man5/zpool-features.5 Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/bpobj.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/cmd/zinject/zinject.c ============================================================================== --- vendor/illumos/dist/cmd/zinject/zinject.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor/illumos/dist/cmd/zinject/zinject.c Mon Aug 27 19:25:20 2012 (r239746) @@ -294,11 +294,9 @@ static int iter_handlers(int (*func)(int, const char *, zinject_record_t *, void *), void *data) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; int ret; - zc.zc_guid = 0; - while (ioctl(zfs_fd, ZFS_IOC_INJECT_LIST_NEXT, &zc) == 0) if ((ret = func((int)zc.zc_guid, zc.zc_name, &zc.zc_inject_record, data)) != 0) @@ -421,7 +419,7 @@ static int cancel_one_handler(int id, const char *pool, zinject_record_t *record, void *data) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; zc.zc_guid = (uint64_t)id; @@ -454,7 +452,7 @@ cancel_all_handlers(void) static int cancel_handler(int id) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; zc.zc_guid = (uint64_t)id; @@ -476,7 +474,7 @@ static int register_handler(const char *pool, int flags, zinject_record_t *record, int quiet) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; (void) strcpy(zc.zc_name, pool); zc.zc_inject_record = *record; @@ -533,7 +531,7 @@ register_handler(const char *pool, int f int perform_action(const char *pool, zinject_record_t *record, int cmd) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; ASSERT(cmd == VDEV_STATE_DEGRADED || cmd == VDEV_STATE_FAULTED); (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Mon Aug 27 19:20:58 2012 (r239745) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Mon Aug 27 19:25:20 2012 (r239746) @@ -3511,7 +3511,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand zhp->zfs_type == ZFS_TYPE_VOLUME); /* - * Destroy all recent snapshots and its dependends. + * Destroy all recent snapshots and their dependents. */ cb.cb_force = force; cb.cb_target = snap->zfs_name; Modified: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- vendor/illumos/dist/man/man5/zpool-features.5 Mon Aug 27 19:20:58 2012 (r239745) +++ vendor/illumos/dist/man/man5/zpool-features.5 Mon Aug 27 19:25:20 2012 (r239746) @@ -169,5 +169,33 @@ through the \fBfreeing\fR property. This feature is only \fBactive\fR while \fBfreeing\fR is non\-zero. .RE + +.sp +.ne 2 +.na +\fB\fBempty_bpobj\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.delphix:empty_bpobj +READ\-ONLY COMPATIBLE yes +DEPENDENCIES none +.TE + +This feature increases the performance of creating and using a large +number of snapshots of a single filesystem or volume, and also reduces +the disk space required. + +When there are many snapshots, each snapshot uses many Block Pointer +Objects (bpobj's) to track blocks associated with that snapshot. +However, in common use cases, most of these bpobj's are empty. This +feature allows us to create each bpobj on-demand, thus eliminating the +empty bpobjs. + +This feature is \fBactive\fR while there are any filesystems, volumes, +or snapshots which were created after enabling this feature. +.RE + .SH "SEE ALSO" \fBzpool\fR(1M) From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:30:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F27AE1065670; Mon, 27 Aug 2012 19:30:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DECD68FC1F; Mon, 27 Aug 2012 19:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJULwc045608; Mon, 27 Aug 2012 19:30:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJUL2Z045605; Mon, 27 Aug 2012 19:30:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208271930.q7RJUL2Z045605@svn.freebsd.org> From: Dimitry Andric Date: Mon, 27 Aug 2012 19:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239747 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:30:22 -0000 Author: dim Date: Mon Aug 27 19:30:21 2012 New Revision: 239747 URL: http://svn.freebsd.org/changeset/base/239747 Log: Add a few other files that are obsolete if WITH_CLANG_EXTRAS is enabled, and clang is updated to 3.2. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 27 19:25:20 2012 (r239746) +++ head/ObsoleteFiles.inc Mon Aug 27 19:30:21 2012 (r239747) @@ -39,6 +39,8 @@ # done # 20120816: new clang import which bumps version from 3.1 to 3.2 +OLD_FILES+=usr/bin/llvm-ld +OLD_FILES+=usr/bin/llvm-stub OLD_FILES+=usr/include/clang/3.1/altivec.h OLD_FILES+=usr/include/clang/3.1/avx2intrin.h OLD_FILES+=usr/include/clang/3.1/avxintrin.h @@ -63,6 +65,7 @@ OLD_FILES+=usr/include/clang/3.1/wmmintr OLD_FILES+=usr/include/clang/3.1/x86intrin.h OLD_FILES+=usr/include/clang/3.1/xmmintrin.h OLD_DIRS+=usr/include/clang/3.1 +OLD_FILES+=usr/share/man/man1/llvm-ld.1.gz # 20120712: OpenSSL 1.0.1c import OLD_LIBS+=lib/libcrypto.so.6 OLD_LIBS+=usr/lib/libssl.so.6 From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:37:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA286106564A; Mon, 27 Aug 2012 19:37:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B818FC16; Mon, 27 Aug 2012 19:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJb2jq046394; Mon, 27 Aug 2012 19:37:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJb2FU046374; Mon, 27 Aug 2012 19:37:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271937.q7RJb2FU046374@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 19:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239748 - in stable/9/sys: amd64/conf conf i386/conf modules/mlx4 modules/mlx4ib modules/mlxen modules/mthca ofed/drivers/infiniband/core ofed/drivers/infiniband/ulp/ipoib ofed/drivers/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:37:03 -0000 Author: jhb Date: Mon Aug 27 19:37:02 2012 New Revision: 239748 URL: http://svn.freebsd.org/changeset/base/239748 Log: MFC 233040,233198,233870,234183: Add OFED and the associated options and drivers to x86 LINT builds: - Fix build with INET6 disabled. - Fix build of OFED bits with debugging options enabled. - Fix build on i386. - Mark 'sdp' as requiring 'inet'. - Always include "opt_inet.h" and "opt_inet6.h" and modify the IB driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options to determine what should be enabled during a module build. - Fix the mlxen(4) driver and the core IB code to compile without if INET is disabled (including when both INET and INET6 are disabled). Modified: stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files stable/9/sys/i386/conf/NOTES stable/9/sys/modules/mlx4/Makefile stable/9/sys/modules/mlx4ib/Makefile stable/9/sys/modules/mlxen/Makefile stable/9/sys/modules/mthca/Makefile stable/9/sys/ofed/drivers/infiniband/core/addr.c stable/9/sys/ofed/drivers/infiniband/core/cma.c stable/9/sys/ofed/drivers/infiniband/core/fmr_pool.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c stable/9/sys/ofed/drivers/net/mlx4/en_frag.c stable/9/sys/ofed/drivers/net/mlx4/en_rx.c stable/9/sys/ofed/include/linux/in.h stable/9/sys/ofed/include/linux/in6.h stable/9/sys/ofed/include/net/ip.h stable/9/sys/ofed/include/net/ipv6.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/amd64/conf/NOTES Mon Aug 27 19:37:02 2012 (r239748) @@ -90,6 +90,19 @@ options DEVICE_POLLING options BPF_JITTER +# OpenFabrics Enterprise Distribution (Infiniband). +options OFED +options OFED_DEBUG_INIT + +# Sockets Direct Protocol +options SDP +options SDP_DEBUG + +# IP over Inifiband +options IPOIB +options IPOIB_DEBUG +options IPOIB_CM + ##################################################################### # CLOCK OPTIONS @@ -290,6 +303,9 @@ options DRM_DEBUG # Include debug print # Requires the iwi firmware module # iwn: Intel Wireless WiFi Link 4965/1000/5000/6000 802.11 network adapters # Requires the iwn firmware module +# mlx4ib: Mellanox ConnectX HCA InfiniBand +# mlxen: Mellanox ConnectX HCA Ethernet +# mthca: Mellanox HCA InfiniBand # mwl: Marvell 88W8363 IEEE 802.11 adapter # Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) @@ -305,6 +321,9 @@ options ED_SIC device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device mlx4ib # Mellanox ConnectX HCA InfiniBand +device mlxen # Mellanox ConnectX HCA Ethernet +device mthca # Mellanox HCA InfiniBand device mwl # Marvell 88W8363 802.11n wireless NICs. device nfe # nVidia nForce MCP on-board Ethernet device nve # nVidia nForce MCP on-board Ethernet Networking Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/conf/files Mon Aug 27 19:37:02 2012 (r239748) @@ -3077,19 +3077,19 @@ ofed/drivers/infiniband/ulp/ipoib/ipoib_ # no-depend \ # compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" -ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_main.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_main.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_rx.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_rx.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/i386/conf/NOTES Mon Aug 27 19:37:02 2012 (r239748) @@ -260,6 +260,19 @@ options DEVICE_POLLING options BPF_JITTER +# OpenFabrics Enterprise Distribution (Infiniband). +options OFED +options OFED_DEBUG_INIT + +# Sockets Direct Protocol +options SDP +options SDP_DEBUG + +# IP over Inifiband +options IPOIB +options IPOIB_DEBUG +options IPOIB_CM + ##################################################################### # CLOCK OPTIONS @@ -561,6 +574,9 @@ hint.mse.0.irq="5" # Requires the iwi firmware module # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters # Requires the iwn firmware module +# mlx4ib: Mellanox ConnectX HCA InfiniBand +# mlxen: Mellanox ConnectX HCA Ethernet +# mthca: Mellanox HCA InfiniBand # mwl: Marvell 88W8363 IEEE 802.11 adapter # Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) @@ -605,6 +621,9 @@ hint.le.0.at="isa" hint.le.0.port="0x280" hint.le.0.irq="10" hint.le.0.drq="0" +device mlx4ib # Mellanox ConnectX HCA InfiniBand +device mlxen # Mellanox ConnectX HCA Ethernet +device mthca # Mellanox HCA InfiniBand device mwl # Marvell 88W8363 802.11n wireless NICs. device nfe # nVidia nForce MCP on-board Ethernet device nve # nVidia nForce MCP on-board Ethernet Networking Modified: stable/9/sys/modules/mlx4/Makefile ============================================================================== --- stable/9/sys/modules/mlx4/Makefile Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/modules/mlx4/Makefile Mon Aug 27 19:37:02 2012 (r239748) @@ -1,13 +1,28 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 + +.include + KMOD = mlx4 SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= alloc.c catas.c cmd.c cq.c eq.c fw.c icm.c intf.c main.c mcg.c mr.c SRCS+= pd.c port.c profile.c qp.c reset.c sense.c srq.c xrcd.c +SRCS+= opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -CFLAGS+= -DINET6 + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: stable/9/sys/modules/mlx4ib/Makefile ============================================================================== --- stable/9/sys/modules/mlx4ib/Makefile Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/modules/mlx4ib/Makefile Mon Aug 27 19:37:02 2012 (r239748) @@ -1,10 +1,26 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 + +.include + KMOD = mlx4ib SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= ah.c cq.c doorbell.c mad.c main.c mr.c qp.c srq.c wc.c +SRCS+= opt_inet.h opt_inet6.h + +CFLAGS+= -I${.CURDIR}/../../ofed/include/ + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif -CFLAGS+= -I${.CURDIR}/../../ofed/include/ -DINET6 +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: stable/9/sys/modules/mlxen/Makefile ============================================================================== --- stable/9/sys/modules/mlxen/Makefile Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/modules/mlxen/Makefile Mon Aug 27 19:37:02 2012 (r239748) @@ -1,12 +1,27 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 + +.include + KMOD = mlxen SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS += en_cq.c en_frag.c en_main.c en_netdev.c en_port.c en_resources.c SRCS += en_rx.c en_tx.c +SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -CFLAGS+= -DINET6 + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: stable/9/sys/modules/mthca/Makefile ============================================================================== --- stable/9/sys/modules/mthca/Makefile Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/modules/mthca/Makefile Mon Aug 27 19:37:02 2012 (r239748) @@ -1,14 +1,30 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mthca + +.include + KMOD = mthca SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= mthca_allocator.c mthca_av.c mthca_catas.c mthca_cmd.c mthca_cq.c SRCS+= mthca_eq.c mthca_mad.c mthca_main.c mthca_mcg.c mthca_memfree.c SRCS+= mthca_mr.c mthca_pd.c mthca_profile.c mthca_provider.c mthca_qp.c SRCS+= mthca_reset.c mthca_srq.c mthca_uar.c +SRCS+= opt_inet.h opt_inet6.h + +CFLAGS+= -I${.CURDIR}/../../ofed/include + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif -CFLAGS+= -I${.CURDIR}/../../ofed/include/ -DINET6 +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: stable/9/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/infiniband/core/addr.c Mon Aug 27 19:37:02 2012 (r239748) @@ -136,6 +136,7 @@ int rdma_translate_ip(struct sockaddr *a } switch (addr->sa_family) { +#ifdef INET case AF_INET: dev = ip_dev_find(NULL, ((struct sockaddr_in *) addr)->sin_addr.s_addr); @@ -146,6 +147,7 @@ int rdma_translate_ip(struct sockaddr *a ret = rdma_copy_addr(dev_addr, dev, NULL); dev_put(dev); break; +#endif #if defined(INET6) case AF_INET6: @@ -346,7 +348,9 @@ static int addr_resolve(struct sockaddr struct sockaddr_in6 *sin6; struct ifaddr *ifa; struct ifnet *ifp; +#if defined(INET) || defined(INET6) struct llentry *lle; +#endif struct rtentry *rte; in_port_t port; u_char edst[MAX_ADDR_LEN]; @@ -365,6 +369,7 @@ static int addr_resolve(struct sockaddr ifp = NULL; rte = NULL; switch (dst_in->sa_family) { +#ifdef INET case AF_INET: sin = (struct sockaddr_in *)dst_in; if (sin->sin_addr.s_addr == INADDR_BROADCAST) @@ -383,6 +388,7 @@ static int addr_resolve(struct sockaddr } else src_in = NULL; break; +#endif #ifdef INET6 case AF_INET6: sin6 = (struct sockaddr_in6 *)dst_in; @@ -459,12 +465,21 @@ mcast: /* * Resolve the link local address. */ - if (dst_in->sa_family == AF_INET) + switch (dst_in->sa_family) { +#ifdef INET + case AF_INET: error = arpresolve(ifp, rte, NULL, dst_in, edst, &lle); + break; +#endif #ifdef INET6 - else + case AF_INET6: error = nd6_storelladdr(ifp, NULL, dst_in, (u_char *)edst, &lle); + break; #endif + default: + /* XXX: Shouldn't happen. */ + error = -EINVAL; + } RTFREE(rte); if (error == 0) return rdma_copy_addr(addr, ifp, edst); Modified: stable/9/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/cma.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/infiniband/core/cma.c Mon Aug 27 19:37:02 2012 (r239748) @@ -96,7 +96,9 @@ static DEFINE_IDR(sdp_ps); static DEFINE_IDR(tcp_ps); static DEFINE_IDR(udp_ps); static DEFINE_IDR(ipoib_ps); +#if defined(INET) static int next_port; +#endif struct cma_device { struct list_head list; @@ -1242,7 +1244,9 @@ static void cma_set_compare_data(enum rd struct cma_hdr *cma_data, *cma_mask; struct sdp_hh *sdp_data, *sdp_mask; __be32 ip4_addr; +#ifdef INET6 struct in6_addr ip6_addr; +#endif memset(compare, 0, sizeof *compare); cma_data = (void *) compare->data; @@ -2135,6 +2139,7 @@ err1: static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv) { +#if defined(INET) struct rdma_bind_list *bind_list; int port, ret, low, high; @@ -2176,6 +2181,9 @@ err2: err1: kfree(bind_list); return ret; +#else + return -ENOSPC; +#endif } static int cma_use_port(struct idr *ps, struct rdma_id_private *id_priv) @@ -2917,13 +2925,20 @@ static int cma_ib_mc_handler(int status, static void cma_set_mgid(struct rdma_id_private *id_priv, struct sockaddr *addr, union ib_gid *mgid) { +#if defined(INET) || defined(INET6) unsigned char mc_map[MAX_ADDR_LEN]; struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr; +#endif +#ifdef INET struct sockaddr_in *sin = (struct sockaddr_in *) addr; +#endif +#ifdef INET6 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr; +#endif if (cma_any_addr(addr)) { memset(mgid, 0, sizeof *mgid); +#ifdef INET6 } else if ((addr->sa_family == AF_INET6) && ((be32_to_cpu(sin6->sin6_addr.s6_addr32[0]) & 0xFFF0FFFF) == 0xFF10A01B)) { @@ -2934,11 +2949,14 @@ static void cma_set_mgid(struct rdma_id_ if (id_priv->id.ps == RDMA_PS_UDP) mc_map[7] = 0x01; /* Use RDMA CM signature */ *mgid = *(union ib_gid *) (mc_map + 4); +#endif +#ifdef INET } else { ip_ib_mc_map(sin->sin_addr.s_addr, dev_addr->broadcast, mc_map); if (id_priv->id.ps == RDMA_PS_UDP) mc_map[7] = 0x01; /* Use RDMA CM signature */ *mgid = *(union ib_gid *) (mc_map + 4); +#endif } } @@ -3341,12 +3359,15 @@ static void cma_remove_one(struct ib_dev static int cma_init(void) { - int ret, low, high, remaining; + int ret; +#if defined(INET) + int low, high, remaining; get_random_bytes(&next_port, sizeof next_port); inet_get_local_port_range(&low, &high); remaining = (high - low) + 1; next_port = ((unsigned int) next_port % remaining) + low; +#endif cma_wq = create_singlethread_workqueue("rdma_cm"); if (!cma_wq) Modified: stable/9/sys/ofed/drivers/infiniband/core/fmr_pool.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/fmr_pool.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/infiniband/core/fmr_pool.c Mon Aug 27 19:37:02 2012 (r239748) @@ -150,7 +150,7 @@ static void ib_fmr_batch_release(struct #ifdef DEBUG if (fmr->ref_count !=0) { - printk(KERN_WARNING PFX "Unmapping FMR 0x%08x with ref count %d\n", + printk(KERN_WARNING PFX "Unmapping FMR %p with ref count %d\n", fmr, fmr->ref_count); } #endif Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Mon Aug 27 19:37:02 2012 (r239748) @@ -1247,7 +1247,9 @@ static void ipoib_cm_mb_reap(struct work cm.mb_task); struct mbuf *mb; unsigned long flags; +#if defined(INET) || defined(INET6) unsigned mtu = priv->mcast_mtu; +#endif uint16_t proto; spin_lock_irqsave(&priv->lock, flags); @@ -1260,14 +1262,20 @@ static void ipoib_cm_mb_reap(struct work proto = htons(*mtod(mb, uint16_t *)); m_adj(mb, IPOIB_ENCAP_LEN); - if (proto == ETHERTYPE_IP) + switch (proto) { +#if defined(INET) + case ETHERTYPE_IP: icmp_error(mb, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, mtu); + break; +#endif #if defined(INET6) - else if (proto == ETHERTYPE_IPV6) + case ETHERTYPE_IPV6: icmp6_error(mb, ICMP6_PACKET_TOO_BIG, 0, mtu); + break; #endif - else + default: m_freem(mb); + } spin_lock_irqsave(&priv->lock, flags); } Modified: stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 27 19:37:02 2012 (r239748) @@ -876,7 +876,7 @@ ipoib_intf_alloc(const char *name) dev->if_output = ipoib_output; dev->if_input = ipoib_input; dev->if_resolvemulti = ipoib_resolvemulti; - dev->if_baudrate = IF_Gbps(10LL); + dev->if_baudrate = IF_Gbps(10UL); dev->if_broadcastaddr = priv->broadcastaddr; dev->if_snd.ifq_maxlen = ipoib_sendq_size * 2; sdl = (struct sockaddr_dl *)dev->if_addr->ifa_addr; Modified: stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Mon Aug 27 19:37:02 2012 (r239748) @@ -855,7 +855,7 @@ sdp_append(struct sdp_sock *ssk, struct int ncnt; SOCKBUF_LOCK_ASSERT(sb); - SBLASTRECORDCHK(sb) + SBLASTRECORDCHK(sb); KASSERT(mb->m_flags & M_PKTHDR, ("sdp_append: %p Missing packet header.\n", mb)); n = sb->sb_lastrecord; Modified: stable/9/sys/ofed/drivers/net/mlx4/en_frag.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_frag.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/net/mlx4/en_frag.c Mon Aug 27 19:37:02 2012 (r239748) @@ -31,8 +31,11 @@ * */ +#include "opt_inet.h" #include "mlx4_en.h" +#ifdef INET + #include #include #include @@ -186,3 +189,4 @@ void mlx4_en_flush_frags(struct mlx4_en_ flush_session(priv, session, IP_MF); } } +#endif Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Mon Aug 27 19:37:02 2012 (r239748) @@ -31,6 +31,7 @@ * */ +#include "opt_inet.h" #include "mlx4_en.h" #include @@ -287,6 +288,7 @@ int mlx4_en_activate_rx_rings(struct mlx /* Initailize all descriptors */ for (i = 0; i < ring->size; i++) mlx4_en_init_rx_desc(priv, ring, i); +#ifdef INET /* Configure lro mngr */ if (priv->dev->if_capenable & IFCAP_LRO) { if (tcp_lro_init(&ring->lro)) @@ -294,6 +296,7 @@ int mlx4_en_activate_rx_rings(struct mlx else ring->lro.ifp = priv->dev; } +#endif } err = mlx4_en_fill_rx_buffers(priv); if (err) @@ -330,7 +333,9 @@ void mlx4_en_destroy_rx_ring(struct mlx4 void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring) { +#ifdef INET tcp_lro_free(&ring->lro); +#endif mlx4_en_free_rx_buf(priv, ring); if (ring->stride <= TXBB_SIZE) ring->buf -= TXBB_SIZE; @@ -446,7 +451,9 @@ int mlx4_en_process_rx_cq(struct net_dev struct mbuf **mb_list; struct mlx4_en_rx_desc *rx_desc; struct mbuf *mb; +#ifdef INET struct lro_entry *queued; +#endif int index; unsigned int length; int polled = 0; @@ -515,22 +522,26 @@ int mlx4_en_process_rx_cq(struct net_dev * - without IP options * - not an IP fragment */ +#ifdef INET if (mlx4_en_can_lro(cqe->status) && (dev->if_capenable & IFCAP_LRO)) { if (ring->lro.lro_cnt != 0 && tcp_lro_rx(&ring->lro, mb, 0) == 0) goto next; } +#endif /* LRO not possible, complete processing here */ INC_PERF_COUNTER(priv->pstats.lro_misses); } else { mb->m_pkthdr.csum_flags = 0; priv->port_stats.rx_chksum_none++; +#ifdef INET if (priv->ip_reasm && cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4) && !mlx4_en_rx_frags(priv, ring, mb, cqe)) goto next; +#endif } /* Push it up the stack */ @@ -545,11 +556,13 @@ next: } /* Flush all pending IP reassembly sessions */ out: +#ifdef INET mlx4_en_flush_frags(priv, ring); while ((queued = SLIST_FIRST(&ring->lro.lro_active)) != NULL) { SLIST_REMOVE_HEAD(&ring->lro.lro_active, next); tcp_lro_flush(&ring->lro, queued); } +#endif AVG_PERF_COUNTER(priv->pstats.rx_coal_avg, polled); mlx4_cq_set_ci(&cq->mcq); wmb(); /* ensure HW sees CQ consumer before we post new buffers */ Modified: stable/9/sys/ofed/include/linux/in.h ============================================================================== --- stable/9/sys/ofed/include/linux/in.h Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/include/linux/in.h Mon Aug 27 19:37:02 2012 (r239748) @@ -28,6 +28,8 @@ #ifndef _LINUX_IN_H_ #define _LINUX_IN_H_ +#include "opt_inet.h" + #include #include Modified: stable/9/sys/ofed/include/linux/in6.h ============================================================================== --- stable/9/sys/ofed/include/linux/in6.h Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/include/linux/in6.h Mon Aug 27 19:37:02 2012 (r239748) @@ -29,8 +29,6 @@ #ifndef _LINUX_IN6_H_ #define _LINUX_IN6_H_ -#ifndef KLD_MODULE #include "opt_inet6.h" -#endif #endif /* _LINUX_IN6_H_ */ Modified: stable/9/sys/ofed/include/net/ip.h ============================================================================== --- stable/9/sys/ofed/include/net/ip.h Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/include/net/ip.h Mon Aug 27 19:37:02 2012 (r239748) @@ -29,6 +29,8 @@ #ifndef _LINUX_NET_IP_H_ #define _LINUX_NET_IP_H_ +#include "opt_inet.h" + #include #include @@ -39,6 +41,7 @@ #include #include +#ifdef INET static inline void inet_get_local_port_range(int *low, int *high) { *low = V_ipport_firstauto; @@ -73,5 +76,6 @@ ip_ib_mc_map(uint32_t addr, const unsign buf[18] = (addr >> 8) & 0xff; buf[19] = addr & 0xff; } +#endif #endif /* _LINUX_NET_IP_H_ */ Modified: stable/9/sys/ofed/include/net/ipv6.h ============================================================================== --- stable/9/sys/ofed/include/net/ipv6.h Mon Aug 27 19:30:21 2012 (r239747) +++ stable/9/sys/ofed/include/net/ipv6.h Mon Aug 27 19:37:02 2012 (r239748) @@ -29,9 +29,7 @@ #ifndef _LINUX_NET_IPV6_H_ #define _LINUX_NET_IPV6_H_ -#ifndef KLD_MODULE #include "opt_inet6.h" -#endif #define ipv6_addr_loopback IN6_IS_ADDR_LOOPBACK #define ipv6_addr_copy(dst, src) \ From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:52:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ED89106566B; Mon, 27 Aug 2012 19:52:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49B368FC08; Mon, 27 Aug 2012 19:52:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJqurX048294; Mon, 27 Aug 2012 19:52:56 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJqu3R048292; Mon, 27 Aug 2012 19:52:56 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208271952.q7RJqu3R048292@svn.freebsd.org> From: Martin Matuska Date: Mon, 27 Aug 2012 19:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239749 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:52:56 -0000 Author: mm Date: Mon Aug 27 19:52:55 2012 New Revision: 239749 URL: http://svn.freebsd.org/changeset/base/239749 Log: Add missing parts to zpool-features.5 manual page Obtained from: vendor/illumos/dist MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Mon Aug 27 19:37:02 2012 (r239748) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Mon Aug 27 19:52:55 2012 (r239749) @@ -21,7 +21,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2012 +.Dd Aug 27, 2012 .Dt ZPOOL-FEATURES 8 .Os .Sh NAME @@ -32,8 +32,10 @@ ZFS pool on\-disk format versions are sp the old on\-disk format numbers (the last supported on\-disk format number is 28). To enable a feature on a pool use the +.Cm upgrade +subcommand of the .Xr zpool 8 -command to set the +command, or set the .Sy feature@feature_name property to .Ar enabled . @@ -154,6 +156,12 @@ The amount of space remaining to be recl available through the .Sy freeing property. +.Pp +This feature is only +.Sy active +while +.Sy freeing +is non\-zero. .Sh SEE ALSO .Xr zpool 8 .Sh AUTHORS From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:55:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EDA91065670; Mon, 27 Aug 2012 19:55:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3849C8FC1C; Mon, 27 Aug 2012 19:55:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJtKaM048649; Mon, 27 Aug 2012 19:55:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJtJ4L048642; Mon, 27 Aug 2012 19:55:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271955.q7RJtJ4L048642@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 19:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239750 - in stable/9: contrib/top usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:55:20 -0000 Author: jhb Date: Mon Aug 27 19:55:19 2012 New Revision: 239750 URL: http://svn.freebsd.org/changeset/base/239750 Log: MFC 237646,237656,238020: - Add a new line to top that provides a brief summary of the ZFS ARC memory usage on hosts using ZFS. The new line displays the total amount of RAM used by the ARC along with the size of MFU, MRU, anonymous (in flight), headers, and other (miscellaneous) sub-categories. The line is not displayed on systems that are not using ZFS. - Clarify that the cached file data pages included in the "Wired" count in top are the BIO-level cached data (i.e. "Buf"), since the previous phrase was a bit ambiguous with the "Cache" count. Modified: stable/9/contrib/top/display.c stable/9/contrib/top/layout.h stable/9/contrib/top/machine.h stable/9/contrib/top/top.c stable/9/usr.bin/top/machine.c stable/9/usr.bin/top/top.local.1 Directory Properties: stable/9/contrib/top/ (props changed) stable/9/contrib/top/install-sh (props changed) stable/9/usr.bin/top/ (props changed) Modified: stable/9/contrib/top/display.c ============================================================================== --- stable/9/contrib/top/display.c Mon Aug 27 19:52:55 2012 (r239749) +++ stable/9/contrib/top/display.c Mon Aug 27 19:55:19 2012 (r239750) @@ -66,6 +66,7 @@ char *screenbuf = NULL; static char **procstate_names; static char **cpustate_names; static char **memory_names; +static char **arc_names; static char **swap_names; static int num_procstates; @@ -100,6 +101,8 @@ int x_brkdn = 15; int y_brkdn = 1; int x_mem = 5; int y_mem = 3; +int x_arc = 5; +int y_arc = 4; int x_swap = 6; int y_swap = 4; int y_message = 5; @@ -216,6 +219,8 @@ struct statics *statics; num_memory = string_count(memory_names); lmemory = (int *)malloc(num_memory * sizeof(int)); + arc_names = statics->arc_names; + /* calculate starting columns where needed */ cpustate_total_length = 0; pp = cpustate_names; @@ -627,6 +632,46 @@ int *stats; } /* + * *_arc(stats) - print "ARC: " followed by the ARC summary string + * + * Assumptions: cursor is on "lastline" + * for i_arc ONLY: cursor is on the previous line + */ +char arc_buffer[MAX_COLS]; + +i_arc(stats) + +int *stats; + +{ + if (arc_names == NULL) + return (0); + + fputs("\nARC: ", stdout); + lastline++; + + /* format and print the memory summary */ + summary_format(arc_buffer, stats, arc_names); + fputs(arc_buffer, stdout); +} + +u_arc(stats) + +int *stats; + +{ + static char new[MAX_COLS]; + + if (arc_names == NULL) + return (0); + + /* format the new line */ + summary_format(new, stats, arc_names); + line_update(arc_buffer, new, x_arc, y_arc); +} + + +/* * *_swap(stats) - print "Swap: " followed by the swap summary string * * Assumptions: cursor is on "lastline" Modified: stable/9/contrib/top/layout.h ============================================================================== --- stable/9/contrib/top/layout.h Mon Aug 27 19:52:55 2012 (r239749) +++ stable/9/contrib/top/layout.h Mon Aug 27 19:55:19 2012 (r239750) @@ -19,6 +19,8 @@ extern int x_brkdn; /* 15 */ extern int y_brkdn; /* 1 */ extern int x_mem; /* 5 */ extern int y_mem; /* 3 */ +extern int x_arc; /* 5 */ +extern int y_arc; /* 4 */ extern int x_swap; /* 6 */ extern int y_swap; /* 4 */ extern int y_message; /* 5 */ Modified: stable/9/contrib/top/machine.h ============================================================================== --- stable/9/contrib/top/machine.h Mon Aug 27 19:52:55 2012 (r239749) +++ stable/9/contrib/top/machine.h Mon Aug 27 19:55:19 2012 (r239750) @@ -16,6 +16,7 @@ struct statics char **procstate_names; char **cpustate_names; char **memory_names; + char **arc_names; char **swap_names; #ifdef ORDER char **order_names; @@ -42,6 +43,7 @@ struct system_info int *procstates; int *cpustates; int *memory; + int *arc; int *swap; struct timeval boottime; int ncpus; Modified: stable/9/contrib/top/top.c ============================================================================== --- stable/9/contrib/top/top.c Mon Aug 27 19:52:55 2012 (r239749) +++ stable/9/contrib/top/top.c Mon Aug 27 19:55:19 2012 (r239750) @@ -121,6 +121,8 @@ int i_cpustates(); int u_cpustates(); int i_memory(); int u_memory(); +int i_arc(); +int u_arc(); int i_swap(); int u_swap(); int i_message(); @@ -135,6 +137,7 @@ int (*d_loadave)() = i_loadave; int (*d_procstates)() = i_procstates; int (*d_cpustates)() = i_cpustates; int (*d_memory)() = i_memory; +int (*d_arc)() = i_arc; int (*d_swap)() = i_swap; int (*d_message)() = i_message; int (*d_header)() = i_header; @@ -647,6 +650,7 @@ restart: /* display memory stats */ (*d_memory)(system_info.memory); + (*d_arc)(system_info.arc); /* display swap stats */ (*d_swap)(system_info.swap); @@ -712,6 +716,7 @@ restart: d_procstates = u_procstates; d_cpustates = u_cpustates; d_memory = u_memory; + d_arc = u_arc; d_swap = u_swap; d_message = u_message; d_header = u_header; @@ -1129,6 +1134,7 @@ reset_display() d_procstates = i_procstates; d_cpustates = i_cpustates; d_memory = i_memory; + d_arc = i_arc; d_swap = i_swap; d_message = i_message; d_header = i_header; Modified: stable/9/usr.bin/top/machine.c ============================================================================== --- stable/9/usr.bin/top/machine.c Mon Aug 27 19:52:55 2012 (r239749) +++ stable/9/usr.bin/top/machine.c Mon Aug 27 19:55:19 2012 (r239750) @@ -176,6 +176,12 @@ char *memorynames[] = { "K Free", NULL }; +int arc_stats[7]; +char *arcnames[] = { + "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other", + NULL +}; + int swap_stats[7]; char *swapnames[] = { "K Total, ", "K Used, ", "K Free, ", "% Inuse, ", "K In, ", "K Out", @@ -194,6 +200,7 @@ static struct kinfo_proc *previous_procs static struct kinfo_proc **previous_pref; static int previous_proc_count = 0; static int previous_proc_count_max = 0; +static int arc_enabled; /* total number of io operations */ static long total_inblock; @@ -239,6 +246,7 @@ static int compare_tid(const void *a, co static const char *format_nice(const struct kinfo_proc *pp); static void getsysctl(const char *name, void *ptr, size_t len); static int swapmode(int *retavail, int *retfree); +static void update_layout(void); void toggle_pcpustats(void) @@ -246,24 +254,32 @@ toggle_pcpustats(void) if (ncpus == 1) return; + update_layout(); +} + +/* Adjust display based on ncpus and the ARC state. */ +static void +update_layout(void) +{ + + y_mem = 3; + y_arc = 4; + y_swap = 4 + arc_enabled; + y_idlecursor = 5 + arc_enabled; + y_message = 5 + arc_enabled; + y_header = 6 + arc_enabled; + y_procs = 7 + arc_enabled; + Header_lines = 7 + arc_enabled; - /* Adjust display based on ncpus */ if (pcpu_stats) { - y_mem += ncpus - 1; /* 3 */ - y_swap += ncpus - 1; /* 4 */ - y_idlecursor += ncpus - 1; /* 5 */ - y_message += ncpus - 1; /* 5 */ - y_header += ncpus - 1; /* 6 */ - y_procs += ncpus - 1; /* 7 */ - Header_lines += ncpus - 1; /* 7 */ - } else { - y_mem = 3; - y_swap = 4; - y_idlecursor = 5; - y_message = 5; - y_header = 6; - y_procs = 7; - Header_lines = 7; + y_mem += ncpus - 1; + y_arc += ncpus - 1; + y_swap += ncpus - 1; + y_idlecursor += ncpus - 1; + y_message += ncpus - 1; + y_header += ncpus - 1; + y_procs += ncpus - 1; + Header_lines += ncpus - 1; } } @@ -271,6 +287,7 @@ int machine_init(struct statics *statics, char do_unames) { int i, j, empty, pagesize; + uint64_t arc_size; size_t size; struct passwd *pw; @@ -282,6 +299,11 @@ machine_init(struct statics *statics, ch size != sizeof(smpmode)) smpmode = 0; + size = sizeof(arc_size); + if (sysctlbyname("kstat.zfs.misc.arcstats.size", &arc_size, &size, + NULL, 0) == 0 && arc_size != 0) + arc_enabled = 1; + if (do_unames) { while ((pw = getpwent()) != NULL) { if (strlen(pw->pw_name) > namelength) @@ -322,6 +344,10 @@ machine_init(struct statics *statics, ch statics->procstate_names = procstatenames; statics->cpustate_names = cpustatenames; statics->memory_names = memorynames; + if (arc_enabled) + statics->arc_names = arcnames; + else + statics->arc_names = NULL; statics->swap_names = swapnames; #ifdef ORDER statics->order_names = ordernames; @@ -356,8 +382,7 @@ machine_init(struct statics *statics, ch pcpu_cpu_states = calloc(1, size); statics->ncpus = ncpus; - if (pcpu_stats) - toggle_pcpustats(); + update_layout(); /* all done! */ return (0); @@ -408,7 +433,7 @@ get_system_info(struct system_info *si) struct loadavg sysload; int mib[2]; struct timeval boottime; - size_t bt_size; + uint64_t arc_stat, arc_stat2; int i, j; size_t size; @@ -487,6 +512,23 @@ get_system_info(struct system_info *si) swap_stats[6] = -1; } + if (arc_enabled) { + GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); + arc_stats[0] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); + arc_stats[1] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.mru_size", arc_stat); + arc_stats[2] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.anon_size", arc_stat); + arc_stats[3] = arc_stat >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); + GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc_stat2); + arc_stats[4] = arc_stat + arc_stat2 >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc_stat); + arc_stats[5] = arc_stat >> 10; + si->arc = arc_stats; + } + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -511,8 +553,8 @@ get_system_info(struct system_info *si) */ mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; - bt_size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &bt_size, NULL, 0) != -1 && + size = sizeof(boottime); + if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { Modified: stable/9/usr.bin/top/top.local.1 ============================================================================== --- stable/9/usr.bin/top/top.local.1 Mon Aug 27 19:52:55 2012 (r239749) +++ stable/9/usr.bin/top/top.local.1 Mon Aug 27 19:55:19 2012 (r239750) @@ -3,6 +3,7 @@ .SH DESCRIPTION OF MEMORY Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free +ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 232K Header, 442K Other Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out .TP .B K: @@ -16,6 +17,7 @@ Gigabyte .TP .B %: 1/100 +.SS Physical Memory Stats .TP .B Active: number of bytes active @@ -24,7 +26,7 @@ number of bytes active number of bytes inactive .TP .B Wired: -number of bytes wired down, including cached file data pages +number of bytes wired down, including BIO-level cached file data pages .TP .B Cache: number of clean bytes caching data that are available for @@ -35,6 +37,27 @@ number of bytes used for BIO-level disk .TP .B Free: number of bytes free +.SS ZFS ARC Stats +These stats are only displayed when the ARC is in use. +.TP +.B Total: +number of wired bytes used for the ZFS ARC +.TP +.B MRU: +number of ARC bytes holding most recently used data +.TP +.B MFU: +number of ARC bytes holding most frequently used data +.TP +.B Anon: +number of ARC bytes holding in flight data +.TP +.B Header: +number of ARC bytes holding headers +.TP +.B Other +miscellaneous ARC bytes +.SS Swap Stats .TP .B Total: total available swap usage From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 19:55:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C26B10657C5; Mon, 27 Aug 2012 19:55:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3637B8FC1F; Mon, 27 Aug 2012 19:55:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJtWvm048713; Mon, 27 Aug 2012 19:55:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJtVpN048706; Mon, 27 Aug 2012 19:55:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271955.q7RJtVpN048706@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 19:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239751 - in stable/8: contrib/top usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:55:32 -0000 Author: jhb Date: Mon Aug 27 19:55:31 2012 New Revision: 239751 URL: http://svn.freebsd.org/changeset/base/239751 Log: MFC 237646,237656,238020: - Add a new line to top that provides a brief summary of the ZFS ARC memory usage on hosts using ZFS. The new line displays the total amount of RAM used by the ARC along with the size of MFU, MRU, anonymous (in flight), headers, and other (miscellaneous) sub-categories. The line is not displayed on systems that are not using ZFS. - Clarify that the cached file data pages included in the "Wired" count in top are the BIO-level cached data (i.e. "Buf"), since the previous phrase was a bit ambiguous with the "Cache" count. Modified: stable/8/contrib/top/display.c stable/8/contrib/top/layout.h stable/8/contrib/top/machine.h stable/8/contrib/top/top.c stable/8/usr.bin/top/machine.c stable/8/usr.bin/top/top.local.1 Directory Properties: stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/usr.bin/top/ (props changed) Modified: stable/8/contrib/top/display.c ============================================================================== --- stable/8/contrib/top/display.c Mon Aug 27 19:55:19 2012 (r239750) +++ stable/8/contrib/top/display.c Mon Aug 27 19:55:31 2012 (r239751) @@ -66,6 +66,7 @@ char *screenbuf = NULL; static char **procstate_names; static char **cpustate_names; static char **memory_names; +static char **arc_names; static char **swap_names; static int num_procstates; @@ -100,6 +101,8 @@ int x_brkdn = 15; int y_brkdn = 1; int x_mem = 5; int y_mem = 3; +int x_arc = 5; +int y_arc = 4; int x_swap = 6; int y_swap = 4; int y_message = 5; @@ -216,6 +219,8 @@ struct statics *statics; num_memory = string_count(memory_names); lmemory = (int *)malloc(num_memory * sizeof(int)); + arc_names = statics->arc_names; + /* calculate starting columns where needed */ cpustate_total_length = 0; pp = cpustate_names; @@ -627,6 +632,46 @@ int *stats; } /* + * *_arc(stats) - print "ARC: " followed by the ARC summary string + * + * Assumptions: cursor is on "lastline" + * for i_arc ONLY: cursor is on the previous line + */ +char arc_buffer[MAX_COLS]; + +i_arc(stats) + +int *stats; + +{ + if (arc_names == NULL) + return (0); + + fputs("\nARC: ", stdout); + lastline++; + + /* format and print the memory summary */ + summary_format(arc_buffer, stats, arc_names); + fputs(arc_buffer, stdout); +} + +u_arc(stats) + +int *stats; + +{ + static char new[MAX_COLS]; + + if (arc_names == NULL) + return (0); + + /* format the new line */ + summary_format(new, stats, arc_names); + line_update(arc_buffer, new, x_arc, y_arc); +} + + +/* * *_swap(stats) - print "Swap: " followed by the swap summary string * * Assumptions: cursor is on "lastline" Modified: stable/8/contrib/top/layout.h ============================================================================== --- stable/8/contrib/top/layout.h Mon Aug 27 19:55:19 2012 (r239750) +++ stable/8/contrib/top/layout.h Mon Aug 27 19:55:31 2012 (r239751) @@ -19,6 +19,8 @@ extern int x_brkdn; /* 15 */ extern int y_brkdn; /* 1 */ extern int x_mem; /* 5 */ extern int y_mem; /* 3 */ +extern int x_arc; /* 5 */ +extern int y_arc; /* 4 */ extern int x_swap; /* 6 */ extern int y_swap; /* 4 */ extern int y_message; /* 5 */ Modified: stable/8/contrib/top/machine.h ============================================================================== --- stable/8/contrib/top/machine.h Mon Aug 27 19:55:19 2012 (r239750) +++ stable/8/contrib/top/machine.h Mon Aug 27 19:55:31 2012 (r239751) @@ -16,6 +16,7 @@ struct statics char **procstate_names; char **cpustate_names; char **memory_names; + char **arc_names; char **swap_names; #ifdef ORDER char **order_names; @@ -42,6 +43,7 @@ struct system_info int *procstates; int *cpustates; int *memory; + int *arc; int *swap; struct timeval boottime; int ncpus; Modified: stable/8/contrib/top/top.c ============================================================================== --- stable/8/contrib/top/top.c Mon Aug 27 19:55:19 2012 (r239750) +++ stable/8/contrib/top/top.c Mon Aug 27 19:55:31 2012 (r239751) @@ -121,6 +121,8 @@ int i_cpustates(); int u_cpustates(); int i_memory(); int u_memory(); +int i_arc(); +int u_arc(); int i_swap(); int u_swap(); int i_message(); @@ -135,6 +137,7 @@ int (*d_loadave)() = i_loadave; int (*d_procstates)() = i_procstates; int (*d_cpustates)() = i_cpustates; int (*d_memory)() = i_memory; +int (*d_arc)() = i_arc; int (*d_swap)() = i_swap; int (*d_message)() = i_message; int (*d_header)() = i_header; @@ -647,6 +650,7 @@ restart: /* display memory stats */ (*d_memory)(system_info.memory); + (*d_arc)(system_info.arc); /* display swap stats */ (*d_swap)(system_info.swap); @@ -712,6 +716,7 @@ restart: d_procstates = u_procstates; d_cpustates = u_cpustates; d_memory = u_memory; + d_arc = u_arc; d_swap = u_swap; d_message = u_message; d_header = u_header; @@ -1129,6 +1134,7 @@ reset_display() d_procstates = i_procstates; d_cpustates = i_cpustates; d_memory = i_memory; + d_arc = i_arc; d_swap = i_swap; d_message = i_message; d_header = i_header; Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Mon Aug 27 19:55:19 2012 (r239750) +++ stable/8/usr.bin/top/machine.c Mon Aug 27 19:55:31 2012 (r239751) @@ -176,6 +176,12 @@ char *memorynames[] = { "K Free", NULL }; +int arc_stats[7]; +char *arcnames[] = { + "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K Other", + NULL +}; + int swap_stats[7]; char *swapnames[] = { "K Total, ", "K Used, ", "K Free, ", "% Inuse, ", "K In, ", "K Out", @@ -194,6 +200,7 @@ static struct kinfo_proc *previous_procs static struct kinfo_proc **previous_pref; static int previous_proc_count = 0; static int previous_proc_count_max = 0; +static int arc_enabled; /* total number of io operations */ static long total_inblock; @@ -238,6 +245,7 @@ static int compare_pid(const void *a, co static const char *format_nice(const struct kinfo_proc *pp); static void getsysctl(const char *name, void *ptr, size_t len); static int swapmode(int *retavail, int *retfree); +static void update_layout(void); void toggle_pcpustats(void) @@ -245,24 +253,32 @@ toggle_pcpustats(void) if (ncpus == 1) return; + update_layout(); +} + +/* Adjust display based on ncpus and the ARC state. */ +static void +update_layout(void) +{ + + y_mem = 3; + y_arc = 4; + y_swap = 4 + arc_enabled; + y_idlecursor = 5 + arc_enabled; + y_message = 5 + arc_enabled; + y_header = 6 + arc_enabled; + y_procs = 7 + arc_enabled; + Header_lines = 7 + arc_enabled; - /* Adjust display based on ncpus */ if (pcpu_stats) { - y_mem += ncpus - 1; /* 3 */ - y_swap += ncpus - 1; /* 4 */ - y_idlecursor += ncpus - 1; /* 5 */ - y_message += ncpus - 1; /* 5 */ - y_header += ncpus - 1; /* 6 */ - y_procs += ncpus - 1; /* 7 */ - Header_lines += ncpus - 1; /* 7 */ - } else { - y_mem = 3; - y_swap = 4; - y_idlecursor = 5; - y_message = 5; - y_header = 6; - y_procs = 7; - Header_lines = 7; + y_mem += ncpus - 1; + y_arc += ncpus - 1; + y_swap += ncpus - 1; + y_idlecursor += ncpus - 1; + y_message += ncpus - 1; + y_header += ncpus - 1; + y_procs += ncpus - 1; + Header_lines += ncpus - 1; } } @@ -270,6 +286,7 @@ int machine_init(struct statics *statics, char do_unames) { int i, j, empty, pagesize; + uint64_t arc_size; size_t size; struct passwd *pw; @@ -281,6 +298,11 @@ machine_init(struct statics *statics, ch size != sizeof(smpmode)) smpmode = 0; + size = sizeof(arc_size); + if (sysctlbyname("kstat.zfs.misc.arcstats.size", &arc_size, &size, + NULL, 0) == 0 && arc_size != 0) + arc_enabled = 1; + if (do_unames) { while ((pw = getpwent()) != NULL) { if (strlen(pw->pw_name) > namelength) @@ -321,6 +343,10 @@ machine_init(struct statics *statics, ch statics->procstate_names = procstatenames; statics->cpustate_names = cpustatenames; statics->memory_names = memorynames; + if (arc_enabled) + statics->arc_names = arcnames; + else + statics->arc_names = NULL; statics->swap_names = swapnames; #ifdef ORDER statics->order_names = ordernames; @@ -355,8 +381,7 @@ machine_init(struct statics *statics, ch pcpu_cpu_states = calloc(1, size); statics->ncpus = ncpus; - if (pcpu_stats) - toggle_pcpustats(); + update_layout(); /* all done! */ return (0); @@ -407,7 +432,7 @@ get_system_info(struct system_info *si) struct loadavg sysload; int mib[2]; struct timeval boottime; - size_t bt_size; + uint64_t arc_stat, arc_stat2; int i, j; size_t size; @@ -486,6 +511,23 @@ get_system_info(struct system_info *si) swap_stats[6] = -1; } + if (arc_enabled) { + GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); + arc_stats[0] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); + arc_stats[1] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.mru_size", arc_stat); + arc_stats[2] = arc_stat >> 10; + GETSYSCTL("vfs.zfs.anon_size", arc_stat); + arc_stats[3] = arc_stat >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); + GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc_stat2); + arc_stats[4] = arc_stat + arc_stat2 >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc_stat); + arc_stats[5] = arc_stat >> 10; + si->arc = arc_stats; + } + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -510,8 +552,8 @@ get_system_info(struct system_info *si) */ mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; - bt_size = sizeof(boottime); - if (sysctl(mib, 2, &boottime, &bt_size, NULL, 0) != -1 && + size = sizeof(boottime); + if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { Modified: stable/8/usr.bin/top/top.local.1 ============================================================================== --- stable/8/usr.bin/top/top.local.1 Mon Aug 27 19:55:19 2012 (r239750) +++ stable/8/usr.bin/top/top.local.1 Mon Aug 27 19:55:31 2012 (r239751) @@ -3,6 +3,7 @@ .SH DESCRIPTION OF MEMORY Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free +ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 232K Header, 442K Other Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out .TP .B K: @@ -16,6 +17,7 @@ Gigabyte .TP .B %: 1/100 +.SS Physical Memory Stats .TP .B Active: number of bytes active @@ -24,7 +26,7 @@ number of bytes active number of bytes inactive .TP .B Wired: -number of bytes wired down, including cached file data pages +number of bytes wired down, including BIO-level cached file data pages .TP .B Cache: number of clean bytes caching data that are available for @@ -35,8 +37,29 @@ number of bytes used for BIO-level disk .TP .B Free: number of bytes free +.SS ZFS ARC Stats +These stats are only displayed when the ARC is in use. .TP .B Total: +number of wired bytes used for the ZFS ARC +.TP +.B MRU: +number of ARC bytes holding most recently used data +.TP +.B MFU: +number of ARC bytes holding most frequently used data +.TP +.B Anon: +number of ARC bytes holding in flight data +.TP +.B Header: +number of ARC bytes holding headers +.TP +.B Other +miscellaneous ARC bytes +.SS Swap Stats +.TP +.B Total: total available swap usage .TP .B Free: From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 20:03:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B16E0106566C; Mon, 27 Aug 2012 20:03:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CDB78FC1D; Mon, 27 Aug 2012 20:03:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RK38MV049624; Mon, 27 Aug 2012 20:03:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RK38qZ049622; Mon, 27 Aug 2012 20:03:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272003.q7RK38qZ049622@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 20:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239752 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:03:08 -0000 Author: adrian Date: Mon Aug 27 20:03:08 2012 New Revision: 239752 URL: http://svn.freebsd.org/changeset/base/239752 Log: Fix the debugging output to correctly log CCK errors. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 19:55:31 2012 (r239751) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 20:03:08 2012 (r239752) @@ -988,7 +988,7 @@ ar5416AniPoll(struct ath_hal *ah, const params->cckTrigHigh / 1000) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: CCK err %u listenTime %u\n", __func__, - aniState->ofdmPhyErrCount, aniState->listenTime); + aniState->cckPhyErrCount, aniState->listenTime); ar5416AniCckErrTrigger(ah); ar5416AniRestart(ah, aniState); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 20:10:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92961065677; Mon, 27 Aug 2012 20:10:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA3848FC08; Mon, 27 Aug 2012 20:10:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RKAcos050553; Mon, 27 Aug 2012 20:10:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RKAcRs050551; Mon, 27 Aug 2012 20:10:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272010.q7RKAcRs050551@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 20:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239753 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:10:39 -0000 Author: adrian Date: Mon Aug 27 20:10:38 2012 New Revision: 239753 URL: http://svn.freebsd.org/changeset/base/239753 Log: Ensure that all firstep values are available in ANI. The comparison assumes maxFirstepLevel is a count, rather than a maximum value. The array is 3 entries in size however 'maxFirstepLevel' is 2. This bug also exists in the AR5212 HAL. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 20:03:08 2012 (r239752) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 20:10:38 2012 (r239753) @@ -422,7 +422,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal * * If weak sig detect is already off, as last resort, * raise firstep level */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel < params->maxFirstepLevel) { if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1)) return; @@ -436,7 +436,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal * ar5416AniControl(ah, HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, AH_TRUE); - if (aniState->firstepLevel+1 < params->maxFirstepLevel) + if (aniState->firstepLevel < params->maxFirstepLevel) if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1)) return; @@ -490,7 +490,7 @@ ar5416AniCckErrTrigger(struct ath_hal *a * Beacon signal in mid and high range, * raise firstep level. */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) + if (aniState->firstepLevel < params->maxFirstepLevel) ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1); } else { @@ -954,6 +954,8 @@ ar5416AniPoll(struct ath_hal *ah, const if (listenTime < 0) { ahp->ah_stats.ast_ani_lneg++; /* restart ANI period if listenTime is invalid */ + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: invalid listenTime\n", + __func__); ar5416AniRestart(ah, aniState); } /* XXX beware of overflow? */ @@ -973,6 +975,8 @@ ar5416AniPoll(struct ath_hal *ah, const aniState->cckPhyErrCount <= aniState->listenTime * params->cckTrigLow/1000) ar5416AniLowerImmunity(ah); + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: lower immunity\n", + __func__); ar5416AniRestart(ah, aniState); } else if (aniState->listenTime > params->period) { updateMIBStats(ah, aniState); From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 20:23:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CAE51065674; Mon, 27 Aug 2012 20:23:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 580D98FC0C; Mon, 27 Aug 2012 20:23:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RKN4l2051961; Mon, 27 Aug 2012 20:23:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RKN4tb051959; Mon, 27 Aug 2012 20:23:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208272023.q7RKN4tb051959@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 Aug 2012 20:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239754 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:23:04 -0000 Author: kib Date: Mon Aug 27 20:23:03 2012 New Revision: 239754 URL: http://svn.freebsd.org/changeset/base/239754 Log: MFC r239374: Deliver SIGSYS to the guilty thread, not to the process. Modified: stable/9/sys/kern/kern_sig.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Mon Aug 27 20:10:38 2012 (r239753) +++ stable/9/sys/kern/kern_sig.c Mon Aug 27 20:23:03 2012 (r239754) @@ -3313,7 +3313,7 @@ nosys(td, args) struct proc *p = td->td_proc; PROC_LOCK(p); - kern_psignal(p, SIGSYS); + tdsignal(td, SIGSYS); PROC_UNLOCK(p); return (ENOSYS); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 20:25:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F9DA106564A; Mon, 27 Aug 2012 20:25:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5788FC19; Mon, 27 Aug 2012 20:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RKPRsw052278; Mon, 27 Aug 2012 20:25:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RKPRMJ052276; Mon, 27 Aug 2012 20:25:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208272025.q7RKPRMJ052276@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 Aug 2012 20:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239755 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:25:27 -0000 Author: kib Date: Mon Aug 27 20:25:26 2012 New Revision: 239755 URL: http://svn.freebsd.org/changeset/base/239755 Log: MFC r239588: Provide some compat32 shims for sysctl vfs.conflist. It is required for getvfsbyname(3) operation when called from 32bit process, and getvfsbyname(3) is used by recent bsdtar import. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Mon Aug 27 20:23:03 2012 (r239754) +++ stable/9/sys/kern/vfs_subr.c Mon Aug 27 20:25:26 2012 (r239755) @@ -41,6 +41,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_ddb.h" #include "opt_watchdog.h" @@ -3110,22 +3111,50 @@ DB_SHOW_COMMAND(mount, db_show_mount) /* * Fill in a struct xvfsconf based on a struct vfsconf. */ -static void -vfsconf2x(struct vfsconf *vfsp, struct xvfsconf *xvfsp) +static int +vfsconf2x(struct sysctl_req *req, struct vfsconf *vfsp) { + struct xvfsconf xvfsp; - strcpy(xvfsp->vfc_name, vfsp->vfc_name); - xvfsp->vfc_typenum = vfsp->vfc_typenum; - xvfsp->vfc_refcount = vfsp->vfc_refcount; - xvfsp->vfc_flags = vfsp->vfc_flags; + bzero(&xvfsp, sizeof(xvfsp)); + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; /* * These are unused in userland, we keep them * to not break binary compatibility. */ - xvfsp->vfc_vfsops = NULL; - xvfsp->vfc_next = NULL; + xvfsp.vfc_vfsops = NULL; + xvfsp.vfc_next = NULL; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); } +#ifdef COMPAT_FREEBSD32 +struct xvfsconf32 { + uint32_t vfc_vfsops; + char vfc_name[MFSNAMELEN]; + int32_t vfc_typenum; + int32_t vfc_refcount; + int32_t vfc_flags; + uint32_t vfc_next; +}; + +static int +vfsconf2x32(struct sysctl_req *req, struct vfsconf *vfsp) +{ + struct xvfsconf32 xvfsp; + + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; + xvfsp.vfc_vfsops = 0; + xvfsp.vfc_next = 0; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +} +#endif + /* * Top level filesystem related information gathering. */ @@ -3133,14 +3162,16 @@ static int sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) { struct vfsconf *vfsp; - struct xvfsconf xvfsp; int error; error = 0; TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - error = SYSCTL_OUT(req, &xvfsp, sizeof xvfsp); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + error = vfsconf2x32(req, vfsp); + else +#endif + error = vfsconf2x(req, vfsp); if (error) break; } @@ -3160,7 +3191,6 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) int *name = (int *)arg1 - 1; /* XXX */ u_int namelen = arg2 + 1; /* XXX */ struct vfsconf *vfsp; - struct xvfsconf xvfsp; printf("WARNING: userland calling deprecated sysctl, " "please rebuild world\n"); @@ -3184,9 +3214,12 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) break; if (vfsp == NULL) return (EOPNOTSUPP); - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + return (vfsconf2x32(req, vfsp)); + else +#endif + return (vfsconf2x(req, vfsp)); } return (EOPNOTSUPP); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 20:30:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C63241065670; Mon, 27 Aug 2012 20:30:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B150B8FC0A; Mon, 27 Aug 2012 20:30:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RKU7bE052886; Mon, 27 Aug 2012 20:30:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RKU7ak052883; Mon, 27 Aug 2012 20:30:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272030.q7RKU7ak052883@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 20:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239756 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:30:07 -0000 Author: adrian Date: Mon Aug 27 20:30:07 2012 New Revision: 239756 URL: http://svn.freebsd.org/changeset/base/239756 Log: Improve the sample rate logging. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Mon Aug 27 20:25:26 2012 (r239755) +++ head/sys/dev/ath/ath_rate/sample/sample.c Mon Aug 27 20:30:07 2012 (r239756) @@ -929,7 +929,7 @@ ath_rate_tx_complete(struct ath_softc *s * Only one rate was used; optimize work. */ IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, "%s: size %d (%d bytes) %s rate/try %d %s/%d/%d nframes/nbad [%d/%d]", + &an->an_node, "%s: size %d (%d bytes) %s rate/short/long %d %s/%d/%d nframes/nbad [%d/%d]", __func__, bin_to_size(size_to_bin(frame_size)), frame_size, @@ -961,11 +961,12 @@ ath_rate_tx_complete(struct ath_softc *s IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, -"%s: size %d (%d bytes) finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d] nframes/nbad [%d/%d]", +"%s: size %d (%d bytes) finaltsidx %d short %d long %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d] nframes/nbad [%d/%d]", __func__, bin_to_size(size_to_bin(frame_size)), frame_size, finalTSIdx, + short_tries, long_tries, status ? "FAIL" : "OK", dot11rate(rt, rc[0].rix), From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 21:49:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C8C8106564A; Mon, 27 Aug 2012 21:49:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB118FC17; Mon, 27 Aug 2012 21:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RLnbNZ062565; Mon, 27 Aug 2012 21:49:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RLnbdv062563; Mon, 27 Aug 2012 21:49:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272149.q7RLnbdv062563@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 21:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239757 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 21:49:38 -0000 Author: adrian Date: Mon Aug 27 21:49:37 2012 New Revision: 239757 URL: http://svn.freebsd.org/changeset/base/239757 Log: Convert to using ulzma. Modified: head/sys/mips/conf/AP96 Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Mon Aug 27 20:30:07 2012 (r239756) +++ head/sys/mips/conf/AP96 Mon Aug 27 21:49:37 2012 (r239757) @@ -25,15 +25,13 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip -options GEOM_UZIP +device geom_uncompress +options GEOM_UNCOMPRESS +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" # Used for the static uboot partition map device geom_map -# Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" - # Options needed for the EEPROM based calibration/PCI configuration data. options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash options ATH_EEPROM_FIRMWARE # Use EEPROM from flash From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 21:53:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DCC21065673; Mon, 27 Aug 2012 21:53:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88C008FC15; Mon, 27 Aug 2012 21:53:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RLr29Y063051; Mon, 27 Aug 2012 21:53:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RLr2Ua063049; Mon, 27 Aug 2012 21:53:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272153.q7RLr2Ua063049@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 21:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239758 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 21:53:02 -0000 Author: adrian Date: Mon Aug 27 21:53:01 2012 New Revision: 239758 URL: http://svn.freebsd.org/changeset/base/239758 Log: Slim down the default AR724X build. The AR724X boards tend to come with minimal RAM/flash. Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Mon Aug 27 21:49:37 2012 (r239757) +++ head/sys/mips/conf/AR724X_BASE Mon Aug 27 21:53:01 2012 (r239758) @@ -1,8 +1,9 @@ # # AR724X -- Kernel configuration file for FreeBSD/MIPS for Atheros 724x systems # -# This includes all the common drivers for the AR724x boards along with -# the usb, net80211 and atheros driver code. +# This includes all the common drivers for the AR724x boards. +# Since the AR724x boards tend to have minimal flash (sometimes 4MB!), +# the majority of the kernel framework will be built as modules. # # $FreeBSD$ # @@ -24,21 +25,19 @@ makeoptions DEBUG=-g #Build kernel with # Build these as modules so small platform builds will have the # modules already built. -makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc" options DDB options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options INET6 # IPv6 - -# options NFS_CL #Network Filesystem Client - +#options INET6 # IPv6 +#options NFS_CL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -# options NFS_LEGACYRPC +#options NFS_LEGACYRPC # Debugging for use in -current options INVARIANTS options INVARIANT_SUPPORT @@ -47,6 +46,10 @@ options WITNESS_SKIPSPIN options DEBUG_REDZONE options DEBUG_MEMGUARD +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + options FFS #Berkeley Fast Filesystem # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists @@ -60,27 +63,27 @@ device ar724x_pci options IEEE80211_DEBUG options IEEE80211_ALQ options IEEE80211_SUPPORT_MESH -# This option is currently broken for if_ath_tx. +options IEEE80211_SUPPORT_SUPERG options IEEE80211_SUPPORT_TDMA options IEEE80211_AMPDU_AGE -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_xauth # 802.11 hostap support # Atheros wireless NICs -device ath # Atheros interface support -device ath_pci # Atheros PCI/Cardbus bus +#device ath # Atheros interface support +#device ath_pci # Atheros PCI/Cardbus bus options ATH_DEBUG options ATH_DIAGAPI options ATH_ENABLE_11N options AH_DEBUG options AH_DEBUG_ALQ options ALQ -device ath_hal +#device ath_hal option AH_SUPPORT_AR5416 -device ath_rate_sample +#device ath_rate_sample option AH_RXCFG_SDMAMW_4BYTES option AH_AR5416_INTERRUPT_MITIGATION # There's no DFS radar detection support yet so this won't actually @@ -90,15 +93,16 @@ option ATH_ENABLE_DFS device mii device arge +options ARGE_DEBUG # Enable if_arge debugging for now -device usb +#device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order options USB_DEBUG options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this -device ehci +#device ehci device scbus -device umass +#device umass device da # On-board SPI flash @@ -114,12 +118,10 @@ device ether device md device bpf device random -device if_bridge -device gif # ip[46] in ip[46] tunneling protocol -device gre # generic encapsulation - only for IPv4 in IPv4 though atm - -options ARGE_DEBUG # Enable if_arge debugging for now +#device if_bridge +#device gif # ip[46] in ip[46] tunneling protocol +#device gre # generic encapsulation - only for IPv4 in IPv4 though atm # Enable GPIO -device gpio -device gpioled +#device gpio +#device gpioled From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 21:59:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93402106566C; Mon, 27 Aug 2012 21:59:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF3E8FC26; Mon, 27 Aug 2012 21:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RLxr3E064028; Mon, 27 Aug 2012 21:59:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RLxr4B064025; Mon, 27 Aug 2012 21:59:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272159.q7RLxr4B064025@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 21:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239759 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 21:59:53 -0000 Author: adrian Date: Mon Aug 27 21:59:52 2012 New Revision: 239759 URL: http://svn.freebsd.org/changeset/base/239759 Log: Convert AP93 to use the new AR724X_BASE configuration file. Modified: head/sys/mips/conf/AP93 head/sys/mips/conf/AP93.hints Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Mon Aug 27 21:53:01 2012 (r239758) +++ head/sys/mips/conf/AP93 Mon Aug 27 21:59:52 2012 (r239759) @@ -1,136 +1,44 @@ # -# AP93 -- Kernel configuration file for FreeBSD/mips for Atheros AP93 reference -# board (AR7240) +# Specific board setup for the Atheros AP91 reference board. # -# $FreeBSD$ +# The AP93 has the following hardware: # +# + AR7240 CPU SoC +# + AR9280 Wifi +# + Integrated switch (XXX speed?) +# + 16MB flash +# + 64MB RAM +# + uboot environment -ident AP93 +# $FreeBSD$ -# XXX The default load address in the Uboot environment is 0x80010000 -makeoptions KERNLOADADDR=0x80050000 -options HZ=1000 +include "AR724X_BASE" +ident "AP93" +hints "AP93.hints" -# The AP93 has 64mb of RAM; hard-code that options AR71XX_REALMEM=64*1024*1024 -# It's UBOOT, not Redboot - without this, things will hang at startup options AR71XX_ENV_UBOOT -makeoptions MODULES_OVERRIDE="ath ath_pci ath_ahb bridgestp if_bridge if_gif if_gre random wlan wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt wlan_tkip wlan_wep wlan_xauth usb ar71xx" - -hints "AP93.hints" -include "../atheros/std.ar71xx" - -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="" +# For DOS - enable if required +options MSDOSFS -options DDB -options KDB - -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -# Can't do IPv6 - it just doesn't fit. -# options INET6 -# options NFSCL #Network Filesystem Client -options PSEUDOFS #Pseudo-filesystem framework -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options ALQ - -# Debugging for use in -current -options DEADLKRES -options INVARIANTS -options INVARIANT_SUPPORT -options WITNESS -options WITNESS_SKIPSPIN -options FFS #Berkeley Fast Filesystem - -# Support uncompress lzma rootfs +# uncompress - to boot read-only lzma natively from flash device geom_uncompress options GEOM_UNCOMPRESS options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" -# PCI bus -device pci -device ar724x_pci -# Enable the AR71xx EEPROM PCI(e) workaround -options AR71XX_ATH_EEPROM - -# NVRAM U-Boot Environment -> Kernel environment -device nvram2env - -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_ALQ - -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support - -device ath # Atheros pci/cardbus NIC's -device ath_pci # PCI/PCIe bus glue -options ATH_DEBUG -options ATH_ENABLE_11N -options ATH_DIAGAPI -device firmware -options ATH_EEPROM_FIRMWARE - -device ath_hal -options AH_SUPPORT_AR5416 -options AH_DEBUG -options AH_DEBUG_ALQ - -device ath_rate_sample - -device mii -device arge -device miiproxy -options ARGE_DEBUG -options ARGE_MDIO -device etherswitch -device arswitch +# Used for the static uboot partition map +device geom_map -# USB devices - (todo: does AR7240 have OHCI, or just EHCI?) +# Options needed for the EEPROM based calibration/PCI configuration data. +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous -#device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 -#device ehci - -# Mass storage -#device scbus -#device umass -#device da - -# Read MSDOS formatted disks -#options MSDOSFS - -# GPIO Bus -#device gpio -#device gpioled - -# SPI and flash -device spibus -device ar71xx_spi -device mx25l - -# The flash is statically partitioned; add in that -device geom_map - -device ar71xx_wdog - -# Serial -device uart - -# Network twiddling -device loop -device ether -device md -device bpf -device random -device if_bridge +device etherswitch +device arswitch Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Mon Aug 27 21:53:01 2012 (r239758) +++ head/sys/mips/conf/AP93.hints Mon Aug 27 21:59:52 2012 (r239759) @@ -1,15 +1,5 @@ # $FreeBSD$ -hint.apb.0.at="nexus0" -hint.apb.0.irq=4 - -# uart0 -hint.uart.0.at="apb0" -# see atheros/uart_cpu_ar71xx.c why +3 -hint.uart.0.maddr=0x18020003 -hint.uart.0.msize=0x18 -hint.uart.0.irq=3 - # arge0 MDIO bus hint.argemdio.0.at="nexus0" hint.argemdio.0.maddr=0x19000000 @@ -21,21 +11,12 @@ hint.argemdio.0.order=0 # arge0: MII; dedicated PHY 4 on switch, connected via internal switch # MDIO bus. -hint.arge.0.at="nexus0" -hint.arge.0.maddr=0x19000000 -hint.arge.0.msize=0x1000 -hint.arge.0.irq=2 # hint.arge.0.eeprommac=0x83fe9ff0 hint.arge.0.phymask=0x10 # PHY 4 # hint.arge.0.miimode=2 # MII hint.arge.0.mdio=mdioproxy1 # Hanging off the arswitch MDIO bus # arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII. -hint.arge.1.at="nexus0" -hint.arge.1.maddr=0x1A000000 -hint.arge.1.msize=0x1000 -hint.arge.1.irq=3 - hint.arge.1.phymask=0x0 # hint.arge.1.miimode=1 # GMII hint.arge.1.media=1000 # Force to 1000BaseTX/full @@ -54,25 +35,6 @@ hint.arswitch.0.is_gmii=0 # No, not GMII hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000 hint.pcib.0.bus.0.0.0.ath_fixup_size=4096 -# ehci - note the 0x100 offset for the AR913x/AR724x -hint.ehci.0.at="nexus0" -hint.ehci.0.maddr=0x1b000100 -hint.ehci.0.msize=0x00ffff00 -hint.ehci.0.irq=1 - -# pci -hint.pcib.0.at="nexus0" -hint.pcib.0.irq=0 - -# ath -hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" - -# GPIO -hint.gpio.0.at="apb0" -hint.gpio.0.maddr=0x18040000 -hint.gpio.0.msize=0x1000 -hint.gpio.0.irq=2 - # Signal leds hint.gpioled.0.at="gpiobus0" hint.gpioled.0.name="sig1" @@ -87,18 +49,6 @@ hint.gpioled.3.at="gpiobus0" hint.gpioled.3.name="sig4" hint.gpioled.3.pins=0x0080 # pin 7 -# SPI controller/bus -hint.spi.0.at="nexus0" -hint.spi.0.maddr=0x1f000000 -hint.spi.0.msize=0x10 - -# SPI flash -hint.mx25l.0.at="spibus0" -hint.mx25l.0.cs=0 - -# Watchdog -hint.ar71xx_wdog.0.at="nexus0" - # nvram mapping - XXX ? hint.nvram.0.base=0x1f030000 hint.nvram.0.maxsize=0x2000 From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 23:18:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428C3106566B; Mon, 27 Aug 2012 23:18:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0C38FC16; Mon, 27 Aug 2012 23:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RNIgce073174; Mon, 27 Aug 2012 23:18:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RNIfcO073172; Mon, 27 Aug 2012 23:18:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272318.q7RNIfcO073172@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 23:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239760 - head/sys/dev/wtap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 23:18:42 -0000 Author: adrian Date: Mon Aug 27 23:18:41 2012 New Revision: 239760 URL: http://svn.freebsd.org/changeset/base/239760 Log: Don't grab an unreferenced pointer to the VAP bss node. Modified: head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Mon Aug 27 21:59:52 2012 (r239759) +++ head/sys/dev/wtap/if_wtap.c Mon Aug 27 23:18:41 2012 (r239760) @@ -268,7 +268,7 @@ wtap_newstate(struct ieee80211vap *vap, DWTAP_PRINTF("%s\n", __func__); - ni = vap->iv_bss; + ni = ieee80211_ref_node(vap->iv_bss); /* * Invoke the parent method to do net80211 work. */ @@ -278,7 +278,8 @@ wtap_newstate(struct ieee80211vap *vap, if (nstate == IEEE80211_S_RUN) { /* NB: collect bss node again, it may have changed */ - ni = vap->iv_bss; + ieee80211_free_node(ni); + ni = ieee80211_ref_node(vap->iv_bss); switch (vap->iv_opmode) { case IEEE80211_M_MBSS: error = wtap_beacon_alloc(sc, ni); @@ -294,9 +295,11 @@ wtap_newstate(struct ieee80211vap *vap, } else if (nstate == IEEE80211_S_INIT) { callout_stop(&avp->av_swba); } + ieee80211_free_node(ni); return 0; bad: printf("%s: bad\n", __func__); + ieee80211_free_node(ni); return error; } @@ -319,6 +322,7 @@ wtap_vap_create(struct ieee80211com *ic, struct ieee80211vap *vap; struct wtap_vap *avp; int error; + struct ieee80211_node *ni; DWTAP_PRINTF("%s\n", __func__); @@ -347,7 +351,9 @@ wtap_vap_create(struct ieee80211com *ic, (const char *)ic->ic_ifp->if_xname); /* TODO this is a hack to force it to choose the rate we want */ - vap->iv_bss->ni_txrate = 130; + ni = ieee80211_ref_node(vap->iv_bss); + ni->ni_txrate = 130; + ieee80211_free_node(ni); return vap; } From owner-svn-src-all@FreeBSD.ORG Mon Aug 27 23:27:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4E5B106566C; Mon, 27 Aug 2012 23:27:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06408FC1B; Mon, 27 Aug 2012 23:27:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RNRfWk074357; Mon, 27 Aug 2012 23:27:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RNRf01074355; Mon, 27 Aug 2012 23:27:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272327.q7RNRf01074355@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 23:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239761 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 23:27:42 -0000 Author: adrian Date: Mon Aug 27 23:27:41 2012 New Revision: 239761 URL: http://svn.freebsd.org/changeset/base/239761 Log: Only print the descriptor contents! Found by: magical CLANG build environments Submitted by: Sevan Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Mon Aug 27 23:18:41 2012 (r239760) +++ head/sys/dev/ath/if_ath_debug.c Mon Aug 27 23:27:41 2012 (r239761) @@ -178,10 +178,10 @@ ath_printtxbuf_edma(struct ath_softc *sc eds->ds_hw[8], eds->ds_hw[9], eds->ds_hw[10], eds->ds_hw[11], eds->ds_hw[12], eds->ds_hw[13]); - printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + printf(" %08x %08x %08x %08x %08x %08x %08x\n", eds->ds_hw[14], eds->ds_hw[15], eds->ds_hw[16], eds->ds_hw[17], eds->ds_hw[18], eds->ds_hw[19], - eds->ds_hw[20], eds->ds_hw[21]); + eds->ds_hw[20]); #if 0 printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", ds->ds_hw[22],ds->ds_hw[23],ds->ds_hw[24], From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 01:28:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 539771065676; Tue, 28 Aug 2012 01:28:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A4E48FC0C; Tue, 28 Aug 2012 01:28:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S1Sr9x088040; Tue, 28 Aug 2012 01:28:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S1SriX088038; Tue, 28 Aug 2012 01:28:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208280128.q7S1SriX088038@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 01:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239762 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 01:28:53 -0000 Author: imp Date: Tue Aug 28 01:28:52 2012 New Revision: 239762 URL: http://svn.freebsd.org/changeset/base/239762 Log: Bring in the multi-block patches for mci. These required extensive restructuring of the driver. I've tried to preserve the other silicon workarounds that we've added over the years, but haven't had a chance to extensively test on other hardware. On my AT91RM9200 with 30MHz/1 wire/64 block transfers, I've been able to go from ~.66MB/s to 2.25MB/s in the simple tests I performed, almost a 3.5x improvement. This cuts the boot time almost in half when everything else goes right (timed from rtc message to login: prompt). PR: 155214 Submitted by: Ian Lapore Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 23:27:41 2012 (r239761) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 01:28:52 2012 (r239762) @@ -114,7 +114,24 @@ __FBSDID("$FreeBSD$"); #define AT91_MCI_USE_30MHZ 1 #endif -#define BBSZ 512 +/* + * Allocate 2 bounce buffers we'll use to endian-swap the data due to the rm9200 + * erratum. We use a pair of buffers because when reading that lets us begin + * endian-swapping the data in the first buffer while the DMA is reading into + * the second buffer. (We can't use the same trick for writing because we might + * not get all the data in the 2nd buffer swapped before the hardware needs it; + * dealing with that would add complexity to the driver.) + * + * The buffers are sized at 16K each due to the way the busdma cache sync + * operations work on arm. A dcache_inv_range() operation on a range larger + * than 16K gets turned into a dcache_wbinv_all(). That needlessly flushes the + * entire data cache, impacting overall system performance. + */ +#define BBCOUNT 2 +#define BBSIZE (16*1024) +#define MAX_BLOCKS ((BBSIZE*BBCOUNT)/512) + +static int mci_debug; struct at91_mci_softc { void *intrhand; /* Interrupt handle */ @@ -123,21 +140,25 @@ struct at91_mci_softc { #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ #define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ int flags; -#define CMD_STARTED 1 -#define STOP_STARTED 2 +#define PENDING_CMD 0x01 +#define PENDING_STOP 0x02 +#define CMD_MULTIREAD 0x10 +#define CMD_MULTIWRITE 0x20 int has_4wire; int use_30mhz; struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; bus_dma_tag_t dmatag; - bus_dmamap_t map; - int mapped; struct mmc_host host; int bus_busy; struct mmc_request *req; struct mmc_command *curcmd; - char bounce_buffer[BBSZ]; + bus_dmamap_t bbuf_map[BBCOUNT]; + char * bbuf_vaddr[BBCOUNT]; /* bounce bufs in KVA space */ + uint32_t bbuf_len[BBCOUNT]; /* len currently queued for bounce buf */ + uint32_t bbuf_curidx; /* which bbuf is the active DMA buffer */ + uint32_t xfer_offset; /* offset so far into caller's buf */ }; static inline uint32_t @@ -172,6 +193,51 @@ static int at91_mci_is_mci1rev2xx(void); #define AT91_MCI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define AT91_MCI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static void +at91_bswap_buf(struct at91_mci_softc *sc, void * dptr, void * sptr, uint32_t memsize) +{ + uint32_t * dst = (uint32_t *)dptr; + uint32_t * src = (uint32_t *)sptr; + uint32_t i; + + /* + * If the hardware doesn't need byte-swapping, let bcopy() do the + * work. Use bounce buffer even if we don't need byteswap, since + * buffer may straddle a page boundry, and we don't handle + * multi-segment transfers in hardware. Seen from 'bsdlabel -w' which + * uses raw geom access to the volume. Greg Ansley (gja (at) + * ansley.com) + */ + if (!(sc->sc_cap & CAP_NEEDS_BYTESWAP)) { + bcopy(dptr, sptr, memsize); + return; + } + + /* + * Nice performance boost for slightly unrolling this loop. + * (But very little extra boost for further unrolling it.) + */ + for (i = 0; i < memsize; i += 16) { + *dst++ = bswap32(*src++); + *dst++ = bswap32(*src++); + *dst++ = bswap32(*src++); + *dst++ = bswap32(*src++); + } + + /* Mop up the last 1-3 words, if any. */ + for (i = 0; i < (memsize & 0x0F); i += 4) { + *dst++ = bswap32(*src++); + } +} + +static void +at91_mci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) + return; + *(bus_addr_t *)arg = segs[0].ds_addr; +} + static void at91_mci_pdc_disable(struct at91_mci_softc *sc) { @@ -186,13 +252,57 @@ at91_mci_pdc_disable(struct at91_mci_sof WR4(sc, PDC_TNCR, 0); } +/* + * Reset the controller, then restore most of the current state. + * + * This is called after detecting an error. It's also called after stopping a + * multi-block write, to un-wedge the device so that it will handle the NOTBUSY + * signal correctly. See comments in at91_mci_stop_done() for more details. + */ +static void at91_mci_reset(struct at91_mci_softc *sc) +{ + uint32_t mr; + uint32_t sdcr; + uint32_t dtor; + uint32_t imr; + + at91_mci_pdc_disable(sc); + + /* save current state */ + + imr = RD4(sc, MCI_IMR); + mr = RD4(sc, MCI_MR) & 0x7fff; + sdcr = RD4(sc, MCI_SDCR); + dtor = RD4(sc, MCI_DTOR); + + /* reset the controller */ + + WR4(sc, MCI_IDR, 0xffffffff); + WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); + + /* restore state */ + + WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); + WR4(sc, MCI_MR, mr); + WR4(sc, MCI_SDCR, sdcr); + WR4(sc, MCI_DTOR, dtor); + WR4(sc, MCI_IER, imr); + + /* + * Make sure sdio interrupts will fire. Not sure why reading + * SR ensures that, but this is in the linux driver. + */ + + RD4(sc, MCI_SR); +} + static void at91_mci_init(device_t dev) { struct at91_mci_softc *sc = device_get_softc(dev); uint32_t val; - WR4(sc, MCI_CR, MCI_CR_MCIEN); /* Enable controller */ + WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); /* device into reset */ WR4(sc, MCI_IDR, 0xffffffff); /* Turn off interrupts */ WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); val = MCI_MR_PDCMODE; @@ -203,10 +313,19 @@ at91_mci_init(device_t dev) #ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ #else - /* XXX Really should add second "unit" but nobody using using - * a two slot card that we know of. -- except they are... XXX */ + /* + * XXX Really should add second "unit" but nobody using using + * a two slot card that we know of. XXX + */ WR4(sc, MCI_SDCR, 1); /* SLOT B, 1 bit bus */ #endif + /* + * Enable controller, including power-save. The slower clock + * of the power-save mode is only in effect when there is no + * transfer in progress, so it can be left in this mode all + * the time. + */ + WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); } static void @@ -216,7 +335,7 @@ at91_mci_fini(device_t dev) WR4(sc, MCI_IDR, 0xffffffff); /* Turn off interrupts */ at91_mci_pdc_disable(sc); - WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); /* Put the device into reset */ + WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); /* device into reset */ } static int @@ -234,7 +353,7 @@ at91_mci_attach(device_t dev) struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; device_t child; - int err; + int err, i; sctx = device_get_sysctl_ctx(dev); soid = device_get_sysctl_tree(dev); @@ -249,21 +368,33 @@ at91_mci_attach(device_t dev) AT91_MCI_LOCK_INIT(sc); + at91_mci_fini(dev); + at91_mci_init(dev); + /* - * Allocate DMA tags and maps + * Allocate DMA tags and maps and bounce buffers. + * + * The parms in the tag_create call cause the dmamem_alloc call to + * create each bounce buffer as a single contiguous buffer of BBSIZE + * bytes aligned to a 4096 byte boundary. + * + * Do not use DMA_COHERENT for these buffers because that maps the + * memory as non-cachable, which prevents cache line burst fills/writes, + * which is something we need since we're trying to overlap the + * byte-swapping with the DMA operations. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MAXPHYS, 1, - MAXPHYS, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->dmatag); + err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BBSIZE, 1, BBSIZE, 0, NULL, NULL, &sc->dmatag); if (err != 0) goto out; - err = bus_dmamap_create(sc->dmatag, 0, &sc->map); - if (err != 0) - goto out; - - at91_mci_fini(dev); - at91_mci_init(dev); + for (i = 0; i < BBCOUNT; ++i) { + err = bus_dmamem_alloc(sc->dmatag, (void **)&sc->bbuf_vaddr[i], + BUS_DMA_NOWAIT, &sc->bbuf_map[i]); + if (err != 0) + goto out; + } /* * Activate the interrupt @@ -330,8 +461,15 @@ out: static int at91_mci_detach(device_t dev) { + struct at91_mci_softc *sc = device_get_softc(dev); + at91_mci_fini(dev); at91_mci_deactivate(dev); + + bus_dmamem_free(sc->dmatag, sc->bbuf_vaddr[0], sc->bbuf_map[0]); + bus_dmamem_free(sc->dmatag, sc->bbuf_vaddr[1], sc->bbuf_map[1]); + bus_dma_tag_destroy(sc->dmatag); + return (EBUSY); /* XXX */ } @@ -398,14 +536,6 @@ at91_mci_is_mci1rev2xx(void) } } -static void -at91_mci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - *(bus_addr_t *)arg = segs[0].ds_addr; -} - static int at91_mci_update_ios(device_t brdev, device_t reqdev) { @@ -437,7 +567,7 @@ at91_mci_update_ios(device_t brdev, devi if (sc->use_30mhz && ios->clock == 25000000 && at91_master_clock > 50000000) clkdiv = 0; - else if ((at91_master_clock % (ios->clock * 2)) == 0) + else if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; else clkdiv = (at91_master_clock / ios->clock) / 2; @@ -456,73 +586,182 @@ at91_mci_update_ios(device_t brdev, devi static void at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd) { - size_t len; - uint32_t cmdr, ier = 0, mr; - uint32_t *src, *dst; - int i; + uint32_t cmdr, mr; struct mmc_data *data; - void *vaddr; - bus_addr_t paddr; sc->curcmd = cmd; data = cmd->data; - cmdr = cmd->opcode; /* XXX Upper layers don't always set this */ cmd->mrq = sc->req; + /* Begin setting up command register. */ + + cmdr = cmd->opcode; + + if (sc->host.ios.bus_mode == opendrain) + cmdr |= MCI_CMDR_OPDCMD; + + /* Set up response handling. Allow max timeout for responses. */ + if (MMC_RSP(cmd->flags) == MMC_RSP_NONE) cmdr |= MCI_CMDR_RSPTYP_NO; else { - /* Allow big timeout for responses */ cmdr |= MCI_CMDR_MAXLAT; if (cmd->flags & MMC_RSP_136) cmdr |= MCI_CMDR_RSPTYP_136; else cmdr |= MCI_CMDR_RSPTYP_48; } - if (cmd->opcode == MMC_STOP_TRANSMISSION) - cmdr |= MCI_CMDR_TRCMD_STOP; - if (sc->host.ios.bus_mode == opendrain) - cmdr |= MCI_CMDR_OPDCMD; - if (!data) { - // The no data case is fairly simple + + /* + * If there is no data transfer, just set up the right interrupt mask + * and start the command. + * + * The interrupt mask needs to be CMDRDY plus all non-data-transfer + * errors. It's important to leave the transfer-related errors out, to + * avoid spurious timeout or crc errors on a STOP command following a + * multiblock read. When a multiblock read is in progress, sending a + * STOP in the middle of a block occasionally triggers such errors, but + * we're totally disinterested in them because we've already gotten all + * the data we wanted without error before sending the STOP command. + */ + + if (data == NULL) { + uint32_t ier = MCI_SR_CMDRDY | + MCI_SR_RTOE | MCI_SR_RENDE | + MCI_SR_RCRCE | MCI_SR_RDIRE | MCI_SR_RINDE; + at91_mci_pdc_disable(sc); -// printf("CMDR %x ARGR %x\n", cmdr, cmd->arg); + + if (cmd->opcode == MMC_STOP_TRANSMISSION) + cmdr |= MCI_CMDR_TRCMD_STOP; + + /* Ignore response CRC on CMD2 and ACMD41, per standard. */ + + if (cmd->opcode == MMC_SEND_OP_COND || + cmd->opcode == ACMD_SD_SEND_OP_COND) + ier &= ~MCI_SR_RCRCE; + + if (mci_debug) + printf("CMDR %x (opcode %d) ARGR %x no data\n", + cmdr, cmd->opcode, cmd->arg); + WR4(sc, MCI_ARGR, cmd->arg); WR4(sc, MCI_CMDR, cmdr); - WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_CMDRDY); + WR4(sc, MCI_IDR, 0xffffffff); + WR4(sc, MCI_IER, ier); return; } + + /* There is data, set up the transfer-related parts of the command. */ + if (data->flags & MMC_DATA_READ) cmdr |= MCI_CMDR_TRDIR; + if (data->flags & (MMC_DATA_READ | MMC_DATA_WRITE)) cmdr |= MCI_CMDR_TRCMD_START; + if (data->flags & MMC_DATA_STREAM) cmdr |= MCI_CMDR_TRTYP_STREAM; - if (data->flags & MMC_DATA_MULTI) + else if (data->flags & MMC_DATA_MULTI) { cmdr |= MCI_CMDR_TRTYP_MULTIPLE; - // Set block size and turn on PDC mode for dma xfer and disable - // PDC until we're ready. - mr = RD4(sc, MCI_MR) & ~MCI_MR_BLKLEN; - WR4(sc, MCI_MR, mr | (data->len << 16) | MCI_MR_PDCMODE); - WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); - if (cmdr & MCI_CMDR_TRCMD_START) { - len = data->len; - if (cmdr & MCI_CMDR_TRDIR) - vaddr = cmd->data->data; - else { - /* Use bounce buffer even if we don't need - * byteswap, since buffer may straddle a page - * boundry, and we don't handle multi-segment - * transfers in hardware. - * (page issues seen from 'bsdlabel -w' which - * uses raw geom access to the volume). - * Greg Ansley (gja (at) ansley.com) - */ - vaddr = sc->bounce_buffer; - src = (uint32_t *)cmd->data->data; - dst = (uint32_t *)vaddr; + sc->flags |= (data->flags & MMC_DATA_READ) ? + CMD_MULTIREAD : CMD_MULTIWRITE; + } + + /* + * Disable PDC until we're ready. + * + * Set block size and turn on PDC mode for dma xfer. + * Note that the block size is the smaller of the amount of data to be + * transferred, or 512 bytes. The 512 size is fixed by the standard; + * smaller blocks are possible, but never larger. + */ + + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + + mr = RD4(sc,MCI_MR) & ~MCI_MR_BLKLEN; + mr |= min(data->len, 512) << 16; + WR4(sc, MCI_MR, mr | MCI_MR_PDCMODE|MCI_MR_PDCPADV); + + /* + * Set up DMA. + * + * Use bounce buffers even if we don't need to byteswap, because doing + * multi-block IO with large DMA buffers is way fast (compared to + * single-block IO), even after incurring the overhead of also copying + * from/to the caller's buffers (which may be in non-contiguous physical + * pages). + * + * In an ideal non-byteswap world we could create a dma tag that allows + * for discontiguous segments and do the IO directly from/to the + * caller's buffer(s), using ENDRX/ENDTX interrupts to chain the + * discontiguous buffers through the PDC. Someday. + * + * If a read is bigger than 2k, split it in half so that we can start + * byte-swapping the first half while the second half is on the wire. + * It would be best if we could split it into 8k chunks, but we can't + * always keep up with the byte-swapping due to other system activity, + * and if an RXBUFF interrupt happens while we're still handling the + * byte-swap from the prior buffer (IE, we haven't returned from + * handling the prior interrupt yet), then data will get dropped on the + * floor and we can't easily recover from that. The right fix for that + * would be to have the interrupt handling only keep the DMA flowing and + * enqueue filled buffers to be byte-swapped in a non-interrupt context. + * Even that won't work on the write side of things though; in that + * context we have to have all the data ready to go before starting the + * dma. + * + * XXX what about stream transfers? + */ + sc->xfer_offset = 0; + sc->bbuf_curidx = 0; + + if (data->flags & (MMC_DATA_READ | MMC_DATA_WRITE)) { + uint32_t len; + uint32_t remaining = data->len; + bus_addr_t paddr; + int err; + + if (remaining > (BBCOUNT*BBSIZE)) + panic("IO read size exceeds MAXDATA\n"); + + if (data->flags & MMC_DATA_READ) { + if (remaining > 2048) // XXX + len = remaining / 2; + else + len = remaining; + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO read dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + BUS_DMASYNC_PREREAD); + WR4(sc, PDC_RPR, paddr); + WR4(sc, PDC_RCR, len / 4); + sc->bbuf_len[0] = len; + remaining -= len; + if (remaining == 0) { + sc->bbuf_len[1] = 0; + } else { + len = remaining; + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO read dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + BUS_DMASYNC_PREREAD); + WR4(sc, PDC_RNPR, paddr); + WR4(sc, PDC_RNCR, len / 4); + sc->bbuf_len[1] = len; + remaining -= len; + } + WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); + } else { + len = min(BBSIZE, remaining); /* * If this is MCI1 revision 2xx controller, apply * a work-around for the "Data Write Operation and @@ -530,74 +769,75 @@ at91_mci_start_cmd(struct at91_mci_softc */ if (at91_mci_is_mci1rev2xx() && data->len < 12) { len = 12; - memset(dst, 0, 12); + memset(data->data, 0, 12); } - if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { - for (i = 0; i < data->len / 4; i++) - dst[i] = bswap32(src[i]); - } else - memcpy(dst, src, data->len); - } - data->xfer_len = 0; - if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, len, - at91_mci_getaddr, &paddr, 0) != 0) { - cmd->error = MMC_ERR_NO_MEMORY; - sc->req = NULL; - sc->curcmd = NULL; - cmd->mrq->done(cmd->mrq); - return; - } - sc->mapped++; - if (cmdr & MCI_CMDR_TRDIR) { - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_PREREAD); - WR4(sc, PDC_RPR, paddr); - WR4(sc, PDC_RCR, len / 4); - ier = MCI_SR_ENDRX; - } else { - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_PREWRITE); - WR4(sc, PDC_TPR, paddr); + at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO write dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + BUS_DMASYNC_PREWRITE); + WR4(sc, PDC_TPR,paddr); WR4(sc, PDC_TCR, len / 4); - ier = MCI_SR_TXBUFE; + sc->bbuf_len[0] = len; + remaining -= len; + if (remaining == 0) { + sc->bbuf_len[1] = 0; + } else { + len = remaining; + at91_bswap_buf(sc, sc->bbuf_vaddr[1], + ((char *)data->data)+BBSIZE, len); + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO write dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + BUS_DMASYNC_PREWRITE); + WR4(sc, PDC_TNPR, paddr); + WR4(sc, PDC_TNCR, len / 4); + sc->bbuf_len[1] = len; + remaining -= len; + } + /* do not enable PDC xfer until CMDRDY asserted */ } + data->xfer_len = 0; /* XXX what's this? appears to be unused. */ } -// printf("CMDR %x ARGR %x with data\n", cmdr, cmd->arg); + + if (mci_debug) + printf("CMDR %x (opcode %d) ARGR %x with data len %d\n", + cmdr, cmd->opcode, cmd->arg, cmd->data->len); + WR4(sc, MCI_ARGR, cmd->arg); - if (cmdr & MCI_CMDR_TRCMD_START) { - if (cmdr & MCI_CMDR_TRDIR) { - WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); - WR4(sc, MCI_CMDR, cmdr); - } else { - WR4(sc, MCI_CMDR, cmdr); - WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN); - } - } - WR4(sc, MCI_IER, MCI_SR_ERROR | ier); + WR4(sc, MCI_CMDR, cmdr); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_CMDRDY); } static void -at91_mci_start(struct at91_mci_softc *sc) +at91_mci_next_operation(struct at91_mci_softc *sc) { struct mmc_request *req; req = sc->req; if (req == NULL) return; - // assert locked - if (!(sc->flags & CMD_STARTED)) { - sc->flags |= CMD_STARTED; -// printf("Starting CMD\n"); + + if (sc->flags & PENDING_CMD) { + sc->flags &= ~PENDING_CMD; at91_mci_start_cmd(sc, req->cmd); return; - } - if (!(sc->flags & STOP_STARTED) && req->stop) { -// printf("Starting Stop\n"); - sc->flags |= STOP_STARTED; + } else if (sc->flags & PENDING_STOP) { + sc->flags &= ~PENDING_STOP; at91_mci_start_cmd(sc, req->stop); return; } - /* We must be done -- bad idea to do this while locked? */ + + WR4(sc, MCI_IDR, 0xffffffff); sc->req = NULL; sc->curcmd = NULL; + //printf("req done\n"); req->done(req); } @@ -607,16 +847,16 @@ at91_mci_request(device_t brdev, device_ struct at91_mci_softc *sc = device_get_softc(brdev); AT91_MCI_LOCK(sc); - // XXX do we want to be able to queue up multiple commands? - // XXX sounds like a good idea, but all protocols are sync, so - // XXX maybe the idea is naive... if (sc->req != NULL) { AT91_MCI_UNLOCK(sc); return (EBUSY); } + //printf("new req\n"); sc->req = req; - sc->flags = 0; - at91_mci_start(sc); + sc->flags = PENDING_CMD; + if (sc->req->stop) + sc->flags |= PENDING_STOP; + at91_mci_next_operation(sc); AT91_MCI_UNLOCK(sc); return (0); } @@ -654,120 +894,351 @@ at91_mci_release_host(device_t brdev, de } static void -at91_mci_read_done(struct at91_mci_softc *sc) +at91_mci_read_done(struct at91_mci_softc *sc, uint32_t sr) { - uint32_t *walker; - struct mmc_command *cmd; - int i, len; - - cmd = sc->curcmd; - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->dmatag, sc->map); - sc->mapped--; - if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { - walker = (uint32_t *)cmd->data->data; - len = cmd->data->len / 4; - for (i = 0; i < len; i++) - walker[i] = bswap32(walker[i]); - } - // Finish up the sequence... - WR4(sc, MCI_IDR, MCI_SR_ENDRX); - WR4(sc, MCI_IER, MCI_SR_RXBUFF); - WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + struct mmc_command *cmd = sc->curcmd; + char * dataptr = (char *)cmd->data->data; + uint32_t curidx = sc->bbuf_curidx; + uint32_t len = sc->bbuf_len[curidx]; + + /* + * We arrive here when a DMA transfer for a read is done, whether it's + * a single or multi-block read. + * + * We byte-swap the buffer that just completed, and if that is the + * last buffer that's part of this read then we move on to the next + * operation, otherwise we wait for another ENDRX for the next bufer. + */ + + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[curidx], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->dmatag, sc->bbuf_map[curidx]); + + at91_bswap_buf(sc, dataptr + sc->xfer_offset, sc->bbuf_vaddr[curidx], len); + + if (mci_debug) { + printf("read done sr %x curidx %d len %d xfer_offset %d\n", + sr, curidx, len, sc->xfer_offset); + } + + sc->xfer_offset += len; + sc->bbuf_curidx = !curidx; /* swap buffers */ + + /* + * If we've transferred all the data, move on to the next operation. + * + * If we're still transferring the last buffer, RNCR is already zero but + * we have to write a zero anyway to clear the ENDRX status so we don't + * re-interrupt until the last buffer is done. + */ + if (sc->xfer_offset == cmd->data->len) { + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); + } else { + WR4(sc, PDC_RNCR, 0); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_ENDRX); + } } static void -at91_mci_xmit_done(struct at91_mci_softc *sc) +at91_mci_write_done(struct at91_mci_softc *sc, uint32_t sr) { - // Finish up the sequence... + struct mmc_command *cmd = sc->curcmd; + + /* + * We arrive here when the entire DMA transfer for a write is done, + * whether it's a single or multi-block write. If it's multi-block we + * have to immediately move on to the next operation which is to send + * the stop command. If it's a single-block transfer we need to wait + * for NOTBUSY, but if that's already asserted we can avoid another + * interrupt and just move on to completing the request right away. + */ + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); - WR4(sc, MCI_IDR, MCI_SR_TXBUFE); - WR4(sc, MCI_IER, MCI_SR_NOTBUSY); - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->dmatag, sc->map); - sc->mapped--; + + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[sc->bbuf_curidx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->dmatag, sc->bbuf_map[sc->bbuf_curidx]); + + if ((cmd->data->flags & MMC_DATA_MULTI) || (sr & MCI_SR_NOTBUSY)) { + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); + } else { + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); + } +} + +static void +at91_mci_notbusy(struct at91_mci_softc *sc) +{ + struct mmc_command *cmd = sc->curcmd; + + /* + * We arrive here by either completion of a single-block write, or + * completion of the stop command that ended a multi-block write (and, + * I suppose, after a card-select or erase, but I haven't tested + * those). Anyway, we're done and it's time to move on to the next + * command. + */ + + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); +} + +static void +at91_mci_stop_done(struct at91_mci_softc *sc, uint32_t sr) +{ + struct mmc_command *cmd = sc->curcmd; + + /* + * We arrive here after receiving CMDRDY for a MMC_STOP_TRANSMISSION + * command. Depending on the operation being stopped, we may have to + * do some unusual things to work around hardware bugs. + */ + + /* + * This is known to be true of at91rm9200 hardware; it may or may not + * apply to more recent chips: + * + * After stopping a multi-block write, the NOTBUSY bit in MCI_SR does + * not properly reflect the actual busy state of the card as signaled + * on the DAT0 line; it always claims the card is not-busy. If we + * believe that and let operations continue, following commands will + * fail with response timeouts (except of course MMC_SEND_STATUS -- it + * indicates the card is busy in the PRG state, which was the smoking + * gun that showed MCI_SR NOTBUSY was not tracking DAT0 correctly). + * + * The atmel docs are emphatic: "This flag [NOTBUSY] must be used only + * for Write Operations." I guess technically since we sent a stop + * it's not a write operation anymore. But then just what did they + * think it meant for the stop command to have "...an optional busy + * signal transmitted on the data line" according to the SD spec? + * + * I tried a variety of things to un-wedge the MCI and get the status + * register to reflect NOTBUSY correctly again, but the only thing + * that worked was a full device reset. It feels like an awfully big + * hammer, but doing a full reset after every multiblock write is + * still faster than doing single-block IO (by almost two orders of + * magnitude: 20KB/sec improves to about 1.8MB/sec best case). + * + * After doing the reset, wait for a NOTBUSY interrupt before + * continuing with the next operation. + */ + if (sc->flags & CMD_MULTIWRITE) { + at91_mci_reset(sc); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); + return; + } + + /* + * This is known to be true of at91rm9200 hardware; it may or may not + * apply to more recent chips: + * + * After stopping a multi-block read, loop to read and discard any + * data that coasts in after we sent the stop command. The docs don't + * say anything about it, but empirical testing shows that 1-3 + * additional words of data get buffered up in some unmentioned + * internal fifo and if we don't read and discard them here they end + * up on the front of the next read DMA transfer we do. + */ + if (sc->flags & CMD_MULTIREAD) { + uint32_t sr; + int count = 0; + + do { + sr = RD4(sc, MCI_SR); + if (sr & MCI_SR_RXRDY) { + RD4(sc, MCI_RDR); + ++count; + } + } while (sr & MCI_SR_RXRDY); + at91_mci_reset(sc); +// if (count != 0) +// printf("Had to soak up %d words after read\n", count); + } + + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); + +} + +static void +at91_mci_cmdrdy(struct at91_mci_softc *sc, uint32_t sr) +{ + struct mmc_command *cmd = sc->curcmd; + int i; + + if (cmd == NULL) + return; + + /* + * We get here at the end of EVERY command. We retrieve the command + * response (if any) then decide what to do next based on the command. + */ + + if (cmd->flags & MMC_RSP_PRESENT) { + for (i = 0; i < ((cmd->flags & MMC_RSP_136) ? 4 : 1); i++) { + cmd->resp[i] = RD4(sc, MCI_RSPR + i * 4); + if (mci_debug) + printf("RSPR[%d] = %x sr=%x\n", i, cmd->resp[i], sr); + } + } + + /* + * If this was a stop command, go handle the various special + * conditions (read: bugs) that have to be dealt with following a stop. + */ + if (cmd->opcode == MMC_STOP_TRANSMISSION) { + at91_mci_stop_done(sc, sr); + return; + } + + /* + * If this command can continue to assert BUSY beyond the response then + * we need to wait for NOTBUSY before the command is really done. + * + * Note that this may not work properly on the at91rm9200. It certainly + * doesn't work for the STOP command that follows a multi-block write, + * so post-stop CMDRDY is handled separately; see the special handling + * in at91_mci_stop_done(). + * + * Beside STOP, there are other R1B-type commands that use the busy + * signal after CMDRDY: CMD7 (card select), CMD28-29 (write protect), + * CMD38 (erase). I haven't tested any of them, but I rather expect + * them all to have the same sort of problem with MCI_SR not actually + * reflecting the state of the DAT0-line busy indicator. So this code + * may need to grow some sort of special handling for them too. (This + * just in: CMD7 isn't a problem right now because dev/mmc.c incorrectly + * sets the response flags to R1 rather than R1B.) XXX + */ + if ((cmd->flags & MMC_RSP_BUSY)) { + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); + return; + } + + /* + * If there is a data transfer with this command, then... + * - If it's a read, we need to wait for ENDRX. + * - If it's a write, now is the time to enable the PDC, and we need + * to wait for a BLKE that follows a TXBUFE, because if we're doing + * a split transfer we get a BLKE after the first half (when TPR/TCR + * get loaded from TNPR/TNCR). So first we wait for the TXBUFE, and + * the handling for that interrupt will then invoke the wait for the + * subsequent BLKE which indicates actual completion. + */ + if (cmd->data) { + uint32_t ier; + if (cmd->data->flags & MMC_DATA_READ) { + ier = MCI_SR_ENDRX; + } else { + ier = MCI_SR_TXBUFE; + WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN); + } + WR4(sc, MCI_IER, MCI_SR_ERROR | ier); + return; + } + + /* + * If we made it to here, we don't need to wait for anything more for + * the current command, move on to the next command (will complete the + * request if there is no next command). + */ + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); } static void at91_mci_intr(void *arg) { struct at91_mci_softc *sc = (struct at91_mci_softc*)arg; - uint32_t sr; - int i, done = 0; - struct mmc_command *cmd; + struct mmc_command *cmd = sc->curcmd; + uint32_t sr, isr; AT91_MCI_LOCK(sc); - sr = RD4(sc, MCI_SR) & RD4(sc, MCI_IMR); -// printf("i 0x%x\n", sr); - cmd = sc->curcmd; - if (sr & MCI_SR_ERROR) { - // Ignore CRC errors on CMD2 and ACMD47, per relevant standards - if ((sr & MCI_SR_RCRCE) && (cmd->opcode == MMC_SEND_OP_COND || - cmd->opcode == ACMD_SD_SEND_OP_COND)) - cmd->error = MMC_ERR_NONE; - else if (sr & (MCI_SR_RTOE | MCI_SR_DTOE)) + + sr = RD4(sc, MCI_SR); + isr = sr & RD4(sc, MCI_IMR); + + if (mci_debug) + printf("i 0x%x sr 0x%x\n", isr, sr); + + /* + * All interrupts are one-shot; disable it now. + * The next operation will re-enable whatever interrupts it wants. + */ + WR4(sc, MCI_IDR, isr); + if (isr & MCI_SR_ERROR) { + if (isr & (MCI_SR_RTOE | MCI_SR_DTOE)) cmd->error = MMC_ERR_TIMEOUT; - else if (sr & (MCI_SR_RCRCE | MCI_SR_DCRCE)) + else if (isr & (MCI_SR_RCRCE | MCI_SR_DCRCE)) cmd->error = MMC_ERR_BADCRC; - else if (sr & (MCI_SR_OVRE | MCI_SR_UNRE)) + else if (isr & (MCI_SR_OVRE | MCI_SR_UNRE)) cmd->error = MMC_ERR_FIFO; else cmd->error = MMC_ERR_FAILED; - done = 1; - if (sc->mapped && cmd->error) { - bus_dmamap_unload(sc->dmatag, sc->map); - sc->mapped--; + /* + * CMD8 is used to probe for SDHC cards, a standard SD card + * will get a response timeout; don't report it because it's a + * normal and expected condition. One might argue that all + * error reporting should be left to higher levels, but when + * they report at all it's always EIO, which isn't very + * helpful. XXX bootverbose? + */ + if (cmd->opcode != 8) { + device_printf(sc->dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 03:27:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59C001065673; Tue, 28 Aug 2012 03:27:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42F728FC14; Tue, 28 Aug 2012 03:27:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S3RnQo001955; Tue, 28 Aug 2012 03:27:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S3RntR001953; Tue, 28 Aug 2012 03:27:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208280327.q7S3RntR001953@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 03:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239763 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 03:27:49 -0000 Author: imp Date: Tue Aug 28 03:27:48 2012 New Revision: 239763 URL: http://svn.freebsd.org/changeset/base/239763 Log: Style: Move these routines to be before the forward declared functions as is the normal practice. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 01:28:52 2012 (r239762) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 03:27:48 2012 (r239763) @@ -161,18 +161,6 @@ struct at91_mci_softc { uint32_t xfer_offset; /* offset so far into caller's buf */ }; -static inline uint32_t -RD4(struct at91_mci_softc *sc, bus_size_t off) -{ - return (bus_read_4(sc->mem_res, off)); -} - -static inline void -WR4(struct at91_mci_softc *sc, bus_size_t off, uint32_t val) -{ - bus_write_4(sc->mem_res, off, val); -} - /* bus entry points */ static int at91_mci_probe(device_t dev); static int at91_mci_attach(device_t dev); @@ -193,6 +181,18 @@ static int at91_mci_is_mci1rev2xx(void); #define AT91_MCI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define AT91_MCI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static inline uint32_t +RD4(struct at91_mci_softc *sc, bus_size_t off) +{ + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct at91_mci_softc *sc, bus_size_t off, uint32_t val) +{ + bus_write_4(sc->mem_res, off, val); +} + static void at91_bswap_buf(struct at91_mci_softc *sc, void * dptr, void * sptr, uint32_t memsize) { From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 03:46:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB9AC106566B; Tue, 28 Aug 2012 03:46:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6FBF8FC14; Tue, 28 Aug 2012 03:46:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S3kVOl004139; Tue, 28 Aug 2012 03:46:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S3kVJK004137; Tue, 28 Aug 2012 03:46:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208280346.q7S3kVJK004137@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 03:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239764 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 03:46:31 -0000 Author: imp Date: Tue Aug 28 03:46:31 2012 New Revision: 239764 URL: http://svn.freebsd.org/changeset/base/239764 Log: Move to using a flag instead of checking the CPU type each transaction for the MCI1 rev 2.x write workarounds. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 03:27:48 2012 (r239763) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 03:46:31 2012 (r239764) @@ -139,6 +139,7 @@ struct at91_mci_softc { int sc_cap; #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ #define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ +#define CAP_MCI1_REV2XX 4 /* MCI 1 rev 2.x */ int flags; #define PENDING_CMD 0x01 #define PENDING_STOP 0x02 @@ -307,7 +308,7 @@ at91_mci_init(device_t dev) WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); val = MCI_MR_PDCMODE; val |= 0x34a; /* PWSDIV = 3; CLKDIV = 74 */ - if (at91_mci_is_mci1rev2xx()) + if (sc->sc_cap & CAP_MCI1_REV2XX) val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; WR4(sc, MCI_MR, val); #ifndef AT91_MCI_SLOT_B @@ -407,6 +408,12 @@ at91_mci_attach(device_t dev) } /* + * MCI1 Rev 2 controllers need some workarounds, flag if so. + */ + if (at91_mci_is_mci1rev2xx()) + sc->sc_cap |= CAP_MCI1_REV2XX; + + /* * Allow 4-wire to be initially set via #define. * Allow a device hint to override that. * Allow a sysctl to override that. @@ -767,7 +774,7 @@ at91_mci_start_cmd(struct at91_mci_softc * a work-around for the "Data Write Operation and * number of bytes" erratum. */ - if (at91_mci_is_mci1rev2xx() && data->len < 12) { + if ((sc->sc_cap & CAP_MCI1_REV2XX) && data->len < 12) { len = 12; memset(data->data, 0, 12); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 06:17:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8FE6106566C; Tue, 28 Aug 2012 06:17:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98788FC0A; Tue, 28 Aug 2012 06:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S6HiRP021929; Tue, 28 Aug 2012 06:17:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S6Hih5021927; Tue, 28 Aug 2012 06:17:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208280617.q7S6Hih5021927@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 06:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239765 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 06:17:45 -0000 Author: adrian Date: Tue Aug 28 06:17:44 2012 New Revision: 239765 URL: http://svn.freebsd.org/changeset/base/239765 Log: This is an initial board configuration for the D-Link DIR-825 dual-band 802.11n router. The flash layout defaults to a 1 MiB section for the kernel so I'm trying very hard to squeeze a minimialistic (LZMA compressde) kernel image into that. I've verified that it boots through to single user mode fine. Issues: * USB doesn't yet work as a module - I need to add something else to the USB AR71xx build before that will work. * There's no switch PHY support - but for now it quite happily behaves as a useful dumb switch out of the box. Phew. * Since a previous flash attempt trashed my radio configuration block, I haven't yet verified whether the wireless works correctly. I'll test that out shortly (read: once I re-calibrate the board somehow.) Thanks to ray@ and the zrouter project for doing some of the initial hard work in figuring out how to bring this board up. Added: head/sys/mips/conf/DIR-825 (contents, props changed) head/sys/mips/conf/DIR-825.hints (contents, props changed) Added: head/sys/mips/conf/DIR-825 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825 Tue Aug 28 06:17:44 2012 (r239765) @@ -0,0 +1,68 @@ +# +# Specific board setup for the D-Link DIR-825 router. +# +# The DIR-825 has the following hardware: +# +# + AR7161 CPU SoC +# + AR9223 2.4GHz 11n +# + AR9220 5GHz 11n +# + RealTek RTL8366S Gigabit switch +# + m25p64 based 8MB flash +# + 64MB RAM +# + uboot environment + +# $FreeBSD$ + +include "AR71XX_BASE" +ident "DIR-825" +hints "DIR-825.hints" + +# Since the kernel image must fit inside 1024KiB, we have to build almost +# everything as modules. +nodevice random +nodevice gpio +nodevice gpioled +nodevice gif +nodevice gre +nodevice bridge +nodevice usb +nodevice ehci +nodevice wlan +nodevice wlan_xauth +nodevice wlan_acl +nodevice wlan_wep +nodevice wlan_tkip +nodevice wlan_ccmp +nodevice wlan_rssadapt +nodevice wlan_amrr +nodevice ath +nodevice ath_pci +nodevice ath_hal +nodevice umass +nodevice ath_rate_sample + +nooptions INET6 + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# GEOM modules +device geom_map # to get access to the SPI flash partitions +device geom_uncompress # compressed in-memory filesystem hackery! +options GEOM_UNCOMPRESS + +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +options AR71XX_REALMEM=64*1024*1024 + +options AR71XX_ENV_UBOOT + +# options MD_ROOT +# options MD_ROOT_SIZE="6144" + +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above Added: head/sys/mips/conf/DIR-825.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825.hints Tue Aug 28 06:17:44 2012 (r239765) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +# arge0 is connected to the LAN side of the switch PHY. +# arge1 is connected to the single port WAN side of the switch PHY. + +hint.arge.0.phymask=0x0 +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 + +# XXX grab these from uboot? +# hint.arge.0.eeprommac=0x1f01fc00 + +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 + +# ath0 - slot 17 +hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 + +# ath1 - slot 18 +hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000 +hint.pcib.0.bus.0.18.0.ath_fixup_size=4096 + +# .. and now, telling each ath(4) NIC where to find the firmware +# image. +hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" +hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" + +# TODO: gpio LEDs + +# Geom MAP + +# mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000040000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +# This config partition is the D-Link specific configuration area. +# I'm re-purposing it for FreeBSD. +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 +hint.map.1.name="cfg" +hint.map.1.readonly=1 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x0050000 +hint.map.2.end=0x00150000 +hint.map.2.name="kernel" +hint.map.2.readonly=1 + +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00150000 +hint.map.3.end=0x007f0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007f0000 +hint.map.4.end=0x00800000 +hint.map.4.name="art" +hint.map.4.readonly=1 + From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 06:47:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83451106566C; Tue, 28 Aug 2012 06:47:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DC288FC15; Tue, 28 Aug 2012 06:47:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S6lMMo025459; Tue, 28 Aug 2012 06:47:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S6lMoK025457; Tue, 28 Aug 2012 06:47:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208280647.q7S6lMoK025457@svn.freebsd.org> From: Dimitry Andric Date: Tue, 28 Aug 2012 06:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239766 - stable/9/usr.bin/clang/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 06:47:22 -0000 Author: dim Date: Tue Aug 28 06:47:21 2012 New Revision: 239766 URL: http://svn.freebsd.org/changeset/base/239766 Log: MFC r239509: Support the WITH_SHARED_TOOLCHAIN setting that was introduced in r234782 for the clang executable. Build it statically by default, like the gcc executables, which should improve performance a little bit. Modified: stable/9/usr.bin/clang/clang/Makefile Directory Properties: stable/9/usr.bin/clang/ (props changed) Modified: stable/9/usr.bin/clang/clang/Makefile ============================================================================== --- stable/9/usr.bin/clang/clang/Makefile Tue Aug 28 06:17:44 2012 (r239765) +++ stable/9/usr.bin/clang/clang/Makefile Tue Aug 28 06:47:21 2012 (r239766) @@ -9,6 +9,10 @@ SRCS= cc1_main.cpp \ cc1as_main.cpp \ driver.cpp +.if ${MK_SHARED_TOOLCHAIN} == "no" +NO_SHARED?= yes +.endif + LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \ ${BINDIR}/clang ${BINDIR}/clang-cpp MLINKS= clang.1 clang++.1 \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 06:49:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE61F106564A; Tue, 28 Aug 2012 06:49:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98E4D8FC19; Tue, 28 Aug 2012 06:49:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S6nXPM025749; Tue, 28 Aug 2012 06:49:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S6nXOp025747; Tue, 28 Aug 2012 06:49:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208280649.q7S6nXOp025747@svn.freebsd.org> From: Dimitry Andric Date: Tue, 28 Aug 2012 06:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239767 - stable/9/usr.bin/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 06:49:33 -0000 Author: dim Date: Tue Aug 28 06:49:33 2012 New Revision: 239767 URL: http://svn.freebsd.org/changeset/base/239767 Log: MFC r239513: When WITH_CLANG_EXTRAS is enabled, avoid needlessly building the llvm and clang extras in the cross-tools stage. Modified: stable/9/usr.bin/clang/Makefile Directory Properties: stable/9/usr.bin/clang/ (props changed) Modified: stable/9/usr.bin/clang/Makefile ============================================================================== --- stable/9/usr.bin/clang/Makefile Tue Aug 28 06:47:21 2012 (r239766) +++ stable/9/usr.bin/clang/Makefile Tue Aug 28 06:49:33 2012 (r239767) @@ -4,7 +4,7 @@ SUBDIR= clang clang-tblgen tblgen -.if ${MK_CLANG_EXTRAS} != "no" +.if ${MK_CLANG_EXTRAS} != "no" && !defined(TOOLS_PREFIX) SUBDIR+=bugpoint \ llc \ lli \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 06:52:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AECA106564A; Tue, 28 Aug 2012 06:52:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157E68FC16; Tue, 28 Aug 2012 06:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S6q05h026070; Tue, 28 Aug 2012 06:52:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S6q0BO026068; Tue, 28 Aug 2012 06:52:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208280652.q7S6q0BO026068@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 06:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239768 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 06:52:01 -0000 Author: adrian Date: Tue Aug 28 06:52:00 2012 New Revision: 239768 URL: http://svn.freebsd.org/changeset/base/239768 Log: oops, make cfg read-write. Modified: head/sys/mips/conf/DIR-825.hints Modified: head/sys/mips/conf/DIR-825.hints ============================================================================== --- head/sys/mips/conf/DIR-825.hints Tue Aug 28 06:49:33 2012 (r239767) +++ head/sys/mips/conf/DIR-825.hints Tue Aug 28 06:52:00 2012 (r239768) @@ -45,7 +45,7 @@ hint.map.1.at="flash/spi0" hint.map.1.start=0x00040000 hint.map.1.end=0x00050000 hint.map.1.name="cfg" -hint.map.1.readonly=1 +hint.map.1.readonly=0 hint.map.2.at="flash/spi0" hint.map.2.start=0x0050000 From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 08:38:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F208106564A; Tue, 28 Aug 2012 08:38:54 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8068FC14; Tue, 28 Aug 2012 08:38:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S8csoe038106; Tue, 28 Aug 2012 08:38:54 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S8crqM038104; Tue, 28 Aug 2012 08:38:53 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208280838.q7S8crqM038104@svn.freebsd.org> From: Andrey Zonov Date: Tue, 28 Aug 2012 08:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239769 - head/usr.sbin/watchdogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 08:38:54 -0000 Author: zont Date: Tue Aug 28 08:38:53 2012 New Revision: 239769 URL: http://svn.freebsd.org/changeset/base/239769 Log: - Don't allow watchdogd(8) to be swapped out. On machines with huge amount of swap and high IO activity, watchdogd(8) may wait for a swap memory longer than timeout and sometimes fires. Approved by: kib (mentor) MFC after: 1 week Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Tue Aug 28 06:52:00 2012 (r239768) +++ head/usr.sbin/watchdogd/watchdogd.c Tue Aug 28 08:38:53 2012 (r239769) @@ -118,6 +118,8 @@ main(int argc, char *argv[]) pidfile_write(pfh); if (madvise(0, 0, MADV_PROTECT) != 0) warn("madvise failed"); + if (mlockall(MCL_FUTURE) != 0) + warn("mlockall failed"); watchdog_loop(); From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 10:15:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3806F106566C; Tue, 28 Aug 2012 10:15:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 231268FC15; Tue, 28 Aug 2012 10:15:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SAFUUn049547; Tue, 28 Aug 2012 10:15:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SAFUG7049545; Tue, 28 Aug 2012 10:15:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208281015.q7SAFUG7049545@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 Aug 2012 10:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239770 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 10:15:31 -0000 Author: kib Date: Tue Aug 28 10:15:30 2012 New Revision: 239770 URL: http://svn.freebsd.org/changeset/base/239770 Log: MFC r239588: Provide some compat32 shims for sysctl vfs.conflist. It is required for getvfsbyname(3) operation when called from 32bit process, and getvfsbyname(3) is used by recent bsdtar import. Modified: stable/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Tue Aug 28 08:38:53 2012 (r239769) +++ stable/8/sys/kern/vfs_subr.c Tue Aug 28 10:15:30 2012 (r239770) @@ -41,6 +41,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_ddb.h" #include "opt_watchdog.h" @@ -3012,22 +3013,50 @@ DB_SHOW_COMMAND(mount, db_show_mount) /* * Fill in a struct xvfsconf based on a struct vfsconf. */ -static void -vfsconf2x(struct vfsconf *vfsp, struct xvfsconf *xvfsp) +static int +vfsconf2x(struct sysctl_req *req, struct vfsconf *vfsp) { + struct xvfsconf xvfsp; - strcpy(xvfsp->vfc_name, vfsp->vfc_name); - xvfsp->vfc_typenum = vfsp->vfc_typenum; - xvfsp->vfc_refcount = vfsp->vfc_refcount; - xvfsp->vfc_flags = vfsp->vfc_flags; + bzero(&xvfsp, sizeof(xvfsp)); + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; /* * These are unused in userland, we keep them * to not break binary compatibility. */ - xvfsp->vfc_vfsops = NULL; - xvfsp->vfc_next = NULL; + xvfsp.vfc_vfsops = NULL; + xvfsp.vfc_next = NULL; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); } +#ifdef COMPAT_FREEBSD32 +struct xvfsconf32 { + uint32_t vfc_vfsops; + char vfc_name[MFSNAMELEN]; + int32_t vfc_typenum; + int32_t vfc_refcount; + int32_t vfc_flags; + uint32_t vfc_next; +}; + +static int +vfsconf2x32(struct sysctl_req *req, struct vfsconf *vfsp) +{ + struct xvfsconf32 xvfsp; + + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; + xvfsp.vfc_vfsops = 0; + xvfsp.vfc_next = 0; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +} +#endif + /* * Top level filesystem related information gathering. */ @@ -3035,14 +3064,16 @@ static int sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) { struct vfsconf *vfsp; - struct xvfsconf xvfsp; int error; error = 0; TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - error = SYSCTL_OUT(req, &xvfsp, sizeof xvfsp); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + error = vfsconf2x32(req, vfsp); + else +#endif + error = vfsconf2x(req, vfsp); if (error) break; } @@ -3061,7 +3092,6 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) int *name = (int *)arg1 - 1; /* XXX */ u_int namelen = arg2 + 1; /* XXX */ struct vfsconf *vfsp; - struct xvfsconf xvfsp; printf("WARNING: userland calling deprecated sysctl, " "please rebuild world\n"); @@ -3085,9 +3115,12 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) break; if (vfsp == NULL) return (EOPNOTSUPP); - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + return (vfsconf2x32(req, vfsp)); + else +#endif + return (vfsconf2x(req, vfsp)); } return (EOPNOTSUPP); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 11:34:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D38DC1065670; Tue, 28 Aug 2012 11:34:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEEEA8FC0C; Tue, 28 Aug 2012 11:34:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SBY9wp060289; Tue, 28 Aug 2012 11:34:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SBY9TM060285; Tue, 28 Aug 2012 11:34:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208281134.q7SBY9TM060285@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Aug 2012 11:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239771 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 11:34:10 -0000 Author: jhb Date: Tue Aug 28 11:34:09 2012 New Revision: 239771 URL: http://svn.freebsd.org/changeset/base/239771 Log: Fix misspelled "Infiniband". Submitted by: gcooper MFC after: 3 days Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Aug 28 10:15:30 2012 (r239770) +++ head/sys/amd64/conf/NOTES Tue Aug 28 11:34:09 2012 (r239771) @@ -98,7 +98,7 @@ options OFED_DEBUG_INIT options SDP options SDP_DEBUG -# IP over Inifiband +# IP over Infiniband options IPOIB options IPOIB_DEBUG options IPOIB_CM Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Aug 28 10:15:30 2012 (r239770) +++ head/sys/i386/conf/NOTES Tue Aug 28 11:34:09 2012 (r239771) @@ -268,7 +268,7 @@ options OFED_DEBUG_INIT options SDP options SDP_DEBUG -# IP over Inifiband +# IP over Infiniband options IPOIB options IPOIB_DEBUG options IPOIB_CM From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 12:25:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84257106566C; Tue, 28 Aug 2012 12:25:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC8B8FC08; Tue, 28 Aug 2012 12:25:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SCPc4n066867; Tue, 28 Aug 2012 12:25:38 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCPcB1066844; Tue, 28 Aug 2012 12:25:38 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208281225.q7SCPcB1066844@svn.freebsd.org> From: Martin Matuska Date: Tue, 28 Aug 2012 12:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239774 - in head: . cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:25:38 -0000 Author: mm Date: Tue Aug 28 12:25:37 2012 New Revision: 239774 URL: http://svn.freebsd.org/changeset/base/239774 Log: Merge recent vendor changes: 3100 zvol rename fails with EBUSY when dirty 3104 eliminate empty bpobjs 3120 zinject hangs in zfsdev_ioctl() due to uninitialized zc References: https://www.illumos.org/issues/3100 https://www.illumos.org/issues/3104 https://www.illumos.org/issues/3120 Obtained from: illumos (vendor/illumos, vendor/illumos-sys) MFC after: 2 weeks Modified: head/UPDATING head/cddl/contrib/opensolaris/cmd/zinject/zinject.c head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Aug 28 12:19:14 2012 (r239773) +++ head/UPDATING Tue Aug 28 12:25:37 2012 (r239774) @@ -24,6 +24,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120828: + A new ZFS feature flag "com.delphix:empty_bpobj" has been merged + to -HEAD. Pools that have empty_bpobj in active state can not be + imported read-write with ZFS implementations that do not support + this feature. For more information read the zpool-features(5) + manual page. + 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these Modified: head/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zinject/zinject.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/cddl/contrib/opensolaris/cmd/zinject/zinject.c Tue Aug 28 12:25:37 2012 (r239774) @@ -297,11 +297,9 @@ static int iter_handlers(int (*func)(int, const char *, zinject_record_t *, void *), void *data) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; int ret; - zc.zc_guid = 0; - while (ioctl(zfs_fd, ZFS_IOC_INJECT_LIST_NEXT, &zc) == 0) if ((ret = func((int)zc.zc_guid, zc.zc_name, &zc.zc_inject_record, data)) != 0) @@ -424,7 +422,7 @@ static int cancel_one_handler(int id, const char *pool, zinject_record_t *record, void *data) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; zc.zc_guid = (uint64_t)id; @@ -457,7 +455,7 @@ cancel_all_handlers(void) static int cancel_handler(int id) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; zc.zc_guid = (uint64_t)id; @@ -479,7 +477,7 @@ static int register_handler(const char *pool, int flags, zinject_record_t *record, int quiet) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; (void) strcpy(zc.zc_name, pool); zc.zc_inject_record = *record; @@ -536,7 +534,7 @@ register_handler(const char *pool, int f int perform_action(const char *pool, zinject_record_t *record, int cmd) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; ASSERT(cmd == VDEV_STATE_DEGRADED || cmd == VDEV_STATE_FAULTED); (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Tue Aug 28 12:19:14 2012 (r239773) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Tue Aug 28 12:25:37 2012 (r239774) @@ -21,7 +21,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 27, 2012 +.Dd Aug 28, 2012 .Dt ZPOOL-FEATURES 8 .Os .Sh NAME @@ -162,6 +162,29 @@ This feature is only while .Sy freeing is non\-zero. +.It Sy empty_bpobj +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:empty_bpobj" +.It GUID Ta com.delphix:empty_bpobj +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This feature increases the performance of creating and using a large number +of snapshots of a single filesystem or volume, and also reduces the disk +space required. +.Pp +When there are many snapshots, each snapshot uses many Block Pointer Objects +.Pq bpobj's +to track blocks associated with that snapshot. +However, in common use cases, most of these bpobj's are empty. +This feature allows us to create each bpobj on-demand, thus eliminating the +empty bpobjs. +.Pp +This feature is +.Sy active +while there are any filesystems, volumes, or snapshots which were created +after enabling this feature. +.El .Sh SEE ALSO .Xr zpool 8 .Sh AUTHORS Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 28 12:25:37 2012 (r239774) @@ -3546,7 +3546,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand zhp->zfs_type == ZFS_TYPE_VOLUME); /* - * Destroy all recent snapshots and its dependends. + * Destroy all recent snapshots and their dependents. */ cb.cb_force = force; cb.cb_target = snap->zfs_name; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Aug 28 12:25:37 2012 (r239774) @@ -152,4 +152,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_ASYNC_DESTROY, "com.delphix:async_destroy", "async_destroy", "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, + "com.delphix:empty_bpobj", "empty_bpobj", + "Snapshots use less space.", B_TRUE, B_FALSE, NULL); } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue Aug 28 12:25:37 2012 (r239774) @@ -50,6 +50,7 @@ typedef int (zfeature_func_t)(zfeature_i static enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURES } spa_feature_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Aug 28 12:25:37 2012 (r239774) @@ -20,13 +20,61 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include #include #include #include +#include +#include + +/* + * Return an empty bpobj, preferably the empty dummy one (dp_empty_bpobj). + */ +uint64_t +bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx) +{ + zfeature_info_t *empty_bpobj_feat = + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; + spa_t *spa = dmu_objset_spa(os); + dsl_pool_t *dp = dmu_objset_pool(os); + + if (spa_feature_is_enabled(spa, empty_bpobj_feat)) { + if (!spa_feature_is_active(spa, empty_bpobj_feat)) { + ASSERT3U(dp->dp_empty_bpobj, ==, 0); + dp->dp_empty_bpobj = + bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); + VERIFY(zap_add(os, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, + &dp->dp_empty_bpobj, tx) == 0); + } + spa_feature_incr(spa, empty_bpobj_feat, tx); + ASSERT(dp->dp_empty_bpobj != 0); + return (dp->dp_empty_bpobj); + } else { + return (bpobj_alloc(os, blocksize, tx)); + } +} + +void +bpobj_decr_empty(objset_t *os, dmu_tx_t *tx) +{ + zfeature_info_t *empty_bpobj_feat = + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; + dsl_pool_t *dp = dmu_objset_pool(os); + + spa_feature_decr(dmu_objset_spa(os), empty_bpobj_feat, tx); + if (!spa_feature_is_active(dmu_objset_spa(os), empty_bpobj_feat)) { + VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, tx)); + VERIFY3U(0, ==, dmu_object_free(os, dp->dp_empty_bpobj, tx)); + dp->dp_empty_bpobj = 0; + } +} uint64_t bpobj_alloc(objset_t *os, int blocksize, dmu_tx_t *tx) @@ -53,6 +101,7 @@ bpobj_free(objset_t *os, uint64_t obj, d int epb; dmu_buf_t *dbuf = NULL; + ASSERT(obj != dmu_objset_pool(os)->dp_empty_bpobj); VERIFY3U(0, ==, bpobj_open(&bpo, os, obj)); mutex_enter(&bpo.bpo_lock); @@ -320,6 +369,12 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 ASSERT(bpo->bpo_havesubobj); ASSERT(bpo->bpo_havecomp); + ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj); + + if (subobj == dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj) { + bpobj_decr_empty(bpo->bpo_os, tx); + return; + } VERIFY3U(0, ==, bpobj_open(&subbpo, bpo->bpo_os, subobj)); VERIFY3U(0, ==, bpobj_space(&subbpo, &used, &comp, &uncomp)); @@ -388,6 +443,7 @@ bpobj_enqueue(bpobj_t *bpo, const blkptr blkptr_t *bparray; ASSERT(!BP_IS_HOLE(bp)); + ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj); /* We never need the fill count. */ stored_bp.blk_fill = 0; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1187,15 +1187,6 @@ dmu_objset_is_dirty(objset_t *os, uint64 !list_is_empty(&os->os_free_dnodes[txg & TXG_MASK])); } -boolean_t -dmu_objset_is_dirty_anywhere(objset_t *os) -{ - for (int t = 0; t < TXG_SIZE; t++) - if (dmu_objset_is_dirty(os, t)) - return (B_TRUE); - return (B_FALSE); -} - static objset_used_cb_t *used_cbs[DMU_OST_NUMTYPES]; void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1258,6 +1258,17 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu } } +boolean_t +dsl_dataset_is_dirty(dsl_dataset_t *ds) +{ + for (int t = 0; t < TXG_SIZE; t++) { + if (txg_list_member(&ds->ds_dir->dd_pool->dp_dirty_datasets, + ds, t)) + return (B_TRUE); + } + return (B_FALSE); +} + /* * The unique space in the head dataset can be calculated by subtracting * the space used in the most recent snapshot, that is still being used @@ -3495,10 +3506,6 @@ dsl_dataset_set_quota_sync(void *arg1, v if (ds->ds_quota != effective_value) { dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_quota = effective_value; - - spa_history_log_internal(LOG_DS_REFQUOTA, - ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu ", - (longlong_t)ds->ds_quota, ds->ds_object); } } @@ -3602,10 +3609,6 @@ dsl_dataset_set_reservation_sync(void *a dsl_dir_diduse_space(ds->ds_dir, DD_USED_REFRSRV, delta, 0, 0, tx); mutex_exit(&ds->ds_dir->dd_lock); - - spa_history_log_internal(LOG_DS_REFRESERV, - ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu", - (longlong_t)effective_value, ds->ds_object); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Tue Aug 28 12:25:37 2012 (r239774) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -163,12 +163,49 @@ dsl_deadlist_free(objset_t *os, uint64_t for (zap_cursor_init(&zc, os, dlobj); zap_cursor_retrieve(&zc, &za) == 0; - zap_cursor_advance(&zc)) - bpobj_free(os, za.za_first_integer, tx); + zap_cursor_advance(&zc)) { + uint64_t obj = za.za_first_integer; + if (obj == dmu_objset_pool(os)->dp_empty_bpobj) + bpobj_decr_empty(os, tx); + else + bpobj_free(os, obj, tx); + } zap_cursor_fini(&zc); VERIFY3U(0, ==, dmu_object_free(os, dlobj, tx)); } +static void +dle_enqueue(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, + const blkptr_t *bp, dmu_tx_t *tx) +{ + if (dle->dle_bpobj.bpo_object == + dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { + uint64_t obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + bpobj_close(&dle->dle_bpobj); + bpobj_decr_empty(dl->dl_os, tx); + VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); + VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object, + dle->dle_mintxg, obj, tx)); + } + bpobj_enqueue(&dle->dle_bpobj, bp, tx); +} + +static void +dle_enqueue_subobj(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, + uint64_t obj, dmu_tx_t *tx) +{ + if (dle->dle_bpobj.bpo_object != + dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { + bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); + } else { + bpobj_close(&dle->dle_bpobj); + bpobj_decr_empty(dl->dl_os, tx); + VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); + VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object, + dle->dle_mintxg, obj, tx)); + } +} + void dsl_deadlist_insert(dsl_deadlist_t *dl, const blkptr_t *bp, dmu_tx_t *tx) { @@ -197,7 +234,7 @@ dsl_deadlist_insert(dsl_deadlist_t *dl, dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE); else dle = AVL_PREV(&dl->dl_tree, dle); - bpobj_enqueue(&dle->dle_bpobj, bp, tx); + dle_enqueue(dl, dle, bp, tx); } /* @@ -217,7 +254,7 @@ dsl_deadlist_add_key(dsl_deadlist_t *dl, dle = kmem_alloc(sizeof (*dle), KM_SLEEP); dle->dle_mintxg = mintxg; - obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); avl_add(&dl->dl_tree, dle); @@ -243,8 +280,7 @@ dsl_deadlist_remove_key(dsl_deadlist_t * dle = avl_find(&dl->dl_tree, &dle_tofind, NULL); dle_prev = AVL_PREV(&dl->dl_tree, dle); - bpobj_enqueue_subobj(&dle_prev->dle_bpobj, - dle->dle_bpobj.bpo_object, tx); + dle_enqueue_subobj(dl, dle_prev, dle->dle_bpobj.bpo_object, tx); avl_remove(&dl->dl_tree, dle); bpobj_close(&dle->dle_bpobj); @@ -302,7 +338,7 @@ dsl_deadlist_clone(dsl_deadlist_t *dl, u if (dle->dle_mintxg >= maxtxg) break; - obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, newobj, dle->dle_mintxg, obj, tx)); } @@ -400,7 +436,7 @@ dsl_deadlist_insert_bpobj(dsl_deadlist_t dle = avl_find(&dl->dl_tree, &dle_tofind, &where); if (dle == NULL) dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE); - bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); + dle_enqueue_subobj(dl, dle, obj, tx); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1061,10 +1061,6 @@ dsl_dir_set_quota_sync(void *arg1, void mutex_enter(&dd->dd_lock); dd->dd_phys->dd_quota = effective_value; mutex_exit(&dd->dd_lock); - - spa_history_log_internal(LOG_DS_QUOTA, dd->dd_pool->dp_spa, - tx, "%lld dataset = %llu ", - (longlong_t)effective_value, dd->dd_phys->dd_head_dataset_obj); } int @@ -1177,10 +1173,6 @@ dsl_dir_set_reservation_sync(void *arg1, delta, 0, 0, tx); } mutex_exit(&dd->dd_lock); - - spa_history_log_internal(LOG_DS_RESERVATION, dd->dd_pool->dp_spa, - tx, "%lld dataset = %llu", - (longlong_t)effective_value, dd->dd_phys->dd_head_dataset_obj); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Aug 28 12:25:37 2012 (r239774) @@ -151,8 +151,6 @@ dsl_pool_open(dsl_pool_t *dp) dsl_dataset_t *ds; uint64_t obj; - ASSERT(!dmu_objset_is_dirty_anywhere(dp->dp_meta_objset)); - rw_enter(&dp->dp_config_rwlock, RW_WRITER); err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_ROOT_DATASET, sizeof (uint64_t), 1, @@ -209,6 +207,15 @@ dsl_pool_open(dsl_pool_t *dp) goto out; } + if (spa_feature_is_active(dp->dp_spa, + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) { + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, + &dp->dp_empty_bpobj); + if (err != 0) + goto out; + } + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_TMP_USERREFS, sizeof (uint64_t), 1, &dp->dp_tmp_userrefs_obj); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h Tue Aug 28 12:25:37 2012 (r239774) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_BPOBJ_H @@ -67,7 +68,9 @@ typedef struct bpobj { typedef int bpobj_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx); uint64_t bpobj_alloc(objset_t *mos, int blocksize, dmu_tx_t *tx); +uint64_t bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx); void bpobj_free(objset_t *os, uint64_t obj, dmu_tx_t *tx); +void bpobj_decr_empty(objset_t *os, dmu_tx_t *tx); int bpobj_open(bpobj_t *bpo, objset_t *mos, uint64_t object); void bpobj_close(bpobj_t *bpo); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Aug 28 12:25:37 2012 (r239774) @@ -314,6 +314,7 @@ typedef void dmu_buf_evict_func_t(struct #define DMU_POOL_SCAN "scan" #define DMU_POOL_FREE_BPOBJ "free_bpobj" #define DMU_POOL_BPTREE_OBJ "bptree_obj" +#define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" /* * Allocate an object from this objset. The range of object numbers Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue Aug 28 12:25:37 2012 (r239774) @@ -161,7 +161,6 @@ timestruc_t dmu_objset_snap_cmtime(objse /* called from dsl */ void dmu_objset_sync(objset_t *os, zio_t *zio, dmu_tx_t *tx); boolean_t dmu_objset_is_dirty(objset_t *os, uint64_t txg); -boolean_t dmu_objset_is_dirty_anywhere(objset_t *os); objset_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx); int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Aug 28 12:25:37 2012 (r239774) @@ -271,6 +271,7 @@ int dsl_dataset_space_written(dsl_datase uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); int dsl_dataset_space_wouldfree(dsl_dataset_t *firstsnap, dsl_dataset_t *last, uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); +boolean_t dsl_dataset_is_dirty(dsl_dataset_t *ds); int dsl_dsobj_to_dsname(char *pname, uint64_t obj, char *buf); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Tue Aug 28 12:25:37 2012 (r239774) @@ -88,6 +88,7 @@ typedef struct dsl_pool { uint64_t dp_tmp_userrefs_obj; bpobj_t dp_free_bpobj; uint64_t dp_bptree_obj; + uint64_t dp_empty_bpobj; struct dsl_scan *dp_scan; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Tue Aug 28 12:25:37 2012 (r239774) @@ -300,6 +300,8 @@ int zap_increment_int(objset_t *os, uint /* Here the key is an int and the value is a different int. */ int zap_add_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t value, dmu_tx_t *tx); +int zap_update_int_key(objset_t *os, uint64_t obj, + uint64_t key, uint64_t value, dmu_tx_t *tx); int zap_lookup_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t *valuep); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1094,6 +1094,16 @@ zap_add_int_key(objset_t *os, uint64_t o } int +zap_update_int_key(objset_t *os, uint64_t obj, + uint64_t key, uint64_t value, dmu_tx_t *tx) +{ + char name[20]; + + (void) snprintf(name, sizeof (name), "%llx", (longlong_t)key); + return (zap_update(os, obj, name, 8, 1, &value, tx)); +} + +int zap_lookup_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t *valuep) { char name[20]; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Tue Aug 28 12:25:37 2012 (r239774) @@ -221,7 +221,12 @@ feature_get_refcount(objset_t *os, uint6 uint64_t refcount; uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj; - ASSERT(0 != zapobj); + /* + * If the pool is currently being created, the feature objects may not + * have been allocated yet. Act as though all features are disabled. + */ + if (zapobj == 0) + return (ENOTSUP); err = zap_lookup(os, zapobj, feature->fi_guid, sizeof (uint64_t), 1, &refcount); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1839,9 +1839,9 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea /* * Evict cached data */ - if (dmu_objset_is_dirty_anywhere(zfsvfs->z_os)) - if (!(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)) - txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), 0); + if (dsl_dataset_is_dirty(dmu_objset_ds(zfsvfs->z_os)) && + !(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)) + txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), 0); (void) dmu_objset_evict_dbufs(zfsvfs->z_os); return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Aug 28 12:25:37 2012 (r239774) @@ -671,8 +671,18 @@ zvol_last_close(zvol_state_t *zv) { zil_close(zv->zv_zilog); zv->zv_zilog = NULL; + dmu_buf_rele(zv->zv_dbuf, zvol_tag); zv->zv_dbuf = NULL; + + /* + * Evict cached data + */ + if (dsl_dataset_is_dirty(dmu_objset_ds(zv->zv_objset)) && + !(zv->zv_flags & ZVOL_RDONLY)) + txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); + (void) dmu_objset_evict_dbufs(zv->zv_objset); + dmu_objset_disown(zv->zv_objset, zvol_tag); zv->zv_objset = NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 12:33:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDFD1106564A; Tue, 28 Aug 2012 12:33:54 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F148FC1C; Tue, 28 Aug 2012 12:33:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SCXsDN067845; Tue, 28 Aug 2012 12:33:54 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCXskC067843; Tue, 28 Aug 2012 12:33:54 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201208281233.q7SCXskC067843@svn.freebsd.org> From: Isabell Long Date: Tue, 28 Aug 2012 12:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239775 - head/sbin/ipf/ipf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:33:55 -0000 Author: issyl0 (doc committer) Date: Tue Aug 28 12:33:54 2012 New Revision: 239775 URL: http://svn.freebsd.org/changeset/base/239775 Log: Link ipfilter(4) and ipfilter(5) to the build to stop the wrong man page displaying for 'man 4 ipfilter'. PR: docs/118020 Approved by: gjb (mentor) MFC after: 5 days Modified: head/sbin/ipf/ipf/Makefile Modified: head/sbin/ipf/ipf/Makefile ============================================================================== --- head/sbin/ipf/ipf/Makefile Tue Aug 28 12:25:37 2012 (r239774) +++ head/sbin/ipf/ipf/Makefile Tue Aug 28 12:33:54 2012 (r239775) @@ -2,8 +2,8 @@ PROG= ipf SRCS= ${GENHDRS} ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c -MAN= ipf.8 ipf.4 ipf.5 ipl.4 -MLINKS= ipl.4 ipfilter.4 ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5 +MAN= ipfilter.4 ipfilter.5 ipf.8 ipf.4 ipf.5 ipl.4 +MLINKS= ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5 CFLAGS+= -I. -DIPFILTER_BPF GENHDRS= ipf_l.h ipf_y.h From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 12:56:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99B7D106564A; Tue, 28 Aug 2012 12:56:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84A128FC14; Tue, 28 Aug 2012 12:56:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SCuO1t070742; Tue, 28 Aug 2012 12:56:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCuO96070740; Tue, 28 Aug 2012 12:56:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208281256.q7SCuO96070740@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 28 Aug 2012 12:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239776 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:56:24 -0000 Author: bz Date: Tue Aug 28 12:56:23 2012 New Revision: 239776 URL: http://svn.freebsd.org/changeset/base/239776 Log: MFC r238877: Fix a comment that we do not have an SA yet but need to acquire one. Modified: stable/9/sys/netinet6/ip6_ipsec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/9/sys/netinet6/ip6_ipsec.c Tue Aug 28 12:33:54 2012 (r239775) +++ stable/9/sys/netinet6/ip6_ipsec.c Tue Aug 28 12:56:23 2012 (r239776) @@ -263,7 +263,7 @@ ip6_ipsec_output(struct mbuf **m, struct mtag->m_tag_id != PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED) continue; /* - * Check if policy has an SA associated with it. + * Check if policy has no SA associated with it. * This can happen when an SP has yet to acquire * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 12:56:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12121106566B; Tue, 28 Aug 2012 12:56:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F03948FC0C; Tue, 28 Aug 2012 12:56:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SCuSWk070785; Tue, 28 Aug 2012 12:56:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCuSso070782; Tue, 28 Aug 2012 12:56:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208281256.q7SCuSso070782@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 28 Aug 2012 12:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239777 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:56:29 -0000 Author: bz Date: Tue Aug 28 12:56:28 2012 New Revision: 239777 URL: http://svn.freebsd.org/changeset/base/239777 Log: MFC r238877: Fix a comment that we do not have an SA yet but need to acquire one. Modified: stable/8/sys/netinet6/ip6_ipsec.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/8/sys/netinet6/ip6_ipsec.c Tue Aug 28 12:56:23 2012 (r239776) +++ stable/8/sys/netinet6/ip6_ipsec.c Tue Aug 28 12:56:28 2012 (r239777) @@ -261,7 +261,7 @@ ip6_ipsec_output(struct mbuf **m, struct mtag->m_tag_id != PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED) continue; /* - * Check if policy has an SA associated with it. + * Check if policy has no SA associated with it. * This can happen when an SP has yet to acquire * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 12:56:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBF61065884; Tue, 28 Aug 2012 12:56:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACA568FC19; Tue, 28 Aug 2012 12:56:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SCuZrU070833; Tue, 28 Aug 2012 12:56:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCuZpm070831; Tue, 28 Aug 2012 12:56:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208281256.q7SCuZpm070831@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 28 Aug 2012 12:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239778 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:56:40 -0000 Author: bz Date: Tue Aug 28 12:56:35 2012 New Revision: 239778 URL: http://svn.freebsd.org/changeset/base/239778 Log: MFC r238877: Fix a comment that we do not have an SA yet but need to acquire one. Modified: stable/7/sys/netinet6/ip6_ipsec.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/7/sys/netinet6/ip6_ipsec.c Tue Aug 28 12:56:28 2012 (r239777) +++ stable/7/sys/netinet6/ip6_ipsec.c Tue Aug 28 12:56:35 2012 (r239778) @@ -239,7 +239,7 @@ ip6_ipsec_output(struct mbuf **m, struct mtag->m_tag_id != PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED) continue; /* - * Check if policy has an SA associated with it. + * Check if policy has no SA associated with it. * This can happen when an SP has yet to acquire * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 13:35:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E69A1065670; Tue, 28 Aug 2012 13:35:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 391F08FC14; Tue, 28 Aug 2012 13:35:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SDZci1075480; Tue, 28 Aug 2012 13:35:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SDZchp075478; Tue, 28 Aug 2012 13:35:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208281335.q7SDZchp075478@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Aug 2012 13:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239779 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 13:35:38 -0000 Author: jhb Date: Tue Aug 28 13:35:37 2012 New Revision: 239779 URL: http://svn.freebsd.org/changeset/base/239779 Log: Shorten the name of the fast SWI taskqueue to "fast taskq" so that it fits. Reported by: lev MFC after: 1 week Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Aug 28 12:56:35 2012 (r239778) +++ head/sys/kern/subr_taskqueue.c Tue Aug 28 13:35:37 2012 (r239779) @@ -565,7 +565,7 @@ taskqueue_fast_run(void *dummy) } TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, NULL, - swi_add(NULL, "Fast task queue", taskqueue_fast_run, NULL, + swi_add(NULL, "fast taskq", taskqueue_fast_run, NULL, SWI_TQ_FAST, INTR_MPSAFE, &taskqueue_fast_ih)); int From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 14:19:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2133E106566C; Tue, 28 Aug 2012 14:19:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF4E8FC0A; Tue, 28 Aug 2012 14:19:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SEJAOD080322; Tue, 28 Aug 2012 14:19:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SEJAc6080320; Tue, 28 Aug 2012 14:19:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208281419.q7SEJAc6080320@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 14:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239780 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 14:19:11 -0000 Author: imp Date: Tue Aug 28 14:19:10 2012 New Revision: 239780 URL: http://svn.freebsd.org/changeset/base/239780 Log: Clip the upper end to 31MHz for slow clock speeds. On faster machines, we wind up with a 66MHz clock, which is too fast. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 13:35:37 2012 (r239779) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 14:19:10 2012 (r239780) @@ -557,10 +557,10 @@ at91_mci_update_ios(device_t brdev, devi * Calculate our closest available clock speed that doesn't exceed the * requested speed. * - * If the master clock is greater than 50MHz and the requested bus - * speed is 25mhz and the use_30mhz flag is on, set clkdiv to zero to - * get a master_clock / 2 (25-30MHz) MMC/SD clock rather than settle for - * the next lower click (12-15MHz). See comments near the top of the + * If the master clock is 50MHz-62MHz and the requested bus speed is + * 25mhz and the use_30mhz flag is on, set clkdiv to zero to get a + * master_clock / 2 (25-31MHz) MMC/SD clock rather than settle for the + * next lower click (12.5-15.5MHz). See comments near the top of the * file for more info. * * Whatever we come up with, store it back into ios->clock so that the @@ -572,7 +572,8 @@ at91_mci_update_ios(device_t brdev, devi } else { WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); if (sc->use_30mhz && ios->clock == 25000000 && - at91_master_clock > 50000000) + at91_master_clock > 50000000 && + at91_master_clock < 62000000) clkdiv = 0; else if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 14:20:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F5341065687; Tue, 28 Aug 2012 14:20:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58B3A8FC12; Tue, 28 Aug 2012 14:20:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SEKgYf080520; Tue, 28 Aug 2012 14:20:42 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SEKgLL080518; Tue, 28 Aug 2012 14:20:42 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201208281420.q7SEKgLL080518@svn.freebsd.org> From: Brooks Davis Date: Tue, 28 Aug 2012 14:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239781 - head/sbin/gvinum X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 14:20:42 -0000 Author: brooks Date: Tue Aug 28 14:20:41 2012 New Revision: 239781 URL: http://svn.freebsd.org/changeset/base/239781 Log: Don't overwrite the global default CFLAGS when setting include paths. MFC after: 3 days Modified: head/sbin/gvinum/Makefile Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Tue Aug 28 14:19:10 2012 (r239780) +++ head/sbin/gvinum/Makefile Tue Aug 28 14:20:41 2012 (r239781) @@ -5,7 +5,7 @@ SRCS= gvinum.c gvinum.h geom_vinum_share MAN= gvinum.8 WARNS?= 2 -CFLAGS= -I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit +CFLAGS+= -I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM} LDADD= -ledit -ltermcap -ldevstat -lkvm -lgeom From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 15:45:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBE1A1065677; Tue, 28 Aug 2012 15:45:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B75AC8FC22; Tue, 28 Aug 2012 15:45:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SFjb5V090070; Tue, 28 Aug 2012 15:45:37 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SFjbYh090068; Tue, 28 Aug 2012 15:45:37 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201208281545.q7SFjbYh090068@svn.freebsd.org> From: Devin Teske Date: Tue, 28 Aug 2012 15:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239782 - stable/9/usr.sbin/bsdinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 15:45:37 -0000 Author: dteske Date: Tue Aug 28 15:45:37 2012 New Revision: 239782 URL: http://svn.freebsd.org/changeset/base/239782 Log: MFC r239500: Fix "unexpected operator" error when passed multi-word first-argument containing whitespace. Also make other changes to support multi-word arguments. PR: bin/170759 Submitted by: dteske Reviewed by: emaste (mentor) Approved by: emaste (mentor) Modified: stable/9/usr.sbin/bsdinstall/bsdinstall Modified: stable/9/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- stable/9/usr.sbin/bsdinstall/bsdinstall Tue Aug 28 14:20:41 2012 (r239781) +++ stable/9/usr.sbin/bsdinstall/bsdinstall Tue Aug 28 15:45:37 2012 (r239782) @@ -34,11 +34,10 @@ VERB=$1; shift -if [ -z $VERB ]; then +if [ -z "$VERB" ]; then VERB=auto fi test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC" -echo Running installation step: $VERB $@ >> "$BSDINSTALL_LOG" -exec /usr/libexec/bsdinstall/$VERB $@ 2>>"$BSDINSTALL_LOG" - +echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" +exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG" From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 17:08:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 291631065676; Tue, 28 Aug 2012 17:08:48 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE1AE8FC14; Tue, 28 Aug 2012 17:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SH8lBk099599; Tue, 28 Aug 2012 17:08:47 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SH8l3Z099596; Tue, 28 Aug 2012 17:08:47 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201208281708.q7SH8l3Z099596@svn.freebsd.org> From: Max Khon Date: Tue, 28 Aug 2012 17:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239783 - stable/9/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 17:08:48 -0000 Author: fjoe Date: Tue Aug 28 17:08:47 2012 New Revision: 239783 URL: http://svn.freebsd.org/changeset/base/239783 Log: MFC: r238933 - Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg". - Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f Approved by: re (kib) Modified: stable/9/sys/dev/puc/puc_cfg.h stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/puc/puc_cfg.h ============================================================================== --- stable/9/sys/dev/puc/puc_cfg.h Tue Aug 28 15:45:37 2012 (r239782) +++ stable/9/sys/dev/puc/puc_cfg.h Tue Aug 28 17:08:47 2012 (r239783) @@ -79,7 +79,7 @@ struct puc_cfg { int8_t ports; int8_t rid; /* Rid of first port */ int8_t d_rid; /* Delta rid of next ports */ - int16_t d_ofs; /* Delta offset of next ports */ + int8_t d_ofs; /* Delta offset of next ports */ puc_config_f *config_function; }; Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Tue Aug 28 15:45:37 2012 (r239782) +++ stable/9/sys/dev/puc/pucdata.c Tue Aug 28 17:08:47 2012 (r239783) @@ -510,13 +510,15 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1024, 0xffff, 0, "Moxa Technologies, Smartio CP-102E/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_2S, 0x14, 0, 0x200 + PUC_PORT_2S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1025, 0xffff, 0, "Moxa Technologies, Smartio CP-102EL/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_2S, 0x14, 0, 0x200, + PUC_PORT_2S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1040, 0xffff, 0, @@ -572,7 +574,8 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1182, 0xffff, 0, "Moxa Technologies, Smartio CP-118EL-A/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_8S, 0x14, 0, 0x200, + PUC_PORT_8S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1680, 0xffff, 0, @@ -596,7 +599,8 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1683, 0xffff, 0, "Moxa Technologies, Smartio CP-168EL-A/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_8S, 0x14, 0, 0x200, + PUC_PORT_8S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x13a8, 0x0152, 0xffff, 0, @@ -1153,7 +1157,12 @@ puc_config_moxa(struct puc_softc *sc, en intptr_t *res) { if (cmd == PUC_CFG_GET_OFS) { - *res = ((port == 3) ? 7 : port) * 0x200; + const struct puc_cfg *cfg = sc->sc_cfg; + + if (port == 3 && (cfg->device == 0x1045 || cfg->device == 0x1144)) + port = 7; + *res = port * 0x200; + return 0; } return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 17:09:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF98C106566C; Tue, 28 Aug 2012 17:09:34 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0E6F8FC0C; Tue, 28 Aug 2012 17:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SH9YgF099768; Tue, 28 Aug 2012 17:09:34 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SH9Yg9099765; Tue, 28 Aug 2012 17:09:34 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201208281709.q7SH9Yg9099765@svn.freebsd.org> From: Max Khon Date: Tue, 28 Aug 2012 17:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239784 - releng/9.1/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 17:09:35 -0000 Author: fjoe Date: Tue Aug 28 17:09:34 2012 New Revision: 239784 URL: http://svn.freebsd.org/changeset/base/239784 Log: MFC: r238933 - Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg". - Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f Approved by: re (kib) Modified: releng/9.1/sys/dev/puc/puc_cfg.h releng/9.1/sys/dev/puc/pucdata.c Directory Properties: releng/9.1/ (props changed) releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/puc/puc_cfg.h ============================================================================== --- releng/9.1/sys/dev/puc/puc_cfg.h Tue Aug 28 17:08:47 2012 (r239783) +++ releng/9.1/sys/dev/puc/puc_cfg.h Tue Aug 28 17:09:34 2012 (r239784) @@ -79,7 +79,7 @@ struct puc_cfg { int8_t ports; int8_t rid; /* Rid of first port */ int8_t d_rid; /* Delta rid of next ports */ - int16_t d_ofs; /* Delta offset of next ports */ + int8_t d_ofs; /* Delta offset of next ports */ puc_config_f *config_function; }; Modified: releng/9.1/sys/dev/puc/pucdata.c ============================================================================== --- releng/9.1/sys/dev/puc/pucdata.c Tue Aug 28 17:08:47 2012 (r239783) +++ releng/9.1/sys/dev/puc/pucdata.c Tue Aug 28 17:09:34 2012 (r239784) @@ -510,13 +510,15 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1024, 0xffff, 0, "Moxa Technologies, Smartio CP-102E/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_2S, 0x14, 0, 0x200 + PUC_PORT_2S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1025, 0xffff, 0, "Moxa Technologies, Smartio CP-102EL/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_2S, 0x14, 0, 0x200, + PUC_PORT_2S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1040, 0xffff, 0, @@ -572,7 +574,8 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1182, 0xffff, 0, "Moxa Technologies, Smartio CP-118EL-A/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_8S, 0x14, 0, 0x200, + PUC_PORT_8S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x1393, 0x1680, 0xffff, 0, @@ -596,7 +599,8 @@ const struct puc_cfg puc_pci_devices[] = { 0x1393, 0x1683, 0xffff, 0, "Moxa Technologies, Smartio CP-168EL-A/PCIe", DEFAULT_RCLK * 8, - PUC_PORT_8S, 0x14, 0, 0x200, + PUC_PORT_8S, 0x14, 0, -1, + .config_function = puc_config_moxa }, { 0x13a8, 0x0152, 0xffff, 0, @@ -1153,7 +1157,12 @@ puc_config_moxa(struct puc_softc *sc, en intptr_t *res) { if (cmd == PUC_CFG_GET_OFS) { - *res = ((port == 3) ? 7 : port) * 0x200; + const struct puc_cfg *cfg = sc->sc_cfg; + + if (port == 3 && (cfg->device == 0x1045 || cfg->device == 0x1144)) + port = 7; + *res = port * 0x200; + return 0; } return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 17:27:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CBC106566B; Tue, 28 Aug 2012 17:27:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71D798FC25; Tue, 28 Aug 2012 17:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SHRlJK002219; Tue, 28 Aug 2012 17:27:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SHRlAh002217; Tue, 28 Aug 2012 17:27:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208281727.q7SHRlAh002217@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 17:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239785 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 17:27:47 -0000 Author: imp Date: Tue Aug 28 17:27:46 2012 New Revision: 239785 URL: http://svn.freebsd.org/changeset/base/239785 Log: Make AT91_MCI_ALLOW_OVERCLOCK a real option. Rename old use 30MHz to this new option. Only try to use > 25MHz when our best frequency is < 15MHz and overclocking is enabled. Fix minor style chaff. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 17:09:34 2012 (r239784) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 17:27:46 2012 (r239785) @@ -68,50 +68,51 @@ __FBSDID("$FreeBSD$"); #include "opt_at91.h" /* - * About running the MCI bus at 30mhz... + * About running the MCI bus above 25MHz * - * Historically, the MCI bus has been run at 30mhz on systems with a 60mhz - * master clock, due to a bug in the mantissa table in dev/mmc.c making it - * appear that the card's max speed was always 30mhz. Fixing that bug causes - * the mmc driver to request a 25mhz clock (as it should) and the logic in - * at91_mci_update_ios() picks the highest speed that doesn't exceed that limit. - * With a 60mhz MCK that would be 15mhz, and that's a real performance buzzkill - * when you've been getting away with 30mhz all along. + * Historically, the MCI bus has been run at 30MHz on systems with a 60MHz + * master clock, in part due to a bug in dev/mmc.c making always request + * 30MHz, and in part over clocking the bus because 15MHz was too slow. + * Fixing that bug causes the mmc driver to request a 25MHz clock (as it + * should) and the logic in at91_mci_update_ios() picks the highest speed that + * doesn't exceed that limit. With a 60MHz MCK that would be 15MHz, and + * that's a real performance buzzkill when you've been getting away with 30MHz + * all along. * - * By defining AT91_MCI_USE_30MHZ (or setting the 30mhz=1 device hint or - * sysctl) you can enable logic in at91_mci_update_ios() to overlcock the SD - * bus a little by running it at MCK / 2 when MCK is between greater than - * 50MHz and the requested speed is 25mhz. This appears to work on virtually - * all SD cards, since it is what this driver has been doing prior to the - * introduction of this option, where the overclocking vs underclocking - * decision was automaticly "overclock". Modern SD cards can run at - * 45mhz/1-bit in standard mode (high speed mode enable commands not sent) - * without problems. + * By defining AT91_MCI_ALLOW_OVERCLOCK (or setting the allow_overclock=1 + * device hint or sysctl) you can enable logic in at91_mci_update_ios() to + * overlcock the SD bus a little by running it at MCK / 2 when the requested + * speed is 25MHz and the next highest speed is 15MHz or less. This appears + * to work on virtually all SD cards, since it is what this driver has been + * doing prior to the introduction of this option, where the overclocking vs + * underclocking decision was automaticly "overclock". Modern SD cards can + * run at 45mhz/1-bit in standard mode (high speed mode enable commands not + * sent) without problems. * * Speaking of high-speed mode, the rm9200 manual says the MCI device supports - * the SD v1.0 specification and can run up to 50mhz. This is interesting in - * that the SD v1.0 spec caps the speed at 25mhz; high speed mode was added in + * the SD v1.0 specification and can run up to 50MHz. This is interesting in + * that the SD v1.0 spec caps the speed at 25MHz; high speed mode was added in * the v1.10 spec. Furthermore, high speed mode doesn't just crank up the * clock, it alters the signal timing. The rm9200 MCI device doesn't support - * these altered timings. So while speeds over 25mhz may work, they only work + * these altered timings. So while speeds over 25MHz may work, they only work * in what the SD spec calls "default" speed mode, and it amounts to violating * the spec by overclocking the bus. * - * If you also enable 4-wire mode it's possible the 30mhz transfers will fail. - * On the AT91RM9200, due to bugs in the bus contention logic, if you have the - * USB host device and OHCI driver enabled will fail. Even underclocking to - * 15MHz, intermittant overrun and underrun errors occur. Note that you don't - * even need to have usb devices attached to the system, the errors begin to - * occur as soon as the OHCI driver sets the register bit to enable periodic - * transfers. It appears (based on brief investigation) that the usb host - * controller uses so much ASB bandwidth that sometimes the DMA for MCI - * transfers doesn't get a bus grant in time and data gets dropped. Adding - * even a modicum of network activity changes the symptom from intermittant to - * very frequent. Members of the AT91SAM9 family have corrected this problem, or - * are at least better about their use of the bus. + * If you also enable 4-wire mode it's possible transfers faster than 25MHz + * will fail. On the AT91RM9200, due to bugs in the bus contention logic, if + * you have the USB host device and OHCI driver enabled will fail. Even + * underclocking to 15MHz, intermittant overrun and underrun errors occur. + * Note that you don't even need to have usb devices attached to the system, + * the errors begin to occur as soon as the OHCI driver sets the register bit + * to enable periodic transfers. It appears (based on brief investigation) + * that the usb host controller uses so much ASB bandwidth that sometimes the + * DMA for MCI transfers doesn't get a bus grant in time and data gets + * dropped. Adding even a modicum of network activity changes the symptom + * from intermittant to very frequent. Members of the AT91SAM9 family have + * corrected this problem, or are at least better about their use of the bus. */ -#ifndef AT91_MCI_USE_30MHZ -#define AT91_MCI_USE_30MHZ 1 +#ifndef AT91_MCI_ALLOW_OVERCLOCK +#define AT91_MCI_ALLOW_OVERCLOCK 1 #endif /* @@ -146,7 +147,7 @@ struct at91_mci_softc { #define CMD_MULTIREAD 0x10 #define CMD_MULTIWRITE 0x20 int has_4wire; - int use_30mhz; + int allow_overclock; struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; @@ -194,7 +195,7 @@ WR4(struct at91_mci_softc *sc, bus_size_ bus_write_4(sc->mem_res, off, val); } -static void +static void at91_bswap_buf(struct at91_mci_softc *sc, void * dptr, void * sptr, uint32_t memsize) { uint32_t * dst = (uint32_t *)dptr; @@ -315,7 +316,7 @@ at91_mci_init(device_t dev) WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ #else /* - * XXX Really should add second "unit" but nobody using using + * XXX Really should add second "unit" but nobody using using * a two slot card that we know of. XXX */ WR4(sc, MCI_SDCR, 1); /* SLOT B, 1 bit bus */ @@ -385,7 +386,7 @@ at91_mci_attach(device_t dev) * byte-swapping with the DMA operations. */ err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BBSIZE, 1, BBSIZE, 0, NULL, NULL, &sc->dmatag); if (err != 0) goto out; @@ -421,36 +422,35 @@ at91_mci_attach(device_t dev) #if defined(AT91_MCI_HAS_4WIRE) && AT91_MCI_HAS_4WIRE != 0 sc->has_4wire = 1; #endif - resource_int_value(device_get_name(dev), device_get_unit(dev), + resource_int_value(device_get_name(dev), device_get_unit(dev), "4wire", &sc->has_4wire); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); if (sc->has_4wire) sc->sc_cap |= CAP_HAS_4WIRE; -#if defined(AT91_MCI_USE_30MHZ) && AT91_MCI_USE_30MHZ != 0 - sc->use_30mhz = 1; -#endif - resource_int_value(device_get_name(dev), device_get_unit(dev), - "30mhz", &sc->use_30mhz); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "30mhz", - CTLFLAG_RW, &sc->use_30mhz, 0, "use 30mhz clock for 25mhz request"); + sc->allow_overclock = AT91_MCI_ALLOW_OVERCLOCK; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "allow_overclock", &sc->allow_overclock); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "allow_overclock", + CTLFLAG_RW, &sc->allow_overclock, 0, + "Allow up to 30MHz clock for 25MHz request when next highest speed 15MHz or less."); /* * Our real min freq is master_clock/512, but upper driver layers are * going to set the min speed during card discovery, and the right speed - * for that is 400khz, so advertise a safe value just under that. + * for that is 400kHz, so advertise a safe value just under that. * * For max speed, while the rm9200 manual says the max is 50mhz, it also * says it supports only the SD v1.0 spec, which means the real limit is * 25mhz. On the other hand, historical use has been to slightly violate - * the standard by running the bus at 30mhz. For more information on + * the standard by running the bus at 30MHz. For more information on * that, see the comments at the top of this file. */ sc->host.f_min = 375000; sc->host.f_max = at91_master_clock / 2; - if (sc->host.f_max > 25000000) - sc->host.f_max = 25000000; /* Limit to 25MHz */ + if (sc->host.f_max > 25000000) + sc->host.f_max = 25000000; sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = 0; if (sc->sc_cap & CAP_HAS_4WIRE) @@ -549,6 +549,7 @@ at91_mci_update_ios(device_t brdev, devi struct at91_mci_softc *sc; struct mmc_ios *ios; uint32_t clkdiv; + uint32_t freq; sc = device_get_softc(brdev); ios = &sc->host.ios; @@ -557,11 +558,10 @@ at91_mci_update_ios(device_t brdev, devi * Calculate our closest available clock speed that doesn't exceed the * requested speed. * - * If the master clock is 50MHz-62MHz and the requested bus speed is - * 25mhz and the use_30mhz flag is on, set clkdiv to zero to get a - * master_clock / 2 (25-31MHz) MMC/SD clock rather than settle for the - * next lower click (12.5-15.5MHz). See comments near the top of the - * file for more info. + * When overclocking is allowed, the requested clock is 25MHz, the + * computed frequency is 15MHz or smaller and clockdiv is 1, use + * clockdiv of 0 to double that. If less than 12.5MHz, double + * regardless of the overclocking setting. * * Whatever we come up with, store it back into ios->clock so that the * upper layer drivers can report the actual speed of the bus. @@ -571,15 +571,18 @@ at91_mci_update_ios(device_t brdev, devi clkdiv = 0; } else { WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); - if (sc->use_30mhz && ios->clock == 25000000 && - at91_master_clock > 50000000 && - at91_master_clock < 62000000) - clkdiv = 0; - else if ((at91_master_clock % (ios->clock * 2)) == 0) + if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; else clkdiv = (at91_master_clock / ios->clock) / 2; - ios->clock = at91_master_clock / ((clkdiv+1) * 2); + freq = at91_master_clock / ((clkdiv+1) * 2); + if (clkdiv == 1 && ios->clock == 25000000 && freq <= 15000000) { + if (sc->allow_overclock || freq <= 12500000) { + clkdiv = 0; + freq = at91_master_clock / ((clkdiv+1) * 2); + } + } + ios->clock = freq; } if (ios->bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); @@ -636,8 +639,8 @@ at91_mci_start_cmd(struct at91_mci_softc */ if (data == NULL) { - uint32_t ier = MCI_SR_CMDRDY | - MCI_SR_RTOE | MCI_SR_RENDE | + uint32_t ier = MCI_SR_CMDRDY | + MCI_SR_RTOE | MCI_SR_RENDE | MCI_SR_RCRCE | MCI_SR_RDIRE | MCI_SR_RINDE; at91_mci_pdc_disable(sc); @@ -652,7 +655,7 @@ at91_mci_start_cmd(struct at91_mci_softc ier &= ~MCI_SR_RCRCE; if (mci_debug) - printf("CMDR %x (opcode %d) ARGR %x no data\n", + printf("CMDR %x (opcode %d) ARGR %x no data\n", cmdr, cmd->opcode, cmd->arg); WR4(sc, MCI_ARGR, cmd->arg); @@ -674,8 +677,8 @@ at91_mci_start_cmd(struct at91_mci_softc cmdr |= MCI_CMDR_TRTYP_STREAM; else if (data->flags & MMC_DATA_MULTI) { cmdr |= MCI_CMDR_TRTYP_MULTIPLE; - sc->flags |= (data->flags & MMC_DATA_READ) ? - CMD_MULTIREAD : CMD_MULTIWRITE; + sc->flags |= (data->flags & MMC_DATA_READ) ? + CMD_MULTIREAD : CMD_MULTIWRITE; } /* @@ -687,10 +690,10 @@ at91_mci_start_cmd(struct at91_mci_softc * smaller blocks are possible, but never larger. */ - WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); - mr = RD4(sc,MCI_MR) & ~MCI_MR_BLKLEN; - mr |= min(data->len, 512) << 16; + mr = RD4(sc,MCI_MR) & ~MCI_MR_BLKLEN; + mr |= min(data->len, 512) << 16; WR4(sc, MCI_MR, mr | MCI_MR_PDCMODE|MCI_MR_PDCPADV); /* @@ -740,12 +743,12 @@ at91_mci_start_cmd(struct at91_mci_softc len = remaining / 2; else len = remaining; - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], - sc->bbuf_vaddr[0], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO read dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], BUS_DMASYNC_PREREAD); WR4(sc, PDC_RPR, paddr); WR4(sc, PDC_RCR, len / 4); @@ -755,12 +758,12 @@ at91_mci_start_cmd(struct at91_mci_softc sc->bbuf_len[1] = 0; } else { len = remaining; - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], - sc->bbuf_vaddr[1], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO read dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], BUS_DMASYNC_PREREAD); WR4(sc, PDC_RNPR, paddr); WR4(sc, PDC_RNCR, len / 4); @@ -780,12 +783,12 @@ at91_mci_start_cmd(struct at91_mci_softc memset(data->data, 0, 12); } at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], - sc->bbuf_vaddr[0], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO write dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TPR,paddr); WR4(sc, PDC_TCR, len / 4); @@ -797,12 +800,12 @@ at91_mci_start_cmd(struct at91_mci_softc len = remaining; at91_bswap_buf(sc, sc->bbuf_vaddr[1], ((char *)data->data)+BBSIZE, len); - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], - sc->bbuf_vaddr[1], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO write dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TNPR, paddr); WR4(sc, PDC_TNCR, len / 4); @@ -815,7 +818,7 @@ at91_mci_start_cmd(struct at91_mci_softc } if (mci_debug) - printf("CMDR %x (opcode %d) ARGR %x with data len %d\n", + printf("CMDR %x (opcode %d) ARGR %x with data len %d\n", cmdr, cmd->opcode, cmd->arg, cmd->data->len); WR4(sc, MCI_ARGR, cmd->arg); @@ -1006,7 +1009,7 @@ at91_mci_stop_done(struct at91_mci_softc /* * This is known to be true of at91rm9200 hardware; it may or may not - * apply to more recent chips: + * apply to more recent chips: * * After stopping a multi-block write, the NOTBUSY bit in MCI_SR does * not properly reflect the actual busy state of the card as signaled @@ -1193,10 +1196,10 @@ at91_mci_intr(void *arg) * helpful. XXX bootverbose? */ if (cmd->opcode != 8) { - device_printf(sc->dev, - "IO error; status MCI_SR = 0x%x cmd opcode = %d%s\n", + device_printf(sc->dev, + "IO error; status MCI_SR = 0x%x cmd opcode = %d%s\n", sr, cmd->opcode, - (cmd->opcode != 12) ? "" : + (cmd->opcode != 12) ? "" : (sc->flags & CMD_MULTIREAD) ? " after read" : " after write"); at91_mci_reset(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 18:16:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 664) id 09999106566C; Tue, 28 Aug 2012 18:16:09 +0000 (UTC) Date: Tue, 28 Aug 2012 11:16:08 -0700 From: David O'Brien To: Dag-Erling =?unknown-8bit?Q?Sm=F8rgrav?= Message-ID: <20120828181607.GA56329@dragon.NUXI.org> References: <201208271322.q7RDMSEw002945@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208271322.q7RDMSEw002945@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239730 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 18:16:09 -0000 On Mon, Aug 27, 2012 at 01:22:28PM +0000, Dag-Erling Smrgrav wrote: > Author: des > Date: Mon Aug 27 13:22:27 2012 > New Revision: 239730 > URL: http://svn.freebsd.org/changeset/base/239730 > > Log: > Parly revert r239255: reinstate a default maxswzone on i386, where KVA is > scarce, but set it slightly higher so we can handle 8 GB of swap. Thank you for dealing with this issue. I had a diff addressing this I had prepared but had yet to send to alc for review. The comment below says to me the target swap size is 16GB, not 8GB. >From recent 10-CURRENT experience where I hit the VM_SWZONE_SIZE_MAX limit many times I think shooting for 16GB is more realistic with today's desktop application mix. Or at least 12GB if KVA usage for supporting 16GB is a concern. All it took to hit this was a 2GB tmpfs and running two web browsers with many tabs open. > + * 276 is sizeof(struct swblock), but we do not always have a definition > + * in scope for struct swblock, so we have to hardcode it. Each struct > + * swblock holds metadata for 32 pages, so in theory, this is enough for > + * 16 GB of swap. In practice, however, the usable amount is considerably > + * lower due to fragmentation. The old definition from r102738 (dillon 2002-08-31) was "32 * 1024 * 1024" or 32MB. This allowed for 7GB of swap from a 16GB swap partition, per top(8)'s "Swap total" reporting of swap usage when I would get kernel: swap zone exhausted, increase kern.maxswzone kernel: pid 81073 (firefox-bin), uid 1765, was killed: out of swap space every couple of days. > +#define VM_SWZONE_SIZE_MAX (276 * 128 * 1024) Will 34.5MB, really allow 16GB swap? On the machine you tested this on, what did top(8) report when the swap partition was say 20GB? thanks, -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 18:33:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07AB9106566C; Tue, 28 Aug 2012 18:33:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD53F8FC08; Tue, 28 Aug 2012 18:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SIXCMS009591; Tue, 28 Aug 2012 18:33:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SIXClS009589; Tue, 28 Aug 2012 18:33:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208281833.q7SIXClS009589@svn.freebsd.org> From: Ed Schouten Date: Tue, 28 Aug 2012 18:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239786 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 18:33:13 -0000 Author: ed Date: Tue Aug 28 18:33:12 2012 New Revision: 239786 URL: http://svn.freebsd.org/changeset/base/239786 Log: Use a proper destructor function. When calling a revoke(2) on a dtrace device, dtrace_close() could be called, even if threads are still stuck in the device. Defer the actual deallocation of datastructures to the cdevpriv destructor. While there, remove the unneeded D_TRACKCLOSE and D_NEEDMINOR flags. For the helper device, we never need it. For the regular dtrace devices, we only need these flags on FreeBSD pre-8. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 28 17:27:46 2012 (r239785) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 28 18:33:12 2012 (r239786) @@ -15342,10 +15342,7 @@ dtrace_attach(dev_info_t *devi, ddi_atta #if !defined(sun) #if __FreeBSD_version >= 800039 -static void -dtrace_dtr(void *data __unused) -{ -} +static void dtrace_dtr(void *); #endif #endif @@ -15470,11 +15467,15 @@ dtrace_open(struct cdev *dev, int oflags } /*ARGSUSED*/ -static int #if defined(sun) +static int dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p) -#else +#elif __FreeBSD_version < 800039 +static int dtrace_close(struct cdev *dev, int flags, int fmt __unused, struct thread *td) +#else +static void +dtrace_dtr(void *data) #endif { #if defined(sun) @@ -15493,8 +15494,7 @@ dtrace_close(struct cdev *dev, int flags if (dev2unit(dev) == 0) return (0); #else - dtrace_state_t *state; - devfs_get_cdevpriv((void **) &state); + dtrace_state_t *state = data; #endif #endif @@ -15537,7 +15537,9 @@ dtrace_close(struct cdev *dev, int flags destroy_dev_sched(dev); #endif +#if defined(sun) || __FreeBSD_version < 800039 return (0); +#endif } #if defined(sun) @@ -16584,8 +16586,10 @@ void dtrace_invop_uninit(void); static struct cdevsw dtrace_cdevsw = { .d_version = D_VERSION, +#if __FreeBSD_version < 800039 .d_flags = D_TRACKCLOSE | D_NEEDMINOR, .d_close = dtrace_close, +#endif .d_ioctl = dtrace_ioctl, .d_open = dtrace_open, .d_name = "dtrace", @@ -16593,7 +16597,6 @@ static struct cdevsw dtrace_cdevsw = { static struct cdevsw helper_cdevsw = { .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE | D_NEEDMINOR, .d_ioctl = dtrace_ioctl_helper, .d_name = "helper", }; From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 18:44:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFA33106566B; Tue, 28 Aug 2012 18:44:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8ADC8FC0A; Tue, 28 Aug 2012 18:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SIiuDC010948; Tue, 28 Aug 2012 18:44:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SIiu6e010943; Tue, 28 Aug 2012 18:44:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208281844.q7SIiu6e010943@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Aug 2012 18:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239787 - in stable/9: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 18:44:56 -0000 Author: jhb Date: Tue Aug 28 18:44:56 2012 New Revision: 239787 URL: http://svn.freebsd.org/changeset/base/239787 Log: MFC 230782,237274: Refine the implementation of POSIX_FADV_NOREUSE to perform POSIX_FADV_DONTNEED requests on the currently accessed portion of the file on each read(2) or write(2) rather than using direct I/O. This gives much better performance including read-ahead and write clustering similar to normal read(2) and write(2) calls. If subsequent read(2) and write(2) calls are sequential, then the POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed range. Modified: stable/9/lib/libc/sys/posix_fadvise.2 stable/9/sys/kern/vfs_syscalls.c stable/9/sys/kern/vfs_vnops.c stable/9/sys/sys/file.h Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/lib/libc/uuid/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/lib/libc/sys/posix_fadvise.2 ============================================================================== --- stable/9/lib/libc/sys/posix_fadvise.2 Tue Aug 28 18:33:12 2012 (r239786) +++ stable/9/lib/libc/sys/posix_fadvise.2 Tue Aug 28 18:44:56 2012 (r239787) @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 19, 2012 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -84,10 +84,9 @@ specified range and future access to thi .It Dv POSIX_FADV_NOREUSE Tells the system that the specified data will only be accessed once and then not reused. -Accesses to data within the specified range are treated as if the file -descriptor has the -.Dv O_DIRECT -flag enabled. +The system may decrease the in-memory priority of data once it has been +read or written. +Future access to this data may require a read operation. .El .Pp .Sh RETURN VALUES Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Tue Aug 28 18:33:12 2012 (r239786) +++ stable/9/sys/kern/vfs_syscalls.c Tue Aug 28 18:44:56 2012 (r239787) @@ -4953,6 +4953,8 @@ kern_posix_fadvise(struct thread *td, in new->fa_advice = advice; new->fa_start = offset; new->fa_end = end; + new->fa_prevstart = 0; + new->fa_prevend = 0; fp->f_advice = new; new = fa; } Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Tue Aug 28 18:33:12 2012 (r239786) +++ stable/9/sys/kern/vfs_vnops.c Tue Aug 28 18:44:56 2012 (r239787) @@ -519,6 +519,7 @@ vn_read(fp, uio, active_cred, flags, td) int error, ioflag; struct mtx *mtxp; int advice, vfslocked; + off_t offset, start, end; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); @@ -558,19 +559,14 @@ vn_read(fp, uio, active_cred, flags, td) switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: + case POSIX_FADV_NOREUSE: ioflag |= sequential_heuristic(uio, fp); break; case POSIX_FADV_RANDOM: /* Disable read-ahead for random I/O. */ break; - case POSIX_FADV_NOREUSE: - /* - * Request the underlying FS to discard the buffers - * and pages after the I/O is complete. - */ - ioflag |= IO_DIRECT; - break; } + offset = uio->uio_offset; #ifdef MAC error = mac_vnode_check_read(active_cred, fp->f_cred, vp); @@ -587,6 +583,39 @@ vn_read(fp, uio, active_cred, flags, td) } fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); + if (error == 0 && advice == POSIX_FADV_NOREUSE && + offset != uio->uio_offset) { + /* + * Use POSIX_FADV_DONTNEED to flush clean pages and + * buffers for the backing file after a + * POSIX_FADV_NOREUSE read(2). To optimize the common + * case of using POSIX_FADV_NOREUSE with sequential + * access, track the previous implicit DONTNEED + * request and grow this request to include the + * current read(2) in addition to the previous + * DONTNEED. With purely sequential access this will + * cause the DONTNEED requests to continously grow to + * cover all of the previously read regions of the + * file. This allows filesystem blocks that are + * accessed by multiple calls to read(2) to be flushed + * once the last read(2) finishes. + */ + start = offset; + end = uio->uio_offset - 1; + mtx_lock(mtxp); + if (fp->f_advice != NULL && + fp->f_advice->fa_advice == POSIX_FADV_NOREUSE) { + if (start != 0 && fp->f_advice->fa_prevend + 1 == start) + start = fp->f_advice->fa_prevstart; + else if (fp->f_advice->fa_prevstart != 0 && + fp->f_advice->fa_prevstart == end + 1) + end = fp->f_advice->fa_prevend; + fp->f_advice->fa_prevstart = start; + fp->f_advice->fa_prevend = end; + } + mtx_unlock(mtxp); + error = VOP_ADVISE(vp, start, end, POSIX_FADV_DONTNEED); + } VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -607,6 +636,7 @@ vn_write(fp, uio, active_cred, flags, td int error, ioflag, lock_flags; struct mtx *mtxp; int advice, vfslocked; + off_t offset, start, end; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); @@ -641,6 +671,7 @@ vn_write(fp, uio, active_cred, flags, td if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; advice = POSIX_FADV_NORMAL; + mtxp = NULL; if (fp->f_advice != NULL) { mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); @@ -653,19 +684,14 @@ vn_write(fp, uio, active_cred, flags, td switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: + case POSIX_FADV_NOREUSE: ioflag |= sequential_heuristic(uio, fp); break; case POSIX_FADV_RANDOM: /* XXX: Is this correct? */ break; - case POSIX_FADV_NOREUSE: - /* - * Request the underlying FS to discard the buffers - * and pages after the I/O is complete. - */ - ioflag |= IO_DIRECT; - break; } + offset = uio->uio_offset; #ifdef MAC error = mac_vnode_check_write(active_cred, fp->f_cred, vp); @@ -678,6 +704,55 @@ vn_write(fp, uio, active_cred, flags, td VOP_UNLOCK(vp, 0); if (vp->v_type != VCHR) vn_finished_write(mp); + if (error == 0 && advice == POSIX_FADV_NOREUSE && + offset != uio->uio_offset) { + /* + * Use POSIX_FADV_DONTNEED to flush clean pages and + * buffers for the backing file after a + * POSIX_FADV_NOREUSE write(2). To optimize the + * common case of using POSIX_FADV_NOREUSE with + * sequential access, track the previous implicit + * DONTNEED request and grow this request to include + * the current write(2) in addition to the previous + * DONTNEED. With purely sequential access this will + * cause the DONTNEED requests to continously grow to + * cover all of the previously written regions of the + * file. + * + * Note that the blocks just written are almost + * certainly still dirty, so this only works when + * VOP_ADVISE() calls from subsequent writes push out + * the data written by this write(2) once the backing + * buffers are clean. However, as compared to forcing + * IO_DIRECT, this gives much saner behavior. Write + * clustering is still allowed, and clean pages are + * merely moved to the cache page queue rather than + * outright thrown away. This means a subsequent + * read(2) can still avoid hitting the disk if the + * pages have not been reclaimed. + * + * This does make POSIX_FADV_NOREUSE largely useless + * with non-sequential access. However, sequential + * access is the more common use case and the flag is + * merely advisory. + */ + start = offset; + end = uio->uio_offset - 1; + mtx_lock(mtxp); + if (fp->f_advice != NULL && + fp->f_advice->fa_advice == POSIX_FADV_NOREUSE) { + if (start != 0 && fp->f_advice->fa_prevend + 1 == start) + start = fp->f_advice->fa_prevstart; + else if (fp->f_advice->fa_prevstart != 0 && + fp->f_advice->fa_prevstart == end + 1) + end = fp->f_advice->fa_prevend; + fp->f_advice->fa_prevstart = start; + fp->f_advice->fa_prevend = end; + } + mtx_unlock(mtxp); + error = VOP_ADVISE(vp, start, end, POSIX_FADV_DONTNEED); + } + unlock: VFS_UNLOCK_GIANT(vfslocked); return (error); Modified: stable/9/sys/sys/file.h ============================================================================== --- stable/9/sys/sys/file.h Tue Aug 28 18:33:12 2012 (r239786) +++ stable/9/sys/sys/file.h Tue Aug 28 18:44:56 2012 (r239787) @@ -126,6 +126,8 @@ struct fadvise_info { int fa_advice; /* (f) FADV_* type. */ off_t fa_start; /* (f) Region start. */ off_t fa_end; /* (f) Region end. */ + off_t fa_prevstart; /* (f) Previous NOREUSE start. */ + off_t fa_prevend; /* (f) Previous NOREUSE end. */ }; struct file { From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 18:45:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19DBF1065686; Tue, 28 Aug 2012 18:45:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 031F08FC08; Tue, 28 Aug 2012 18:45:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SIjKkO011031; Tue, 28 Aug 2012 18:45:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SIjKm4011026; Tue, 28 Aug 2012 18:45:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208281845.q7SIjKm4011026@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Aug 2012 18:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239788 - in stable/8: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 18:45:21 -0000 Author: jhb Date: Tue Aug 28 18:45:20 2012 New Revision: 239788 URL: http://svn.freebsd.org/changeset/base/239788 Log: MFC 230782,237274: Refine the implementation of POSIX_FADV_NOREUSE to perform POSIX_FADV_DONTNEED requests on the currently accessed portion of the file on each read(2) or write(2) rather than using direct I/O. This gives much better performance including read-ahead and write clustering similar to normal read(2) and write(2) calls. If subsequent read(2) and write(2) calls are sequential, then the POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed range. Modified: stable/8/lib/libc/sys/posix_fadvise.2 stable/8/sys/kern/vfs_syscalls.c stable/8/sys/kern/vfs_vnops.c stable/8/sys/sys/file.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc/uuid/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/lib/libc/sys/posix_fadvise.2 ============================================================================== --- stable/8/lib/libc/sys/posix_fadvise.2 Tue Aug 28 18:44:56 2012 (r239787) +++ stable/8/lib/libc/sys/posix_fadvise.2 Tue Aug 28 18:45:20 2012 (r239788) @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 19, 2012 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -84,10 +84,9 @@ specified range and future access to thi .It Dv POSIX_FADV_NOREUSE Tells the system that the specified data will only be accessed once and then not reused. -Accesses to data within the specified range are treated as if the file -descriptor has the -.Dv O_DIRECT -flag enabled. +The system may decrease the in-memory priority of data once it has been +read or written. +Future access to this data may require a read operation. .El .Pp .Sh RETURN VALUES Modified: stable/8/sys/kern/vfs_syscalls.c ============================================================================== --- stable/8/sys/kern/vfs_syscalls.c Tue Aug 28 18:44:56 2012 (r239787) +++ stable/8/sys/kern/vfs_syscalls.c Tue Aug 28 18:45:20 2012 (r239788) @@ -4824,6 +4824,8 @@ kern_posix_fadvise(struct thread *td, in new->fa_advice = advice; new->fa_start = offset; new->fa_end = end; + new->fa_prevstart = 0; + new->fa_prevend = 0; fp->f_advice = new; new = fa; } Modified: stable/8/sys/kern/vfs_vnops.c ============================================================================== --- stable/8/sys/kern/vfs_vnops.c Tue Aug 28 18:44:56 2012 (r239787) +++ stable/8/sys/kern/vfs_vnops.c Tue Aug 28 18:45:20 2012 (r239788) @@ -512,6 +512,7 @@ vn_read(fp, uio, active_cred, flags, td) int error, ioflag; struct mtx *mtxp; int advice, vfslocked; + off_t offset, start, end; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); @@ -551,19 +552,14 @@ vn_read(fp, uio, active_cred, flags, td) switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: + case POSIX_FADV_NOREUSE: ioflag |= sequential_heuristic(uio, fp); break; case POSIX_FADV_RANDOM: /* Disable read-ahead for random I/O. */ break; - case POSIX_FADV_NOREUSE: - /* - * Request the underlying FS to discard the buffers - * and pages after the I/O is complete. - */ - ioflag |= IO_DIRECT; - break; } + offset = uio->uio_offset; #ifdef MAC error = mac_vnode_check_read(active_cred, fp->f_cred, vp); @@ -580,6 +576,39 @@ vn_read(fp, uio, active_cred, flags, td) } fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); + if (error == 0 && advice == POSIX_FADV_NOREUSE && + offset != uio->uio_offset) { + /* + * Use POSIX_FADV_DONTNEED to flush clean pages and + * buffers for the backing file after a + * POSIX_FADV_NOREUSE read(2). To optimize the common + * case of using POSIX_FADV_NOREUSE with sequential + * access, track the previous implicit DONTNEED + * request and grow this request to include the + * current read(2) in addition to the previous + * DONTNEED. With purely sequential access this will + * cause the DONTNEED requests to continously grow to + * cover all of the previously read regions of the + * file. This allows filesystem blocks that are + * accessed by multiple calls to read(2) to be flushed + * once the last read(2) finishes. + */ + start = offset; + end = uio->uio_offset - 1; + mtx_lock(mtxp); + if (fp->f_advice != NULL && + fp->f_advice->fa_advice == POSIX_FADV_NOREUSE) { + if (start != 0 && fp->f_advice->fa_prevend + 1 == start) + start = fp->f_advice->fa_prevstart; + else if (fp->f_advice->fa_prevstart != 0 && + fp->f_advice->fa_prevstart == end + 1) + end = fp->f_advice->fa_prevend; + fp->f_advice->fa_prevstart = start; + fp->f_advice->fa_prevend = end; + } + mtx_unlock(mtxp); + error = VOP_ADVISE(vp, start, end, POSIX_FADV_DONTNEED); + } VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -600,6 +629,7 @@ vn_write(fp, uio, active_cred, flags, td int error, ioflag, lock_flags; struct mtx *mtxp; int advice, vfslocked; + off_t offset, start, end; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); @@ -634,6 +664,7 @@ vn_write(fp, uio, active_cred, flags, td if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; advice = POSIX_FADV_NORMAL; + mtxp = NULL; if (fp->f_advice != NULL) { mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); @@ -646,19 +677,14 @@ vn_write(fp, uio, active_cred, flags, td switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: + case POSIX_FADV_NOREUSE: ioflag |= sequential_heuristic(uio, fp); break; case POSIX_FADV_RANDOM: /* XXX: Is this correct? */ break; - case POSIX_FADV_NOREUSE: - /* - * Request the underlying FS to discard the buffers - * and pages after the I/O is complete. - */ - ioflag |= IO_DIRECT; - break; } + offset = uio->uio_offset; #ifdef MAC error = mac_vnode_check_write(active_cred, fp->f_cred, vp); @@ -671,6 +697,55 @@ vn_write(fp, uio, active_cred, flags, td VOP_UNLOCK(vp, 0); if (vp->v_type != VCHR) vn_finished_write(mp); + if (error == 0 && advice == POSIX_FADV_NOREUSE && + offset != uio->uio_offset) { + /* + * Use POSIX_FADV_DONTNEED to flush clean pages and + * buffers for the backing file after a + * POSIX_FADV_NOREUSE write(2). To optimize the + * common case of using POSIX_FADV_NOREUSE with + * sequential access, track the previous implicit + * DONTNEED request and grow this request to include + * the current write(2) in addition to the previous + * DONTNEED. With purely sequential access this will + * cause the DONTNEED requests to continously grow to + * cover all of the previously written regions of the + * file. + * + * Note that the blocks just written are almost + * certainly still dirty, so this only works when + * VOP_ADVISE() calls from subsequent writes push out + * the data written by this write(2) once the backing + * buffers are clean. However, as compared to forcing + * IO_DIRECT, this gives much saner behavior. Write + * clustering is still allowed, and clean pages are + * merely moved to the cache page queue rather than + * outright thrown away. This means a subsequent + * read(2) can still avoid hitting the disk if the + * pages have not been reclaimed. + * + * This does make POSIX_FADV_NOREUSE largely useless + * with non-sequential access. However, sequential + * access is the more common use case and the flag is + * merely advisory. + */ + start = offset; + end = uio->uio_offset - 1; + mtx_lock(mtxp); + if (fp->f_advice != NULL && + fp->f_advice->fa_advice == POSIX_FADV_NOREUSE) { + if (start != 0 && fp->f_advice->fa_prevend + 1 == start) + start = fp->f_advice->fa_prevstart; + else if (fp->f_advice->fa_prevstart != 0 && + fp->f_advice->fa_prevstart == end + 1) + end = fp->f_advice->fa_prevend; + fp->f_advice->fa_prevstart = start; + fp->f_advice->fa_prevend = end; + } + mtx_unlock(mtxp); + error = VOP_ADVISE(vp, start, end, POSIX_FADV_DONTNEED); + } + unlock: VFS_UNLOCK_GIANT(vfslocked); return (error); Modified: stable/8/sys/sys/file.h ============================================================================== --- stable/8/sys/sys/file.h Tue Aug 28 18:44:56 2012 (r239787) +++ stable/8/sys/sys/file.h Tue Aug 28 18:45:20 2012 (r239788) @@ -117,6 +117,8 @@ struct fadvise_info { int fa_advice; /* (f) FADV_* type. */ off_t fa_start; /* (f) Region start. */ off_t fa_end; /* (f) Region end. */ + off_t fa_prevstart; /* (f) Previous NOREUSE start. */ + off_t fa_prevend; /* (f) Previous NOREUSE end. */ }; struct file { From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 19:23:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C322106566C; Tue, 28 Aug 2012 19:23:05 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA8A88FC16; Tue, 28 Aug 2012 19:23:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SJN4pD017486; Tue, 28 Aug 2012 19:23:04 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SJN4XW017484; Tue, 28 Aug 2012 19:23:04 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208281923.q7SJN4XW017484@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 28 Aug 2012 19:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239789 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 19:23:05 -0000 Author: pluknet Date: Tue Aug 28 19:23:04 2012 New Revision: 239789 URL: http://svn.freebsd.org/changeset/base/239789 Log: MFC r239723: Typo in previous change: print half the theoretical maximum as maximum recommended amount. Modified: stable/9/sys/vm/swap_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/swap_pager.c ============================================================================== --- stable/9/sys/vm/swap_pager.c Tue Aug 28 18:45:20 2012 (r239788) +++ stable/9/sys/vm/swap_pager.c Tue Aug 28 19:23:04 2012 (r239789) @@ -2135,7 +2135,7 @@ swapon_check_swzone(unsigned long npages if (npages > maxpages / 2) { printf("warning: total configured swap (%lu pages) " "exceeds maximum recommended amount (%lu pages).\n", - npages, maxpages); + npages, maxpages / 2); printf("warning: increase kern.maxswzone " "or reduce amount of swap.\n"); return (-1); From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 19:28:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB6F106566C; Tue, 28 Aug 2012 19:28:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95CB08FC16; Tue, 28 Aug 2012 19:28:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SJSWPb018100; Tue, 28 Aug 2012 19:28:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SJSWeg018090; Tue, 28 Aug 2012 19:28:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208281928.q7SJSWeg018090@svn.freebsd.org> From: Ed Schouten Date: Tue, 28 Aug 2012 19:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239790 - in head/sys/geom: . bde part uncompress uzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 19:28:32 -0000 Author: ed Date: Tue Aug 28 19:28:31 2012 New Revision: 239790 URL: http://svn.freebsd.org/changeset/base/239790 Log: Remove unneeded G_PF_CANDELETE flag. This flag is only used by GEOM so it can be propagated to the character device's SI_CANDELETE. Unfortunately, SI_CANDELETE seems to do nothing. Modified: head/sys/geom/bde/g_bde.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_slice.c head/sys/geom/geom_subr.c head/sys/geom/part/g_part.c head/sys/geom/uncompress/g_uncompress.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/bde/g_bde.c Tue Aug 28 19:28:31 2012 (r239790) @@ -185,14 +185,6 @@ g_bde_create_geom(struct gctl_req *req, kproc_create(g_bde_worker, gp, &sc->thread, 0, 0, "g_bde %s", gp->name); pp = g_new_providerf(gp, gp->name); -#if 0 - /* - * XXX: Disable this for now. Appearantly UFS no longer - * XXX: issues BIO_DELETE requests correctly, with the obvious - * XXX: outcome that userdata is trashed. - */ - pp->flags |= G_PF_CANDELETE; -#endif pp->stripesize = kp->zone_cont; pp->stripeoffset = 0; pp->mediasize = sc->mediasize; Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom.h Tue Aug 28 19:28:31 2012 (r239790) @@ -203,7 +203,6 @@ struct g_provider { struct devstat *stat; u_int nstart, nend; u_int flags; -#define G_PF_CANDELETE 0x1 #define G_PF_WITHER 0x2 #define G_PF_ORPHAN 0x4 Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_dev.c Tue Aug 28 19:28:31 2012 (r239790) @@ -208,15 +208,11 @@ g_dev_taste(struct g_class *mp, struct g } } - if (pp->flags & G_PF_CANDELETE) - dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; if (adev != NULL) { - if (pp->flags & G_PF_CANDELETE) - adev->si_flags |= SI_CANDELETE; adev->si_iosize_max = MAXPHYS; adev->si_drv1 = gp; adev->si_drv2 = cp; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_disk.c Tue Aug 28 19:28:31 2012 (r239790) @@ -162,10 +162,6 @@ g_disk_access(struct g_provider *pp, int } pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - if (dp->d_flags & DISKFLAG_CANDELETE) - pp->flags |= G_PF_CANDELETE; - else - pp->flags &= ~G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; dp->d_flags |= DISKFLAG_OPEN; @@ -487,8 +483,6 @@ g_disk_create(void *arg, int flag) pp = g_new_providerf(gp, "%s", gp->name); pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - if (dp->d_flags & DISKFLAG_CANDELETE) - pp->flags |= G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; if (bootverbose) Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_slice.c Tue Aug 28 19:28:31 2012 (r239790) @@ -392,7 +392,6 @@ g_slice_config(struct g_geom *gp, u_int sbuf_finish(sb); pp = g_new_providerf(gp, sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; - pp->flags = pp2->flags & G_PF_CANDELETE; pp->stripesize = pp2->stripesize; pp->stripeoffset = pp2->stripeoffset + offset; if (pp->stripesize > 0) Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_subr.c Tue Aug 28 19:28:31 2012 (r239790) @@ -1261,7 +1261,6 @@ provider_flags_to_string(struct g_provid strlcpy(str, "NONE", size); return (str); } - ADDFLAG(pp, G_PF_CANDELETE, "G_PF_CANDELETE"); ADDFLAG(pp, G_PF_WITHER, "G_PF_WITHER"); ADDFLAG(pp, G_PF_ORPHAN, "G_PF_ORPHAN"); return (str); Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/part/g_part.c Tue Aug 28 19:28:31 2012 (r239790) @@ -423,7 +423,6 @@ g_part_new_provider(struct g_geom *gp, s pp->sectorsize; entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; - entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; entry->gpe_pp->stripesize = pp->stripesize; entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; if (pp->stripesize > 0) Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/uncompress/g_uncompress.c Tue Aug 28 19:28:31 2012 (r239790) @@ -594,7 +594,6 @@ g_uncompress_taste(struct g_class *mp, s pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->flags = pp->flags & G_PF_CANDELETE; if (pp->stripesize > 0) { pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/uzip/g_uzip.c Tue Aug 28 19:28:31 2012 (r239790) @@ -467,7 +467,6 @@ g_uzip_taste(struct g_class *mp, struct pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->flags = pp->flags & G_PF_CANDELETE; pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 19:30:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 098E31065673; Tue, 28 Aug 2012 19:30:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96518FC18; Tue, 28 Aug 2012 19:30:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SJUTVL018345; Tue, 28 Aug 2012 19:30:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SJUTXY018342; Tue, 28 Aug 2012 19:30:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208281930.q7SJUTXY018342@svn.freebsd.org> From: Ed Schouten Date: Tue, 28 Aug 2012 19:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239791 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 19:30:30 -0000 Author: ed Date: Tue Aug 28 19:30:29 2012 New Revision: 239791 URL: http://svn.freebsd.org/changeset/base/239791 Log: Remove unused SI_* flags. The SI_DEVOPEN, SI_CONSOPEN and SI_CANDELETE flags are not used by any piece of code in the tree. Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Tue Aug 28 19:28:31 2012 (r239790) +++ head/sys/kern/kern_conf.c Tue Aug 28 19:30:29 2012 (r239791) @@ -1431,10 +1431,7 @@ DB_SHOW_COMMAND(cdev, db_show_cdev) SI_FLAG(SI_NAMED); SI_FLAG(SI_CHEAPCLONE); SI_FLAG(SI_CHILD); - SI_FLAG(SI_DEVOPEN); - SI_FLAG(SI_CONSOPEN); SI_FLAG(SI_DUMPDEV); - SI_FLAG(SI_CANDELETE); SI_FLAG(SI_CLONELIST); db_printf("si_flags %s\n", buf); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Tue Aug 28 19:28:31 2012 (r239790) +++ head/sys/sys/conf.h Tue Aug 28 19:30:29 2012 (r239791) @@ -59,10 +59,7 @@ struct cdev { #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ #define SI_CHILD 0x0010 /* child of another struct cdev **/ -#define SI_DEVOPEN 0x0020 /* opened by device */ -#define SI_CONSOPEN 0x0040 /* opened by console */ #define SI_DUMPDEV 0x0080 /* is kernel dumpdev */ -#define SI_CANDELETE 0x0100 /* can do BIO_DELETE */ #define SI_CLONELIST 0x0200 /* on a clone list */ struct timespec si_atime; struct timespec si_ctime; From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 22:17:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B720A1065680; Tue, 28 Aug 2012 22:17:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F778FC0C; Tue, 28 Aug 2012 22:17:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SMHMUI037959; Tue, 28 Aug 2012 22:17:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SMHMOP037957; Tue, 28 Aug 2012 22:17:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208282217.q7SMHMOP037957@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 22:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239794 - head/sys/dev/flash X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 22:17:22 -0000 Author: adrian Date: Tue Aug 28 22:17:22 2012 New Revision: 239794 URL: http://svn.freebsd.org/changeset/base/239794 Log: Add a new flash part - 4MB SPI flash from Winbond. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Tue Aug 28 19:37:54 2012 (r239793) +++ head/sys/dev/flash/mx25l.c Tue Aug 28 22:17:22 2012 (r239794) @@ -104,6 +104,7 @@ struct mx25l_flash_ident flash_devices[] { "s25s1032", 0x01, 0x0215, 64 * 1024, 64, FL_NONE }, { "s25sl064a", 0x01, 0x0216, 64 * 1024, 128, FL_NONE }, { "w25q64bv", 0xef, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, + { "w25x32", 0xef, 0x3016, 64 * 1024, 64, FL_ERASE_4K }, }; static uint8_t From owner-svn-src-all@FreeBSD.ORG Tue Aug 28 22:50:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD224106566B; Tue, 28 Aug 2012 22:50:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88588FC16; Tue, 28 Aug 2012 22:50:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7SMolME041664; Tue, 28 Aug 2012 22:50:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SMolaK041662; Tue, 28 Aug 2012 22:50:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208282250.q7SMolaK041662@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 22:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239795 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 22:50:48 -0000 Author: adrian Date: Tue Aug 28 22:50:47 2012 New Revision: 239795 URL: http://svn.freebsd.org/changeset/base/239795 Log: * Don't compile in sysctl descriptions * random is fine as a module Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Tue Aug 28 22:17:22 2012 (r239794) +++ head/sys/mips/conf/AR724X_BASE Tue Aug 28 22:50:47 2012 (r239795) @@ -50,6 +50,9 @@ options DEBUG_MEMGUARD options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS +# .. And no sysctl strings +options NO_SYSCTL_DESCR + options FFS #Berkeley Fast Filesystem # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists @@ -117,7 +120,7 @@ device loop device ether device md device bpf -device random +#device random #device if_bridge #device gif # ip[46] in ip[46] tunneling protocol #device gre # generic encapsulation - only for IPv4 in IPv4 though atm From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 00:53:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE59F1065679; Wed, 29 Aug 2012 00:53:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8BDC8FC1E; Wed, 29 Aug 2012 00:53:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T0rfGa055973; Wed, 29 Aug 2012 00:53:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T0rfCi055971; Wed, 29 Aug 2012 00:53:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290053.q7T0rfCi055971@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 00:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239796 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 00:53:41 -0000 Author: adrian Date: Wed Aug 29 00:53:41 2012 New Revision: 239796 URL: http://svn.freebsd.org/changeset/base/239796 Log: Remove extra debugging - there's no longer any need. 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 Aug 28 22:50:47 2012 (r239795) +++ head/sys/dev/ath/if_ath_rx.c Wed Aug 29 00:53:41 2012 (r239796) @@ -1093,8 +1093,6 @@ void ath_recv_setup_legacy(struct ath_softc *sc) { - device_printf(sc->sc_dev, "DMA setup: legacy\n"); - /* Sensible legacy defaults */ sc->sc_rx_statuslen = 0; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 00:53:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF76D10657DA; Wed, 29 Aug 2012 00:53:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8248FC0A; Wed, 29 Aug 2012 00:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T0rwbX056035; Wed, 29 Aug 2012 00:53:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T0rwCZ056033; Wed, 29 Aug 2012 00:53:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290053.q7T0rwCZ056033@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 00:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239797 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 00:53:58 -0000 Author: adrian Date: Wed Aug 29 00:53:58 2012 New Revision: 239797 URL: http://svn.freebsd.org/changeset/base/239797 Log: Remove - not needed. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Wed Aug 29 00:53:41 2012 (r239796) +++ head/sys/dev/ath/if_ath_rx_edma.c Wed Aug 29 00:53:58 2012 (r239797) @@ -817,8 +817,6 @@ void ath_recv_setup_edma(struct ath_softc *sc) { - device_printf(sc->sc_dev, "DMA setup: EDMA\n"); - /* Set buffer size to 4k */ sc->sc_edma_bufsize = 4096; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 01:04:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B306106564A; Wed, 29 Aug 2012 01:04:13 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFC268FC08; Wed, 29 Aug 2012 01:04:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T14Cke057370; Wed, 29 Aug 2012 01:04:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T14CcR057368; Wed, 29 Aug 2012 01:04:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208290104.q7T14CcR057368@svn.freebsd.org> From: Jim Harris Date: Wed, 29 Aug 2012 01:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239798 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 01:04:13 -0000 Author: jimharris Date: Wed Aug 29 01:04:12 2012 New Revision: 239798 URL: http://svn.freebsd.org/changeset/base/239798 Log: MFC r239591: Remove unncessary atomic operation when reading process flags in PMC_PROC_IS_USING_PMCS macro. Invocations of this macro are not synchronized with setting/clearing of P_HWPMC flag, so the atomic operation here isn't needed. Removing the atomic operation provides noticeable improvement (5-6%) on some scheduler-intensive workloads with HWPMC_HOOKS enabled on an 8C Sandy Bridge Xeon system. Sponsored by: Intel Modified: stable/9/sys/sys/pmckern.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/pmckern.h ============================================================================== --- stable/9/sys/sys/pmckern.h Wed Aug 29 00:53:58 2012 (r239797) +++ stable/9/sys/sys/pmckern.h Wed Aug 29 01:04:12 2012 (r239798) @@ -201,8 +201,7 @@ do { \ /* Check if a process is using HWPMCs.*/ #define PMC_PROC_IS_USING_PMCS(p) \ - (__predict_false(atomic_load_acq_int(&(p)->p_flag) & \ - P_HWPMC)) + (__predict_false(p->p_flag & P_HWPMC)) /* Check if a thread have pending user capture. */ #define PMC_IS_PENDING_CALLCHAIN(p) \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 01:08:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A25106564A; Wed, 29 Aug 2012 01:08:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2678FC0A; Wed, 29 Aug 2012 01:08:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T18agA057897; Wed, 29 Aug 2012 01:08:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T18aLc057894; Wed, 29 Aug 2012 01:08:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290108.q7T18aLc057894@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 01:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239799 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 01:08:36 -0000 Author: adrian Date: Wed Aug 29 01:08:36 2012 New Revision: 239799 URL: http://svn.freebsd.org/changeset/base/239799 Log: Bring over a configuration for the Atheros AP91 reference board. This has an AR7240 SoC with an AR9285 wireless NIC on-board. Since the kernel partition on the 4MiB flash is 960KiB, quite a bit is disabled to try and squeeze the build into that. Even lzma'ed, it's still quite large. Added: head/sys/mips/conf/AP91 (contents, props changed) head/sys/mips/conf/AP91.hints (contents, props changed) Added: head/sys/mips/conf/AP91 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP91 Wed Aug 29 01:08:36 2012 (r239799) @@ -0,0 +1,64 @@ +# +# Specific board setup for the Atheros AP91 reference board. +# +# The AP91 has the following hardware: +# +# + AR7241 CPU SoC +# + AR9287 Wifi +# + Integrated switch (XXX speed?) +# + 4MB flash +# + 16MB RAM +# + uboot environment + +# $FreeBSD$ + +include "AR724X_BASE" +ident "AP91" +hints "AP91.hints" + +options AR71XX_REALMEM=16*1024*1024 + +options AR71XX_ENV_UBOOT + +# Limit inlines +makeoptions INLINE_LIMIT=768 + +# We bite the performance overhead for now; the kernel won't +# fit if the mutexes are inlined. +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options SX_NOINLINE + +# There's no need to enable swapping on this platform. +options NO_SWAPPING + +# For DOS - enable if required +# options MSDOSFS + +# uncompress - to boot read-only lzma natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" + +# Not enough space for these.. +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEBUG_REDZONE +nooptions DEBUG_MEMGUARD + +# Used for the static uboot partition map +device geom_map + +# Options needed for the EEPROM based calibration/PCI configuration data. +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch Added: head/sys/mips/conf/AP91.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP91.hints Wed Aug 29 01:08:36 2012 (r239799) @@ -0,0 +1,103 @@ +# $FreeBSD$ + +# arge0 MDIO bus +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# arge1 MDIO bus doesn't exist on the AR7240 + +# arge0: MII; dedicated PHY 4 on switch, connected via internal switch +# MDIO bus. + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 +# hint.arge.0.eeprommac=0x83fe9ff0 +hint.arge.0.phymask=0x10 # PHY 4 +# hint.arge.0.miimode=2 # MII +hint.arge.0.mdio=mdioproxy1 # Hanging off the arswitch MDIO bus + +# arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII. + +hint.arge.1.phymask=0x0 +# hint.arge.1.miimode=1 # GMII +hint.arge.1.media=1000 # Force to 1000BaseTX/full +hint.arge.1.fduplex=1 + +# +# AR7240 switch config +# +hint.arswitch.0.is_7240=1 # We need to be explicitly told this +hint.arswitch.0.numphys=4 # 4 active switch PHYs (PHY 0 -> 3) +hint.arswitch.0.phy4cpu=1 # Yes, PHY 4 == dedicated PHY +hint.arswitch.0.is_rgmii=0 # No, not RGMII +hint.arswitch.0.is_gmii=0 # No, not GMII + +# ath0 hint - pcie slot 0 +hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.0.0.ath_fixup_size=4096 + +# ath +hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + +# Signal leds +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.name="sig1" +hint.gpioled.0.pins=0x0001 # pin 0 +hint.gpioled.1.at="gpiobus0" +hint.gpioled.1.name="sig2" +hint.gpioled.1.pins=0x0002 # pin 1 +hint.gpioled.2.at="gpiobus0" +hint.gpioled.2.name="sig3" +hint.gpioled.2.pins=0x0800 # pin 11 +hint.gpioled.3.at="gpiobus0" +hint.gpioled.3.name="sig4" +hint.gpioled.3.pins=0x0080 # pin 7 + +# nvram mapping - XXX ? +hint.nvram.0.base=0x1f030000 +hint.nvram.0.maxsize=0x2000 +hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic +hint.nvram.1.base=0x1f032000 +hint.nvram.1.maxsize=0x4000 +hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic + +# GEOM_MAP +# +# From my AP91 environment: +# +# mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs), +# 960k(uImage),64k(ART) + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00040000 # 256k u-boot +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 # 64k u-boot-env +hint.map.1.name="u-boot-env" +hint.map.1.readonly=0 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00050000 +hint.map.2.end=0x00300000 # 2752k rootfs +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00300000 +hint.map.3.end=0x003f0000 # 896k uImage +hint.map.3.name="uImage" +hint.map.3.readonly=1 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x003f0000 +hint.map.4.end=0x00400000 # 64k ART +hint.map.4.name="ART" +hint.map.4.readonly=1 From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 03:50:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E5C1065674; Wed, 29 Aug 2012 03:50:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C19568FC14; Wed, 29 Aug 2012 03:50:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T3oxoF077771; Wed, 29 Aug 2012 03:50:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T3ox8L077769; Wed, 29 Aug 2012 03:50:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290350.q7T3ox8L077769@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 03:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239800 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 03:51:00 -0000 Author: adrian Date: Wed Aug 29 03:50:59 2012 New Revision: 239800 URL: http://svn.freebsd.org/changeset/base/239800 Log: Add a (temporarily located) definition. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 01:08:36 2012 (r239799) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 03:50:59 2012 (r239800) @@ -79,6 +79,11 @@ typedef enum { } HAL_PHYDIAG_CAPS; /* + * Enable/disable strong signal fast diversity + */ +#define HAL_CAP_STRONG_DIV 2 + +/* * Each chip or class of chips registers to offer support. */ struct ath_hal_chip { From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 03:58:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D1AC106564A; Wed, 29 Aug 2012 03:58:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 176058FC12; Wed, 29 Aug 2012 03:58:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T3wD0x078655; Wed, 29 Aug 2012 03:58:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T3wDqW078652; Wed, 29 Aug 2012 03:58:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290358.q7T3wDqW078652@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 03:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239801 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 03:58:14 -0000 Author: adrian Date: Wed Aug 29 03:58:13 2012 New Revision: 239801 URL: http://svn.freebsd.org/changeset/base/239801 Log: Add AR5413 radar parameters and strong signal diversity capability. This is a re-implementation based on the reference carrier code for the AR5413. Tested: * Pulse detection for AR5212 and AR5413, to ensure the correct behaviour for both chips PR: kern/170904 Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Wed Aug 29 03:50:59 2012 (r239800) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Wed Aug 29 03:58:13 2012 (r239801) @@ -843,6 +843,10 @@ ar5212GetCapability(struct ath_hal *ah, return HAL_OK; case 1: /* current setting */ return ahp->ah_diversity ? HAL_OK : HAL_ENXIO; + case HAL_CAP_STRONG_DIV: + *result = OS_REG_READ(ah, AR_PHY_RESTART); + *result = MS(*result, AR_PHY_RESTART_DIV_GC); + return HAL_OK; } return HAL_EINVAL; case HAL_CAP_DIAG: @@ -950,16 +954,34 @@ ar5212SetCapability(struct ath_hal *ah, OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode); return AH_TRUE; case HAL_CAP_DIVERSITY: - if (ahp->ah_phyPowerOn) { - v = OS_REG_READ(ah, AR_PHY_CCK_DETECT); - if (setting) - v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; - else - v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; - OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, v); + switch (capability) { + case 0: + return AH_FALSE; + case 1: /* setting */ + if (ahp->ah_phyPowerOn) { + if (capability == HAL_CAP_STRONG_DIV) { + } + v = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + if (setting) + v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; + else + v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; + OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, v); + } + ahp->ah_diversity = (setting != 0); + return AH_TRUE; + + case HAL_CAP_STRONG_DIV: + if (! ahp->ah_phyPowerOn) + return AH_FALSE; + v = OS_REG_READ(ah, AR_PHY_RESTART); + v &= ~AR_PHY_RESTART_DIV_GC; + v |= SM(setting, AR_PHY_RESTART_DIV_GC); + OS_REG_WRITE(ah, AR_PHY_RESTART, v); + return AH_TRUE; + default: + return AH_FALSE; } - ahp->ah_diversity = (setting != 0); - return AH_TRUE; case HAL_CAP_DIAG: /* hardware diagnostic support */ /* * NB: could split this up into virtual capabilities, @@ -1165,14 +1187,61 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ else val &= ~ AR_PHY_RADAR_0_ENA; + if (IS_5413(ah)) { + + if (pe->pe_blockradar == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_BLOCKOFDMWEAK); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_BLOCKOFDMWEAK); + + if (pe->pe_en_relstep_check == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELSTEPCHK); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELSTEPCHK); + + if (pe->pe_usefir128 == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_USEFIR128); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_USEFIR128); + + if (pe->pe_enmaxrssi == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENMAXRSSI); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENMAXRSSI); + + if (pe->pe_enrelpwr == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELPWRCHK); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELPWRCHK); + + if (pe->pe_relpwr != HAL_PHYERR_PARAM_NOVAL) + OS_REG_RMW_FIELD(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_RELPWR, pe->pe_relpwr); + + if (pe->pe_relstep != HAL_PHYERR_PARAM_NOVAL) + OS_REG_RMW_FIELD(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_RELSTEP, pe->pe_relstep); + + if (pe->pe_maxlen != HAL_PHYERR_PARAM_NOVAL) + OS_REG_RMW_FIELD(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_MAXLEN, pe->pe_maxlen); + } + OS_REG_WRITE(ah, AR_PHY_RADAR_0, val); } /* * Parameters for the AR5212 PHY. - * - * TODO: figure out what values were added for the AR5413 and later - * PHY; update these here. */ #define AR5212_DFS_FIRPWR -41 #define AR5212_DFS_RRSSI 12 @@ -1180,19 +1249,52 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ #define AR5212_DFS_PRSSI 22 #define AR5212_DFS_INBAND 6 +/* + * Default parameters for the AR5413 PHY. + */ +#define AR5413_DFS_FIRPWR -34 +#define AR5413_DFS_RRSSI 20 +#define AR5413_DFS_HEIGHT 10 +#define AR5413_DFS_PRSSI 15 +#define AR5413_DFS_INBAND 6 +#define AR5413_DFS_RELPWR 8 +#define AR5413_DFS_RELSTEP 31 +#define AR5413_DFS_MAXLEN 255 + + HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { - pe->pe_firpwr = AR5212_DFS_FIRPWR; - pe->pe_rrssi = AR5212_DFS_RRSSI; - pe->pe_height = AR5212_DFS_HEIGHT; - pe->pe_prssi = AR5212_DFS_PRSSI; - pe->pe_inband = AR5212_DFS_INBAND; - /* XXX look up what is needed for the AR5413 */ - pe->pe_relpwr = 0; - pe->pe_relstep = 0; - pe->pe_maxlen = 0; + if (IS_5413(ah)) { + pe->pe_firpwr = AR5413_DFS_FIRPWR; + pe->pe_rrssi = AR5413_DFS_RRSSI; + pe->pe_height = AR5413_DFS_HEIGHT; + pe->pe_prssi = AR5413_DFS_PRSSI; + pe->pe_inband = AR5413_DFS_INBAND; + pe->pe_relpwr = AR5413_DFS_RELPWR; + pe->pe_relstep = AR5413_DFS_RELSTEP; + pe->pe_maxlen = AR5413_DFS_MAXLEN; + pe->pe_usefir128 = 0; + pe->pe_blockradar = 1; + pe->pe_enmaxrssi = 1; + pe->pe_enrelpwr = 1; + pe->pe_en_relstep_check = 0; + } else { + pe->pe_firpwr = AR5212_DFS_FIRPWR; + pe->pe_rrssi = AR5212_DFS_RRSSI; + pe->pe_height = AR5212_DFS_HEIGHT; + pe->pe_prssi = AR5212_DFS_PRSSI; + pe->pe_inband = AR5212_DFS_INBAND; + pe->pe_relpwr = 0; + pe->pe_relstep = 0; + pe->pe_maxlen = 0; + pe->pe_usefir128 = 0; + pe->pe_blockradar = 0; + pe->pe_enmaxrssi = 0; + pe->pe_enrelpwr = 0; + pe->pe_en_relstep_check = 0; + } return (AH_TRUE); } @@ -1216,7 +1318,26 @@ ar5212GetDfsThresh(struct ath_hal *ah, H pe->pe_relpwr = 0; pe->pe_relstep = 0; pe->pe_maxlen = 0; + pe->pe_usefir128 = 0; + pe->pe_blockradar = 0; + pe->pe_enmaxrssi = 0; + pe->pe_enrelpwr = 0; + pe->pe_en_relstep_check = 0; pe->pe_extchannel = AH_FALSE; + + if (IS_5413(ah)) { + val = OS_REG_READ(ah, AR_PHY_RADAR_2); + pe->pe_relpwr = !! MS(val, AR_PHY_RADAR_2_RELPWR); + pe->pe_relstep = !! MS(val, AR_PHY_RADAR_2_RELSTEP); + pe->pe_maxlen = !! MS(val, AR_PHY_RADAR_2_MAXLEN); + + pe->pe_usefir128 = !! (val & AR_PHY_RADAR_2_USEFIR128); + pe->pe_blockradar = !! (val & AR_PHY_RADAR_2_BLOCKOFDMWEAK); + pe->pe_enmaxrssi = !! (val & AR_PHY_RADAR_2_ENMAXRSSI); + pe->pe_enrelpwr = !! (val & AR_PHY_RADAR_2_ENRELPWRCHK); + pe->pe_en_relstep_check = + !! (val & AR_PHY_RADAR_2_ENRELSTEPCHK); + } } /* Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Wed Aug 29 03:50:59 2012 (r239800) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Wed Aug 29 03:58:13 2012 (r239801) @@ -221,6 +221,19 @@ #define AR_PHY_RADAR_0_FIRPWR 0x7F000000 /* Radar firpwr threshold */ #define AR_PHY_RADAR_0_FIRPWR_S 24 +/* ar5413 specific */ +#define AR_PHY_RADAR_2 0x9958 /* radar detection settings */ +#define AR_PHY_RADAR_2_ENRELSTEPCHK 0x00002000 /* Enable using max rssi */ +#define AR_PHY_RADAR_2_ENMAXRSSI 0x00004000 /* Enable using max rssi */ +#define AR_PHY_RADAR_2_BLOCKOFDMWEAK 0x00008000 /* En block OFDM weak sig as radar */ +#define AR_PHY_RADAR_2_USEFIR128 0x00400000 /* En measuring pwr over 128 cycles */ +#define AR_PHY_RADAR_2_ENRELPWRCHK 0x00800000 /* Enable using max rssi */ +#define AR_PHY_RADAR_2_MAXLEN 0x000000FF /* Max Pulse duration threshold */ +#define AR_PHY_RADAR_2_MAXLEN_S 0 +#define AR_PHY_RADAR_2_RELSTEP 0x00001F00 /* Pulse relative step threshold */ +#define AR_PHY_RADAR_2_RELSTEP_S 8 +#define AR_PHY_RADAR_2_RELPWR 0x003F0000 /* pulse relative power threshold */ +#define AR_PHY_RADAR_2_RELPWR_S 16 #define AR_PHY_SIGMA_DELTA 0x996C /* AR5312 only */ #define AR_PHY_SIGMA_DELTA_ADC_SEL 0x00000003 From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 04:09:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3BC21065674; Wed, 29 Aug 2012 04:09:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF17C8FC1F; Wed, 29 Aug 2012 04:09:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T49sC1080008; Wed, 29 Aug 2012 04:09:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T49s4V080006; Wed, 29 Aug 2012 04:09:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290409.q7T49s4V080006@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 04:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239802 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 04:09:55 -0000 Author: adrian Date: Wed Aug 29 04:09:54 2012 New Revision: 239802 URL: http://svn.freebsd.org/changeset/base/239802 Log: Add a new capability bit - whether the hardware supports AR9285 style combined diversity. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 03:58:13 2012 (r239801) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 04:09:54 2012 (r239802) @@ -234,7 +234,8 @@ typedef struct { uint32_t halIsrRacSupport : 1, halApmEnable : 1, halIntrMitigation : 1, - hal49GhzSupport : 1; + hal49GhzSupport : 1, + halAntDivCombSupport : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 04:11:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD63E1065678; Wed, 29 Aug 2012 04:11:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A781F8FC1A; Wed, 29 Aug 2012 04:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T4B0gp080189; Wed, 29 Aug 2012 04:11:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T4B0bM080187; Wed, 29 Aug 2012 04:11:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290411.q7T4B0bM080187@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 04:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239803 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 04:11:00 -0000 Author: adrian Date: Wed Aug 29 04:11:00 2012 New Revision: 239803 URL: http://svn.freebsd.org/changeset/base/239803 Log: Set the HAL combined antenna diversity capability if the AR9285 EEPROM settings allow it. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 29 04:09:54 2012 (r239802) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 29 04:11:00 2012 (r239803) @@ -504,6 +504,9 @@ ar9285FillCapabilityInfo(struct ath_hal pCap->halTxStreams = 1; pCap->halRxStreams = 1; + if (ar9285_check_div_comb(ah)) + pCap->halAntDivCombSupport = AH_TRUE; + pCap->halCSTSupport = AH_TRUE; pCap->halRifsRxSupport = AH_TRUE; pCap->halRifsTxSupport = AH_TRUE; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 04:41:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADF1D106566B; Wed, 29 Aug 2012 04:41:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98FF58FC08; Wed, 29 Aug 2012 04:41:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T4fPTA083964; Wed, 29 Aug 2012 04:41:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T4fPVX083962; Wed, 29 Aug 2012 04:41:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208290441.q7T4fPVX083962@svn.freebsd.org> From: Warner Losh Date: Wed, 29 Aug 2012 04:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239804 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 04:41:25 -0000 Author: imp Date: Wed Aug 29 04:41:25 2012 New Revision: 239804 URL: http://svn.freebsd.org/changeset/base/239804 Log: When copying data, use memcpy instead of bcopy. It matches the arguments better. Also, set the need to use the workaround flag before we actually need to use it, rather than after. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Aug 29 04:11:00 2012 (r239803) +++ head/sys/arm/at91/at91_mci.c Wed Aug 29 04:41:25 2012 (r239804) @@ -211,7 +211,7 @@ at91_bswap_buf(struct at91_mci_softc *sc * ansley.com) */ if (!(sc->sc_cap & CAP_NEEDS_BYTESWAP)) { - bcopy(dptr, sptr, memsize); + memcpy(dptr, sptr, memsize); return; } @@ -364,6 +364,12 @@ at91_mci_attach(device_t dev) sc->sc_cap = 0; if (at91_is_rm92()) sc->sc_cap |= CAP_NEEDS_BYTESWAP; + /* + * MCI1 Rev 2 controllers need some workarounds, flag if so. + */ + if (at91_mci_is_mci1rev2xx()) + sc->sc_cap |= CAP_MCI1_REV2XX; + err = at91_mci_activate(dev); if (err) goto out; @@ -409,12 +415,6 @@ at91_mci_attach(device_t dev) } /* - * MCI1 Rev 2 controllers need some workarounds, flag if so. - */ - if (at91_mci_is_mci1rev2xx()) - sc->sc_cap |= CAP_MCI1_REV2XX; - - /* * Allow 4-wire to be initially set via #define. * Allow a device hint to override that. * Allow a sysctl to override that. From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 06:42:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22695106566C; Wed, 29 Aug 2012 06:42:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D5A68FC14; Wed, 29 Aug 2012 06:42:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T6gd5C098834; Wed, 29 Aug 2012 06:42:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T6gdmK098832; Wed, 29 Aug 2012 06:42:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208290642.q7T6gdmK098832@svn.freebsd.org> From: Warner Losh Date: Wed, 29 Aug 2012 06:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239805 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 06:42:40 -0000 Author: imp Date: Wed Aug 29 06:42:39 2012 New Revision: 239805 URL: http://svn.freebsd.org/changeset/base/239805 Log: Make this work on the AT91SAM9G20: o Disable multi-block operations: they sometimes fail. o Don't use the PROOF bits yet: they hang the system hard. o Disable the the multi-block operations for !rm9200, but it still doesn't help. o Fix writing < 12 bytes errata to actually work. o Enable, for the moment, reporting extra bytes soaked up. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Aug 29 04:41:25 2012 (r239804) +++ head/sys/arm/at91/at91_mci.c Wed Aug 29 06:42:39 2012 (r239805) @@ -309,8 +309,8 @@ at91_mci_init(device_t dev) WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); val = MCI_MR_PDCMODE; val |= 0x34a; /* PWSDIV = 3; CLKDIV = 74 */ - if (sc->sc_cap & CAP_MCI1_REV2XX) - val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; +// if (sc->sc_cap & CAP_MCI1_REV2XX) +// val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; WR4(sc, MCI_MR, val); #ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ @@ -778,9 +778,9 @@ at91_mci_start_cmd(struct at91_mci_softc * a work-around for the "Data Write Operation and * number of bytes" erratum. */ - if ((sc->sc_cap & CAP_MCI1_REV2XX) && data->len < 12) { + if ((sc->sc_cap & CAP_MCI1_REV2XX) && len < 12) { len = 12; - memset(data->data, 0, 12); + memset(sc->bbuf_vaddr[0], 0, 12); } at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], @@ -1034,8 +1034,11 @@ at91_mci_stop_done(struct at91_mci_softc * * After doing the reset, wait for a NOTBUSY interrupt before * continuing with the next operation. + * + * This workaround breaks multiwrite on the rev2xx parts, but some other + * workaround is needed. */ - if (sc->flags & CMD_MULTIWRITE) { + if ((sc->flags & CMD_MULTIWRITE) && (sc->sc_cap & CAP_NEEDS_BYTESWAP)) { at91_mci_reset(sc); WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); return; @@ -1051,8 +1054,10 @@ at91_mci_stop_done(struct at91_mci_softc * additional words of data get buffered up in some unmentioned * internal fifo and if we don't read and discard them here they end * up on the front of the next read DMA transfer we do. + * + * This appears to be unnecessary for rev2xx parts. */ - if (sc->flags & CMD_MULTIREAD) { + if ((sc->flags & CMD_MULTIREAD) && (sc->sc_cap & CAP_NEEDS_BYTESWAP)) { uint32_t sr; int count = 0; @@ -1064,8 +1069,8 @@ at91_mci_stop_done(struct at91_mci_softc } } while (sr & MCI_SR_RXRDY); at91_mci_reset(sc); -// if (count != 0) -// printf("Had to soak up %d words after read\n", count); + if (count != 0) + printf("Had to soak up %d words after read\n", count); } cmd->error = MMC_ERR_NONE; @@ -1306,7 +1311,15 @@ at91_mci_read_ivar(device_t bus, device_ *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = MAX_BLOCKS; + /* + * Something is wrong with the 2x parts and multiblock, so + * just do 1 block at a time for now, which really kills + * performance. + */ + if (sc->sc_cap & CAP_MCI1_REV2XX) + *(int *)result = 1; + else + *(int *)result = MAX_BLOCKS; break; } return (0); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 06:43:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6127A106566C; Wed, 29 Aug 2012 06:43:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331C38FC21; Wed, 29 Aug 2012 06:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T6hT9D098958; Wed, 29 Aug 2012 06:43:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T6hTI5098956; Wed, 29 Aug 2012 06:43:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208290643.q7T6hTI5098956@svn.freebsd.org> From: Warner Losh Date: Wed, 29 Aug 2012 06:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239806 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 06:43:29 -0000 Author: imp Date: Wed Aug 29 06:43:28 2012 New Revision: 239806 URL: http://svn.freebsd.org/changeset/base/239806 Log: 4-wire mode isn't working quite right, so turn it off for a bit. Modified: head/sys/arm/conf/SAM9G20EK Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Wed Aug 29 06:42:39 2012 (r239805) +++ head/sys/arm/conf/SAM9G20EK Wed Aug 29 06:43:28 2012 (r239806) @@ -105,7 +105,7 @@ device at91_mci device mmc device mmcsd option AT91_MCI_SLOT_B -option AT91_MCI_HAS_4WIRE +#option AT91_MCI_HAS_4WIRE # iic device iic From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:14:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2D44106567C; Wed, 29 Aug 2012 08:14:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D69BA8FC23; Wed, 29 Aug 2012 08:14:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8EGh8010207; Wed, 29 Aug 2012 08:14:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8EGFX010205; Wed, 29 Aug 2012 08:14:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290814.q7T8EGFX010205@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239807 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:14:17 -0000 Author: avg Date: Wed Aug 29 08:14:16 2012 New Revision: 239807 URL: http://svn.freebsd.org/changeset/base/239807 Log: MFC r238418: acpi_cpu: separate a notion of current deepest allowed+available Cx level from a user-set persistent limit on the said level Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 06:43:28 2012 (r239806) +++ stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:14:16 2012 (r239807) @@ -89,6 +89,7 @@ struct acpi_cpu_softc { struct sysctl_ctx_list cpu_sysctl_ctx; struct sysctl_oid *cpu_sysctl_tree; int cpu_cx_lowest; + int cpu_cx_lowest_lim; char cpu_cx_supported[64]; int cpu_rid; }; @@ -138,13 +139,12 @@ static int cpu_quirks; /* Indicate any /* Runtime state. */ static int cpu_disable_idle; /* Disable entry to idle function */ -static int cpu_cx_count; /* Number of valid Cx states */ /* Values for sysctl. */ static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; static int cpu_cx_generic; -static int cpu_cx_lowest; +static int cpu_cx_lowest_lim; static device_t *cpu_devices; static int cpu_ndevices; @@ -173,7 +173,7 @@ static void acpi_cpu_idle(void); static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(void); static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS); -static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val); +static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); static int acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); @@ -590,6 +590,7 @@ acpi_cpu_cx_probe(struct acpi_cpu_softc /* Use initial sleep value of 1 sec. to start with lowest idle state. */ sc->cpu_prev_sleep = 1000000; sc->cpu_cx_lowest = 0; + sc->cpu_cx_lowest_lim = 0; /* * Check for the ACPI 2.0 _CST sleep states object. If we can't find @@ -816,7 +817,6 @@ acpi_cpu_startup(void *arg) */ acpi_cpu_quirks(); - cpu_cx_count = 0; if (cpu_cx_generic) { /* * We are using generic Cx mode, probe for available Cx states @@ -825,24 +825,10 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); acpi_cpu_generic_cx_probe(sc); - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; - } - - /* - * Find the highest Cx state common to all CPUs - * in the system, taking quirks into account. - */ - for (i = 0; i < cpu_ndevices; i++) { - sc = device_get_softc(cpu_devices[i]); - if (sc->cpu_cx_count < cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; } } else { /* * We are using _CST mode, remove C3 state if necessary. - * Update the largest Cx state supported in the global cpu_cx_count. - * It will be used in the global Cx sysctl handler. * As we now know for sure that we will be using _CST mode * install our notify handler. */ @@ -851,8 +837,6 @@ acpi_cpu_startup(void *arg) if (cpu_quirks & CPU_QUIRK_NO_C3) { sc->cpu_cx_count = sc->cpu_non_c3 + 1; } - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY, acpi_cpu_notify, sc); } @@ -871,7 +855,7 @@ acpi_cpu_startup(void *arg) "Global lowest Cx sleep state to use"); /* Take over idling from cpu_idle_default(). */ - cpu_cx_lowest = 0; + cpu_cx_lowest_lim = 0; cpu_disable_idle = FALSE; cpu_idle_hook = acpi_cpu_idle; } @@ -1062,8 +1046,6 @@ static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context; - struct acpi_cpu_softc *isc; - int i; if (notify != ACPI_NOTIFY_CX_STATES) return; @@ -1072,16 +1054,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no acpi_cpu_cx_cst(sc); acpi_cpu_cx_list(sc); - /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); - cpu_cx_count = 0; - for (i = 0; i < cpu_ndevices; i++) { - isc = device_get_softc(cpu_devices[i]); - if (isc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = isc->cpu_cx_count; - } - if (sc->cpu_cx_lowest < cpu_cx_lowest) - acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); } @@ -1209,12 +1183,12 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG } static int -acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val) +acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc) { int i; ACPI_SERIAL_ASSERT(cpu); - sc->cpu_cx_lowest = val; + sc->cpu_cx_lowest = min(sc->cpu_cx_lowest_lim, sc->cpu_cx_count - 1); /* If not disabling, cache the new lowest non-C3 state. */ sc->cpu_non_c3 = 0; @@ -1238,18 +1212,23 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER int val, error; sc = (struct acpi_cpu_softc *) arg1; - snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > sc->cpu_cx_count - 1) - return (EINVAL); + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } ACPI_SERIAL_BEGIN(cpu); - acpi_cpu_set_cx_lowest(sc, val); + sc->cpu_cx_lowest_lim = val - 1; + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); return (0); @@ -1262,22 +1241,27 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ char state[8]; int val, error, i; - snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > cpu_cx_count - 1) - return (EINVAL); - cpu_cx_lowest = val; + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); + cpu_cx_lowest_lim = val - 1; for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); + sc->cpu_cx_lowest_lim = cpu_cx_lowest_lim; + acpi_cpu_set_cx_lowest(sc); } ACPI_SERIAL_END(cpu); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:34:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DADF106564A; Wed, 29 Aug 2012 08:34:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 271C18FC0A; Wed, 29 Aug 2012 08:34:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8YHxZ012653; Wed, 29 Aug 2012 08:34:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8YGFl012651; Wed, 29 Aug 2012 08:34:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290834.q7T8YGFl012651@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239808 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:34:17 -0000 Author: avg Date: Wed Aug 29 08:34:16 2012 New Revision: 239808 URL: http://svn.freebsd.org/changeset/base/239808 Log: MFC r238418: acpi_cpu: separate a notion of current deepest allowed+available Cx level from a user-set persistent limit on the said level Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:14:16 2012 (r239807) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:34:16 2012 (r239808) @@ -86,6 +86,7 @@ struct acpi_cpu_softc { struct sysctl_ctx_list cpu_sysctl_ctx; struct sysctl_oid *cpu_sysctl_tree; int cpu_cx_lowest; + int cpu_cx_lowest_lim; char cpu_cx_supported[64]; int cpu_rid; }; @@ -135,13 +136,12 @@ static int cpu_quirks; /* Indicate any /* Runtime state. */ static int cpu_disable_idle; /* Disable entry to idle function */ -static int cpu_cx_count; /* Number of valid Cx states */ /* Values for sysctl. */ static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; static int cpu_cx_generic; -static int cpu_cx_lowest; +static int cpu_cx_lowest_lim; static device_t *cpu_devices; static int cpu_ndevices; @@ -170,7 +170,7 @@ static void acpi_cpu_idle(void); static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(void); static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS); -static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val); +static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); static int acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); @@ -579,6 +579,7 @@ acpi_cpu_cx_probe(struct acpi_cpu_softc /* Use initial sleep value of 1 sec. to start with lowest idle state. */ sc->cpu_prev_sleep = 1000000; sc->cpu_cx_lowest = 0; + sc->cpu_cx_lowest_lim = 0; /* * Check for the ACPI 2.0 _CST sleep states object. If we can't find @@ -783,7 +784,6 @@ acpi_cpu_startup(void *arg) */ acpi_cpu_quirks(); - cpu_cx_count = 0; if (cpu_cx_generic) { /* * We are using generic Cx mode, probe for available Cx states @@ -792,24 +792,10 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); acpi_cpu_generic_cx_probe(sc); - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; - } - - /* - * Find the highest Cx state common to all CPUs - * in the system, taking quirks into account. - */ - for (i = 0; i < cpu_ndevices; i++) { - sc = device_get_softc(cpu_devices[i]); - if (sc->cpu_cx_count < cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; } } else { /* * We are using _CST mode, remove C3 state if necessary. - * Update the largest Cx state supported in the global cpu_cx_count. - * It will be used in the global Cx sysctl handler. * As we now know for sure that we will be using _CST mode * install our notify handler. */ @@ -818,8 +804,6 @@ acpi_cpu_startup(void *arg) if (cpu_quirks & CPU_QUIRK_NO_C3) { sc->cpu_cx_count = sc->cpu_non_c3 + 1; } - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY, acpi_cpu_notify, sc); } @@ -838,7 +822,7 @@ acpi_cpu_startup(void *arg) "Global lowest Cx sleep state to use"); /* Take over idling from cpu_idle_default(). */ - cpu_cx_lowest = 0; + cpu_cx_lowest_lim = 0; cpu_disable_idle = FALSE; cpu_idle_hook = acpi_cpu_idle; } @@ -1021,8 +1005,6 @@ static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context; - struct acpi_cpu_softc *isc; - int i; if (notify != ACPI_NOTIFY_CX_STATES) return; @@ -1031,16 +1013,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no acpi_cpu_cx_cst(sc); acpi_cpu_cx_list(sc); - /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); - cpu_cx_count = 0; - for (i = 0; i < cpu_ndevices; i++) { - isc = device_get_softc(cpu_devices[i]); - if (isc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = isc->cpu_cx_count; - } - if (sc->cpu_cx_lowest < cpu_cx_lowest) - acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); } @@ -1168,12 +1142,12 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG } static int -acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val) +acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc) { int i; ACPI_SERIAL_ASSERT(cpu); - sc->cpu_cx_lowest = val; + sc->cpu_cx_lowest = min(sc->cpu_cx_lowest_lim, sc->cpu_cx_count - 1); /* If not disabling, cache the new lowest non-C3 state. */ sc->cpu_non_c3 = 0; @@ -1197,18 +1171,23 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER int val, error; sc = (struct acpi_cpu_softc *) arg1; - snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > sc->cpu_cx_count - 1) - return (EINVAL); + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } ACPI_SERIAL_BEGIN(cpu); - acpi_cpu_set_cx_lowest(sc, val); + sc->cpu_cx_lowest_lim = val - 1; + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); return (0); @@ -1221,22 +1200,27 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ char state[8]; int val, error, i; - snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > cpu_cx_count - 1) - return (EINVAL); - cpu_cx_lowest = val; + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); + cpu_cx_lowest_lim = val - 1; for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); + sc->cpu_cx_lowest_lim = cpu_cx_lowest_lim; + acpi_cpu_set_cx_lowest(sc); } ACPI_SERIAL_END(cpu); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:39:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F5BF106568D; Wed, 29 Aug 2012 08:39:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AAD98FC0C; Wed, 29 Aug 2012 08:39:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8dxms013455; Wed, 29 Aug 2012 08:39:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8dxhY013452; Wed, 29 Aug 2012 08:39:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290839.q7T8dxhY013452@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239809 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:39:59 -0000 Author: avg Date: Wed Aug 29 08:39:58 2012 New Revision: 239809 URL: http://svn.freebsd.org/changeset/base/239809 Log: MFC r238192: acpi_cpu_cx_cst: consistently use cpu_cx_count during state enumeration Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:34:16 2012 (r239808) +++ stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:39:58 2012 (r239809) @@ -747,13 +747,13 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* This is the first C1 state. Use the reserved slot. */ sc->cpu_cx_states[0] = *cx_ptr; } else { - sc->cpu_non_c3 = i; + sc->cpu_non_c3 = sc->cpu_cx_count; cx_ptr++; sc->cpu_cx_count++; } continue; case ACPI_STATE_C2: - sc->cpu_non_c3 = i; + sc->cpu_non_c3 = sc->cpu_cx_count; break; case ACPI_STATE_C3: default: From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:44:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ADB2106566C; Wed, 29 Aug 2012 08:44:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5208FC16; Wed, 29 Aug 2012 08:44:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8iMiO014078; Wed, 29 Aug 2012 08:44:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8iLHk014076; Wed, 29 Aug 2012 08:44:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290844.q7T8iLHk014076@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239810 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:44:22 -0000 Author: avg Date: Wed Aug 29 08:44:21 2012 New Revision: 239810 URL: http://svn.freebsd.org/changeset/base/239810 Log: MFC r215188: Create C1 state when _CST is valid but _CST does not have one. On behalf of: jkim Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:39:58 2012 (r239809) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:44:21 2012 (r239810) @@ -705,9 +705,19 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s count = MAX_CX_STATES; } - /* Set up all valid states. */ + sc->cpu_non_c3 = 0; sc->cpu_cx_count = 0; cx_ptr = sc->cpu_cx_states; + + /* + * C1 has been required since just after ACPI 1.0. + * Reserve the first slot for it. + */ + cx_ptr->type = ACPI_STATE_C0; + cx_ptr++; + sc->cpu_cx_count++; + + /* Set up all valid states. */ for (i = 0; i < count; i++) { pkg = &top->Package.Elements[i + 1]; if (!ACPI_PKG_VALID(pkg, 4) || @@ -722,9 +732,14 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* Validate the state to see if we should use it. */ switch (cx_ptr->type) { case ACPI_STATE_C1: - sc->cpu_non_c3 = i; - cx_ptr++; - sc->cpu_cx_count++; + if (sc->cpu_cx_states[0].type == ACPI_STATE_C0) { + /* This is the first C1 state. Use the reserved slot. */ + sc->cpu_cx_states[0] = *cx_ptr; + } else { + sc->cpu_non_c3 = i; + cx_ptr++; + sc->cpu_cx_count++; + } continue; case ACPI_STATE_C2: sc->cpu_non_c3 = i; @@ -763,6 +778,13 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s } AcpiOsFree(buf.Pointer); + /* If C1 state was not found, we need one now. */ + cx_ptr = sc->cpu_cx_states; + if (cx_ptr->type == ACPI_STATE_C0) { + cx_ptr->type = ACPI_STATE_C1; + cx_ptr->trans_lat = 0; + } + return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:46:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E59F5106566B; Wed, 29 Aug 2012 08:46:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D09198FC25; Wed, 29 Aug 2012 08:46:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8k4Fe014342; Wed, 29 Aug 2012 08:46:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8k4JL014340; Wed, 29 Aug 2012 08:46:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290846.q7T8k4JL014340@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239811 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:46:05 -0000 Author: avg Date: Wed Aug 29 08:46:04 2012 New Revision: 239811 URL: http://svn.freebsd.org/changeset/base/239811 Log: MFC r238192: acpi_cpu_cx_cst: consistently use cpu_cx_count during state enumeration Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:44:21 2012 (r239810) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:46:04 2012 (r239811) @@ -736,13 +736,13 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* This is the first C1 state. Use the reserved slot. */ sc->cpu_cx_states[0] = *cx_ptr; } else { - sc->cpu_non_c3 = i; + sc->cpu_non_c3 = sc->cpu_cx_count; cx_ptr++; sc->cpu_cx_count++; } continue; case ACPI_STATE_C2: - sc->cpu_non_c3 = i; + sc->cpu_non_c3 = sc->cpu_cx_count; break; case ACPI_STATE_C3: default: From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:47:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 393FB1065674; Wed, 29 Aug 2012 08:47:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4768FC1D; Wed, 29 Aug 2012 08:47:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8lhsv014580; Wed, 29 Aug 2012 08:47:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8lh3U014577; Wed, 29 Aug 2012 08:47:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290847.q7T8lh3U014577@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239812 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:47:44 -0000 Author: avg Date: Wed Aug 29 08:47:43 2012 New Revision: 239812 URL: http://svn.freebsd.org/changeset/base/239812 Log: MFC r238193: acpi_cpu_cx_list: there is no need to re-evaluate cpu_non_c3 here Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:46:04 2012 (r239811) +++ stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:47:43 2012 (r239812) @@ -671,6 +671,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->trans_lat = AcpiGbl_FADT.C3Latency; cx_ptr++; sc->cpu_cx_count++; + cpu_can_deep_sleep = 1; } } } @@ -762,7 +763,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s "acpi_cpu%d: C3[%d] not available.\n", device_get_unit(sc->cpu_dev), i)); continue; - } + } else + cpu_can_deep_sleep = 1; break; } @@ -869,16 +871,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * /* * Set up the list of Cx states */ - sc->cpu_non_c3 = 0; sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); - for (i = 0; i < sc->cpu_cx_count; i++) { + for (i = 0; i < sc->cpu_cx_count; i++) sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); - if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) - sc->cpu_non_c3 = i; - else - cpu_can_deep_sleep = 1; - } sbuf_trim(&sb); sbuf_finish(&sb); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:58:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95A471065670; Wed, 29 Aug 2012 08:58:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 808428FC16; Wed, 29 Aug 2012 08:58:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8wBix015964; Wed, 29 Aug 2012 08:58:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8wB4X015962; Wed, 29 Aug 2012 08:58:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290858.q7T8wB4X015962@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239813 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:58:11 -0000 Author: avg Date: Wed Aug 29 08:58:10 2012 New Revision: 239813 URL: http://svn.freebsd.org/changeset/base/239813 Log: MFC r238194: acpi_cpu_generic_cx_probe: for consistency set cpu_non_c3 here too Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:47:43 2012 (r239812) +++ stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:58:10 2012 (r239813) @@ -630,6 +630,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->type = ACPI_STATE_C1; cx_ptr->trans_lat = 0; cx_ptr++; + sc->cpu_non_c3 = sc->cpu_cx_count; sc->cpu_cx_count++; /* @@ -654,6 +655,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->type = ACPI_STATE_C2; cx_ptr->trans_lat = AcpiGbl_FADT.C2Latency; cx_ptr++; + sc->cpu_non_c3 = sc->cpu_cx_count; sc->cpu_cx_count++; } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 08:59:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E1D0106566C; Wed, 29 Aug 2012 08:59:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8985A8FC1D; Wed, 29 Aug 2012 08:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T8x2So016093; Wed, 29 Aug 2012 08:59:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8x2Sd016091; Wed, 29 Aug 2012 08:59:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290859.q7T8x2Sd016091@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239814 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 08:59:02 -0000 Author: avg Date: Wed Aug 29 08:59:02 2012 New Revision: 239814 URL: http://svn.freebsd.org/changeset/base/239814 Log: MFC r238194: acpi_cpu_generic_cx_probe: for consistency set cpu_non_c3 here too Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:58:10 2012 (r239813) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:59:02 2012 (r239814) @@ -619,6 +619,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->type = ACPI_STATE_C1; cx_ptr->trans_lat = 0; cx_ptr++; + sc->cpu_non_c3 = sc->cpu_cx_count; sc->cpu_cx_count++; /* @@ -643,6 +644,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->type = ACPI_STATE_C2; cx_ptr->trans_lat = AcpiGbl_FADT.C2Latency; cx_ptr++; + sc->cpu_non_c3 = sc->cpu_cx_count; sc->cpu_cx_count++; } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 09:00:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D4591065674; Wed, 29 Aug 2012 09:00:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C58C8FC12; Wed, 29 Aug 2012 09:00:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T90wUJ016420; Wed, 29 Aug 2012 09:00:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T90vcV016418; Wed, 29 Aug 2012 09:00:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290900.q7T90vcV016418@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 09:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239815 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 09:00:58 -0000 Author: avg Date: Wed Aug 29 09:00:57 2012 New Revision: 239815 URL: http://svn.freebsd.org/changeset/base/239815 Log: MFC r238229: acpi_cpu: we are able to handle _CST change notifications Modified: stable/9/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:59:02 2012 (r239814) +++ stable/9/sys/dev/acpica/acpi_cpu.c Wed Aug 29 09:00:57 2012 (r239815) @@ -902,14 +902,12 @@ acpi_cpu_startup_cx(struct acpi_cpu_soft (void *)sc, 0, acpi_cpu_usage_sysctl, "A", "percent usage for each Cx state"); -#ifdef notyet /* Signal platform that we can handle _CST notification. */ if (!cpu_cx_generic && cpu_cst_cnt != 0) { ACPI_LOCK(acpi); AcpiOsWritePort(cpu_smi_cmd, cpu_cst_cnt, 8); ACPI_UNLOCK(acpi); } -#endif } /* From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 09:02:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490EF106566C; Wed, 29 Aug 2012 09:02:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33D168FC15; Wed, 29 Aug 2012 09:02:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T923BV016602; Wed, 29 Aug 2012 09:02:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T923BI016600; Wed, 29 Aug 2012 09:02:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290902.q7T923BI016600@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 09:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239816 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 09:02:03 -0000 Author: avg Date: Wed Aug 29 09:02:02 2012 New Revision: 239816 URL: http://svn.freebsd.org/changeset/base/239816 Log: MFC r238229: acpi_cpu: we are able to handle _CST change notifications Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 09:00:57 2012 (r239815) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 09:02:02 2012 (r239816) @@ -893,14 +893,12 @@ acpi_cpu_startup_cx(struct acpi_cpu_soft (void *)sc, 0, acpi_cpu_usage_sysctl, "A", "percent usage for each Cx state"); -#ifdef notyet /* Signal platform that we can handle _CST notification. */ if (!cpu_cx_generic && cpu_cst_cnt != 0) { ACPI_LOCK(acpi); AcpiOsWritePort(cpu_smi_cmd, cpu_cst_cnt, 8); ACPI_UNLOCK(acpi); } -#endif } /* From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 09:37:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A8051065708; Wed, 29 Aug 2012 09:37:01 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 077C28FC1B; Wed, 29 Aug 2012 09:37:00 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 69B8E6771; Wed, 29 Aug 2012 11:36:54 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 3A2158253; Wed, 29 Aug 2012 11:36:54 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: obrien@freebsd.org References: <201208271322.q7RDMSEw002945@svn.freebsd.org> <20120828181607.GA56329@dragon.NUXI.org> Date: Wed, 29 Aug 2012 11:36:53 +0200 In-Reply-To: <20120828181607.GA56329@dragon.NUXI.org> (David O'Brien's message of "Tue, 28 Aug 2012 11:16:08 -0700") Message-ID: <86y5ky11l6.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239730 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 09:37:01 -0000 David O'Brien writes: > The comment below says to me the target swap size is 16GB, not 8GB. The target is 8 assuming 50% waste. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 11:23:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B88A106566C; Wed, 29 Aug 2012 11:23:21 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13F818FC14; Wed, 29 Aug 2012 11:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TBNLtZ035355; Wed, 29 Aug 2012 11:23:21 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TBNK6G035350; Wed, 29 Aug 2012 11:23:20 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208291123.q7TBNK6G035350@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 29 Aug 2012 11:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239817 - in stable/9: share/man/man4 share/syscons/keymaps sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 11:23:21 -0000 Author: gavin Date: Wed Aug 29 11:23:20 2012 New Revision: 239817 URL: http://svn.freebsd.org/changeset/base/239817 Log: Merge r238803, r238804 from head: Add support for more devices to uslcom(4). This commit syncronises the list of supported devices with the union of: NetBSD src/sys/dev/usb/uslsa.c 1.18 OpenBSD src/sys/dev/usb/uslcom.c 1.24 Linux source/drivers/usb/serial/cp210x.c HEAD Remove duplicate JABLOTRON PC60B entry. Note that some of the devices added here are multi-port devices. The uslcom(4) driver currently only supports the first port on such devices. Update the man page to reflect the full list of supported devices. Remove two caveats from the CAVEATS section, as both listed caveats no longer apply. Add a caveat about multi-port devices. Improve descriptions for several devices supported by uslcom(4). Correct the spelling of the company Telegesis. Move MpMan to the correct location alphabetically. Replaced: stable/9/share/syscons/keymaps/spanish.dvorak.kbd - copied unchanged from r235251, head/share/syscons/keymaps/spanish.dvorak.kbd Modified: stable/9/share/man/man4/uslcom.4 stable/9/sys/dev/usb/serial/uslcom.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/uslcom.4 ============================================================================== --- stable/9/share/man/man4/uslcom.4 Wed Aug 29 09:02:02 2012 (r239816) +++ stable/9/share/man/man4/uslcom.4 Wed Aug 29 11:23:20 2012 (r239817) @@ -16,12 +16,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2007 +.Dd July 26, 2012 .Dt USLCOM 4 .Os .Sh NAME .Nm uslcom -.Nd Silicon Laboratories CP2101/CP2102 based USB serial adapter +.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104 based USB serial adapter .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -39,7 +39,8 @@ uslcom_load="YES" .Sh DESCRIPTION The .Nm -driver supports Silicon Laboratories CP2101/CP2102 based USB serial adapters. +driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104 +based USB serial adapters. .Sh HARDWARE The following devices should work with the .Nm @@ -47,29 +48,147 @@ driver: .Pp .Bl -bullet -compact .It +AC-Services CAN, CIS-IBUS, IBUS and OBD interfaces +.It +Aerocomm Radio +.It +AKTACOM ACE-1001 cable +.It +AMBER Wireless AMB2560 +.It +Arkham DS-101 Adapter +.It Argussoft ISP .It +Arygon Technologies Mifare RFID Reader +.It +AVIT Research USB-TTL interface +.It +B&G H3000 Data Cable +.It +Balluff RFID reader +.It Baltech card reader .It +BEI USB VCP Sensor +.It Burnside Telecom Desktop Mobile .It chip45.com Crumb128 module .It +Clipsal 5000CT2, 5500PACA, 5500PCU, 560884, 5800PC, C5000CT2 +and L51xx C-Bus Home Automation products +.It +Commander 2 EDGE(GSM) Modem +.It +Cygnal Fasttrax GPS and Debug adapter +.It +DataApex MultiCOM USB to RS232 converter +.It +Degree Controls USB adapter +.It +DekTec DTA Plus VHF/UHF Booster +.It +Dell DW700 GPS Receiver +.It +Digianswer ZigBee/802.15.4 MAC +.It +Dynastream ANT Development kits +.It +Elan USBcount50, USBscope50, USBpulse100 and USBwave12 +.It +ELV USB-I2C interface +.It +EMS C1007 HF RFID controller +.It +Festo CPX-USB and CMSP interfaces +.It +Gemalto Prox-PU/CU contactless card reader +.It +Helicomm IP-Link 1220-DVM +.It +IMS USB-RS422 adapter +.It +Infinity GPS-MIC-1 Radio Monophone +.It +INSYS Modem +.It +IRZ SG-10 and MC35pu GSM/GPRS Modems +.It Jablotron PC-60B .It -Lipowsky Baby-JTAG +Kamstrup M-Bus Master MultiPort 250D +and Optical Eye/3 wire utility meter interfaces .It -Lipowsky Baby-LIN +Kyocera GPS .It -Lipowsky HARP-1 +Link Instruments MS-019 and MS-028 +Oscilloscope/Logic Analyzer/Pattern Generators +.It +Lipowsky Baby-JTAG, Baby-LIN and HARP-1 +.It +MEI CashFlow SC and Series 2000 cash acceptors +.It +MJS USB-TOSLINK Adapter +.It +MobiData GPRS USB Modems +.It +MSD DashHawk +.It +Multiplex RC adapter +.It +Optris MSpro LT Thermometer +.It +Owen AC4 USB-RS485 converter +.It +Pirelli DP-L10 SIP phone +.It +PLX CA-42 Phone cable .It Pololu USB to Serial .It -Silicon Laboratories CP2101 +Procyon AVS Mind Machine +.It +Renesas RX-Stick for RX610 +.It +Siemens MC60 Cable +.It +Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104 chips +.It +Software Bisque Paramount ME +.It +SPORTident BSM7-D USB .It -Silicon Laboratories CP2102 +Suunto Sports Instrument +.It +Syntech CipherLab USB Barcode Scanner +.It +T-Com TC 300 SIP phone +.It +Tams Master Easy Control +.It +Telegesis ETRX2USB +.It +Timewave HamLinkUSB +.It +Tracient RFID Reader .It Track Systems Traqmate +.It +Vaisala USB Instrument cable +.It +VStabi Controller +.It +WAGO 750-923 USB Service Cable +.It +WaveSense Jazz Blood Glucose Meter +.It +WIENER Plein & Baus CML Data Logger, RCM Remote, +and PL512 and MPOD PSUs +.It +WMR RIGblaster Plug&Play and RIGtalk RT1 +.It +Zephyr Bioharness .El .Sh SEE ALSO .Xr tty 4 , @@ -90,7 +209,5 @@ The driver was written by .An Jonathan Gray Aq jsg@openbsd.org . .Sh CAVEATS -Setting hardware flow control is not currently supported. -.Pp -Silicon Laboratories do not release any programming information -on their products. +On devices with multiple ports attached to a single chip, +only the first port is currently supported. Copied: stable/9/share/syscons/keymaps/spanish.dvorak.kbd (from r235251, head/share/syscons/keymaps/spanish.dvorak.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/syscons/keymaps/spanish.dvorak.kbd Wed Aug 29 11:23:20 2012 (r239817, copy of r235251, head/share/syscons/keymaps/spanish.dvorak.kbd) @@ -0,0 +1,139 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '|' '!' nop nop O + 003 '2' '"' nop nop '@' '"' nop nop O + 004 '3' 183 nop nop '#' '#' nop nop O + 005 '4' '$' nop nop '~' '~' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '&' nop nop 172 172 nop nop O + 008 '7' '/' nop nop '7' '/' nop nop O + 009 '8' '(' nop nop '8' '(' nop nop O + 010 '9' ')' nop nop '9' ')' nop nop O + 011 '0' '=' nop nop '0' '=' nop nop O + 012 ''' '?' nop nop ''' '?' nop nop O + 013 161 191 nop nop 161 191 nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 '.' ':' nop nop '.' ':' nop nop O + 017 ',' ';' nop nop ',' ';' nop nop O + 018 241 209 nop nop '~' '~' nop nop O + 019 'p' 'P' dle dle 'p' 'P' dle dle C + 020 'y' 'Y' em em 'y' 'Y' em em C + 021 'f' 'F' ack ack 'f' 'F' ack ack C + 022 'g' 'G' bel bel 'g' 'G' bel bel C + 023 'c' 'C' etx etx 'c' 'C' etx etx C + 024 'h' 'H' bs bs 'h' 'H' bs bs C + 025 'l' 'L' ff ff 'l' 'L' ff ff C + 026 dgra dcir esc esc '[' '[' esc esc O + 027 '+' '*' gs gs ']' ']' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 'o' 'O' si si 243 211 si si C + 032 'e' 'E' enq enq 164 164 enq enq C + 033 'u' 'U' nak nak 250 218 nak nak C + 034 'i' 'I' ht ht 237 205 ht ht C + 035 'd' 'D' eot eot 'd' 'D' eot eot C + 036 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 037 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 038 'n' 'N' so so 'n' 'N' so so C + 039 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 040 dacu duml nop nop '{' '{' nop nop O + 041 '\' '|' fs fs '\' '|' fs fs O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 231 199 rs rs '}' '}' rs rs O + 044 '-' '_' us us '-' '_' us us O + 045 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 046 'j' 'J' nl nl 'j' 'J' nl nl C + 047 'k' 'K' vt vt 'k' 'K' vt vt C + 048 'x' 'X' can can 'x' 'X' can can C + 049 'b' 'B' stx stx 'b' 'B' stx stx C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 'w' 'W' etb etb 'w' 'W' etb etb C + 052 'v' 'V' syn syn 'v' 'V' syn syn C + 053 'z' 'Z' sub sub 'z' 'Z' sub sub C + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' nop nop '<' '>' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dacu 180 ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + ( 'o' 245 ) ( 'O' 213 ) + dmac 000 + dbre 000 + ddot 000 + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) + dsla 000 + drin 176 ( 'a' 229 ) ( 'A' 197 ) + dced 184 ( 'c' 231 ) ( 'C' 199 ) + dapo 000 + ddac 000 + dogo 000 + dcar 000 Modified: stable/9/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uslcom.c Wed Aug 29 09:02:02 2012 (r239816) +++ stable/9/sys/dev/usb/serial/uslcom.c Wed Aug 29 11:23:20 2012 (r239817) @@ -214,7 +214,13 @@ static struct ucom_callback uslcom_callb static const STRUCT_USB_HOST_ID uslcom_devs[] = { #define USLCOM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } USLCOM_DEV(BALTECH, CARDREADER), + USLCOM_DEV(CLIPSAL, 5000CT2), + USLCOM_DEV(CLIPSAL, 5500PACA), USLCOM_DEV(CLIPSAL, 5500PCU), + USLCOM_DEV(CLIPSAL, 560884), + USLCOM_DEV(CLIPSAL, 5800PC), + USLCOM_DEV(CLIPSAL, C5000CT2), + USLCOM_DEV(CLIPSAL, L51xx), USLCOM_DEV(DATAAPEX, MULTICOM), USLCOM_DEV(DELL, DW700), USLCOM_DEV(DIGIANSWER, ZIGBEE802154), @@ -222,17 +228,27 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(DYNASTREAM, ANTDEVBOARD2), USLCOM_DEV(DYNASTREAM, ANT2USB), USLCOM_DEV(ELV, USBI2C), + USLCOM_DEV(FESTO, CMSP), + USLCOM_DEV(FESTO, CPX_USB), USLCOM_DEV(FOXCONN, PIRELLI_DP_L10), USLCOM_DEV(FOXCONN, TCOM_TC_300), USLCOM_DEV(GEMALTO, PROXPU), USLCOM_DEV(JABLOTRON, PC60B), + USLCOM_DEV(KAMSTRUP, OPTICALEYE), + USLCOM_DEV(KAMSTRUP, MBUS_250D), + USLCOM_DEV(LINKINSTRUMENTS, MSO19), + USLCOM_DEV(LINKINSTRUMENTS, MSO28), + USLCOM_DEV(LINKINSTRUMENTS, MSO28_2), USLCOM_DEV(MEI, CASHFLOW_SC), USLCOM_DEV(MEI, S2000), - USLCOM_DEV(JABLOTRON, PC60B), USLCOM_DEV(OWEN, AC4), USLCOM_DEV(PHILIPS, ACE1001), USLCOM_DEV(PLX, CA42), USLCOM_DEV(RENESAS, RX610), + USLCOM_DEV(SILABS, AC_SERV_CAN), + USLCOM_DEV(SILABS, AC_SERV_CIS), + USLCOM_DEV(SILABS, AC_SERV_IBUS), + USLCOM_DEV(SILABS, AC_SERV_OBD), USLCOM_DEV(SILABS, AEROCOMM), USLCOM_DEV(SILABS, AMBER_AMB2560), USLCOM_DEV(SILABS, ARGUSISP), @@ -248,16 +264,21 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, C2_EDGE_MODEM), USLCOM_DEV(SILABS, CP2102), USLCOM_DEV(SILABS, CP210X_2), + USLCOM_DEV(SILABS, CP210X_3), + USLCOM_DEV(SILABS, CP210X_4), USLCOM_DEV(SILABS, CRUMB128), USLCOM_DEV(SILABS, CYGNAL), USLCOM_DEV(SILABS, CYGNAL_DEBUG), USLCOM_DEV(SILABS, CYGNAL_GPS), USLCOM_DEV(SILABS, DEGREE), + USLCOM_DEV(SILABS, DEKTEK_DTAPLUS), USLCOM_DEV(SILABS, EMS_C1007), + USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INSYS_MODEM), + USLCOM_DEV(SILABS, IRZ_SG10), USLCOM_DEV(SILABS, KYOCERA_GPS), USLCOM_DEV(SILABS, LIPOWSKY_HARP), USLCOM_DEV(SILABS, LIPOWSKY_JTAG), @@ -265,12 +286,14 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, MC35PU), USLCOM_DEV(SILABS, MJS_TOSLINK), USLCOM_DEV(SILABS, MSD_DASHHAWK), + USLCOM_DEV(SILABS, MULTIPLEX_RC), + USLCOM_DEV(SILABS, OPTRIS_MSPRO), USLCOM_DEV(SILABS, POLOLU), USLCOM_DEV(SILABS, PROCYON_AVS), USLCOM_DEV(SILABS, SB_PARAMOUNT_ME), USLCOM_DEV(SILABS, SUUNTO), USLCOM_DEV(SILABS, TAMSMASTER), - USLCOM_DEV(SILABS, TELEGESYS_ETRX2), + USLCOM_DEV(SILABS, TELEGESIS_ETRX2), USLCOM_DEV(SILABS, TRACIENT), USLCOM_DEV(SILABS, TRAQMATE), USLCOM_DEV(SILABS, USBCOUNT50), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Wed Aug 29 09:02:02 2012 (r239816) +++ stable/9/sys/dev/usb/usbdevs Wed Aug 29 11:23:20 2012 (r239817) @@ -656,6 +656,7 @@ vendor SENAO 0x1740 Senao vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek +vendor KAMSTRUP 0x17a8 Kamstrup A/S vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -680,6 +681,7 @@ vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies +vendor FESTO 0x1e29 Festo vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications @@ -695,6 +697,7 @@ vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ vendor PLANEX 0x2c02 Planex Communications vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd +vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. vendor AEI 0x3334 AEI vendor HANK 0x3353 Hank Connection vendor PQI 0x3538 PQI @@ -1240,7 +1243,13 @@ product CISCOLINKSYS2 RT3070 0x4001 RT30 product CISCOLINKSYS3 RT3070 0x0101 RT3070 /* Clipsal products */ -product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus +product CLIPSAL 560884 0x0101 560884 C-Bus Audio Matrix Switch +product CLIPSAL 5500PACA 0x0201 5500PACA C-Bus Pascal Automation Controller +product CLIPSAL 5800PC 0x0301 5800PC C-Bus Wireless Interface +product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus Interface +product CLIPSAL 5000CT2 0x0304 5000CT2 C-Bus Touch Screen +product CLIPSAL C5000CT2 0x0305 C5000CT2 C-Bus Touch Screen +product CLIPSAL L51xx 0x0401 L51xx C-Bus Dimmer /* CMOTECH products */ product CMOTECH CNU510 0x5141 CDMA Technologies USB modem @@ -1582,6 +1591,10 @@ product FEIYA DUMMY 0x0000 Dummy produc product FEIYA 5IN1 0x1132 5-in-1 Card Reader product FEIYA AC110 0x6300 AC-110 Card Reader +/* Festo */ +product FESTO CPX_USB 0x0102 CPX-USB +product FESTO CMSP 0x0501 CMSP + /* Fiberline */ product FIBERLINE WL430U 0x6003 WL-430U @@ -1649,7 +1662,7 @@ product FUJITSUSIEMENS SCR 0x0009 Fujits product GARMIN IQUE_3600 0x0004 iQue 3600 /* Gemalto products */ -product GEMALTO PROXPU 0x5501 Prox-PU/CU +product GEMALTO PROXPU 0x5501 Prox-PU/CU RFID Card Reader /* General Instruments (Motorola) products */ product GENERALINSTMNTS SB5100 0x5100 SURFboard SB5100 Cable modem @@ -1978,6 +1991,10 @@ product JVC MP_PRX1 0x3008 MP-PRX1 Ethe /* JRC products */ product JRC AH_J3001V_J3002V 0x0001 AirH PHONE AH-J3001V/J3002V +/* Kamstrrup products */ +product KAMSTRUP OPTICALEYE 0x0001 Optical Eye/3-wire +product KAMSTRUP MBUS_250D 0x0005 M-Bus Master MultiPort 250D + /* Kawatsu products */ product KAWATSU MH4000P 0x0003 MiniHub 4000P @@ -2073,6 +2090,11 @@ product LEXMARK S2450 0x0009 Optra S 24 /* Liebert products */ product LIEBERT POWERSURE_PXT 0xffff PowerSure Personal XT +/* Link Instruments Inc. products */ +product LINKINSTRUMENTS MSO19 0xf190 Link Instruments MSO-19 +product LINKINSTRUMENTS MSO28 0xf280 Link Instruments MSO-28 +product LINKINSTRUMENTS MSO28_2 0xf281 Link Instruments MSO-28 + /* Linksys products */ product LINKSYS MAUSB2 0x0105 Camedia MAUSB-2 product LINKSYS USB10TX1 0x200c USB10TX @@ -2208,7 +2230,7 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS /* MEI products */ product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor -product MEI S2000 0x1101 Seies 2000 Combo Acceptor +product MEI S2000 0x1101 Series 2000 Combo Acceptor /* Micro Star International products */ product MSI BT_DONGLE 0x1967 Bluetooth USB dongle @@ -2321,6 +2343,10 @@ product MOTOROLA2 USBLAN2 0x6027 USBLAN product MOTOROLA4 RT2770 0x9031 RT2770 product MOTOROLA4 RT3070 0x9032 RT3070 +/* MpMan products */ +product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go +product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go + /* MultiTech products */ product MULTITECH ATLAS 0xf101 MT5634ZBA-USB modem @@ -3029,10 +3055,10 @@ product SILICOM U2E 0x0001 U2E product SILICOM GPE 0x0002 Psion Gold Port Ethernet /* SI Labs */ -product SILABS VSTABI 0x0f91 Vstabi +product SILABS VSTABI 0x0f91 VStabi Controller product SILABS ARKHAM_DS101_M 0x1101 Arkham DS101 Monitor product SILABS ARKHAM_DS101_A 0x1601 Arkham DS101 Adapter -product SILABS BSM7DUSB 0x800a BSM7-D-USB +product SILABS BSM7DUSB 0x800a SPORTident BSM7-D USB product SILABS POLOLU 0x803b Pololu Serial product SILABS CYGNAL_DEBUG 0x8044 Cygnal Debug Adapter product SILABS SB_PARAMOUNT_ME 0x8043 Software Bisque Paramount ME @@ -3041,6 +3067,7 @@ product SILABS GSM2228 0x8054 Enfora GS product SILABS ARGUSISP 0x8066 Argussoft ISP product SILABS IMS_USB_RS422 0x806f IMS USB-RS422 product SILABS CRUMB128 0x807a Crumb128 board +product SILABS OPTRIS_MSPRO 0x80c4 Optris MSpro LT Thermometer product SILABS DEGREE 0x80ca Degree Controls Inc product SILABS TRACIENT 0x80dd Tracient RFID product SILABS TRAQMATE 0x80ed Track Systems Traqmate @@ -3053,9 +3080,11 @@ product SILABS WMRRIGBLASTER 0x814a WMR product SILABS WMRRIGTALK 0x814b WMR RIGtalk RT1 product SILABS B_G_H3000 0x8156 B&G H3000 Data Cable product SILABS HELICOM 0x815e Helicomm IP-Link 1220-DVM +product SILABS HAMLINKUSB 0x815f Timewave HamLinkUSB product SILABS AVIT_USB_TTL 0x818b AVIT Research USB-TTL -product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINk +product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINK product SILABS WAVIT 0x81a6 ThinkOptics WavIt +product SILABS MULTIPLEX_RC 0x81a9 Multiplex RC adapter product SILABS MSD_DASHHAWK 0x81ac MSD DashHawk product SILABS INSYS_MODEM 0x81ad INSYS Modem product SILABS LIPOWSKY_JTAG 0x81c8 Lipowsky Baby-JTAG @@ -3066,16 +3095,24 @@ product SILABS EMS_C1007 0x81f2 EMS C100 product SILABS LIPOWSKY_HARP 0x8218 Lipowsky HARP-1 product SILABS C2_EDGE_MODEM 0x822b Commander 2 EDGE(GSM) Modem product SILABS CYGNAL_GPS 0x826b Cygnal Fasttrax GPS -product SILABS TELEGESYS_ETRX2 0x8293 Telegesys ETRX2USB +product SILABS TELEGESIS_ETRX2 0x8293 Telegesis ETRX2USB product SILABS PROCYON_AVS 0x82f9 Procyon AVS product SILABS MC35PU 0x8341 MC35pu product SILABS CYGNAL 0x8382 Cygnal product SILABS AMBER_AMB2560 0x83a8 Amber Wireless AMB2560 +product SILABS DEKTEK_DTAPLUS 0x83d8 DekTec DTA Plus VHF/UHF Booster product SILABS KYOCERA_GPS 0x8411 Kyocera GPS +product SILABS IRZ_SG10 0x8418 IRZ SG-10 GSM/GPRS Modem product SILABS BEI_VCP 0x846e BEI USB Sensor (VCP) product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader +product SILABS AC_SERV_IBUS 0x85ea AC-Services IBUS Interface +product SILABS AC_SERV_CIS 0x85eb AC-Services CIS-IBUS +product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Interface +product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial +product SILABS CP210X_3 0xea70 CP210x Serial +product SILABS CP210X_4 0xea80 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone product SILABS USBSCOPE50 0xf001 USBscope50 product SILABS USBWAVE12 0xf002 USBwave12 @@ -3215,10 +3252,6 @@ product STELERA E1010 0x1010 3G modem product STELERA E1011 0x1011 3G modem product STELERA E1012 0x1012 3G modem -/* MpMan products */ -product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go -product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go - /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 11:23:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A38121065680; Wed, 29 Aug 2012 11:23:59 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2F98FC1D; Wed, 29 Aug 2012 11:23:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TBNxVI035459; Wed, 29 Aug 2012 11:23:59 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TBNxJb035457; Wed, 29 Aug 2012 11:23:59 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208291123.q7TBNxJb035457@svn.freebsd.org> From: Andrey Zonov Date: Wed, 29 Aug 2012 11:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239818 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 11:23:59 -0000 Author: zont Date: Wed Aug 29 11:23:59 2012 New Revision: 239818 URL: http://svn.freebsd.org/changeset/base/239818 Log: - Don't take an account of locked memory for current process in vslock(9). There are two consumers of vslock(9): sysctl code and drm driver. These consumers are using locked memory as transient memory, it doesn't belong to a process's memory. Suggested by: avg Reviewed by: alc Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Aug 29 11:23:20 2012 (r239817) +++ head/sys/vm/vm_glue.c Wed Aug 29 11:23:59 2012 (r239818) @@ -183,7 +183,6 @@ int vslock(void *addr, size_t len) { vm_offset_t end, last, start; - unsigned long nsize; vm_size_t npages; int error; @@ -195,18 +194,6 @@ vslock(void *addr, size_t len) npages = atop(end - start); if (npages > vm_page_max_wired) return (ENOMEM); - PROC_LOCK(curproc); - nsize = ptoa(npages + - pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map))); - if (nsize > lim_cur(curproc, RLIMIT_MEMLOCK)) { - PROC_UNLOCK(curproc); - return (ENOMEM); - } - if (racct_set(curproc, RACCT_MEMLOCK, nsize)) { - PROC_UNLOCK(curproc); - return (ENOMEM); - } - PROC_UNLOCK(curproc); #if 0 /* * XXX - not yet @@ -222,14 +209,6 @@ vslock(void *addr, size_t len) #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); -#ifdef RACCT - if (error != KERN_SUCCESS) { - PROC_LOCK(curproc); - racct_set(curproc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map)))); - PROC_UNLOCK(curproc); - } -#endif /* * Return EFAULT on error to match copy{in,out}() behaviour * rather than returning ENOMEM like mlock() would. From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 11:29:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BDB5106566B; Wed, 29 Aug 2012 11:29:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 166778FC1E; Wed, 29 Aug 2012 11:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TBSxRf036118; Wed, 29 Aug 2012 11:28:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TBSxGQ036116; Wed, 29 Aug 2012 11:28:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208291128.q7TBSxGQ036116@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 11:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239819 - releng/9.1/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 11:29:00 -0000 Author: avg Date: Wed Aug 29 11:28:59 2012 New Revision: 239819 URL: http://svn.freebsd.org/changeset/base/239819 Log: MFC r238418: acpi_cpu: separate a notion of current deepest allowed+available Cx level from a user-set persistent limit on the said level Reviewed by: jhb, gianni, sbruno Tested by: sbruno, Vitaly Magerya Approved by: re(kib) Modified: releng/9.1/sys/dev/acpica/acpi_cpu.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/dev/ (props changed) Modified: releng/9.1/sys/dev/acpica/acpi_cpu.c ============================================================================== --- releng/9.1/sys/dev/acpica/acpi_cpu.c Wed Aug 29 11:23:59 2012 (r239818) +++ releng/9.1/sys/dev/acpica/acpi_cpu.c Wed Aug 29 11:28:59 2012 (r239819) @@ -89,6 +89,7 @@ struct acpi_cpu_softc { struct sysctl_ctx_list cpu_sysctl_ctx; struct sysctl_oid *cpu_sysctl_tree; int cpu_cx_lowest; + int cpu_cx_lowest_lim; char cpu_cx_supported[64]; int cpu_rid; }; @@ -138,13 +139,12 @@ static int cpu_quirks; /* Indicate any /* Runtime state. */ static int cpu_disable_idle; /* Disable entry to idle function */ -static int cpu_cx_count; /* Number of valid Cx states */ /* Values for sysctl. */ static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; static int cpu_cx_generic; -static int cpu_cx_lowest; +static int cpu_cx_lowest_lim; static device_t *cpu_devices; static int cpu_ndevices; @@ -173,7 +173,7 @@ static void acpi_cpu_idle(void); static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(void); static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS); -static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val); +static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); static int acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); @@ -590,6 +590,7 @@ acpi_cpu_cx_probe(struct acpi_cpu_softc /* Use initial sleep value of 1 sec. to start with lowest idle state. */ sc->cpu_prev_sleep = 1000000; sc->cpu_cx_lowest = 0; + sc->cpu_cx_lowest_lim = 0; /* * Check for the ACPI 2.0 _CST sleep states object. If we can't find @@ -816,7 +817,6 @@ acpi_cpu_startup(void *arg) */ acpi_cpu_quirks(); - cpu_cx_count = 0; if (cpu_cx_generic) { /* * We are using generic Cx mode, probe for available Cx states @@ -825,24 +825,10 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); acpi_cpu_generic_cx_probe(sc); - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; - } - - /* - * Find the highest Cx state common to all CPUs - * in the system, taking quirks into account. - */ - for (i = 0; i < cpu_ndevices; i++) { - sc = device_get_softc(cpu_devices[i]); - if (sc->cpu_cx_count < cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; } } else { /* * We are using _CST mode, remove C3 state if necessary. - * Update the largest Cx state supported in the global cpu_cx_count. - * It will be used in the global Cx sysctl handler. * As we now know for sure that we will be using _CST mode * install our notify handler. */ @@ -851,8 +837,6 @@ acpi_cpu_startup(void *arg) if (cpu_quirks & CPU_QUIRK_NO_C3) { sc->cpu_cx_count = sc->cpu_non_c3 + 1; } - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY, acpi_cpu_notify, sc); } @@ -871,7 +855,7 @@ acpi_cpu_startup(void *arg) "Global lowest Cx sleep state to use"); /* Take over idling from cpu_idle_default(). */ - cpu_cx_lowest = 0; + cpu_cx_lowest_lim = 0; cpu_disable_idle = FALSE; cpu_idle_hook = acpi_cpu_idle; } @@ -1062,8 +1046,6 @@ static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context; - struct acpi_cpu_softc *isc; - int i; if (notify != ACPI_NOTIFY_CX_STATES) return; @@ -1072,16 +1054,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no acpi_cpu_cx_cst(sc); acpi_cpu_cx_list(sc); - /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); - cpu_cx_count = 0; - for (i = 0; i < cpu_ndevices; i++) { - isc = device_get_softc(cpu_devices[i]); - if (isc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = isc->cpu_cx_count; - } - if (sc->cpu_cx_lowest < cpu_cx_lowest) - acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); } @@ -1209,12 +1183,12 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG } static int -acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val) +acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc) { int i; ACPI_SERIAL_ASSERT(cpu); - sc->cpu_cx_lowest = val; + sc->cpu_cx_lowest = min(sc->cpu_cx_lowest_lim, sc->cpu_cx_count - 1); /* If not disabling, cache the new lowest non-C3 state. */ sc->cpu_non_c3 = 0; @@ -1238,18 +1212,23 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER int val, error; sc = (struct acpi_cpu_softc *) arg1; - snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > sc->cpu_cx_count - 1) - return (EINVAL); + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } ACPI_SERIAL_BEGIN(cpu); - acpi_cpu_set_cx_lowest(sc, val); + sc->cpu_cx_lowest_lim = val - 1; + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); return (0); @@ -1262,22 +1241,27 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ char state[8]; int val, error, i; - snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > cpu_cx_count - 1) - return (EINVAL); - cpu_cx_lowest = val; + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); + cpu_cx_lowest_lim = val - 1; for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); + sc->cpu_cx_lowest_lim = cpu_cx_lowest_lim; + acpi_cpu_set_cx_lowest(sc); } ACPI_SERIAL_END(cpu); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:09:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A719D106567A; Wed, 29 Aug 2012 12:09:39 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 170A98FC1A; Wed, 29 Aug 2012 12:09:39 +0000 (UTC) Received: by ialo14 with SMTP id o14so1230072ial.13 for ; Wed, 29 Aug 2012 05:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Zlvr4KqWnvqAGmMHgWjxx/GeeUZcmCX8B0/DVVVj/28=; b=B94Yrj+5Gtoff1Zv97Qxy2jLyvj5zC9ux35BqVL+gKeqAAIlkYUfMVdjNnsvj7kKfq qZQRjTxSW5gJq0hw41eRPuYDbljQSap/2oHsXYS++qMaYXAxjURXUUVi1Fd8fKpByY0n +2bh41/zQNiTzMWVWqrPP5vyjH+510U/rG71AFJX43y+tMQwpeZed5kqMjFvxG69gT2v QhtGhlUrkCoZrRrK23/ETj5BJuuMzW3bNN4GKZIlSRzPi4Q61D7p/hTZ6Xh9g0qfWRch w2xsUphBiM4SR/FhRBRjR2H6CL4V3jrCHY1eqx5PxkC6ZFITfDOqnaSdpg+hBZQ/8mHA cJaA== MIME-Version: 1.0 Received: by 10.50.163.66 with SMTP id yg2mr16938206igb.3.1346242178464; Wed, 29 Aug 2012 05:09:38 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.64.165.34 with HTTP; Wed, 29 Aug 2012 05:09:38 -0700 (PDT) In-Reply-To: <201208291123.q7TBNxJb035457@svn.freebsd.org> References: <201208291123.q7TBNxJb035457@svn.freebsd.org> Date: Wed, 29 Aug 2012 16:09:38 +0400 X-Google-Sender-Auth: mtFXD8qmsf_f2vVyZi8mNV2haj0 Message-ID: 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 Subject: Re: svn commit: r239818 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:09:39 -0000 On 29 August 2012 15:23, Andrey Zonov wrote: > Author: zont > Date: Wed Aug 29 11:23:59 2012 > New Revision: 239818 > URL: http://svn.freebsd.org/changeset/base/239818 > > Log: > - Don't take an account of locked memory for current process in vslock(9). > > There are two consumers of vslock(9): sysctl code and drm driver. These > consumers are using locked memory as transient memory, it doesn't belong > to a process's memory. Hi. So, since we do not account such memory in vslock() anymore, I think this one shall be applied as well. Index: share/man/man9/vslock.9 =================================================================== --- share/man/man9/vslock.9 (revision 239171) +++ share/man/man9/vslock.9 (working copy) @@ -82,9 +82,6 @@ .It Bq Er ENOMEM The size of the specified address range exceeds the system limit on locked memory. -.It Bq Er ENOMEM -Locking the requested address range would cause the process to exceed -its per-process locked memory limit. .It Bq Er EFAULT Some portion of the indicated address range is not allocated. There was an error faulting/mapping a page. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:18:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49550106564A; Wed, 29 Aug 2012 12:18:43 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31B0B8FC14; Wed, 29 Aug 2012 12:18:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCIhim042586; Wed, 29 Aug 2012 12:18:43 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCIhvS042582; Wed, 29 Aug 2012 12:18:43 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208291218.q7TCIhvS042582@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 29 Aug 2012 12:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239820 - in stable/8: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:18:43 -0000 Author: gavin Date: Wed Aug 29 12:18:42 2012 New Revision: 239820 URL: http://svn.freebsd.org/changeset/base/239820 Log: Merge r238803, r238804 from head: Add support for more devices to uslcom(4). This commit syncronises the list of supported devices with the union of: NetBSD src/sys/dev/usb/uslsa.c 1.18 OpenBSD src/sys/dev/usb/uslcom.c 1.24 Linux source/drivers/usb/serial/cp210x.c HEAD Remove duplicate JABLOTRON PC60B entry. Note that some of the devices added here are multi-port devices. The uslcom(4) driver currently only supports the first port on such devices. Update the man page to reflect the full list of supported devices. Remove two caveats from the CAVEATS section, as both listed caveats no longer apply. Add a caveat about multi-port devices. Improve descriptions for several devices supported by uslcom(4). Correct the spelling of the company Telegesis. Move MpMan to the correct location alphabetically. Modified: stable/8/share/man/man4/uslcom.4 stable/8/sys/dev/usb/serial/uslcom.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/share/man/man4/uslcom.4 ============================================================================== --- stable/8/share/man/man4/uslcom.4 Wed Aug 29 11:28:59 2012 (r239819) +++ stable/8/share/man/man4/uslcom.4 Wed Aug 29 12:18:42 2012 (r239820) @@ -16,12 +16,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2007 +.Dd July 26, 2012 .Dt USLCOM 4 .Os .Sh NAME .Nm uslcom -.Nd Silicon Laboratories CP2101/CP2102 based USB serial adapter +.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104 based USB serial adapter .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -40,7 +40,8 @@ uslcom_load="YES" .Sh DESCRIPTION The .Nm -driver supports Silicon Laboratories CP2101/CP2102 based USB serial adapters. +driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104 +based USB serial adapters. .Sh HARDWARE The following devices should work with the .Nm @@ -48,29 +49,147 @@ driver: .Pp .Bl -bullet -compact .It +AC-Services CAN, CIS-IBUS, IBUS and OBD interfaces +.It +Aerocomm Radio +.It +AKTACOM ACE-1001 cable +.It +AMBER Wireless AMB2560 +.It +Arkham DS-101 Adapter +.It Argussoft ISP .It +Arygon Technologies Mifare RFID Reader +.It +AVIT Research USB-TTL interface +.It +B&G H3000 Data Cable +.It +Balluff RFID reader +.It Baltech card reader .It +BEI USB VCP Sensor +.It Burnside Telecom Desktop Mobile .It chip45.com Crumb128 module .It +Clipsal 5000CT2, 5500PACA, 5500PCU, 560884, 5800PC, C5000CT2 +and L51xx C-Bus Home Automation products +.It +Commander 2 EDGE(GSM) Modem +.It +Cygnal Fasttrax GPS and Debug adapter +.It +DataApex MultiCOM USB to RS232 converter +.It +Degree Controls USB adapter +.It +DekTec DTA Plus VHF/UHF Booster +.It +Dell DW700 GPS Receiver +.It +Digianswer ZigBee/802.15.4 MAC +.It +Dynastream ANT Development kits +.It +Elan USBcount50, USBscope50, USBpulse100 and USBwave12 +.It +ELV USB-I2C interface +.It +EMS C1007 HF RFID controller +.It +Festo CPX-USB and CMSP interfaces +.It +Gemalto Prox-PU/CU contactless card reader +.It +Helicomm IP-Link 1220-DVM +.It +IMS USB-RS422 adapter +.It +Infinity GPS-MIC-1 Radio Monophone +.It +INSYS Modem +.It +IRZ SG-10 and MC35pu GSM/GPRS Modems +.It Jablotron PC-60B .It -Lipowsky Baby-JTAG +Kamstrup M-Bus Master MultiPort 250D +and Optical Eye/3 wire utility meter interfaces .It -Lipowsky Baby-LIN +Kyocera GPS .It -Lipowsky HARP-1 +Link Instruments MS-019 and MS-028 +Oscilloscope/Logic Analyzer/Pattern Generators +.It +Lipowsky Baby-JTAG, Baby-LIN and HARP-1 +.It +MEI CashFlow SC and Series 2000 cash acceptors +.It +MJS USB-TOSLINK Adapter +.It +MobiData GPRS USB Modems +.It +MSD DashHawk +.It +Multiplex RC adapter +.It +Optris MSpro LT Thermometer +.It +Owen AC4 USB-RS485 converter +.It +Pirelli DP-L10 SIP phone +.It +PLX CA-42 Phone cable .It Pololu USB to Serial .It -Silicon Laboratories CP2101 +Procyon AVS Mind Machine +.It +Renesas RX-Stick for RX610 +.It +Siemens MC60 Cable +.It +Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104 chips +.It +Software Bisque Paramount ME +.It +SPORTident BSM7-D USB .It -Silicon Laboratories CP2102 +Suunto Sports Instrument +.It +Syntech CipherLab USB Barcode Scanner +.It +T-Com TC 300 SIP phone +.It +Tams Master Easy Control +.It +Telegesis ETRX2USB +.It +Timewave HamLinkUSB +.It +Tracient RFID Reader .It Track Systems Traqmate +.It +Vaisala USB Instrument cable +.It +VStabi Controller +.It +WAGO 750-923 USB Service Cable +.It +WaveSense Jazz Blood Glucose Meter +.It +WIENER Plein & Baus CML Data Logger, RCM Remote, +and PL512 and MPOD PSUs +.It +WMR RIGblaster Plug&Play and RIGtalk RT1 +.It +Zephyr Bioharness .El .Sh SEE ALSO .Xr tty 4 , @@ -91,7 +210,5 @@ The driver was written by .An Jonathan Gray Aq jsg@openbsd.org . .Sh CAVEATS -Setting hardware flow control is not currently supported. -.Pp -Silicon Laboratories do not release any programming information -on their products. +On devices with multiple ports attached to a single chip, +only the first port is currently supported. Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Wed Aug 29 11:28:59 2012 (r239819) +++ stable/8/sys/dev/usb/serial/uslcom.c Wed Aug 29 12:18:42 2012 (r239820) @@ -214,7 +214,13 @@ static struct ucom_callback uslcom_callb static const STRUCT_USB_HOST_ID uslcom_devs[] = { #define USLCOM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } USLCOM_DEV(BALTECH, CARDREADER), + USLCOM_DEV(CLIPSAL, 5000CT2), + USLCOM_DEV(CLIPSAL, 5500PACA), USLCOM_DEV(CLIPSAL, 5500PCU), + USLCOM_DEV(CLIPSAL, 560884), + USLCOM_DEV(CLIPSAL, 5800PC), + USLCOM_DEV(CLIPSAL, C5000CT2), + USLCOM_DEV(CLIPSAL, L51xx), USLCOM_DEV(DATAAPEX, MULTICOM), USLCOM_DEV(DELL, DW700), USLCOM_DEV(DIGIANSWER, ZIGBEE802154), @@ -222,17 +228,27 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(DYNASTREAM, ANTDEVBOARD2), USLCOM_DEV(DYNASTREAM, ANT2USB), USLCOM_DEV(ELV, USBI2C), + USLCOM_DEV(FESTO, CMSP), + USLCOM_DEV(FESTO, CPX_USB), USLCOM_DEV(FOXCONN, PIRELLI_DP_L10), USLCOM_DEV(FOXCONN, TCOM_TC_300), USLCOM_DEV(GEMALTO, PROXPU), USLCOM_DEV(JABLOTRON, PC60B), + USLCOM_DEV(KAMSTRUP, OPTICALEYE), + USLCOM_DEV(KAMSTRUP, MBUS_250D), + USLCOM_DEV(LINKINSTRUMENTS, MSO19), + USLCOM_DEV(LINKINSTRUMENTS, MSO28), + USLCOM_DEV(LINKINSTRUMENTS, MSO28_2), USLCOM_DEV(MEI, CASHFLOW_SC), USLCOM_DEV(MEI, S2000), - USLCOM_DEV(JABLOTRON, PC60B), USLCOM_DEV(OWEN, AC4), USLCOM_DEV(PHILIPS, ACE1001), USLCOM_DEV(PLX, CA42), USLCOM_DEV(RENESAS, RX610), + USLCOM_DEV(SILABS, AC_SERV_CAN), + USLCOM_DEV(SILABS, AC_SERV_CIS), + USLCOM_DEV(SILABS, AC_SERV_IBUS), + USLCOM_DEV(SILABS, AC_SERV_OBD), USLCOM_DEV(SILABS, AEROCOMM), USLCOM_DEV(SILABS, AMBER_AMB2560), USLCOM_DEV(SILABS, ARGUSISP), @@ -248,16 +264,21 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, C2_EDGE_MODEM), USLCOM_DEV(SILABS, CP2102), USLCOM_DEV(SILABS, CP210X_2), + USLCOM_DEV(SILABS, CP210X_3), + USLCOM_DEV(SILABS, CP210X_4), USLCOM_DEV(SILABS, CRUMB128), USLCOM_DEV(SILABS, CYGNAL), USLCOM_DEV(SILABS, CYGNAL_DEBUG), USLCOM_DEV(SILABS, CYGNAL_GPS), USLCOM_DEV(SILABS, DEGREE), + USLCOM_DEV(SILABS, DEKTEK_DTAPLUS), USLCOM_DEV(SILABS, EMS_C1007), + USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INSYS_MODEM), + USLCOM_DEV(SILABS, IRZ_SG10), USLCOM_DEV(SILABS, KYOCERA_GPS), USLCOM_DEV(SILABS, LIPOWSKY_HARP), USLCOM_DEV(SILABS, LIPOWSKY_JTAG), @@ -265,12 +286,14 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, MC35PU), USLCOM_DEV(SILABS, MJS_TOSLINK), USLCOM_DEV(SILABS, MSD_DASHHAWK), + USLCOM_DEV(SILABS, MULTIPLEX_RC), + USLCOM_DEV(SILABS, OPTRIS_MSPRO), USLCOM_DEV(SILABS, POLOLU), USLCOM_DEV(SILABS, PROCYON_AVS), USLCOM_DEV(SILABS, SB_PARAMOUNT_ME), USLCOM_DEV(SILABS, SUUNTO), USLCOM_DEV(SILABS, TAMSMASTER), - USLCOM_DEV(SILABS, TELEGESYS_ETRX2), + USLCOM_DEV(SILABS, TELEGESIS_ETRX2), USLCOM_DEV(SILABS, TRACIENT), USLCOM_DEV(SILABS, TRAQMATE), USLCOM_DEV(SILABS, USBCOUNT50), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Wed Aug 29 11:28:59 2012 (r239819) +++ stable/8/sys/dev/usb/usbdevs Wed Aug 29 12:18:42 2012 (r239820) @@ -655,6 +655,7 @@ vendor SENAO 0x1740 Senao vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek +vendor KAMSTRUP 0x17a8 Kamstrup A/S vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -679,6 +680,7 @@ vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies +vendor FESTO 0x1e29 Festo vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications @@ -693,6 +695,7 @@ vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ vendor PLANEX 0x2c02 Planex Communications vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd +vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. vendor AEI 0x3334 AEI vendor HANK 0x3353 Hank Connection vendor PQI 0x3538 PQI @@ -1236,7 +1239,13 @@ product CISCOLINKSYS2 RT3070 0x4001 RT30 product CISCOLINKSYS3 RT3070 0x0101 RT3070 /* Clipsal products */ -product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus +product CLIPSAL 560884 0x0101 560884 C-Bus Audio Matrix Switch +product CLIPSAL 5500PACA 0x0201 5500PACA C-Bus Pascal Automation Controller +product CLIPSAL 5800PC 0x0301 5800PC C-Bus Wireless Interface +product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus Interface +product CLIPSAL 5000CT2 0x0304 5000CT2 C-Bus Touch Screen +product CLIPSAL C5000CT2 0x0305 C5000CT2 C-Bus Touch Screen +product CLIPSAL L51xx 0x0401 L51xx C-Bus Dimmer /* CMOTECH products */ product CMOTECH CNU510 0x5141 CDMA Technologies USB modem @@ -1578,6 +1587,10 @@ product FEIYA DUMMY 0x0000 Dummy produc product FEIYA 5IN1 0x1132 5-in-1 Card Reader product FEIYA AC110 0x6300 AC-110 Card Reader +/* Festo */ +product FESTO CPX_USB 0x0102 CPX-USB +product FESTO CMSP 0x0501 CMSP + /* Fiberline */ product FIBERLINE WL430U 0x6003 WL-430U @@ -1645,7 +1658,7 @@ product FUJITSUSIEMENS SCR 0x0009 Fujits product GARMIN IQUE_3600 0x0004 iQue 3600 /* Gemalto products */ -product GEMALTO PROXPU 0x5501 Prox-PU/CU +product GEMALTO PROXPU 0x5501 Prox-PU/CU RFID Card Reader /* General Instruments (Motorola) products */ product GENERALINSTMNTS SB5100 0x5100 SURFboard SB5100 Cable modem @@ -1974,6 +1987,10 @@ product JVC MP_PRX1 0x3008 MP-PRX1 Ethe /* JRC products */ product JRC AH_J3001V_J3002V 0x0001 AirH PHONE AH-J3001V/J3002V +/* Kamstrrup products */ +product KAMSTRUP OPTICALEYE 0x0001 Optical Eye/3-wire +product KAMSTRUP MBUS_250D 0x0005 M-Bus Master MultiPort 250D + /* Kawatsu products */ product KAWATSU MH4000P 0x0003 MiniHub 4000P @@ -2069,6 +2086,11 @@ product LEXMARK S2450 0x0009 Optra S 24 /* Liebert products */ product LIEBERT POWERSURE_PXT 0xffff PowerSure Personal XT +/* Link Instruments Inc. products */ +product LINKINSTRUMENTS MSO19 0xf190 Link Instruments MSO-19 +product LINKINSTRUMENTS MSO28 0xf280 Link Instruments MSO-28 +product LINKINSTRUMENTS MSO28_2 0xf281 Link Instruments MSO-28 + /* Linksys products */ product LINKSYS MAUSB2 0x0105 Camedia MAUSB-2 product LINKSYS USB10TX1 0x200c USB10TX @@ -2204,7 +2226,7 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS /* MEI products */ product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor -product MEI S2000 0x1101 Seies 2000 Combo Acceptor +product MEI S2000 0x1101 Series 2000 Combo Acceptor /* Micro Star International products */ product MSI BT_DONGLE 0x1967 Bluetooth USB dongle @@ -2312,6 +2334,10 @@ product MOTOROLA2 USBLAN2 0x6027 USBLAN product MOTOROLA4 RT2770 0x9031 RT2770 product MOTOROLA4 RT3070 0x9032 RT3070 +/* MpMan products */ +product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go +product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go + /* MultiTech products */ product MULTITECH ATLAS 0xf101 MT5634ZBA-USB modem @@ -3017,10 +3043,10 @@ product SILICOM U2E 0x0001 U2E product SILICOM GPE 0x0002 Psion Gold Port Ethernet /* SI Labs */ -product SILABS VSTABI 0x0f91 Vstabi +product SILABS VSTABI 0x0f91 VStabi Controller product SILABS ARKHAM_DS101_M 0x1101 Arkham DS101 Monitor product SILABS ARKHAM_DS101_A 0x1601 Arkham DS101 Adapter -product SILABS BSM7DUSB 0x800a BSM7-D-USB +product SILABS BSM7DUSB 0x800a SPORTident BSM7-D USB product SILABS POLOLU 0x803b Pololu Serial product SILABS CYGNAL_DEBUG 0x8044 Cygnal Debug Adapter product SILABS SB_PARAMOUNT_ME 0x8043 Software Bisque Paramount ME @@ -3029,6 +3055,7 @@ product SILABS GSM2228 0x8054 Enfora GS product SILABS ARGUSISP 0x8066 Argussoft ISP product SILABS IMS_USB_RS422 0x806f IMS USB-RS422 product SILABS CRUMB128 0x807a Crumb128 board +product SILABS OPTRIS_MSPRO 0x80c4 Optris MSpro LT Thermometer product SILABS DEGREE 0x80ca Degree Controls Inc product SILABS TRACIENT 0x80dd Tracient RFID product SILABS TRAQMATE 0x80ed Track Systems Traqmate @@ -3041,9 +3068,11 @@ product SILABS WMRRIGBLASTER 0x814a WMR product SILABS WMRRIGTALK 0x814b WMR RIGtalk RT1 product SILABS B_G_H3000 0x8156 B&G H3000 Data Cable product SILABS HELICOM 0x815e Helicomm IP-Link 1220-DVM +product SILABS HAMLINKUSB 0x815f Timewave HamLinkUSB product SILABS AVIT_USB_TTL 0x818b AVIT Research USB-TTL -product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINk +product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINK product SILABS WAVIT 0x81a6 ThinkOptics WavIt +product SILABS MULTIPLEX_RC 0x81a9 Multiplex RC adapter product SILABS MSD_DASHHAWK 0x81ac MSD DashHawk product SILABS INSYS_MODEM 0x81ad INSYS Modem product SILABS LIPOWSKY_JTAG 0x81c8 Lipowsky Baby-JTAG @@ -3054,16 +3083,24 @@ product SILABS EMS_C1007 0x81f2 EMS C100 product SILABS LIPOWSKY_HARP 0x8218 Lipowsky HARP-1 product SILABS C2_EDGE_MODEM 0x822b Commander 2 EDGE(GSM) Modem product SILABS CYGNAL_GPS 0x826b Cygnal Fasttrax GPS -product SILABS TELEGESYS_ETRX2 0x8293 Telegesys ETRX2USB +product SILABS TELEGESIS_ETRX2 0x8293 Telegesis ETRX2USB product SILABS PROCYON_AVS 0x82f9 Procyon AVS product SILABS MC35PU 0x8341 MC35pu product SILABS CYGNAL 0x8382 Cygnal product SILABS AMBER_AMB2560 0x83a8 Amber Wireless AMB2560 +product SILABS DEKTEK_DTAPLUS 0x83d8 DekTec DTA Plus VHF/UHF Booster product SILABS KYOCERA_GPS 0x8411 Kyocera GPS +product SILABS IRZ_SG10 0x8418 IRZ SG-10 GSM/GPRS Modem product SILABS BEI_VCP 0x846e BEI USB Sensor (VCP) product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader +product SILABS AC_SERV_IBUS 0x85ea AC-Services IBUS Interface +product SILABS AC_SERV_CIS 0x85eb AC-Services CIS-IBUS +product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Interface +product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial +product SILABS CP210X_3 0xea70 CP210x Serial +product SILABS CP210X_4 0xea80 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone product SILABS USBSCOPE50 0xf001 USBscope50 product SILABS USBWAVE12 0xf002 USBwave12 @@ -3202,10 +3239,6 @@ product STELERA E1010 0x1010 3G modem product STELERA E1011 0x1011 3G modem product STELERA E1012 0x1012 3G modem -/* MpMan products */ -product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go -product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go - /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:25:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8699106564A; Wed, 29 Aug 2012 12:25:46 +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 B3C7B8FC17; Wed, 29 Aug 2012 12:25:46 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0DA71B93B; Wed, 29 Aug 2012 08:25:46 -0400 (EDT) From: John Baldwin To: Gavin Atkinson Date: Wed, 29 Aug 2012 07:46:03 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208291123.q7TBNK6G035350@svn.freebsd.org> In-Reply-To: <201208291123.q7TBNK6G035350@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208290746.03772.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 29 Aug 2012 08:25:46 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r239817 - in stable/9: share/man/man4 share/syscons/keymaps sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:25:47 -0000 On Wednesday, August 29, 2012 7:23:20 am Gavin Atkinson wrote: > Author: gavin > Date: Wed Aug 29 11:23:20 2012 > New Revision: 239817 > URL: http://svn.freebsd.org/changeset/base/239817 > > Log: > Merge r238803, r238804 from head: > > Add support for more devices to uslcom(4). This commit syncronises the > list of supported devices with the union of: > > NetBSD src/sys/dev/usb/uslsa.c 1.18 > OpenBSD src/sys/dev/usb/uslcom.c 1.24 > Linux source/drivers/usb/serial/cp210x.c HEAD > > Remove duplicate JABLOTRON PC60B entry. > > Note that some of the devices added here are multi-port devices. The > uslcom(4) driver currently only supports the first port on such devices. > > Update the man page to reflect the full list of supported devices. > Remove two caveats from the CAVEATS section, as both listed caveats no > longer apply. Add a caveat about multi-port devices. > > Improve descriptions for several devices supported by uslcom(4). > Correct the spelling of the company Telegesis. > Move MpMan to the correct location alphabetically. > > Replaced: > stable/9/share/syscons/keymaps/spanish.dvorak.kbd > - copied unchanged from r235251, head/share/syscons/keymaps/spanish.dvorak.kbd This seems to be unrelated? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:29:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5396106567A for ; Wed, 29 Aug 2012 12:29:20 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 13A058FC29 for ; Wed, 29 Aug 2012 12:29:19 +0000 (UTC) Received: by eeke52 with SMTP id e52so215617eek.13 for ; Wed, 29 Aug 2012 05:29:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=w9nfm3iaR0Xg+/ZVfG2cpujXDffSW6SClJqpGdkktyk=; b=WLJcoh+gnk/vSCt1M+djYB3ZPZvPOxcwv7IsnwCz3wfe78h2nQb3ij66+Shd4LKpQj rLqxiSECKi5CXeVbmwT+8WfYGo1Z6Ks5hONd8M2Pt6CWSTTUc51eJzG+WpsyV4dQ5H1l Mb/FY9TojdOLBtwbS3XU3CX3BWiUBYXhH9OHag8ux0Yu0JBw9RgGQslo3SO3UnK+XL41 6uBh9kvzGZvLJDJXUxszDw2pVj1TxMNreoAhalCI6DXdCwog2swKsnM70Vmc4ps+hsEE UIPuWQ0xZJ+uNKJT1okqUj7sH4l5gQaEBynuSDvPemxWnRDqrV5mi4qXewTzAxxJeknv TKng== Received: by 10.14.202.66 with SMTP id c42mr1749810eeo.35.1346243358810; Wed, 29 Aug 2012 05:29:18 -0700 (PDT) Received: from dhcp170-234-red.yandex.net ([2a02:6b8:0:401:f907:1f1a:380d:eba]) by mx.google.com with ESMTPS id e7sm69602565eep.2.2012.08.29.05.29.17 (version=SSLv3 cipher=OTHER); Wed, 29 Aug 2012 05:29:18 -0700 (PDT) Sender: Andrey Zonov Message-ID: <503E0B18.70605@FreeBSD.org> Date: Wed, 29 Aug 2012 16:29:12 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201208291123.q7TBNxJb035457@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8F54062FBFD303E943129D3E" X-Gm-Message-State: ALoCoQlCGKO+Udl1kbeguELlgaLpT5b0YDPFEOJRqAAeCw9Dozenn860YkfSVPEte65VFu5Eh7El Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239818 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:29:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8F54062FBFD303E943129D3E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 8/29/12 4:09 PM, Sergey Kandaurov wrote: > On 29 August 2012 15:23, Andrey Zonov wrote: >> Author: zont >> Date: Wed Aug 29 11:23:59 2012 >> New Revision: 239818 >> URL: http://svn.freebsd.org/changeset/base/239818 >> >> Log: >> - Don't take an account of locked memory for current process in vslo= ck(9). >> >> There are two consumers of vslock(9): sysctl code and drm driver. T= hese >> consumers are using locked memory as transient memory, it doesn't be= long >> to a process's memory. >=20 > Hi. > So, since we do not account such memory in vslock() anymore, > I think this one shall be applied as well. >=20 > Index: share/man/man9/vslock.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/man/man9/vslock.9 (revision 239171) > +++ share/man/man9/vslock.9 (working copy) > @@ -82,9 +82,6 @@ > .It Bq Er ENOMEM > The size of the specified address range exceeds the system > limit on locked memory. > -.It Bq Er ENOMEM > -Locking the requested address range would cause the process to exceed > -its per-process locked memory limit. > .It Bq Er EFAULT > Some portion of the indicated address range is not allocated. > There was an error faulting/mapping a page. >=20 >=20 Please, commit it. Thanks! --=20 Andrey Zonov --------------enig8F54062FBFD303E943129D3E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQPgscAAoJEBWLemxX/CvTXAMH/1VYb33/kIRplvX9ztEE1yuW fBA0iUNSxMc3EU496wMGnmZWP/Bw5FtzhItQ8VZD06RqFL6xxJCv+sAGsKrY+M/k auEb8+U2dqf0XKpNXxnbaDN2NoR62Hu50wR8xiAdU5AD1M4YktAc7RVjpW2We016 ZToK6ewHr570kdQMuJIqLrUXybJSqARD1ey6B1q9kzt9uyB3LdUyV0b0FqtCd0ws 9QGuCHMSKjtPpyXk7BKQ6XEYl0XE6f6LLy2tFb70CPoYjMs6rIx2mg/SIylrvMpd owJxDEkDQI8C9CIBTegj0zHZxp1gqFnygqepc9ekPv9HUWezSz9zqgQC11fwx8Y= =z/x9 -----END PGP SIGNATURE----- --------------enig8F54062FBFD303E943129D3E-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:34:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A5C91065670; Wed, 29 Aug 2012 12:34:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9B68FC21; Wed, 29 Aug 2012 12:34:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCYidL044549; Wed, 29 Aug 2012 12:34:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCYiGF044546; Wed, 29 Aug 2012 12:34:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291234.q7TCYiGF044546@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 12:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239821 - stable/9/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:34:44 -0000 Author: jhb Date: Wed Aug 29 12:34:43 2012 New Revision: 239821 URL: http://svn.freebsd.org/changeset/base/239821 Log: MFC 237338: Don't return an error if a kld does not contain any modules (e.g. a kld that only contained a sysctl). The kernel linker allows such modules, so the boot loader should not reject them. Modified: stable/9/sys/boot/common/load_elf.c stable/9/sys/boot/common/load_elf_obj.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/boot/common/load_elf.c ============================================================================== --- stable/9/sys/boot/common/load_elf.c Wed Aug 29 12:18:42 2012 (r239820) +++ stable/9/sys/boot/common/load_elf.c Wed Aug 29 12:34:43 2012 (r239821) @@ -612,7 +612,7 @@ __elfN(parse_modmetadata)(struct preload Elf_Addr v, p, p_stop; if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0) - return ENOENT; + return 0; p = sym.st_value + ef->off; if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0) return ENOENT; Modified: stable/9/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/9/sys/boot/common/load_elf_obj.c Wed Aug 29 12:18:42 2012 (r239820) +++ stable/9/sys/boot/common/load_elf_obj.c Wed Aug 29 12:34:43 2012 (r239821) @@ -369,7 +369,7 @@ __elfN(obj_parse_modmetadata)(struct pre if (__elfN(obj_lookup_set)(fp, ef, "modmetadata_set", &p, &p_stop, &modcnt) != 0) - return ENOENT; + return 0; modcnt = 0; while (p < p_stop) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:35:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14F2B106566B; Wed, 29 Aug 2012 12:35:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB0308FC0C; Wed, 29 Aug 2012 12:35:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCZoHt044723; Wed, 29 Aug 2012 12:35:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCZoDb044720; Wed, 29 Aug 2012 12:35:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291235.q7TCZoDb044720@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 12:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239822 - stable/8/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:35:51 -0000 Author: jhb Date: Wed Aug 29 12:35:50 2012 New Revision: 239822 URL: http://svn.freebsd.org/changeset/base/239822 Log: MFC 237338: Don't return an error if a kld does not contain any modules (e.g. a kld that only contained a sysctl). The kernel linker allows such modules, so the boot loader should not reject them. Modified: stable/8/sys/boot/common/load_elf.c stable/8/sys/boot/common/load_elf_obj.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/boot/common/load_elf.c ============================================================================== --- stable/8/sys/boot/common/load_elf.c Wed Aug 29 12:34:43 2012 (r239821) +++ stable/8/sys/boot/common/load_elf.c Wed Aug 29 12:35:50 2012 (r239822) @@ -611,7 +611,7 @@ __elfN(parse_modmetadata)(struct preload Elf_Addr v, p, p_stop; if (__elfN(lookup_symbol)(fp, ef, "__start_set_modmetadata_set", &sym) != 0) - return ENOENT; + return 0; p = sym.st_value + ef->off; if (__elfN(lookup_symbol)(fp, ef, "__stop_set_modmetadata_set", &sym) != 0) return ENOENT; Modified: stable/8/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/8/sys/boot/common/load_elf_obj.c Wed Aug 29 12:34:43 2012 (r239821) +++ stable/8/sys/boot/common/load_elf_obj.c Wed Aug 29 12:35:50 2012 (r239822) @@ -344,7 +344,7 @@ __elfN(obj_parse_modmetadata)(struct pre if (__elfN(obj_lookup_set)(fp, ef, "modmetadata_set", &p, &p_stop, &modcnt) != 0) - return ENOENT; + return 0; modcnt = 0; while (p < p_stop) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:44:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFF5F1065670; Wed, 29 Aug 2012 12:44:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0198FC19; Wed, 29 Aug 2012 12:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCiDiN046024; Wed, 29 Aug 2012 12:44:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCiDAa046022; Wed, 29 Aug 2012 12:44:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208291244.q7TCiDAa046022@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Aug 2012 12:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239823 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:44:13 -0000 Author: bz Date: Wed Aug 29 12:44:13 2012 New Revision: 239823 URL: http://svn.freebsd.org/changeset/base/239823 Log: MFC r238878: For consistency put the IPsec comment iside the #fidef section. Modified: stable/9/sys/netinet6/ip6_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Wed Aug 29 12:35:50 2012 (r239822) +++ stable/9/sys/netinet6/ip6_output.c Wed Aug 29 12:44:13 2012 (r239823) @@ -292,11 +292,11 @@ ip6_output(struct mbuf *m0, struct ip6_p MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2); } +#ifdef IPSEC /* * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ -#ifdef IPSEC switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) { case 1: /* Bad packet */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:44:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 973991065675; Wed, 29 Aug 2012 12:44:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81D028FC1F; Wed, 29 Aug 2012 12:44:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCiFS7046066; Wed, 29 Aug 2012 12:44:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCiF5k046064; Wed, 29 Aug 2012 12:44:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208291244.q7TCiF5k046064@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Aug 2012 12:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239824 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:44:15 -0000 Author: bz Date: Wed Aug 29 12:44:14 2012 New Revision: 239824 URL: http://svn.freebsd.org/changeset/base/239824 Log: MFC r238878: For consistency put the IPsec comment iside the #fidef section. Modified: stable/8/sys/netinet6/ip6_output.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/ip6_output.c ============================================================================== --- stable/8/sys/netinet6/ip6_output.c Wed Aug 29 12:44:13 2012 (r239823) +++ stable/8/sys/netinet6/ip6_output.c Wed Aug 29 12:44:14 2012 (r239824) @@ -260,11 +260,11 @@ ip6_output(struct mbuf *m0, struct ip6_p MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2); } +#ifdef IPSEC /* * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ -#ifdef IPSEC switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) { case 1: /* Bad packet */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:44:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 326BE106566B; Wed, 29 Aug 2012 12:44:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7188FC1C; Wed, 29 Aug 2012 12:44:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCiHT5046103; Wed, 29 Aug 2012 12:44:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCiHSH046101; Wed, 29 Aug 2012 12:44:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208291244.q7TCiHSH046101@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Aug 2012 12:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239825 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:44:18 -0000 Author: bz Date: Wed Aug 29 12:44:17 2012 New Revision: 239825 URL: http://svn.freebsd.org/changeset/base/239825 Log: MFC r238878: For consistency put the IPsec comment iside the #fidef section. Modified: stable/7/sys/netinet6/ip6_output.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet6/ip6_output.c ============================================================================== --- stable/7/sys/netinet6/ip6_output.c Wed Aug 29 12:44:14 2012 (r239824) +++ stable/7/sys/netinet6/ip6_output.c Wed Aug 29 12:44:17 2012 (r239825) @@ -249,11 +249,11 @@ ip6_output(struct mbuf *m0, struct ip6_p MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2); } +#ifdef IPSEC /* * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ -#ifdef IPSEC switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) { case 1: /* Bad packet */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:46:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B3A1065677; Wed, 29 Aug 2012 12:46:53 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBC838FC1F; Wed, 29 Aug 2012 12:46:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCkrXH046510; Wed, 29 Aug 2012 12:46:53 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCkrFM046507; Wed, 29 Aug 2012 12:46:53 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208291246.q7TCkrFM046507@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 29 Aug 2012 12:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239826 - in stable/9: share/man/man4 sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:46:54 -0000 Author: gavin Date: Wed Aug 29 12:46:53 2012 New Revision: 239826 URL: http://svn.freebsd.org/changeset/base/239826 Log: Merge r239037,239050 from head: Support multiple interface devices. The driver had previously hardcoded support for only the first port, but the CP2105 can have multiple ports. Although without this change the the first port mostly worked on multi port devices, there could still be issues with this arrangement. Update the man page to reflect support for both ports and the CP2105. Many thanks to Silicon Labs (www.silabs.com) for providing a CP2105-EK dev board for testing. Modified: stable/9/share/man/man4/uslcom.4 stable/9/sys/dev/usb/serial/uslcom.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/uslcom.4 ============================================================================== --- stable/9/share/man/man4/uslcom.4 Wed Aug 29 12:44:17 2012 (r239825) +++ stable/9/share/man/man4/uslcom.4 Wed Aug 29 12:46:53 2012 (r239826) @@ -16,12 +16,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2012 +.Dd August 4, 2012 .Dt USLCOM 4 .Os .Sh NAME .Nm uslcom -.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104 based USB serial adapter +.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104/CP2105 based USB serial adapter .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -39,7 +39,7 @@ uslcom_load="YES" .Sh DESCRIPTION The .Nm -driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104 +driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104/CP2105 based USB serial adapters. .Sh HARDWARE The following devices should work with the @@ -153,7 +153,7 @@ Renesas RX-Stick for RX610 .It Siemens MC60 Cable .It -Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104 chips +Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104/CP2105 chips .It Software Bisque Paramount ME .It @@ -208,6 +208,3 @@ The .Nm driver was written by .An Jonathan Gray Aq jsg@openbsd.org . -.Sh CAVEATS -On devices with multiple ports attached to a single chip, -only the first port is currently supported. Modified: stable/9/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/9/sys/dev/usb/serial/uslcom.c Wed Aug 29 12:44:17 2012 (r239825) +++ stable/9/sys/dev/usb/serial/uslcom.c Wed Aug 29 12:46:53 2012 (r239826) @@ -60,7 +60,6 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_BULK_BUF_SIZE 1024 #define USLCOM_CONFIG_INDEX 0 -#define USLCOM_IFACE_INDEX 0 #define USLCOM_SET_DATA_BITS(x) ((x) << 8) @@ -103,8 +102,6 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_PARITY_ODD 0x10 #define USLCOM_PARITY_EVEN 0x20 -#define USLCOM_PORT_NO 0x0000 - /* USLCOM_BREAK values */ #define USLCOM_BREAK_OFF 0x00 #define USLCOM_BREAK_ON 0x01 @@ -138,6 +135,7 @@ struct uslcom_softc { uint8_t sc_msr; uint8_t sc_lsr; + uint8_t sc_iface_no; }; static device_probe_t uslcom_probe; @@ -367,9 +365,6 @@ uslcom_probe(device_t dev) if (uaa->info.bConfigIndex != USLCOM_CONFIG_INDEX) { return (ENXIO); } - if (uaa->info.bIfaceIndex != USLCOM_IFACE_INDEX) { - return (ENXIO); - } return (usbd_lookup_id_by_uaa(uslcom_devs, sizeof(uslcom_devs), uaa)); } @@ -387,6 +382,8 @@ uslcom_attach(device_t dev) usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); sc->sc_udev = uaa->device; + /* use the interface number from the USB interface descriptor */ + sc->sc_iface_no = uaa->info.bIfaceNum; error = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->sc_xfer, uslcom_config, @@ -441,7 +438,7 @@ uslcom_open(struct ucom_softc *ucom) req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_UART; USETW(req.wValue, USLCOM_UART_ENABLE); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -465,7 +462,7 @@ uslcom_close(struct ucom_softc *ucom) req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_UART; USETW(req.wValue, USLCOM_UART_DISABLE); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -489,7 +486,7 @@ uslcom_set_dtr(struct ucom_softc *ucom, req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_CTRL; USETW(req.wValue, ctl); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -513,7 +510,7 @@ uslcom_set_rts(struct ucom_softc *ucom, req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_CTRL; USETW(req.wValue, ctl); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -544,7 +541,7 @@ uslcom_param(struct ucom_softc *ucom, st req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_SET_BAUD_RATE; USETW(req.wValue, 0); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(baudrate)); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -581,7 +578,7 @@ uslcom_param(struct ucom_softc *ucom, st req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_DATA; USETW(req.wValue, data); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -603,7 +600,7 @@ uslcom_param(struct ucom_softc *ucom, st req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_SET_FLOWCTRL; USETW(req.wValue, 0); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(flowctrl)); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -633,7 +630,7 @@ uslcom_set_break(struct ucom_softc *ucom req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_BREAK; USETW(req.wValue, brk); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -787,7 +784,7 @@ uslcom_control_callback(struct usb_xfer req.bmRequestType = USLCOM_READ; req.bRequest = USLCOM_RCTRL; USETW(req.wValue, 0); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(buf)); usbd_xfer_set_frames(xfer, 2); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:47:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38FE81065758; Wed, 29 Aug 2012 12:47:01 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE618FC12; Wed, 29 Aug 2012 12:47:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCl1jn046563; Wed, 29 Aug 2012 12:47:01 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCl1dm046559; Wed, 29 Aug 2012 12:47:01 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208291247.q7TCl1dm046559@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 29 Aug 2012 12:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239827 - in stable/8: share/man/man4 sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:47:02 -0000 Author: gavin Date: Wed Aug 29 12:47:00 2012 New Revision: 239827 URL: http://svn.freebsd.org/changeset/base/239827 Log: Merge r239037,239050 from head: Support multiple interface devices. The driver had previously hardcoded support for only the first port, but the CP2105 can have multiple ports. Although without this change the the first port mostly worked on multi port devices, there could still be issues with this arrangement. Update the man page to reflect support for both ports and the CP2105. Many thanks to Silicon Labs (www.silabs.com) for providing a CP2105-EK dev board for testing. Modified: stable/8/share/man/man4/uslcom.4 stable/8/sys/dev/usb/serial/uslcom.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/share/man/man4/uslcom.4 ============================================================================== --- stable/8/share/man/man4/uslcom.4 Wed Aug 29 12:46:53 2012 (r239826) +++ stable/8/share/man/man4/uslcom.4 Wed Aug 29 12:47:00 2012 (r239827) @@ -16,12 +16,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2012 +.Dd August 4, 2012 .Dt USLCOM 4 .Os .Sh NAME .Nm uslcom -.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104 based USB serial adapter +.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104/CP2105 based USB serial adapter .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -40,7 +40,7 @@ uslcom_load="YES" .Sh DESCRIPTION The .Nm -driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104 +driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104/CP2105 based USB serial adapters. .Sh HARDWARE The following devices should work with the @@ -154,7 +154,7 @@ Renesas RX-Stick for RX610 .It Siemens MC60 Cable .It -Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104 chips +Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104/CP2105 chips .It Software Bisque Paramount ME .It @@ -209,6 +209,3 @@ The .Nm driver was written by .An Jonathan Gray Aq jsg@openbsd.org . -.Sh CAVEATS -On devices with multiple ports attached to a single chip, -only the first port is currently supported. Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Wed Aug 29 12:46:53 2012 (r239826) +++ stable/8/sys/dev/usb/serial/uslcom.c Wed Aug 29 12:47:00 2012 (r239827) @@ -60,7 +60,6 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_BULK_BUF_SIZE 1024 #define USLCOM_CONFIG_INDEX 0 -#define USLCOM_IFACE_INDEX 0 #define USLCOM_SET_DATA_BITS(x) ((x) << 8) @@ -103,8 +102,6 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_PARITY_ODD 0x10 #define USLCOM_PARITY_EVEN 0x20 -#define USLCOM_PORT_NO 0x0000 - /* USLCOM_BREAK values */ #define USLCOM_BREAK_OFF 0x00 #define USLCOM_BREAK_ON 0x01 @@ -138,6 +135,7 @@ struct uslcom_softc { uint8_t sc_msr; uint8_t sc_lsr; + uint8_t sc_iface_no; }; static device_probe_t uslcom_probe; @@ -367,9 +365,6 @@ uslcom_probe(device_t dev) if (uaa->info.bConfigIndex != USLCOM_CONFIG_INDEX) { return (ENXIO); } - if (uaa->info.bIfaceIndex != USLCOM_IFACE_INDEX) { - return (ENXIO); - } return (usbd_lookup_id_by_uaa(uslcom_devs, sizeof(uslcom_devs), uaa)); } @@ -387,6 +382,8 @@ uslcom_attach(device_t dev) usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); sc->sc_udev = uaa->device; + /* use the interface number from the USB interface descriptor */ + sc->sc_iface_no = uaa->info.bIfaceNum; error = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->sc_xfer, uslcom_config, @@ -441,7 +438,7 @@ uslcom_open(struct ucom_softc *ucom) req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_UART; USETW(req.wValue, USLCOM_UART_ENABLE); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -465,7 +462,7 @@ uslcom_close(struct ucom_softc *ucom) req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_UART; USETW(req.wValue, USLCOM_UART_DISABLE); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -489,7 +486,7 @@ uslcom_set_dtr(struct ucom_softc *ucom, req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_CTRL; USETW(req.wValue, ctl); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -513,7 +510,7 @@ uslcom_set_rts(struct ucom_softc *ucom, req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_CTRL; USETW(req.wValue, ctl); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -544,7 +541,7 @@ uslcom_param(struct ucom_softc *ucom, st req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_SET_BAUD_RATE; USETW(req.wValue, 0); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(baudrate)); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -581,7 +578,7 @@ uslcom_param(struct ucom_softc *ucom, st req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_DATA; USETW(req.wValue, data); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -603,7 +600,7 @@ uslcom_param(struct ucom_softc *ucom, st req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_SET_FLOWCTRL; USETW(req.wValue, 0); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(flowctrl)); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -633,7 +630,7 @@ uslcom_set_break(struct ucom_softc *ucom req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_BREAK; USETW(req.wValue, brk); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, @@ -787,7 +784,7 @@ uslcom_control_callback(struct usb_xfer req.bmRequestType = USLCOM_READ; req.bRequest = USLCOM_RCTRL; USETW(req.wValue, 0); - USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(buf)); usbd_xfer_set_frames(xfer, 2); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 12:52:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DDD5106564A; Wed, 29 Aug 2012 12:52:05 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DF618FC14; Wed, 29 Aug 2012 12:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TCq5DU047190; Wed, 29 Aug 2012 12:52:05 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TCq5WY047188; Wed, 29 Aug 2012 12:52:05 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201208291252.q7TCq5WY047188@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 29 Aug 2012 12:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239828 - stable/8/share/syscons/keymaps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:52:05 -0000 Author: gavin Date: Wed Aug 29 12:52:04 2012 New Revision: 239828 URL: http://svn.freebsd.org/changeset/base/239828 Log: Merge r225538 from head: Include descriptions for keymaps missing from INDEX.keymaps. This fixes the five keymaps referred to only by filename on the keymap selection screen of bsdinstall. Modified: stable/8/share/syscons/keymaps/INDEX.keymaps Directory Properties: stable/8/share/syscons/keymaps/ (props changed) Modified: stable/8/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/8/share/syscons/keymaps/INDEX.keymaps Wed Aug 29 12:47:00 2012 (r239827) +++ stable/8/share/syscons/keymaps/INDEX.keymaps Wed Aug 29 12:52:04 2012 (r239828) @@ -117,6 +117,8 @@ danish.cp865.kbd:fr:Danois Code page 865 danish.cp865.kbd:pt:Dinamarquês Codepage 865 danish.cp865.kbd:es:Danés Codepage 865 +dutch.iso.acc.kbd:en:Dutch ISO keymap (accent keys) + eee_nordic.kbd:en:Nordic layout on Asus eeePC eee_nordic.kbd:fr:Norvégien phonétique sur Asus eeePC @@ -368,6 +370,14 @@ ru.koi8-r.shift.kbd:pt:Russo koi8-r (shi ru.koi8-r.shift.kbd:es:Ruso koi8-r (shift) ru.koi8-r.shift.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r (shift) +ru.koi8-r.win.kbd:en:Russian koi8-r (winkeys) +ru.koi8-r.win.kbd:de:Russisch koi8-r (winkeys) +ru.koi8-r.win.kbd:ru:òÕÓÓËÉÊ koi8-r (winkeys) +ru.koi8-r.win.kbd:fr:Russe koi8-r (winkeys) +ru.koi8-r.win.kbd:pt:Russo koi8-r (winkeys) +ru.koi8-r.win.kbd:es:Ruso koi8-r (winkeys) +ru.koi8-r.win.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r (winkeys) + spanish.iso.kbd:en:Spanish ISO-8859-1 spanish.iso.kbd:de:Spanisch ISO-8859-1 spanish.iso.kbd:fr:Espagnol ISO-8859-1 @@ -456,12 +466,16 @@ uk.iso.kbd:fr:Royaume Uni ISO-8859-1 uk.iso.kbd:pt:Reino Unido ISO-8859-1 uk.iso.kbd:es:Británico ISO-8859-1 +uk.iso-ctrl.kbd:en:United Kingdom ISO-8859-1 (Caps Lock acts as Left Ctrl) + uk.cp850.kbd:en:United Kingdom Codepage 850 uk.cp850.kbd:de:Vereinigtes Königreich Codeseite 850 uk.cp850.kbd:fr:Royaume Uni Code page 850 uk.cp850.kbd:pt:Reino Unido Codepage 850 uk.cp850.kbd:es:Británico Codepage 850 +uk.cp850-ctrl.kbd:en:United Kingdom Codepage 850 (Caps Lock acts as Left Ctrl) + uk.dvorak.kbd:en:United Kingdom Dvorak uk.dvorak.kbd:de:Vereinigtes K\xf6nigreich Dvorak uk.dvorak.kbd:fr:Royaume Uni Dvorak @@ -510,6 +524,8 @@ us.emacs.kbd:fr:États Unis d'Amérique em us.emacs.kbd:pt:Estados Unidos da América emacs us.emacs.kbd:es:Estadounidense optimizado para Emacs +us.pc-ctrl.kbd:en:United States of America ISO-8859-1 (Caps Lock acts as Left Ctrl) + us.unix.kbd:en:United States of America Traditional Unix Workstation us.unix.kbd:de:US-amerikanisch traditionelles Unix Layout us.unix.kbd:fr:États Unis d'Amérique unix From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 13:00:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76982106566C; Wed, 29 Aug 2012 13:00:01 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5598D8FC18; Wed, 29 Aug 2012 13:00:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TD01mw048167; Wed, 29 Aug 2012 13:00:01 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TD01j6048159; Wed, 29 Aug 2012 13:00:01 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208291300.q7TD01j6048159@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 29 Aug 2012 13:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239829 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:00:01 -0000 Author: pluknet Date: Wed Aug 29 13:00:00 2012 New Revision: 239829 URL: http://svn.freebsd.org/changeset/base/239829 Log: Follow r239818 and remove no more relevant vslock() ENOMEM error. Reviewed by: zont MFC after: 2 weeks Modified: head/share/man/man9/vslock.9 Modified: head/share/man/man9/vslock.9 ============================================================================== --- head/share/man/man9/vslock.9 Wed Aug 29 12:52:04 2012 (r239828) +++ head/share/man/man9/vslock.9 Wed Aug 29 13:00:00 2012 (r239829) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2004 +.Dd August 29, 2012 .Dt VSLOCK 9 .Os .Sh NAME @@ -82,9 +82,6 @@ machine address space. .It Bq Er ENOMEM The size of the specified address range exceeds the system limit on locked memory. -.It Bq Er ENOMEM -Locking the requested address range would cause the process to exceed -its per-process locked memory limit. .It Bq Er EFAULT Some portion of the indicated address range is not allocated. There was an error faulting/mapping a page. From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 13:10:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 744C3106564A; Wed, 29 Aug 2012 13:10:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DC4E8FC1F; Wed, 29 Aug 2012 13:10:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TDAZiL049530; Wed, 29 Aug 2012 13:10:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TDAZmX049528; Wed, 29 Aug 2012 13:10:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208291310.q7TDAZmX049528@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Aug 2012 13:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239830 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:10:35 -0000 Author: bz Date: Wed Aug 29 13:10:34 2012 New Revision: 239830 URL: http://svn.freebsd.org/changeset/base/239830 Log: MFC 238934: Improve the should-never-hit printf to ease debugging in case we'd ever hit it again when doing the delayed IPv6 checksum calculations. Modified: stable/9/sys/netinet6/ip6_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Wed Aug 29 13:00:00 2012 (r239829) +++ stable/9/sys/netinet6/ip6_output.c Wed Aug 29 13:10:34 2012 (r239830) @@ -195,8 +195,9 @@ in6_delayed_cksum(struct mbuf *m, uint32 offset += m->m_pkthdr.csum_data; /* checksum offset */ if (offset + sizeof(u_short) > m->m_len) { - printf("%s: delayed m_pullup, m->len: %d off: %d\n", - __func__, m->m_len, offset); + printf("%s: delayed m_pullup, m->len: %d plen %u off %u " + "csum_flags=0x%04x\n", __func__, m->m_len, plen, offset, + m->m_pkthdr.csum_flags); /* * XXX this should not happen, but if it does, the correct * behavior may be to insert the checksum in the appropriate From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 13:14:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DEEA41065677; Wed, 29 Aug 2012 13:14:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7B78FC0C; Wed, 29 Aug 2012 13:14:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TDEd3e050123; Wed, 29 Aug 2012 13:14:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TDEdiq050121; Wed, 29 Aug 2012 13:14:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208291314.q7TDEdiq050121@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Aug 2012 13:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239831 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:14:40 -0000 Author: bz Date: Wed Aug 29 13:14:39 2012 New Revision: 239831 URL: http://svn.freebsd.org/changeset/base/239831 Log: MFC r238935: Properly apply #ifdef INET and leave a comment that we are (will) apply delayed IPv6 checksum processing in ip6_output.c when doing IPsec. PR: kern/170116 Modified: stable/9/sys/netinet6/ip6_ipsec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/9/sys/netinet6/ip6_ipsec.c Wed Aug 29 13:10:34 2012 (r239830) +++ stable/9/sys/netinet6/ip6_ipsec.c Wed Aug 29 13:14:39 2012 (r239831) @@ -291,16 +291,16 @@ ip6_ipsec_output(struct mbuf **m, struct /* * Do delayed checksums now because we send before * this is done in the normal processing path. - * XXX-BZ CSUM_DELAY_DATA_IPV6? + * For IPv6 we do delayed checksums in ip6_output.c. */ +#ifdef INET if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { ipseclog((LOG_DEBUG, "%s: we do not support IPv4 over IPv6", __func__)); -#ifdef INET in_delayed_cksum(*m); -#endif (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } +#endif /* * Preserve KAME behaviour: ENOENT can be returned From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 13:19:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 487091065670; Wed, 29 Aug 2012 13:19:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 325FD8FC0A; Wed, 29 Aug 2012 13:19:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TDJSgo050853; Wed, 29 Aug 2012 13:19:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TDJSfE050851; Wed, 29 Aug 2012 13:19:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201208291319.q7TDJSfE050851@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 29 Aug 2012 13:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239832 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:19:28 -0000 Author: bz Date: Wed Aug 29 13:19:27 2012 New Revision: 239832 URL: http://svn.freebsd.org/changeset/base/239832 Log: MFC r238960: In case of IPsec he have to do delayed checksum calculations before adding any extension header, or rather before calling into IPsec processing as we may send the packet and not return to IPv6 output processing here. PR: kern/170116 Modified: stable/9/sys/netinet6/ip6_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Wed Aug 29 13:14:39 2012 (r239831) +++ stable/9/sys/netinet6/ip6_output.c Wed Aug 29 13:19:27 2012 (r239832) @@ -304,6 +304,20 @@ ip6_output(struct mbuf *m0, struct ip6_p goto freehdrs; case -1: /* Do IPSec */ needipsec = 1; + /* + * Do delayed checksums now, as we may send before returning. + */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + plen = m->m_pkthdr.len - sizeof(*ip6); + in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } +#ifdef SCTP + if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { + sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); + m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; + } +#endif case 0: /* No IPSec */ default: break; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 13:28:07 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 937A21065675; Wed, 29 Aug 2012 13:28:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw5.york.ac.uk (mail-gw5.york.ac.uk [144.32.129.29]) by mx1.freebsd.org (Postfix) with ESMTP id 16C608FC08; Wed, 29 Aug 2012 13:28:00 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.108.81]:49838 helo=ury.org.uk) by mail-gw5.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1T6iJF-0007WS-Rt; Wed, 29 Aug 2012 14:27:53 +0100 Received: from localhost ([127.0.0.1] helo=thunderhorn.york.ac.uk) by ury.org.uk with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1T6iJF-0002Wn-HO; Wed, 29 Aug 2012 14:27:53 +0100 Received: from localhost (gavin@localhost) by thunderhorn.york.ac.uk (8.14.5/8.14.5/Submit) with ESMTP id q7TDRrOb009718; Wed, 29 Aug 2012 14:27:53 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: thunderhorn.york.ac.uk: gavin owned process doing -bs Date: Wed, 29 Aug 2012 14:27:53 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@thunderhorn.york.ac.uk To: John Baldwin In-Reply-To: <201208290746.03772.jhb@freebsd.org> Message-ID: References: <201208291123.q7TBNK6G035350@svn.freebsd.org> <201208290746.03772.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: gavin@FreeBSD.org X-SA-Exim-Scanned: No (on ury.org.uk); SAEximRunCond expanded to false Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r239817 - in stable/9: share/man/man4 share/syscons/keymaps sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:28:07 -0000 On Wed, 29 Aug 2012, John Baldwin wrote: > On Wednesday, August 29, 2012 7:23:20 am Gavin Atkinson wrote: > > Author: gavin > > Date: Wed Aug 29 11:23:20 2012 > > New Revision: 239817 > > URL: http://svn.freebsd.org/changeset/base/239817 > > > > Log: > > Merge r238803, r238804 from head: > > > > Add support for more devices to uslcom(4). This commit syncronises the > > list of supported devices with the union of: > > > > Replaced: > > stable/9/share/syscons/keymaps/spanish.dvorak.kbd > > - copied unchanged from r235251, head/share/syscons/keymaps/spanish.dvorak.kbd > > This seems to be unrelated? Indeed it was, and it's not clear why this happened at all (it didn't show up in "svn diff", and I've never knowingly touched that file). Luckily, it apparently hasn't broken the SVN-CVS exporter. Gavin From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 13:28:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4C27106579E; Wed, 29 Aug 2012 13:28:26 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD4B8FC28; Wed, 29 Aug 2012 13:28:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TDSQfi051998; Wed, 29 Aug 2012 13:28:26 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TDSQ6m051990; Wed, 29 Aug 2012 13:28:26 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201208291328.q7TDSQ6m051990@svn.freebsd.org> From: Isabell Long Date: Wed, 29 Aug 2012 13:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239833 - stable/9/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:28:27 -0000 Author: issyl0 (doc committer) Date: Wed Aug 29 13:28:25 2012 New Revision: 239833 URL: http://svn.freebsd.org/changeset/base/239833 Log: MFC r238781, r238919 from HEAD: r238781: - Add a new man page containing details of new locale-specific functions for wctype.h, iswalnum_l(3). Add it and its functions to the Makefile. r238919: - Add more locale-specific functions to the relevant man pages and Makefile: - lib/libc/locale/islower.3 - lib/libc/locale/ispunct.3 - lib/libc/locale/nl_langinfo.3 - lib/libc/locale/isgraph.3 - lib/libc/locale/isspace.3 Approved by: gjb (mentor) Added: stable/9/lib/libc/locale/iswalnum_l.3 - copied unchanged from r238781, head/lib/libc/locale/iswalnum_l.3 Modified: stable/9/lib/libc/locale/Makefile.inc stable/9/lib/libc/locale/isgraph.3 stable/9/lib/libc/locale/islower.3 stable/9/lib/libc/locale/ispunct.3 stable/9/lib/libc/locale/isspace.3 stable/9/lib/libc/locale/nl_langinfo.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/Makefile.inc ============================================================================== --- stable/9/lib/libc/locale/Makefile.inc Wed Aug 29 13:19:27 2012 (r239832) +++ stable/9/lib/libc/locale/Makefile.inc Wed Aug 29 13:28:25 2012 (r239833) @@ -30,7 +30,8 @@ MAN+= btowc.3 \ ctype.3 digittoint.3 isalnum.3 isalpha.3 isascii.3 isblank.3 iscntrl.3 \ isdigit.3 isgraph.3 isideogram.3 islower.3 isphonogram.3 isprint.3 \ ispunct.3 isrune.3 isspace.3 isspecial.3 \ - isupper.3 iswalnum.3 isxdigit.3 localeconv.3 mblen.3 mbrlen.3 \ + isupper.3 iswalnum.3 iswalnum_l.3 isxdigit.3 \ + localeconv.3 mblen.3 mbrlen.3 \ mbrtowc.3 \ mbsinit.3 \ mbsrtowcs.3 mbstowcs.3 mbtowc.3 multibyte.3 \ @@ -46,6 +47,11 @@ MAN+= big5.5 euc.5 gb18030.5 gb2312.5 gb MLINKS+=btowc.3 wctob.3 MLINKS+=isdigit.3 isnumber.3 +MLINKS+=isgraph.3 isgraph_l.3 +MLINKS+=islower.3 islower_l.3 +MLINKS+=ispunct.3 ispunct_l.3 +MLINKS+=isspace.3 isspace_l.3 +MLINKS+=nl_langinfo.3 nl_langinfo_l.3 MLINKS+=iswalnum.3 iswalpha.3 iswalnum.3 iswascii.3 iswalnum.3 iswblank.3 \ iswalnum.3 iswcntrl.3 iswalnum.3 iswdigit.3 iswalnum.3 iswgraph.3 \ iswalnum.3 iswhexnumber.3 \ @@ -53,6 +59,18 @@ MLINKS+=iswalnum.3 iswalpha.3 iswalnum.3 iswalnum.3 iswphonogram.3 iswalnum.3 iswprint.3 iswalnum.3 iswpunct.3 \ iswalnum.3 iswrune.3 iswalnum.3 iswspace.3 iswalnum.3 iswspecial.3 \ iswalnum.3 iswupper.3 iswalnum.3 iswxdigit.3 +MLINKS+=iswalnum_l.3 iswalpha_l.3 iswalnum_l.3 iswcntrl_l.3 \ + iswalnum_l.3 iswctype_l.3 iswalnum_l.3 iswdigit_l.3 \ + iswalnum_l.3 iswgraph_l.3 iswalnum_l.3 iswlower_l.3 \ + iswalnum_l.3 iswprint_l.3 iswalnum_l.3 iswpunct_l.3 \ + iswalnum_l.3 iswspace_l.3 iswalnum_l.3 iswupper_l.3 \ + iswalnum_l.3 iswxdigit_l.3 iswalnum_l.3 towlower_l.3 \ + iswalnum_l.3 towupper_l.3 iswalnum_l.3 wctype_l.3 \ + iswalnum_l.3 iswblank_l.3 iswalnum_l.3 iswhexnumber_l.3 \ + iswalnum_l.3 iswideogram_l.3 iswalnum_l.3 iswnumber_l.3 \ + iswalnum_l.3 iswphonogram_l.3 iswalnum_l.3 iswrune_l.3 \ + iswalnum_l.3 iswspecial_l.3 iswalnum_l.3 nextwctype_l.3 \ + iswalnum_l.3 towctrans_l.3 iswalnum_l.3 wctrans_l.3 MLINKS+=isxdigit.3 ishexnumber.3 MLINKS+=mbsrtowcs.3 mbsnrtowcs.3 MLINKS+=wcsrtombs.3 wcsnrtombs.3 Modified: stable/9/lib/libc/locale/isgraph.3 ============================================================================== --- stable/9/lib/libc/locale/isgraph.3 Wed Aug 29 13:19:27 2012 (r239832) +++ stable/9/lib/libc/locale/isgraph.3 Wed Aug 29 13:28:25 2012 (r239833) @@ -32,7 +32,7 @@ .\" @(#)isgraph.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd July 30, 2012 .Dt ISGRAPH 3 .Os .Sh NAME @@ -44,6 +44,8 @@ .In ctype.h .Ft int .Fn isgraph "int c" +.Ft int +.Fn isgraph_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isgraph @@ -80,11 +82,19 @@ In the ASCII character set, this include .It "\&166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y'' \t172\ ``z''" .It "\&173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" .El +.Pp +The +.Fn isgraph_l +function takes an explicit locale argument, whereas the +.Fn isgraph +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isgraph -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isgraph_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 @@ -104,3 +114,7 @@ The .Fn isgraph function conforms to .St -isoC . +The +.Fn isgraph_l +function conforms to +.St -p1003.1-2008 . Modified: stable/9/lib/libc/locale/islower.3 ============================================================================== --- stable/9/lib/libc/locale/islower.3 Wed Aug 29 13:19:27 2012 (r239832) +++ stable/9/lib/libc/locale/islower.3 Wed Aug 29 13:28:25 2012 (r239833) @@ -32,7 +32,7 @@ .\" @(#)islower.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd July 30, 2012 .Dt ISLOWER 3 .Os .Sh NAME @@ -44,6 +44,8 @@ .In ctype.h .Ft int .Fn islower "int c" +.Ft int +.Fn islower_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn islower @@ -64,11 +66,18 @@ In the ASCII character set, this include .It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" .It "\&172\ ``z''" .El +The +.Fn islower_l +function takes an explicit locale argument, whereas the +.Fn islower +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn islower -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn islower_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 @@ -89,3 +98,7 @@ The .Fn islower function conforms to .St -isoC . +The +.Fn islower_l +function conforms to +.St -p1003.1-2008 . Modified: stable/9/lib/libc/locale/ispunct.3 ============================================================================== --- stable/9/lib/libc/locale/ispunct.3 Wed Aug 29 13:19:27 2012 (r239832) +++ stable/9/lib/libc/locale/ispunct.3 Wed Aug 29 13:28:25 2012 (r239833) @@ -32,7 +32,7 @@ .\" @(#)ispunct.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd July 30, 2012 .Dt ISPUNCT 3 .Os .Sh NAME @@ -44,6 +44,8 @@ .In ctype.h .Ft int .Fn ispunct "int c" +.Ft int +.Fn ispunct_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn ispunct @@ -70,11 +72,19 @@ In the ASCII character set, this include .It "\&136\ ``^'' \t137\ ``_'' \t140\ ```'' \t173\ ``{'' \t174\ ``|''" .It "\&175\ ``}'' \t176\ ``~''" .El +.Pp +The +.Fn ispunct_l +function takes an explicit locale argument, whereas the +.Fn ispunct +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn ispunct -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn ispunct_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 @@ -94,3 +104,7 @@ The .Fn ispunct function conforms to .St -isoC . +The +.Fn ispunct_l +function conforms to +.St -p1003.1-2008 . Modified: stable/9/lib/libc/locale/isspace.3 ============================================================================== --- stable/9/lib/libc/locale/isspace.3 Wed Aug 29 13:19:27 2012 (r239832) +++ stable/9/lib/libc/locale/isspace.3 Wed Aug 29 13:28:25 2012 (r239833) @@ -32,7 +32,7 @@ .\" @(#)isspace.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd July 30, 2012 .Dt ISSPACE 3 .Os .Sh NAME @@ -44,6 +44,8 @@ .In ctype.h .Ft int .Fn isspace "int c" +.Ft int +.Fn isspace_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn isspace @@ -61,11 +63,19 @@ The value of the argument must be repres .Vt "unsigned char" or the value of .Dv EOF . +.Pp +The +.Fn isspace_l +function takes an explicit locale argument, whereas the +.Fn isspace +function uses the current global or per-thread locale. .Sh RETURN VALUES The .Fn isspace -function returns zero if the character tests false and -returns non-zero if the character tests true. +and +.Fn isspace_l +functions return zero if the character tests false and +return non-zero if the character tests true. .Sh COMPATIBILITY The .Bx 4.4 @@ -86,3 +96,7 @@ The .Fn isspace function conforms to .St -isoC . +The +.Fn isspace_l +function conforms to +.St -p1003.1-2008 . Copied: stable/9/lib/libc/locale/iswalnum_l.3 (from r238781, head/lib/libc/locale/iswalnum_l.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/locale/iswalnum_l.3 Wed Aug 29 13:28:25 2012 (r239833, copy of r238781, head/lib/libc/locale/iswalnum_l.3) @@ -0,0 +1,168 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dt ISWALNUM_L 3 +.Dd July 25, 2012 +.Os +.Sh NAME +.Nm iswalnum_l , +.Nm iswalpha_l , +.Nm iswcntrl_l , +.Nm iswctype_l , +.Nm iswdigit_l , +.Nm iswgraph_l , +.Nm iswlower_l , +.Nm iswprint_l , +.Nm iswpunct_l , +.Nm iswspace_l , +.Nm iswupper_l , +.Nm iswxdigit_l , +.Nm towlower_l , +.Nm towupper_l , +.Nm wctype_l , +.Nm iswblank_l , +.Nm iswhexnumber_l , +.Nm iswideogram_l , +.Nm iswnumber_l , +.Nm iswphonogram_l , +.Nm iswrune_l , +.Nm iswspecial_l , +.Nm nextwctype_l , +.Nm towctrans_l , +.Nm wctrans_l +.Nd wide character classification utilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft int +.Fn iswalnum_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswalpha_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswcntrl_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswctype_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswdigit_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswgraph_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswlower_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswprint_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswpunct_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswspace_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswupper_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswxdigit_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn towlower_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn towupper_l "wint_t wc" "locale_t loc" +.Ft wctype_t +.Fn wctype_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswblank_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswhexnumber_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswideogram_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswnumber_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswphonogram_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswrune_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswspecial_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn nextwctype_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn towctrans_l "wint_t wc" "wctrans_t" "locale_t loc" +.Ft wctrans_t +.Fn wctrans_l "const char *" "locale_t loc" +.Sh DESCRIPTION +The above functions are character classification utility functions, +for use with wide characters +.Vt ( wchar_t +or +.Vt wint_t ) +in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specified locale rather than the global or per-thread locale. +These functions may be implemented as inline functions in +.In wctype.h +and as functions in the C library. +See the specific manual pages for more information. +.Sh RETURN VALUES +These functions return the same things as their non-locale versions. +If the locale is invalid, their behaviors are undefined. +.Sh SEE ALSO +.Xr iswalnum 3 , +.Xr iswalpha 3 , +.Xr iswblank 3 , +.Xr iswcntrl 3 , +.Xr iswctype 3 , +.Xr iswdigit 3 , +.Xr iswgraph 3 , +.Xr iswhexnumber 3 , +.Xr iswideogram 3 , +.Xr iswlower 3 , +.Xr iswnumber 3 , +.Xr iswphonogram 3 , +.Xr iswprint 3 , +.Xr iswpunct 3 , +.Xr iswrune 3 , +.Xr iswspace 3 , +.Xr iswspecial 3 , +.Xr iswupper 3 , +.Xr iswxdigit 3 , +.Xr nextwctype 3 , +.Xr towctrans 3 , +.Xr towlower 3 , +.Xr towupper 3 , +.Xr wctrans 3 , +.Xr wctype 3 +.Sh STANDARDS +These functions conform to +.St -p1003.1-2008 , +except for +.Fn iswascii_l , +.Fn iswhexnumber_l , +.Fn iswideogram_l , +.Fn iswphonogram_l , +.Fn iswrune_l , +.Fn iswspecial_l +and +.Fn nextwctype_l +which are +.Fx +extensions. Modified: stable/9/lib/libc/locale/nl_langinfo.3 ============================================================================== --- stable/9/lib/libc/locale/nl_langinfo.3 Wed Aug 29 13:19:27 2012 (r239832) +++ stable/9/lib/libc/locale/nl_langinfo.3 Wed Aug 29 13:28:25 2012 (r239833) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2001 +.Dd July 30, 2012 .Dt NL_LANGINFO 3 .Os .Sh NAME @@ -36,11 +36,16 @@ .In langinfo.h .Ft char * .Fn nl_langinfo "nl_item item" +.Ft char * +.Fn nl_langinfo_l "nl_item item" "locale_t loc" .Sh DESCRIPTION The .Fn nl_langinfo function returns a pointer to a string containing information relevant to -the particular language or cultural area defined in the program's locale. +the particular language or cultural area defined in the program or thread's +locale, or in the case of +.Fn nl_langinfo_l , +the locale passed as the second argument. The manifest constant names and values of .Fa item are defined in @@ -60,6 +65,9 @@ In a locale where langinfo data is not d returns a pointer to the corresponding string in the .Tn POSIX locale. +.Fn nl_langinfo_l +returns the same values as +.Fn nl_langinfo . In all locales, .Fn nl_langinfo returns a pointer to an empty string if @@ -83,6 +91,10 @@ The .Fn nl_langinfo function conforms to .St -susv2 . +The +.Fn nl_langinfo_l +function conforms to +.St -p1003.1-2008 . .Sh HISTORY The .Fn nl_langinfo From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 14:06:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4CC70106564A; Wed, 29 Aug 2012 14:06:59 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 369508FC08; Wed, 29 Aug 2012 14:06:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TE6xuR058085; Wed, 29 Aug 2012 14:06:59 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TE6wkr058083; Wed, 29 Aug 2012 14:06:59 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201208291406.q7TE6wkr058083@svn.freebsd.org> From: Isabell Long Date: Wed, 29 Aug 2012 14:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239834 - stable/9/sbin/geom/class/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 14:06:59 -0000 Author: issyl0 (doc committer) Date: Wed Aug 29 14:06:58 2012 New Revision: 239834 URL: http://svn.freebsd.org/changeset/base/239834 Log: MFC r238813 from HEAD: - The ad(4) driver no longer exists in FreeBSD CURRENT or 9, so change the references to it in gsched(8) to the existing ada(4) driver. PR: docs/170085 Approved by: gjb (mentor) Modified: stable/9/sbin/geom/class/sched/gsched.8 Directory Properties: stable/9/sbin/geom/class/sched/ (props changed) Modified: stable/9/sbin/geom/class/sched/gsched.8 ============================================================================== --- stable/9/sbin/geom/class/sched/gsched.8 Wed Aug 29 13:28:25 2012 (r239833) +++ stable/9/sbin/geom/class/sched/gsched.8 Wed Aug 29 14:06:58 2012 (r239834) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2010 +.Dd July 26, 2012 .Dt GSCHED 8 .Os .Sh NAME @@ -135,19 +135,19 @@ maximum amount of debug information is p Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to create a scheduling provider for disk -.Pa /dev/ad0 , +.Pa /dev/ada0 , and how to destroy it. .Bd -literal -offset indent # Load the geom_sched module: kldload geom_sched # Load some scheduler classes used by geom_sched: kldload gsched_rr -# Configure device ad0 to use scheduler "rr": -geom sched insert -a rr ad0 -# Now provider ad0 uses the "rr" algorithm; -# the new geom is ad0.sched. +# Configure device ada0 to use scheduler "rr": +geom sched insert -a rr ada0 +# Now provider ada0 uses the "rr" algorithm; +# the new geom is ada0.sched. # Remove the scheduler on the device: -geom sched destroy -v ad0.sched. +geom sched destroy -v ada0.sched. .Ed .Pp .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:06:35 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 75F051065674; Wed, 29 Aug 2012 15:06:35 +0000 (UTC) Date: Wed, 29 Aug 2012 15:06:35 +0000 From: Alexey Dokuchaev To: Gavin Atkinson Message-ID: <20120829150635.GA43130@FreeBSD.org> References: <201208291123.q7TBNK6G035350@svn.freebsd.org> <201208290746.03772.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org, John Baldwin Subject: Re: svn commit: r239817 - in stable/9: share/man/man4 share/syscons/keymaps sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:06:35 -0000 On Wed, Aug 29, 2012 at 02:27:53PM +0100, Gavin Atkinson wrote: > Indeed it was, and it's not clear why this happened at all (it didn't show > up in "svn diff", and I've never knowingly touched that file). Luckily, > it apparently hasn't broken the SVN-CVS exporter. I would not trust "svn diff" to reveal all uncommitted changes. "svn st" is better suited for this. ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:13:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC71D106564A; Wed, 29 Aug 2012 15:13:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C41868FC14; Wed, 29 Aug 2012 15:13:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFDDVf066183; Wed, 29 Aug 2012 15:13:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFDDTd066174; Wed, 29 Aug 2012 15:13:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291513.q7TFDDTd066174@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239835 - in stable/9/sys: conf kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:13:14 -0000 Author: kib Date: Wed Aug 29 15:13:13 2012 New Revision: 239835 URL: http://svn.freebsd.org/changeset/base/239835 Log: MFC r236317: Add a rangelock implementation, intended to be used to range-locking the i/o regions of the vnode data space. The implementation is quite simple-minded, it uses the list of the lock requests, ordered by arrival time. Each request may be for read or for write. The implementation is fair FIFO. Added: stable/9/sys/kern/kern_rangelock.c - copied unchanged from r236317, head/sys/kern/kern_rangelock.c stable/9/sys/sys/rangelock.h - copied unchanged from r236317, head/sys/sys/rangelock.h Modified: stable/9/sys/conf/files stable/9/sys/kern/kern_thread.c stable/9/sys/kern/vfs_subr.c stable/9/sys/sys/proc.h stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Wed Aug 29 14:06:58 2012 (r239834) +++ stable/9/sys/conf/files Wed Aug 29 15:13:13 2012 (r239835) @@ -2381,6 +2381,7 @@ kern/kern_priv.c standard kern/kern_proc.c standard kern/kern_prot.c standard kern/kern_racct.c standard +kern/kern_rangelock.c standard kern/kern_rctl.c standard kern/kern_resource.c standard kern/kern_rmlock.c standard Copied: stable/9/sys/kern/kern_rangelock.c (from r236317, head/sys/kern/kern_rangelock.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/kern/kern_rangelock.c Wed Aug 29 15:13:13 2012 (r239835, copy of r236317, head/sys/kern/kern_rangelock.c) @@ -0,0 +1,246 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +struct rl_q_entry { + TAILQ_ENTRY(rl_q_entry) rl_q_link; + off_t rl_q_start, rl_q_end; + int rl_q_flags; +}; + +static uma_zone_t rl_entry_zone; + +static void +rangelock_sys_init(void) +{ + + rl_entry_zone = uma_zcreate("rl_entry", sizeof(struct rl_q_entry), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); +} +SYSINIT(vfs, SI_SUB_LOCK, SI_ORDER_ANY, rangelock_sys_init, NULL); + +static struct rl_q_entry * +rlqentry_alloc(void) +{ + + return (uma_zalloc(rl_entry_zone, M_WAITOK)); +} + +void +rlqentry_free(struct rl_q_entry *rleq) +{ + + uma_zfree(rl_entry_zone, rleq); +} + +void +rangelock_init(struct rangelock *lock) +{ + + TAILQ_INIT(&lock->rl_waiters); + lock->rl_currdep = NULL; +} + +void +rangelock_destroy(struct rangelock *lock) +{ + + KASSERT(TAILQ_EMPTY(&lock->rl_waiters), ("Dangling waiters")); +} + +/* + * Verifies the supplied rl_q_entries for compatibility. Returns true + * if the rangelock queue entries are not compatible, false if they are. + * + * Two entries are compatible if their ranges do not overlap, or both + * entries are for read. + */ +static int +rangelock_incompatible(const struct rl_q_entry *e1, + const struct rl_q_entry *e2) +{ + + if ((e1->rl_q_flags & RL_LOCK_TYPE_MASK) == RL_LOCK_READ && + (e2->rl_q_flags & RL_LOCK_TYPE_MASK) == RL_LOCK_READ) + return (0); + if (e1->rl_q_start < e2->rl_q_end && e1->rl_q_end > e2->rl_q_start) + return (1); + return (0); +} + +/* + * Recalculate the lock->rl_currdep after an unlock. + */ +static void +rangelock_calc_block(struct rangelock *lock) +{ + struct rl_q_entry *entry, *entry1, *whead; + + if (lock->rl_currdep == TAILQ_FIRST(&lock->rl_waiters) && + lock->rl_currdep != NULL) + lock->rl_currdep = TAILQ_NEXT(lock->rl_currdep, rl_q_link); + for (entry = lock->rl_currdep; entry != NULL; + entry = TAILQ_NEXT(entry, rl_q_link)) { + TAILQ_FOREACH(entry1, &lock->rl_waiters, rl_q_link) { + if (rangelock_incompatible(entry, entry1)) + goto out; + if (entry1 == entry) + break; + } + } +out: + lock->rl_currdep = entry; + TAILQ_FOREACH(whead, &lock->rl_waiters, rl_q_link) { + if (whead == lock->rl_currdep) + break; + if (!(whead->rl_q_flags & RL_LOCK_GRANTED)) { + whead->rl_q_flags |= RL_LOCK_GRANTED; + wakeup(whead); + } + } +} + +static void +rangelock_unlock_locked(struct rangelock *lock, struct rl_q_entry *entry, + struct mtx *ilk) +{ + + MPASS(lock != NULL && entry != NULL && ilk != NULL); + mtx_assert(ilk, MA_OWNED); + KASSERT(entry != lock->rl_currdep, ("stuck currdep")); + + TAILQ_REMOVE(&lock->rl_waiters, entry, rl_q_link); + rangelock_calc_block(lock); + mtx_unlock(ilk); + if (curthread->td_rlqe == NULL) + curthread->td_rlqe = entry; + else + rlqentry_free(entry); +} + +void +rangelock_unlock(struct rangelock *lock, void *cookie, struct mtx *ilk) +{ + + MPASS(lock != NULL && cookie != NULL && ilk != NULL); + + mtx_lock(ilk); + rangelock_unlock_locked(lock, cookie, ilk); +} + +/* + * Unlock the sub-range of granted lock. + */ +void * +rangelock_unlock_range(struct rangelock *lock, void *cookie, off_t start, + off_t end, struct mtx *ilk) +{ + struct rl_q_entry *entry; + + MPASS(lock != NULL && cookie != NULL && ilk != NULL); + entry = cookie; + KASSERT(entry->rl_q_flags & RL_LOCK_GRANTED, + ("Unlocking non-granted lock")); + KASSERT(entry->rl_q_start == start, ("wrong start")); + KASSERT(entry->rl_q_end >= end, ("wrong end")); + + mtx_lock(ilk); + if (entry->rl_q_end == end) { + rangelock_unlock_locked(lock, cookie, ilk); + return (NULL); + } + entry->rl_q_end = end; + rangelock_calc_block(lock); + mtx_unlock(ilk); + return (cookie); +} + +/* + * Add the lock request to the queue of the pending requests for + * rangelock. Sleep until the request can be granted. + */ +static void * +rangelock_enqueue(struct rangelock *lock, off_t start, off_t end, int mode, + struct mtx *ilk) +{ + struct rl_q_entry *entry; + struct thread *td; + + MPASS(lock != NULL && ilk != NULL); + + td = curthread; + if (td->td_rlqe != NULL) { + entry = td->td_rlqe; + td->td_rlqe = NULL; + } else + entry = rlqentry_alloc(); + MPASS(entry != NULL); + entry->rl_q_flags = mode; + entry->rl_q_start = start; + entry->rl_q_end = end; + + mtx_lock(ilk); + /* + * XXXKIB TODO. Check that a thread does not try to enqueue a + * lock that is incompatible with another request from the same + * thread. + */ + + TAILQ_INSERT_TAIL(&lock->rl_waiters, entry, rl_q_link); + if (lock->rl_currdep == NULL) + lock->rl_currdep = entry; + rangelock_calc_block(lock); + while (!(entry->rl_q_flags & RL_LOCK_GRANTED)) + msleep(entry, ilk, 0, "range", 0); + mtx_unlock(ilk); + return (entry); +} + +void * +rangelock_rlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk) +{ + + return (rangelock_enqueue(lock, start, end, RL_LOCK_READ, ilk)); +} + +void * +rangelock_wlock(struct rangelock *lock, off_t start, off_t end, struct mtx *ilk) +{ + + return (rangelock_enqueue(lock, start, end, RL_LOCK_WRITE, ilk)); +} Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Wed Aug 29 14:06:58 2012 (r239834) +++ stable/9/sys/kern/kern_thread.c Wed Aug 29 15:13:13 2012 (r239835) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -205,6 +206,7 @@ thread_init(void *mem, int size, int fla td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); + td->td_rlqe = NULL; EVENTHANDLER_INVOKE(thread_init, td); td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); @@ -222,6 +224,7 @@ thread_fini(void *mem, int size) td = (struct thread *)mem; EVENTHANDLER_INVOKE(thread_fini, td); + rlqentry_free(td->td_rlqe); turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); umtx_thread_fini(td); Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Wed Aug 29 14:06:58 2012 (r239834) +++ stable/9/sys/kern/vfs_subr.c Wed Aug 29 15:13:13 2012 (r239835) @@ -1026,6 +1026,7 @@ alloc: if ((mp->mnt_kern_flag & MNTK_NOKNOTE) != 0) vp->v_vflag |= VV_NOKNOTE; } + rangelock_init(&vp->v_rl); *vpp = vp; return (0); @@ -2468,6 +2469,7 @@ vdropl(struct vnode *vp) /* XXX Elsewhere we detect an already freed vnode via NULL v_op. */ vp->v_op = NULL; #endif + rangelock_destroy(&vp->v_rl); lockdestroy(vp->v_vnlock); mtx_destroy(&vp->v_interlock); mtx_destroy(BO_MTX(bo)); Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Wed Aug 29 14:06:58 2012 (r239834) +++ stable/9/sys/sys/proc.h Wed Aug 29 15:13:13 2012 (r239835) @@ -313,6 +313,7 @@ struct thread { const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ struct proc *td_rfppwait_p; /* (k) The vforked child */ + struct rl_q_entry *td_rlqe; /* (k) Associated range lock entry. */ }; struct mtx *thread_lock_block(struct thread *); Copied: stable/9/sys/sys/rangelock.h (from r236317, head/sys/sys/rangelock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/sys/rangelock.h Wed Aug 29 15:13:13 2012 (r239835, copy of r236317, head/sys/sys/rangelock.h) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_RANGELOCK_H +#define _SYS_RANGELOCK_H + +#include + +#define RL_LOCK_READ 0x0001 +#define RL_LOCK_WRITE 0x0002 +#define RL_LOCK_TYPE_MASK 0x0003 +#define RL_LOCK_GRANTED 0x0004 + +struct rl_q_entry; + +/* + * The structure representing the range lock. Caller may request + * read or write access to the range of bytes. Access is granted if + * all existing lock owners are compatible with the request. Two lock + * owners are compatible if their ranges do not overlap, or both + * owners are for read. + * + * Access to the structure itself is synchronized with the externally + * supplied mutex. + * + * rl_waiters is the queue of lock requests in the order of arrival. + * rl_currdep is the first lock request that cannot be granted now due + * to the preceding requests conflicting with it. + */ +struct rangelock { + TAILQ_HEAD(, rl_q_entry) rl_waiters; + struct rl_q_entry *rl_currdep; +}; + +#ifdef _KERNEL + +struct mtx; + +void rangelock_init(struct rangelock *lock); +void rangelock_destroy(struct rangelock *lock); +void rangelock_unlock(struct rangelock *lock, void *cookie, + struct mtx *ilk); +void *rangelock_unlock_range(struct rangelock *lock, void *cookie, + off_t start, off_t end, struct mtx *ilk); +void *rangelock_rlock(struct rangelock *lock, off_t start, off_t end, + struct mtx *ilk); +void *rangelock_wlock(struct rangelock *lock, off_t start, off_t end, + struct mtx *ilk); +void rlqentry_free(struct rl_q_entry *rlqe); + +#endif /* _KERNEL */ + +#endif /* _SYS_RANGELOCK_H */ Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Wed Aug 29 14:06:58 2012 (r239834) +++ stable/9/sys/sys/vnode.h Wed Aug 29 15:13:13 2012 (r239835) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -165,6 +166,7 @@ struct vnode { struct vpollinfo *v_pollinfo; /* i Poll events, p for *v_pi */ struct label *v_label; /* MAC label for vnode */ struct lockf *v_lockf; /* Byte-level advisory lock list */ + struct rangelock v_rl; /* Byte-range lock */ }; #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ @@ -682,6 +684,15 @@ int vn_extattr_rm(struct vnode *vp, int int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp); +#define vn_rangelock_unlock(vp, cookie) \ + rangelock_unlock(&(vp)->v_rl, (cookie), VI_MTX(vp)) +#define vn_rangelock_unlock_range(vp, cookie, start, end) \ + rangelock_unlock_range(&(vp)->v_rl, (cookie), (start), (end), \ + VI_MTX(vp)) +#define vn_rangelock_rlock(vp, start, end) \ + rangelock_rlock(&(vp)->v_rl, (start), (end), VI_MTX(vp)) +#define vn_rangelock_wlock(vp, start, end) \ + rangelock_wlock(&(vp)->v_rl, (start), (end), VI_MTX(vp)) int vfs_cache_lookup(struct vop_lookup_args *ap); void vfs_timestamp(struct timespec *); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:18:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F3AE1065673; Wed, 29 Aug 2012 15:18:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B69A8FC0A; Wed, 29 Aug 2012 15:18:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFIuTL066973; Wed, 29 Aug 2012 15:18:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFIup7066971; Wed, 29 Aug 2012 15:18:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291518.q7TFIup7066971@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239836 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:18:57 -0000 Author: des Date: Wed Aug 29 15:18:56 2012 New Revision: 239836 URL: http://svn.freebsd.org/changeset/base/239836 Log: Change the gptboot example so the boot partition is aligned on a 4 kB boundary. MFC after: 3 days Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Wed Aug 29 15:13:13 2012 (r239835) +++ head/sbin/geom/class/part/gpart.8 Wed Aug 29 15:18:56 2012 (r239836) @@ -1006,11 +1006,12 @@ or but smaller than 545 kB since the first-stage loader will load the entire partition into memory during boot, regardless of how much data it actually contains. -This example uses 94 blocks (47 kB) so the next partition will be +This example uses 88 blocks (44 kB) so the next partition will be aligned on a 64 kB boundary without the need to specify an explicit offset or alignment. +The boot partition itself is aligned on a 4 kB boundary. .Bd -literal -offset indent -/sbin/gpart add -b 34 -s 94 -t freebsd-boot ad0 +/sbin/gpart add -b 40 -s 88 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:21:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8D3E1065677; Wed, 29 Aug 2012 15:21:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D22578FC1C; Wed, 29 Aug 2012 15:21:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFLRD8067299; Wed, 29 Aug 2012 15:21:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFLRHO067294; Wed, 29 Aug 2012 15:21:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291521.q7TFLRHO067294@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239837 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:21:28 -0000 Author: kib Date: Wed Aug 29 15:21:27 2012 New Revision: 239837 URL: http://svn.freebsd.org/changeset/base/239837 Log: MFC r236321: Add vn_io_fault(), which is a facility to prevent page faults while filesystems perform copyin/copyout of the file data into the usermode buffer. Modified: stable/9/sys/kern/vfs_vnops.c stable/9/sys/sys/mount.h stable/9/sys/sys/proc.h stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:18:56 2012 (r239836) +++ stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:21:27 2012 (r239837) @@ -65,10 +65,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include +#include static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; +static fo_rdwr_t vn_io_fault; static fo_truncate_t vn_truncate; static fo_ioctl_t vn_ioctl; static fo_poll_t vn_poll; @@ -77,8 +82,8 @@ static fo_stat_t vn_statfile; static fo_close_t vn_closefile; struct fileops vnops = { - .fo_read = vn_read, - .fo_write = vn_write, + .fo_read = vn_io_fault, + .fo_write = vn_io_fault, .fo_truncate = vn_truncate, .fo_ioctl = vn_ioctl, .fo_poll = vn_poll, @@ -362,57 +367,56 @@ sequential_heuristic(struct uio *uio, st * Package up an I/O request on a vnode into a uio and do it. */ int -vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, - aresid, td) - enum uio_rw rw; - struct vnode *vp; - void *base; - int len; - off_t offset; - enum uio_seg segflg; - int ioflg; - struct ucred *active_cred; - struct ucred *file_cred; - ssize_t *aresid; - struct thread *td; +vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, + enum uio_seg segflg, int ioflg, struct ucred *active_cred, + struct ucred *file_cred, ssize_t *aresid, struct thread *td) { struct uio auio; struct iovec aiov; struct mount *mp; struct ucred *cred; + void *rl_cookie; int error, lock_flags; VFS_ASSERT_GIANT(vp->v_mount); + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + aiov.iov_base = base; + aiov.iov_len = len; + auio.uio_resid = len; + auio.uio_offset = offset; + auio.uio_segflg = segflg; + auio.uio_rw = rw; + auio.uio_td = td; + error = 0; + if ((ioflg & IO_NODELOCKED) == 0) { + if (rw == UIO_READ) { + rl_cookie = vn_rangelock_rlock(vp, offset, + offset + len); + } else { + rl_cookie = vn_rangelock_wlock(vp, offset, + offset + len); + } mp = NULL; if (rw == UIO_WRITE) { if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) - return (error); + goto out; if (MNT_SHARED_WRITES(mp) || - ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) lock_flags = LK_SHARED; - } else { + else lock_flags = LK_EXCLUSIVE; - } - vn_lock(vp, lock_flags | LK_RETRY); } else - vn_lock(vp, LK_SHARED | LK_RETRY); + lock_flags = LK_SHARED; + vn_lock(vp, lock_flags | LK_RETRY); + } else + rl_cookie = NULL; - } ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - aiov.iov_base = base; - aiov.iov_len = len; - auio.uio_resid = len; - auio.uio_offset = offset; - auio.uio_segflg = segflg; - auio.uio_rw = rw; - auio.uio_td = td; - error = 0; #ifdef MAC if ((ioflg & IO_NOMACCHECK) == 0) { if (rw == UIO_READ) @@ -424,7 +428,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl } #endif if (error == 0) { - if (file_cred) + if (file_cred != NULL) cred = file_cred; else cred = active_cred; @@ -439,10 +443,13 @@ vn_rdwr(rw, vp, base, len, offset, segfl if (auio.uio_resid && error == 0) error = EIO; if ((ioflg & IO_NODELOCKED) == 0) { - if (rw == UIO_WRITE && vp->v_type != VCHR) - vn_finished_write(mp); VOP_UNLOCK(vp, 0); + if (mp != NULL) + vn_finished_write(mp); } + out: + if (rl_cookie != NULL) + vn_rangelock_unlock(vp, rl_cookie); return (error); } @@ -758,29 +765,269 @@ unlock: return (error); } +static const int io_hold_cnt = 16; + /* - * File table truncate routine. + * The vn_io_fault() is a wrapper around vn_read() and vn_write() to + * prevent the following deadlock: + * + * Assume that the thread A reads from the vnode vp1 into userspace + * buffer buf1 backed by the pages of vnode vp2. If a page in buf1 is + * currently not resident, then system ends up with the call chain + * vn_read() -> VOP_READ(vp1) -> uiomove() -> [Page Fault] -> + * vm_fault(buf1) -> vnode_pager_getpages(vp2) -> VOP_GETPAGES(vp2) + * which establishes lock order vp1->vn_lock, then vp2->vn_lock. + * If, at the same time, thread B reads from vnode vp2 into buffer buf2 + * backed by the pages of vnode vp1, and some page in buf2 is not + * resident, we get a reversed order vp2->vn_lock, then vp1->vn_lock. + * + * To prevent the lock order reversal and deadlock, vn_io_fault() does + * not allow page faults to happen during VOP_READ() or VOP_WRITE(). + * Instead, it first tries to do the whole range i/o with pagefaults + * disabled. If all pages in the i/o buffer are resident and mapped, + * VOP will succeed (ignoring the genuine filesystem errors). + * Otherwise, we get back EFAULT, and vn_io_fault() falls back to do + * i/o in chunks, with all pages in the chunk prefaulted and held + * using vm_fault_quick_hold_pages(). + * + * Filesystems using this deadlock avoidance scheme should use the + * array of the held pages from uio, saved in the curthread->td_ma, + * instead of doing uiomove(). A helper function + * vn_io_fault_uiomove() converts uiomove request into + * uiomove_fromphys() over td_ma array. + * + * Since vnode locks do not cover the whole i/o anymore, rangelocks + * make the current i/o request atomic with respect to other i/os and + * truncations. */ static int -vn_truncate(fp, length, active_cred, td) - struct file *fp; - off_t length; - struct ucred *active_cred; +vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + vm_page_t ma[io_hold_cnt + 2]; + struct uio *uio_clone, short_uio; + struct iovec short_iovec[1]; + fo_rdwr_t *doio; + struct vnode *vp; + void *rl_cookie; + struct mount *mp; + vm_page_t *prev_td_ma; + int cnt, error, save, saveheld, prev_td_ma_cnt; + vm_offset_t addr, end; + vm_prot_t prot; + size_t len, resid; + ssize_t adv; + + if (uio->uio_rw == UIO_READ) + doio = vn_read; + else + doio = vn_write; + vp = fp->f_vnode; + if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || + ((mp = vp->v_mount) != NULL && + (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0)) + return (doio(fp, uio, active_cred, flags, td)); + + /* + * The UFS follows IO_UNIT directive and replays back both + * uio_offset and uio_resid if an error is encountered during the + * operation. But, since the iovec may be already advanced, + * uio is still in an inconsistent state. + * + * Cache a copy of the original uio, which is advanced to the redo + * point using UIO_NOCOPY below. + */ + uio_clone = cloneuio(uio); + resid = uio->uio_resid; + + short_uio.uio_segflg = UIO_USERSPACE; + short_uio.uio_rw = uio->uio_rw; + short_uio.uio_td = uio->uio_td; + + if (uio->uio_rw == UIO_READ) { + prot = VM_PROT_WRITE; + rl_cookie = vn_rangelock_rlock(vp, uio->uio_offset, + uio->uio_offset + uio->uio_resid); + } else { + prot = VM_PROT_READ; + if ((fp->f_flag & O_APPEND) != 0 || (flags & FOF_OFFSET) == 0) + /* For appenders, punt and lock the whole range. */ + rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); + else + rl_cookie = vn_rangelock_wlock(vp, uio->uio_offset, + uio->uio_offset + uio->uio_resid); + } + + save = vm_fault_disable_pagefaults(); + error = doio(fp, uio, active_cred, flags, td); + if (error != EFAULT) + goto out; + + uio_clone->uio_segflg = UIO_NOCOPY; + uiomove(NULL, resid - uio->uio_resid, uio_clone); + uio_clone->uio_segflg = uio->uio_segflg; + + saveheld = curthread_pflags_set(TDP_UIOHELD); + prev_td_ma = td->td_ma; + prev_td_ma_cnt = td->td_ma_cnt; + + while (uio_clone->uio_resid != 0) { + len = uio_clone->uio_iov->iov_len; + if (len == 0) { + KASSERT(uio_clone->uio_iovcnt >= 1, + ("iovcnt underflow")); + uio_clone->uio_iov++; + uio_clone->uio_iovcnt--; + continue; + } + + addr = (vm_offset_t)uio_clone->uio_iov->iov_base; + end = round_page(addr + len); + cnt = howmany(end - trunc_page(addr), PAGE_SIZE); + /* + * A perfectly misaligned address and length could cause + * both the start and the end of the chunk to use partial + * page. +2 accounts for such a situation. + */ + if (cnt > io_hold_cnt + 2) { + len = io_hold_cnt * PAGE_SIZE; + KASSERT(howmany(round_page(addr + len) - + trunc_page(addr), PAGE_SIZE) <= io_hold_cnt + 2, + ("cnt overflow")); + } + cnt = vm_fault_quick_hold_pages(&td->td_proc->p_vmspace->vm_map, + addr, len, prot, ma, io_hold_cnt + 2); + if (cnt == -1) { + error = EFAULT; + break; + } + short_uio.uio_iov = &short_iovec[0]; + short_iovec[0].iov_base = (void *)addr; + short_uio.uio_iovcnt = 1; + short_uio.uio_resid = short_iovec[0].iov_len = len; + short_uio.uio_offset = uio_clone->uio_offset; + td->td_ma = ma; + td->td_ma_cnt = cnt; + + error = doio(fp, &short_uio, active_cred, flags, td); + vm_page_unhold_pages(ma, cnt); + adv = len - short_uio.uio_resid; + + uio_clone->uio_iov->iov_base = + (char *)uio_clone->uio_iov->iov_base + adv; + uio_clone->uio_iov->iov_len -= adv; + uio_clone->uio_resid -= adv; + uio_clone->uio_offset += adv; + + uio->uio_resid -= adv; + uio->uio_offset += adv; + + if (error != 0 || adv == 0) + break; + } + td->td_ma = prev_td_ma; + td->td_ma_cnt = prev_td_ma_cnt; + curthread_pflags_restore(saveheld); +out: + vm_fault_enable_pagefaults(save); + vn_rangelock_unlock(vp, rl_cookie); + free(uio_clone, M_IOV); + return (error); +} + +/* + * Helper function to perform the requested uiomove operation using + * the held pages for io->uio_iov[0].iov_base buffer instead of + * copyin/copyout. Access to the pages with uiomove_fromphys() + * instead of iov_base prevents page faults that could occur due to + * pmap_collect() invalidating the mapping created by + * vm_fault_quick_hold_pages(), or pageout daemon, page laundry or + * object cleanup revoking the write access from page mappings. + * + * Filesystems specified MNTK_NO_IOPF shall use vn_io_fault_uiomove() + * instead of plain uiomove(). + */ +int +vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio) +{ + struct uio transp_uio; + struct iovec transp_iov[1]; struct thread *td; + size_t adv; + int error, pgadv; + + td = curthread; + if ((td->td_pflags & TDP_UIOHELD) == 0 || + uio->uio_segflg != UIO_USERSPACE) + return (uiomove(data, xfersize, uio)); + + KASSERT(uio->uio_iovcnt == 1, ("uio_iovcnt %d", uio->uio_iovcnt)); + transp_iov[0].iov_base = data; + transp_uio.uio_iov = &transp_iov[0]; + transp_uio.uio_iovcnt = 1; + if (xfersize > uio->uio_resid) + xfersize = uio->uio_resid; + transp_uio.uio_resid = transp_iov[0].iov_len = xfersize; + transp_uio.uio_offset = 0; + transp_uio.uio_segflg = UIO_SYSSPACE; + /* + * Since transp_iov points to data, and td_ma page array + * corresponds to original uio->uio_iov, we need to invert the + * direction of the i/o operation as passed to + * uiomove_fromphys(). + */ + switch (uio->uio_rw) { + case UIO_WRITE: + transp_uio.uio_rw = UIO_READ; + break; + case UIO_READ: + transp_uio.uio_rw = UIO_WRITE; + break; + } + transp_uio.uio_td = uio->uio_td; + error = uiomove_fromphys(td->td_ma, + ((vm_offset_t)uio->uio_iov->iov_base) & PAGE_MASK, + xfersize, &transp_uio); + adv = xfersize - transp_uio.uio_resid; + pgadv = + (((vm_offset_t)uio->uio_iov->iov_base + adv) >> PAGE_SHIFT) - + (((vm_offset_t)uio->uio_iov->iov_base) >> PAGE_SHIFT); + td->td_ma += pgadv; + KASSERT(td->td_ma_cnt >= pgadv, ("consumed pages %d %d", td->td_ma_cnt, + pgadv)); + td->td_ma_cnt -= pgadv; + uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + adv; + uio->uio_iov->iov_len -= adv; + uio->uio_resid -= adv; + uio->uio_offset += adv; + return (error); +} + +/* + * File table truncate routine. + */ +static int +vn_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) { struct vattr vattr; struct mount *mp; struct vnode *vp; + void *rl_cookie; int vfslocked; int error; vp = fp->f_vnode; + + /* + * Lock the whole range for truncation. Otherwise split i/o + * might happen partly before and partly after the truncation. + */ + rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX); vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); - if (error) { - VFS_UNLOCK_GIANT(vfslocked); - return (error); - } + if (error) + goto out1; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type == VDIR) { error = EISDIR; @@ -800,7 +1047,9 @@ vn_truncate(fp, length, active_cred, td) out: VOP_UNLOCK(vp, 0); vn_finished_write(mp); +out1: VFS_UNLOCK_GIANT(vfslocked); + vn_rangelock_unlock(vp, rl_cookie); return (error); } Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Wed Aug 29 15:18:56 2012 (r239836) +++ stable/9/sys/sys/mount.h Wed Aug 29 15:21:27 2012 (r239837) @@ -371,6 +371,9 @@ void __mnt_vnode_markerfree(str #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ +#define MNTK_NO_IOPF 0x00000100 /* Disallow page faults during reads + and writes. Filesystem shall properly + handle i/o state on EFAULT. */ #define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Wed Aug 29 15:18:56 2012 (r239836) +++ stable/9/sys/sys/proc.h Wed Aug 29 15:21:27 2012 (r239837) @@ -312,7 +312,9 @@ struct thread { struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ - struct proc *td_rfppwait_p; /* (k) The vforked child */ + struct proc *td_rfppwait_p; /* (k) The vforked child */ + struct vm_page **td_ma; /* (k) uio pages held */ + int td_ma_cnt; /* (k) size of *td_ma */ struct rl_q_entry *td_rlqe; /* (k) Associated range lock entry. */ }; @@ -421,6 +423,7 @@ do { \ #define TDP_RFPPWAIT 0x02000000 /* Handle RFPPWAIT on syscall exit */ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ +#define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ /* * Reasons that the current thread can not be run yet. Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Wed Aug 29 15:18:56 2012 (r239836) +++ stable/9/sys/sys/vnode.h Wed Aug 29 15:21:27 2012 (r239837) @@ -684,6 +684,8 @@ int vn_extattr_rm(struct vnode *vp, int int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp); +int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio); + #define vn_rangelock_unlock(vp, cookie) \ rangelock_unlock(&(vp)->v_rl, (cookie), VI_MTX(vp)) #define vn_rangelock_unlock_range(vp, cookie, start, end) \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:28:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30754106574F; Wed, 29 Aug 2012 15:28:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184F28FC19; Wed, 29 Aug 2012 15:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFSc9e068200; Wed, 29 Aug 2012 15:28:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFScrj068198; Wed, 29 Aug 2012 15:28:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291528.q7TFScrj068198@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239838 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:28:39 -0000 Author: kib Date: Wed Aug 29 15:28:38 2012 New Revision: 239838 URL: http://svn.freebsd.org/changeset/base/239838 Log: MFC r236516: Count and export the number of prefaulting happen. Modified: stable/9/sys/kern/vfs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:21:27 2012 (r239837) +++ stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:28:38 2012 (r239838) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -766,6 +767,9 @@ unlock: } static const int io_hold_cnt = 16; +static unsigned long vn_io_faults_cnt; +SYSCTL_LONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, + &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); /* * The vn_io_fault() is a wrapper around vn_read() and vn_write() to @@ -863,6 +867,7 @@ vn_io_fault(struct file *fp, struct uio if (error != EFAULT) goto out; + atomic_add_long(&vn_io_faults_cnt, 1); uio_clone->uio_segflg = UIO_NOCOPY; uiomove(NULL, resid - uio->uio_resid, uio_clone); uio_clone->uio_segflg = uio->uio_segflg; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:34:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F79106564A; Wed, 29 Aug 2012 15:34:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E17448FC1A; Wed, 29 Aug 2012 15:34:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFYQVr069098; Wed, 29 Aug 2012 15:34:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFYQUn069096; Wed, 29 Aug 2012 15:34:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291534.q7TFYQUn069096@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239839 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:34:27 -0000 Author: kib Date: Wed Aug 29 15:34:26 2012 New Revision: 239839 URL: http://svn.freebsd.org/changeset/base/239839 Log: MFC r236517: Add a knob to disable vn_io_fault. MFC note: by default, vn_io_fault for stable/9 is disabled. Modified: stable/9/sys/kern/vfs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:28:38 2012 (r239838) +++ stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:34:26 2012 (r239839) @@ -767,6 +767,9 @@ unlock: } static const int io_hold_cnt = 16; +static int vn_io_fault_enable = 0; +SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW, + &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance"); static unsigned long vn_io_faults_cnt; SYSCTL_LONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD, &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers"); @@ -829,7 +832,8 @@ vn_io_fault(struct file *fp, struct uio vp = fp->f_vnode; if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || ((mp = vp->v_mount) != NULL && - (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0)) + (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0) || + !vn_io_fault_enable) return (doio(fp, uio, active_cred, flags, td)); /* From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:34:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2ADEF1065670; Wed, 29 Aug 2012 15:34:32 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16C938FC14; Wed, 29 Aug 2012 15:34:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFYVkA069143; Wed, 29 Aug 2012 15:34:31 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFYVm6069141; Wed, 29 Aug 2012 15:34:31 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201208291534.q7TFYVm6069141@svn.freebsd.org> From: Isabell Long Date: Wed, 29 Aug 2012 15:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239840 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:34:32 -0000 Author: issyl0 (doc committer) Date: Wed Aug 29 15:34:31 2012 New Revision: 239840 URL: http://svn.freebsd.org/changeset/base/239840 Log: Fix a dead link in sk(4). PR: docs/146958 Approved by: gjb (mentor) MFC after: 3 days Modified: head/share/man/man4/sk.4 Modified: head/share/man/man4/sk.4 ============================================================================== --- head/share/man/man4/sk.4 Wed Aug 29 15:34:26 2012 (r239839) +++ head/share/man/man4/sk.4 Wed Aug 29 15:34:31 2012 (r239840) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd August 29, 2012 .Dt SK 4 .Os .Sh NAME @@ -223,7 +223,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%U http://www.xaqti.com +.%U http://people.freebsd.org/~wpaul/SysKonnect/xmacii_datasheet_rev_c_9-29.pdf .Re .Rs .%T SysKonnect GEnesis programming manual From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:38:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11993106564A; Wed, 29 Aug 2012 15:38:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E649D8FC0A; Wed, 29 Aug 2012 15:38:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFcI5e069644; Wed, 29 Aug 2012 15:38:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFcIZK069634; Wed, 29 Aug 2012 15:38:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208291538.q7TFcIZK069634@svn.freebsd.org> From: Glen Barber Date: Wed, 29 Aug 2012 15:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239841 - in stable/9/sys: amd64/conf arm/conf i386/conf pc98/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:38:19 -0000 Author: gjb (doc,ports committer) Date: Wed Aug 29 15:38:18 2012 New Revision: 239841 URL: http://svn.freebsd.org/changeset/base/239841 Log: MFC r239699: - Grammar fix: s/NIC's/NICs/ Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/arm/conf/AVILA stable/9/sys/arm/conf/AVILA.hints stable/9/sys/arm/conf/CAMBRIA stable/9/sys/arm/conf/CAMBRIA.hints stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/PAE stable/9/sys/pc98/conf/GENERIC stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/amd64/conf/GENERIC Wed Aug 29 15:38:18 2012 (r239841) @@ -253,7 +253,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: stable/9/sys/arm/conf/AVILA ============================================================================== --- stable/9/sys/arm/conf/AVILA Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/arm/conf/AVILA Wed Aug 29 15:38:18 2012 (r239841) @@ -120,7 +120,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI Modified: stable/9/sys/arm/conf/AVILA.hints ============================================================================== --- stable/9/sys/arm/conf/AVILA.hints Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/arm/conf/AVILA.hints Wed Aug 29 15:38:18 2012 (r239841) @@ -19,7 +19,7 @@ hint.uart.1.ier_rxbits=0x5d # NB: need U # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wired NIC's, requires ixpqmgr +# NPE wired NICs, requires ixpqmgr hint.npe.0.at="ixp0" hint.npe.0.npeid="B" hint.npe.0.mac="B" Modified: stable/9/sys/arm/conf/CAMBRIA ============================================================================== --- stable/9/sys/arm/conf/CAMBRIA Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/arm/conf/CAMBRIA Wed Aug 29 15:38:18 2012 (r239841) @@ -123,7 +123,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI Modified: stable/9/sys/arm/conf/CAMBRIA.hints ============================================================================== --- stable/9/sys/arm/conf/CAMBRIA.hints Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/arm/conf/CAMBRIA.hints Wed Aug 29 15:38:18 2012 (r239841) @@ -28,7 +28,7 @@ hint.uart.0.ier_rxbits=0x5d # NB: need U # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wired NIC's, requires ixpqmgr +# NPE wired NICs, requires ixpqmgr hint.npe.0.at="ixp0" hint.npe.0.npeid="C" hint.npe.0.mac="C" Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/i386/conf/GENERIC Wed Aug 29 15:38:18 2012 (r239841) @@ -265,7 +265,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: stable/9/sys/i386/conf/PAE ============================================================================== --- stable/9/sys/i386/conf/PAE Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/i386/conf/PAE Wed Aug 29 15:38:18 2012 (r239841) @@ -76,7 +76,7 @@ nodevice sn nodevice xe nodevice an -nodevice ath # Atheros pci/cardbus NIC's +nodevice ath # Atheros pci/cardbus NICs nodevice ath_pci nodevice ath_hal nodevice ath_rate_sample # SampleRate tx rate control for ath Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/pc98/conf/GENERIC Wed Aug 29 15:38:18 2012 (r239841) @@ -205,7 +205,7 @@ device xe # Xircom pccard Ethernet #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm #device an # Aironet 4500/4800 802.11 wireless NICs. -#device ath # Atheros NIC's +#device ath # Atheros NICs #device ath_pci # Atheros pci/cardbus glue #device ath_hal # pci/cardbus chip support #options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Wed Aug 29 15:34:31 2012 (r239840) +++ stable/9/sys/sparc64/conf/GENERIC Wed Aug 29 15:38:18 2012 (r239841) @@ -193,7 +193,7 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # Atheros HAL (Hardware Access Layer) options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:41:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C6A71065670; Wed, 29 Aug 2012 15:41:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 064FF8FC0A; Wed, 29 Aug 2012 15:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFfHt0070053; Wed, 29 Aug 2012 15:41:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFfHsR070051; Wed, 29 Aug 2012 15:41:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291541.q7TFfHsR070051@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239842 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:41:18 -0000 Author: kib Date: Wed Aug 29 15:41:17 2012 New Revision: 239842 URL: http://svn.freebsd.org/changeset/base/239842 Log: MFC r237365: Fix locking for f_offset, vn_read() and vn_write() cases only. Modified: stable/9/sys/kern/vfs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:38:18 2012 (r239841) +++ stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:41:17 2012 (r239842) @@ -512,6 +512,66 @@ vn_rdwr_inchunks(rw, vp, base, len, offs return (error); } +static void +foffset_lock(struct file *fp, struct uio *uio, int flags) +{ + struct mtx *mtxp; + + if ((flags & FOF_OFFSET) != 0) + return; + + /* + * According to McKusick the vn lock was protecting f_offset here. + * It is now protected by the FOFFSET_LOCKED flag. + */ + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + while (fp->f_vnread_flags & FOFFSET_LOCKED) { + fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; + msleep(&fp->f_vnread_flags, mtxp, PUSER -1, + "vnread offlock", 0); + } + fp->f_vnread_flags |= FOFFSET_LOCKED; + uio->uio_offset = fp->f_offset; + mtx_unlock(mtxp); +} + +static int +get_advice(struct file *fp, struct uio *uio) +{ + struct mtx *mtxp; + int ret; + + ret = POSIX_FADV_NORMAL; + if (fp->f_advice == NULL) + return (ret); + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + if (uio->uio_offset >= fp->f_advice->fa_start && + uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end) + ret = fp->f_advice->fa_advice; + mtx_unlock(mtxp); + return (ret); +} + +static void +foffset_unlock(struct file *fp, struct uio *uio, int flags) +{ + struct mtx *mtxp; + + if ((flags & FOF_OFFSET) != 0) + return; + + fp->f_offset = uio->uio_offset; + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) + wakeup(&fp->f_vnread_flags); + fp->f_vnread_flags = 0; + mtx_unlock(mtxp); +} + /* * File table vnode read routine. */ @@ -524,44 +584,22 @@ vn_read(fp, uio, active_cred, flags, td) struct thread *td; { struct vnode *vp; - int error, ioflag; struct mtx *mtxp; + int error, ioflag; int advice, vfslocked; off_t offset, start, end; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); - mtxp = NULL; + KASSERT(flags & FOF_OFFSET, ("No FOF_OFFSET")); vp = fp->f_vnode; ioflag = 0; if (fp->f_flag & FNONBLOCK) ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; - advice = POSIX_FADV_NORMAL; + advice = get_advice(fp, uio); vfslocked = VFS_LOCK_GIANT(vp->v_mount); - /* - * According to McKusick the vn lock was protecting f_offset here. - * It is now protected by the FOFFSET_LOCKED flag. - */ - if ((flags & FOF_OFFSET) == 0 || fp->f_advice != NULL) { - mtxp = mtx_pool_find(mtxpool_sleep, fp); - mtx_lock(mtxp); - if ((flags & FOF_OFFSET) == 0) { - while (fp->f_vnread_flags & FOFFSET_LOCKED) { - fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PUSER -1, - "vnread offlock", 0); - } - fp->f_vnread_flags |= FOFFSET_LOCKED; - uio->uio_offset = fp->f_offset; - } - if (fp->f_advice != NULL && - uio->uio_offset >= fp->f_advice->fa_start && - uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end) - advice = fp->f_advice->fa_advice; - mtx_unlock(mtxp); - } vn_lock(vp, LK_SHARED | LK_RETRY); switch (advice) { @@ -581,14 +619,6 @@ vn_read(fp, uio, active_cred, flags, td) if (error == 0) #endif error = VOP_READ(vp, uio, ioflag, fp->f_cred); - if ((flags & FOF_OFFSET) == 0) { - fp->f_offset = uio->uio_offset; - mtx_lock(mtxp); - if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) - wakeup(&fp->f_vnread_flags); - fp->f_vnread_flags = 0; - mtx_unlock(mtxp); - } fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); if (error == 0 && advice == POSIX_FADV_NOREUSE && @@ -610,6 +640,7 @@ vn_read(fp, uio, active_cred, flags, td) */ start = offset; end = uio->uio_offset - 1; + mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); if (fp->f_advice != NULL && fp->f_advice->fa_advice == POSIX_FADV_NOREUSE) { @@ -641,13 +672,14 @@ vn_write(fp, uio, active_cred, flags, td { struct vnode *vp; struct mount *mp; - int error, ioflag, lock_flags; struct mtx *mtxp; + int error, ioflag, lock_flags; int advice, vfslocked; off_t offset, start, end; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); + KASSERT(flags & FOF_OFFSET, ("No FOF_OFFSET")); vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type == VREG) @@ -666,6 +698,8 @@ vn_write(fp, uio, active_cred, flags, td if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; + + advice = get_advice(fp, uio); if ((MNT_SHARED_WRITES(mp) || ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) && @@ -676,19 +710,6 @@ vn_write(fp, uio, active_cred, flags, td } vn_lock(vp, lock_flags | LK_RETRY); - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; - advice = POSIX_FADV_NORMAL; - mtxp = NULL; - if (fp->f_advice != NULL) { - mtxp = mtx_pool_find(mtxpool_sleep, fp); - mtx_lock(mtxp); - if (fp->f_advice != NULL && - uio->uio_offset >= fp->f_advice->fa_start && - uio->uio_offset + uio->uio_resid <= fp->f_advice->fa_end) - advice = fp->f_advice->fa_advice; - mtx_unlock(mtxp); - } switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: @@ -706,8 +727,6 @@ vn_write(fp, uio, active_cred, flags, td if (error == 0) #endif error = VOP_WRITE(vp, uio, ioflag, fp->f_cred); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); if (vp->v_type != VCHR) @@ -746,6 +765,7 @@ vn_write(fp, uio, active_cred, flags, td */ start = offset; end = uio->uio_offset - 1; + mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); if (fp->f_advice != NULL && fp->f_advice->fa_advice == POSIX_FADV_NOREUSE) { @@ -830,11 +850,15 @@ vn_io_fault(struct file *fp, struct uio else doio = vn_write; vp = fp->f_vnode; + foffset_lock(fp, uio, flags); + if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || ((mp = vp->v_mount) != NULL && (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0) || - !vn_io_fault_enable) - return (doio(fp, uio, active_cred, flags, td)); + !vn_io_fault_enable) { + error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td); + goto out_last; + } /* * The UFS follows IO_UNIT directive and replays back both @@ -867,7 +891,7 @@ vn_io_fault(struct file *fp, struct uio } save = vm_fault_disable_pagefaults(); - error = doio(fp, uio, active_cred, flags, td); + error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td); if (error != EFAULT) goto out; @@ -918,7 +942,8 @@ vn_io_fault(struct file *fp, struct uio td->td_ma = ma; td->td_ma_cnt = cnt; - error = doio(fp, &short_uio, active_cred, flags, td); + error = doio(fp, &short_uio, active_cred, flags | FOF_OFFSET, + td); vm_page_unhold_pages(ma, cnt); adv = len - short_uio.uio_resid; @@ -941,6 +966,8 @@ out: vm_fault_enable_pagefaults(save); vn_rangelock_unlock(vp, rl_cookie); free(uio_clone, M_IOV); +out_last: + foffset_unlock(fp, uio, flags); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:45:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A80E1106566C; Wed, 29 Aug 2012 15:45:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FFD68FC14; Wed, 29 Aug 2012 15:45:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFjxZ5070687; Wed, 29 Aug 2012 15:45:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFjxX0070678; Wed, 29 Aug 2012 15:45:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291545.q7TFjxX0070678@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239843 - in stable/9/sys: compat/linux fs/devfs kern sys ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:45:59 -0000 Author: kib Date: Wed Aug 29 15:45:58 2012 New Revision: 239843 URL: http://svn.freebsd.org/changeset/base/239843 Log: MFC r238029: Extend the KPI to lock and unlock f_offset member of struct file. It now fully encapsulates all accesses to f_offset, and extends f_offset locking to other consumers that need it, in particular, to lseek() and variants of getdirentries(). Modified: stable/9/sys/compat/linux/linux_file.c stable/9/sys/fs/devfs/devfs_vnops.c stable/9/sys/kern/kern_descrip.c stable/9/sys/kern/vfs_syscalls.c stable/9/sys/kern/vfs_vnops.c stable/9/sys/sys/file.h stable/9/sys/ufs/ffs/ffs_alloc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/compat/linux/linux_file.c ============================================================================== --- stable/9/sys/compat/linux/linux_file.c Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/compat/linux/linux_file.c Wed Aug 29 15:45:58 2012 (r239843) @@ -354,15 +354,16 @@ getdents_common(struct thread *td, struc return (EBADF); } + off = foffset_lock(fp, 0); vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, off, 0); fdrop(fp, td); return (EINVAL); } - off = fp->f_offset; buflen = max(LINUX_DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); @@ -511,7 +512,6 @@ getdents_common(struct thread *td, struc goto eof; } - fp->f_offset = off; if (justone) nbytes = resid + linuxreclen; @@ -524,6 +524,7 @@ out: VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, off, 0); fdrop(fp, td); free(buf, M_TEMP); free(lbuf, M_TEMP); Modified: stable/9/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_vnops.c Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/fs/devfs/devfs_vnops.c Wed Aug 29 15:45:58 2012 (r239843) @@ -1170,18 +1170,14 @@ devfs_read_f(struct file *fp, struct uio if (ioflag & O_DIRECT) ioflag |= IO_DIRECT; - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; - + foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); error = dsw->d_read(dev, uio, ioflag); if (uio->uio_resid != resid || (error == 0 && resid != 0)) vfs_timestamp(&dev->si_atime); td->td_fpop = fpop; dev_relthread(dev, ref); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; - fp->f_nextoff = uio->uio_offset; + foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF); return (error); } @@ -1648,8 +1644,7 @@ devfs_write_f(struct file *fp, struct ui ioflag = fp->f_flag & (O_NONBLOCK | O_DIRECT | O_FSYNC); if (ioflag & O_DIRECT) ioflag |= IO_DIRECT; - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; + foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); resid = uio->uio_resid; @@ -1661,9 +1656,7 @@ devfs_write_f(struct file *fp, struct ui td->td_fpop = fpop; dev_relthread(dev, ref); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; - fp->f_nextoff = uio->uio_offset; + foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF); return (error); } Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/kern/kern_descrip.c Wed Aug 29 15:45:58 2012 (r239843) @@ -472,6 +472,7 @@ kern_fcntl(struct thread *td, int fd, in int vfslocked; u_int old, new; uint64_t bsize; + off_t foffset; vfslocked = 0; error = 0; @@ -613,14 +614,15 @@ kern_fcntl(struct thread *td, int fd, in } flp = (struct flock *)arg; if (flp->l_whence == SEEK_CUR) { - if (fp->f_offset < 0 || + foffset = foffset_get(fp); + if (foffset < 0 || (flp->l_start > 0 && - fp->f_offset > OFF_MAX - flp->l_start)) { + foffset > OFF_MAX - flp->l_start)) { FILEDESC_SUNLOCK(fdp); error = EOVERFLOW; break; } - flp->l_start += fp->f_offset; + flp->l_start += foffset; } /* @@ -714,15 +716,16 @@ kern_fcntl(struct thread *td, int fd, in break; } if (flp->l_whence == SEEK_CUR) { + foffset = foffset_get(fp); if ((flp->l_start > 0 && - fp->f_offset > OFF_MAX - flp->l_start) || + foffset > OFF_MAX - flp->l_start) || (flp->l_start < 0 && - fp->f_offset < OFF_MIN - flp->l_start)) { + foffset < OFF_MIN - flp->l_start)) { FILEDESC_SUNLOCK(fdp); error = EOVERFLOW; break; } - flp->l_start += fp->f_offset; + flp->l_start += foffset; } /* * VOP_ADVLOCK() may block. @@ -2907,7 +2910,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) xf.xf_type = fp->f_type; xf.xf_count = fp->f_count; xf.xf_msgcount = 0; - xf.xf_offset = fp->f_offset; + xf.xf_offset = foffset_get(fp); xf.xf_flag = fp->f_flag; error = SYSCTL_OUT(req, &xf, sizeof(xf)); if (error) @@ -3112,7 +3115,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE kif->kf_flags |= KF_FLAG_DIRECT; if (fp->f_flag & FHASLOCK) kif->kf_flags |= KF_FLAG_HASLOCK; - kif->kf_offset = fp->f_offset; + kif->kf_offset = foffset_get(fp); if (vp != NULL) { vref(vp); switch (vp->v_type) { @@ -3456,7 +3459,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER } refcnt = fp->f_count; fflags = fp->f_flag; - offset = fp->f_offset; + offset = foffset_get(fp); /* * Create sysctl entry. Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/kern/vfs_syscalls.c Wed Aug 29 15:45:58 2012 (r239843) @@ -1992,7 +1992,7 @@ sys_lseek(td, uap) struct file *fp; struct vnode *vp; struct vattr vattr; - off_t offset, size; + off_t foffset, offset, size; int error, noneg; int vfslocked; @@ -2004,18 +2004,19 @@ sys_lseek(td, uap) return (ESPIPE); } vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); vfslocked = VFS_LOCK_GIANT(vp->v_mount); noneg = (vp->v_type != VCHR); offset = uap->offset; switch (uap->whence) { case L_INCR: if (noneg && - (fp->f_offset < 0 || - (offset > 0 && fp->f_offset > OFF_MAX - offset))) { + (foffset < 0 || + (offset > 0 && foffset > OFF_MAX - offset))) { error = EOVERFLOW; break; } - offset += fp->f_offset; + offset += foffset; break; case L_XTND: vn_lock(vp, LK_SHARED | LK_RETRY); @@ -2055,12 +2056,12 @@ sys_lseek(td, uap) error = EINVAL; if (error != 0) goto drop; - fp->f_offset = offset; VFS_KNOTE_UNLOCKED(vp, 0); - *(off_t *)(td->td_retval) = fp->f_offset; + *(off_t *)(td->td_retval) = offset; drop: fdrop(fp, td); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); } @@ -3993,6 +3994,7 @@ kern_ogetdirentries(struct thread *td, s caddr_t dirbuf; int error, eofflag, readcnt, vfslocked; long loff; + off_t foffset; /* XXX arbitrary sanity limit on `count'. */ if (uap->count > 64 * 1024) @@ -4005,10 +4007,12 @@ kern_ogetdirentries(struct thread *td, s return (EBADF); } vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); unionread: vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, 0); fdrop(fp, td); return (EINVAL); } @@ -4021,12 +4025,13 @@ unionread: auio.uio_td = td; auio.uio_resid = uap->count; vn_lock(vp, LK_SHARED | LK_RETRY); - loff = auio.uio_offset = fp->f_offset; + loff = auio.uio_offset = foffset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); if (error) { VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, FOF_NOUPDATE); fdrop(fp, td); return (error); } @@ -4035,7 +4040,7 @@ unionread: if (vp->v_mount->mnt_maxsymlinklen <= 0) { error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL, NULL); - fp->f_offset = auio.uio_offset; + foffset = auio.uio_offset; } else # endif { @@ -4047,7 +4052,7 @@ unionread: kiov.iov_base = dirbuf; error = VOP_READDIR(vp, &kuio, fp->f_cred, &eofflag, NULL, NULL); - fp->f_offset = kuio.uio_offset; + foffset = kuio.uio_offset; if (error == 0) { readcnt = uap->count - kuio.uio_resid; edp = (struct dirent *)&dirbuf[readcnt]; @@ -4085,6 +4090,7 @@ unionread: if (error) { VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, 0); fdrop(fp, td); return (error); } @@ -4096,13 +4102,14 @@ unionread: VREF(vp); fp->f_vnode = vp; fp->f_data = vp; - fp->f_offset = 0; + foffset = 0; vput(tvp); VFS_UNLOCK_GIANT(vfslocked); goto unionread; } VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, 0); fdrop(fp, td); td->td_retval[0] = uap->count - auio.uio_resid; if (error == 0) @@ -4154,6 +4161,7 @@ kern_getdirentries(struct thread *td, in int vfslocked; long loff; int error, eofflag; + off_t foffset; AUDIT_ARG_FD(fd); auio.uio_resid = count; @@ -4167,6 +4175,7 @@ kern_getdirentries(struct thread *td, in return (EBADF); } vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); unionread: vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { @@ -4183,14 +4192,14 @@ unionread: auio.uio_td = td; vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); - loff = auio.uio_offset = fp->f_offset; + loff = auio.uio_offset = foffset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); if (error == 0) #endif error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL, NULL); - fp->f_offset = auio.uio_offset; + foffset = auio.uio_offset; if (error) { VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); @@ -4204,7 +4213,7 @@ unionread: VREF(vp); fp->f_vnode = vp; fp->f_data = vp; - fp->f_offset = 0; + foffset = 0; vput(tvp); VFS_UNLOCK_GIANT(vfslocked); goto unionread; @@ -4214,6 +4223,7 @@ unionread: *basep = loff; td->td_retval[0] = count - auio.uio_resid; fail: + foffset_unlock(fp, foffset, 0); fdrop(fp, td); return (error); } Modified: stable/9/sys/kern/vfs_vnops.c ============================================================================== --- stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/kern/vfs_vnops.c Wed Aug 29 15:45:58 2012 (r239843) @@ -512,13 +512,22 @@ vn_rdwr_inchunks(rw, vp, base, len, offs return (error); } -static void -foffset_lock(struct file *fp, struct uio *uio, int flags) +off_t +foffset_lock(struct file *fp, int flags) { struct mtx *mtxp; + off_t res; - if ((flags & FOF_OFFSET) != 0) - return; + KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); + +#if OFF_MAX <= LONG_MAX + /* + * Caller only wants the current f_offset value. Assume that + * the long and shorter integer types reads are atomic. + */ + if ((flags & FOF_NOLOCK) != 0) + return (fp->f_offset); +#endif /* * According to McKusick the vn lock was protecting f_offset here. @@ -526,16 +535,68 @@ foffset_lock(struct file *fp, struct uio */ mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); - while (fp->f_vnread_flags & FOFFSET_LOCKED) { - fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PUSER -1, - "vnread offlock", 0); + if ((flags & FOF_NOLOCK) == 0) { + while (fp->f_vnread_flags & FOFFSET_LOCKED) { + fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; + msleep(&fp->f_vnread_flags, mtxp, PUSER -1, + "vofflock", 0); + } + fp->f_vnread_flags |= FOFFSET_LOCKED; + } + res = fp->f_offset; + mtx_unlock(mtxp); + return (res); +} + +void +foffset_unlock(struct file *fp, off_t val, int flags) +{ + struct mtx *mtxp; + + KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); + +#if OFF_MAX <= LONG_MAX + if ((flags & FOF_NOLOCK) != 0) { + if ((flags & FOF_NOUPDATE) == 0) + fp->f_offset = val; + if ((flags & FOF_NEXTOFF) != 0) + fp->f_nextoff = val; + return; + } +#endif + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + if ((flags & FOF_NOUPDATE) == 0) + fp->f_offset = val; + if ((flags & FOF_NEXTOFF) != 0) + fp->f_nextoff = val; + if ((flags & FOF_NOLOCK) == 0) { + KASSERT((fp->f_vnread_flags & FOFFSET_LOCKED) != 0, + ("Lost FOFFSET_LOCKED")); + if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) + wakeup(&fp->f_vnread_flags); + fp->f_vnread_flags = 0; } - fp->f_vnread_flags |= FOFFSET_LOCKED; - uio->uio_offset = fp->f_offset; mtx_unlock(mtxp); } +void +foffset_lock_uio(struct file *fp, struct uio *uio, int flags) +{ + + if ((flags & FOF_OFFSET) == 0) + uio->uio_offset = foffset_lock(fp, flags); +} + +void +foffset_unlock_uio(struct file *fp, struct uio *uio, int flags) +{ + + if ((flags & FOF_OFFSET) == 0) + foffset_unlock(fp, uio->uio_offset, flags); +} + static int get_advice(struct file *fp, struct uio *uio) { @@ -555,23 +616,6 @@ get_advice(struct file *fp, struct uio * return (ret); } -static void -foffset_unlock(struct file *fp, struct uio *uio, int flags) -{ - struct mtx *mtxp; - - if ((flags & FOF_OFFSET) != 0) - return; - - fp->f_offset = uio->uio_offset; - mtxp = mtx_pool_find(mtxpool_sleep, fp); - mtx_lock(mtxp); - if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) - wakeup(&fp->f_vnread_flags); - fp->f_vnread_flags = 0; - mtx_unlock(mtxp); -} - /* * File table vnode read routine. */ @@ -850,7 +894,7 @@ vn_io_fault(struct file *fp, struct uio else doio = vn_write; vp = fp->f_vnode; - foffset_lock(fp, uio, flags); + foffset_lock_uio(fp, uio, flags); if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || ((mp = vp->v_mount) != NULL && @@ -967,7 +1011,7 @@ out: vn_rangelock_unlock(vp, rl_cookie); free(uio_clone, M_IOV); out_last: - foffset_unlock(fp, uio, flags); + foffset_unlock_uio(fp, uio, flags); return (error); } Modified: stable/9/sys/sys/file.h ============================================================================== --- stable/9/sys/sys/file.h Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/sys/file.h Wed Aug 29 15:45:58 2012 (r239843) @@ -72,10 +72,25 @@ struct socket; struct file; struct ucred; +#define FOF_OFFSET 0x01 /* Use the offset in uio argument */ +#define FOF_NOLOCK 0x02 /* Do not take FOFFSET_LOCK */ +#define FOF_NEXTOFF 0x04 /* Also update f_nextoff */ +#define FOF_NOUPDATE 0x10 /* Do not update f_offset */ +off_t foffset_lock(struct file *fp, int flags); +void foffset_lock_uio(struct file *fp, struct uio *uio, int flags); +void foffset_unlock(struct file *fp, off_t val, int flags); +void foffset_unlock_uio(struct file *fp, struct uio *uio, int flags); + +static inline off_t +foffset_get(struct file *fp) +{ + + return (foffset_lock(fp, FOF_NOLOCK)); +} + typedef int fo_rdwr_t(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td); -#define FOF_OFFSET 1 /* Use the offset in uio argument */ typedef int fo_truncate_t(struct file *fp, off_t length, struct ucred *active_cred, struct thread *td); typedef int fo_ioctl_t(struct file *fp, u_long com, void *data, Modified: stable/9/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_alloc.c Wed Aug 29 15:41:17 2012 (r239842) +++ stable/9/sys/ufs/ffs/ffs_alloc.c Wed Aug 29 15:45:58 2012 (r239843) @@ -2871,10 +2871,9 @@ buffered_write(fp, uio, active_cred, fla if (ip->i_devvp != devvp) return (EINVAL); fs = ip->i_fs; + foffset_lock_uio(fp, uio, flags); vfslocked = VFS_LOCK_GIANT(ip->i_vnode->v_mount); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; #ifdef DEBUG if (fsckcmds) { printf("%s: buffered write for block %jd\n", @@ -2899,11 +2898,9 @@ buffered_write(fp, uio, active_cred, fla goto out; } error = bwrite(bp); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; - fp->f_nextoff = uio->uio_offset; out: VOP_UNLOCK(devvp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock_uio(fp, uio, flags | FOF_NEXTOFF); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:46:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A53A106566B; Wed, 29 Aug 2012 15:46:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 019058FC15; Wed, 29 Aug 2012 15:46:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFk1aK070731; Wed, 29 Aug 2012 15:46:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFk1Ol070716; Wed, 29 Aug 2012 15:46:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291546.q7TFk1Ol070716@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239844 - in vendor-crypto/openssh/dist: . contrib/caldera contrib/cygwin contrib/redhat contrib/suse lib openbsd-compat regress scp sftp sftp-server ssh ssh-add ssh-agent ssh-keygen ss... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:46:02 -0000 Author: des Date: Wed Aug 29 15:46:01 2012 New Revision: 239844 URL: http://svn.freebsd.org/changeset/base/239844 Log: Vendor import of OpenSSH 6.0p1. Added: vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c (contents, props changed) vendor-crypto/openssh/dist/openbsd-compat/strnlen.c (contents, props changed) vendor-crypto/openssh/dist/sandbox-seccomp-filter.c (contents, props changed) Deleted: vendor-crypto/openssh/dist/lib/ vendor-crypto/openssh/dist/scp/ vendor-crypto/openssh/dist/sftp/ vendor-crypto/openssh/dist/sftp-server/ vendor-crypto/openssh/dist/ssh/ vendor-crypto/openssh/dist/ssh-add/ vendor-crypto/openssh/dist/ssh-agent/ vendor-crypto/openssh/dist/ssh-keygen/ vendor-crypto/openssh/dist/ssh-keyscan/ vendor-crypto/openssh/dist/ssh-keysign/ vendor-crypto/openssh/dist/sshd/ Modified: vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/dist/INSTALL vendor-crypto/openssh/dist/LICENCE vendor-crypto/openssh/dist/Makefile.in vendor-crypto/openssh/dist/PROTOCOL.mux vendor-crypto/openssh/dist/README vendor-crypto/openssh/dist/audit-bsm.c vendor-crypto/openssh/dist/auth-options.c vendor-crypto/openssh/dist/auth2-pubkey.c vendor-crypto/openssh/dist/auth2.c vendor-crypto/openssh/dist/authfile.c vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/dist/channels.h vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/dist/clientloop.h vendor-crypto/openssh/dist/compat.c vendor-crypto/openssh/dist/compat.h vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/dist/configure vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/dist/contrib/caldera/openssh.spec vendor-crypto/openssh/dist/contrib/cygwin/Makefile vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/dist/defines.h vendor-crypto/openssh/dist/dh.c vendor-crypto/openssh/dist/entropy.c vendor-crypto/openssh/dist/entropy.h vendor-crypto/openssh/dist/key.c vendor-crypto/openssh/dist/mac.c vendor-crypto/openssh/dist/misc.c vendor-crypto/openssh/dist/moduli vendor-crypto/openssh/dist/moduli.c vendor-crypto/openssh/dist/monitor.c vendor-crypto/openssh/dist/mux.c vendor-crypto/openssh/dist/openbsd-compat/Makefile.in vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.c vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.h vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.h vendor-crypto/openssh/dist/openbsd-compat/getcwd.c vendor-crypto/openssh/dist/openbsd-compat/getgrouplist.c vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname.c vendor-crypto/openssh/dist/openbsd-compat/glob.c vendor-crypto/openssh/dist/openbsd-compat/inet_ntop.c vendor-crypto/openssh/dist/openbsd-compat/mktemp.c vendor-crypto/openssh/dist/openbsd-compat/openbsd-compat.h vendor-crypto/openssh/dist/openbsd-compat/openssl-compat.h vendor-crypto/openssh/dist/openbsd-compat/port-linux.c vendor-crypto/openssh/dist/openbsd-compat/setenv.c vendor-crypto/openssh/dist/openbsd-compat/sha2.c vendor-crypto/openssh/dist/openbsd-compat/sha2.h vendor-crypto/openssh/dist/openbsd-compat/strlcpy.c vendor-crypto/openssh/dist/packet.c vendor-crypto/openssh/dist/packet.h vendor-crypto/openssh/dist/readconf.c vendor-crypto/openssh/dist/readconf.h vendor-crypto/openssh/dist/regress/keytype.sh vendor-crypto/openssh/dist/roaming.h vendor-crypto/openssh/dist/roaming_client.c vendor-crypto/openssh/dist/roaming_common.c vendor-crypto/openssh/dist/scp.0 vendor-crypto/openssh/dist/scp.1 vendor-crypto/openssh/dist/scp.c vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/dist/session.c vendor-crypto/openssh/dist/sftp-client.c vendor-crypto/openssh/dist/sftp-glob.c vendor-crypto/openssh/dist/sftp.0 vendor-crypto/openssh/dist/sftp.1 vendor-crypto/openssh/dist/sftp.c vendor-crypto/openssh/dist/ssh-add.0 vendor-crypto/openssh/dist/ssh-add.1 vendor-crypto/openssh/dist/ssh-add.c vendor-crypto/openssh/dist/ssh-ecdsa.c vendor-crypto/openssh/dist/ssh-keygen.0 vendor-crypto/openssh/dist/ssh-keygen.1 vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/dist/ssh-keyscan.1 vendor-crypto/openssh/dist/ssh-keyscan.c vendor-crypto/openssh/dist/ssh-pkcs11-client.c vendor-crypto/openssh/dist/ssh.0 vendor-crypto/openssh/dist/ssh.1 vendor-crypto/openssh/dist/ssh.c vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/dist/sshd.8 vendor-crypto/openssh/dist/sshd.c vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/dist/sshd_config.5 vendor-crypto/openssh/dist/umac.c vendor-crypto/openssh/dist/version.h Modified: vendor-crypto/openssh/dist/ChangeLog ============================================================================== --- vendor-crypto/openssh/dist/ChangeLog Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/ChangeLog Wed Aug 29 15:46:01 2012 (r239844) @@ -1,3 +1,334 @@ +20120420 + - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Update for release 6.0 + - (djm) [README] Update URL to release notes. + - (djm) Release openssh-6.0 + +20120419 + - (djm) [configure.ac] Fix compilation error on FreeBSD, whose libutil + contains openpty() but not login() + +20120404 + - (djm) [Makefile.in configure.ac sandbox-seccomp-filter.c] Add sandbox + mode for Linux's new seccomp filter; patch from Will Drewry; feedback + and ok dtucker@ + +20120330 + - (dtucker) [contrib/redhat/openssh.spec] Bug #1992: remove now-gone WARNING + file from spec file. From crighter at nuclioss com. + - (djm) [entropy.c] bz#1991: relax OpenSSL version test to allow running + openssh binaries on a newer fix release than they were compiled on. + with and ok dtucker@ + - (djm) [openbsd-compat/bsd-cygwin_util.h] #undef _WIN32 to avoid incorrect + assumptions when building on Cygwin; patch from Corinna Vinschen + +20120309 + - (djm) [openbsd-compat/port-linux.c] bz#1960: fix crash on SELinux + systems where sshd is run in te wrong context. Patch from Sven + Vermeulen; ok dtucker@ + - (djm) [packet.c] bz#1963: Fix IPQoS not being set on non-mapped v4-in-v6 + addressed connections. ok dtucker@ + +20120224 + - (dtucker) [audit-bsm.c configure.ac] bug #1968: enable workarounds for BSM + audit breakage in Solaris 11. Patch from Magnus Johansson. + +20120215 + - (tim) [openbsd-compat/bsd-misc.h sshd.c] Fix conflicting return type for + unsetenv due to rev 1.14 change to setenv.c. Cast unsetenv to void in sshd.c + ok dtucker@ + - (tim) [defines.h] move chunk introduced in 1.125 before MAXPATHLEN so + it actually works. + - (tim) [regress/keytype.sh] stderr redirection needs to be inside back quote + to work. Spotted by Angel Gonzalez + +20120214 + - (djm) [openbsd-compat/bsd-cygwin_util.c] Add PROGRAMFILES to list of + preserved Cygwin environment variables; from Corinna Vinschen + +20120211 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/01/05 00:16:56 + [monitor.c] + memleak on error path + - djm@cvs.openbsd.org 2012/01/07 21:11:36 + [mux.c] + fix double-free in new session handler + - miod@cvs.openbsd.org 2012/01/08 13:17:11 + [ssh-ecdsa.c] + Fix memory leak in ssh_ecdsa_verify(); from Loganaden Velvindron, + ok markus@ + - miod@cvs.openbsd.org 2012/01/16 20:34:09 + [ssh-pkcs11-client.c] + Fix a memory leak in pkcs11_rsa_private_encrypt(), reported by Jan Klemkow. + While there, be sure to buffer_clear() between send_msg() and recv_msg(). + ok markus@ + - dtucker@cvs.openbsd.org 2012/01/18 21:46:43 + [clientloop.c] + Ensure that $DISPLAY contains only valid characters before using it to + extract xauth data so that it can't be used to play local shell + metacharacter games. Report from r00t_ati at ihteam.net, ok markus. + - markus@cvs.openbsd.org 2012/01/25 19:26:43 + [packet.c] + do not permit SSH2_MSG_SERVICE_REQUEST/ACCEPT during rekeying; + ok dtucker@, djm@ + - markus@cvs.openbsd.org 2012/01/25 19:36:31 + [authfile.c] + memleak in key_load_file(); from Jan Klemkow + - markus@cvs.openbsd.org 2012/01/25 19:40:09 + [packet.c packet.h] + packet_read_poll() is not used anymore. + - markus@cvs.openbsd.org 2012/02/09 20:00:18 + [version.h] + move from 6.0-beta to 6.0 + +20120206 + - (djm) [ssh-keygen.c] Don't fail in do_gen_all_hostkeys on platforms + that don't support ECC. Patch from Phil Oleson + +20111219 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2011/12/02 00:41:56 + [mux.c] + fix bz#1948: ssh -f doesn't fork for multiplexed connection. + ok dtucker@ + - djm@cvs.openbsd.org 2011/12/02 00:43:57 + [mac.c] + fix bz#1934: newer OpenSSL versions will require HMAC_CTX_Init before + HMAC_init (this change in policy seems insane to me) + ok dtucker@ + - djm@cvs.openbsd.org 2011/12/04 23:16:12 + [mux.c] + revert: + > revision 1.32 + > date: 2011/12/02 00:41:56; author: djm; state: Exp; lines: +4 -1 + > fix bz#1948: ssh -f doesn't fork for multiplexed connection. + > ok dtucker@ + it interacts badly with ControlPersist + - djm@cvs.openbsd.org 2011/12/07 05:44:38 + [auth2.c dh.c packet.c roaming.h roaming_client.c roaming_common.c] + fix some harmless and/or unreachable int overflows; + reported Xi Wang, ok markus@ + +20111125 + - OpenBSD CVS Sync + - oga@cvs.openbsd.org 2011/11/16 12:24:28 + [sftp.c] + Don't leak list in complete_cmd_parse if there are no commands found. + Discovered when I was ``borrowing'' this code for something else. + ok djm@ + +20111121 + - (dtucker) [configure.ac] Set _FORTIFY_SOURCE. ok djm@ + +20111104 + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2011/10/18 05:15:28 + [ssh.c] + ssh(1): skip attempting to create ~/.ssh when -F is passed; ok markus@ + - djm@cvs.openbsd.org 2011/10/18 23:37:42 + [ssh-add.c] + add -k to usage(); reminded by jmc@ + - djm@cvs.openbsd.org 2011/10/19 00:06:10 + [moduli.c] + s/tmpfile/tmp/ to make this -Wshadow clean + - djm@cvs.openbsd.org 2011/10/19 10:39:48 + [umac.c] + typo in comment; patch from Michael W. Bombardieri + - djm@cvs.openbsd.org 2011/10/24 02:10:46 + [ssh.c] + bz#1943: unbreak stdio forwarding when ControlPersist is in user - ssh + was incorrectly requesting the forward in both the control master and + slave. skip requesting it in the master to fix. ok markus@ + - djm@cvs.openbsd.org 2011/10/24 02:13:13 + [session.c] + bz#1859: send tty break to pty master instead of (probably already + closed) slave side; "looks good" markus@ + - dtucker@cvs.openbsd.org 011/11/04 00:09:39 + [moduli] + regenerated moduli file; ok deraadt + - (dtucker) [INSTALL LICENCE configure.ac openbsd-compat/Makefile.in + openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/getrrsetbyname.c] + bz 1320: Add optional support for LDNS, a BSD licensed DNS resolver library + which supports DNSSEC. Patch from Simon Vallet (svallet at genoscope cns fr) + with some rework from myself and djm. ok djm. + +20111025 + - (dtucker) [contrib/cygwin/Makefile] Continue if installing a doc file + fails. Patch from Corinna Vinschen. + +20111018 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2011/10/04 14:17:32 + [sftp-glob.c] + silence error spam for "ls */foo" in directory with files; bz#1683 + - dtucker@cvs.openbsd.org 2011/10/16 11:02:46 + [moduli.c ssh-keygen.1 ssh-keygen.c] + Add optional checkpoints for moduli screening. feedback & ok deraadt + - jmc@cvs.openbsd.org 2011/10/16 15:02:41 + [ssh-keygen.c] + put -K in the right place (usage()); + - stsp@cvs.openbsd.org 2011/10/16 15:51:39 + [moduli.c] + add missing includes to unbreak tree; fix from rpointel + - djm@cvs.openbsd.org 2011/10/18 04:58:26 + [auth-options.c key.c] + remove explict search for \0 in packet strings, this job is now done + implicitly by buffer_get_cstring; ok markus + - djm@cvs.openbsd.org 2011/10/18 05:00:48 + [ssh-add.1 ssh-add.c] + new "ssh-add -k" option to load plain keys (skipping certificates); + "looks ok" markus@ + +20111001 + - (dtucker) [openbsd-compat/mktemp.c] Fix compiler warning. ok djm + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2011/09/23 00:22:04 + [channels.c auth-options.c servconf.c channels.h sshd.8] + Add wildcard support to PermitOpen, allowing things like "PermitOpen + localhost:*". bz #1857, ok djm markus. + - markus@cvs.openbsd.org 2011/09/23 07:45:05 + [mux.c readconf.h channels.h compat.h compat.c ssh.c readconf.c channels.c + version.h] + unbreak remote portforwarding with dynamic allocated listen ports: + 1) send the actual listen port in the open message (instead of 0). + this allows multiple forwardings with a dynamic listen port + 2) update the matching permit-open entry, so we can identify where + to connect to + report: den at skbkontur.ru and P. Szczygielski + feedback and ok djm@ + - djm@cvs.openbsd.org 2011/09/25 05:44:47 + [auth2-pubkey.c] + improve the AuthorizedPrincipalsFile debug log message to include + file and line number + - dtucker@cvs.openbsd.org 2011/09/30 00:47:37 + [sshd.c] + don't attempt privsep cleanup when not using privsep; ok markus@ + - djm@cvs.openbsd.org 2011/09/30 21:22:49 + [sshd.c] + fix inverted test that caused logspam; spotted by henning@ + +20110929 + - (djm) [configure.ac defines.h] No need to detect sizeof(char); patch + from des AT des.no + - (dtucker) [configure.ac openbsd-compat/Makefile.in + openbsd-compat/strnlen.c] Add strnlen to the compat library. + +20110923 + - (djm) [openbsd-compat/getcwd.c] Remove OpenBSD rcsid marker since we no + longer want to sync this file (OpenBSD uses a __getcwd syscall now, we + want this longhand version) + - (djm) [openbsd-compat/getgrouplist.c] Remove OpenBSD rcsid marker: the + upstream version is YPified and we don't want this + - (djm) [openbsd-compat/mktemp.c] forklift upgrade to -current version. + The file was totally rewritten between what we had in tree and -current. + - (djm) [openbsd-compat/sha2.c openbsd-compat/sha2.h] Remove OpenBSD rcsid + marker. The upstream API has changed (function and structure names) + enough to put it out of sync with other providers of this interface. + - (djm) [openbsd-compat/setenv.c] Forklift upgrade, including inclusion + of static __findenv() function from upstream setenv.c + - OpenBSD CVS Sync + - millert@cvs.openbsd.org 2006/05/05 15:27:38 + [openbsd-compat/strlcpy.c] + Convert do {} while loop -> while {} for clarity. No binary change + on most architectures. From Oliver Smith. OK deraadt@ and henning@ + - tobias@cvs.openbsd.org 2007/10/21 11:09:30 + [openbsd-compat/mktemp.c] + Comment fix about time consumption of _gettemp. + FreeBSD did this in revision 1.20. + OK deraadt@, krw@ + - deraadt@cvs.openbsd.org 2008/07/22 21:47:45 + [openbsd-compat/mktemp.c] + use arc4random_uniform(); ok djm millert + - millert@cvs.openbsd.org 2008/08/21 16:54:44 + [openbsd-compat/mktemp.c] + Remove useless code, the kernel will set errno appropriately if an + element in the path does not exist. OK deraadt@ pvalchev@ + - otto@cvs.openbsd.org 2008/12/09 19:38:38 + [openbsd-compat/inet_ntop.c] + fix inet_ntop(3) prototype; ok millert@ libc to be bumbed very soon + +20110922 + - OpenBSD CVS Sync + - pyr@cvs.openbsd.org 2011/05/12 07:15:10 + [openbsd-compat/glob.c] + When the max number of items for a directory has reached GLOB_LIMIT_READDIR + an error is returned but closedir() is not called. + spotted and fix provided by Frank Denis obsd-tech@pureftpd.org + ok otto@, millert@ + - stsp@cvs.openbsd.org 2011/09/20 10:18:46 + [glob.c] + In glob(3), limit recursion during matching attempts. Similar to + fnmatch fix. Also collapse consecutive '*' (from NetBSD). + ok miod deraadt + - djm@cvs.openbsd.org 2011/09/22 06:27:29 + [glob.c] + fix GLOB_KEEPSTAT without GLOB_NOSORT; the implicit sort was being + applied only to the gl_pathv vector and not the corresponding gl_statv + array. reported in OpenSSH bz#1935; feedback and okay matthew@ + - djm@cvs.openbsd.org 2011/08/26 01:45:15 + [ssh.1] + Add some missing ssh_config(5) options that can be used in ssh(1)'s + -o argument. Patch from duclare AT guu.fi + - djm@cvs.openbsd.org 2011/09/05 05:56:13 + [scp.1 sftp.1] + mention ControlPersist and KbdInteractiveAuthentication in the -o + verbiage in these pages too (prompted by jmc@) + - djm@cvs.openbsd.org 2011/09/05 05:59:08 + [misc.c] + fix typo in IPQoS parsing: there is no "AF14" class, but there is + an "AF21" class. Spotted by giesen AT snickers.org; ok markus stevesk + - jmc@cvs.openbsd.org 2011/09/05 07:01:44 + [scp.1] + knock out a useless Ns; + - deraadt@cvs.openbsd.org 2011/09/07 02:18:31 + [ssh-keygen.1] + typo (they vs the) found by Lawrence Teo + - djm@cvs.openbsd.org 2011/09/09 00:43:00 + [ssh_config.5 sshd_config.5] + fix typo in IPQoS parsing: there is no "AF14" class, but there is + an "AF21" class. Spotted by giesen AT snickers.org; ok markus stevesk + - djm@cvs.openbsd.org 2011/09/09 00:44:07 + [PROTOCOL.mux] + MUX_C_CLOSE_FWD includes forward type in message (though it isn't + implemented anyway) + - djm@cvs.openbsd.org 2011/09/09 22:37:01 + [scp.c] + suppress adding '--' to remote commandlines when the first argument + does not start with '-'. saves breakage on some difficult-to-upgrade + embedded/router platforms; feedback & ok dtucker ok markus + - djm@cvs.openbsd.org 2011/09/09 22:38:21 + [sshd.c] + kill the preauth privsep child on fatal errors in the monitor; + ok markus@ + - djm@cvs.openbsd.org 2011/09/09 22:46:44 + [channels.c channels.h clientloop.h mux.c ssh.c] + support for cancelling local and remote port forwards via the multiplex + socket. Use ssh -O cancel -L xx:xx:xx -R yy:yy:yy user@host" to request + the cancellation of the specified forwardings; ok markus@ + - markus@cvs.openbsd.org 2011/09/10 22:26:34 + [channels.c channels.h clientloop.c ssh.1] + support cancellation of local/dynamic forwardings from ~C commandline; + ok & feedback djm@ + - okan@cvs.openbsd.org 2011/09/11 06:59:05 + [ssh.1] + document new -O cancel command; ok djm@ + - markus@cvs.openbsd.org 2011/09/11 16:07:26 + [sftp-client.c] + fix leaks in do_hardlink() and do_readlink(); bz#1921 + from Loganaden Velvindron + - markus@cvs.openbsd.org 2011/09/12 08:46:15 + [sftp-client.c] + fix leak in do_lsreaddir(); ok djm + - djm@cvs.openbsd.org 2011/09/22 06:29:03 + [sftp.c] + don't let remote_glob() implicitly sort its results in do_globbed_ls() - + in all likelihood, they will be resorted anyway + +20110909 + - (dtucker) [entropy.h] Bug #1932: remove old definition of init_rng. From + Colin Watson. + 20110906 - (djm) [README version.h] Correct version - (djm) [contrib/redhat/openssh.spec] Correct restorcon => restorecon Modified: vendor-crypto/openssh/dist/INSTALL ============================================================================== --- vendor-crypto/openssh/dist/INSTALL Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/INSTALL Wed Aug 29 15:46:01 2012 (r239844) @@ -80,6 +80,12 @@ these multi-platform ports: http://www.thrysoee.dk/editline/ http://sourceforge.net/projects/libedit/ +LDNS: + +LDNS is a DNS BSD-licensed resolver library which supports DNSSEC. + +http://nlnetlabs.nl/projects/ldns/ + Autoconf: If you modify configure.ac or configure doesn't exist (eg if you checked @@ -260,4 +266,4 @@ Please refer to the "reporting bugs" sec http://www.openssh.com/ -$Id: INSTALL,v 1.86 2011/05/05 03:48:37 djm Exp $ +$Id: INSTALL,v 1.87 2011/11/04 00:25:25 dtucker Exp $ Modified: vendor-crypto/openssh/dist/LICENCE ============================================================================== --- vendor-crypto/openssh/dist/LICENCE Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/LICENCE Wed Aug 29 15:46:01 2012 (r239844) @@ -207,6 +207,7 @@ OpenSSH contains no GPL code. The SCO Group Daniel Walsh Red Hat, Inc + Simon Vallet / Genoscope * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: vendor-crypto/openssh/dist/Makefile.in ============================================================================== --- vendor-crypto/openssh/dist/Makefile.in Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/Makefile.in Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.325 2011/08/05 20:15:18 djm Exp $ +# $Id: Makefile.in,v 1.326 2012/04/04 01:27:57 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -90,7 +90,8 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ sftp-server.o sftp-common.o \ roaming_common.o roaming_serv.o \ - sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o + sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ + sandbox-seccomp-filter.o MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out sshd_config.5.out ssh_config.5.out MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 sshd_config.5 ssh_config.5 Modified: vendor-crypto/openssh/dist/PROTOCOL.mux ============================================================================== --- vendor-crypto/openssh/dist/PROTOCOL.mux Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/PROTOCOL.mux Wed Aug 29 15:46:01 2012 (r239844) @@ -133,6 +133,7 @@ A client may request the master to close uint32 MUX_C_CLOSE_FWD uint32 request id + uint32 forwarding type string listen host string listen port string connect host @@ -218,4 +219,4 @@ XXX inject packet (what about replies) XXX server->client error/warning notifications XXX send signals via mux -$OpenBSD: PROTOCOL.mux,v 1.7 2011/05/08 12:52:01 djm Exp $ +$OpenBSD: PROTOCOL.mux,v 1.8 2011/09/09 00:44:07 djm Exp $ Modified: vendor-crypto/openssh/dist/README ============================================================================== --- vendor-crypto/openssh/dist/README Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/README Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-5.9 for the release notes. +See http://www.openssh.com/txt/release-6.0 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.77.2.2 2011/09/06 23:11:20 djm Exp $ +$Id: README,v 1.80 2012/04/20 04:11:04 djm Exp $ Modified: vendor-crypto/openssh/dist/audit-bsm.c ============================================================================== --- vendor-crypto/openssh/dist/audit-bsm.c Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/audit-bsm.c Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -/* $Id: audit-bsm.c,v 1.7 2011/01/17 10:15:29 dtucker Exp $ */ +/* $Id: audit-bsm.c,v 1.8 2012/02/23 23:40:43 dtucker Exp $ */ /* * TODO @@ -45,6 +45,10 @@ #include #include +#ifdef BROKEN_BSM_API +#include +#endif + #include "ssh.h" #include "log.h" #include "key.h" @@ -114,6 +118,12 @@ extern int aug_daemon_session(void); extern Authctxt *the_authctxt; static AuditInfoTermID ssh_bsm_tid; +#ifdef BROKEN_BSM_API +/* For some reason this constant is no longer defined + in Solaris 11. */ +#define BSM_TEXTBUFSZ 256 +#endif + /* Below is the low-level BSM interface code */ /* @@ -161,6 +171,65 @@ aug_get_machine(char *host, u_int32_t *a } #endif +#ifdef BROKEN_BSM_API +/* + In Solaris 11 the audit daemon has been moved to SMF. In the process + they simply dropped getacna() from the API, since it read from a now + non-existent config file. This function re-implements getacna() to + read from the SMF repository instead. + */ +int +getacna(char *auditstring, int len) +{ + scf_handle_t *handle = NULL; + scf_property_t *property = NULL; + scf_value_t *value = NULL; + int ret = 0; + + handle = scf_handle_create(SCF_VERSION); + if (handle == NULL) + return -2; /* The man page for getacna on Solaris 10 states + we should return -2 in case of error and set + errno to indicate the error. We don't bother + with errno here, though, since the only use + of this function below doesn't check for errors + anyway. + */ + + ret = scf_handle_bind(handle); + if (ret == -1) + return -2; + + property = scf_property_create(handle); + if (property == NULL) + return -2; + + ret = scf_handle_decode_fmri(handle, + "svc:/system/auditd:default/:properties/preselection/naflags", + NULL, NULL, NULL, NULL, property, 0); + if (ret == -1) + return -2; + + value = scf_value_create(handle); + if (value == NULL) + return -2; + + ret = scf_property_get_value(property, value); + if (ret == -1) + return -2; + + ret = scf_value_get_astring(value, auditstring, len); + if (ret == -1) + return -2; + + scf_value_destroy(value); + scf_property_destroy(property); + scf_handle_destroy(handle); + + return 0; +} +#endif + /* * Check if the specified event is selected (enabled) for auditing. * Returns 1 if the event is selected, 0 if not and -1 on failure. @@ -213,7 +282,15 @@ bsm_audit_record(int typ, char *string, (void) au_write(ad, au_to_text(string)); (void) au_write(ad, AUToReturnFunc(typ, rc)); +#ifdef BROKEN_BSM_API + /* The last argument is the event modifier flags. For + some seemingly undocumented reason it was added in + Solaris 11. */ + rc = au_close(ad, AU_TO_WRITE, event_no, 0); +#else rc = au_close(ad, AU_TO_WRITE, event_no); +#endif + if (rc < 0) error("BSM audit: %s failed to write \"%s\" record: %s", __func__, string, strerror(errno)); Modified: vendor-crypto/openssh/dist/auth-options.c ============================================================================== --- vendor-crypto/openssh/dist/auth-options.c Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/auth-options.c Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.54 2010/12/24 21:41:48 djm Exp $ */ +/* $OpenBSD: auth-options.c,v 1.56 2011/10/18 04:58:26 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -341,7 +341,7 @@ auth_parse_options(struct passwd *pw, ch goto bad_option; } host = cleanhostname(host); - if (p == NULL || (port = a2port(p)) <= 0) { + if (p == NULL || (port = permitopen_port(p)) < 0) { debug("%.100s, line %lu: Bad permitopen port " "<%.100s>", file, linenum, p ? p : ""); auth_debug_add("%.100s, line %lu: " @@ -452,10 +452,6 @@ parse_option_list(u_char *optblob, size_ buffer_append(&data, data_blob, dlen); debug3("found certificate option \"%.100s\" len %u", name, dlen); - if (strlen(name) != nlen) { - error("Certificate constraint name contains \\0"); - goto out; - } found = 0; if ((which & OPTIONS_EXTENSIONS) != 0) { if (strcmp(name, "permit-X11-forwarding") == 0) { @@ -485,11 +481,6 @@ parse_option_list(u_char *optblob, size_ "corrupt", name); goto out; } - if (strlen(command) != clen) { - error("force-command constraint " - "contains \\0"); - goto out; - } if (*cert_forced_command != NULL) { error("Certificate has multiple " "force-command options"); @@ -506,11 +497,6 @@ parse_option_list(u_char *optblob, size_ "\"%s\" corrupt", name); goto out; } - if (strlen(allowed) != clen) { - error("source-address constraint " - "contains \\0"); - goto out; - } if ((*cert_source_address_done)++) { error("Certificate has multiple " "source-address options"); Modified: vendor-crypto/openssh/dist/auth2-pubkey.c ============================================================================== --- vendor-crypto/openssh/dist/auth2-pubkey.c Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/auth2-pubkey.c Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-pubkey.c,v 1.29 2011/05/23 03:30:07 djm Exp $ */ +/* $OpenBSD: auth2-pubkey.c,v 1.30 2011/09/25 05:44:47 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -238,8 +238,9 @@ match_principals_file(char *file, struct } for (i = 0; i < cert->nprincipals; i++) { if (strcmp(cp, cert->principals[i]) == 0) { - debug3("matched principal from file \"%.100s\"", - cert->principals[i]); + debug3("matched principal \"%.100s\" " + "from file \"%s\" on line %lu", + cert->principals[i], file, linenum); if (auth_parse_options(pw, line_opts, file, linenum) != 1) continue; Modified: vendor-crypto/openssh/dist/auth2.c ============================================================================== --- vendor-crypto/openssh/dist/auth2.c Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/auth2.c Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2.c,v 1.123 2011/03/10 02:52:57 djm Exp $ */ +/* $OpenBSD: auth2.c,v 1.124 2011/12/07 05:44:38 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -113,7 +113,7 @@ auth2_read_banner(void) close(fd); return (NULL); } - if (st.st_size > 1*1024*1024) { + if (st.st_size <= 0 || st.st_size > 1*1024*1024) { close(fd); return (NULL); } Modified: vendor-crypto/openssh/dist/authfile.c ============================================================================== --- vendor-crypto/openssh/dist/authfile.c Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/authfile.c Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -/* $OpenBSD: authfile.c,v 1.92 2011/06/14 22:49:18 markus Exp $ */ +/* $OpenBSD: authfile.c,v 1.93 2012/01/25 19:36:31 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -340,7 +340,7 @@ key_load_file(int fd, const char *filena filename == NULL ? "" : " "); return 0; } - buffer_init(blob); + buffer_clear(blob); for (;;) { if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) { if (errno == EPIPE) Modified: vendor-crypto/openssh/dist/channels.c ============================================================================== --- vendor-crypto/openssh/dist/channels.c Wed Aug 29 15:45:58 2012 (r239843) +++ vendor-crypto/openssh/dist/channels.c Wed Aug 29 15:46:01 2012 (r239844) @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.311 2011/06/22 22:08:42 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.315 2011/09/23 07:45:05 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -125,6 +125,9 @@ static int num_permitted_opens = 0; /* Number of permitted host/port pair in the array permitted by the admin. */ static int num_adm_permitted_opens = 0; +/* special-case port number meaning allow any port */ +#define FWD_PERMIT_ANY_PORT 0 + /* * If this is true, all opens are permitted. This is the case on the server * on which we have to trust the client anyway, and the user could do @@ -302,6 +305,8 @@ channel_new(char *ctype, int type, int r buffer_init(&c->output); buffer_init(&c->extended); c->path = NULL; + c->listening_addr = NULL; + c->listening_port = 0; c->ostate = CHAN_OUTPUT_OPEN; c->istate = CHAN_INPUT_OPEN; c->flags = 0; @@ -411,6 +416,10 @@ channel_free(Channel *c) xfree(c->path); c->path = NULL; } + if (c->listening_addr) { + xfree(c->listening_addr); + c->listening_addr = NULL; + } while ((cc = TAILQ_FIRST(&c->status_confirms)) != NULL) { if (cc->abandon_cb != NULL) cc->abandon_cb(c, cc->ctx); @@ -2634,6 +2643,46 @@ channel_set_af(int af) IPv4or6 = af; } + +/* + * Determine whether or not a port forward listens to loopback, the + * specified address or wildcard. On the client, a specified bind + * address will always override gateway_ports. On the server, a + * gateway_ports of 1 (``yes'') will override the client's specification + * and force a wildcard bind, whereas a value of 2 (``clientspecified'') + * will bind to whatever address the client asked for. + * + * Special-case listen_addrs are: + * + * "0.0.0.0" -> wildcard v4/v6 if SSH_OLD_FORWARD_ADDR + * "" (empty string), "*" -> wildcard v4/v6 + * "localhost" -> loopback v4/v6 + */ +static const char * +channel_fwd_bind_addr(const char *listen_addr, int *wildcardp, + int is_client, int gateway_ports) +{ + const char *addr = NULL; + int wildcard = 0; + + if (listen_addr == NULL) { + /* No address specified: default to gateway_ports setting */ + if (gateway_ports) + wildcard = 1; + } else if (gateway_ports || is_client) { + if (((datafellows & SSH_OLD_FORWARD_ADDR) && + strcmp(listen_addr, "0.0.0.0") == 0 && is_client == 0) || + *listen_addr == '\0' || strcmp(listen_addr, "*") == 0 || + (!is_client && gateway_ports == 1)) + wildcard = 1; + else if (strcmp(listen_addr, "localhost") != 0) + addr = listen_addr; + } + if (wildcardp != NULL) + *wildcardp = wildcard; + return addr; +} + static int channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_port, int *allocated_listen_port, @@ -2659,36 +2708,9 @@ channel_setup_fwd_listener(int type, con return 0; } - /* - * Determine whether or not a port forward listens to loopback, - * specified address or wildcard. On the client, a specified bind - * address will always override gateway_ports. On the server, a - * gateway_ports of 1 (``yes'') will override the client's - * specification and force a wildcard bind, whereas a value of 2 - * (``clientspecified'') will bind to whatever address the client - * asked for. - * - * Special-case listen_addrs are: - * - * "0.0.0.0" -> wildcard v4/v6 if SSH_OLD_FORWARD_ADDR - * "" (empty string), "*" -> wildcard v4/v6 - * "localhost" -> loopback v4/v6 - */ - addr = NULL; - if (listen_addr == NULL) { - /* No address specified: default to gateway_ports setting */ - if (gateway_ports) - wildcard = 1; - } else if (gateway_ports || is_client) { - if (((datafellows & SSH_OLD_FORWARD_ADDR) && - strcmp(listen_addr, "0.0.0.0") == 0 && is_client == 0) || - *listen_addr == '\0' || strcmp(listen_addr, "*") == 0 || - (!is_client && gateway_ports == 1)) - wildcard = 1; - else if (strcmp(listen_addr, "localhost") != 0) - addr = listen_addr; - } - + /* Determine the bind address, cf. channel_fwd_bind_addr() comment */ + addr = channel_fwd_bind_addr(listen_addr, &wildcard, + is_client, gateway_ports); debug3("channel_setup_fwd_listener: type %d wildcard %d addr %s", type, wildcard, (addr == NULL) ? "NULL" : addr); @@ -2792,7 +2814,12 @@ channel_setup_fwd_listener(int type, con 0, "port listener", 1); c->path = xstrdup(host); c->host_port = port_to_connect; - c->listening_port = listen_port; + c->listening_addr = addr == NULL ? NULL : xstrdup(addr); + if (listen_port == 0 && allocated_listen_port != NULL && + !(datafellows & SSH_BUG_DYNAMIC_RPORT)) + c->listening_port = *allocated_listen_port; + else + c->listening_port = listen_port; success = 1; } if (success == 0) @@ -2810,9 +2837,44 @@ channel_cancel_rport_listener(const char for (i = 0; i < channels_alloc; i++) { Channel *c = channels[i]; + if (c == NULL || c->type != SSH_CHANNEL_RPORT_LISTENER) + continue; + if (strcmp(c->path, host) == 0 && c->listening_port == port) { + debug2("%s: close channel %d", __func__, i); + channel_free(c); + found = 1; + } + } + + return (found); +} + +int +channel_cancel_lport_listener(const char *lhost, u_short lport, + int cport, int gateway_ports) +{ + u_int i; + int found = 0; + const char *addr = channel_fwd_bind_addr(lhost, NULL, 1, gateway_ports); - if (c != NULL && c->type == SSH_CHANNEL_RPORT_LISTENER && - strcmp(c->path, host) == 0 && c->listening_port == port) { + for (i = 0; i < channels_alloc; i++) { + Channel *c = channels[i]; + if (c == NULL || c->type != SSH_CHANNEL_PORT_LISTENER) + continue; + if (c->listening_port != lport) + continue; + if (cport == CHANNEL_CANCEL_PORT_STATIC) { + /* skip dynamic forwardings */ + if (c->host_port == 0) + continue; + } else { + if (c->host_port != cport) + continue; + } + if ((c->listening_addr == NULL && addr != NULL) || + (c->listening_addr != NULL && addr == NULL)) + continue; + if (addr == NULL || strcmp(c->listening_addr, addr) == 0) { debug2("%s: close channel %d", __func__, i); channel_free(c); found = 1; @@ -2843,37 +2905,44 @@ channel_setup_remote_fwd_listener(const } /* + * Translate the requested rfwd listen host to something usable for + * this server. + */ +static const char * +channel_rfwd_bind_host(const char *listen_host) +{ + if (listen_host == NULL) { + if (datafellows & SSH_BUG_RFWD_ADDR) + return "127.0.0.1"; + else + return "localhost"; + } else if (*listen_host == '\0' || strcmp(listen_host, "*") == 0) { + if (datafellows & SSH_BUG_RFWD_ADDR) + return "0.0.0.0"; + else + return ""; + } else + return listen_host; +} + +/* * Initiate forwarding of connections to port "port" on remote host through * the secure channel to host:port from local side. + * Returns handle (index) for updating the dynamic listen port with + * channel_update_permitted_opens(). */ - int channel_request_remote_forwarding(const char *listen_host, u_short listen_port, const char *host_to_connect, u_short port_to_connect) { - int type, success = 0; + int type, success = 0, idx = -1; /* Send the forward request to the remote side. */ if (compat20) { - const char *address_to_bind; - if (listen_host == NULL) { - if (datafellows & SSH_BUG_RFWD_ADDR) - address_to_bind = "127.0.0.1"; - else - address_to_bind = "localhost"; - } else if (*listen_host == '\0' || - strcmp(listen_host, "*") == 0) { - if (datafellows & SSH_BUG_RFWD_ADDR) - address_to_bind = "0.0.0.0"; - else - address_to_bind = ""; - } else - address_to_bind = listen_host; - packet_start(SSH2_MSG_GLOBAL_REQUEST); packet_put_cstring("tcpip-forward"); - packet_put_char(1); /* boolean: want reply */ - packet_put_cstring(address_to_bind); + packet_put_char(1); /* boolean: want reply */ + packet_put_cstring(channel_rfwd_bind_host(listen_host)); packet_put_int(listen_port); packet_send(); packet_write_wait(); @@ -2905,25 +2974,25 @@ channel_request_remote_forwarding(const /* Record that connection to this host/port is permitted. */ permitted_opens = xrealloc(permitted_opens, num_permitted_opens + 1, sizeof(*permitted_opens)); - permitted_opens[num_permitted_opens].host_to_connect = xstrdup(host_to_connect); - permitted_opens[num_permitted_opens].port_to_connect = port_to_connect; - permitted_opens[num_permitted_opens].listen_port = listen_port; - num_permitted_opens++; + idx = num_permitted_opens++; + permitted_opens[idx].host_to_connect = xstrdup(host_to_connect); + permitted_opens[idx].port_to_connect = port_to_connect; + permitted_opens[idx].listen_port = listen_port; } - return (success ? 0 : -1); + return (idx); } /* * Request cancellation of remote forwarding of connection host:port from * local side. */ -void +int channel_request_rforward_cancel(const char *host, u_short port) { int i; if (!compat20) - return; + return -1; for (i = 0; i < num_permitted_opens; i++) { if (permitted_opens[i].host_to_connect != NULL && @@ -2932,12 +3001,12 @@ channel_request_rforward_cancel(const ch } if (i >= num_permitted_opens) { debug("%s: requested forward not found", __func__); - return; + return -1; } packet_start(SSH2_MSG_GLOBAL_REQUEST); packet_put_cstring("cancel-tcpip-forward"); packet_put_char(0); - packet_put_cstring(host == NULL ? "" : host); + packet_put_cstring(channel_rfwd_bind_host(host)); packet_put_int(port); packet_send(); @@ -2945,6 +3014,8 @@ channel_request_rforward_cancel(const ch permitted_opens[i].port_to_connect = 0; xfree(permitted_opens[i].host_to_connect); permitted_opens[i].host_to_connect = NULL; + + return 0; } /* @@ -3013,6 +3084,35 @@ channel_add_permitted_opens(char *host, all_opens_permitted = 0; } +/* + * Update the listen port for a dynamic remote forward, after + * the actual 'newport' has been allocated. If 'newport' < 0 is + * passed then they entry will be invalidated. + */ +void +channel_update_permitted_opens(int idx, int newport) +{ + if (idx < 0 || idx >= num_permitted_opens) { + debug("channel_update_permitted_opens: index out of range:" + " %d num_permitted_opens %d", idx, num_permitted_opens); + return; + } + debug("%s allowed port %d for forwarding to host %s port %d", + newport > 0 ? "Updating" : "Removing", + newport, + permitted_opens[idx].host_to_connect, + permitted_opens[idx].port_to_connect); + if (newport >= 0) { + permitted_opens[idx].listen_port = + (datafellows & SSH_BUG_DYNAMIC_RPORT) ? 0 : newport; + } else { + permitted_opens[idx].listen_port = 0; + permitted_opens[idx].port_to_connect = 0; + xfree(permitted_opens[idx].host_to_connect); + permitted_opens[idx].host_to_connect = NULL; + } +} + int channel_add_adm_permitted_opens(char *host, int port) { @@ -3073,6 +3173,28 @@ channel_print_adm_permitted_opens(void) printf("\n"); } +/* returns port number, FWD_PERMIT_ANY_PORT or -1 on error */ +int +permitopen_port(const char *p) +{ + int port; + + if (strcmp(p, "*") == 0) + return FWD_PERMIT_ANY_PORT; + if ((port = a2port(p)) > 0) + return port; + return -1; +} + +static int +port_match(u_short allowedport, u_short requestedport) +{ + if (allowedport == FWD_PERMIT_ANY_PORT || *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:50:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCFF3106566C; Wed, 29 Aug 2012 15:50:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD58D8FC14; Wed, 29 Aug 2012 15:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFo9YM071262; Wed, 29 Aug 2012 15:50:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFo9mQ071260; Wed, 29 Aug 2012 15:50:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291550.q7TFo9mQ071260@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239845 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:50:10 -0000 Author: kib Date: Wed Aug 29 15:50:09 2012 New Revision: 239845 URL: http://svn.freebsd.org/changeset/base/239845 Log: MFC r236687: Improve handling of uiomove(9) errors for the NFS client. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:46:01 2012 (r239844) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:50:09 2012 (r239845) @@ -873,8 +873,9 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount; - int n, on, error = 0; - off_t tmp_off; + int bp_cached, n, on, error = 0; + size_t orig_resid, local_resid; + off_t orig_size, tmp_off; KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, @@ -926,6 +927,11 @@ flush_and_restart: mtx_unlock(&np->n_mtx); } + orig_resid = uio->uio_resid; + mtx_lock(&np->n_mtx); + orig_size = np->n_size; + mtx_unlock(&np->n_mtx); + /* * If IO_APPEND then load uio_offset. We restart here if we cannot * get the append lock. @@ -1103,7 +1109,10 @@ again: * normally. */ + bp_cached = 1; if (on == 0 && n == bcount) { + if ((bp->b_flags & B_CACHE) == 0) + bp_cached = 0; bp->b_flags |= B_CACHE; bp->b_flags &= ~B_INVAL; bp->b_ioflags &= ~BIO_ERROR; @@ -1169,8 +1178,24 @@ again: goto again; } + local_resid = uio->uio_resid; error = uiomove((char *)bp->b_data + on, n, uio); + if (error != 0 && !bp_cached) { + /* + * This block has no other content then what + * possibly was written by the faulty uiomove. + * Release it, forgetting the data pages, to + * prevent the leak of uninitialized data to + * usermode. + */ + bp->b_ioflags |= BIO_ERROR; + brelse(bp); + uio->uio_offset -= local_resid - uio->uio_resid; + uio->uio_resid = local_resid; + break; + } + /* * Since this block is being modified, it must be written * again and not just committed. Since write clustering does @@ -1179,17 +1204,18 @@ again: */ bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK); - if (error) { - bp->b_ioflags |= BIO_ERROR; - brelse(bp); - break; - } + /* + * Get the partial update on the progress made from + * uiomove, if an error occured. + */ + if (error != 0) + n = local_resid - uio->uio_resid; /* * Only update dirtyoff/dirtyend if not a degenerate * condition. */ - if (n) { + if (n > 0) { if (bp->b_dirtyend > 0) { bp->b_dirtyoff = min(on, bp->b_dirtyoff); bp->b_dirtyend = max((on + n), bp->b_dirtyend); @@ -1218,8 +1244,22 @@ again: } else { bdwrite(bp); } + + if (error != 0) + break; } while (uio->uio_resid > 0 && n > 0); + if (error != 0) { + if (ioflag & IO_UNIT) { + VATTR_NULL(&vattr); + vattr.va_size = orig_size; + /* IO_SYNC is handled implicitely */ + (void)VOP_SETATTR(vp, &vattr, cred); + uio->uio_offset -= orig_resid - uio->uio_resid; + uio->uio_resid = orig_resid; + } + } + return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:51:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4F0F106566C; Wed, 29 Aug 2012 15:51:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69B78FC17; Wed, 29 Aug 2012 15:51:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFp4r0071420; Wed, 29 Aug 2012 15:51:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFp49g071419; Wed, 29 Aug 2012 15:51:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291551.q7TFp49g071419@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239846 - in vendor-crypto/openssh/dist: . openbsd-compat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:51:05 -0000 Author: des Date: Wed Aug 29 15:51:04 2012 New Revision: 239846 URL: http://svn.freebsd.org/changeset/base/239846 Log: Remove autoprops :( Modified: Directory Properties: vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c (props changed) vendor-crypto/openssh/dist/openbsd-compat/strnlen.c (props changed) vendor-crypto/openssh/dist/sandbox-seccomp-filter.c (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:51:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB524106568E; Wed, 29 Aug 2012 15:51:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D9458FC20; Wed, 29 Aug 2012 15:51:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFpeKh071517; Wed, 29 Aug 2012 15:51:40 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFpepS071516; Wed, 29 Aug 2012 15:51:40 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291551.q7TFpepS071516@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239847 - vendor-crypto/openssh/6.0p1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:51:40 -0000 Author: des Date: Wed Aug 29 15:51:40 2012 New Revision: 239847 URL: http://svn.freebsd.org/changeset/base/239847 Log: Tag OpenSSH 6.0p1 Added: vendor-crypto/openssh/6.0p1/ - copied from r239846, vendor-crypto/openssh/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:53:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB8B106566C; Wed, 29 Aug 2012 15:53:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 295998FC12; Wed, 29 Aug 2012 15:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFrS2T071766; Wed, 29 Aug 2012 15:53:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFrRlv071764; Wed, 29 Aug 2012 15:53:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291553.q7TFrRlv071764@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239848 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:53:28 -0000 Author: kib Date: Wed Aug 29 15:53:27 2012 New Revision: 239848 URL: http://svn.freebsd.org/changeset/base/239848 Log: MFC r237987: Do not override an error from uiomove() with (non-)error result from bwrite(). Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:51:40 2012 (r239847) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:53:27 2012 (r239848) @@ -873,7 +873,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount; - int bp_cached, n, on, error = 0; + int bp_cached, n, on, error = 0, error1; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -1235,9 +1235,12 @@ again: if ((ioflag & IO_SYNC)) { if (ioflag & IO_INVAL) bp->b_flags |= B_NOCACHE; - error = bwrite(bp); - if (error) + error1 = bwrite(bp); + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } else if ((n + on) == biosize) { bp->b_flags |= B_ASYNC; (void) ncl_writebp(bp, 0, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:55:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E4EA106564A; Wed, 29 Aug 2012 15:55:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65AD08FC12; Wed, 29 Aug 2012 15:55:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFtt7v072144; Wed, 29 Aug 2012 15:55:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFttHv072129; Wed, 29 Aug 2012 15:55:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291555.q7TFttHv072129@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239849 - in vendor-crypto/openssh/dist: . contrib contrib/caldera contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:55:55 -0000 Author: des Date: Wed Aug 29 15:55:54 2012 New Revision: 239849 URL: http://svn.freebsd.org/changeset/base/239849 Log: Vendor import of OpenSSH 6.1p1. Modified: vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/dist/PROTOCOL.certkeys vendor-crypto/openssh/dist/PROTOCOL.mux vendor-crypto/openssh/dist/README vendor-crypto/openssh/dist/addrmatch.c vendor-crypto/openssh/dist/auth-krb5.c vendor-crypto/openssh/dist/auth-passwd.c vendor-crypto/openssh/dist/auth.c vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/dist/channels.h vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/dist/configure vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/dist/contrib/Makefile vendor-crypto/openssh/dist/contrib/caldera/openssh.spec vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/dist/dns.c vendor-crypto/openssh/dist/dns.h vendor-crypto/openssh/dist/jpake.c vendor-crypto/openssh/dist/key.c vendor-crypto/openssh/dist/key.h vendor-crypto/openssh/dist/mac.c vendor-crypto/openssh/dist/moduli vendor-crypto/openssh/dist/moduli.0 vendor-crypto/openssh/dist/moduli.c vendor-crypto/openssh/dist/monitor.c vendor-crypto/openssh/dist/mux.c vendor-crypto/openssh/dist/myproposal.h vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.h vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.h vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c vendor-crypto/openssh/dist/regress/addrmatch.sh vendor-crypto/openssh/dist/regress/cipher-speed.sh vendor-crypto/openssh/dist/regress/connect-privsep.sh vendor-crypto/openssh/dist/regress/forwarding.sh vendor-crypto/openssh/dist/regress/multiplex.sh vendor-crypto/openssh/dist/regress/reexec.sh vendor-crypto/openssh/dist/regress/sftp-cmds.sh vendor-crypto/openssh/dist/regress/test-exec.sh vendor-crypto/openssh/dist/regress/try-ciphers.sh vendor-crypto/openssh/dist/sandbox-rlimit.c vendor-crypto/openssh/dist/sandbox-seccomp-filter.c vendor-crypto/openssh/dist/sandbox-systrace.c vendor-crypto/openssh/dist/scp.0 vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/dist/servconf.h vendor-crypto/openssh/dist/serverloop.c vendor-crypto/openssh/dist/session.c vendor-crypto/openssh/dist/sftp-client.c vendor-crypto/openssh/dist/sftp-server.0 vendor-crypto/openssh/dist/sftp.0 vendor-crypto/openssh/dist/sftp.c vendor-crypto/openssh/dist/ssh-add.0 vendor-crypto/openssh/dist/ssh-agent.0 vendor-crypto/openssh/dist/ssh-keygen.0 vendor-crypto/openssh/dist/ssh-keygen.1 vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/dist/ssh-keyscan.0 vendor-crypto/openssh/dist/ssh-keyscan.1 vendor-crypto/openssh/dist/ssh-keyscan.c vendor-crypto/openssh/dist/ssh-keysign.0 vendor-crypto/openssh/dist/ssh-pkcs11-helper.0 vendor-crypto/openssh/dist/ssh-pkcs11-helper.c vendor-crypto/openssh/dist/ssh.0 vendor-crypto/openssh/dist/ssh.1 vendor-crypto/openssh/dist/ssh.c vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/dist/sshconnect2.c vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/dist/sshd.8 vendor-crypto/openssh/dist/sshd.c vendor-crypto/openssh/dist/sshd_config vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/dist/sshd_config.5 vendor-crypto/openssh/dist/version.h Modified: vendor-crypto/openssh/dist/ChangeLog ============================================================================== --- vendor-crypto/openssh/dist/ChangeLog Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/ChangeLog Wed Aug 29 15:55:54 2012 (r239849) @@ -1,3 +1,298 @@ +20120828 + - (djm) Release openssh-6.1 + +20120828 + - (dtucker) [openbsd-compat/bsd-cygwin_util.h] define WIN32_LEAN_AND_MEAN + for compatibility with future mingw-w64 headers. Patch from vinschen at + redhat com. + +20120822 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Update version numbers + +20120731 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2012/07/06 06:38:03 + [ssh-keygen.c] + missing full stop in usage(); + - djm@cvs.openbsd.org 2012/07/10 02:19:15 + [servconf.c servconf.h sshd.c sshd_config] + Turn on systrace sandboxing of pre-auth sshd by default for new installs + by shipping a config that overrides the current UsePrivilegeSeparation=yes + default. Make it easier to flip the default in the future by adding too. + prodded markus@ feedback dtucker@ "get it in" deraadt@ + - dtucker@cvs.openbsd.org 2012/07/13 01:35:21 + [servconf.c] + handle long comments in config files better. bz#2025, ok markus + - markus@cvs.openbsd.org 2012/07/22 18:19:21 + [version.h] + openssh 6.1 + +20120720 + - (dtucker) Import regened moduli file. + +20120706 + - (djm) [sandbox-seccomp-filter.c] fallback to rlimit if seccomp filter is + not available. Allows use of sshd compiled on host with a filter-capable + kernel on hosts that lack the support. bz#2011 ok dtucker@ + - (djm) [configure.ac] Recursively expand $(bindir) to ensure it has no + unexpanded $(prefix) embedded. bz#2007 patch from nix-corp AT + esperi.org.uk; ok dtucker@ +- (djm) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/07/06 00:41:59 + [moduli.c ssh-keygen.1 ssh-keygen.c] + Add options to specify starting line number and number of lines to process + when screening moduli candidates. This allows processing of different + parts of a candidate moduli file in parallel. man page help jmc@, ok djm@ + - djm@cvs.openbsd.org 2012/07/06 01:37:21 + [mux.c] + fix memory leak of passed-in environment variables and connection + context when new session message is malformed; bz#2003 from Bert.Wesarg + AT googlemail.com + - djm@cvs.openbsd.org 2012/07/06 01:47:38 + [ssh.c] + move setting of tty_flag to after config parsing so RequestTTY options + are correctly picked up. bz#1995 patch from przemoc AT gmail.com; + ok dtucker@ + +20120704 + - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] Add setlinebuf for + platforms that don't have it. "looks good" tim@ + +20120703 + - (dtucker) [configure.ac] Detect platforms that can't use select(2) with + setrlimit(RLIMIT_NOFILE, rl_zero) and disable the rlimit sandbox on those. + - (dtucker) [configure.ac sandbox-rlimit.c] Test whether or not + setrlimit(RLIMIT_FSIZE, rl_zero) and skip it if it's not supported. Its + benefit is minor, so it's not worth disabling the sandbox if it doesn't + work. + +20120702 +- (dtucker) OpenBSD CVS Sync + - naddy@cvs.openbsd.org 2012/06/29 13:57:25 + [ssh_config.5 sshd_config.5] + match the documented MAC order of preference to the actual one; + ok dtucker@ + - markus@cvs.openbsd.org 2012/06/30 14:35:09 + [sandbox-systrace.c sshd.c] + fix a during the load of the sandbox policies (child can still make + the read-syscall and wait forever for systrace-answers) by replacing + the read/write synchronisation with SIGSTOP/SIGCONT; + report and help hshoexer@; ok djm@, dtucker@ + - dtucker@cvs.openbsd.org 2012/07/02 08:50:03 + [ssh.c] + set interactive ToS for forwarded X11 sessions. ok djm@ + - dtucker@cvs.openbsd.org 2012/07/02 12:13:26 + [ssh-pkcs11-helper.c sftp-client.c] + fix a couple of "assigned but not used" warnings. ok markus@ + - dtucker@cvs.openbsd.org 2012/07/02 14:37:06 + [regress/connect-privsep.sh] + remove exit from end of test since it prevents reporting failure + - (dtucker) [regress/reexec.sh regress/sftp-cmds.sh regress/test-exec.sh] + Move cygwin detection to test-exec and use to skip reexec test on cygwin. + - (dtucker) [regress/test-exec.sh] Correct uname for cygwin/w2k. + +20120629 + - OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/06/21 00:16:07 + [addrmatch.c] + fix strlcpy truncation check. from carsten at debian org, ok markus + - dtucker@cvs.openbsd.org 2012/06/22 12:30:26 + [monitor.c sshconnect2.c] + remove dead code following 'for (;;)' loops. + From Steve.McClellan at radisys com, ok markus@ + - dtucker@cvs.openbsd.org 2012/06/22 14:36:33 + [sftp.c] + Remove unused variable leftover from tab-completion changes. + From Steve.McClellan at radisys com, ok markus@ + - dtucker@cvs.openbsd.org 2012/06/26 11:02:30 + [sandbox-systrace.c] + Add mquery to the list of allowed syscalls for "UsePrivilegeSeparation + sandbox" since malloc now uses it. From johnw.mail at gmail com. + - dtucker@cvs.openbsd.org 2012/06/28 05:07:45 + [mac.c myproposal.h ssh_config.5 sshd_config.5] + Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed + from draft6 of the spec and will not be in the RFC when published. Patch + from mdb at juniper net via bz#2023, ok markus. + - naddy@cvs.openbsd.org 2012/06/29 13:57:25 + [ssh_config.5 sshd_config.5] + match the documented MAC order of preference to the actual one; ok dtucker@ + - dtucker@cvs.openbsd.org 2012/05/13 01:42:32 + [regress/addrmatch.sh] + Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests + to match. Feedback and ok djm@ markus@. + - djm@cvs.openbsd.org 2012/06/01 00:47:35 + [regress/multiplex.sh regress/forwarding.sh] + append to rather than truncate test log; bz#2013 from openssh AT + roumenpetrov.info + - djm@cvs.openbsd.org 2012/06/01 00:52:52 + [regress/sftp-cmds.sh] + don't delete .* on cleanup due to unintended env expansion; pointed out in + bz#2014 by openssh AT roumenpetrov.info + - dtucker@cvs.openbsd.org 2012/06/26 12:06:59 + [regress/connect-privsep.sh] + test sandbox with every malloc option + - dtucker@cvs.openbsd.org 2012/06/28 05:07:45 + [regress/try-ciphers.sh regress/cipher-speed.sh] + Remove hmac-sha2-256-96 and hmac-sha2-512-96 MACs since they were removed + from draft6 of the spec and will not be in the RFC when published. Patch + from mdb at juniper net via bz#2023, ok markus. + - (dtucker) [myproposal.h] Remove trailing backslash to fix compile error. + - (dtucker) [key.c] ifdef out sha256 key types on platforms that don't have + the required functions in libcrypto. + +20120628 + - (dtucker) [openbsd-compat/getrrsetbyname-ldns.c] bz #2022: prevent null + pointer deref in the client when built with LDNS and using DNSSEC with a + CNAME. Patch from gregdlg+mr at hochet info. + +20120622 + - (dtucker) [contrib/cygwin/ssh-host-config] Ensure that user sshd runs as + can logon as a service. Patch from vinschen at redhat com. + +20120620 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2011/12/02 00:41:56 + [mux.c] + fix bz#1948: ssh -f doesn't fork for multiplexed connection. + ok dtucker@ + - djm@cvs.openbsd.org 2011/12/04 23:16:12 + [mux.c] + revert: + > revision 1.32 + > date: 2011/12/02 00:41:56; author: djm; state: Exp; lines: +4 -1 + > fix bz#1948: ssh -f doesn't fork for multiplexed connection. + > ok dtucker@ + it interacts badly with ControlPersist + - djm@cvs.openbsd.org 2012/01/07 21:11:36 + [mux.c] + fix double-free in new session handler + NB. Id sync only + - djm@cvs.openbsd.org 2012/05/23 03:28:28 + [dns.c dns.h key.c key.h ssh-keygen.c] + add support for RFC6594 SSHFP DNS records for ECDSA key types. + patch from bugzilla-m67 AT nulld.me in bz#1978; ok + tweak markus@ + - djm@cvs.openbsd.org 2012/06/01 00:49:35 + [PROTOCOL.mux] + correct types of port numbers (integers, not strings); bz#2004 from + bert.wesarg AT googlemail.com + - djm@cvs.openbsd.org 2012/06/01 01:01:22 + [mux.c] + fix memory leak when mux socket creation fails; bz#2002 from bert.wesarg + AT googlemail.com + - dtucker@cvs.openbsd.org 2012/06/18 11:43:53 + [jpake.c] + correct sizeof usage. patch from saw at online.de, ok deraadt + - dtucker@cvs.openbsd.org 2012/06/18 11:49:58 + [ssh_config.5] + RSA instead of DSA twice. From Steve.McClellan at radisys com + - dtucker@cvs.openbsd.org 2012/06/18 12:07:07 + [ssh.1 sshd.8] + Remove mention of 'three' key files since there are now four. From + Steve.McClellan at radisys com. + - dtucker@cvs.openbsd.org 2012/06/18 12:17:18 + [ssh.1] + Clarify description of -W. Noted by Steve.McClellan at radisys com, + ok jmc + - markus@cvs.openbsd.org 2012/06/19 18:25:28 + [servconf.c servconf.h sshd_config.5] + sshd_config: extend Match to allow AcceptEnv and {Allow,Deny}{Users,Groups} + this allows 'Match LocalPort 1022' combined with 'AllowUser bauer' + ok djm@ (back in March) + - jmc@cvs.openbsd.org 2012/06/19 21:35:54 + [sshd_config.5] + tweak previous; ok markus + - djm@cvs.openbsd.org 2012/06/20 04:42:58 + [clientloop.c serverloop.c] + initialise accept() backoff timer to avoid EINVAL from select(2) in + rekeying + +20120519 + - (dtucker) [configure.ac] bz#2010: fix non-portable shell construct. Patch + from cjwatson at debian org. + - (dtucker) [configure.ac contrib/Makefile] bz#1996: use AC_PATH_TOOL to find + pkg-config so it does the right thing when cross-compiling. Patch from + cjwatson at debian org. +- (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/05/13 01:42:32 + [servconf.h servconf.c sshd.8 sshd.c auth.c sshd_config.5] + Add "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests + to match. Feedback and ok djm@ markus@. + - dtucker@cvs.openbsd.org 2012/05/19 06:30:30 + [sshd_config.5] + Document PermitOpen none. bz#2001, patch from Loganaden Velvindron + +20120504 + - (dtucker) [configure.ac] Include rather than + to fix building on some plaforms. Fom bowman at math utah edu and + des at des no. + +20120427 + - (dtucker) [regress/addrmatch.sh] skip tests when running on a non-ipv6 + platform rather than exiting early, so that we still clean up and return + success or failure to test-exec.sh + +20120426 + - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters + via Niels + - (djm) [auth-krb5.c] Save errno across calls that might modify it; + ok dtucker@ + +20120423 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/04/23 08:18:17 + [channels.c] + fix function proto/source mismatch + +20120422 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/02/29 11:21:26 + [ssh-keygen.c] + allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@ + - guenther@cvs.openbsd.org 2012/03/15 03:10:27 + [session.c] + root should always be excluded from the test for /etc/nologin instead + of having it always enforced even when marked as ignorenologin. This + regressed when the logic was incompletely flipped around in rev 1.251 + ok halex@ millert@ + - djm@cvs.openbsd.org 2012/03/28 07:23:22 + [PROTOCOL.certkeys] + explain certificate extensions/crit split rationale. Mention requirement + that each appear at most once per cert. + - dtucker@cvs.openbsd.org 2012/03/29 23:54:36 + [channels.c channels.h servconf.c] + Add PermitOpen none option based on patch from Loganaden Velvindron + (bz #1949). ok djm@ + - djm@cvs.openbsd.org 2012/04/11 13:16:19 + [channels.c channels.h clientloop.c serverloop.c] + don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a + while; ok deraadt@ markus@ + - djm@cvs.openbsd.org 2012/04/11 13:17:54 + [auth.c] + Support "none" as an argument for AuthorizedPrincipalsFile to indicate + no file should be read. + - djm@cvs.openbsd.org 2012/04/11 13:26:40 + [sshd.c] + don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a + while; ok deraadt@ markus@ + - djm@cvs.openbsd.org 2012/04/11 13:34:17 + [ssh-keyscan.1 ssh-keyscan.c] + now that sshd defaults to offering ECDSA keys, ssh-keyscan should also + look for them by default; bz#1971 + - djm@cvs.openbsd.org 2012/04/12 02:42:32 + [servconf.c servconf.h sshd.c sshd_config sshd_config.5] + VersionAddendum option to allow server operators to append some arbitrary + text to the SSH-... banner; ok deraadt@ "don't care" markus@ + - djm@cvs.openbsd.org 2012/04/12 02:43:55 + [sshd_config sshd_config.5] + mention AuthorizedPrincipalsFile=none default + - djm@cvs.openbsd.org 2012/04/20 03:24:23 + [sftp.c] + setlinebuf(3) is more readable than setvbuf(.., _IOLBF, ...) + - jmc@cvs.openbsd.org 2012/04/20 16:26:22 + [ssh.1] + use "brackets" instead of "braces", for consistency; + 20120420 - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] [contrib/suse/openssh.spec] Update for release 6.0 Modified: vendor-crypto/openssh/dist/PROTOCOL.certkeys ============================================================================== --- vendor-crypto/openssh/dist/PROTOCOL.certkeys Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/PROTOCOL.certkeys Wed Aug 29 15:55:54 2012 (r239849) @@ -162,6 +162,13 @@ extensions is a set of zero or more opti are not critical, and an implementation that encounters one that it does not recognise may safely ignore it. +Generally, critical options are used to control features that restrict +access where extensions are used to enable features that grant access. +This ensures that certificates containing unknown restrictions do not +inadvertently grant access while allowing new protocol features to be +enabled via extensions without breaking certificates' backwards +compatibility. + The reserved field is currently unused and is ignored in this version of the protocol. @@ -189,7 +196,7 @@ is a sequence of zero or more tuples: string data Options must be lexically ordered by "name" if they appear in the -sequence. +sequence. Each named option may only appear once in a certificate. The name field identifies the option and the data field encodes option-specific information (see below). All options are @@ -220,7 +227,9 @@ Extensions The extensions section of the certificate specifies zero or more non-critical certificate extensions. The encoding and ordering of -extensions in this field is identical to that of the critical options. +extensions in this field is identical to that of the critical options, +as is the requirement that each name appear only once. + If an implementation does not recognise an extension, then it should ignore it. @@ -253,4 +262,4 @@ permit-user-rc empty Fl of this script will not be permitted if this option is not present. -$OpenBSD: PROTOCOL.certkeys,v 1.8 2010/08/31 11:54:45 djm Exp $ +$OpenBSD: PROTOCOL.certkeys,v 1.9 2012/03/28 07:23:22 djm Exp $ Modified: vendor-crypto/openssh/dist/PROTOCOL.mux ============================================================================== --- vendor-crypto/openssh/dist/PROTOCOL.mux Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/PROTOCOL.mux Wed Aug 29 15:55:54 2012 (r239849) @@ -110,9 +110,9 @@ A client may request the master to estab uint32 request id uint32 forwarding type string listen host - string listen port + uint32 listen port string connect host - string connect port + uint32 connect port forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. @@ -135,9 +135,9 @@ A client may request the master to close uint32 request id uint32 forwarding type string listen host - string listen port + uint32 listen port string connect host - string connect port + uint32 connect port A server may reply with a MUX_S_OK, a MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. @@ -219,4 +219,4 @@ XXX inject packet (what about replies) XXX server->client error/warning notifications XXX send signals via mux -$OpenBSD: PROTOCOL.mux,v 1.8 2011/09/09 00:44:07 djm Exp $ +$OpenBSD: PROTOCOL.mux,v 1.9 2012/06/01 00:49:35 djm Exp $ Modified: vendor-crypto/openssh/dist/README ============================================================================== --- vendor-crypto/openssh/dist/README Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/README Wed Aug 29 15:55:54 2012 (r239849) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-6.0 for the release notes. +See http://www.openssh.com/txt/release-6.1 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.80 2012/04/20 04:11:04 djm Exp $ +$Id: README,v 1.81 2012/08/22 11:57:13 djm Exp $ Modified: vendor-crypto/openssh/dist/addrmatch.c ============================================================================== --- vendor-crypto/openssh/dist/addrmatch.c Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/addrmatch.c Wed Aug 29 15:55:54 2012 (r239849) @@ -1,4 +1,4 @@ -/* $OpenBSD: addrmatch.c,v 1.5 2010/02/26 20:29:54 djm Exp $ */ +/* $OpenBSD: addrmatch.c,v 1.6 2012/06/21 00:16:07 dtucker Exp $ */ /* * Copyright (c) 2004-2008 Damien Miller @@ -318,7 +318,7 @@ addr_pton_cidr(const char *p, struct xad char addrbuf[64], *mp, *cp; /* Don't modify argument */ - if (p == NULL || strlcpy(addrbuf, p, sizeof(addrbuf)) > sizeof(addrbuf)) + if (p == NULL || strlcpy(addrbuf, p, sizeof(addrbuf)) >= sizeof(addrbuf)) return -1; if ((mp = strchr(addrbuf, '/')) != NULL) { Modified: vendor-crypto/openssh/dist/auth-krb5.c ============================================================================== --- vendor-crypto/openssh/dist/auth-krb5.c Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/auth-krb5.c Wed Aug 29 15:55:54 2012 (r239849) @@ -226,7 +226,7 @@ krb5_cleanup_proc(Authctxt *authctxt) #ifndef HEIMDAL krb5_error_code ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { - int tmpfd, ret; + int tmpfd, ret, oerrno; char ccname[40]; mode_t old_umask; @@ -237,16 +237,18 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_c old_umask = umask(0177); tmpfd = mkstemp(ccname + strlen("FILE:")); + oerrno = errno; umask(old_umask); if (tmpfd == -1) { - logit("mkstemp(): %.100s", strerror(errno)); - return errno; + logit("mkstemp(): %.100s", strerror(oerrno)); + return oerrno; } if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) { - logit("fchmod(): %.100s", strerror(errno)); + oerrno = errno; + logit("fchmod(): %.100s", strerror(oerrno)); close(tmpfd); - return errno; + return oerrno; } close(tmpfd); Modified: vendor-crypto/openssh/dist/auth-passwd.c ============================================================================== --- vendor-crypto/openssh/dist/auth-passwd.c Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/auth-passwd.c Wed Aug 29 15:55:54 2012 (r239849) @@ -209,6 +209,7 @@ sys_auth_passwd(Authctxt *authctxt, cons * Authentication is accepted if the encrypted passwords * are identical. */ - return (strcmp(encrypted_password, pw_password) == 0); + return encrypted_password != NULL && + strcmp(encrypted_password, pw_password) == 0; } #endif Modified: vendor-crypto/openssh/dist/auth.c ============================================================================== --- vendor-crypto/openssh/dist/auth.c Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/auth.c Wed Aug 29 15:55:54 2012 (r239849) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.c,v 1.94 2011/05/23 03:33:38 djm Exp $ */ +/* $OpenBSD: auth.c,v 1.96 2012/05/13 01:42:32 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -357,7 +357,8 @@ expand_authorized_keys(const char *filen char * authorized_principals_file(struct passwd *pw) { - if (options.authorized_principals_file == NULL) + if (options.authorized_principals_file == NULL || + strcasecmp(options.authorized_principals_file, "none") == 0) return NULL; return expand_authorized_keys(options.authorized_principals_file, pw); } @@ -544,9 +545,10 @@ getpwnamallow(const char *user) #endif #endif struct passwd *pw; + struct connection_info *ci = get_connection_info(1, options.use_dns); - parse_server_match_config(&options, user, - get_canonical_hostname(options.use_dns), get_remote_ipaddr()); + ci->user = user; + parse_server_match_config(&options, ci); #if defined(_AIX) && defined(HAVE_SETAUTHDB) aix_setauthdb(user); Modified: vendor-crypto/openssh/dist/channels.c ============================================================================== --- vendor-crypto/openssh/dist/channels.c Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/channels.c Wed Aug 29 15:55:54 2012 (r239849) @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.315 2011/09/23 07:45:05 markus Exp $ */ +/* $OpenBSD: channels.c,v 1.318 2012/04/23 08:18:17 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -311,6 +311,7 @@ channel_new(char *ctype, int type, int r c->istate = CHAN_INPUT_OPEN; c->flags = 0; channel_register_fds(c, rfd, wfd, efd, extusage, nonblock, 0); + c->notbefore = 0; c->self = found; c->type = type; c->ctype = ctype; @@ -1339,6 +1340,8 @@ channel_post_x11_listener(Channel *c, fd } if (newsock < 0) { error("accept: %.100s", strerror(errno)); + if (errno == EMFILE || errno == ENFILE) + c->notbefore = time(NULL) + 1; return; } set_nodelay(newsock); @@ -1482,6 +1485,8 @@ channel_post_port_listener(Channel *c, f newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen); if (newsock < 0) { error("accept: %.100s", strerror(errno)); + if (errno == EMFILE || errno == ENFILE) + c->notbefore = time(NULL) + 1; return; } set_nodelay(newsock); @@ -1514,7 +1519,10 @@ channel_post_auth_listener(Channel *c, f addrlen = sizeof(addr); newsock = accept(c->sock, (struct sockaddr *)&addr, &addrlen); if (newsock < 0) { - error("accept from auth socket: %.100s", strerror(errno)); + error("accept from auth socket: %.100s", + strerror(errno)); + if (errno == EMFILE || errno == ENFILE) + c->notbefore = time(NULL) + 1; return; } nc = channel_new("accepted auth socket", @@ -1917,6 +1925,8 @@ channel_post_mux_listener(Channel *c, fd if ((newsock = accept(c->sock, (struct sockaddr*)&addr, &addrlen)) == -1) { error("%s accept: %s", __func__, strerror(errno)); + if (errno == EMFILE || errno == ENFILE) + c->notbefore = time(NULL) + 1; return; } @@ -2067,16 +2077,21 @@ channel_garbage_collect(Channel *c) } static void -channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset) +channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset, + time_t *unpause_secs) { static int did_init = 0; u_int i, oalloc; Channel *c; + time_t now; if (!did_init) { channel_handler_init(); did_init = 1; } + now = time(NULL); + if (unpause_secs != NULL) + *unpause_secs = 0; for (i = 0, oalloc = channels_alloc; i < oalloc; i++) { c = channels[i]; if (c == NULL) @@ -2087,10 +2102,30 @@ channel_handler(chan_fn *ftab[], fd_set else continue; } - if (ftab[c->type] != NULL) - (*ftab[c->type])(c, readset, writeset); + if (ftab[c->type] != NULL) { + /* + * Run handlers that are not paused. + */ + if (c->notbefore <= now) + (*ftab[c->type])(c, readset, writeset); + else if (unpause_secs != NULL) { + /* + * Collect the time that the earliest + * channel comes off pause. + */ + debug3("%s: chan %d: skip for %d more seconds", + __func__, c->self, + (int)(c->notbefore - now)); + if (*unpause_secs == 0 || + (c->notbefore - now) < *unpause_secs) + *unpause_secs = c->notbefore - now; + } + } channel_garbage_collect(c); } + if (unpause_secs != NULL && *unpause_secs != 0) + debug3("%s: first channel unpauses in %d seconds", + __func__, (int)*unpause_secs); } /* @@ -2099,7 +2134,7 @@ channel_handler(chan_fn *ftab[], fd_set */ void channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp, - u_int *nallocp, int rekeying) + u_int *nallocp, time_t *minwait_secs, int rekeying) { u_int n, sz, nfdset; @@ -2122,7 +2157,8 @@ channel_prepare_select(fd_set **readsetp memset(*writesetp, 0, sz); if (!rekeying) - channel_handler(channel_pre, *readsetp, *writesetp); + channel_handler(channel_pre, *readsetp, *writesetp, + minwait_secs); } /* @@ -2132,7 +2168,7 @@ channel_prepare_select(fd_set **readsetp void channel_after_select(fd_set *readset, fd_set *writeset) { - channel_handler(channel_post, readset, writeset); + channel_handler(channel_post, readset, writeset, NULL); } @@ -3127,6 +3163,17 @@ channel_add_adm_permitted_opens(char *ho } void +channel_disable_adm_local_opens(void) +{ + if (num_adm_permitted_opens == 0) { + permitted_adm_opens = xmalloc(sizeof(*permitted_adm_opens)); + permitted_adm_opens[num_adm_permitted_opens].host_to_connect + = NULL; + num_adm_permitted_opens = 1; + } +} + +void channel_clear_permitted_opens(void) { int i; @@ -3167,7 +3214,9 @@ channel_print_adm_permitted_opens(void) return; } for (i = 0; i < num_adm_permitted_opens; i++) - if (permitted_adm_opens[i].host_to_connect != NULL) + if (permitted_adm_opens[i].host_to_connect == NULL) + printf(" none"); + else printf(" %s:%d", permitted_adm_opens[i].host_to_connect, permitted_adm_opens[i].port_to_connect); printf("\n"); Modified: vendor-crypto/openssh/dist/channels.h ============================================================================== --- vendor-crypto/openssh/dist/channels.h Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/channels.h Wed Aug 29 15:55:54 2012 (r239849) @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.h,v 1.109 2011/09/23 07:45:05 markus Exp $ */ +/* $OpenBSD: channels.h,v 1.111 2012/04/11 13:16:19 djm Exp $ */ /* * Author: Tatu Ylonen @@ -105,6 +105,7 @@ struct Channel { int wfd_isatty; /* wfd is a tty */ int client_tty; /* (client) TTY has been requested */ int force_drain; /* force close on iEOF */ + time_t notbefore; /* Pause IO until deadline (time_t) */ int delayed; /* post-select handlers for newly created * channels are delayed until the first call * to a matching pre-select handler. @@ -238,7 +239,8 @@ void channel_input_status_confirm(int, /* file descriptor handling (read/write) */ -void channel_prepare_select(fd_set **, fd_set **, int *, u_int*, int); +void channel_prepare_select(fd_set **, fd_set **, int *, u_int*, + time_t*, int); void channel_after_select(fd_set *, fd_set *); void channel_output_poll(void); @@ -253,6 +255,7 @@ void channel_set_af(int af); void channel_permit_all_opens(void); void channel_add_permitted_opens(char *, int); int channel_add_adm_permitted_opens(char *, int); +void channel_disable_adm_local_opens(void); void channel_update_permitted_opens(int, int); void channel_clear_permitted_opens(void); void channel_clear_adm_permitted_opens(void); Modified: vendor-crypto/openssh/dist/clientloop.c ============================================================================== --- vendor-crypto/openssh/dist/clientloop.c Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/clientloop.c Wed Aug 29 15:55:54 2012 (r239849) @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.238 2012/01/18 21:46:43 dtucker Exp $ */ +/* $OpenBSD: clientloop.c,v 1.240 2012/06/20 04:42:58 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -583,10 +583,12 @@ client_wait_until_can_do_something(fd_se { struct timeval tv, *tvp; int timeout_secs; + time_t minwait_secs = 0; int ret; /* Add any selections by the channel mechanism. */ - channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, rekeying); + channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, + &minwait_secs, rekeying); if (!compat20) { /* Read from the connection, unless our buffers are full. */ @@ -639,6 +641,8 @@ client_wait_until_can_do_something(fd_se if (timeout_secs < 0) timeout_secs = 0; } + if (minwait_secs != 0) + timeout_secs = MIN(timeout_secs, (int)minwait_secs); if (timeout_secs == INT_MAX) tvp = NULL; else { Modified: vendor-crypto/openssh/dist/config.h.in ============================================================================== --- vendor-crypto/openssh/dist/config.h.in Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/config.h.in Wed Aug 29 15:55:54 2012 (r239849) @@ -822,6 +822,9 @@ /* Define to 1 if you have the `setgroups' function. */ #undef HAVE_SETGROUPS +/* Define to 1 if you have the `setlinebuf' function. */ +#undef HAVE_SETLINEBUF + /* Define to 1 if you have the `setlogin' function. */ #undef HAVE_SETLOGIN @@ -1374,6 +1377,9 @@ /* Sandbox using seccomp filter */ #undef SANDBOX_SECCOMP_FILTER +/* setrlimit RLIMIT_FSIZE works */ +#undef SANDBOX_SKIP_RLIMIT_FSIZE + /* Sandbox using systrace(4) */ #undef SANDBOX_SYSTRACE Modified: vendor-crypto/openssh/dist/configure ============================================================================== --- vendor-crypto/openssh/dist/configure Wed Aug 29 15:53:27 2012 (r239848) +++ vendor-crypto/openssh/dist/configure Wed Aug 29 15:55:54 2012 (r239849) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.489 . +# From configure.ac Revision: 1.496 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for OpenSSH Portable. # @@ -6927,7 +6927,8 @@ $as_echo "#define SSH_TUN_PREPEND_AF 1" for ac_header in linux/seccomp.h linux/filter.h linux/audit.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include +" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -9137,8 +9138,9 @@ LIBEDIT_MSG="no" if test "${with_libedit+set}" = set; then : withval=$with_libedit; if test "x$withval" != "xno" ; then if test "x$withval" = "xyes" ; then - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKGCONFIG+:} false; then : @@ -9164,7 +9166,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_PKGCONFIG" && ac_cv_path_PKGCONFIG="no" ;; esac fi @@ -9178,6 +9179,63 @@ $as_echo "no" >&6; } fi +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +$as_echo "$ac_pt_PKGCONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi + if test "x$PKGCONFIG" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $PKGCONFIG knows about libedit" >&5 $as_echo_n "checking if $PKGCONFIG knows about libedit... " >&6; } @@ -9499,6 +9557,7 @@ for ac_func in \ seteuid \ setgroupent \ setgroups \ + setlinebuf \ setlogin \ setpassent\ setpcred \ @@ -11784,6 +11843,109 @@ if test "${with_sandbox+set}" = set; the fi + +# Some platforms (seems to be the ones that have a kernel poll(2)-type +# function with which they implement select(2)) use an extra file descriptor +# when calling select(2), which means we can't use the rlimit sandbox. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select works with descriptor rlimit" >&5 +$as_echo_n "checking if select works with descriptor rlimit... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming yes" >&5 +$as_echo "$as_me: WARNING: cross compiling: assuming yes" >&2;} + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_SYS_TIME_H +# include +#endif +#include +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#include +#include +#include + +int +main () +{ + + struct rlimit rl_zero; + int fd, r; + fd_set fds; + + fd = open("/dev/null", O_RDONLY); + FD_ZERO(&fds); + FD_SET(fd, &fds); + rl_zero.rlim_cur = rl_zero.rlim_max = 0; + setrlimit(RLIMIT_FSIZE, &rl_zero); + setrlimit(RLIMIT_NOFILE, &rl_zero); + r = select(fd+1, &fds, NULL, NULL, NULL); + exit (r == -1 ? 1 : 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + select_works_with_rlimit=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + select_works_with_rlimit=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if setrlimit RLIMIT_FSIZE works" >&5 +$as_echo_n "checking if setrlimit RLIMIT_FSIZE works... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: assuming yes" >&5 +$as_echo "$as_me: WARNING: cross compiling: assuming yes" >&2;} + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + + struct rlimit rl_zero; + + rl_zero.rlim_cur = rl_zero.rlim_max = 0; + exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define SANDBOX_SKIP_RLIMIT_FSIZE 1" >>confdefs.h + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + if test "x$sandbox_arg" = "xsystrace" || \ ( test -z "$sandbox_arg" && test "x$have_systr_policy_kill" = "x1" ) ; then test "x$have_systr_policy_kill" != "x1" && \ @@ -11804,7 +11966,7 @@ $as_echo "#define SANDBOX_DARWIN 1" >>co elif test "x$sandbox_arg" = "xseccomp_filter" || \ ( test -z "$sandbox_arg" && \ - test "x$have_seccomp_filter" == "x1" && \ + test "x$have_seccomp_filter" = "x1" && \ test "x$ac_cv_header_linux_audit_h" = "xyes" && \ test "x$have_seccomp_audit_arch" = "x1" && \ test "x$have_linux_no_new_privs" = "x1" && \ @@ -11822,9 +11984,12 @@ elif test "x$sandbox_arg" = "xseccomp_fi $as_echo "#define SANDBOX_SECCOMP_FILTER 1" >>confdefs.h elif test "x$sandbox_arg" = "xrlimit" || \ - ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" ) ; then + ( test -z "$sandbox_arg" && test "x$ac_cv_func_setrlimit" = "xyes" && \ + test "x$select_works_with_rlimit" == "xyes" ) ; then test "x$ac_cv_func_setrlimit" != "xyes" && \ as_fn_error $? "rlimit sandbox requires setrlimit function" "$LINENO" 5 + test "x$select_works_with_rlimit" != "xyes" && \ + as_fn_error $? "rlimit sandbox requires select to work with rlimit" "$LINENO" 5 SANDBOX_STYLE="rlimit" $as_echo "#define SANDBOX_RLIMIT 1" >>confdefs.h @@ -14118,7 +14283,7 @@ $as_echo_n "checking if struct statvfs.f cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include #include #ifdef HAVE_SYS_TIME_H # include @@ -16077,13 +16242,16 @@ rm -f core *.core core.conftest.* gmon.o fi # make sure $bindir is in USER_PATH so scp will work - t_bindir=`eval echo ${bindir}` - case $t_bindir in - NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;; - esac - case $t_bindir in - NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:56:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C21D1065687; Wed, 29 Aug 2012 15:56:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 769228FC0A; Wed, 29 Aug 2012 15:56:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFuEdr072220; Wed, 29 Aug 2012 15:56:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFuEik072217; Wed, 29 Aug 2012 15:56:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291556.q7TFuEik072217@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239850 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:56:14 -0000 Author: kib Date: Wed Aug 29 15:56:13 2012 New Revision: 239850 URL: http://svn.freebsd.org/changeset/base/239850 Log: MFC r236322: Enable vn_io_fault() lock avoidance for UFS. Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c stable/9/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Wed Aug 29 15:55:54 2012 (r239849) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Wed Aug 29 15:56:13 2012 (r239850) @@ -1064,7 +1064,7 @@ ffs_mountfs(devvp, mp, td) */ MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | - MNTK_EXTENDED_SHARED; + MNTK_EXTENDED_SHARED | MNTK_NO_IOPF; MNT_IUNLOCK(mp); #ifdef UFS_EXTATTR #ifdef UFS_EXTATTR_AUTOSTART Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Wed Aug 29 15:55:54 2012 (r239849) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Wed Aug 29 15:56:13 2012 (r239850) @@ -567,7 +567,7 @@ ffs_read(ap) xfersize = size; } - error = uiomove((char *)bp->b_data + blkoffset, + error = vn_io_fault_uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); if (error) break; @@ -738,8 +738,8 @@ ffs_write(ap) if (size < xfersize) xfersize = size; - error = - uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); + error = vn_io_fault_uiomove((char *)bp->b_data + blkoffset, + (int)xfersize, uio); /* * If the buffer is not already filled and we encounter an * error while trying to fill it, we have to clear out any From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:56:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 691F610657D6; Wed, 29 Aug 2012 15:56:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7368FC17; Wed, 29 Aug 2012 15:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFuQYA072279; Wed, 29 Aug 2012 15:56:26 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFuQKp072278; Wed, 29 Aug 2012 15:56:26 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291556.q7TFuQKp072278@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239851 - vendor-crypto/openssh/6.1p1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:56:26 -0000 Author: des Date: Wed Aug 29 15:56:25 2012 New Revision: 239851 URL: http://svn.freebsd.org/changeset/base/239851 Log: Tag OpenSSH 6.1p1 Added: vendor-crypto/openssh/6.1p1/ - copied from r239850, vendor-crypto/openssh/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 15:58:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07877106564A; Wed, 29 Aug 2012 15:58:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E55638FC19; Wed, 29 Aug 2012 15:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFwi7J072633; Wed, 29 Aug 2012 15:58:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFwihO072630; Wed, 29 Aug 2012 15:58:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291558.q7TFwihO072630@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239852 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:58:45 -0000 Author: kib Date: Wed Aug 29 15:58:44 2012 New Revision: 239852 URL: http://svn.freebsd.org/changeset/base/239852 Log: MFC r237367: Enable deadlock avoidance code for NFS client. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:56:25 2012 (r239851) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:58:44 2012 (r239852) @@ -698,7 +698,7 @@ ncl_bioread(struct vnode *vp, struct uio }; if (n > 0) { - error = uiomove(bp->b_data + on, (int)n, uio); + error = vn_io_fault_uiomove(bp->b_data + on, (int)n, uio); } if (vp->v_type == VLNK) n = 0; @@ -1179,7 +1179,7 @@ again: } local_resid = uio->uio_resid; - error = uiomove((char *)bp->b_data + on, n, uio); + error = vn_io_fault_uiomove((char *)bp->b_data + on, n, uio); if (error != 0 && !bp_cached) { /* Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Aug 29 15:56:25 2012 (r239851) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Aug 29 15:58:44 2012 (r239852) @@ -1136,7 +1136,8 @@ nfs_mount(struct mount *mp) out: if (!error) { MNT_ILOCK(mp); - mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED); + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | + MNTK_NO_IOPF; MNT_IUNLOCK(mp); } return (error); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:00:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 253821065675; Wed, 29 Aug 2012 16:00:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA3FD8FC14; Wed, 29 Aug 2012 16:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TG0QEh072915; Wed, 29 Aug 2012 16:00:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TG0QCn072914; Wed, 29 Aug 2012 16:00:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291600.q7TG0QCn072914@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239853 - stable/9/tools/test/upsdl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:00:27 -0000 Author: kib Date: Wed Aug 29 16:00:26 2012 New Revision: 239853 URL: http://svn.freebsd.org/changeset/base/239853 Log: MFC r238374: Add a test program, written by Stephan Uphoff, which demonstrates the deadlock due to i/o performed over the buffers backed by file mappings. Added: stable/9/tools/test/upsdl/ - copied from r238374, head/tools/test/upsdl/ Modified: Directory Properties: stable/9/tools/test/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:11:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1C091065670; Wed, 29 Aug 2012 16:11:03 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D376B8FC1A; Wed, 29 Aug 2012 16:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGB3kf074850; Wed, 29 Aug 2012 16:11:03 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGB3xX074847; Wed, 29 Aug 2012 16:11:03 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208291611.q7TGB3xX074847@svn.freebsd.org> From: Jamie Gritton Date: Wed, 29 Aug 2012 16:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239854 - stable/9/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:11:04 -0000 Author: jamie Date: Wed Aug 29 16:11:03 2012 New Revision: 239854 URL: http://svn.freebsd.org/changeset/base/239854 Log: MFC r239601: Remember that I'm using length-defined strings in parameters: Remove a bogus null terminator when stripping the netmask from IP addresses. This was causing later addresses in a comma-separated string to disappear. Use memcpy instead of strcpy. This could just cause Bad Things. MFC r239602: Pre-separate IP addresses passed on the command line, so they can be properly parsed for interface prefixes and netmask suffixes. This was already done for the old-style (fixed) command line, but missed for the new-style. MFC r239621: Partially roll back r239601 - keep parameter strings both length-delimited and null-terminated at the same time, because they're later passed to libjail as null-terminated. That means I also need to add a nul byte when comma-combining array parameters. PR: 170832 Modified: stable/9/usr.sbin/jail/config.c stable/9/usr.sbin/jail/jail.c Directory Properties: stable/9/usr.sbin/jail/ (props changed) Modified: stable/9/usr.sbin/jail/config.c ============================================================================== --- stable/9/usr.sbin/jail/config.c Wed Aug 29 16:00:26 2012 (r239853) +++ stable/9/usr.sbin/jail/config.c Wed Aug 29 16:11:03 2012 (r239854) @@ -596,7 +596,7 @@ check_intparams(struct cfjail *j) error = -1; } *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -620,7 +620,7 @@ check_intparams(struct cfjail *j) error = -1; } *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -712,12 +712,11 @@ import_params(struct cfjail *j) value = alloca(vallen); cs = value; TAILQ_FOREACH_SAFE(s, &p->val, tq, ts) { - strcpy(cs, s->s); - if (ts != NULL) { - cs += s->len + 1; - cs[-1] = ','; - } + memcpy(cs, s->s, s->len); + cs += s->len + 1; + cs[-1] = ','; } + value[vallen - 1] = '\0'; } if (jailparam_import(jp, value) < 0) { error = -1; Modified: stable/9/usr.sbin/jail/jail.c ============================================================================== --- stable/9/usr.sbin/jail/jail.c Wed Aug 29 16:00:26 2012 (r239853) +++ stable/9/usr.sbin/jail/jail.c Wed Aug 29 16:11:03 2012 (r239854) @@ -304,9 +304,33 @@ main(int argc, char **argv) for (i++; i < argc; i++) add_param(NULL, NULL, IP_COMMAND, argv[i]); - break; } - add_param(NULL, NULL, 0, argv[i]); +#ifdef INET + else if (!strncmp(argv[i], "ip4.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP4_ADDR, cs); + if (!ncs) + break; + } + } +#endif +#ifdef INET6 + else if (!strncmp(argv[i], "ip6.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP6_ADDR, cs); + if (!ncs) + break; + } + } +#endif + else + add_param(NULL, NULL, 0, argv[i]); } } else { /* From the config file, perhaps with a specified jail */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:15:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDB51065673; Wed, 29 Aug 2012 16:15:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 991668FC1D; Wed, 29 Aug 2012 16:15:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGFMbW075914; Wed, 29 Aug 2012 16:15:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGFMPr075912; Wed, 29 Aug 2012 16:15:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208291615.q7TGFMPr075912@svn.freebsd.org> From: Ed Schouten Date: Wed, 29 Aug 2012 16:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239855 - head/usr.sbin/ac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:15:22 -0000 Author: ed Date: Wed Aug 29 16:15:22 2012 New Revision: 239855 URL: http://svn.freebsd.org/changeset/base/239855 Log: Fix whitespace. Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Wed Aug 29 16:11:03 2012 (r239854) +++ head/usr.sbin/ac/ac.c Wed Aug 29 16:15:22 2012 (r239855) @@ -60,7 +60,7 @@ struct tty_list { * globals - yes yuk */ #ifdef CONSOLE_TTY -static char *Console = CONSOLE_TTY; +static char *Console = CONSOLE_TTY; #endif static time_t Total = 0; static time_t FirstTime = 0; @@ -406,7 +406,6 @@ log_out(struct utmp_list *head, struct u return head; } - /* * if do_tty says ok, login a user */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:17:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33565106566C; Wed, 29 Aug 2012 16:17:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB2078FC14; Wed, 29 Aug 2012 16:17:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGH24F076290; Wed, 29 Aug 2012 16:17:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGH2KH076287; Wed, 29 Aug 2012 16:17:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291617.q7TGH2KH076287@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239856 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:17:03 -0000 Author: kib Date: Wed Aug 29 16:17:02 2012 New Revision: 239856 URL: http://svn.freebsd.org/changeset/base/239856 Log: MFC r238614: Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4. MFC r238627: Remove line which was accidentally kept in r238614. PR: standards/169962 Modified: stable/9/sys/kern/kern_descrip.c stable/9/sys/sys/fcntl.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Wed Aug 29 16:15:22 2012 (r239855) +++ stable/9/sys/kern/kern_descrip.c Wed Aug 29 16:17:02 2012 (r239856) @@ -113,6 +113,7 @@ static uma_zone_t file_zone; /* Flags for do_dup() */ #define DUP_FIXED 0x1 /* Force fixed allocation */ #define DUP_FCNTL 0x2 /* fcntl()-style errors */ +#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ static int do_dup(struct thread *td, int flags, int old, int new, register_t *retval); @@ -486,6 +487,12 @@ kern_fcntl(struct thread *td, int fd, in error = do_dup(td, DUP_FCNTL, fd, tmp, td->td_retval); break; + case F_DUPFD_CLOEXEC: + tmp = arg; + error = do_dup(td, DUP_FCNTL | DUP_CLOEXEC, fd, tmp, + td->td_retval); + break; + case F_DUP2FD: tmp = arg; error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); @@ -914,7 +921,10 @@ do_dup(struct thread *td, int flags, int * Duplicate the source descriptor */ fdp->fd_ofiles[new] = fp; - fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE; + if ((flags & DUP_CLOEXEC) != 0) + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] | UF_EXCLOSE; + else + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] & ~UF_EXCLOSE; if (new > fdp->fd_lastfile) fdp->fd_lastfile = new; *retval = new; Modified: stable/9/sys/sys/fcntl.h ============================================================================== --- stable/9/sys/sys/fcntl.h Wed Aug 29 16:15:22 2012 (r239855) +++ stable/9/sys/sys/fcntl.h Wed Aug 29 16:17:02 2012 (r239856) @@ -225,6 +225,9 @@ typedef __pid_t pid_t; #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ +#endif /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:23:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99A53106564A; Wed, 29 Aug 2012 16:23:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8460E8FC18; Wed, 29 Aug 2012 16:23:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGNUTV077094; Wed, 29 Aug 2012 16:23:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGNURc077091; Wed, 29 Aug 2012 16:23:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291623.q7TGNURc077091@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239857 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:23:30 -0000 Author: kib Date: Wed Aug 29 16:23:29 2012 New Revision: 239857 URL: http://svn.freebsd.org/changeset/base/239857 Log: MFC r238834: Add F_DUP2FD_CLOEXEC. PR: standards/169962 Modified: stable/9/sys/kern/kern_descrip.c stable/9/sys/sys/fcntl.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Wed Aug 29 16:17:02 2012 (r239856) +++ stable/9/sys/kern/kern_descrip.c Wed Aug 29 16:23:29 2012 (r239857) @@ -498,6 +498,12 @@ kern_fcntl(struct thread *td, int fd, in error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); break; + case F_DUP2FD_CLOEXEC: + tmp = arg; + error = do_dup(td, DUP_FIXED | DUP_CLOEXEC, fd, tmp, + td->td_retval); + break; + case F_GETFD: FILEDESC_SLOCK(fdp); if ((fp = fdtofp(fd, fdp)) == NULL) { @@ -836,6 +842,8 @@ do_dup(struct thread *td, int flags, int } if (flags & DUP_FIXED && old == new) { *retval = new; + if (flags & DUP_CLOEXEC) + fdp->fd_ofileflags[new] |= UF_EXCLOSE; FILEDESC_XUNLOCK(fdp); return (0); } Modified: stable/9/sys/sys/fcntl.h ============================================================================== --- stable/9/sys/sys/fcntl.h Wed Aug 29 16:17:02 2012 (r239856) +++ stable/9/sys/sys/fcntl.h Wed Aug 29 16:23:29 2012 (r239857) @@ -228,6 +228,9 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif +#if __BSD_VISIBLE +#define F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */ +#endif /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:25:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8D921065670; Wed, 29 Aug 2012 16:25:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A29A78FC0C; Wed, 29 Aug 2012 16:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGPXJG077389; Wed, 29 Aug 2012 16:25:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGPXXO077387; Wed, 29 Aug 2012 16:25:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291625.q7TGPXXO077387@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239858 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:25:33 -0000 Author: kib Date: Wed Aug 29 16:25:33 2012 New Revision: 239858 URL: http://svn.freebsd.org/changeset/base/239858 Log: MFC r238615: Document F_DUPFD_CLOEXEC. Modified: stable/9/lib/libc/sys/fcntl.2 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/sys/fcntl.2 ============================================================================== --- stable/9/lib/libc/sys/fcntl.2 Wed Aug 29 16:23:29 2012 (r239857) +++ stable/9/lib/libc/sys/fcntl.2 Wed Aug 29 16:25:33 2012 (r239858) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd September 28, 2009 +.Dd July 18, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -54,7 +54,7 @@ Depending on the value of .Fn fcntl can take an additional third argument .Fa "int arg" . -.Bl -tag -width F_GETOWNX +.Bl -tag -width F_DUPFD_CLOEXEC .It Dv F_DUPFD Return a new descriptor as follows: .Pp @@ -73,11 +73,22 @@ Same access mode (read, write or read/wr Same file status flags (i.e., both file descriptors share the same file status flags). .It -The close-on-exec flag associated with the new file descriptor -is set to remain open across +The close-on-exec flag +.Dv FD_CLOEXEC +associated with the new file descriptor is cleared, so the file descriptor is +to remain open across .Xr execve 2 system calls. .El +.It Dv F_DUPFD_CLOEXEC +Like +.Dv F_DUPFD , +but the +.Dv FD_CLOEXEC +flag associated with the new file descriptor is set, so the file descriptor +is closed when +.Xr execve 2 +system call executes. .It Dv F_DUP2FD It is functionally equivalent to .Bd -literal -offset indent From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:26:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDAD8106566B; Wed, 29 Aug 2012 16:26:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B81048FC1C; Wed, 29 Aug 2012 16:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGQfCr077581; Wed, 29 Aug 2012 16:26:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGQfj9077579; Wed, 29 Aug 2012 16:26:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291626.q7TGQfj9077579@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239859 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:26:42 -0000 Author: kib Date: Wed Aug 29 16:26:41 2012 New Revision: 239859 URL: http://svn.freebsd.org/changeset/base/239859 Log: MFC r238835: Document F_DUP2FD_CLOEXEC. Modified: stable/9/lib/libc/sys/fcntl.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/fcntl.2 ============================================================================== --- stable/9/lib/libc/sys/fcntl.2 Wed Aug 29 16:25:33 2012 (r239858) +++ stable/9/lib/libc/sys/fcntl.2 Wed Aug 29 16:26:41 2012 (r239859) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd July 18, 2012 +.Dd July 27, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -54,7 +54,7 @@ Depending on the value of .Fn fcntl can take an additional third argument .Fa "int arg" . -.Bl -tag -width F_DUPFD_CLOEXEC +.Bl -tag -width F_DUP2FD_CLOEXEC .It Dv F_DUPFD Return a new descriptor as follows: .Pp @@ -94,13 +94,23 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed +.It Dv F_DU2PFD_CLOEXEC +Like +.Dv F_DUP2FD , +but the +.Dv FD_CLOEXEC +flag associated with the new file descriptor is set. .Pp The .Dv F_DUP2FD -constant is not portable, so it should not be used if portability is needed. +and +.Dv F_DUP2DF_CLOEXEC +constants are not portable, so they should not be used if +portability is needed. Use .Fn dup2 -instead. +instead of +.Dv F_DUP2FD . .It Dv F_GETFD Get the close-on-exec flag associated with the file descriptor .Fa fd From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:37:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1995F106564A; Wed, 29 Aug 2012 16:37:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DED4C8FC19; Wed, 29 Aug 2012 16:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGbmTV079013; Wed, 29 Aug 2012 16:37:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGbmZh079009; Wed, 29 Aug 2012 16:37:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291637.q7TGbmZh079009@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239860 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:37:49 -0000 Author: kib Date: Wed Aug 29 16:37:48 2012 New Revision: 239860 URL: http://svn.freebsd.org/changeset/base/239860 Log: MFC r238614: Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4. MFC r238627: Remove line which was accidentally kept in r238614. PR: standards/169962 Modified: stable/8/sys/kern/kern_descrip.c stable/8/sys/sys/fcntl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/kern/kern_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Wed Aug 29 16:26:41 2012 (r239859) +++ stable/8/sys/kern/kern_descrip.c Wed Aug 29 16:37:48 2012 (r239860) @@ -100,6 +100,7 @@ static uma_zone_t file_zone; /* Flags for do_dup() */ #define DUP_FIXED 0x1 /* Force fixed allocation */ #define DUP_FCNTL 0x2 /* fcntl()-style errors */ +#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ static int do_dup(struct thread *td, int flags, int old, int new, register_t *retval); @@ -441,6 +442,12 @@ kern_fcntl(struct thread *td, int fd, in error = do_dup(td, DUP_FCNTL, fd, tmp, td->td_retval); break; + case F_DUPFD_CLOEXEC: + tmp = arg; + error = do_dup(td, DUP_FCNTL | DUP_CLOEXEC, fd, tmp, + td->td_retval); + break; + case F_DUP2FD: tmp = arg; error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); @@ -848,7 +855,10 @@ do_dup(struct thread *td, int flags, int * Duplicate the source descriptor */ fdp->fd_ofiles[new] = fp; - fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE; + if ((flags & DUP_CLOEXEC) != 0) + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] | UF_EXCLOSE; + else + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] & ~UF_EXCLOSE; if (new > fdp->fd_lastfile) fdp->fd_lastfile = new; *retval = new; Modified: stable/8/sys/sys/fcntl.h ============================================================================== --- stable/8/sys/sys/fcntl.h Wed Aug 29 16:26:41 2012 (r239859) +++ stable/8/sys/sys/fcntl.h Wed Aug 29 16:37:48 2012 (r239860) @@ -225,6 +225,9 @@ typedef __pid_t pid_t; #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ +#endif /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:42:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83E2C1065673; Wed, 29 Aug 2012 16:42:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2BB8FC0C; Wed, 29 Aug 2012 16:42:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGgR9K079688; Wed, 29 Aug 2012 16:42:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGgRaK079685; Wed, 29 Aug 2012 16:42:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291642.q7TGgRaK079685@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239861 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:42:27 -0000 Author: kib Date: Wed Aug 29 16:42:26 2012 New Revision: 239861 URL: http://svn.freebsd.org/changeset/base/239861 Log: MFC r238834: Add F_DUP2FD_CLOEXEC. PR: standards/169962 Modified: stable/8/sys/kern/kern_descrip.c stable/8/sys/sys/fcntl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/kern/kern_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Wed Aug 29 16:37:48 2012 (r239860) +++ stable/8/sys/kern/kern_descrip.c Wed Aug 29 16:42:26 2012 (r239861) @@ -453,6 +453,12 @@ kern_fcntl(struct thread *td, int fd, in error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); break; + case F_DUP2FD_CLOEXEC: + tmp = arg; + error = do_dup(td, DUP_FIXED | DUP_CLOEXEC, fd, tmp, + td->td_retval); + break; + case F_GETFD: FILEDESC_SLOCK(fdp); if ((fp = fdtofp(fd, fdp)) == NULL) { @@ -789,6 +795,8 @@ do_dup(struct thread *td, int flags, int } if (flags & DUP_FIXED && old == new) { *retval = new; + if (flags & DUP_CLOEXEC) + fdp->fd_ofileflags[new] |= UF_EXCLOSE; FILEDESC_XUNLOCK(fdp); return (0); } Modified: stable/8/sys/sys/fcntl.h ============================================================================== --- stable/8/sys/sys/fcntl.h Wed Aug 29 16:37:48 2012 (r239860) +++ stable/8/sys/sys/fcntl.h Wed Aug 29 16:42:26 2012 (r239861) @@ -228,6 +228,9 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif +#if __BSD_VISIBLE +#define F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */ +#endif /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:43:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4DC1065673; Wed, 29 Aug 2012 16:43:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48E4F8FC14; Wed, 29 Aug 2012 16:43:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGhwPF079906; Wed, 29 Aug 2012 16:43:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGhwNr079903; Wed, 29 Aug 2012 16:43:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291643.q7TGhwNr079903@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239862 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:43:58 -0000 Author: kib Date: Wed Aug 29 16:43:57 2012 New Revision: 239862 URL: http://svn.freebsd.org/changeset/base/239862 Log: MFC r238615: Document F_DUPFD_CLOEXEC. Modified: stable/8/lib/libc/sys/fcntl.2 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/sys/fcntl.2 ============================================================================== --- stable/8/lib/libc/sys/fcntl.2 Wed Aug 29 16:42:26 2012 (r239861) +++ stable/8/lib/libc/sys/fcntl.2 Wed Aug 29 16:43:57 2012 (r239862) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd September 28, 2009 +.Dd July 18, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -54,7 +54,7 @@ Depending on the value of .Fn fcntl can take an additional third argument .Fa "int arg" . -.Bl -tag -width F_GETOWNX +.Bl -tag -width F_DUPFD_CLOEXEC .It Dv F_DUPFD Return a new descriptor as follows: .Pp @@ -73,11 +73,22 @@ Same access mode (read, write or read/wr Same file status flags (i.e., both file descriptors share the same file status flags). .It -The close-on-exec flag associated with the new file descriptor -is set to remain open across +The close-on-exec flag +.Dv FD_CLOEXEC +associated with the new file descriptor is cleared, so the file descriptor is +to remain open across .Xr execve 2 system calls. .El +.It Dv F_DUPFD_CLOEXEC +Like +.Dv F_DUPFD , +but the +.Dv FD_CLOEXEC +flag associated with the new file descriptor is set, so the file descriptor +is closed when +.Xr execve 2 +system call executes. .It Dv F_DUP2FD It is functionally equivalent to .Bd -literal -offset indent From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:44:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47DE81065675; Wed, 29 Aug 2012 16:44:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324798FC1F; Wed, 29 Aug 2012 16:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGipRv080087; Wed, 29 Aug 2012 16:44:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGio2E080084; Wed, 29 Aug 2012 16:44:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291644.q7TGio2E080084@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 16:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239863 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:44:51 -0000 Author: kib Date: Wed Aug 29 16:44:50 2012 New Revision: 239863 URL: http://svn.freebsd.org/changeset/base/239863 Log: MFC r238835: Document F_DUP2FD_CLOEXEC. Modified: stable/8/lib/libc/sys/fcntl.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/fcntl.2 ============================================================================== --- stable/8/lib/libc/sys/fcntl.2 Wed Aug 29 16:43:57 2012 (r239862) +++ stable/8/lib/libc/sys/fcntl.2 Wed Aug 29 16:44:50 2012 (r239863) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd July 18, 2012 +.Dd July 27, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -54,7 +54,7 @@ Depending on the value of .Fn fcntl can take an additional third argument .Fa "int arg" . -.Bl -tag -width F_DUPFD_CLOEXEC +.Bl -tag -width F_DUP2FD_CLOEXEC .It Dv F_DUPFD Return a new descriptor as follows: .Pp @@ -94,13 +94,23 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed +.It Dv F_DU2PFD_CLOEXEC +Like +.Dv F_DUP2FD , +but the +.Dv FD_CLOEXEC +flag associated with the new file descriptor is set. .Pp The .Dv F_DUP2FD -constant is not portable, so it should not be used if portability is needed. +and +.Dv F_DUP2DF_CLOEXEC +constants are not portable, so they should not be used if +portability is needed. Use .Fn dup2 -instead. +instead of +.Dv F_DUP2FD . .It Dv F_GETFD Get the close-on-exec flag associated with the file descriptor .Fa fd From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:56:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08232106566C; Wed, 29 Aug 2012 16:56:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC9478FC12; Wed, 29 Aug 2012 16:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGuolh081562; Wed, 29 Aug 2012 16:56:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGuoed081557; Wed, 29 Aug 2012 16:56:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208291656.q7TGuoed081557@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 Aug 2012 16:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239864 - in head/sys: kern sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:56:51 -0000 Author: marius Date: Wed Aug 29 16:56:50 2012 New Revision: 239864 URL: http://svn.freebsd.org/changeset/base/239864 Log: - Unlike cache invalidation and TLB demapping IPIs, reading registers from other CPUs doesn't require locking so get rid of it. As the latter is used for the timecounter on certain machine models, using a spin lock in this case can lead to a deadlock with the upcoming callout(9) rework. - Merge r134227/r167250 from x86: Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB demapping IPIs. - Mark some unused function arguments as such. MFC after: 1 week Modified: head/sys/kern/subr_witness.c head/sys/sparc64/include/smp.h head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/tick.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/kern/subr_witness.c Wed Aug 29 16:56:50 2012 (r239864) @@ -669,9 +669,6 @@ static struct witness_order_list_entry o */ { "intrcnt", &lock_class_mtx_spin }, { "icu", &lock_class_mtx_spin }, -#if defined(SMP) && defined(__sparc64__) - { "ipi", &lock_class_mtx_spin }, -#endif #ifdef __i386__ { "allpmaps", &lock_class_mtx_spin }, { "descriptor tables", &lock_class_mtx_spin }, Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/sparc64/include/smp.h Wed Aug 29 16:56:50 2012 (r239864) @@ -109,7 +109,6 @@ extern cpu_ipi_single_t *cpu_ipi_single; void mp_init(u_int cpu_impl); -extern struct mtx ipi_mtx; extern struct ipi_cache_args ipi_cache_args; extern struct ipi_rd_args ipi_rd_args; extern struct ipi_tlb_args ipi_tlb_args; @@ -169,7 +168,7 @@ ipi_dcache_page_inval(void *func, vm_pad return (NULL); sched_pin(); ica = &ipi_cache_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ica->ica_mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; @@ -186,7 +185,7 @@ ipi_icache_page_inval(void *func, vm_pad return (NULL); sched_pin(); ica = &ipi_cache_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ica->ica_mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; @@ -203,7 +202,6 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; - mtx_lock_spin(&ipi_mtx); CPU_SETOF(cpu, &ira->ira_mask); ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -227,7 +225,7 @@ ipi_tlb_context_demap(struct pmap *pm) return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, @@ -252,7 +250,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; @@ -277,7 +275,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; @@ -295,7 +293,19 @@ ipi_wait(void *cookie) if ((mask = cookie) != NULL) { while (!CPU_EMPTY(mask)) ; - mtx_unlock_spin(&ipi_mtx); + mtx_unlock_spin(&smp_ipi_mtx); + sched_unpin(); + } +} + +static __inline void +ipi_wait_unlocked(void *cookie) +{ + volatile cpuset_t *mask; + + if ((mask = cookie) != NULL) { + while (!CPU_EMPTY(mask)) + ; sched_unpin(); } } @@ -352,7 +362,13 @@ ipi_tlb_range_demap(struct pmap *pm __un } static __inline void -ipi_wait(void *cookie) +ipi_wait(void *cookie __unused) +{ + +} + +static __inline void +ipi_wait_unlocked(void *cookie __unused) { } Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/sparc64/sparc64/mp_machdep.c Wed Aug 29 16:56:50 2012 (r239864) @@ -113,8 +113,6 @@ struct ipi_rd_args ipi_rd_args; struct ipi_tlb_args ipi_tlb_args; struct pcb stoppcbs[MAXCPU]; -struct mtx ipi_mtx; - cpu_ipi_selected_t *cpu_ipi_selected; cpu_ipi_single_t *cpu_ipi_single; @@ -280,8 +278,6 @@ void cpu_mp_start(void) { - mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN); - intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL); intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action, -1, NULL, NULL); @@ -503,13 +499,13 @@ cpu_mp_shutdown(void) } static void -cpu_ipi_ast(struct trapframe *tf) +cpu_ipi_ast(struct trapframe *tf __unused) { } static void -cpu_ipi_stop(struct trapframe *tf) +cpu_ipi_stop(struct trapframe *tf __unused) { u_int cpuid; Modified: head/sys/sparc64/sparc64/tick.c ============================================================================== --- head/sys/sparc64/sparc64/tick.c Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/sparc64/sparc64/tick.c Wed Aug 29 16:56:50 2012 (r239864) @@ -332,7 +332,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -346,7 +346,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 16:58:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F12F1065674; Wed, 29 Aug 2012 16:58:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20BB48FC1E; Wed, 29 Aug 2012 16:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGwpeS081833; Wed, 29 Aug 2012 16:58:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGwpH1081831; Wed, 29 Aug 2012 16:58:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208291658.q7TGwpH1081831@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 16:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239865 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:58:52 -0000 Author: adrian Date: Wed Aug 29 16:58:51 2012 New Revision: 239865 URL: http://svn.freebsd.org/changeset/base/239865 Log: There's no nede to allocate a DMA map just before calling bus_dmamem_alloc(). In fact, bus_dmamem_alloc() happily NULLs the dmat pointer passed in, before replacing it with its own. This fixes a MIPS crash when kldload'ing if_ath/if_ath_pci - bus_dmamap_destroy() was passed in a NULL dmat pointer and was doing all kinds of very bad things. Reviewed by: scottl Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Aug 29 16:56:50 2012 (r239864) +++ head/sys/dev/ath/if_ath.c Wed Aug 29 16:58:51 2012 (r239865) @@ -2856,13 +2856,6 @@ ath_descdma_alloc_desc(struct ath_softc } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); @@ -2892,8 +2885,6 @@ ath_descdma_alloc_desc(struct ath_softc fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -2976,7 +2967,6 @@ ath_descdma_setup(struct ath_softc *sc, fail3: bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -3057,7 +3047,6 @@ ath_descdma_cleanup(struct ath_softc *sc if (dd->dd_dmamap != 0) { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 17:36:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A057D1065670; Wed, 29 Aug 2012 17:36:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AD1B8FC0A; Wed, 29 Aug 2012 17:36:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7THaCvN086412; Wed, 29 Aug 2012 17:36:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7THaCEm086409; Wed, 29 Aug 2012 17:36:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291736.q7THaCEm086409@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 17:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239866 - stable/9/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 17:36:12 -0000 Author: jhb Date: Wed Aug 29 17:36:12 2012 New Revision: 239866 URL: http://svn.freebsd.org/changeset/base/239866 Log: MFC 238077: Fix panics triggered by older mfiutil binaries run on the new mfi(4) driver. The new driver changed the size of the mfi_dcmd_frame structure in such a way that a MFI_IOC_PASSTHRU ioctl from an old amd64 binary is treated as an MFI_IOC_PASSTHRU32 ioctl in the new driver. As a result, the user pointer is treated as the buffer length. mfi_user_command() doesn't have a bounds check on the buffer length, so it passes a really big value to malloc() which panics when it tries to exhaust the kmem_map. Fix this two ways: - Only honor MFI_IOC_PASSTHRU32 if the binary has the SV_ILP32 flag set, otherwise treat it as an unknown ioctl. - Add a bounds check on the buffer length passed by the user. For now it fails any user attempts to use a buffer larger than 1MB. While here, fix a few other nits: - Remove an unnecessary check for a NULL return from malloc(M_WAITOK). - Use the ENOTTY errno for invalid ioctl commands instead of ENOENT. Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Wed Aug 29 16:58:51 2012 (r239865) +++ stable/9/sys/dev/mfi/mfi.c Wed Aug 29 17:36:12 2012 (r239866) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2832,10 +2833,9 @@ mfi_user_command(struct mfi_softc *sc, s if (ioc->buf_size > 0) { - ioc_buf = malloc(ioc->buf_size, M_MFIBUF, M_WAITOK); - if (ioc_buf == NULL) { + if (ioc->buf_size > 1024 * 1024) return (ENOMEM); - } + ioc_buf = malloc(ioc->buf_size, M_MFIBUF, M_WAITOK); error = copyin(ioc->buf, ioc_buf, ioc->buf_size); if (error) { device_printf(sc->mfi_dev, "failed to copyin\n"); @@ -3244,6 +3244,10 @@ out: } #ifdef COMPAT_FREEBSD32 case MFIIO_PASSTHRU32: + if (!SV_CURPROC_FLAG(SV_ILP32)) { + error = ENOTTY; + break; + } iop_swab.ioc_frame = iop32->ioc_frame; iop_swab.buf_size = iop32->buf_size; iop_swab.buf = PTRIN(iop32->buf); @@ -3259,7 +3263,7 @@ out: break; default: device_printf(sc->mfi_dev, "IOCTL 0x%lx not handled\n", cmd); - error = ENOENT; + error = ENOTTY; break; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 17:36:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBFFE106564A; Wed, 29 Aug 2012 17:36:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACB3D8FC20; Wed, 29 Aug 2012 17:36:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7THaVNM086481; Wed, 29 Aug 2012 17:36:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7THaV45086479; Wed, 29 Aug 2012 17:36:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291736.q7THaV45086479@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 17:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239867 - stable/8/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 17:36:32 -0000 Author: jhb Date: Wed Aug 29 17:36:31 2012 New Revision: 239867 URL: http://svn.freebsd.org/changeset/base/239867 Log: MFC 238077: Fix panics triggered by older mfiutil binaries run on the new mfi(4) driver. The new driver changed the size of the mfi_dcmd_frame structure in such a way that a MFI_IOC_PASSTHRU ioctl from an old amd64 binary is treated as an MFI_IOC_PASSTHRU32 ioctl in the new driver. As a result, the user pointer is treated as the buffer length. mfi_user_command() doesn't have a bounds check on the buffer length, so it passes a really big value to malloc() which panics when it tries to exhaust the kmem_map. Fix this two ways: - Only honor MFI_IOC_PASSTHRU32 if the binary has the SV_ILP32 flag set, otherwise treat it as an unknown ioctl. - Add a bounds check on the buffer length passed by the user. For now it fails any user attempts to use a buffer larger than 1MB. While here, fix a few other nits: - Remove an unnecessary check for a NULL return from malloc(M_WAITOK). - Use the ENOTTY errno for invalid ioctl commands instead of ENOENT. Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Aug 29 17:36:12 2012 (r239866) +++ stable/8/sys/dev/mfi/mfi.c Wed Aug 29 17:36:31 2012 (r239867) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2832,10 +2833,9 @@ mfi_user_command(struct mfi_softc *sc, s if (ioc->buf_size > 0) { - ioc_buf = malloc(ioc->buf_size, M_MFIBUF, M_WAITOK); - if (ioc_buf == NULL) { + if (ioc->buf_size > 1024 * 1024) return (ENOMEM); - } + ioc_buf = malloc(ioc->buf_size, M_MFIBUF, M_WAITOK); error = copyin(ioc->buf, ioc_buf, ioc->buf_size); if (error) { device_printf(sc->mfi_dev, "failed to copyin\n"); @@ -3244,6 +3244,10 @@ out: } #ifdef COMPAT_FREEBSD32 case MFIIO_PASSTHRU32: + if (!SV_CURPROC_FLAG(SV_ILP32)) { + error = ENOTTY; + break; + } iop_swab.ioc_frame = iop32->ioc_frame; iop_swab.buf_size = iop32->buf_size; iop_swab.buf = PTRIN(iop32->buf); @@ -3259,7 +3263,7 @@ out: break; default: device_printf(sc->mfi_dev, "IOCTL 0x%lx not handled\n", cmd); - error = ENOENT; + error = ENOTTY; break; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 18:14:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8DAB106564A; Wed, 29 Aug 2012 18:14:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9326A8FC08; Wed, 29 Aug 2012 18:14:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TIELwp090923; Wed, 29 Aug 2012 18:14:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIELXN090920; Wed, 29 Aug 2012 18:14:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291814.q7TIELXN090920@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239868 - in head/sys: conf modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:14:21 -0000 Author: dim Date: Wed Aug 29 18:14:20 2012 New Revision: 239868 URL: http://svn.freebsd.org/changeset/base/239868 Log: Remove workaround for the clang 3.2 warning in ah_eeprom_9287.c, since the fix has been applied now. Modified: head/sys/conf/files head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 29 17:36:31 2012 (r239867) +++ head/sys/conf/files Wed Aug 29 18:14:20 2012 (r239868) @@ -767,7 +767,7 @@ dev/ath/ath_hal/ah_eeprom_v4k.c \ # XXX Work around clang warning, until maintainer approves fix. dev/ath/ath_hal/ah_eeprom_9287.c \ optional ath_hal | ath_ar9287 \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} -I$S/dev/ath" + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -I$S/dev/ath" # ar5210 Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Wed Aug 29 17:36:31 2012 (r239867) +++ head/sys/modules/ath/Makefile Wed Aug 29 18:14:20 2012 (r239868) @@ -150,6 +150,5 @@ opt_ah.h: CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} # XXX Work around clang warnings, until maintainer approves fix. -CWARNFLAGS.ah_eeprom_9287.c= ${NO_WSOMETIMES_UNINITIALIZED} CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UNINITIALIZED} CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 18:22:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4A42106564A; Wed, 29 Aug 2012 18:22:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C009A8FC08; Wed, 29 Aug 2012 18:22:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TIMqTQ091958; Wed, 29 Aug 2012 18:22:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIMqw1091955; Wed, 29 Aug 2012 18:22:52 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291822.q7TIMqw1091955@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239869 - head/sys/i386/bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:22:53 -0000 Author: dim Date: Wed Aug 29 18:22:52 2012 New Revision: 239869 URL: http://svn.freebsd.org/changeset/base/239869 Log: Remove the argument-less .align directive in sys/i386/bios/smapi_bios.S. Specifying no argument is undocumented in the gas manual, and clang's integrated assembler refuses to parse it. Also, removing it causes no change at all in the resulting object file. MFC after: 1 week Modified: head/sys/i386/bios/smapi_bios.S Modified: head/sys/i386/bios/smapi_bios.S ============================================================================== --- head/sys/i386/bios/smapi_bios.S Wed Aug 29 18:14:20 2012 (r239868) +++ head/sys/i386/bios/smapi_bios.S Wed Aug 29 18:22:52 2012 (r239869) @@ -6,7 +6,6 @@ __FBSDID("$FreeBSD$"); * Thomas Hood. */ - .align smapi32_entry: /* far pointer to SMAPI entry */ .globl smapi32_offset smapi32_offset: .long 0x00000000 /* set by caller */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 18:37:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFF71065670; Wed, 29 Aug 2012 18:37:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78DB98FC18; Wed, 29 Aug 2012 18:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TIbBdh094459; Wed, 29 Aug 2012 18:37:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIbB6W094456; Wed, 29 Aug 2012 18:37:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291837.q7TIbB6W094456@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239870 - in head/contrib: binutils/include/elf gdb/gdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:37:11 -0000 Author: dim Date: Wed Aug 29 18:37:10 2012 New Revision: 239870 URL: http://svn.freebsd.org/changeset/base/239870 Log: Teach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't error out on files that contain it. (This attribute can be emitted by newer versions of clang.) MFC after: 2 weeks Modified: head/contrib/binutils/include/elf/dwarf2.h head/contrib/gdb/gdb/dwarf2read.c Modified: head/contrib/binutils/include/elf/dwarf2.h ============================================================================== --- head/contrib/binutils/include/elf/dwarf2.h Wed Aug 29 18:22:52 2012 (r239869) +++ head/contrib/binutils/include/elf/dwarf2.h Wed Aug 29 18:37:10 2012 (r239870) @@ -238,7 +238,8 @@ enum dwarf_form DW_FORM_ref4 = 0x13, DW_FORM_ref8 = 0x14, DW_FORM_ref_udata = 0x15, - DW_FORM_indirect = 0x16 + DW_FORM_indirect = 0x16, + DW_FORM_flag_present = 0x19 }; /* Attribute names and codes. */ Modified: head/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- head/contrib/gdb/gdb/dwarf2read.c Wed Aug 29 18:22:52 2012 (r239869) +++ head/contrib/gdb/gdb/dwarf2read.c Wed Aug 29 18:37:10 2012 (r239870) @@ -4604,6 +4604,9 @@ read_attribute_value (struct attribute * DW_UNSND (attr) = read_1_byte (abfd, info_ptr); info_ptr += 1; break; + case DW_FORM_flag_present: + DW_UNSND (attr) = 1; + break; case DW_FORM_sdata: DW_SND (attr) = read_signed_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; @@ -7226,6 +7229,9 @@ dump_die (struct die_info *die) else fprintf_unfiltered (gdb_stderr, "flag: FALSE"); break; + case DW_FORM_flag_present: + fprintf_unfiltered (gdb_stderr, "flag: TRUE"); + break; case DW_FORM_indirect: /* the reader will have reduced the indirect form to the "base form" so this form should not occur */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 18:40:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 066FD106566C; Wed, 29 Aug 2012 18:40:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5898FC0A; Wed, 29 Aug 2012 18:40:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TIeC4V094869; Wed, 29 Aug 2012 18:40:12 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIeCwh094866; Wed, 29 Aug 2012 18:40:12 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208291840.q7TIeCwh094866@svn.freebsd.org> From: Jamie Gritton Date: Wed, 29 Aug 2012 18:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239871 - releng/9.1/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:40:13 -0000 Author: jamie Date: Wed Aug 29 18:40:12 2012 New Revision: 239871 URL: http://svn.freebsd.org/changeset/base/239871 Log: MFS r239854 (including MFC r239601, r239602, r239621): Remember that I'm using length-defined strings in parameters: Don't include the null terminator when recomputing the parameter length when stripping the netmask from IP addresses. This was causing later addresses in a comma-separated string to disappear. Use memcpy instead of strcpy. This could just cause Bad Things. Add a null byte when comma-combining array parameters. Pre-separate IP addresses passed on the command line, so they can be properly parsed for interface prefixes and netmask suffixes. This was already done for the old-style (fixed) command line, but missed for the new-style. PR: 170832 Approved by: re (kib) Modified: releng/9.1/usr.sbin/jail/config.c releng/9.1/usr.sbin/jail/jail.c Directory Properties: releng/9.1/usr.sbin/jail/ (props changed) Modified: releng/9.1/usr.sbin/jail/config.c ============================================================================== --- releng/9.1/usr.sbin/jail/config.c Wed Aug 29 18:37:10 2012 (r239870) +++ releng/9.1/usr.sbin/jail/config.c Wed Aug 29 18:40:12 2012 (r239871) @@ -596,7 +596,7 @@ check_intparams(struct cfjail *j) error = -1; } *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -620,7 +620,7 @@ check_intparams(struct cfjail *j) error = -1; } *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -712,12 +712,11 @@ import_params(struct cfjail *j) value = alloca(vallen); cs = value; TAILQ_FOREACH_SAFE(s, &p->val, tq, ts) { - strcpy(cs, s->s); - if (ts != NULL) { - cs += s->len + 1; - cs[-1] = ','; - } + memcpy(cs, s->s, s->len); + cs += s->len + 1; + cs[-1] = ','; } + value[vallen - 1] = '\0'; } if (jailparam_import(jp, value) < 0) { error = -1; Modified: releng/9.1/usr.sbin/jail/jail.c ============================================================================== --- releng/9.1/usr.sbin/jail/jail.c Wed Aug 29 18:37:10 2012 (r239870) +++ releng/9.1/usr.sbin/jail/jail.c Wed Aug 29 18:40:12 2012 (r239871) @@ -304,9 +304,33 @@ main(int argc, char **argv) for (i++; i < argc; i++) add_param(NULL, NULL, IP_COMMAND, argv[i]); - break; } - add_param(NULL, NULL, 0, argv[i]); +#ifdef INET + else if (!strncmp(argv[i], "ip4.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP4_ADDR, cs); + if (!ncs) + break; + } + } +#endif +#ifdef INET6 + else if (!strncmp(argv[i], "ip6.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP6_ADDR, cs); + if (!ncs) + break; + } + } +#endif + else + add_param(NULL, NULL, 0, argv[i]); } } else { /* From the config file, perhaps with a specified jail */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 18:49:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB3B9106566C; Wed, 29 Aug 2012 18:49:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CEE78FC16; Wed, 29 Aug 2012 18:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TIngE5096128; Wed, 29 Aug 2012 18:49:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIng9H096123; Wed, 29 Aug 2012 18:49:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291849.q7TIng9H096123@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239872 - head/lib/libdwarf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:49:42 -0000 Author: dim Date: Wed Aug 29 18:49:41 2012 New Revision: 239872 URL: http://svn.freebsd.org/changeset/base/239872 Log: Teach libdwarf about the DW_FORM_flag_present dwarf attribute, so programs using libdwarf (such as ctfconvert) don't error out on files containing the attribute. MFC after: 2 weeks Modified: head/lib/libdwarf/dwarf.h head/lib/libdwarf/dwarf_attrval.c head/lib/libdwarf/dwarf_dump.c head/lib/libdwarf/dwarf_init.c Modified: head/lib/libdwarf/dwarf.h ============================================================================== --- head/lib/libdwarf/dwarf.h Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf.h Wed Aug 29 18:49:41 2012 (r239872) @@ -184,6 +184,7 @@ #define DW_FORM_ref8 0x14 #define DW_FORM_ref_udata 0x15 #define DW_FORM_indirect 0x16 +#define DW_FORM_flag_present 0x19 #define DW_OP_addr 0x03 #define DW_OP_deref 0x06 Modified: head/lib/libdwarf/dwarf_attrval.c ============================================================================== --- head/lib/libdwarf/dwarf_attrval.c Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf_attrval.c Wed Aug 29 18:49:41 2012 (r239872) @@ -101,6 +101,7 @@ dwarf_attrval_flag(Dwarf_Die die, uint64 } else { switch (av->av_form) { case DW_FORM_flag: + case DW_FORM_flag_present: *valp = (Dwarf_Bool) av->u[0].u64; break; default: Modified: head/lib/libdwarf/dwarf_dump.c ============================================================================== --- head/lib/libdwarf/dwarf_dump.c Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf_dump.c Wed Aug 29 18:49:41 2012 (r239872) @@ -240,6 +240,8 @@ get_form_desc(uint32_t form) return "DW_FORM_data8"; case DW_FORM_flag: return "DW_FORM_flag"; + case DW_FORM_flag_present: + return "DW_FORM_flag_present"; case DW_FORM_indirect: return "DW_FORM_indirect"; case DW_FORM_ref1: @@ -648,6 +650,7 @@ dwarf_dump_av(Dwarf_Die die, Dwarf_AttrV case DW_FORM_data4: case DW_FORM_data8: case DW_FORM_flag: + case DW_FORM_flag_present: printf("%llu", (unsigned long long) av->u[0].u64); break; case DW_FORM_ref1: Modified: head/lib/libdwarf/dwarf_init.c ============================================================================== --- head/lib/libdwarf/dwarf_init.c Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf_init.c Wed Aug 29 18:49:41 2012 (r239872) @@ -396,6 +396,10 @@ dwarf_init_attr(Dwarf_Debug dbg, Elf_Dat avref.u[1].s = elf_strptr(dbg->dbg_elf, dbg->dbg_s[DWARF_debug_str].s_shnum, avref.u[0].u64); break; + case DW_FORM_flag_present: + /* This form has no value encoded in the DIE. */ + avref.u[0].u64 = 1; + break; default: DWARF_SET_ERROR(error, DWARF_E_NOT_IMPLEMENTED); ret = DWARF_E_NOT_IMPLEMENTED; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 18:58:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB96106564A; Wed, 29 Aug 2012 18:58:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08CB88FC08; Wed, 29 Aug 2012 18:58:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TIw3hN097180; Wed, 29 Aug 2012 18:58:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIw336097178; Wed, 29 Aug 2012 18:58:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291858.q7TIw336097178@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239873 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:58:04 -0000 Author: dim Date: Wed Aug 29 18:58:03 2012 New Revision: 239873 URL: http://svn.freebsd.org/changeset/base/239873 Log: After r239868, also remove the comment about the workaround for ah_eeprom_9287.c. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 29 18:49:41 2012 (r239872) +++ head/sys/conf/files Wed Aug 29 18:58:03 2012 (r239873) @@ -764,7 +764,6 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ dev/ath/ath_hal/ah_eeprom_v4k.c \ optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath" -# XXX Work around clang warning, until maintainer approves fix. dev/ath/ath_hal/ah_eeprom_9287.c \ optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath" From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 19:12:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AD00106566C; Wed, 29 Aug 2012 19:12:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 445938FC0C; Wed, 29 Aug 2012 19:12:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TJCY2R099051; Wed, 29 Aug 2012 19:12:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TJCYEU099047; Wed, 29 Aug 2012 19:12:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291912.q7TJCYEU099047@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 19:12:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239874 - in stable/9/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 19:12:34 -0000 Author: jhb Date: Wed Aug 29 19:12:33 2012 New Revision: 239874 URL: http://svn.freebsd.org/changeset/base/239874 Log: MFC 238000,239584: Honor db_pager_quit in 'show malloc', 'show uma', and 'show witness'. Modified: stable/9/sys/kern/kern_malloc.c stable/9/sys/kern/subr_witness.c stable/9/sys/vm/uma_core.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/kern/kern_malloc.c ============================================================================== --- stable/9/sys/kern/kern_malloc.c Wed Aug 29 18:58:03 2012 (r239873) +++ stable/9/sys/kern/kern_malloc.c Wed Aug 29 19:12:33 2012 (r239874) @@ -963,6 +963,8 @@ DB_SHOW_COMMAND(malloc, db_show_malloc) db_printf("%18s %12ju %12juK %12ju\n", mtp->ks_shortdesc, allocs - frees, (alloced - freed + 1023) / 1024, allocs); + if (db_pager_quit) + break; } } @@ -992,6 +994,8 @@ DB_SHOW_COMMAND(multizone_matches, db_sh if (mtip->mti_zone != subzone) continue; db_printf("%s\n", mtp->ks_shortdesc); + if (db_pager_quit) + break; } } #endif /* MALLOC_DEBUG_MAXZONES > 1 */ Modified: stable/9/sys/kern/subr_witness.c ============================================================================== --- stable/9/sys/kern/subr_witness.c Wed Aug 29 18:58:03 2012 (r239873) +++ stable/9/sys/kern/subr_witness.c Wed Aug 29 19:12:33 2012 (r239874) @@ -943,6 +943,8 @@ witness_ddb_display_descendants(int(*prn indent++; WITNESS_INDEX_ASSERT(w->w_index); for (i = 1; i <= w_max_used_index; i++) { + if (db_pager_quit) + return; if (w_rmatrix[w->w_index][i] & WITNESS_PARENT) witness_ddb_display_descendants(prnt, &w_data[i], indent); @@ -961,6 +963,8 @@ witness_ddb_display_list(int(*prnt)(cons /* This lock has no anscestors - display its descendants. */ witness_ddb_display_descendants(prnt, w, 0); + if (db_pager_quit) + return; } } @@ -982,12 +986,16 @@ witness_ddb_display(int(*prnt)(const cha */ prnt("Sleep locks:\n"); witness_ddb_display_list(prnt, &w_sleep); + if (db_pager_quit) + return; /* * Now do spin locks which have been acquired at least once. */ prnt("\nSpin locks:\n"); witness_ddb_display_list(prnt, &w_spin); + if (db_pager_quit) + return; /* * Finally, any locks which have not been acquired yet. @@ -998,6 +1006,8 @@ witness_ddb_display(int(*prnt)(const cha continue; prnt("%s (type: %s, depth: %d)\n", w->w_name, w->w_class->lc_name, w->w_ddb_level); + if (db_pager_quit) + return; } } #endif /* DDB */ @@ -2393,6 +2403,8 @@ DB_SHOW_ALL_COMMAND(locks, db_witness_li db_printf("Process %d (%s) thread %p (%d)\n", p->p_pid, p->p_comm, td, td->td_tid); witness_ddb_list(td); + if (db_pager_quit) + return; } } } Modified: stable/9/sys/vm/uma_core.c ============================================================================== --- stable/9/sys/vm/uma_core.c Wed Aug 29 18:58:03 2012 (r239873) +++ stable/9/sys/vm/uma_core.c Wed Aug 29 19:12:33 2012 (r239874) @@ -3345,6 +3345,8 @@ DB_SHOW_COMMAND(uma, db_show_uma) (uintmax_t)kz->uk_size, (intmax_t)(allocs - frees), cachefree, (uintmax_t)allocs, sleeps); + if (db_pager_quit) + return; } } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 19:12:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98BAE106566B; Wed, 29 Aug 2012 19:12:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F2D8FC08; Wed, 29 Aug 2012 19:12:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TJCspK099126; Wed, 29 Aug 2012 19:12:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TJCspT099121; Wed, 29 Aug 2012 19:12:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291912.q7TJCspT099121@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 19:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239875 - in stable/8/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 19:12:54 -0000 Author: jhb Date: Wed Aug 29 19:12:53 2012 New Revision: 239875 URL: http://svn.freebsd.org/changeset/base/239875 Log: MFC 238000,239584: Honor db_pager_quit in 'show malloc', 'show uma', and 'show witness'. Modified: stable/8/sys/kern/kern_malloc.c stable/8/sys/kern/subr_witness.c stable/8/sys/vm/uma_core.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Wed Aug 29 19:12:33 2012 (r239874) +++ stable/8/sys/kern/kern_malloc.c Wed Aug 29 19:12:53 2012 (r239875) @@ -924,6 +924,8 @@ DB_SHOW_COMMAND(malloc, db_show_malloc) db_printf("%18s %12ju %12juK %12ju\n", mtp->ks_shortdesc, allocs - frees, (alloced - freed + 1023) / 1024, allocs); + if (db_pager_quit) + break; } } #endif Modified: stable/8/sys/kern/subr_witness.c ============================================================================== --- stable/8/sys/kern/subr_witness.c Wed Aug 29 19:12:33 2012 (r239874) +++ stable/8/sys/kern/subr_witness.c Wed Aug 29 19:12:53 2012 (r239875) @@ -929,6 +929,8 @@ witness_ddb_display_descendants(int(*prn indent++; WITNESS_INDEX_ASSERT(w->w_index); for (i = 1; i <= w_max_used_index; i++) { + if (db_pager_quit) + return; if (w_rmatrix[w->w_index][i] & WITNESS_PARENT) witness_ddb_display_descendants(prnt, &w_data[i], indent); @@ -947,6 +949,8 @@ witness_ddb_display_list(int(*prnt)(cons /* This lock has no anscestors - display its descendants. */ witness_ddb_display_descendants(prnt, w, 0); + if (db_pager_quit) + return; } } @@ -968,12 +972,16 @@ witness_ddb_display(int(*prnt)(const cha */ prnt("Sleep locks:\n"); witness_ddb_display_list(prnt, &w_sleep); + if (db_pager_quit) + return; /* * Now do spin locks which have been acquired at least once. */ prnt("\nSpin locks:\n"); witness_ddb_display_list(prnt, &w_spin); + if (db_pager_quit) + return; /* * Finally, any locks which have not been acquired yet. @@ -984,6 +992,8 @@ witness_ddb_display(int(*prnt)(const cha continue; prnt("%s (type: %s, depth: %d)\n", w->w_name, w->w_class->lc_name, w->w_ddb_level); + if (db_pager_quit) + return; } } #endif /* DDB */ @@ -2370,6 +2380,8 @@ DB_SHOW_ALL_COMMAND(locks, db_witness_li db_printf("Process %d (%s) thread %p (%d)\n", p->p_pid, p->p_comm, td, td->td_tid); witness_ddb_list(td); + if (db_pager_quit) + return; } } } Modified: stable/8/sys/vm/uma_core.c ============================================================================== --- stable/8/sys/vm/uma_core.c Wed Aug 29 19:12:33 2012 (r239874) +++ stable/8/sys/vm/uma_core.c Wed Aug 29 19:12:53 2012 (r239875) @@ -3367,6 +3367,8 @@ DB_SHOW_COMMAND(uma, db_show_uma) (uintmax_t)kz->uk_size, (intmax_t)(allocs - frees), cachefree, (uintmax_t)allocs); + if (db_pager_quit) + return; } } } From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 19:17:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18290106564A; Wed, 29 Aug 2012 19:17:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0277A8FC16; Wed, 29 Aug 2012 19:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TJHTbi099699; Wed, 29 Aug 2012 19:17:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TJHTZR099697; Wed, 29 Aug 2012 19:17:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291917.q7TJHTZR099697@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 19:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239876 - stable/9/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 19:17:30 -0000 Author: jhb Date: Wed Aug 29 19:17:29 2012 New Revision: 239876 URL: http://svn.freebsd.org/changeset/base/239876 Log: MFC 238024: Add a one second sleep before touching the spool directory. If the touch occurs in the same second as the earlier operations to create the temporary file and the cron(8) daemon is rescans the spool directory during that second, then the daemon may miss a cron edit and not properly update its internal database. Modified: stable/9/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/9/usr.sbin/cron/crontab/ (props changed) Modified: stable/9/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/9/usr.sbin/cron/crontab/crontab.c Wed Aug 29 19:12:53 2012 (r239875) +++ stable/9/usr.sbin/cron/crontab/crontab.c Wed Aug 29 19:17:29 2012 (r239876) @@ -608,6 +608,15 @@ replace_cmd() { log_it(RealUser, Pid, "REPLACE", User); + /* + * Creating the 'tn' temp file has already updated the + * modification time of the spool directory. Sleep for a + * second to ensure that poke_daemon() sets a later + * modification time. Otherwise, this can race with the cron + * daemon scanning for updated crontabs. + */ + sleep(1); + poke_daemon(); return (0); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 19:17:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1C5A1065783; Wed, 29 Aug 2012 19:17:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63B5D8FC1A; Wed, 29 Aug 2012 19:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TJHaab099747; Wed, 29 Aug 2012 19:17:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TJHaMn099745; Wed, 29 Aug 2012 19:17:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291917.q7TJHaMn099745@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 19:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239877 - stable/8/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 19:17:38 -0000 Author: jhb Date: Wed Aug 29 19:17:35 2012 New Revision: 239877 URL: http://svn.freebsd.org/changeset/base/239877 Log: MFC 238024: Add a one second sleep before touching the spool directory. If the touch occurs in the same second as the earlier operations to create the temporary file and the cron(8) daemon is rescans the spool directory during that second, then the daemon may miss a cron edit and not properly update its internal database. Modified: stable/8/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/8/usr.sbin/cron/crontab/ (props changed) Modified: stable/8/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/8/usr.sbin/cron/crontab/crontab.c Wed Aug 29 19:17:29 2012 (r239876) +++ stable/8/usr.sbin/cron/crontab/crontab.c Wed Aug 29 19:17:35 2012 (r239877) @@ -608,6 +608,15 @@ replace_cmd() { log_it(RealUser, Pid, "REPLACE", User); + /* + * Creating the 'tn' temp file has already updated the + * modification time of the spool directory. Sleep for a + * second to ensure that poke_daemon() sets a later + * modification time. Otherwise, this can race with the cron + * daemon scanning for updated crontabs. + */ + sleep(1); + poke_daemon(); return (0); From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 19:34:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 460CA1065670; Wed, 29 Aug 2012 19:34:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3CB8FC1A; Wed, 29 Aug 2012 19:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TJYkcJ002041; Wed, 29 Aug 2012 19:34:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TJYkff002035; Wed, 29 Aug 2012 19:34:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291934.q7TJYkff002035@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 19:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239878 - in stable/9/contrib/binutils: gas/config opcodes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 19:34:47 -0000 Author: jhb Date: Wed Aug 29 19:34:46 2012 New Revision: 239878 URL: http://svn.freebsd.org/changeset/base/239878 Log: MFC 238123,238167: - Add support for the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', and 'xsetbv' instructions. I reimplemented this from scratch based on the Intel manuals and the existing support for handling the fxsave and fxrstor instructions. - Add support for the 'invept' and 'invvpid' instructions. Beyond simply adding appropriate table entries, the assembler had to be adjusted as these are the first non-SSE instructions to use a 3-byte opcode (and a mandatory prefix to boot). Modified: stable/9/contrib/binutils/gas/config/tc-i386.c stable/9/contrib/binutils/opcodes/i386-dis.c stable/9/contrib/binutils/opcodes/i386-opc.h stable/9/contrib/binutils/opcodes/i386-opc.tbl stable/9/contrib/binutils/opcodes/i386-tbl.h Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/gas/config/tc-i386.c ============================================================================== --- stable/9/contrib/binutils/gas/config/tc-i386.c Wed Aug 29 19:17:35 2012 (r239877) +++ stable/9/contrib/binutils/gas/config/tc-i386.c Wed Aug 29 19:34:46 2012 (r239878) @@ -517,7 +517,9 @@ static const arch_entry cpu_arch[] = {".sse4a", PROCESSOR_UNKNOWN, CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a}, {".abm", PROCESSOR_UNKNOWN, - CpuABM} + CpuABM}, + {".xsave", PROCESSOR_UNKNOWN, + CpuXSAVE} }; const pseudo_typeS md_pseudo_table[] = @@ -3988,6 +3990,16 @@ output_insn (void) goto check_prefix; } } + else if (i.tm.base_opcode == 0x660f3880 || i.tm.base_opcode == 0x660f3881) + { + /* invept and invvpid are 3 byte instructions with a + mandatory prefix. */ + if (i.tm.base_opcode & 0xff000000) + { + prefix = (i.tm.base_opcode >> 24) & 0xff; + add_prefix (prefix); + } + } else if ((i.tm.base_opcode & 0xff0000) != 0) { prefix = (i.tm.base_opcode >> 16) & 0xff; @@ -4027,6 +4039,12 @@ output_insn (void) p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; } + else if (i.tm.base_opcode == 0x660f3880 || + i.tm.base_opcode == 0x660f3881) + { + p = frag_more (3); + *p++ = (i.tm.base_opcode >> 16) & 0xff; + } else p = frag_more (2); Modified: stable/9/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-dis.c Wed Aug 29 19:17:35 2012 (r239877) +++ stable/9/contrib/binutils/opcodes/i386-dis.c Wed Aug 29 19:34:46 2012 (r239878) @@ -93,6 +93,7 @@ static void OP_3DNowSuffix (int, int); static void OP_SIMD_Suffix (int, int); static void SIMD_Fixup (int, int); static void PNI_Fixup (int, int); +static void XCR_Fixup (int, int); static void SVME_Fixup (int, int); static void INVLPG_Fixup (int, int); static void BadOp (void); @@ -212,6 +213,7 @@ fetch_data (struct disassemble_info *inf #define Ew { OP_E, w_mode } #define M { OP_M, 0 } /* lea, lgdt, etc. */ #define Ma { OP_M, v_mode } +#define Mo { OP_M, o_mode } #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */ #define Mq { OP_M, q_mode } #define Gb { OP_G, b_mode } @@ -539,6 +541,8 @@ fetch_data (struct disassemble_info *inf #define PREGRP95 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 95 } } #define PREGRP96 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 96 } } #define PREGRP97 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 97 } } +#define PREGRP98 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 98 } } +#define PREGRP99 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 99 } } #define X86_64_0 NULL, { { NULL, X86_64_SPECIAL }, { NULL, 0 } } @@ -1693,7 +1697,7 @@ static const struct dis386 grps[][8] = { { { "sgdt{Q|IQ||}", { { VMX_Fixup, 0 } } }, { "sidt{Q|IQ||}", { { PNI_Fixup, 0 } } }, - { "lgdt{Q|Q||}", { M } }, + { "lgdt{Q|Q||}", { { XCR_Fixup, 0 } } }, { "lidt{Q|Q||}", { { SVME_Fixup, 0 } } }, { "smswD", { Sv } }, { "(bad)", { XX } }, @@ -1783,9 +1787,9 @@ static const struct dis386 grps[][8] = { { "fxrstor", { Ev } }, { "ldmxcsr", { Ev } }, { "stmxcsr", { Ev } }, - { "(bad)", { XX } }, - { "lfence", { { OP_0fae, 0 } } }, - { "mfence", { { OP_0fae, 0 } } }, + { "xsave", { Ev } }, + { "xrstor", { { OP_0fae, v_mode } } }, + { "xsaveopt", { { OP_0fae, v_mode } } }, { "clflush", { { OP_0fae, 0 } } }, }, /* GRP16 */ @@ -2585,6 +2589,22 @@ static const struct dis386 prefix_user_t { "punpckldq",{ MX, EMq } }, { "(bad)", { XX } }, }, + + /* PREGRP98 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "invept", { Gm, Mo } }, + { "(bad)", { XX } }, + }, + + /* PREGRP99 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "invvpid",{ Gm, Mo } }, + { "(bad)", { XX } }, + }, }; static const struct dis386 x86_64_table[][2] = { @@ -2754,8 +2774,8 @@ static const struct dis386 three_byte_ta { "(bad)", { XX } }, { "(bad)", { XX } }, /* 80 */ - { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP98 }, + { PREGRP99 }, { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -5883,7 +5903,7 @@ static void OP_M (int bytemode, int sizeflag) { if (modrm.mod == 3) - /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */ + /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst,invept,invvpid modrm */ BadOp (); else OP_E (bytemode, sizeflag); @@ -5905,17 +5925,17 @@ OP_0fae (int bytemode, int sizeflag) { if (modrm.reg == 7) strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); + else if (modrm.reg == 6) + strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence"); + else if (modrm.reg == 5) + strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence"); if (modrm.reg < 5 || modrm.rm != 0) { BadOp (); /* bad sfence, mfence, or lfence */ return; } - } - else if (modrm.reg != 7) - { - BadOp (); /* bad clflush */ - return; + bytemode = 0; } OP_E (bytemode, sizeflag); @@ -6170,6 +6190,43 @@ PNI_Fixup (int extrachar ATTRIBUTE_UNUSE } static void +XCR_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag) +{ + if (modrm.mod == 3 && modrm.reg == 2 && modrm.rm <= 1) + { + /* Override "lgdt". */ + size_t olen = strlen (obuf); + char *p = obuf + olen - 4; + + /* We might have a suffix when disassembling with -Msuffix. */ + if (*p == 'i') + --p; + + /* Remove "addr16/addr32" if we aren't in Intel mode. */ + if (!intel_syntax + && (prefixes & PREFIX_ADDR) + && olen >= (4 + 7) + && *(p - 1) == ' ' + && CONST_STRNEQ (p - 7, "addr") + && (CONST_STRNEQ (p - 3, "16") + || CONST_STRNEQ (p - 3, "32"))) + p -= 7; + + if (modrm.rm) + { + strcpy (p, "xsetbv"); + } + else + { + strcpy (p, "xgetbv"); + } + + codep++; + } + else + OP_M (0, sizeflag); +} +static void SVME_Fixup (int bytemode, int sizeflag) { const char *alt; Modified: stable/9/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-opc.h Wed Aug 29 19:17:35 2012 (r239877) +++ stable/9/contrib/binutils/opcodes/i386-opc.h Wed Aug 29 19:34:46 2012 (r239878) @@ -71,6 +71,7 @@ typedef struct template #define CpuABM 0x200000 /* ABM New Instructions required */ #define CpuSSE4_1 0x400000 /* SSE4.1 Instructions required */ #define CpuSSE4_2 0x800000 /* SSE4.2 Instructions required */ +#define CpuXSAVE 0x1000000 /* XSAVE Instructions required */ /* SSE4.1/4.2 Instructions required */ #define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) @@ -83,7 +84,7 @@ typedef struct template #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ |Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \ - |CpuSSE4_2|CpuABM|CpuSSE4a) + |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of Modified: stable/9/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-opc.tbl Wed Aug 29 19:17:35 2012 (r239877) +++ stable/9/contrib/binutils/opcodes/i386-opc.tbl Wed Aug 29 19:34:46 2012 (r239878) @@ -1289,6 +1289,10 @@ mwait, 2, 0xf01, 0xc9, CpuSSE3|CpuNo64, mwait, 2, 0xf01, 0xc9, CpuSSE3|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt|NoRex64, { Reg64, Reg64 } // VMX instructions. +invept, 2, 0x660f3880, None, CpuVMX|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg32 } +invept, 2, 0x660f3880, None, CpuVMX|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } +invvpid, 2, 0x660f3881, None, CpuVMX|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg32 } +invvpid, 2, 0x660f3881, None, CpuVMX|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } vmcall, 0, 0xf01, 0xc1, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } vmclear, 1, 0x660fc7, 0x6, CpuVMX, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } vmlaunch, 0, 0xf01, 0xc2, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } @@ -1487,3 +1491,10 @@ xcryptcfb, 0, 0xf30fa7, 0xe0, Cpu686|Cpu xcryptofb, 0, 0xf30fa7, 0xe8, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 } // Alias for xstore-rng. xstore, 0, 0xfa7, 0xc0, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 } + +// XSAVE/XRSTOR related instructions +xgetbv, 0, 0xf01, 0xd0, CpuXSAVE, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } +xsetbv, 0, 0xf01, 0xd1, CpuXSAVE, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } +xsave, 1, 0xfae, 0x4, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } +xsaveopt, 1, 0xfae, 0x6, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } +xrstor, 1, 0xfae, 0x5, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } Modified: stable/9/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- stable/9/contrib/binutils/opcodes/i386-tbl.h Wed Aug 29 19:17:35 2012 (r239877) +++ stable/9/contrib/binutils/opcodes/i386-tbl.h Wed Aug 29 19:34:46 2012 (r239878) @@ -3625,6 +3625,22 @@ const template i386_optab[] = No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt|NoRex64, { Reg64, Reg64 } }, + { "invept", 2, 0x660f3880, None, CpuVMX|CpuNo64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg32 } }, + { "invept", 2, 0x660f3880, None, CpuVMX|Cpu64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg64 } }, + { "invvpid", 2, 0x660f3881, None, CpuVMX|CpuNo64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg32 } }, + { "invvpid", 2, 0x660f3881, None, CpuVMX|Cpu64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg64 } }, { "vmcall", 0, 0xf01, 0xc1, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } }, @@ -4288,6 +4304,21 @@ const template i386_optab[] = { "xstore", 0, 0xfa7, 0xc0, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 } }, + { "xgetbv", 0, 0xf01, 0xd0, CpuXSAVE, + No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, + { 0 } }, + { "xsetbv", 0, 0xf01, 0xd1, CpuXSAVE, + No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, + { 0 } }, + { "xsave", 1, 0xfae, 0x4, CpuXSAVE, + Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, + { "xsaveopt", 1, 0xfae, 0x6, CpuXSAVE, + Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, + { "xrstor", 1, 0xfae, 0x5, CpuXSAVE, + Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, { NULL, 0, 0, 0, 0, 0, { 0 } } }; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 19:47:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A41CD1065677; Wed, 29 Aug 2012 19:47:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D33B8FC25; Wed, 29 Aug 2012 19:47:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TJlJ9A003601; Wed, 29 Aug 2012 19:47:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TJlJuW003599; Wed, 29 Aug 2012 19:47:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208291947.q7TJlJuW003599@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 19:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239879 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 19:47:19 -0000 Author: jhb Date: Wed Aug 29 19:47:19 2012 New Revision: 239879 URL: http://svn.freebsd.org/changeset/base/239879 Log: MFC 238109,238166: Several fixes to the amd64 disassembler: - Decode the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', 'xsetbv', and 'rdtscp' instructions. - Add generic support for opcodes that are escape bytes used for multi-byte opcodes (such as the 0x0f prefix). Use this to replace the hard-coded 0x0f special case and add support for three-byte opcodes that use the 0x0f38 prefix. - Decode all Intel VMX instructions. invept and invvpid in particular are three-byte opcodes that use the 0x0f38 escape prefix. - Rework how the special 'SDEP' size flag works such that the default instruction name (i_name) is the instruction when the data size prefix (0x66) is not specified, and the alternate name in i_extra is used when the prefix is included. - Add a new 'ADEP' size flag similar to 'SDEP' except that it chooses between i_name and i_extra based on the address size prefix (0x67). Use this to fix the decoding for jrcxz vs jecxz which is determined by the address size prefix, not the operand size prefix. Also, jcxz is not possible in 64-bit mode, but jrcxz is the default instruction for that opcode. - Add support for handling instructions that have a mandatory 'rep' prefix (this means not outputting the 'repe ' prefix until determining if it is used as part of an opcode). Make 'pause' less of a special case this way. - Decode 'cmpxchg16b' and 'cdqe' which are variants of other instructions but with a REX.W prefix. Modified: stable/9/sys/amd64/amd64/db_disasm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/amd64/db_disasm.c ============================================================================== --- stable/9/sys/amd64/amd64/db_disasm.c Wed Aug 29 19:34:46 2012 (r239878) +++ stable/9/sys/amd64/amd64/db_disasm.c Wed Aug 29 19:47:19 2012 (r239879) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); * Instruction disassembler. */ #include +#include #include #include @@ -47,7 +48,9 @@ __FBSDID("$FreeBSD$"); #define DBLR 5 #define EXTR 6 #define SDEP 7 -#define NONE 8 +#define ADEP 8 +#define ESC 9 +#define NONE 10 /* * REX prefix and bits @@ -67,6 +70,7 @@ __FBSDID("$FreeBSD$"); #define Eb 4 /* address, byte size */ #define R 5 /* register, in 'reg' field */ #define Rw 6 /* word register, in 'reg' field */ +#define Rq 39 /* quad register, in 'reg' field */ #define Ri 7 /* register in instruction */ #define S 8 /* segment reg, in 'reg' field */ #define Si 9 /* segment reg, in instruction */ @@ -120,6 +124,45 @@ struct finst { (or pointer to table) */ }; +static const struct inst db_inst_0f388x[] = { +/*80*/ { "", TRUE, SDEP, op2(E, Rq), "invept" }, +/*81*/ { "", TRUE, SDEP, op2(E, Rq), "invvpid" }, +/*82*/ { "", FALSE, NONE, 0, 0 }, +/*83*/ { "", FALSE, NONE, 0, 0 }, +/*84*/ { "", FALSE, NONE, 0, 0 }, +/*85*/ { "", FALSE, NONE, 0, 0 }, +/*86*/ { "", FALSE, NONE, 0, 0 }, +/*87*/ { "", FALSE, NONE, 0, 0 }, + +/*88*/ { "", FALSE, NONE, 0, 0 }, +/*89*/ { "", FALSE, NONE, 0, 0 }, +/*8a*/ { "", FALSE, NONE, 0, 0 }, +/*8b*/ { "", FALSE, NONE, 0, 0 }, +/*8c*/ { "", FALSE, NONE, 0, 0 }, +/*8d*/ { "", FALSE, NONE, 0, 0 }, +/*8e*/ { "", FALSE, NONE, 0, 0 }, +/*8f*/ { "", FALSE, NONE, 0, 0 }, +}; + +static const struct inst * const db_inst_0f38[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + db_inst_0f388x, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + static const char * const db_Grp6[] = { "sldt", "str", @@ -160,8 +203,8 @@ static const char * const db_Grp9[] = { "", "", "", - "", - "" + "vmptrld", + "vmptrst" }; static const char * const db_Grp15[] = { @@ -169,9 +212,9 @@ static const char * const db_Grp15[] = { "fxrstor", "ldmxcsr", "stmxcsr", - "", - "", - "", + "xsave", + "xrstor", + "xsaveopt", "clflush" }; @@ -236,7 +279,7 @@ static const struct inst db_inst_0f3x[] /*36*/ { "", FALSE, NONE, 0, 0 }, /*37*/ { "getsec",FALSE, NONE, 0, 0 }, -/*38*/ { "", FALSE, NONE, 0, 0 }, +/*38*/ { "", FALSE, ESC, 0, db_inst_0f38 }, /*39*/ { "", FALSE, NONE, 0, 0 }, /*3a*/ { "", FALSE, NONE, 0, 0 }, /*3b*/ { "", FALSE, NONE, 0, 0 }, @@ -266,6 +309,26 @@ static const struct inst db_inst_0f4x[] /*4f*/ { "cmovnle",TRUE, NONE, op2(E, R), 0 }, }; +static const struct inst db_inst_0f7x[] = { +/*70*/ { "", FALSE, NONE, 0, 0 }, +/*71*/ { "", FALSE, NONE, 0, 0 }, +/*72*/ { "", FALSE, NONE, 0, 0 }, +/*73*/ { "", FALSE, NONE, 0, 0 }, +/*74*/ { "", FALSE, NONE, 0, 0 }, +/*75*/ { "", FALSE, NONE, 0, 0 }, +/*76*/ { "", FALSE, NONE, 0, 0 }, +/*77*/ { "", FALSE, NONE, 0, 0 }, + +/*78*/ { "vmread", TRUE, NONE, op2(Rq, E), 0 }, +/*79*/ { "vmwrite",TRUE, NONE, op2(E, Rq), 0 }, +/*7a*/ { "", FALSE, NONE, 0, 0 }, +/*7b*/ { "", FALSE, NONE, 0, 0 }, +/*7c*/ { "", FALSE, NONE, 0, 0 }, +/*7d*/ { "", FALSE, NONE, 0, 0 }, +/*7e*/ { "", FALSE, NONE, 0, 0 }, +/*7f*/ { "", FALSE, NONE, 0, 0 }, +}; + static const struct inst db_inst_0f8x[] = { /*80*/ { "jo", FALSE, NONE, op1(Dl), 0 }, /*81*/ { "jno", FALSE, NONE, op1(Dl), 0 }, @@ -373,7 +436,7 @@ static const struct inst * const db_inst db_inst_0f4x, 0, 0, - 0, + db_inst_0f7x, db_inst_0f8x, db_inst_0f9x, db_inst_0fax, @@ -582,7 +645,7 @@ static const struct inst db_inst_table[2 /*0c*/ { "or", FALSE, BYTE, op2(I, A), 0 }, /*0d*/ { "or", FALSE, LONG, op2(I, A), 0 }, /*0e*/ { "push", FALSE, NONE, op1(Si), 0 }, -/*0f*/ { "", FALSE, NONE, 0, 0 }, +/*0f*/ { "", FALSE, ESC, 0, db_inst_0f }, /*10*/ { "adc", TRUE, BYTE, op2(R, E), 0 }, /*11*/ { "adc", TRUE, LONG, op2(R, E), 0 }, @@ -738,8 +801,8 @@ static const struct inst db_inst_table[2 /*96*/ { "xchg", FALSE, LONG, op2(A, Ri), 0 }, /*97*/ { "xchg", FALSE, LONG, op2(A, Ri), 0 }, -/*98*/ { "cbw", FALSE, SDEP, 0, "cwde" }, /* cbw/cwde */ -/*99*/ { "cwd", FALSE, SDEP, 0, "cdq" }, /* cwd/cdq */ +/*98*/ { "cwde", FALSE, SDEP, 0, "cbw" }, +/*99*/ { "cdq", FALSE, SDEP, 0, "cwd" }, /*9a*/ { "lcall", FALSE, NONE, op1(OS), 0 }, /*9b*/ { "wait", FALSE, NONE, 0, 0 }, /*9c*/ { "pushf", FALSE, LONG, 0, 0 }, @@ -822,7 +885,7 @@ static const struct inst db_inst_table[2 /*e0*/ { "loopne",FALSE, NONE, op1(Db), 0 }, /*e1*/ { "loope", FALSE, NONE, op1(Db), 0 }, /*e2*/ { "loop", FALSE, NONE, op1(Db), 0 }, -/*e3*/ { "jcxz", FALSE, SDEP, op1(Db), "jecxz" }, +/*e3*/ { "jrcxz", FALSE, ADEP, op1(Db), "jecxz" }, /*e4*/ { "in", FALSE, BYTE, op2(Ib, A), 0 }, /*e5*/ { "in", FALSE, LONG, op2(Ib, A) , 0 }, /*e6*/ { "out", FALSE, BYTE, op2(A, Ib), 0 }, @@ -1208,14 +1271,6 @@ db_disasm(loc, altfmt) if (prefix) { get_value_inc(inst, loc, 1, FALSE); } - if (rep == TRUE) { - if (inst == 0x90) { - db_printf("pause\n"); - return (loc); - } - db_printf("repe "); /* XXX repe VS rep */ - rep = FALSE; - } } while (prefix); if (inst >= 0xd8 && inst <= 0xdf) { @@ -1224,9 +1279,10 @@ db_disasm(loc, altfmt) return (loc); } - if (inst == 0x0f) { + ip = &db_inst_table[inst]; + while (ip->i_size == ESC) { get_value_inc(inst, loc, 1, FALSE); - ip = db_inst_0f[inst>>4]; + ip = ((const struct inst * const *)ip->i_extra)[inst>>4]; if (ip == 0) { ip = &db_bad_inst; } @@ -1234,8 +1290,6 @@ db_disasm(loc, altfmt) ip = &ip[inst&0xf]; } } - else - ip = &db_inst_table[inst]; if (ip->i_has_modrm) { get_value_inc(regmodrm, loc, 1, FALSE); @@ -1269,6 +1323,26 @@ db_disasm(loc, altfmt) /* Special cases that don't fit well in the tables. */ if (ip->i_extra == db_Grp7 && f_mod(rex, regmodrm) == 3) { switch (regmodrm) { + case 0xc1: + i_name = "vmcall"; + i_size = NONE; + i_mode = 0; + break; + case 0xc2: + i_name = "vmlaunch"; + i_size = NONE; + i_mode = 0; + break; + case 0xc3: + i_name = "vmresume"; + i_size = NONE; + i_mode = 0; + break; + case 0xc4: + i_name = "vmxoff"; + i_size = NONE; + i_mode = 0; + break; case 0xc8: i_name = "monitor"; i_size = NONE; @@ -1279,11 +1353,26 @@ db_disasm(loc, altfmt) i_size = NONE; i_mode = 0; break; + case 0xd0: + i_name = "xgetbv"; + i_size = NONE; + i_mode = 0; + break; + case 0xd1: + i_name = "xsetbv"; + i_size = NONE; + i_mode = 0; + break; case 0xf8: i_name = "swapgs"; i_size = NONE; i_mode = 0; break; + case 0xf9: + i_name = "rdtscp"; + i_size = NONE; + i_mode = 0; + break; } } if (ip->i_extra == db_Grp15 && f_mod(rex, regmodrm) == 3) { @@ -1292,8 +1381,42 @@ db_disasm(loc, altfmt) i_mode = 0; } + /* Handle instructions identified by mandatory prefixes. */ + if (rep == TRUE) { + if (inst == 0x90) { + i_name = "pause"; + i_size = NONE; + i_mode = 0; + rep = FALSE; + } else if (ip->i_extra == db_Grp9 && f_mod(rex, regmodrm) != 3 && + f_reg(rex, regmodrm) == 0x6) { + i_name = "vmxon"; + rep = FALSE; + } + } + if (size == WORD) { + if (ip->i_extra == db_Grp9 && f_mod(rex, regmodrm) != 3 && + f_reg(rex, regmodrm) == 0x6) { + i_name = "vmclear"; + } + } + if (rex & REX_W) { + if (strcmp(i_name, "cwde") == 0) + i_name = "cdqe"; + else if (strcmp(i_name, "cmpxchg8b") == 0) + i_name = "cmpxchg16b"; + } + + if (rep == TRUE) + db_printf("repe "); /* XXX repe VS rep */ + if (i_size == SDEP) { - if (size == WORD) + if (size == LONG) + db_printf("%s", i_name); + else + db_printf("%s", (const char *)ip->i_extra); + } else if (i_size == ADEP) { + if (short_addr == FALSE) db_printf("%s", i_name); else db_printf("%s", (const char *)ip->i_extra); @@ -1366,6 +1489,10 @@ db_disasm(loc, altfmt) db_printf("%s", db_reg[rex != 0 ? 1 : 0][WORD][f_reg(rex, regmodrm)]); break; + case Rq: + db_printf("%s", db_reg[rex != 0 ? 1 : 0][QUAD][f_reg(rex, regmodrm)]); + break; + case Ri: db_printf("%s", db_reg[0][QUAD][f_rm(rex, inst)]); break; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 20:49:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84339106564A; Wed, 29 Aug 2012 20:49:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBD68FC08; Wed, 29 Aug 2012 20:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TKnbgY012410; Wed, 29 Aug 2012 20:49:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TKnbxN012404; Wed, 29 Aug 2012 20:49:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208292049.q7TKnbxN012404@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 20:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239880 - in stable/9/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 20:49:37 -0000 Author: jhb Date: Wed Aug 29 20:49:36 2012 New Revision: 239880 URL: http://svn.freebsd.org/changeset/base/239880 Log: MFC 238310: Partially revert r217515 so that the mem_range_softc variable is always present on x86 kernels. This fixes the build of kernels that include 'device acpi' but do not include 'device mem'. Modified: stable/9/sys/amd64/amd64/machdep.c stable/9/sys/amd64/amd64/mem.c stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/i386/mem.c stable/9/sys/pc98/pc98/machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/amd64/machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/machdep.c Wed Aug 29 19:47:19 2012 (r239879) +++ stable/9/sys/amd64/amd64/machdep.c Wed Aug 29 20:49:36 2012 (r239880) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -206,6 +207,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + struct mtx dt_lock; /* lock for GDT and LDT */ static void Modified: stable/9/sys/amd64/amd64/mem.c ============================================================================== --- stable/9/sys/amd64/amd64/mem.c Wed Aug 29 19:47:19 2012 (r239879) +++ stable/9/sys/amd64/amd64/mem.c Wed Aug 29 20:49:36 2012 (r239880) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Wed Aug 29 19:47:19 2012 (r239879) +++ stable/9/sys/i386/i386/machdep.c Wed Aug 29 20:49:36 2012 (r239880) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -247,6 +248,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + static void cpu_startup(dummy) void *dummy; Modified: stable/9/sys/i386/i386/mem.c ============================================================================== --- stable/9/sys/i386/i386/mem.c Wed Aug 29 19:47:19 2012 (r239879) +++ stable/9/sys/i386/i386/mem.c Wed Aug 29 20:49:36 2012 (r239880) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - static struct sx memsxlock; SX_SYSINIT(memsxlockinit, &memsxlock, "/dev/mem lock"); Modified: stable/9/sys/pc98/pc98/machdep.c ============================================================================== --- stable/9/sys/pc98/pc98/machdep.c Wed Aug 29 19:47:19 2012 (r239879) +++ stable/9/sys/pc98/pc98/machdep.c Wed Aug 29 20:49:36 2012 (r239880) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -216,6 +217,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + static void cpu_startup(dummy) void *dummy; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 20:50:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9BB01065677; Wed, 29 Aug 2012 20:50:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90B3A8FC1F; Wed, 29 Aug 2012 20:50:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TKo2cf012502; Wed, 29 Aug 2012 20:50:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TKo2xY012496; Wed, 29 Aug 2012 20:50:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208292050.q7TKo2xY012496@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 20:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239881 - in stable/8/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 20:50:02 -0000 Author: jhb Date: Wed Aug 29 20:50:01 2012 New Revision: 239881 URL: http://svn.freebsd.org/changeset/base/239881 Log: MFC 238310: Partially revert r217515 so that the mem_range_softc variable is always present on x86 kernels. This fixes the build of kernels that include 'device acpi' but do not include 'device mem'. Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/amd64/mem.c stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/i386/mem.c stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Wed Aug 29 20:49:36 2012 (r239880) +++ stable/8/sys/amd64/amd64/machdep.c Wed Aug 29 20:50:01 2012 (r239881) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -196,6 +197,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + struct mtx dt_lock; /* lock for GDT and LDT */ static void Modified: stable/8/sys/amd64/amd64/mem.c ============================================================================== --- stable/8/sys/amd64/amd64/mem.c Wed Aug 29 20:49:36 2012 (r239880) +++ stable/8/sys/amd64/amd64/mem.c Wed Aug 29 20:50:01 2012 (r239881) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Wed Aug 29 20:49:36 2012 (r239880) +++ stable/8/sys/i386/i386/machdep.c Wed Aug 29 20:50:01 2012 (r239881) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -238,6 +239,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + static void cpu_startup(dummy) void *dummy; Modified: stable/8/sys/i386/i386/mem.c ============================================================================== --- stable/8/sys/i386/i386/mem.c Wed Aug 29 20:49:36 2012 (r239880) +++ stable/8/sys/i386/i386/mem.c Wed Aug 29 20:50:01 2012 (r239881) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - static struct sx memsxlock; SX_SYSINIT(memsxlockinit, &memsxlock, "/dev/mem lock"); Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Wed Aug 29 20:49:36 2012 (r239880) +++ stable/8/sys/pc98/pc98/machdep.c Wed Aug 29 20:50:01 2012 (r239881) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -206,6 +207,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + static void cpu_startup(dummy) void *dummy; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 21:12:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39356106566C; Wed, 29 Aug 2012 21:12:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19E078FC1E; Wed, 29 Aug 2012 21:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TLCJRD015298; Wed, 29 Aug 2012 21:12:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TLCJcH015293; Wed, 29 Aug 2012 21:12:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208292112.q7TLCJcH015293@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Aug 2012 21:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239882 - in stable/9/sys/amd64: acpica amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 21:12:20 -0000 Author: jhb Date: Wed Aug 29 21:12:19 2012 New Revision: 239882 URL: http://svn.freebsd.org/changeset/base/239882 Log: MFC 238142,238179: Now that our assembler supports the xsave family of instructions, use them natively rather than hand-assembled versions. For xgetbv/xsetbv, add a wrapper API to deal with xcr* registers: rxcr() and load_xcr(). Modified: stable/9/sys/amd64/acpica/acpi_switch.S stable/9/sys/amd64/amd64/cpu_switch.S stable/9/sys/amd64/amd64/fpu.c stable/9/sys/amd64/include/cpufunc.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/acpica/acpi_switch.S ============================================================================== --- stable/9/sys/amd64/acpica/acpi_switch.S Wed Aug 29 20:50:01 2012 (r239881) +++ stable/9/sys/amd64/acpica/acpi_switch.S Wed Aug 29 21:12:19 2012 (r239882) @@ -143,10 +143,8 @@ ENTRY(acpi_restorecpu) movq %rax, %rdx shrq $32, %rdx movl $XCR0, %ecx -/* xsetbv */ - .byte 0x0f, 0x01, 0xd1 -/* xrstor (%rbx) */ - .byte 0x0f, 0xae, 0x2b + xsetbv + xrstor (%rbx) jmp 2f 1: fxrstor (%rbx) Modified: stable/9/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/9/sys/amd64/amd64/cpu_switch.S Wed Aug 29 20:50:01 2012 (r239881) +++ stable/9/sys/amd64/amd64/cpu_switch.S Wed Aug 29 21:12:19 2012 (r239882) @@ -122,8 +122,7 @@ done_store_dr: 1: movq %rdx,%rcx movl xsave_mask,%eax movl xsave_mask+4,%edx -/* xsave (%r8) */ - .byte 0x41,0x0f,0xae,0x20 + xsave (%r8) movq %rcx,%rdx 2: smsw %ax orb $CR0_TS,%al Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Wed Aug 29 20:50:01 2012 (r239881) +++ stable/9/sys/amd64/amd64/fpu.c Wed Aug 29 21:12:19 2012 (r239882) @@ -85,9 +85,7 @@ xrstor(char *addr, uint64_t mask) low = mask; hi = mask >> 32; - /* xrstor (%rdi) */ - __asm __volatile(".byte 0x0f,0xae,0x2f" : : - "a" (low), "d" (hi), "D" (addr)); + __asm __volatile("xrstor %0" : : "m" (*addr), "a" (low), "d" (hi)); } static __inline void @@ -97,20 +95,8 @@ xsave(char *addr, uint64_t mask) low = mask; hi = mask >> 32; - /* xsave (%rdi) */ - __asm __volatile(".byte 0x0f,0xae,0x27" : : - "a" (low), "d" (hi), "D" (addr) : "memory"); -} - -static __inline void -xsetbv(uint32_t reg, uint64_t val) -{ - uint32_t low, hi; - - low = val; - hi = val >> 32; - __asm __volatile(".byte 0x0f,0x01,0xd1" : : - "c" (reg), "a" (low), "d" (hi)); + __asm __volatile("xsave %0" : "=m" (*addr) : "a" (low), "d" (hi) : + "memory"); } #else /* !(__GNUCLIKE_ASM && !lint) */ @@ -127,7 +113,6 @@ void start_emulating(void); void stop_emulating(void); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); -void xsetbv(uint32_t reg, uint64_t val); #endif /* __GNUCLIKE_ASM && !lint */ @@ -238,7 +223,7 @@ fpuinit(void) if (use_xsave) { load_cr4(rcr4() | CR4_XSAVE); - xsetbv(XCR0, xsave_mask); + load_xcr(XCR0, xsave_mask); } /* Modified: stable/9/sys/amd64/include/cpufunc.h ============================================================================== --- stable/9/sys/amd64/include/cpufunc.h Wed Aug 29 20:50:01 2012 (r239881) +++ stable/9/sys/amd64/include/cpufunc.h Wed Aug 29 21:12:19 2012 (r239882) @@ -409,6 +409,25 @@ rcr4(void) return (data); } +static __inline u_long +rxcr(u_int reg) +{ + u_int low, high; + + __asm __volatile("xgetbv" : "=a" (low), "=d" (high) : "c" (reg)); + return (low | ((uint64_t)high << 32)); +} + +static __inline void +load_xcr(u_int reg, u_long val) +{ + u_int low, high; + + low = val; + high = val >> 32; + __asm __volatile("xsetbv" : : "c" (reg), "a" (low), "d" (high)); +} + /* * Global TLB flush (except for thise for pages marked PG_G) */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 21:38:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A76F4106564A; Wed, 29 Aug 2012 21:38:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 931718FC1D; Wed, 29 Aug 2012 21:38:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TLcZs5019195; Wed, 29 Aug 2012 21:38:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TLcZuF019193; Wed, 29 Aug 2012 21:38:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208292138.q7TLcZuF019193@svn.freebsd.org> From: Ed Maste Date: Wed, 29 Aug 2012 21:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239883 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 21:38:35 -0000 Author: emaste Date: Wed Aug 29 21:38:34 2012 New Revision: 239883 URL: http://svn.freebsd.org/changeset/base/239883 Log: Avoid passing uninitialized stack to addelem() if called with an empty arg. PR: bin/171174 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Wed Aug 29 21:12:19 2012 (r239882) +++ head/bin/ps/ps.c Wed Aug 29 21:38:34 2012 (r239883) @@ -889,8 +889,8 @@ add_list(struct listinfo *inf, const cha int toolong; char elemcopy[PATH_MAX]; - if (*argp == 0) - inf->addelem(inf, elemcopy); + if (*argp == '\0') + inf->addelem(inf, argp); while (*argp != '\0') { while (*argp != '\0' && strchr(W_SEP, *argp) != NULL) argp++; From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 22:53:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C8A9106564A; Wed, 29 Aug 2012 22:53:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47B418FC16; Wed, 29 Aug 2012 22:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TMrtcN029007; Wed, 29 Aug 2012 22:53:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMrtEu029005; Wed, 29 Aug 2012 22:53:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292253.q7TMrtEu029005@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239884 - head/tools/bsdbox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:53:55 -0000 Author: adrian Date: Wed Aug 29 22:53:54 2012 New Revision: 239884 URL: http://svn.freebsd.org/changeset/base/239884 Log: For now, disable building wpa_supplicant. My 4MB flash builds can't handle the bloat. Modified: head/tools/bsdbox/Makefile.hostapd Modified: head/tools/bsdbox/Makefile.hostapd ============================================================================== --- head/tools/bsdbox/Makefile.hostapd Wed Aug 29 21:38:34 2012 (r239883) +++ head/tools/bsdbox/Makefile.hostapd Wed Aug 29 22:53:54 2012 (r239884) @@ -7,9 +7,9 @@ CRUNCH_PROGS_usr.sbin+= hostapd hostapd_ CRUNCH_SRCDIR_hostapd= $(.CURDIR)/../../usr.sbin/wpa/hostapd CRUNCH_SRCDIR_hostapd_cli= $(.CURDIR)/../../usr.sbin/wpa/hostapd_cli -CRUNCH_PROGS_usr.sbin+= wpa_supplicant wpa_cli -CRUNCH_SRCDIR_wpa_supplicant= $(.CURDIR)/../../usr.sbin/wpa/wpa_supplicant -CRUNCH_SRCDIR_wpa_cli= $(.CURDIR)/../../usr.sbin/wpa/wpa_cli +#CRUNCH_PROGS_usr.sbin+= wpa_supplicant wpa_cli +#CRUNCH_SRCDIR_wpa_supplicant= $(.CURDIR)/../../usr.sbin/wpa/wpa_supplicant +#CRUNCH_SRCDIR_wpa_cli= $(.CURDIR)/../../usr.sbin/wpa/wpa_cli CRUNCH_LIBS+= -lpcap From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 22:54:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3019106566B; Wed, 29 Aug 2012 22:54:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB1F8FC15; Wed, 29 Aug 2012 22:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TMsRjf029105; Wed, 29 Aug 2012 22:54:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMsRIL029103; Wed, 29 Aug 2012 22:54:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292254.q7TMsRIL029103@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239885 - head/tools/bsdbox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:54:27 -0000 Author: adrian Date: Wed Aug 29 22:54:27 2012 New Revision: 239885 URL: http://svn.freebsd.org/changeset/base/239885 Log: Disable building textproc for now, it doesn't fit on my 4MB flash partition. Add -lcrypt as a dynamic target. Modified: head/tools/bsdbox/Makefile Modified: head/tools/bsdbox/Makefile ============================================================================== --- head/tools/bsdbox/Makefile Wed Aug 29 22:53:54 2012 (r239884) +++ head/tools/bsdbox/Makefile Wed Aug 29 22:54:27 2012 (r239885) @@ -55,7 +55,7 @@ CRUNCH_SRCDIRS+= bin # setuid binaries - they use these libraries. PAM needs to be # built dynamically or it tries to build _all_ of the modules # statically - and that ends very badly. -CRUNCH_SHLIBS+= -lc -lutil +CRUNCH_SHLIBS+= -lc -lutil -lcrypt CRUNCH_LIBS+= -lkvm -lmemstat -lnetgraph CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcap @@ -98,7 +98,7 @@ CRUNCH_LIBS+= -lm .include "Makefile.base" .include "Makefile.net" .include "Makefile.hostapd" -.include "Makefile.textproc" +#.include "Makefile.textproc" .include "Makefile.login" .include "Makefile.kld" # telnet/telnetd are too broken to include as a crunchgen'ed binary, From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 22:54:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA7F10657D7; Wed, 29 Aug 2012 22:54:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7DC28FC26; Wed, 29 Aug 2012 22:54:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TMsd4H029170; Wed, 29 Aug 2012 22:54:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMsdBH029168; Wed, 29 Aug 2012 22:54:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292254.q7TMsdBH029168@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239886 - head/tools/bsdbox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:54:40 -0000 Author: adrian Date: Wed Aug 29 22:54:39 2012 New Revision: 239886 URL: http://svn.freebsd.org/changeset/base/239886 Log: Disable fsck_ffs for now, 4MB target size issues. Modified: head/tools/bsdbox/Makefile.fs Modified: head/tools/bsdbox/Makefile.fs ============================================================================== --- head/tools/bsdbox/Makefile.fs Wed Aug 29 22:54:27 2012 (r239885) +++ head/tools/bsdbox/Makefile.fs Wed Aug 29 22:54:39 2012 (r239886) @@ -8,7 +8,7 @@ CRUNCH_PROGS_sbin+= mdmfs mdconfig newfs CRUNCH_ALIAS_mdmfs= mount_mfs # UFS -CRUNCH_PROGS_sbin+= fsck_ffs +# CRUNCH_PROGS_sbin+= fsck_ffs CRUNCH_LIBS+= -lgeom CRUNCH_LIBS+= -lufs From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 22:55:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F6BB106567D; Wed, 29 Aug 2012 22:55:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF168FC2D; Wed, 29 Aug 2012 22:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TMtpZl029362; Wed, 29 Aug 2012 22:55:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMtpKu029360; Wed, 29 Aug 2012 22:55:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292255.q7TMtpKu029360@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239887 - head/tools/bsdbox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:55:51 -0000 Author: adrian Date: Wed Aug 29 22:55:50 2012 New Revision: 239887 URL: http://svn.freebsd.org/changeset/base/239887 Log: Do a bunch of fixing and refactoring. Fix up gzip to crunch right. Add kenv, although I'm not yet sure why it isn't working on my MIPS boards (reading kenv always returns blank.) Modified: head/tools/bsdbox/Makefile.base Modified: head/tools/bsdbox/Makefile.base ============================================================================== --- head/tools/bsdbox/Makefile.base Wed Aug 29 22:54:39 2012 (r239886) +++ head/tools/bsdbox/Makefile.base Wed Aug 29 22:55:50 2012 (r239887) @@ -5,16 +5,19 @@ # $FreeBSD$ # CRUNCH_PROGS_sbin+= dmesg sysctl init reboot -CRUNCH_PROGS_bin+= ls cat dd df cp hostname kill mkdir sleep ps ln rm hostname +CRUNCH_PROGS_bin+= ls cat dd df cp hostname kill mkdir sleep ps +CRUNCH_PROGS_bin+= ln rm hostname kenv CRUNCH_PROGS_usr.bin+= true false hexdump tail nc w head uname tset CRUNCH_PROGS_usr.sbin+= gpioctl CRUNCH_ALIAS_w= uptime CRUNCH_ALIAS_tset= reset -CRUNCH_PROGS_usr.bin+= vmstat systat +CRUNCH_PROGS_usr.bin+= vmstat +#CRUNCH_PROGS_user.bin+= systat CRUNCH_LIBS+= -ldevstat -lncursesw -lncurses -lmemstat -lkvm -CRUNCH_PROGS_usr.bin+= tar cpio +# CRUNCH_PROGS_usr.bin+= tar +CRUNCH_PROGS_usr.bin+= cpio # XXX SSL ? CRUNCH_LIBS+= -larchive -lbz2 -lz -llzma -lbsdxml -lssl -lcrypto @@ -36,11 +39,11 @@ CRUNCH_PROGS_sbin+= mount umount # grep # grep doesn't yet work -adrian -CRUNCH_PROGS_usr.bin+= grep +#CRUNCH_PROGS_usr.bin+= grep # less/more -CRUNCH_PROGS_usr.bin+= less -CRUNCH_ALIAS_less= more +#CRUNCH_PROGS_usr.bin+= less +#CRUNCH_ALIAS_less= more # passwd CRUNCH_PROGS_usr.bin+= passwd @@ -50,6 +53,5 @@ CRUNCH_SHLIBS+= -lpam -lbsm # gzip/gunzip CRUNCH_PROGS_usr.bin+= gzip -CRUNCH_ALIAS_gunzip= gzip -CRUNCH_ALIAS_gzcat= gzip +CRUNCH_ALIAS_gzip= gunzip gzcat zcat CRUNCH_LIBS+= -lz -llzma -lbz2 From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 22:58:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B69D106566C; Wed, 29 Aug 2012 22:58:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46D3D8FC0A; Wed, 29 Aug 2012 22:58:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TMwr93029759; Wed, 29 Aug 2012 22:58:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMwrcF029757; Wed, 29 Aug 2012 22:58:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292258.q7TMwrcF029757@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239888 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:58:53 -0000 Author: adrian Date: Wed Aug 29 22:58:52 2012 New Revision: 239888 URL: http://svn.freebsd.org/changeset/base/239888 Log: More attempts at space saving. * add cam as a module to build - but build in scbus/da for now, as "cam" as a module includes all cam devices. Hardly space saving. * Don't build FFS snapshot support. Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Wed Aug 29 22:55:50 2012 (r239887) +++ head/sys/mips/conf/AR724X_BASE Wed Aug 29 22:58:52 2012 (r239888) @@ -25,7 +25,7 @@ makeoptions DEBUG=-g #Build kernel with # Build these as modules so small platform builds will have the # modules already built. -makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc" +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc cam" options DDB options KDB @@ -54,6 +54,7 @@ options SCSI_NO_OP_STRINGS options NO_SYSCTL_DESCR options FFS #Berkeley Fast Filesystem +options NO_FFS_SNAPSHOT # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists # options UFS_DIRHASH #Improve performance on big directories @@ -104,8 +105,9 @@ options USB_DEBUG options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this #device ehci -device scbus #device umass + +device scbus device da # On-board SPI flash From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 00:43:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2E05106566B; Thu, 30 Aug 2012 00:43:14 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD7FD8FC12; Thu, 30 Aug 2012 00:43:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U0hENw042568; Thu, 30 Aug 2012 00:43:14 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U0hEQk042566; Thu, 30 Aug 2012 00:43:14 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208300043.q7U0hEQk042566@svn.freebsd.org> From: Jim Harris Date: Thu, 30 Aug 2012 00:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239889 - head/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 00:43:14 -0000 Author: jimharris Date: Thu Aug 30 00:43:14 2012 New Revision: 239889 URL: http://svn.freebsd.org/changeset/base/239889 Log: Do not call sati_check_data_io() for SATI_UNMAP sequences. This routine is intended only for commands such as INQUIRY where the controller may fill out a smaller amount of data than allocated by the host. The end result of this bug was that isci(4) would report non-zero resid for successful SCSI_UNMAP commands. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/isci/scil/sati.c Modified: head/sys/dev/isci/scil/sati.c ============================================================================== --- head/sys/dev/isci/scil/sati.c Wed Aug 29 22:58:52 2012 (r239888) +++ head/sys/dev/isci/scil/sati.c Thu Aug 30 00:43:14 2012 (r239889) @@ -1095,10 +1095,6 @@ SATI_STATUS sati_translate_command_respo status = sati_unmap_translate_response( sequence, scsi_io, ata_io ); - if(status == SATI_COMPLETE) - { - status = sati_check_data_io(sequence); - } break; #endif // !defined(DISABLE_SATI_UNMAP) From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 06:55:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47F9106564A; Thu, 30 Aug 2012 06:55:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B51918FC08; Thu, 30 Aug 2012 06:55:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U6tlrb093980; Thu, 30 Aug 2012 06:55:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U6tll1093976; Thu, 30 Aug 2012 06:55:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208300655.q7U6tll1093976@svn.freebsd.org> From: Adrian Chadd Date: Thu, 30 Aug 2012 06:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239890 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 06:55:47 -0000 Author: adrian Date: Thu Aug 30 06:55:47 2012 New Revision: 239890 URL: http://svn.freebsd.org/changeset/base/239890 Log: Migrate the AR9285 diversity configuration LNA configuration to use some HAL definitions rather than local definitions. The original source (ath9k) pulled this stuff from the QCA driver and removed the HAL_* prefix. I'm just restoring the correct order of things. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar9002/ar9285.h head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Aug 30 00:43:14 2012 (r239889) +++ head/sys/dev/ath/ath_hal/ah.h Thu Aug 30 06:55:47 2012 (r239890) @@ -855,6 +855,29 @@ typedef enum { HAL_MFP_HW_CRYPTO /* hardware decryption enabled. Merlin can do it. */ } HAL_MFP_OPT_T; +/* LNA config supported */ +typedef enum { + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0, + HAL_ANT_DIV_COMB_LNA2 = 1, + HAL_ANT_DIV_COMB_LNA1 = 2, + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3, +} HAL_ANT_DIV_COMB_LNA_CONF; + +typedef struct { + u_int8_t main_lna_conf; + u_int8_t alt_lna_conf; + u_int8_t fast_div_bias; + u_int8_t main_gaintb; + u_int8_t alt_gaintb; + u_int8_t antdiv_configgroup; + int8_t lna1_lna2_delta; +} HAL_ANT_COMB_CONFIG; + +#define DEFAULT_ANTDIV_CONFIG_GROUP 0x00 +#define HAL_ANTDIV_CONFIG_GROUP_1 0x01 +#define HAL_ANTDIV_CONFIG_GROUP_2 0x02 +#define HAL_ANTDIV_CONFIG_GROUP_3 0x03 + /* * Flag for setting QUIET period */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285.h Thu Aug 30 00:43:14 2012 (r239889) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.h Thu Aug 30 06:55:47 2012 (r239890) @@ -20,13 +20,6 @@ #include "ar5416/ar5416.h" -enum ar9285_ant_div_comb_lna_conf { - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0, - ATH_ANT_DIV_COMB_LNA2 = 1, - ATH_ANT_DIV_COMB_LNA1 = 2, - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3, -}; - struct ar9285_ant_comb { uint16_t count; uint16_t total_pkt_count; @@ -46,8 +39,8 @@ struct ar9285_ant_comb { HAL_BOOL alt_good; int quick_scan_cnt; int main_conf; - enum ar9285_ant_div_comb_lna_conf first_quick_scan_conf; - enum ar9285_ant_div_comb_lna_conf second_quick_scan_conf; + HAL_ANT_DIV_COMB_LNA_CONF first_quick_scan_conf; + HAL_ANT_DIV_COMB_LNA_CONF second_quick_scan_conf; int first_bias; int second_bias; HAL_BOOL first_ratio; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Thu Aug 30 00:43:14 2012 (r239889) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Thu Aug 30 06:55:47 2012 (r239890) @@ -63,49 +63,49 @@ ath_lnaconf_alt_good_scan(struct ar9285_ { antcomb->quick_scan_cnt = 0; - if (ant_conf.main_lna_conf == ATH_ANT_DIV_COMB_LNA2) + if (ant_conf.main_lna_conf == HAL_ANT_DIV_COMB_LNA2) antcomb->rssi_lna2 = main_rssi_avg; - else if (ant_conf.main_lna_conf == ATH_ANT_DIV_COMB_LNA1) + else if (ant_conf.main_lna_conf == HAL_ANT_DIV_COMB_LNA1) antcomb->rssi_lna1 = main_rssi_avg; switch ((ant_conf.main_lna_conf << 4) | ant_conf.alt_lna_conf) { case (0x10): /* LNA2 A-B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA1; break; case (0x20): /* LNA1 A-B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA2; break; case (0x21): /* LNA1 LNA2 */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->second_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; case (0x12): /* LNA2 LNA1 */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->second_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; case (0x13): /* LNA2 A+B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA1; break; case (0x23): /* LNA1 A+B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA2; break; default: break; @@ -131,7 +131,7 @@ ath_select_ant_div_from_quick_scan(struc antcomb->rssi_first = main_rssi_avg; antcomb->rssi_second = alt_rssi_avg; - if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) { + if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) { /* main is LNA1 */ if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, @@ -141,7 +141,7 @@ ath_select_ant_div_from_quick_scan(struc antcomb->first_ratio = AH_TRUE; else antcomb->first_ratio = AH_FALSE; - } else if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2) { + } else if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2) { if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_MID, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, @@ -168,26 +168,26 @@ ath_select_ant_div_from_quick_scan(struc antcomb->rssi_first = main_rssi_avg; antcomb->rssi_third = alt_rssi_avg; - if (antcomb->second_quick_scan_conf == ATH_ANT_DIV_COMB_LNA1) + if (antcomb->second_quick_scan_conf == HAL_ANT_DIV_COMB_LNA1) antcomb->rssi_lna1 = alt_rssi_avg; else if (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) antcomb->rssi_lna2 = alt_rssi_avg; else if (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2) { - if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2) { + if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2) antcomb->rssi_lna2 = main_rssi_avg; - else if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) + else if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) antcomb->rssi_lna1 = main_rssi_avg; } if (antcomb->rssi_lna2 > antcomb->rssi_lna1 + ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA) - div_ant_conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA2; + div_ant_conf->main_lna_conf = HAL_ANT_DIV_COMB_LNA2; else - div_ant_conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1; + div_ant_conf->main_lna_conf = HAL_ANT_DIV_COMB_LNA1; - if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) { + if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) { if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, @@ -196,7 +196,7 @@ ath_select_ant_div_from_quick_scan(struc antcomb->second_ratio = AH_TRUE; else antcomb->second_ratio = AH_FALSE; - } else if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2) { + } else if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2) { if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_MID, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, @@ -221,33 +221,33 @@ ath_select_ant_div_from_quick_scan(struc if (antcomb->rssi_second > antcomb->rssi_third) { /* first alt*/ if ((antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) + HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2*/ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = antcomb->first_quick_scan_conf; } else if ((antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) { + HAL_ANT_DIV_COMB_LNA2)) { /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } else { /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = @@ -256,17 +256,17 @@ ath_select_ant_div_from_quick_scan(struc } else if (antcomb->first_ratio) { /* first alt */ if ((antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) + HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = @@ -274,33 +274,33 @@ ath_select_ant_div_from_quick_scan(struc } else if (antcomb->second_ratio) { /* second alt */ if ((antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) + HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = antcomb->second_quick_scan_conf; } else { /* main is largest */ - if ((antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) || - (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2)) + if ((antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) || + (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = antcomb->main_conf; @@ -454,29 +454,29 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (!antcomb->scan) { if (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO) { - if (curr_alt_set == ATH_ANT_DIV_COMB_LNA2) { + if (curr_alt_set == HAL_ANT_DIV_COMB_LNA2) { /* Switch main and alt LNA */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; - } else if (curr_alt_set == ATH_ANT_DIV_COMB_LNA1) { + HAL_ANT_DIV_COMB_LNA1; + } else if (curr_alt_set == HAL_ANT_DIV_COMB_LNA1) { div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } goto div_comb_done; - } else if ((curr_alt_set != ATH_ANT_DIV_COMB_LNA1) && - (curr_alt_set != ATH_ANT_DIV_COMB_LNA2)) { + } else if ((curr_alt_set != HAL_ANT_DIV_COMB_LNA1) && + (curr_alt_set != HAL_ANT_DIV_COMB_LNA2)) { /* Set alt to another LNA */ - if (curr_main_set == ATH_ANT_DIV_COMB_LNA2) + if (curr_main_set == HAL_ANT_DIV_COMB_LNA2) div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; - else if (curr_main_set == ATH_ANT_DIV_COMB_LNA1) + HAL_ANT_DIV_COMB_LNA1; + else if (curr_main_set == HAL_ANT_DIV_COMB_LNA1) div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; goto div_comb_done; } @@ -488,33 +488,33 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (!antcomb->scan_not_start) { switch (curr_alt_set) { - case ATH_ANT_DIV_COMB_LNA2: + case HAL_ANT_DIV_COMB_LNA2: antcomb->rssi_lna2 = alt_rssi_avg; antcomb->rssi_lna1 = main_rssi_avg; antcomb->scan = AH_TRUE; /* set to A+B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; - case ATH_ANT_DIV_COMB_LNA1: + case HAL_ANT_DIV_COMB_LNA1: antcomb->rssi_lna1 = alt_rssi_avg; antcomb->rssi_lna2 = main_rssi_avg; antcomb->scan = AH_TRUE; /* set to A+B */ - div_ant_conf.main_lna_conf = ATH_ANT_DIV_COMB_LNA2; + div_ant_conf.main_lna_conf = HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; - case ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2: + case HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2: antcomb->rssi_add = alt_rssi_avg; antcomb->scan = AH_TRUE; /* set to A-B */ div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; break; - case ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2: + case HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2: antcomb->rssi_sub = alt_rssi_avg; antcomb->scan = AH_FALSE; if (antcomb->rssi_lna2 > @@ -525,22 +525,22 @@ ar9285_ant_comb_scan(struct ath_hal *ah, (antcomb->rssi_add > antcomb->rssi_sub)) { /* set to A+B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; } else if (antcomb->rssi_sub > antcomb->rssi_lna1) { /* set to A-B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; } else { /* set to LNA1 */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; } } else { /* use LNA1 as main LNA */ @@ -548,22 +548,22 @@ ar9285_ant_comb_scan(struct ath_hal *ah, (antcomb->rssi_add > antcomb->rssi_sub)) { /* set to A+B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; } else if (antcomb->rssi_sub > antcomb->rssi_lna1) { /* set to A-B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; } else { /* set to LNA2 */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } } break; @@ -574,16 +574,16 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (!antcomb->alt_good) { antcomb->scan_not_start = AH_FALSE; /* Set alt to another LNA */ - if (curr_main_set == ATH_ANT_DIV_COMB_LNA2) { + if (curr_main_set == HAL_ANT_DIV_COMB_LNA2) { div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; - } else if (curr_main_set == ATH_ANT_DIV_COMB_LNA1) { + HAL_ANT_DIV_COMB_LNA1; + } else if (curr_main_set == HAL_ANT_DIV_COMB_LNA1) { div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } goto div_comb_done; } @@ -697,8 +697,8 @@ ar9285SetAntennaSwitch(struct ath_hal *a /* Diversity disabled, RX = LNA1 */ HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_FIXED_A\n", __func__); - regVal |= SM(ATH_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); - regVal |= SM(ATH_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_0, AR_PHY_9285_ANT_DIV_ALT_GAINTB); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_1, AR_PHY_9285_ANT_DIV_MAIN_GAINTB); } @@ -706,8 +706,8 @@ ar9285SetAntennaSwitch(struct ath_hal *a /* Diversity disabled, RX = LNA2 */ HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_FIXED_B\n", __func__); - regVal |= SM(ATH_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_ALT_LNACONF); - regVal |= SM(ATH_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_1, AR_PHY_9285_ANT_DIV_ALT_GAINTB); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_0, AR_PHY_9285_ANT_DIV_MAIN_GAINTB); } @@ -740,8 +740,8 @@ ar9285SetAntennaSwitch(struct ath_hal *a __func__); regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); regVal &= (~(AR_PHY_9285_ANT_DIV_MAIN_LNACONF | AR_PHY_9285_ANT_DIV_ALT_LNACONF)); - regVal |= (ATH_ANT_DIV_COMB_LNA1 << AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S); - regVal |= (ATH_ANT_DIV_COMB_LNA2 << AR_PHY_9285_ANT_DIV_ALT_LNACONF_S); + regVal |= (HAL_ANT_DIV_COMB_LNA1 << AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S); + regVal |= (HAL_ANT_DIV_COMB_LNA2 << AR_PHY_9285_ANT_DIV_ALT_LNACONF_S); regVal &= (~(AR_PHY_9285_FAST_DIV_BIAS)); regVal |= (0 << AR_PHY_9285_FAST_DIV_BIAS_S); OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 07:25:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86BF0106566C; Thu, 30 Aug 2012 07:25:18 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57E8B8FC08; Thu, 30 Aug 2012 07:25:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U7PIkZ098846; Thu, 30 Aug 2012 07:25:18 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U7PI02098844; Thu, 30 Aug 2012 07:25:18 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201208300725.q7U7PI02098844@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 30 Aug 2012 07:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239891 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 07:25:18 -0000 Author: maxim Date: Thu Aug 30 07:25:17 2012 New Revision: 239891 URL: http://svn.freebsd.org/changeset/base/239891 Log: MFC r230584 by glebius: remove casts from inet6 address testing macros, thus preserving qualifier from original argument. Modified: stable/9/sys/netinet6/in6.h Modified: stable/9/sys/netinet6/in6.h ============================================================================== --- stable/9/sys/netinet6/in6.h Thu Aug 30 06:55:47 2012 (r239890) +++ stable/9/sys/netinet6/in6.h Thu Aug 30 07:25:17 2012 (r239891) @@ -235,37 +235,37 @@ extern const struct in6_addr in6addr_lin * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == 0 && \ + (a)->__u6_addr.__u6_addr32[3] == 0) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == 0 && \ + (a)->__u6_addr.__u6_addr32[3] == ntohl(1)) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == 0 && \ + (a)->__u6_addr.__u6_addr32[3] != 0 && \ + (a)->__u6_addr.__u6_addr32[3] != ntohl(1)) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff)) /* * KAME Scope Values From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 07:34:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6293A106566C; Thu, 30 Aug 2012 07:34:26 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC858FC15; Thu, 30 Aug 2012 07:34:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U7YQ0q000120; Thu, 30 Aug 2012 07:34:26 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U7YQ4g000118; Thu, 30 Aug 2012 07:34:26 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201208300734.q7U7YQ4g000118@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 30 Aug 2012 07:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239892 - stable/9/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 07:34:26 -0000 Author: maxim Date: Thu Aug 30 07:34:25 2012 New Revision: 239892 URL: http://svn.freebsd.org/changeset/base/239892 Log: MFC r237697: restore -u getopt(3) flag. Modified: stable/9/usr.sbin/jail/jail.c Directory Properties: stable/9/usr.sbin/jail/ (props changed) Modified: stable/9/usr.sbin/jail/jail.c ============================================================================== --- stable/9/usr.sbin/jail/jail.c Thu Aug 30 07:25:17 2012 (r239891) +++ stable/9/usr.sbin/jail/jail.c Thu Aug 30 07:34:25 2012 (r239892) @@ -145,7 +145,7 @@ main(int argc, char **argv) cfname = CONF_FILE; JidFile = NULL; - while ((ch = getopt(argc, argv, "cdf:hiJ:lmn:p:qrRs:U:v")) != -1) { + while ((ch = getopt(argc, argv, "cdf:hiJ:lmn:p:qrRs:u:U:v")) != -1) { switch (ch) { case 'c': op |= JF_START; From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 07:38:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 168A0106566B; Thu, 30 Aug 2012 07:38:25 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01C358FC08; Thu, 30 Aug 2012 07:38:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U7cOme000666; Thu, 30 Aug 2012 07:38:24 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U7cOYZ000664; Thu, 30 Aug 2012 07:38:24 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201208300738.q7U7cOYZ000664@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 30 Aug 2012 07:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239893 - stable/9/usr.bin/ncal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 07:38:25 -0000 Author: maxim Date: Thu Aug 30 07:38:24 2012 New Revision: 239893 URL: http://svn.freebsd.org/changeset/base/239893 Log: MFC r232004: use ISO 3166 county code for Sweden. Modified: stable/9/usr.bin/ncal/ncal.c Directory Properties: stable/9/usr.bin/ncal/ (props changed) Modified: stable/9/usr.bin/ncal/ncal.c ============================================================================== --- stable/9/usr.bin/ncal/ncal.c Thu Aug 30 07:34:25 2012 (r239892) +++ stable/9/usr.bin/ncal/ncal.c Thu Aug 30 07:38:24 2012 (r239893) @@ -105,7 +105,7 @@ static struct djswitch { {"RO", "Romania", {1919, 3, 31}}, {"RU", "Russia", {1918, 1, 31}}, {"SI", "Slovenia", {1919, 3, 4}}, - {"SW", "Sweden", {1753, 2, 17}}, + {"SE", "Sweden", {1753, 2, 17}}, {"TR", "Turkey", {1926, 12, 18}}, {"US", "United States", {1752, 9, 2}}, {"YU", "Yugoslavia", {1919, 3, 4}} From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 07:45:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86675106566C; Thu, 30 Aug 2012 07:45:26 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70E708FC0C; Thu, 30 Aug 2012 07:45:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U7jQsW001624; Thu, 30 Aug 2012 07:45:26 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U7jQhR001622; Thu, 30 Aug 2012 07:45:26 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201208300745.q7U7jQhR001622@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 30 Aug 2012 07:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239894 - stable/9/games/pom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 07:45:26 -0000 Author: maxim Date: Thu Aug 30 07:45:25 2012 New Revision: 239894 URL: http://svn.freebsd.org/changeset/base/239894 Log: MFC r230644: preserve argv[0] to use it later in usage(). Modified: stable/9/games/pom/pom.c Directory Properties: stable/9/games/pom/ (props changed) Modified: stable/9/games/pom/pom.c ============================================================================== --- stable/9/games/pom/pom.c Thu Aug 30 07:38:24 2012 (r239893) +++ stable/9/games/pom/pom.c Thu Aug 30 07:45:25 2012 (r239894) @@ -86,6 +86,7 @@ main(int argc, char **argv) double days, today, tomorrow; int ch, cnt, pflag = 0; char *odate = NULL, *otime = NULL; + char *progname = argv[0]; while ((ch = getopt(argc, argv, "d:pt:")) != -1) switch (ch) { @@ -99,14 +100,14 @@ main(int argc, char **argv) otime = optarg; break; default: - usage(argv[0]); + usage(progname); } argc -= optind; argv += optind; if (argc) - usage(argv[0]); + usage(progname); /* Adjust based on users preferences */ time(&tt); From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 08:03:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF49B106564A; Thu, 30 Aug 2012 08:03:33 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB2A68FC0C; Thu, 30 Aug 2012 08:03:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U83XTI004015; Thu, 30 Aug 2012 08:03:33 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U83XIW004013; Thu, 30 Aug 2012 08:03:33 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208300803.q7U83XIW004013@svn.freebsd.org> From: Andrey Zonov Date: Thu, 30 Aug 2012 08:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239895 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:03:34 -0000 Author: zont Date: Thu Aug 30 08:03:33 2012 New Revision: 239895 URL: http://svn.freebsd.org/changeset/base/239895 Log: - Remove accounting of locked memory from vsunlock(9) that I missed in r239818. Approved by: kib (mentor) Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Aug 30 07:45:25 2012 (r239894) +++ head/sys/vm/vm_glue.c Thu Aug 30 08:03:33 2012 (r239895) @@ -224,13 +224,6 @@ vsunlock(void *addr, size_t len) (void)vm_map_unwire(&curproc->p_vmspace->vm_map, trunc_page((vm_offset_t)addr), round_page((vm_offset_t)addr + len), VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); - -#ifdef RACCT - PROC_LOCK(curproc); - racct_set(curproc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map)))); - PROC_UNLOCK(curproc); -#endif } /* From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 08:07:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A82EA1065670; Thu, 30 Aug 2012 08:07:37 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 936128FC20; Thu, 30 Aug 2012 08:07:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U87bRL004540; Thu, 30 Aug 2012 08:07:37 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U87bfx004538; Thu, 30 Aug 2012 08:07:37 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208300807.q7U87bfx004538@svn.freebsd.org> From: Andrey Zonov Date: Thu, 30 Aug 2012 08:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239896 - head/usr.sbin/watchdogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:07:37 -0000 Author: zont Date: Thu Aug 30 08:07:37 2012 New Revision: 239896 URL: http://svn.freebsd.org/changeset/base/239896 Log: - It's also need to lock current memory. Approved by: kib (mentor) MFC after: 1 week Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Thu Aug 30 08:03:33 2012 (r239895) +++ head/usr.sbin/watchdogd/watchdogd.c Thu Aug 30 08:07:37 2012 (r239896) @@ -118,7 +118,7 @@ main(int argc, char *argv[]) pidfile_write(pfh); if (madvise(0, 0, MADV_PROTECT) != 0) warn("madvise failed"); - if (mlockall(MCL_FUTURE) != 0) + if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) warn("mlockall failed"); watchdog_loop(); From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 08:37:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C04B1065674; Thu, 30 Aug 2012 08:37:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 771DE8FC22; Thu, 30 Aug 2012 08:37:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U8b7Lj008409; Thu, 30 Aug 2012 08:37:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U8b7ob008407; Thu, 30 Aug 2012 08:37:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208300837.q7U8b7ob008407@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Aug 2012 08:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239897 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:37:07 -0000 Author: kib Date: Thu Aug 30 08:37:06 2012 New Revision: 239897 URL: http://svn.freebsd.org/changeset/base/239897 Log: MFC r238180: Style. Modified: stable/9/sys/vm/vm_pageout.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_pageout.c ============================================================================== --- stable/9/sys/vm/vm_pageout.c Thu Aug 30 08:07:37 2012 (r239896) +++ stable/9/sys/vm/vm_pageout.c Thu Aug 30 08:37:06 2012 (r239897) @@ -836,7 +836,7 @@ rescan0: object = m->object; if (!VM_OBJECT_TRYLOCK(object) && (!vm_pageout_fallback_object_lock(m, &next) || - m->hold_count != 0)) { + m->hold_count != 0)) { VM_OBJECT_UNLOCK(object); vm_page_unlock(m); addl_page_shortage++; @@ -867,8 +867,8 @@ rescan0: * level VM system not knowing anything about existing * references. */ - } else if (((m->aflags & PGA_REFERENCED) == 0) && - (actcount = pmap_ts_referenced(m))) { + } else if ((m->aflags & PGA_REFERENCED) == 0 && + (actcount = pmap_ts_referenced(m)) != 0) { vm_page_activate(m); vm_page_unlock(m); m->act_count += actcount + ACT_ADVANCE; From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 08:54:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EFAD1065670; Thu, 30 Aug 2012 08:54:14 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19E688FC08; Thu, 30 Aug 2012 08:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7U8sDAc010450; Thu, 30 Aug 2012 08:54:13 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U8sDon010446; Thu, 30 Aug 2012 08:54:13 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208300854.q7U8sDon010446@svn.freebsd.org> From: Andrey Zonov Date: Thu, 30 Aug 2012 08:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239898 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:54:14 -0000 Author: zont Date: Thu Aug 30 08:54:13 2012 New Revision: 239898 URL: http://svn.freebsd.org/changeset/base/239898 Log: - Remove unused variables. - Fix warnings about comparing signed and unsigned ints. Approved by: kib (mentor) Modified: head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Thu Aug 30 08:37:06 2012 (r239897) +++ head/usr.bin/truss/powerpc-fbsd.c Thu Aug 30 08:54:13 2012 (r239898) @@ -115,12 +115,11 @@ clear_fsc(void) { void powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { - char buf[32]; struct reg regs; void *args; int syscall_num; int i; - unsigned int regargs; + int regargs; struct syscall *sc; /* Account for a 64-bit argument with corresponding alignment. */ Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Thu Aug 30 08:37:06 2012 (r239897) +++ head/usr.bin/truss/powerpc64-fbsd.c Thu Aug 30 08:54:13 2012 (r239898) @@ -110,12 +110,11 @@ clear_fsc(void) { void powerpc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { - char buf[32]; struct reg regs; void *args; int syscall_num; int i; - unsigned int regargs; + int regargs; struct syscall *sc; cpid = trussinfo->curthread->tid; From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 10:12:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E4FC1065676; Thu, 30 Aug 2012 10:12:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28DF48FC1F; Thu, 30 Aug 2012 10:12:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UACfMX021023; Thu, 30 Aug 2012 10:12:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UACeft021019; Thu, 30 Aug 2012 10:12:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208301012.q7UACeft021019@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Aug 2012 10:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239899 - in stable/9: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 10:12:41 -0000 Author: kib Date: Thu Aug 30 10:12:40 2012 New Revision: 239899 URL: http://svn.freebsd.org/changeset/base/239899 Log: MFC r238667: Fixes for symbols visibility issues and style in fcntl.h. Modified: stable/9/lib/libc/sys/fcntl.c stable/9/sys/kern/kern_descrip.c stable/9/sys/sys/fcntl.h Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libc/sys/fcntl.c ============================================================================== --- stable/9/lib/libc/sys/fcntl.c Thu Aug 30 08:54:13 2012 (r239898) +++ stable/9/lib/libc/sys/fcntl.c Thu Aug 30 10:12:40 2012 (r239899) @@ -41,7 +41,7 @@ __fcntl_compat(int fd, int cmd, ...) { va_list args; long arg; - struct oflock ofl; + struct __oflock ofl; struct flock *flp; int res; Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Thu Aug 30 08:54:13 2012 (r239898) +++ stable/9/sys/kern/kern_descrip.c Thu Aug 30 10:12:40 2012 (r239899) @@ -364,7 +364,7 @@ int sys_fcntl(struct thread *td, struct fcntl_args *uap) { struct flock fl; - struct oflock ofl; + struct __oflock ofl; intptr_t arg; int error; int cmd; Modified: stable/9/sys/sys/fcntl.h ============================================================================== --- stable/9/sys/sys/fcntl.h Thu Aug 30 08:54:13 2012 (r239898) +++ stable/9/sys/sys/fcntl.h Thu Aug 30 10:12:40 2012 (r239899) @@ -111,7 +111,7 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE /* Attempt to bypass buffer cache */ -#define O_DIRECT 0x00010000 +#define O_DIRECT 0x00010000 #endif /* Defined by POSIX Extended API Set Part 2 */ @@ -213,18 +213,22 @@ typedef __pid_t pid_t; #define F_SETFL 4 /* set file status flags */ #if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ -#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ +#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ #endif +#if __BSD_VISIBLE #define F_OGETLK 7 /* get record locking information */ #define F_OSETLK 8 /* set record locking information */ #define F_OSETLKW 9 /* F_SETLK; wait if blocked */ #define F_DUP2FD 10 /* duplicate file descriptor to arg */ +#endif #define F_GETLK 11 /* get record locking information */ #define F_SETLK 12 /* set record locking information */ #define F_SETLKW 13 /* F_SETLK; wait if blocked */ +#if __BSD_VISIBLE #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ +#endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif @@ -239,14 +243,16 @@ typedef __pid_t pid_t; #define F_RDLCK 1 /* shared or read lock */ #define F_UNLCK 2 /* unlock */ #define F_WRLCK 3 /* exclusive or write lock */ +#if __BSD_VISIBLE #define F_UNLCKSYS 4 /* purge locks for a given system ID */ #define F_CANCEL 5 /* cancel an async lock request */ +#endif #ifdef _KERNEL #define F_WAIT 0x010 /* Wait until lock is granted */ #define F_FLOCK 0x020 /* Use flock(2) semantics for lock */ #define F_POSIX 0x040 /* Use POSIX semantics for lock */ #define F_REMOTE 0x080 /* Lock owner is remote NFS client */ -#define F_NOINTR 0x100 /* Ignore signals when waiting */ +#define F_NOINTR 0x100 /* Ignore signals when waiting */ #endif /* @@ -262,18 +268,19 @@ struct flock { int l_sysid; /* remote system id or zero for local */ }; +#if __BSD_VISIBLE /* * Old advisory file segment locking data type, * before adding l_sysid. */ -struct oflock { +struct __oflock { off_t l_start; /* starting offset */ off_t l_len; /* len = 0 means until end of file */ pid_t l_pid; /* lock owner */ short l_type; /* lock type: read/write, etc. */ short l_whence; /* type of l_start */ }; - +#endif #if __BSD_VISIBLE /* lock operations for flock(2) */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 10:18:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36298106564A; Thu, 30 Aug 2012 10:18:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 207128FC15; Thu, 30 Aug 2012 10:18:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UAItdg022073; Thu, 30 Aug 2012 10:18:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UAItP8022069; Thu, 30 Aug 2012 10:18:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208301018.q7UAItP8022069@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Aug 2012 10:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239900 - in stable/9/sys: compat/ia32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 10:18:56 -0000 Author: kib Date: Thu Aug 30 10:18:55 2012 New Revision: 239900 URL: http://svn.freebsd.org/changeset/base/239900 Log: MFC r238687: Cosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct sysentvec .sv_minuser. Also improve style. Modified: stable/9/sys/compat/ia32/ia32_sysvec.c stable/9/sys/compat/ia32/ia32_util.h stable/9/sys/kern/imgact_aout.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/9/sys/compat/ia32/ia32_sysvec.c Thu Aug 30 10:12:40 2012 (r239899) +++ stable/9/sys/compat/ia32/ia32_sysvec.c Thu Aug 30 10:18:55 2012 (r239900) @@ -126,7 +126,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, .sv_pagesize = IA32_PAGE_SIZE, - .sv_minuser = 0, + .sv_minuser = FREEBSD32_MINUSER, .sv_maxuser = FREEBSD32_MAXUSER, .sv_usrstack = FREEBSD32_USRSTACK, .sv_psstrings = FREEBSD32_PS_STRINGS, Modified: stable/9/sys/compat/ia32/ia32_util.h ============================================================================== --- stable/9/sys/compat/ia32/ia32_util.h Thu Aug 30 10:12:40 2012 (r239899) +++ stable/9/sys/compat/ia32/ia32_util.h Thu Aug 30 10:18:55 2012 (r239900) @@ -35,29 +35,30 @@ #include #include - #include #include #include #ifdef __ia64__ -#define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE * 2) +#define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE * 2) +#define FREEBSD32_MINUSER 0 #define FREEBSD32_SHAREDPAGE 0 -#define FREEBSD32_USRSTACK FREEBSD32_MAXUSER -#else +#define FREEBSD32_USRSTACK FREEBSD32_MAXUSER +#else /* __ia64__ */ #define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE) +#define FREEBSD32_MINUSER 0 #define FREEBSD32_SHAREDPAGE (FREEBSD32_MAXUSER - IA32_PAGE_SIZE) -#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE -#endif +#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE +#endif /* __ia64 */ #define IA32_PAGE_SIZE 4096 #define IA32_MAXDSIZ (512*1024*1024) /* 512MB */ #define IA32_MAXSSIZ (64*1024*1024) /* 64MB */ -#define IA32_MAXVMEM 0 /* Unlimited */ +#define IA32_MAXVMEM 0 /* Unlimited */ struct syscall_args; int ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa); void ia32_set_syscall_retval(struct thread *, int); void ia32_fixlimit(struct rlimit *rl, int which); -#endif +#endif /* _COMPAT_IA32_IA32_UTIL_H */ Modified: stable/9/sys/kern/imgact_aout.c ============================================================================== --- stable/9/sys/kern/imgact_aout.c Thu Aug 30 10:12:40 2012 (r239899) +++ stable/9/sys/kern/imgact_aout.c Thu Aug 30 10:18:55 2012 (r239900) @@ -106,6 +106,7 @@ struct sysentvec aout_sysvec = { #define AOUT32_USRSTACK 0xbfc00000 #define AOUT32_PS_STRINGS \ (AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings)) +#define AOUT32_MINUSER FREEBSD32_MINUSER extern const char *freebsd32_syscallnames[]; extern u_long ia32_maxssiz; @@ -129,7 +130,7 @@ struct sysentvec aout_sysvec = { .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, .sv_pagesize = IA32_PAGE_SIZE, - .sv_minuser = 0, + .sv_minuser = AOUT32_MINUSER, .sv_maxuser = AOUT32_USRSTACK, .sv_usrstack = AOUT32_USRSTACK, .sv_psstrings = AOUT32_PS_STRINGS, From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 10:23:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF6B1065677; Thu, 30 Aug 2012 10:23:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1971D8FC08; Thu, 30 Aug 2012 10:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UANRCg022878; Thu, 30 Aug 2012 10:23:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UANR26022874; Thu, 30 Aug 2012 10:23:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208301023.q7UANR26022874@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Aug 2012 10:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239901 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 10:23:28 -0000 Author: kib Date: Thu Aug 30 10:23:27 2012 New Revision: 239901 URL: http://svn.freebsd.org/changeset/base/239901 Log: MFC r238703: Put struct ostat and struct nstat under #ifdef _KERNEL. The compatibility definitions are only needed for implementation of the syscalls, they cause namespace pollution and are not useful for applications. Modified: stable/9/sys/sys/stat.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/stat.h ============================================================================== --- stable/9/sys/sys/stat.h Thu Aug 30 10:18:55 2012 (r239900) +++ stable/9/sys/sys/stat.h Thu Aug 30 10:23:27 2012 (r239901) @@ -99,7 +99,7 @@ typedef __uid_t uid_t; #include #endif -#if __BSD_VISIBLE +#ifdef _KERNEL struct ostat { __uint16_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ @@ -117,7 +117,7 @@ struct ostat { fflags_t st_flags; /* user defined flags for file */ __uint32_t st_gen; /* file generation number */ }; -#endif /* __BSD_VISIBLE */ +#endif struct stat { __dev_t st_dev; /* inode's device */ @@ -149,7 +149,7 @@ struct stat { unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); }; -#if __BSD_VISIBLE +#ifdef _KERNEL struct nstat { __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 10:38:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92E3F1065679; Thu, 30 Aug 2012 10:38:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFE28FC0A; Thu, 30 Aug 2012 10:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UAcg1L024831; Thu, 30 Aug 2012 10:38:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UAcgrj024827; Thu, 30 Aug 2012 10:38:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208301038.q7UAcgrj024827@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Aug 2012 10:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239902 - in stable/9/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 10:38:42 -0000 Author: kib Date: Thu Aug 30 10:38:41 2012 New Revision: 239902 URL: http://svn.freebsd.org/changeset/base/239902 Log: MFC r238972: Add lfence(). Modified: stable/9/sys/amd64/include/cpufunc.h stable/9/sys/i386/include/cpufunc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/cpufunc.h ============================================================================== --- stable/9/sys/amd64/include/cpufunc.h Thu Aug 30 10:23:27 2012 (r239901) +++ stable/9/sys/amd64/include/cpufunc.h Thu Aug 30 10:38:41 2012 (r239902) @@ -274,6 +274,13 @@ outw(u_int port, u_short data) } static __inline void +lfence(void) +{ + + __asm __volatile("lfence" : : : "memory"); +} + +static __inline void mfence(void) { Modified: stable/9/sys/i386/include/cpufunc.h ============================================================================== --- stable/9/sys/i386/include/cpufunc.h Thu Aug 30 10:23:27 2012 (r239901) +++ stable/9/sys/i386/include/cpufunc.h Thu Aug 30 10:38:41 2012 (r239902) @@ -148,6 +148,13 @@ cpu_mwait(u_long extensions, u_int hints } static __inline void +lfence(void) +{ + + __asm __volatile("lfence" : : : "memory"); +} + +static __inline void mfence(void) { From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 11:00:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75C861065670; Thu, 30 Aug 2012 11:00:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59DB88FC17; Thu, 30 Aug 2012 11:00:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UB01qQ029047; Thu, 30 Aug 2012 11:00:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UB01CP029040; Thu, 30 Aug 2012 11:00:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208301100.q7UB01CP029040@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Aug 2012 11:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239903 - in stable/8/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 11:00:01 -0000 Author: kib Date: Thu Aug 30 11:00:00 2012 New Revision: 239903 URL: http://svn.freebsd.org/changeset/base/239903 Log: MFC r238972: Add lfence(). Modified: stable/8/sys/amd64/include/cpufunc.h stable/8/sys/i386/include/cpufunc.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/include/cpufunc.h ============================================================================== --- stable/8/sys/amd64/include/cpufunc.h Thu Aug 30 10:38:41 2012 (r239902) +++ stable/8/sys/amd64/include/cpufunc.h Thu Aug 30 11:00:00 2012 (r239903) @@ -274,6 +274,13 @@ outw(u_int port, u_short data) } static __inline void +lfence(void) +{ + + __asm __volatile("lfence" : : : "memory"); +} + +static __inline void mfence(void) { Modified: stable/8/sys/i386/include/cpufunc.h ============================================================================== --- stable/8/sys/i386/include/cpufunc.h Thu Aug 30 10:38:41 2012 (r239902) +++ stable/8/sys/i386/include/cpufunc.h Thu Aug 30 11:00:00 2012 (r239903) @@ -146,6 +146,13 @@ cpu_mwait(int extensions, int hints) } static __inline void +lfence(void) +{ + + __asm __volatile("lfence" : : : "memory"); +} + +static __inline void mfence(void) { From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 11:52:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C405C1065670; Thu, 30 Aug 2012 11:52:26 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF25F8FC16; Thu, 30 Aug 2012 11:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UBqQm2035565; Thu, 30 Aug 2012 11:52:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UBqQwK035563; Thu, 30 Aug 2012 11:52:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208301152.q7UBqQwK035563@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 30 Aug 2012 11:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239904 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 11:52:26 -0000 Author: pluknet Date: Thu Aug 30 11:52:26 2012 New Revision: 239904 URL: http://svn.freebsd.org/changeset/base/239904 Log: Remove a duplicated "thread". Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Thu Aug 30 11:00:00 2012 (r239903) +++ head/share/man/man9/locking.9 Thu Aug 30 11:52:26 2012 (r239904) @@ -155,7 +155,7 @@ A thread must hold the mutex before call .Fn cv_wait* , functions. When a thread waits on a condition, the mutex -is atomically released before the thread thread yields the processor, +is atomically released before the thread yields the processor, then reacquired before the function call returns. .Pp See From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 12:18:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7059D106566C; Thu, 30 Aug 2012 12:18:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B39A8FC0A; Thu, 30 Aug 2012 12:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UCIkCr039183; Thu, 30 Aug 2012 12:18:46 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UCIkBT039181; Thu, 30 Aug 2012 12:18:46 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201208301218.q7UCIkBT039181@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 30 Aug 2012 12:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239905 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 12:18:46 -0000 Author: glebius Date: Thu Aug 30 12:18:45 2012 New Revision: 239905 URL: http://svn.freebsd.org/changeset/base/239905 Log: In ifc_alloc_unit(): - In the !wildcard case, return ENOSPC instead of confusing EEXIST in case if ifc->ifc_maxunit reached. - Fix unit leak, that I've introduced in previous revision. Submitted by: Daan Vreeken Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Thu Aug 30 11:52:26 2012 (r239904) +++ head/sys/net/if_clone.c Thu Aug 30 12:18:45 2012 (r239905) @@ -443,21 +443,30 @@ ifc_alloc_unit(struct if_clone *ifc, int wildcard = (*unit < 0); retry: - if (wildcard) { + if (*unit > ifc->ifc_maxunit) + return (ENOSPC); + if (*unit < 0) { *unit = alloc_unr(ifc->ifc_unrhdr); if (*unit == -1) return (ENOSPC); } else { *unit = alloc_unr_specific(ifc->ifc_unrhdr, *unit); - if (*unit == -1) - return (EEXIST); + if (*unit == -1) { + if (wildcard) { + (*unit)++; + goto retry; + } else + return (EEXIST); + } } snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit); if (ifunit(name) != NULL) { - if (wildcard) - goto retry; /* XXXGL: yep, it's a unit leak */ - else + free_unr(ifc->ifc_unrhdr, *unit); + if (wildcard) { + (*unit)++; + goto retry; + } else return (EEXIST); } From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 14:44:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E4C1065670; Thu, 30 Aug 2012 14:44:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 623028FC21; Thu, 30 Aug 2012 14:44:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UEiVwA059513; Thu, 30 Aug 2012 14:44:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UEiVKu059511; Thu, 30 Aug 2012 14:44:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301444.q7UEiVKu059511@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 14:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239906 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 14:44:31 -0000 Author: jhb Date: Thu Aug 30 14:44:30 2012 New Revision: 239906 URL: http://svn.freebsd.org/changeset/base/239906 Log: Clarify that bus_dma does not stall future load requests once a load is deferred. The caller is required to enforce that if that is desired. MFC after: 2 weeks Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Thu Aug 30 12:18:45 2012 (r239905) +++ head/share/man/man9/bus_dma.9 Thu Aug 30 14:44:30 2012 (r239906) @@ -580,8 +580,13 @@ The status of the mapping has been deliv The mapping has been deferred for lack of resources. The callback will be called as soon as resources are available. Callbacks are serviced in FIFO order. -To ensure that ordering is guaranteed, all subsequent load requests will also -be deferred until all callbacks have been processed. +.Pp +Note that subsequent load operations for the same tag that do not require +extra resources will still succeed. +This may result in out-of-order processing of requests. +If the caller requires the order of requests to be preserved, +then the caller is required to stall subsequent requests until a pending +request's callback is invoked. .It Er ENOMEM The load request has failed due to insufficient resources, and the caller specifically used the From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 15:24:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A310B1065674; Thu, 30 Aug 2012 15:24:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 748548FC16; Thu, 30 Aug 2012 15:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UFO03f067773; Thu, 30 Aug 2012 15:24:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UFO0lr067769; Thu, 30 Aug 2012 15:24:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208301524.q7UFO0lr067769@svn.freebsd.org> From: Alexander Motin Date: Thu, 30 Aug 2012 15:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239907 - in head/sys/dev: ahci ata ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 15:24:00 -0000 Author: mav Date: Thu Aug 30 15:23:59 2012 New Revision: 239907 URL: http://svn.freebsd.org/changeset/base/239907 Log: Add IDs for JMicron JMB360/JMB362 AHCI SATA controllers. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-jmicron.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Aug 30 14:44:30 2012 (r239906) +++ head/sys/dev/ahci/ahci.c Thu Aug 30 15:23:59 2012 (r239907) @@ -175,7 +175,9 @@ static struct { {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, + {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, + {0x2362197b, 0x00, "JMicron JMB362", 0}, {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Thu Aug 30 14:44:30 2012 (r239906) +++ head/sys/dev/ata/ata-pci.h Thu Aug 30 15:23:59 2012 (r239907) @@ -266,6 +266,7 @@ struct ata_pci_controller { #define ATA_JMICRON_ID 0x197b #define ATA_JMB360 0x2360197b #define ATA_JMB361 0x2361197b +#define ATA_JMB362 0x2362197b #define ATA_JMB363 0x2363197b #define ATA_JMB365 0x2365197b #define ATA_JMB366 0x2366197b Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Thu Aug 30 14:44:30 2012 (r239906) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Thu Aug 30 15:23:59 2012 (r239907) @@ -67,6 +67,7 @@ ata_jmicron_probe(device_t dev) static const struct ata_chip_id const ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, + { ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" }, { ATA_JMB363, 0, 2, 1, ATA_UDMA6, "JMB363" }, { ATA_JMB365, 0, 1, 2, ATA_UDMA6, "JMB365" }, { ATA_JMB366, 0, 2, 2, ATA_UDMA6, "JMB366" }, From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 15:47:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9A3B106564A; Thu, 30 Aug 2012 15:47:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6318FC0A; Thu, 30 Aug 2012 15:47:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UFlLYm070679; Thu, 30 Aug 2012 15:47:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UFlL6C070676; Thu, 30 Aug 2012 15:47:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208301547.q7UFlL6C070676@svn.freebsd.org> From: Alexander Motin Date: Thu, 30 Aug 2012 15:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239908 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 15:47:21 -0000 Author: mav Date: Thu Aug 30 15:47:20 2012 New Revision: 239908 URL: http://svn.freebsd.org/changeset/base/239908 Log: Add bunch of ATI HDMI HDA controller IDs. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Aug 30 15:23:59 2012 (r239907) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Aug 30 15:47:20 2012 (r239908) @@ -138,6 +138,15 @@ static const struct { { HDA_ATI_RV730, "ATI RV730", 0, 0 }, { HDA_ATI_RV740, "ATI RV740", 0, 0 }, { HDA_ATI_RV770, "ATI RV770", 0, 0 }, + { HDA_ATI_RV810, "ATI RV810", 0, 0 }, + { HDA_ATI_RV830, "ATI RV830", 0, 0 }, + { HDA_ATI_RV840, "ATI RV840", 0, 0 }, + { HDA_ATI_RV870, "ATI RV870", 0, 0 }, + { HDA_ATI_RV910, "ATI RV910", 0, 0 }, + { HDA_ATI_RV930, "ATI RV930", 0, 0 }, + { HDA_ATI_RV940, "ATI RV940", 0, 0 }, + { HDA_ATI_RV970, "ATI RV970", 0, 0 }, + { HDA_ATI_R1000, "ATI R1000", 0, 0 }, { HDA_RDC_M3010, "RDC M3010", 0, 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0, 0 }, { HDA_SIS_966, "SiS 966", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Thu Aug 30 15:23:59 2012 (r239907) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Aug 30 15:47:20 2012 (r239908) @@ -110,6 +110,15 @@ #define HDA_ATI_RV730 HDA_MODEL_CONSTRUCT(ATI, 0xaa38) #define HDA_ATI_RV710 HDA_MODEL_CONSTRUCT(ATI, 0xaa40) #define HDA_ATI_RV740 HDA_MODEL_CONSTRUCT(ATI, 0xaa48) +#define HDA_ATI_RV870 HDA_MODEL_CONSTRUCT(ATI, 0xaa50) +#define HDA_ATI_RV840 HDA_MODEL_CONSTRUCT(ATI, 0xaa58) +#define HDA_ATI_RV830 HDA_MODEL_CONSTRUCT(ATI, 0xaa60) +#define HDA_ATI_RV810 HDA_MODEL_CONSTRUCT(ATI, 0xaa68) +#define HDA_ATI_RV970 HDA_MODEL_CONSTRUCT(ATI, 0xaa80) +#define HDA_ATI_RV940 HDA_MODEL_CONSTRUCT(ATI, 0xaa88) +#define HDA_ATI_RV930 HDA_MODEL_CONSTRUCT(ATI, 0xaa90) +#define HDA_ATI_RV910 HDA_MODEL_CONSTRUCT(ATI, 0xaa98) +#define HDA_ATI_R1000 HDA_MODEL_CONSTRUCT(ATI, 0xaaa0) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) /* RDC */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 16:19:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E1BC106564A; Thu, 30 Aug 2012 16:19:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBBAC8FC08; Thu, 30 Aug 2012 16:19:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UGJ5BA074288; Thu, 30 Aug 2012 16:19:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UGJ5hW074284; Thu, 30 Aug 2012 16:19:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208301619.q7UGJ5hW074284@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 30 Aug 2012 16:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239909 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 16:19:06 -0000 Author: hselasky Date: Thu Aug 30 16:19:05 2012 New Revision: 239909 URL: http://svn.freebsd.org/changeset/base/239909 Log: Preparations for adding USB HOST mode to the DWC OTG driver. Merge register file with external one and put all register definitions in a separate file. Submitted by: ray @ Added: head/sys/dev/usb/controller/dwc_otgreg.h (contents, props changed) Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Thu Aug 30 15:47:20 2012 (r239908) +++ head/sys/dev/usb/controller/dwc_otg.c Thu Aug 30 16:19:05 2012 (r239909) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define DWC_OTG_BUS2SC(bus) \ ((struct dwc_otg_softc *)(((uint8_t *)(bus)) - \ @@ -90,12 +91,12 @@ __FBSDID("$FreeBSD$"); DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) #define DWC_OTG_MSK_GINT_ENABLED \ - (DWC_OTG_MSK_GINT_ENUM_DONE | \ - DWC_OTG_MSK_GINT_USB_RESET | \ - DWC_OTG_MSK_GINT_USB_SUSPEND | \ - DWC_OTG_MSK_GINT_INEP | \ - DWC_OTG_MSK_GINT_RXFLVL | \ - DWC_OTG_MSK_GINT_SESSREQINT) + (GINTSTS_ENUMDONE | \ + GINTSTS_USBRST | \ + GINTSTS_USBSUSP | \ + GINTSTS_IEPINT | \ + GINTSTS_RXFLVL | \ + GINTSTS_SESSREQINT) #define DWC_OTG_USE_HSIC 0 @@ -172,7 +173,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* split equally for IN and OUT */ fifo_size /= 2; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRXFSIZ, fifo_size / 4); + DWC_OTG_WRITE_4(sc, DOTG_GRXFSIZ, fifo_size / 4); /* align to 4-bytes */ fifo_size &= ~3; @@ -185,7 +186,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * return (EINVAL); } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GNPTXFSIZ, (0x10 << 16) | (tx_start / 4)); + DWC_OTG_WRITE_4(sc, DOTG_GNPTXFSIZ, (0x10 << 16) | (tx_start / 4)); fifo_size -= 0x40; tx_start += 0x40; @@ -210,7 +211,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * (DWC_OTG_MAX_TXN / 2); if (fifo_size >= limit) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x), ((limit / 4) << 16) | (tx_start / 4)); tx_start += limit; @@ -220,7 +221,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * pf->max_buffer = limit; } else if (fifo_size >= 0x80) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x), ((0x80 / 4) << 16) | (tx_start / 4)); tx_start += 0x80; fifo_size -= 0x80; @@ -229,7 +230,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } else { pf->usb.is_simplex = 1; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x), (0x0 << 16) | (tx_start / 4)); } } else { @@ -242,13 +243,13 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } /* reset RX FIFO */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_RXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_RXFFLSH); /* reset all TX FIFOs */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_TXFIFO(0x10) | - DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_TXFIFO(0x10) | + GRSTCTL_TXFFLSH); return (0); } @@ -291,9 +292,9 @@ dwc_otg_pull_up(struct dwc_otg_softc *sc sc->sc_flags.port_powered) { sc->sc_flags.d_pulled_up = 1; - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); - temp &= ~DWC_OTG_MSK_DCTL_SOFT_DISC; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCTL); + temp &= ~DCTL_SFTDISCON; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); } } @@ -307,9 +308,9 @@ dwc_otg_pull_down(struct dwc_otg_softc * if (sc->sc_flags.d_pulled_up) { sc->sc_flags.d_pulled_up = 0; - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); - temp |= DWC_OTG_MSK_DCTL_SOFT_DISC; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCTL); + temp |= DCTL_SFTDISCON; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); } } @@ -325,9 +326,9 @@ dwc_otg_resume_irq(struct dwc_otg_softc * Disable resume interrupt and enable suspend * interrupt: */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_WKUPINT; - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_USB_SUSPEND; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_WKUPINT; + sc->sc_irq_mask |= GINTSTS_USBSUSP; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); @@ -345,15 +346,15 @@ dwc_otg_wakeup_peer(struct dwc_otg_softc DPRINTFN(5, "Remote wakeup\n"); /* enable remote wakeup signalling */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); - temp |= DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCTL); + temp |= DCTL_RMTWKUPSIG; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); /* Wait 8ms for remote wakeup to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - temp &= ~DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp &= ~DCTL_RMTWKUPSIG; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); /* need to fake resume IRQ */ dwc_otg_resume_irq(sc); @@ -366,10 +367,10 @@ dwc_otg_set_address(struct dwc_otg_softc DPRINTFN(5, "addr=%d\n", addr); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCFG); - temp &= ~DWC_OTG_MSK_DCFG_SET_DEV_ADDR(0x7F); - temp |= DWC_OTG_MSK_DCFG_SET_DEV_ADDR(addr); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCFG, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCFG); + temp &= ~DCFG_DEVADDR_SET(0x7F); + temp |= DCFG_DEVADDR_SET(addr); + DWC_OTG_WRITE_4(sc, DOTG_DCFG, temp); } static void @@ -378,8 +379,8 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof DPRINTFN(5, "RX status clear\n"); /* enable RX FIFO level interrupt */ - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_RXFLVL; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask |= GINTSTS_RXFLVL; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* clear cached status */ sc->sc_last_rx_status = 0; @@ -401,18 +402,18 @@ dwc_otg_setup_rx(struct dwc_otg_td *td) if (sc->sc_last_rx_status == 0) goto not_complete; - if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != 0) + if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != 0) goto not_complete; - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PID) != - DWC_OTG_MSK_GRXSTS_PID_DATA0) { + if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != + GRXSTSRD_DPID_DATA0) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; } - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) != - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_DATA) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; @@ -424,7 +425,7 @@ dwc_otg_setup_rx(struct dwc_otg_td *td) td->did_stall = 0; /* get the packet byte count */ - count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status); + count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); /* verify data length */ if (count != td->remainder) { @@ -459,22 +460,22 @@ dwc_otg_setup_rx(struct dwc_otg_td *td) } /* don't send any data by default */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(0), - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(0) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(0)); + DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(0), + DXEPTSIZ_SET_NPKT(0) | + DXEPTSIZ_SET_NBYTES(0)); temp = sc->sc_in_ctl[0]; /* enable IN endpoint */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), - temp | DWC_OTG_MSK_DIEPCTL_ENABLE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), - temp | DWC_OTG_MSK_DIEPCTL_SET_NAK); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), + temp | DIEPCTL_EPENA); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), + temp | DIEPCTL_SNAK); /* reset IN endpoint buffer */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_TXFIFO(0) | - DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_TXFIFO(0) | + GRSTCTL_TXFFLSH); /* acknowledge RX status */ dwc_otg_common_rx_ack(sc); @@ -485,11 +486,11 @@ not_complete: temp = sc->sc_out_ctl[0]; - temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | - DWC_OTG_MSK_DOEPCTL_SET_NAK; + temp |= DOEPCTL_EPENA | + DOEPCTL_SNAK; /* enable OUT endpoint */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), temp); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), temp); if (!td->did_stall) { td->did_stall = 1; @@ -497,21 +498,21 @@ not_complete: DPRINTFN(5, "stalling IN and OUT direction\n"); /* set stall after enabling endpoint */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), - temp | DWC_OTG_MSK_DOEPCTL_STALL); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), + temp | DOEPCTL_STALL); temp = sc->sc_in_ctl[0]; /* set stall assuming endpoint is enabled */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), - temp | DWC_OTG_MSK_DIEPCTL_STALL); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), + temp | DIEPCTL_STALL); } /* setup number of buffers to receive */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), - DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(3) | - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(sizeof(req))); + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), + DXEPTSIZ_SET_MULTI(3) | + DXEPTSIZ_SET_NPKT(1) | + DXEPTSIZ_SET_NBYTES(sizeof(req))); return (1); /* not complete */ } @@ -533,12 +534,12 @@ dwc_otg_data_rx(struct dwc_otg_td *td) if (sc->sc_last_rx_status == 0) goto not_complete; - if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != td->ep_no) + if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != td->ep_no) goto not_complete; /* check for SETUP packet */ - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) == - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) == + GRXSTSRD_STP_DATA) { if (td->remainder == 0) { /* * We are actually complete and have @@ -554,15 +555,15 @@ dwc_otg_data_rx(struct dwc_otg_td *td) return (0); /* complete */ } - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) != - DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_OUT_DATA) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; } /* get the packet byte count */ - count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status); + count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); /* verify the packet byte count */ if (count != td->max_packet_size) { @@ -609,22 +610,22 @@ not_complete: temp = sc->sc_out_ctl[td->ep_no]; - temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | - DWC_OTG_MSK_DOEPCTL_CLR_NAK; + temp |= DOEPCTL_EPENA | + DOEPCTL_CNAK; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(td->ep_no), temp); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp); /* enable SETUP and transfer complete interrupt */ if (td->ep_no == 0) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(td->max_packet_size)); + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), + DXEPTSIZ_SET_NPKT(1) | + DXEPTSIZ_SET_NBYTES(td->max_packet_size)); } else { /* allow reception of multiple packets */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(td->ep_no), - DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(4) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(4 * + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(td->ep_no), + DXEPTSIZ_SET_MULTI(1) | + DXEPTSIZ_SET_NPKT(4) | + DXEPTSIZ_SET_NBYTES(4 * ((td->max_packet_size + 3) & ~3))); } return (1); /* not complete */ @@ -654,10 +655,10 @@ repeat: temp = sc->sc_last_rx_status; if ((td->ep_no == 0) && (temp != 0) && - (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { + (GRXSTSRD_CHNUM_GET(temp) == 0)) { - if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) != - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((temp & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_DATA) { /* dump data - wrong direction */ dwc_otg_common_rx_ack(sc); @@ -677,10 +678,10 @@ repeat: uint16_t cpkt; /* check if packets have been transferred */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); /* get current packet number */ - cpkt = DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp); + cpkt = DXEPTSIZ_GET_NPKT(temp); if (cpkt >= td->npkt) { fifo_left = 0; @@ -711,7 +712,7 @@ repeat: /* transfer data into FIFO */ bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DWC_OTG_REG_DFIFO(td->ep_no), + DOTG_DFIFO(td->ep_no), sc->sc_tx_bounce_buffer, (count + 3) / 4); td->tx_bytes -= count; @@ -735,14 +736,14 @@ repeat: goto not_complete; /* check if not all packets have been transferred */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); - if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { + if (DXEPTSIZ_GET_NPKT(temp) != 0) { DPRINTFN(5, "busy ep=%d npkt=%d DIEPTSIZ=0x%08x " "DIEPCTL=0x%08x\n", td->ep_no, - DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp), - temp, DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no))); + DXEPTSIZ_GET_NPKT(temp), + temp, DWC_OTG_READ_4(sc, DOTG_DIEPCTL(td->ep_no))); goto not_complete; } @@ -791,10 +792,10 @@ repeat: } td->npkt = 1; } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no), - DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(td->npkt) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(count)); + DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(td->ep_no), + DXEPTSIZ_SET_MULTI(1) | + DXEPTSIZ_SET_NPKT(td->npkt) | + DXEPTSIZ_SET_NBYTES(count)); /* make room for buffering */ td->npkt += mpkt; @@ -802,9 +803,9 @@ repeat: temp = sc->sc_in_ctl[td->ep_no]; /* must enable before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no), temp | - DWC_OTG_MSK_DIEPCTL_ENABLE | - DWC_OTG_MSK_DIEPCTL_CLR_NAK); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(td->ep_no), temp | + DIEPCTL_EPENA | + DIEPCTL_CNAK); td->tx_bytes = count; @@ -834,10 +835,10 @@ dwc_otg_data_tx_sync(struct dwc_otg_td * /* * If all packets are transferred we are complete: */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); /* check that all packets have been transferred */ - if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { + if (DXEPTSIZ_GET_NPKT(temp) != 0) { DPRINTFN(5, "busy ep=%d\n", td->ep_no); goto not_complete; } @@ -850,10 +851,10 @@ not_complete: temp = sc->sc_last_rx_status; if ((td->ep_no == 0) && (temp != 0) && - (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { + (GRXSTSRD_CHNUM_GET(temp) == 0)) { - if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) == - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((temp & GRXSTSRD_PKTSTS_MASK) == + GRXSTSRD_STP_DATA) { DPRINTFN(5, "faking complete\n"); /* * Race condition: We are complete! @@ -920,36 +921,36 @@ dwc_otg_interrupt_poll(struct dwc_otg_so repeat: if (sc->sc_last_rx_status == 0) { - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GINTSTS); - if (temp & DWC_OTG_MSK_GINT_RXFLVL) { + temp = DWC_OTG_READ_4(sc, DOTG_GINTSTS); + if (temp & GINTSTS_RXFLVL) { /* pop current status */ sc->sc_last_rx_status = - DWC_OTG_READ_4(sc, DWC_OTG_REG_GRXSTSP); + DWC_OTG_READ_4(sc, DOTG_GRXSTSPD); } if (sc->sc_last_rx_status != 0) { uint8_t ep_no; - temp = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT( + temp = GRXSTSRD_BCNT_GET( sc->sc_last_rx_status); - ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + ep_no = GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status); /* receive data, if any */ if (temp != 0) { DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DWC_OTG_REG_DFIFO(ep_no), + DOTG_DFIFO(ep_no), sc->sc_rx_bounce_buffer, (temp + 3) / 4); } temp = sc->sc_last_rx_status & - DWC_OTG_MSK_GRXSTS_PACKET_STS; + GRXSTSRD_PKTSTS_MASK; /* non-data messages we simply skip */ - if (temp != DWC_OTG_MSK_GRXSTS_DEV_STP_DATA && - temp != DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { + if (temp != GRXSTSRD_STP_DATA && + temp != GRXSTSRD_OUT_DATA) { dwc_otg_common_rx_ack(sc); goto repeat; } @@ -965,7 +966,7 @@ repeat: DPRINTFN(5, "RX status = 0x%08x: ch=%d pid=%d bytes=%d sts=%d\n", sc->sc_last_rx_status, ep_no, (sc->sc_last_rx_status >> 15) & 3, - DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status), + GRXSTSRD_BCNT_GET(sc->sc_last_rx_status), (sc->sc_last_rx_status >> 17) & 15); } else { got_rx_status = 0; @@ -973,7 +974,7 @@ repeat: } else { uint8_t ep_no; - ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + ep_no = GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status); /* check if we should dump the data */ @@ -997,8 +998,8 @@ repeat: goto repeat; /* disable RX FIFO level interrupt */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_RXFLVL; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_RXFLVL; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } } @@ -1038,12 +1039,12 @@ dwc_otg_interrupt(struct dwc_otg_softc * USB_BUS_LOCK(&sc->sc_bus); /* read and clear interrupt status */ - status = DWC_OTG_READ_4(sc, DWC_OTG_REG_GINTSTS); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTSTS, status); + status = DWC_OTG_READ_4(sc, DOTG_GINTSTS); + DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status); DPRINTFN(14, "GINTSTS=0x%08x\n", status); - if (status & DWC_OTG_MSK_GINT_USB_RESET) { + if (status & GINTSTS_USBRST) { /* set correct state */ sc->sc_flags.status_bus_reset = 0; @@ -1056,7 +1057,7 @@ dwc_otg_interrupt(struct dwc_otg_softc * } /* check for any bus state change interrupts */ - if (status & DWC_OTG_MSK_GINT_ENUM_DONE) { + if (status & GINTSTS_ENUMDONE) { uint32_t temp; @@ -1078,18 +1079,18 @@ dwc_otg_interrupt(struct dwc_otg_softc * sc->sc_active_out_ep = 1; /* figure out enumeration speed */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DSTS); - if (DWC_OTG_MSK_DSTS_GET_ENUM_SPEED(temp) == - DWC_OTG_MSK_DSTS_ENUM_SPEED_HI) + temp = DWC_OTG_READ_4(sc, DOTG_DSTS); + if (DSTS_ENUMSPD_GET(temp) == + DSTS_ENUMSPD_HI) sc->sc_flags.status_high_speed = 1; else sc->sc_flags.status_high_speed = 0; /* disable resume interrupt and enable suspend interrupt */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_WKUPINT; - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_USB_SUSPEND; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_WKUPINT; + sc->sc_irq_mask |= GINTSTS_USBSUSP; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); @@ -1099,13 +1100,13 @@ dwc_otg_interrupt(struct dwc_otg_softc * * that like RESUME. Resume is set when there is at least 3 * milliseconds of inactivity on the USB BUS. */ - if (status & DWC_OTG_MSK_GINT_WKUPINT) { + if (status & GINTSTS_WKUPINT) { DPRINTFN(5, "resume interrupt\n"); dwc_otg_resume_irq(sc); - } else if (status & DWC_OTG_MSK_GINT_USB_SUSPEND) { + } else if (status & GINTSTS_USBSUSP) { DPRINTFN(5, "suspend interrupt\n"); @@ -1118,45 +1119,45 @@ dwc_otg_interrupt(struct dwc_otg_softc * * Disable suspend interrupt and enable resume * interrupt: */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_USB_SUSPEND; - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_WKUPINT; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_USBSUSP; + sc->sc_irq_mask |= GINTSTS_WKUPINT; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); } } /* check VBUS */ - if (status & (DWC_OTG_MSK_GINT_USB_SUSPEND | - DWC_OTG_MSK_GINT_USB_RESET | - DWC_OTG_MSK_GINT_SESSREQINT)) { + if (status & (GINTSTS_USBSUSP | + GINTSTS_USBRST | + GINTSTS_SESSREQINT)) { uint32_t temp; - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GOTGCTL); + temp = DWC_OTG_READ_4(sc, DOTG_GOTGCTL); DPRINTFN(5, "GOTGCTL=0x%08x\n", temp); dwc_otg_vbus_interrupt(sc, - (temp & DWC_OTG_MSK_GOTGCTL_BSESS_VALID) ? 1 : 0); + (temp & GOTGCTL_BSESVLD) ? 1 : 0); } /* clear all IN endpoint interrupts */ - if (status & DWC_OTG_MSK_GINT_INEP) { + if (status & GINTSTS_IEPINT) { uint32_t temp; uint8_t x; for (x = 0; x != sc->sc_dev_in_ep_max; x++) { - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPINT(x)); - if (temp & DWC_OTG_MSK_DIEP_XFER_COMPLETE) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPINT(x), - DWC_OTG_MSK_DIEP_XFER_COMPLETE); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPINT(x)); + if (temp & DIEPMSK_XFERCOMPLMSK) { + DWC_OTG_WRITE_4(sc, DOTG_DIEPINT(x), + DIEPMSK_XFERCOMPLMSK); } } } #if 0 /* check if we should poll the FIFOs */ - if (status & (DWC_OTG_MSK_GINT_RXFLVL | DWC_OTG_MSK_GINT_INEP)) + if (status & (GINTSTS_RXFLVL | GINTSTS_IEPINT)) #endif /* poll FIFO(s) */ dwc_otg_interrupt_poll(sc); @@ -1548,16 +1549,16 @@ dwc_otg_set_stall(struct usb_device *ude DPRINTFN(5, "endpoint=0x%x\n", ep_no); if (ep_no & UE_DIR_IN) { - reg = DWC_OTG_REG_DIEPCTL(ep_no & UE_ADDR); + reg = DOTG_DIEPCTL(ep_no & UE_ADDR); temp = sc->sc_in_ctl[ep_no & UE_ADDR]; } else { - reg = DWC_OTG_REG_DOEPCTL(ep_no & UE_ADDR); + reg = DOTG_DOEPCTL(ep_no & UE_ADDR); temp = sc->sc_out_ctl[ep_no & UE_ADDR]; } /* disable and stall endpoint */ - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_STALL); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_STALL); /* clear active OUT ep */ if (!(ep_no & UE_DIR_IN)) { @@ -1565,7 +1566,7 @@ dwc_otg_set_stall(struct usb_device *ude sc->sc_active_out_ep &= ~(1U << (ep_no & UE_ADDR)); if (sc->sc_last_rx_status != 0 && - (ep_no & UE_ADDR) == DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + (ep_no & UE_ADDR) == GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status)) { /* dump data */ dwc_otg_common_rx_ack(sc); @@ -1588,9 +1589,9 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s } if (ep_dir) { - reg = DWC_OTG_REG_DIEPCTL(ep_no); + reg = DOTG_DIEPCTL(ep_no); } else { - reg = DWC_OTG_REG_DOEPCTL(ep_no); + reg = DOTG_DOEPCTL(ep_no); sc->sc_active_out_ep |= (1U << ep_no); } @@ -1598,39 +1599,39 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s mps = (mps + 3) & 0x7FC; if (ep_type == UE_BULK) { - temp = DWC_OTG_MSK_EP_SET_TYPE( - DWC_OTG_MSK_EP_TYPE_BULK) | - DWC_OTG_MSK_DIEPCTL_USB_AEP; + temp = DIEPCTL_EPTYPE_SET( + DIEPCTL_EPTYPE_BULK) | + DIEPCTL_USBACTEP; } else if (ep_type == UE_INTERRUPT) { - temp = DWC_OTG_MSK_EP_SET_TYPE( - DWC_OTG_MSK_EP_TYPE_INTERRUPT) | - DWC_OTG_MSK_DIEPCTL_USB_AEP; + temp = DIEPCTL_EPTYPE_SET( + DIEPCTL_EPTYPE_INTERRUPT) | + DIEPCTL_USBACTEP; } else { - temp = DWC_OTG_MSK_EP_SET_TYPE( - DWC_OTG_MSK_EP_TYPE_ISOC) | - DWC_OTG_MSK_DIEPCTL_USB_AEP; + temp = DIEPCTL_EPTYPE_SET( + DIEPCTL_EPTYPE_ISOC) | + DIEPCTL_USBACTEP; } - temp |= DWC_OTG_MSK_DIEPCTL_MPS(mps); - temp |= DWC_OTG_MSK_DIEPCTL_FNUM(ep_no); + temp |= DIEPCTL_MPS_SET(mps); + temp |= DIEPCTL_TXFNUM_SET(ep_no); if (ep_dir) sc->sc_in_ctl[ep_no] = temp; else sc->sc_out_ctl[ep_no] = temp; - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_SET_DATA0); - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DIEPCTL_SET_NAK); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_SETD0PID); + DWC_OTG_WRITE_4(sc, reg, temp | DIEPCTL_SNAK); /* we only reset the transmit FIFO */ if (ep_dir) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_TXFIFO(ep_no) | - DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_TXFIFO(ep_no) | + GRSTCTL_TXFFLSH); DWC_OTG_WRITE_4(sc, - DWC_OTG_REG_DIEPTSIZ(ep_no), 0); + DOTG_DIEPTSIZ(ep_no), 0); } /* poll interrupt */ @@ -1684,14 +1685,14 @@ dwc_otg_device_state_change(struct usb_d for (x = 1; x != sc->sc_dev_ep_max; x++) { if (x < sc->sc_dev_in_ep_max) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(x), - DWC_OTG_MSK_DIEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(x), + DIEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(x), 0); } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(x), - DWC_OTG_MSK_DOEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(x), + DOEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(x), 0); } USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1716,68 +1717,68 @@ dwc_otg_init(struct dwc_otg_softc *sc) /* turn on clocks */ dwc_otg_clocks_on(sc); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GSNPSID); + temp = DWC_OTG_READ_4(sc, DOTG_GSNPSID); DPRINTF("Version = 0x%08x\n", temp); /* disconnect */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, - DWC_OTG_MSK_DCTL_SOFT_DISC); + DWC_OTG_WRITE_4(sc, DOTG_DCTL, + DCTL_SFTDISCON); /* wait for host to detect disconnect */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 32); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_CSFTRST); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_CSFTRST); /* wait a little bit for block to reset */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 128); /* select HSIC or non-HSIC mode */ if (DWC_OTG_USE_HSIC) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GUSBCFG, - DWC_OTG_MSK_GUSBCFG_PHY_INTF | - DWC_OTG_MSK_GUSBCFG_TRD_TIM(5)); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GOTGCTL, + DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, + GUSBCFG_PHYIF | + GUSBCFG_TRD_TIM_SET(5)); + DWC_OTG_WRITE_4(sc, DOTG_GOTGCTL, 0x000000EC); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GLPMCFG); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GLPMCFG, - temp & ~DWC_OTG_MSK_GLPMCFG_HSIC_CONN); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GLPMCFG, - temp | DWC_OTG_MSK_GLPMCFG_HSIC_CONN); + temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp & ~GLPMCFG_HSIC_CONN); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp | GLPMCFG_HSIC_CONN); } else { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GUSBCFG, - DWC_OTG_MSK_GUSBCFG_ULPI_UMTI_SEL | - DWC_OTG_MSK_GUSBCFG_TRD_TIM(5)); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GOTGCTL, 0); - - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GLPMCFG); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GLPMCFG, - temp & ~DWC_OTG_MSK_GLPMCFG_HSIC_CONN); + DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, + GUSBCFG_ULPI_UTMI_SEL | + GUSBCFG_TRD_TIM_SET(5)); + DWC_OTG_WRITE_4(sc, DOTG_GOTGCTL, 0); + + temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp & ~GLPMCFG_HSIC_CONN); } /* clear global nak */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, - DWC_OTG_MSK_DCTL_CGOUT_NAK | - DWC_OTG_MSK_DCTL_CGNPIN_NAK); + DWC_OTG_WRITE_4(sc, DOTG_DCTL, + DCTL_CGOUTNAK | + DCTL_CGNPINNAK); /* enable USB port */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_PCGCCTL, 0); + DWC_OTG_WRITE_4(sc, DOTG_PCGCCTL, 0); /* pull up D+ */ dwc_otg_pull_up(sc); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG3); + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG3); - sc->sc_fifo_size = 4 * DWC_OTG_MSK_GHWCFG3_GET_DFIFO(temp); + sc->sc_fifo_size = 4 * GHWCFG3_DFIFODEPTH_GET(temp); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG2); + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG2); - sc->sc_dev_ep_max = DWC_OTG_MSK_GHWCFG2_NUM_DEV_EP(temp); + sc->sc_dev_ep_max = GHWCFG2_NUMDEVEPS_GET(temp); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG4); + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG4); - sc->sc_dev_in_ep_max = DWC_OTG_MSK_GHWCFG4_NUM_IN_EPS(temp); + sc->sc_dev_in_ep_max = GHWCFG4_NUM_IN_EP_GET(temp); DPRINTF("Total FIFO size = %d bytes, Device EPs = %d/%d\n", sc->sc_fifo_size, sc->sc_dev_ep_max, sc->sc_dev_in_ep_max); @@ -1788,43 +1789,43 @@ dwc_otg_init(struct dwc_otg_softc *sc) /* enable interrupts */ sc->sc_irq_mask = DWC_OTG_MSK_GINT_ENABLED; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* enable all endpoint interrupts */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG2); - if (temp & DWC_OTG_MSK_GHWCFG2_MPI) { + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG2); + if (temp & GHWCFG2_MPI) { uint8_t x; DPRINTF("Multi Process Interrupts\n"); for (x = 0; x != sc->sc_dev_in_ep_max; x++) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPEACHMSK(x), - DWC_OTG_MSK_DIEP_XFER_COMPLETE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPEACHMSK(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_DIEPEACHINTMSK(x), + DIEPMSK_XFERCOMPLMSK); + DWC_OTG_WRITE_4(sc, DOTG_DOEPEACHINTMSK(x), 0); } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DEACHINTMSK, 0xFFFF); + DWC_OTG_WRITE_4(sc, DOTG_DEACHINTMSK, 0xFFFF); } else { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPMSK, - DWC_OTG_MSK_DIEP_XFER_COMPLETE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPMSK, 0); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DAINTMSK, 0xFFFF); + DWC_OTG_WRITE_4(sc, DOTG_DIEPMSK, + DIEPMSK_XFERCOMPLMSK); + DWC_OTG_WRITE_4(sc, DOTG_DOEPMSK, 0); + DWC_OTG_WRITE_4(sc, DOTG_DAINTMSK, 0xFFFF); } /* enable global IRQ */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GAHBCFG, - DWC_OTG_MSK_GAHBCFG_GLOBAL_IRQ); + DWC_OTG_WRITE_4(sc, DOTG_GAHBCFG, + GAHBCFG_GLBLINTRMSK); /* turn off clocks */ dwc_otg_clocks_off(sc); /* read initial VBUS state */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GOTGCTL); + temp = DWC_OTG_READ_4(sc, DOTG_GOTGCTL); DPRINTFN(5, "GOTCTL=0x%08x\n", temp); dwc_otg_vbus_interrupt(sc, - (temp & DWC_OTG_MSK_GOTGCTL_BSESS_VALID) ? 1 : 0); + (temp & GOTGCTL_BSESVLD) ? 1 : 0); USB_BUS_UNLOCK(&sc->sc_bus); @@ -1841,11 +1842,11 @@ dwc_otg_uninit(struct dwc_otg_softc *sc) USB_BUS_LOCK(&sc->sc_bus); /* set disconnect */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, - DWC_OTG_MSK_DCTL_SOFT_DISC); + DWC_OTG_WRITE_4(sc, DOTG_DCTL, + DCTL_SFTDISCON); /* turn off global IRQ */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GAHBCFG, 0); + DWC_OTG_WRITE_4(sc, DOTG_GAHBCFG, 0); sc->sc_flags.port_powered = 0; sc->sc_flags.status_vbus = 0; @@ -1946,11 +1947,11 @@ dwc_otg_device_isoc_fs_enter(struct usb_ DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", xfer, xfer->endpoint->isoc_next, xfer->nframes); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DSTS); + temp = DWC_OTG_READ_4(sc, DOTG_DSTS); /* get the current frame index */ - nframes = DWC_OTG_MSK_DSTS_GET_FNUM(temp); + nframes = DSTS_SOFFN_GET(temp); if (sc->sc_flags.status_high_speed) nframes /= 8; Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Thu Aug 30 15:47:20 2012 (r239908) +++ head/sys/dev/usb/controller/dwc_otg.h Thu Aug 30 16:19:05 2012 (r239909) @@ -32,290 +32,6 @@ #define DWC_OTG_MAX_TXP 4 #define DWC_OTG_MAX_TXN (0x200 * DWC_OTG_MAX_TXP) -/* Global CSR registers */ - -#define DWC_OTG_REG_GOTGCTL 0x0000 -#define DWC_OTG_MSK_GOTGCTL_CHIRP_ON (1U << 27) -#define DWC_OTG_MSK_GOTGCTL_BSESS_VALID (1U << 19) -#define DWC_OTG_MSK_GOTGCTL_ASESS_VALID (1U << 18) -#define DWC_OTG_MSK_GOTGCTL_CONN_ID_STATUS (1U << 16) -#define DWC_OTG_MSK_GOTGCTL_SESS_REQ (1U << 1) -#define DWC_OTG_MSK_GOTGCTL_SESS_VALID (1U << 0) - -#define DWC_OTG_REG_GOTGINT 0x0004 -#define DWC_OTG_REG_GAHBCFG 0x0008 -#define DWC_OTG_MSK_GAHBCFG_GLOBAL_IRQ (1U << 0) - -#define DWC_OTG_REG_GUSBCFG 0x000C *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 16:45:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92DCA1065670; Thu, 30 Aug 2012 16:45:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C17A8FC15; Thu, 30 Aug 2012 16:45:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UGjSn3077653; Thu, 30 Aug 2012 16:45:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UGjSok077650; Thu, 30 Aug 2012 16:45:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208301645.q7UGjSok077650@svn.freebsd.org> From: Ed Schouten Date: Thu, 30 Aug 2012 16:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239910 - head/usr.sbin/ac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 16:45:28 -0000 Author: ed Date: Thu Aug 30 16:45:27 2012 New Revision: 239910 URL: http://svn.freebsd.org/changeset/base/239910 Log: Massively refactor ac(8). - Use queue(3) -- not some homegrown implementation of linked lists. - Rename structures to _entry, as they are entries in the linked list -- not the lists themselves. - Don't store entire copies of struct utmpx in utmpx_entry, but only the members we're interested in. Large fields such as hostnames are not needed during the execution of the program. - Give structure members useful names, instead of `name'. - While there, use struct timevals instead of time_t's internally. This is not strictly useful, but while we're at it... - Mark stuff static. - Add missing const keywords. - Remove unneeded prototypes. - Remove workaround for sparc64-specific utmp problems. These don't apply to utmpx. - Don't discard entries when timestamps are not monotone. This shouldn't ever happen with utmpx, but discarding them is a bit too harsh. - Remove debug code. We nowadays have `getent utmpx', which can be used to analyze logfiles in depth. - Use proper uppercasing/periods in comments. - Print output of `ac -p' sorted alphabetically, instead of first occurrence. - Properly check against pts/* instead of tty[PQRSpqrs]* to determine whether a TTY is a pseudo-terminal. MFC after: 1 month Modified: head/usr.sbin/ac/Makefile head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/Makefile ============================================================================== --- head/usr.sbin/ac/Makefile Thu Aug 30 16:19:05 2012 (r239909) +++ head/usr.sbin/ac/Makefile Thu Aug 30 16:45:27 2012 (r239910) @@ -3,11 +3,6 @@ PROG= ac MAN= ac.8 -# Temporary, while tracking down problem wrt 64-bit time_t's on sparc64 -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+=-DDEBUG -.endif - # If "CONSOLE_TTY" is not defined, this program is compatible with the # traditional implementation (using SunOS 4.x as the sample traditional # implementation). This is the default. Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Thu Aug 30 16:19:05 2012 (r239909) +++ head/usr.sbin/ac/ac.c Thu Aug 30 16:45:27 2012 (r239910) @@ -16,8 +16,9 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include + #include #include #include @@ -32,43 +33,47 @@ __FBSDID("$FreeBSD$"); /* * this is for our list of currently logged in sessions */ -struct utmp_list { - struct utmp_list *next; - struct utmpx usr; +struct utmpx_entry { + SLIST_ENTRY(utmpx_entry) next; + char user[sizeof(((struct utmpx *)0)->ut_user)]; + char id[sizeof(((struct utmpx *)0)->ut_id)]; +#ifdef CONSOLE_TTY + char line[sizeof(((struct utmpx *)0)->ut_line)]; +#endif + struct timeval time; }; /* * this is for our list of users that are accumulating time. */ -struct user_list { - struct user_list *next; - char name[sizeof(((struct utmpx *)0)->ut_user)]; - time_t secs; +struct user_entry { + SLIST_ENTRY(user_entry) next; + char user[sizeof(((struct utmpx *)0)->ut_user)]; + struct timeval time; }; /* * this is for chosing whether to ignore a login */ -struct tty_list { - struct tty_list *next; - char name[sizeof(((struct utmpx *)0)->ut_host) + 2]; - size_t len; - int ret; +struct tty_entry { + SLIST_ENTRY(tty_entry) next; + char line[sizeof(((struct utmpx *)0)->ut_line) + 2]; + size_t len; + int ret; }; /* * globals - yes yuk */ #ifdef CONSOLE_TTY -static char *Console = CONSOLE_TTY; +static const char *Console = CONSOLE_TTY; #endif -static time_t Total = 0; -static time_t FirstTime = 0; +static struct timeval Total = { 0, 0 }; +static struct timeval FirstTime = { 0, 0 }; static int Flags = 0; -static struct user_list *Users = NULL; -static struct tty_list *Ttys = NULL; - -#define NEW(type) (type *)malloc(sizeof (type)) +static SLIST_HEAD(, utmpx_entry) CurUtmpx = SLIST_HEAD_INITIALIZER(CurUtmpx); +static SLIST_HEAD(, user_entry) Users = SLIST_HEAD_INITIALIZER(Users); +static SLIST_HEAD(, tty_entry) Ttys = SLIST_HEAD_INITIALIZER(Ttys); #define AC_W 1 /* not _PATH_WTMP */ #define AC_D 2 /* daily totals (ignore -p) */ @@ -76,182 +81,112 @@ static struct tty_list *Ttys = NULL; #define AC_U 8 /* specified users only */ #define AC_T 16 /* specified ttys only */ -#ifdef DEBUG -static int Debug = 0; -#endif - -int main(int, char **); -int ac(const char *); -struct tty_list *add_tty(char *); -#ifdef DEBUG -const char *debug_pfx(const struct utmpx *, const struct utmpx *); -#endif -int do_tty(char *); -struct utmp_list *log_in(struct utmp_list *, struct utmpx *); -struct utmp_list *log_out(struct utmp_list *, struct utmpx *); -int on_console(struct utmp_list *); -void show(const char *, time_t); -void show_today(struct user_list *, struct utmp_list *, - time_t); -void show_users(struct user_list *); -struct user_list *update_user(struct user_list *, char *, time_t); -void usage(void); +static void ac(const char *); +static void usage(void); -struct tty_list * -add_tty(char *name) +static void +add_tty(const char *line) { - struct tty_list *tp; + struct tty_entry *tp; char *rcp; Flags |= AC_T; - if ((tp = NEW(struct tty_list)) == NULL) + if ((tp = malloc(sizeof(*tp))) == NULL) errx(1, "malloc failed"); tp->len = 0; /* full match */ tp->ret = 1; /* do if match */ - if (*name == '!') { /* don't do if match */ + if (*line == '!') { /* don't do if match */ tp->ret = 0; - name++; + line++; } - strlcpy(tp->name, name, sizeof (tp->name)); - if ((rcp = strchr(tp->name, '*')) != NULL) { /* wild card */ + strlcpy(tp->line, line, sizeof(tp->line)); + /* Wildcard. */ + if ((rcp = strchr(tp->line, '*')) != NULL) { *rcp = '\0'; - tp->len = strlen(tp->name); /* match len bytes only */ + /* Match len bytes only. */ + tp->len = strlen(tp->line); } - tp->next = Ttys; - Ttys = tp; - return Ttys; + SLIST_INSERT_HEAD(&Ttys, tp, next); } /* * should we process the named tty? */ -int -do_tty(char *name) +static int +do_tty(const char *line) { - struct tty_list *tp; + struct tty_entry *tp; int def_ret = 0; - for (tp = Ttys; tp != NULL; tp = tp->next) { + SLIST_FOREACH(tp, &Ttys, next) { if (tp->ret == 0) /* specific don't */ def_ret = 1; /* default do */ if (tp->len != 0) { - if (strncmp(name, tp->name, tp->len) == 0) + if (strncmp(line, tp->line, tp->len) == 0) return tp->ret; } else { - if (strncmp(name, tp->name, sizeof (tp->name)) == 0) + if (strncmp(line, tp->line, sizeof(tp->line)) == 0) return tp->ret; } } - return def_ret; + return (def_ret); } #ifdef CONSOLE_TTY /* * is someone logged in on Console? */ -int -on_console(struct utmp_list *head) +static int +on_console(void) { - struct utmp_list *up; + struct utmpx_entry *up; - for (up = head; up; up = up->next) { - if (strcmp(up->usr.ut_line, Console) == 0) - return 1; - } - return 0; + SLIST_FOREACH(up, &CurUtmpx, next) + if (strcmp(up->line, Console) == 0) + return (1); + return (0); } #endif /* - * update user's login time + * Update user's login time. + * If no entry for this user is found, a new entry is inserted into the + * list alphabetically. */ -struct user_list * -update_user(struct user_list *head, char *name, time_t secs) +static void +update_user(const char *user, struct timeval secs) { - struct user_list *up; + struct user_entry *up, *aup; + int c; - for (up = head; up != NULL; up = up->next) { - if (strcmp(up->name, name) == 0) { - up->secs += secs; - Total += secs; - return head; - } + aup = NULL; + SLIST_FOREACH(up, &Users, next) { + c = strcmp(up->user, user); + if (c == 0) { + timeradd(&up->time, &secs, &up->time); + timeradd(&Total, &secs, &Total); + return; + } else if (c > 0) + break; + aup = up; } /* * not found so add new user unless specified users only */ if (Flags & AC_U) - return head; + return; - if ((up = NEW(struct user_list)) == NULL) + if ((up = malloc(sizeof(*up))) == NULL) errx(1, "malloc failed"); - up->next = head; - strlcpy(up->name, name, sizeof (up->name)); - up->secs = secs; - Total += secs; - return up; -} - -#ifdef DEBUG -/* - * Create a string which is the standard prefix for a debug line. It - * includes a timestamp (perhaps with year), device-name, and user-name. - */ -const char * -debug_pfx(const struct utmpx *event_up, const struct utmpx *userinf_up) -{ - static char str_result[40 + sizeof(userinf_up->ut_line) + - sizeof(userinf_up->ut_user)]; - static char thisyear[5]; - size_t maxcopy; - time_t ut_timecopy; - - if (thisyear[0] == '\0') { - /* Figure out what "this year" is. */ - time(&ut_timecopy); - strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); - strlcpy(thisyear, &str_result[20], sizeof(thisyear)); - } - - if (event_up->ut_tv.tv_sec == 0) - strlcpy(str_result, "*ZeroTime* --:--:-- ", sizeof(str_result)); - else { - ut_timecopy = event_up->ut_tv.tv_sec; - strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); - /* - * Include the year, if it is not the same year as "now". - */ - if (strncmp(&str_result[20], thisyear, 4) == 0) - str_result[20] = '\0'; - else { - str_result[24] = ' '; /* Replace a '\n' */ - str_result[25] = '\0'; - } - } - - if (userinf_up->ut_line[0] == '\0') - strlcat(str_result, "NoDev", sizeof(str_result)); - else { - maxcopy = strlen(str_result) + sizeof(userinf_up->ut_line); - if (maxcopy > sizeof(str_result)) - maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_line, maxcopy); - } - strlcat(str_result, ": ", sizeof(str_result)); - - if (userinf_up->ut_user[0] == '\0') - strlcat(str_result, "LogOff", sizeof(str_result)); - else { - maxcopy = strlen(str_result) + sizeof(userinf_up->ut_user); - if (maxcopy > sizeof(str_result)) - maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_user, maxcopy); - } - - return (str_result); + if (aup == NULL) + SLIST_INSERT_HEAD(&Users, up, next); + else + SLIST_INSERT_AFTER(aup, up, next); + strlcpy(up->user, user, sizeof(up->user)); + up->time = secs; + timeradd(&Total, &secs, &Total); } -#endif int main(int argc, char *argv[]) @@ -261,13 +196,8 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); - while ((c = getopt(argc, argv, "Dc:dpt:w:")) != -1) { + while ((c = getopt(argc, argv, "c:dpt:w:")) != -1) { switch (c) { -#ifdef DEBUG - case 'D': - Debug++; - break; -#endif case 'c': #ifdef CONSOLE_TTY Console = optarg; @@ -299,7 +229,7 @@ main(int argc, char *argv[]) * initialize user list */ for (; optind < argc; optind++) { - Users = update_user(Users, argv[optind], (time_t)0); + update_user(argv[optind], (struct timeval){ 0, 0 }); } Flags |= AC_U; /* freeze user list */ } @@ -307,112 +237,108 @@ main(int argc, char *argv[]) Flags &= ~AC_P; ac(wtmpf); - return 0; + return (0); } /* * print login time in decimal hours */ -void -show(const char *name, time_t secs) +static void +show(const char *user, struct timeval secs) { (void)printf("\t%-*s %8.2f\n", - (int)sizeof(((struct utmpx *)0)->ut_user), name, - ((double)secs / 3600)); + (int)sizeof(((struct user_entry *)0)->user), user, + (double)secs.tv_sec / 3600); } -void -show_users(struct user_list *list) +static void +show_users(void) { - struct user_list *lp; + struct user_entry *lp; - for (lp = list; lp; lp = lp->next) - show(lp->name, lp->secs); + SLIST_FOREACH(lp, &Users, next) + show(lp->user, lp->time); } /* * print total login time for 24hr period in decimal hours */ -void -show_today(struct user_list *users, struct utmp_list *logins, time_t secs) +static void +show_today(struct timeval today) { - struct user_list *up; - struct utmp_list *lp; + struct user_entry *up; + struct utmpx_entry *lp; char date[64]; - time_t yesterday = secs - 1; + struct timeval usec = { 0, 1 }; + struct timeval yesterday; static int d_first = -1; if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); - (void)strftime(date, sizeof (date), + timersub(&today, &usec, &yesterday); + (void)strftime(date, sizeof(date), d_first ? "%e %b total" : "%b %e total", - localtime(&yesterday)); + localtime(&yesterday.tv_sec)); /* restore the missing second */ - yesterday++; + timeradd(&today, &usec, &yesterday); - for (lp = logins; lp != NULL; lp = lp->next) { - secs = yesterday - lp->usr.ut_tv.tv_sec; - Users = update_user(Users, lp->usr.ut_user, secs); - lp->usr.ut_tv.tv_sec = yesterday; /* as if they just logged in */ + SLIST_FOREACH(lp, &CurUtmpx, next) { + timersub(&yesterday, &lp->time, &today); + update_user(lp->user, today); + /* As if they just logged in. */ + lp->time = yesterday; } - secs = 0; - for (up = users; up != NULL; up = up->next) { - secs += up->secs; - up->secs = 0; /* for next day */ + timerclear(&today); + SLIST_FOREACH(up, &Users, next) { + timeradd(&today, &up->time, &today); + /* For next day. */ + timerclear(&up->time); } - if (secs) - (void)printf("%s %11.2f\n", date, ((double)secs / 3600)); + if (timerisset(&today)) + (void)printf("%s %11.2f\n", date, (double)today.tv_sec / 3600); } /* - * log a user out and update their times. - * if ut_line is "~", we log all users out as the system has - * been shut down. + * Log a user out and update their times. + * If ut_type is BOOT_TIME or SHUTDOWN_TIME, we log all users out as the + * system has been shut down. */ -struct utmp_list * -log_out(struct utmp_list *head, struct utmpx *up) +static void +log_out(const struct utmpx *up) { - struct utmp_list *lp, *lp2, *tlp; - time_t secs; + struct utmpx_entry *lp, *lp2, *tlp; + struct timeval secs; - for (lp = head, lp2 = NULL; lp != NULL; ) + for (lp = SLIST_FIRST(&CurUtmpx), lp2 = NULL; lp != NULL;) if (up->ut_type == BOOT_TIME || up->ut_type == SHUTDOWN_TIME || (up->ut_type == DEAD_PROCESS && - memcmp(lp->usr.ut_id, up->ut_id, sizeof up->ut_id) == 0)) { - secs = up->ut_tv.tv_sec - lp->usr.ut_tv.tv_sec; - Users = update_user(Users, lp->usr.ut_user, secs); -#ifdef DEBUG - if (Debug) - printf("%s logged out (%2d:%02d:%02d)\n", - debug_pfx(up, &lp->usr), (int)(secs / 3600), - (int)((secs % 3600) / 60), - (int)(secs % 60)); -#endif + memcmp(lp->id, up->ut_id, sizeof(up->ut_id)) == 0)) { + timersub(&up->ut_tv, &lp->time, &secs); + update_user(lp->user, secs); /* * now lose it */ tlp = lp; - lp = lp->next; - if (tlp == head) - head = lp; - else if (lp2 != NULL) - lp2->next = lp; + lp = SLIST_NEXT(lp, next); + if (lp2 == NULL) + SLIST_REMOVE_HEAD(&CurUtmpx, next); + else + SLIST_REMOVE_AFTER(lp2, next); free(tlp); } else { lp2 = lp; - lp = lp->next; + lp = SLIST_NEXT(lp, next); } - return head; } /* * if do_tty says ok, login a user */ -struct utmp_list * -log_in(struct utmp_list *head, struct utmpx *up) +static void +log_in(struct utmpx *up) { - struct utmp_list *lp; + struct utmpx_entry *lp; /* * this could be a login. if we're not dealing with @@ -431,198 +357,150 @@ log_in(struct utmp_list *head, struct ut * SunOS 4.0.2 does not treat ":0.0" as special but we * do. */ - if (on_console(head)) - return head; + if (on_console()) + return; /* * ok, no recorded login, so they were here when wtmp * started! Adjust ut_time! */ - up->ut_time = FirstTime; + up->ut_tv = FirstTime; /* * this allows us to pick the right logout */ - strlcpy(up->ut_line, Console, sizeof (up->ut_line)); + strlcpy(up->ut_line, Console, sizeof(up->ut_line)); } #endif /* * If we are doing specified ttys only, we ignore * anything else. */ - if (Flags & AC_T) - if (!do_tty(up->ut_line)) - return head; + if (Flags & AC_T && !do_tty(up->ut_line)) + return; /* * go ahead and log them in */ - if ((lp = NEW(struct utmp_list)) == NULL) + if ((lp = malloc(sizeof(*lp))) == NULL) errx(1, "malloc failed"); - lp->next = head; - head = lp; - memmove(&lp->usr, up, sizeof *up); -#ifdef DEBUG - if (Debug) { - printf("%s logged in", debug_pfx(&lp->usr, up)); - if (*up->ut_host) - printf(" (%-.*s)", (int)sizeof(up->ut_host), - up->ut_host); - putchar('\n'); - } + SLIST_INSERT_HEAD(&CurUtmpx, lp, next); + strlcpy(lp->user, up->ut_user, sizeof(lp->user)); + memcpy(lp->id, up->ut_id, sizeof(lp->id)); +#ifdef CONSOLE_TTY + memcpy(lp->line, up->ut_line, sizeof(lp->line)); #endif - return head; + lp->time = up->ut_tv; } -int +static void ac(const char *file) { - struct utmp_list *lp, *head = NULL; + struct utmpx_entry *lp; struct utmpx *usr, usht; struct tm *ltm; - time_t prev_secs, secs, ut_timecopy; - int day, rfound, tchanged, tskipped; + struct timeval prev_secs, ut_timecopy, secs, clock_shift, now; + int day, rfound; day = -1; - prev_secs = 1; /* Minimum acceptable date == 1970 */ - rfound = tchanged = tskipped = 0; - secs = 0; + timerclear(&prev_secs); /* Minimum acceptable date == 1970. */ + timerclear(&secs); + timerclear(&clock_shift); + rfound = 0; if (setutxdb(UTXDB_LOG, file) != 0) err(1, "%s", file); while ((usr = getutxent()) != NULL) { rfound++; - ut_timecopy = usr->ut_tv.tv_sec; - /* - * With sparc64 using 64-bit time_t's, there is some system - * routine which sets ut_time==0 (the high-order word of a - * 64-bit time) instead of a 32-bit time value. For those - * wtmp files, it is "more-accurate" to substitute the most- - * recent time found, instead of throwing away the entire - * record. While it is still just a guess, it is a better - * guess than throwing away a log-off record and therefore - * counting a session as if it continued to the end of the - * month, or the next system-reboot. - */ - if (ut_timecopy == 0 && prev_secs > 1) { -#ifdef DEBUG - if (Debug) - printf("%s - date changed to: %s", - debug_pfx(usr, usr), ctime(&prev_secs)); -#endif - tchanged++; - usr->ut_tv.tv_sec = ut_timecopy = prev_secs; - } - /* - * Skip records where the time goes backwards. - */ - if (ut_timecopy < prev_secs) { -#ifdef DEBUG - if (Debug) - printf("%s - bad date, record skipped\n", - debug_pfx(usr, usr)); -#endif - tskipped++; - continue; /* Skip this invalid record. */ - } + ut_timecopy = usr->ut_tv; + /* Don't let the time run backwards. */ + if (timercmp(&ut_timecopy, &prev_secs, <)) + ut_timecopy = prev_secs; prev_secs = ut_timecopy; - if (!FirstTime) + if (!timerisset(&FirstTime)) FirstTime = ut_timecopy; if (Flags & AC_D) { - ltm = localtime(&ut_timecopy); + ltm = localtime(&ut_timecopy.tv_sec); if (day >= 0 && day != ltm->tm_yday) { day = ltm->tm_yday; /* * print yesterday's total */ secs = ut_timecopy; - secs -= ltm->tm_sec; - secs -= 60 * ltm->tm_min; - secs -= 3600 * ltm->tm_hour; - show_today(Users, head, secs); + secs.tv_sec -= ltm->tm_sec; + secs.tv_sec -= 60 * ltm->tm_min; + secs.tv_sec -= 3600 * ltm->tm_hour; + secs.tv_usec = 0; + show_today(secs); } else day = ltm->tm_yday; } switch(usr->ut_type) { case OLD_TIME: - secs = ut_timecopy; + clock_shift = ut_timecopy; break; case NEW_TIME: - secs -= ut_timecopy; + timersub(&clock_shift, &ut_timecopy, &clock_shift); /* * adjust time for those logged in */ - for (lp = head; lp != NULL; lp = lp->next) - lp->usr.ut_tv.tv_sec -= secs; + SLIST_FOREACH(lp, &CurUtmpx, next) + timersub(&lp->time, &clock_shift, &lp->time); break; case BOOT_TIME: case SHUTDOWN_TIME: - head = log_out(head, usr); + log_out(usr); FirstTime = ut_timecopy; /* shouldn't be needed */ break; case USER_PROCESS: /* - * if they came in on tty[p-sP-S]*, then it is only - * a login session if the ut_host field is non-empty + * If they came in on pts/..., then it is only + * a login session if the ut_host field is non-empty. */ - if (strncmp(usr->ut_line, "tty", 3) != 0 || - strchr("pqrsPQRS", usr->ut_line[3]) == NULL || + if (strncmp(usr->ut_line, "pts/", 4) != 0 || *usr->ut_host != '\0') - head = log_in(head, usr); -#ifdef DEBUG - else if (Debug > 1) - /* Things such as 'screen' sessions. */ - printf("%s - record ignored\n", - debug_pfx(usr, usr)); -#endif + log_in(usr); break; case DEAD_PROCESS: - head = log_out(head, usr); + log_out(usr); break; } } endutxent(); - if (!(Flags & AC_W)) - usht.ut_tv.tv_sec = time(NULL); + (void)gettimeofday(&now, NULL); + if (Flags & AC_W) + usht.ut_tv = ut_timecopy; else - usht.ut_tv.tv_sec = ut_timecopy; + usht.ut_tv = now; usht.ut_type = SHUTDOWN_TIME; if (Flags & AC_D) { - ltm = localtime(&ut_timecopy); + ltm = localtime(&ut_timecopy.tv_sec); if (day >= 0 && day != ltm->tm_yday) { /* * print yesterday's total */ secs = ut_timecopy; - secs -= ltm->tm_sec; - secs -= 60 * ltm->tm_min; - secs -= 3600 * ltm->tm_hour; - show_today(Users, head, secs); + secs.tv_sec -= ltm->tm_sec; + secs.tv_sec -= 60 * ltm->tm_min; + secs.tv_sec -= 3600 * ltm->tm_hour; + secs.tv_usec = 0; + show_today(secs); } } /* * anyone still logged in gets time up to now */ - head = log_out(head, &usht); + log_out(&usht); if (Flags & AC_D) - show_today(Users, head, time((time_t *)0)); + show_today(now); else { if (Flags & AC_P) - show_users(Users); + show_users(); show("total", Total); } - - if (tskipped > 0) - printf("(Skipped %d of %d records due to invalid time values)\n", - tskipped, rfound); - if (tchanged > 0) - printf("(Changed %d of %d records to have a more likely time value)\n", - tchanged, rfound); - - return 0; } -void +static void usage(void) { (void)fprintf(stderr, From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 17:35:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B6D8106566B; Thu, 30 Aug 2012 17:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD1EE8FC1C; Thu, 30 Aug 2012 17:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UHZCC7084897; Thu, 30 Aug 2012 17:35:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHZCMM084895; Thu, 30 Aug 2012 17:35:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208301735.q7UHZCMM084895@svn.freebsd.org> From: Adrian Chadd Date: Thu, 30 Aug 2012 17:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239911 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 17:35:13 -0000 Author: adrian Date: Thu Aug 30 17:35:12 2012 New Revision: 239911 URL: http://svn.freebsd.org/changeset/base/239911 Log: The DIR-825 cal data is in an odd spot. I don't know why it's here. (This works on my board because I wrote new caldata into this spot; but this obviously won't work for stock DIR-825 units out there.) Modified: head/sys/mips/conf/DIR-825.hints Modified: head/sys/mips/conf/DIR-825.hints ============================================================================== --- head/sys/mips/conf/DIR-825.hints Thu Aug 30 16:45:27 2012 (r239910) +++ head/sys/mips/conf/DIR-825.hints Thu Aug 30 17:35:12 2012 (r239911) @@ -31,6 +31,9 @@ hint.ath.1.eeprom_firmware="pcib.0.bus.0 # Geom MAP +# The DIR-825 has an 8MB flash part - HOWEVER, the 64k caldata isn't +# at the end of the flash. It's ~ 6MB into the flash image. + # mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) hint.map.0.at="flash/spi0" @@ -55,13 +58,13 @@ hint.map.2.readonly=1 hint.map.3.at="flash/spi0" hint.map.3.start=0x00150000 -hint.map.3.end=0x007f0000 +hint.map.3.end=0x00660000 hint.map.3.name="rootfs" hint.map.3.readonly=0 hint.map.4.at="flash/spi0" -hint.map.4.start=0x007f0000 -hint.map.4.end=0x00800000 +hint.map.4.start=0x00660000 +hint.map.4.end=0x00670000 hint.map.4.name="art" hint.map.4.readonly=1 From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 17:37:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5471065694; Thu, 30 Aug 2012 17:37:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 348978FC29; Thu, 30 Aug 2012 17:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UHb2hU085140; Thu, 30 Aug 2012 17:37:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHb1H5085136; Thu, 30 Aug 2012 17:37:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301737.q7UHb1H5085136@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 17:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239912 - head/sys/dev/amr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 17:37:02 -0000 Author: jhb Date: Thu Aug 30 17:37:01 2012 New Revision: 239912 URL: http://svn.freebsd.org/changeset/base/239912 Log: Use callout(9) rather than timeout(9). Note that the periodic timer in amr(4) is never started, so this should be even more of a NOP than normal. Modified: head/sys/dev/amr/amr.c head/sys/dev/amr/amr_pci.c head/sys/dev/amr/amrvar.h Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amr.c Thu Aug 30 17:37:01 2012 (r239912) @@ -351,7 +351,7 @@ amr_startup(void *arg) /* * Start the timeout routine. */ -/* sc->amr_timeout = timeout(amr_periodic, sc, hz);*/ +/* callout_reset(&sc->amr_timeout, hz, amr_periodic, sc);*/ return; } @@ -392,7 +392,7 @@ amr_free(struct amr_softc *sc) device_delete_child(sc->amr_dev, sc->amr_pass); /* cancel status timeout */ - untimeout(amr_periodic, sc, sc->amr_timeout); + callout_drain(&sc->amr_timeout); /* throw away any command buffers */ while ((acc = TAILQ_FIRST(&sc->amr_cmd_clusters)) != NULL) { @@ -979,7 +979,7 @@ amr_periodic(void *data) amr_done(sc); /* reschedule */ - sc->amr_timeout = timeout(amr_periodic, sc, hz); + callout_reset(&sc->amr_timeout, hz, amr_periodic, sc); } /******************************************************************************** Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amr_pci.c Thu Aug 30 17:37:01 2012 (r239912) @@ -331,6 +331,7 @@ amr_pci_attach(device_t dev) */ mtx_init(&sc->amr_list_lock, "AMR List Lock", NULL, MTX_DEF); mtx_init(&sc->amr_hw_lock, "AMR HW Lock", NULL, MTX_DEF); + callout_init(&sc->amr_timeout, CALLOUT_MPSAFE); if ((error = amr_setup_mbox(sc)) != 0) goto out; Modified: head/sys/dev/amr/amrvar.h ============================================================================== --- head/sys/dev/amr/amrvar.h Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amrvar.h Thu Aug 30 17:37:01 2012 (r239912) @@ -256,7 +256,7 @@ struct amr_softc device_t amr_pass; int (*amr_cam_command)(struct amr_softc *sc, struct amr_command **acp); struct intr_config_hook amr_ich; /* wait-for-interrupts probe hook */ - struct callout_handle amr_timeout; /* periodic status check */ + struct callout amr_timeout; /* periodic status check */ int amr_allow_vol_config; int amr_linux_no_adapters; int amr_ld_del_supported; From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 17:47:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F6141065670; Thu, 30 Aug 2012 17:47:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855408FC14; Thu, 30 Aug 2012 17:47:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UHleF5086455; Thu, 30 Aug 2012 17:47:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHle21086453; Thu, 30 Aug 2012 17:47:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301747.q7UHle21086453@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 17:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239913 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 17:47:40 -0000 Author: jhb Date: Thu Aug 30 17:47:39 2012 New Revision: 239913 URL: http://svn.freebsd.org/changeset/base/239913 Log: Attach interrupt handlers during attach instead of during the first time the interface is brought up. Without this, the boot time interrupt round-robin assignment does not think the allocated interrupt resources are active and leaves them assigned to CPU 0. While here, add descriptive tags to each interrupt handler when MSI-X is used. Reviewed by: np MFC after: 1 week Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Aug 30 17:37:01 2012 (r239912) +++ head/sys/dev/cxgb/cxgb_main.c Thu Aug 30 17:47:39 2012 (r239913) @@ -675,6 +675,9 @@ cxgb_controller_attach(device_t dev) for (i = 0; i < NUM_CPL_HANDLERS; i++) sc->cpl_handler[i] = cpl_not_handled; #endif + + t3_intr_clear(sc); + error = cxgb_setup_interrupts(sc); out: if (error) cxgb_free(sc); @@ -922,6 +925,7 @@ cxgb_setup_interrupts(adapter_t *sc) if (!(intr_flag & USING_MSIX) || err) return (err); + bus_describe_intr(sc->dev, sc->irq_res, sc->intr_tag, "err"); for (i = 0; i < sc->msi_count - 1; i++) { rid = i + 2; res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, @@ -945,6 +949,7 @@ cxgb_setup_interrupts(adapter_t *sc) sc->msix_irq_rid[i] = rid; sc->msix_irq_res[i] = res; sc->msix_intr_tag[i] = tag; + bus_describe_intr(sc->dev, res, tag, "qs%d", i); } if (err) @@ -1611,11 +1616,6 @@ cxgb_up(struct adapter *sc) alloc_filters(sc); setup_rss(sc); - t3_intr_clear(sc); - err = cxgb_setup_interrupts(sc); - if (err) - goto out; - t3_add_configured_sysctls(sc); sc->flags |= FULL_INIT_DONE; } From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 18:03:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E64B1106566C; Thu, 30 Aug 2012 18:03:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C73FD8FC12; Thu, 30 Aug 2012 18:03:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UI33je088314; Thu, 30 Aug 2012 18:03:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UI33pc088309; Thu, 30 Aug 2012 18:03:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301803.q7UI33pc088309@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 18:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239914 - in stable/9/sys: amd64/amd64 amd64/include i386/include i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 18:03:04 -0000 Author: jhb Date: Thu Aug 30 18:03:03 2012 New Revision: 239914 URL: http://svn.freebsd.org/changeset/base/239914 Log: MFC 238311: Add a clts() wrapper around the 'clts' instruction to on x86 and use that to implement stop_emulating() in the fpu/npx code. Reimplement start_emulating() in the non-XEN case by using load_cr0() and rcr0() instead of the 'lmsw' and 'smsw' instructions. Intel explicitly discourages the use of 'lmsw' and 'smsw' on 80386 and later processors in the description of these instructions in Volume 2 of the ADM. Modified: stable/9/sys/amd64/amd64/fpu.c stable/9/sys/amd64/include/cpufunc.h stable/9/sys/i386/include/cpufunc.h stable/9/sys/i386/isa/npx.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Thu Aug 30 17:47:39 2012 (r239913) +++ stable/9/sys/amd64/amd64/fpu.c Thu Aug 30 18:03:03 2012 (r239914) @@ -73,10 +73,6 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) -#define start_emulating() __asm __volatile( \ - "smsw %%ax; orb %0,%%al; lmsw %%ax" \ - : : "n" (CR0_TS) : "ax") -#define stop_emulating() __asm __volatile("clts") static __inline void xrstor(char *addr, uint64_t mask) @@ -109,13 +105,14 @@ void fnstsw(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); -void start_emulating(void); -void stop_emulating(void); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && !lint */ +#define start_emulating() load_cr0(rcr0() | CR0_TS) +#define stop_emulating() clts() + #define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) #define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) Modified: stable/9/sys/amd64/include/cpufunc.h ============================================================================== --- stable/9/sys/amd64/include/cpufunc.h Thu Aug 30 17:47:39 2012 (r239913) +++ stable/9/sys/amd64/include/cpufunc.h Thu Aug 30 18:03:03 2012 (r239914) @@ -107,6 +107,13 @@ clflush(u_long addr) } static __inline void +clts(void) +{ + + __asm __volatile("clts"); +} + +static __inline void disable_intr(void) { __asm __volatile("cli" : : : "memory"); @@ -700,6 +707,9 @@ intr_restore(register_t rflags) int breakpoint(void); u_int bsfl(u_int mask); u_int bsrl(u_int mask); +void clflush(u_long addr); +void clts(void); +void cpuid_count(u_int ax, u_int cx, u_int *p); void disable_intr(void); void do_cpuid(u_int ax, u_int *p); void enable_intr(void); Modified: stable/9/sys/i386/include/cpufunc.h ============================================================================== --- stable/9/sys/i386/include/cpufunc.h Thu Aug 30 17:47:39 2012 (r239913) +++ stable/9/sys/i386/include/cpufunc.h Thu Aug 30 18:03:03 2012 (r239914) @@ -97,6 +97,13 @@ clflush(u_long addr) } static __inline void +clts(void) +{ + + __asm __volatile("clts"); +} + +static __inline void disable_intr(void) { #ifdef XEN @@ -695,6 +702,9 @@ intr_restore(register_t eflags) int breakpoint(void); u_int bsfl(u_int mask); u_int bsrl(u_int mask); +void clflush(u_long addr); +void clts(void); +void cpuid_count(u_int ax, u_int cx, u_int *p); void disable_intr(void); void do_cpuid(u_int ax, u_int *p); void enable_intr(void); Modified: stable/9/sys/i386/isa/npx.c ============================================================================== --- stable/9/sys/i386/isa/npx.c Thu Aug 30 17:47:39 2012 (r239913) +++ stable/9/sys/i386/isa/npx.c Thu Aug 30 18:03:03 2012 (r239914) @@ -100,15 +100,6 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #endif -#ifdef XEN -#define start_emulating() (HYPERVISOR_fpu_taskswitch(1)) -#define stop_emulating() (HYPERVISOR_fpu_taskswitch(0)) -#else -#define start_emulating() __asm __volatile( \ - "smsw %%ax; orb %0,%%al; lmsw %%ax" \ - : : "n" (CR0_TS) : "ax") -#define stop_emulating() __asm __volatile("clts") -#endif #else /* !(__GNUCLIKE_ASM && !lint) */ void fldcw(u_short cw); @@ -123,11 +114,17 @@ void frstor(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); #endif -void start_emulating(void); -void stop_emulating(void); #endif /* __GNUCLIKE_ASM && !lint */ +#ifdef XEN +#define start_emulating() (HYPERVISOR_fpu_taskswitch(1)) +#define stop_emulating() (HYPERVISOR_fpu_taskswitch(0)) +#else +#define start_emulating() load_cr0(rcr0() | CR0_TS) +#define stop_emulating() clts() +#endif + #ifdef CPU_ENABLE_SSE #define GET_FPU_CW(thread) \ (cpu_fxsr ? \ From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 18:29:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CFF2106566B; Thu, 30 Aug 2012 18:29:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4708F8FC12; Thu, 30 Aug 2012 18:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UITo4R091818; Thu, 30 Aug 2012 18:29:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UIToR1091816; Thu, 30 Aug 2012 18:29:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301829.q7UIToR1091816@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 18:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239915 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 18:29:50 -0000 Author: jhb Date: Thu Aug 30 18:29:49 2012 New Revision: 239915 URL: http://svn.freebsd.org/changeset/base/239915 Log: MFC 238424: Make the interval timings for EVFILT_TIMER more accurate. tvtohz() always adds an extra tick to account for the current partial clock tick. However, that is not appropriate for a repeating timer when the exact tvtohz() value should be used for subsequent intervals. Fix repeating callouts for EVFILT_TIMER by subtracting 1 tick from the tvtohz() result similar to the fix used in realitexpire() for interval timers. While here, update a few comments to note that if the EVFILT_TIMER code were to move out of kern_event.c, it should move to kern_time.c (where the interval timer code it mimics lives) rather than kern_timeout.c. Modified: stable/9/sys/kern/kern_event.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/kern/kern_event.c ============================================================================== --- stable/9/sys/kern/kern_event.c Thu Aug 30 18:03:03 2012 (r239914) +++ stable/9/sys/kern/kern_event.c Thu Aug 30 18:29:49 2012 (r239915) @@ -512,6 +512,10 @@ knote_fork(struct knlist *list, int pid) list->kl_unlock(list->kl_lockarg); } +/* + * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the + * interval timer support code. + */ static int timertoticks(intptr_t data) { @@ -525,7 +529,6 @@ timertoticks(intptr_t data) return tticks; } -/* XXX - move to kern_timeout.c? */ static void filt_timerexpire(void *knx) { @@ -535,9 +538,16 @@ filt_timerexpire(void *knx) kn->kn_data++; KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ + /* + * timertoticks() uses tvtohz() which always adds 1 to allow + * for the time until the next clock interrupt being strictly + * less than 1 clock tick. We don't want that here since we + * want to appear to be in sync with the clock interrupt even + * when we're delayed. + */ if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata), + callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata) - 1, filt_timerexpire, kn); } } @@ -545,7 +555,6 @@ filt_timerexpire(void *knx) /* * data contains amount of time to sleep, in milliseconds */ -/* XXX - move to kern_timeout.c? */ static int filt_timerattach(struct knote *kn) { @@ -569,7 +578,6 @@ filt_timerattach(struct knote *kn) return (0); } -/* XXX - move to kern_timeout.c? */ static void filt_timerdetach(struct knote *kn) { @@ -582,7 +590,6 @@ filt_timerdetach(struct knote *kn) kn->kn_status |= KN_DETACHED; /* knlist_remove usually clears it */ } -/* XXX - move to kern_timeout.c? */ static int filt_timer(struct knote *kn, long hint) { From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 18:30:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5AD0106574A; Thu, 30 Aug 2012 18:30:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D02BE8FC1E; Thu, 30 Aug 2012 18:30:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UIU851091902; Thu, 30 Aug 2012 18:30:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UIU8p5091900; Thu, 30 Aug 2012 18:30:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301830.q7UIU8p5091900@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 18:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239916 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 18:30:09 -0000 Author: jhb Date: Thu Aug 30 18:30:08 2012 New Revision: 239916 URL: http://svn.freebsd.org/changeset/base/239916 Log: MFC 238424: Make the interval timings for EVFILT_TIMER more accurate. tvtohz() always adds an extra tick to account for the current partial clock tick. However, that is not appropriate for a repeating timer when the exact tvtohz() value should be used for subsequent intervals. Fix repeating callouts for EVFILT_TIMER by subtracting 1 tick from the tvtohz() result similar to the fix used in realitexpire() for interval timers. While here, update a few comments to note that if the EVFILT_TIMER code were to move out of kern_event.c, it should move to kern_time.c (where the interval timer code it mimics lives) rather than kern_timeout.c. Modified: stable/8/sys/kern/kern_event.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/kern/kern_event.c ============================================================================== --- stable/8/sys/kern/kern_event.c Thu Aug 30 18:29:49 2012 (r239915) +++ stable/8/sys/kern/kern_event.c Thu Aug 30 18:30:08 2012 (r239916) @@ -494,6 +494,10 @@ knote_fork(struct knlist *list, int pid) list->kl_unlock(list->kl_lockarg); } +/* + * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the + * interval timer support code. + */ static int timertoticks(intptr_t data) { @@ -507,7 +511,6 @@ timertoticks(intptr_t data) return tticks; } -/* XXX - move to kern_timeout.c? */ static void filt_timerexpire(void *knx) { @@ -517,9 +520,16 @@ filt_timerexpire(void *knx) kn->kn_data++; KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ + /* + * timertoticks() uses tvtohz() which always adds 1 to allow + * for the time until the next clock interrupt being strictly + * less than 1 clock tick. We don't want that here since we + * want to appear to be in sync with the clock interrupt even + * when we're delayed. + */ if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata), + callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata) - 1, filt_timerexpire, kn); } } @@ -527,7 +537,6 @@ filt_timerexpire(void *knx) /* * data contains amount of time to sleep, in milliseconds */ -/* XXX - move to kern_timeout.c? */ static int filt_timerattach(struct knote *kn) { @@ -551,7 +560,6 @@ filt_timerattach(struct knote *kn) return (0); } -/* XXX - move to kern_timeout.c? */ static void filt_timerdetach(struct knote *kn) { @@ -564,7 +572,6 @@ filt_timerdetach(struct knote *kn) kn->kn_status |= KN_DETACHED; /* knlist_remove usually clears it */ } -/* XXX - move to kern_timeout.c? */ static int filt_timer(struct knote *kn, long hint) { From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 19:46:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD1DB106566B; Thu, 30 Aug 2012 19:46:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEA3A8FC08; Thu, 30 Aug 2012 19:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UJkcb4002367; Thu, 30 Aug 2012 19:46:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UJkchv002365; Thu, 30 Aug 2012 19:46:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301946.q7UJkchv002365@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 19:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239917 - stable/9/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 19:46:39 -0000 Author: jhb Date: Thu Aug 30 19:46:38 2012 New Revision: 239917 URL: http://svn.freebsd.org/changeset/base/239917 Log: MFC 239103: Explicitly enable busmastering on PCI-PCI bridges. Transactions initiated on the secondary side of a bridge will not be propagated to the primary bus unless this is enabled. Busmastering is not enabled by default (we have relied on firmware to set this bit to date). The OS needs to set it for any bridges not configured by system firmware. Modified: stable/9/sys/dev/pci/pci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/pci/pci_pci.c ============================================================================== --- stable/9/sys/dev/pci/pci_pci.c Thu Aug 30 18:30:08 2012 (r239916) +++ stable/9/sys/dev/pci/pci_pci.c Thu Aug 30 19:46:38 2012 (r239917) @@ -683,6 +683,13 @@ pcib_attach_common(device_t dev) * would be more widely routed than absolutely necessary. We could * then do a walk of the tree later and fix it. */ + + /* + * Always enable busmastering on bridges so that transactions + * initiated on the secondary bus are passed through to the + * primary bus. + */ + pci_enable_busmaster(dev); } int From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 19:47:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74AAA1065694; Thu, 30 Aug 2012 19:47:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF498FC08; Thu, 30 Aug 2012 19:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UJlGHZ002491; Thu, 30 Aug 2012 19:47:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UJlGpv002489; Thu, 30 Aug 2012 19:47:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301947.q7UJlGpv002489@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 19:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239918 - stable/8/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 19:47:16 -0000 Author: jhb Date: Thu Aug 30 19:47:15 2012 New Revision: 239918 URL: http://svn.freebsd.org/changeset/base/239918 Log: MFC 239103: Explicitly enable busmastering on PCI-PCI bridges. Transactions initiated on the secondary side of a bridge will not be propagated to the primary bus unless this is enabled. Busmastering is not enabled by default (we have relied on firmware to set this bit to date). The OS needs to set it for any bridges not configured by system firmware. Modified: stable/8/sys/dev/pci/pci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/pci/pci_pci.c ============================================================================== --- stable/8/sys/dev/pci/pci_pci.c Thu Aug 30 19:46:38 2012 (r239917) +++ stable/8/sys/dev/pci/pci_pci.c Thu Aug 30 19:47:15 2012 (r239918) @@ -582,6 +582,13 @@ pcib_attach_common(device_t dev) * would be more widely routed than absolutely necessary. We could * then do a walk of the tree later and fix it. */ + + /* + * Always enable busmastering on bridges so that transactions + * initiated on the secondary bus are passed through to the + * primary bus. + */ + pci_enable_busmaster(dev); } int From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 20:31:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1BC1065673; Thu, 30 Aug 2012 20:31:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2618FC0C; Thu, 30 Aug 2012 20:31:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UKVsL6009417; Thu, 30 Aug 2012 20:31:54 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKVsv5009412; Thu, 30 Aug 2012 20:31:54 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208302031.q7UKVsv5009412@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 30 Aug 2012 20:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239919 - in head/sys: conf dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:31:54 -0000 Author: gonzo Date: Thu Aug 30 20:31:53 2012 New Revision: 239919 URL: http://svn.freebsd.org/changeset/base/239919 Log: Add PrimeCell UART (PL011) driver Obtained from: Semihalf Added: head/sys/dev/uart/uart_dev_pl011.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 30 19:47:15 2012 (r239918) +++ head/sys/conf/files Thu Aug 30 20:31:53 2012 (r239919) @@ -2065,6 +2065,7 @@ dev/uart/uart_bus_scc.c optional uart s dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 +dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 dev/uart/uart_dev_sab82532.c optional uart scc Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Thu Aug 30 19:47:15 2012 (r239918) +++ head/sys/dev/uart/uart.h Thu Aug 30 20:31:53 2012 (r239919) @@ -70,6 +70,7 @@ extern struct uart_class uart_sab82532_c extern struct uart_class uart_sbbc_class __attribute__((weak)); extern struct uart_class uart_z8530_class __attribute__((weak)); extern struct uart_class uart_lpc_class __attribute__((weak)); +extern struct uart_class uart_pl011_class __attribute__((weak)); #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Thu Aug 30 19:47:15 2012 (r239918) +++ head/sys/dev/uart/uart_bus_fdt.c Thu Aug 30 20:31:53 2012 (r239919) @@ -105,6 +105,8 @@ uart_fdt_probe(device_t dev) sc->sc_class = &uart_ns8250_class; else if (ofw_bus_is_compatible(dev, "lpc,uart")) sc->sc_class = &uart_lpc_class; + else if (ofw_bus_is_compatible(dev, "arm,pl011")) + sc->sc_class = &uart_pl011_class; else return (ENXIO); @@ -188,6 +190,8 @@ uart_cpu_getdev(int devtype, struct uart class = &uart_lpc_class; if (fdt_is_compatible(node, "ns16550")) class = &uart_ns8250_class; + if (fdt_is_compatible(node, "arm,pl011")) + class = &uart_pl011_class; di->bas.chan = 0; di->bas.regshft = (u_int)shift; Added: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_pl011.c Thu Aug 30 20:31:53 2012 (r239919) @@ -0,0 +1,436 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include "uart_if.h" + +#include + +/* PL011 UART registers and masks*/ +#define UART_DR 0x00 /* Data register */ +#define DR_FE (1 << 8) /* Framing error */ +#define DR_PE (1 << 9) /* Parity error */ +#define DR_BE (1 << 10) /* Break error */ +#define DR_OE (1 << 11) /* Overrun error */ + +#define UART_FR 0x06 /* Flag register */ +#define FR_RXFF (1 << 6) /* Receive FIFO/reg full */ +#define FR_TXFE (1 << 7) /* Transmit FIFO/reg empty */ + +#define UART_IBRD 0x09 /* Integer baud rate register */ +#define IBRD_BDIVINT 0xffff /* Significant part of int. divisor value */ + +#define UART_FBRD 0x0a /* Fractional baud rate register */ +#define FBRD_BDIVFRAC 0x3f /* Significant part of frac. divisor value */ + +#define UART_LCR_H 0x0b /* Line control register */ +#define LCR_H_WLEN8 (0x3 << 5) +#define LCR_H_WLEN7 (0x2 << 5) +#define LCR_H_WLEN6 (0x1 << 5) +#define LCR_H_FEN (1 << 4) /* FIFO mode enable */ +#define LCR_H_STP2 (1 << 3) /* 2 stop frames at the end */ +#define LCR_H_EPS (1 << 2) /* Even parity select */ +#define LCR_H_PEN (1 << 1) /* Parity enable */ + +#define UART_CR 0x0c /* Control register */ +#define CR_RXE (1 << 9) /* Receive enable */ +#define CR_TXE (1 << 8) /* Transmit enable */ +#define CR_UARTEN (1 << 0) /* UART enable */ + +#define UART_IMSC 0x0e /* Interrupt mask set/clear register */ +#define IMSC_MASK_ALL 0x7ff /* Mask all interrupts */ + +#define UART_RIS 0x0f /* Raw interrupt status register */ +#define UART_RXREADY (1 << 4) /* RX buffer full */ +#define UART_TXEMPTY (1 << 5) /* TX buffer empty */ +#define RIS_FE (1 << 7) /* Framing error interrupt status */ +#define RIS_PE (1 << 8) /* Parity error interrupt status */ +#define RIS_BE (1 << 9) /* Break error interrupt status */ +#define RIS_OE (1 << 10) /* Overrun interrupt status */ + +#define UART_MIS 0x10 /* Masked interrupt status register */ +#define UART_ICR 0x11 /* Interrupt clear register */ + +/* + * FIXME: actual register size is SoC-dependent, we need to handle it + */ +#define __uart_getreg(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, uart_regofs(bas, reg)) +#define __uart_setreg(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, uart_regofs(bas, reg), value) + +/* + * Low-level UART interface. + */ +static int uart_pl011_probe(struct uart_bas *bas); +static void uart_pl011_init(struct uart_bas *bas, int, int, int, int); +static void uart_pl011_term(struct uart_bas *bas); +static void uart_pl011_putc(struct uart_bas *bas, int); +static int uart_pl011_rxready(struct uart_bas *bas); +static int uart_pl011_getc(struct uart_bas *bas, struct mtx *); + +static struct uart_ops uart_pl011_ops = { + .probe = uart_pl011_probe, + .init = uart_pl011_init, + .term = uart_pl011_term, + .putc = uart_pl011_putc, + .rxready = uart_pl011_rxready, + .getc = uart_pl011_getc, +}; + +static int +uart_pl011_probe(struct uart_bas *bas) +{ + + return (0); +} + +static void +uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + uint32_t ctrl, line; + uint32_t baud; + + /* Mask all interrupts */ + __uart_setreg(bas, UART_IMSC, __uart_getreg(bas, UART_IMSC) & + ~IMSC_MASK_ALL); + + /* + * Zero all settings to make sure + * UART is disabled and not configured + */ + ctrl = line = 0x0; + __uart_setreg(bas, UART_CR, ctrl); + + /* As we know UART is disabled we may setup the line */ + switch (databits) { + case 7: + line |= LCR_H_WLEN7; + break; + case 6: + line |= LCR_H_WLEN6; + break; + case 8: + default: + line |= LCR_H_WLEN8; + break; + } + + /* TODO: Calculate divisors */ + baud = (0x1 << 16) | 0x28; + + if (stopbits == 2) + line |= LCR_H_STP2; + else + line &= ~LCR_H_STP2; + + if (parity) + line |= LCR_H_PEN; + else + line &= ~LCR_H_PEN; + + /* Configure the rest */ + line &= ~LCR_H_FEN; + ctrl |= (CR_RXE | CR_TXE | CR_UARTEN); + + __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 16)) & IBRD_BDIVINT); + __uart_setreg(bas, UART_FBRD, (uint32_t)(baud) & FBRD_BDIVFRAC); + + /* Add config. to line before reenabling UART */ + __uart_setreg(bas, UART_LCR_H, (__uart_getreg(bas, UART_LCR_H) & + ~0xff) | line); + + __uart_setreg(bas, UART_CR, ctrl); +} + +static void +uart_pl011_term(struct uart_bas *bas) +{ +} + +static void +uart_pl011_putc(struct uart_bas *bas, int c) +{ + + while (!(__uart_getreg(bas, UART_FR) & FR_TXFE)) + ; + __uart_setreg(bas, UART_DR, c & 0xff); +} + +static int +uart_pl011_rxready(struct uart_bas *bas) +{ + + return (__uart_getreg(bas, UART_FR) & FR_RXFF); +} + +static int +uart_pl011_getc(struct uart_bas *bas, struct mtx *hwmtx) +{ + int c; + + while (!uart_pl011_rxready(bas)) + ; + c = __uart_getreg(bas, UART_DR) & 0xff; + + return (c); +} + +/* + * High-level UART interface. + */ +struct uart_pl011_softc { + struct uart_softc base; + uint8_t fcr; + uint8_t ier; + uint8_t mcr; + + uint8_t ier_mask; + uint8_t ier_rxbits; +}; + +static int uart_pl011_bus_attach(struct uart_softc *); +static int uart_pl011_bus_detach(struct uart_softc *); +static int uart_pl011_bus_flush(struct uart_softc *, int); +static int uart_pl011_bus_getsig(struct uart_softc *); +static int uart_pl011_bus_ioctl(struct uart_softc *, int, intptr_t); +static int uart_pl011_bus_ipend(struct uart_softc *); +static int uart_pl011_bus_param(struct uart_softc *, int, int, int, int); +static int uart_pl011_bus_probe(struct uart_softc *); +static int uart_pl011_bus_receive(struct uart_softc *); +static int uart_pl011_bus_setsig(struct uart_softc *, int); +static int uart_pl011_bus_transmit(struct uart_softc *); + +static kobj_method_t uart_pl011_methods[] = { + KOBJMETHOD(uart_attach, uart_pl011_bus_attach), + KOBJMETHOD(uart_detach, uart_pl011_bus_detach), + KOBJMETHOD(uart_flush, uart_pl011_bus_flush), + KOBJMETHOD(uart_getsig, uart_pl011_bus_getsig), + KOBJMETHOD(uart_ioctl, uart_pl011_bus_ioctl), + KOBJMETHOD(uart_ipend, uart_pl011_bus_ipend), + KOBJMETHOD(uart_param, uart_pl011_bus_param), + KOBJMETHOD(uart_probe, uart_pl011_bus_probe), + KOBJMETHOD(uart_receive, uart_pl011_bus_receive), + KOBJMETHOD(uart_setsig, uart_pl011_bus_setsig), + KOBJMETHOD(uart_transmit, uart_pl011_bus_transmit), + { 0, 0 } +}; + +struct uart_class uart_pl011_class = { + "uart_pl011", + uart_pl011_methods, + sizeof(struct uart_pl011_softc), + .uc_ops = &uart_pl011_ops, + .uc_range = 0x48, + .uc_rclk = 0 +}; + +static int +uart_pl011_bus_attach(struct uart_softc *sc) +{ + struct uart_bas *bas; + + bas = &sc->sc_bas; + /* Enable RX & TX interrupts */ + __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + /* Clear RX & TX interrupts */ + __uart_setreg(bas, UART_ICR, IMSC_MASK_ALL); + + sc->sc_rxfifosz = 1; + sc->sc_txfifosz = 1; + + return (0); +} + +static int +uart_pl011_bus_detach(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_pl011_bus_flush(struct uart_softc *sc, int what) +{ + + return (0); +} + +static int +uart_pl011_bus_getsig(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_pl011_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +{ + struct uart_bas *bas; + int error; + + bas = &sc->sc_bas; + error = 0; + uart_lock(sc->sc_hwmtx); + switch (request) { + case UART_IOCTL_BREAK: + break; + case UART_IOCTL_BAUD: + *(int*)data = 115200; + break; + default: + error = EINVAL; + break; + } + uart_unlock(sc->sc_hwmtx); + + return (error); +} + +static int +uart_pl011_bus_ipend(struct uart_softc *sc) +{ + struct uart_bas *bas; + int ipend; + uint32_t ints; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + ints = __uart_getreg(bas, UART_MIS); + ipend = 0; + + if (ints & UART_RXREADY) + ipend |= SER_INT_RXREADY; + if (ints & RIS_BE) + ipend |= SER_INT_BREAK; + if (ints & RIS_OE) + ipend |= SER_INT_OVERRUN; + if (ints & UART_TXEMPTY) { + if (sc->sc_txbusy) + ipend |= SER_INT_TXIDLE; + + __uart_setreg(bas, UART_IMSC, UART_RXREADY); + } + + uart_unlock(sc->sc_hwmtx); + + return (ipend); +} + +static int +uart_pl011_bus_param(struct uart_softc *sc, int baudrate, int databits, + int stopbits, int parity) +{ + + uart_lock(sc->sc_hwmtx); + uart_pl011_init(&sc->sc_bas, baudrate, databits, stopbits, parity); + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_pl011_bus_probe(struct uart_softc *sc) +{ + + device_set_desc(sc->sc_dev, "PrimeCell UART (PL011)"); + + return (0); +} + +static int +uart_pl011_bus_receive(struct uart_softc *sc) +{ + struct uart_bas *bas; + int rx; + uint32_t ints, xc; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + ints = __uart_getreg(bas, UART_MIS); + while (ints & UART_RXREADY) { + if (uart_rx_full(sc)) { + sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; + break; + } + xc = __uart_getreg(bas, UART_DR); + rx = xc & 0xff; + + if (xc & DR_FE) + rx |= UART_STAT_FRAMERR; + if (xc & DR_PE) + rx |= UART_STAT_PARERR; + + __uart_setreg(bas, UART_ICR, UART_RXREADY); + + uart_rx_put(sc, rx); + ints = __uart_getreg(bas, UART_MIS); + } + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_pl011_bus_setsig(struct uart_softc *sc, int sig) +{ + + return (0); +} + +static int +uart_pl011_bus_transmit(struct uart_softc *sc) +{ + struct uart_bas *bas; + int i; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + for (i = 0; i < sc->sc_txdatasz; i++) { + __uart_setreg(bas, UART_DR, sc->sc_txbuf[i]); + uart_barrier(bas); + } + sc->sc_txbusy = 1; + __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + uart_unlock(sc->sc_hwmtx); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 20:42:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E465106566C; Thu, 30 Aug 2012 20:42:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB7F8FC0C; Thu, 30 Aug 2012 20:42:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UKghXZ010938; Thu, 30 Aug 2012 20:42:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKghnS010935; Thu, 30 Aug 2012 20:42:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208302042.q7UKghnS010935@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 20:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239920 - stable/9/sys/dev/ipmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:42:43 -0000 Author: jhb Date: Thu Aug 30 20:42:42 2012 New Revision: 239920 URL: http://svn.freebsd.org/changeset/base/239920 Log: MFC 239128: Don't try to stop the IPMI watchdog timer if it is not running. Starting or stopping the IPMI watchdog is rather expensive with the current implementation as all IPMI requests are bounced via thread. This is not viable during shutdown or dumps, and this avoids headache in the common case that the watchdog is not enabled. The IPMI watchdog should probably be reworked to not use a separate thread to fix this in the case when the watchdog timer is enabled. Modified: stable/9/sys/dev/ipmi/ipmi.c stable/9/sys/dev/ipmi/ipmivars.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi.c Thu Aug 30 20:31:53 2012 (r239919) +++ stable/9/sys/dev/ipmi/ipmi.c Thu Aug 30 20:42:42 2012 (r239920) @@ -652,11 +652,12 @@ ipmi_wd_event(void *arg, unsigned int cm if (timeout == 0) timeout = 1; e = ipmi_set_watchdog(sc, timeout); - if (e == 0) + if (e == 0) { *error = 0; - else + sc->ipmi_watchdog_active = 1; + } else (void)ipmi_set_watchdog(sc, 0); - } else { + } else if (atomic_readandclear_int(&sc->ipmi_watchdog_active) != 0) { e = ipmi_set_watchdog(sc, 0); if (e != 0 && cmd == 0) *error = EOPNOTSUPP; Modified: stable/9/sys/dev/ipmi/ipmivars.h ============================================================================== --- stable/9/sys/dev/ipmi/ipmivars.h Thu Aug 30 20:31:53 2012 (r239919) +++ stable/9/sys/dev/ipmi/ipmivars.h Thu Aug 30 20:42:42 2012 (r239920) @@ -105,6 +105,7 @@ struct ipmi_softc { struct cdev *ipmi_cdev; TAILQ_HEAD(,ipmi_request) ipmi_pending_requests; eventhandler_tag ipmi_watchdog_tag; + int ipmi_watchdog_active; struct intr_config_hook ipmi_ich; struct mtx ipmi_lock; struct cv ipmi_request_added; From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 20:43:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE4001065679; Thu, 30 Aug 2012 20:43:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904328FC17; Thu, 30 Aug 2012 20:43:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UKh1XM011019; Thu, 30 Aug 2012 20:43:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKh1tn011016; Thu, 30 Aug 2012 20:43:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208302043.q7UKh1tn011016@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239921 - stable/8/sys/dev/ipmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:43:01 -0000 Author: jhb Date: Thu Aug 30 20:43:01 2012 New Revision: 239921 URL: http://svn.freebsd.org/changeset/base/239921 Log: MFC 239128: Don't try to stop the IPMI watchdog timer if it is not running. Starting or stopping the IPMI watchdog is rather expensive with the current implementation as all IPMI requests are bounced via thread. This is not viable during shutdown or dumps, and this avoids headache in the common case that the watchdog is not enabled. The IPMI watchdog should probably be reworked to not use a separate thread to fix this in the case when the watchdog timer is enabled. Modified: stable/8/sys/dev/ipmi/ipmi.c stable/8/sys/dev/ipmi/ipmivars.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/compat/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) stable/8/sys/dev/virtio/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/8/sys/dev/ipmi/ipmi.c Thu Aug 30 20:42:42 2012 (r239920) +++ stable/8/sys/dev/ipmi/ipmi.c Thu Aug 30 20:43:01 2012 (r239921) @@ -652,11 +652,12 @@ ipmi_wd_event(void *arg, unsigned int cm if (timeout == 0) timeout = 1; e = ipmi_set_watchdog(sc, timeout); - if (e == 0) + if (e == 0) { *error = 0; - else + sc->ipmi_watchdog_active = 1; + } else (void)ipmi_set_watchdog(sc, 0); - } else { + } else if (atomic_readandclear_int(&sc->ipmi_watchdog_active) != 0) { e = ipmi_set_watchdog(sc, 0); if (e != 0 && cmd == 0) *error = EOPNOTSUPP; Modified: stable/8/sys/dev/ipmi/ipmivars.h ============================================================================== --- stable/8/sys/dev/ipmi/ipmivars.h Thu Aug 30 20:42:42 2012 (r239920) +++ stable/8/sys/dev/ipmi/ipmivars.h Thu Aug 30 20:43:01 2012 (r239921) @@ -105,6 +105,7 @@ struct ipmi_softc { struct cdev *ipmi_cdev; TAILQ_HEAD(,ipmi_request) ipmi_pending_requests; eventhandler_tag ipmi_watchdog_tag; + int ipmi_watchdog_active; struct intr_config_hook ipmi_ich; struct mtx ipmi_lock; struct cv ipmi_request_added; From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 20:59:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DDD24106566C; Thu, 30 Aug 2012 20:59:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C74CF8FC16; Thu, 30 Aug 2012 20:59:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UKxbYQ013263; Thu, 30 Aug 2012 20:59:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKxbpT013259; Thu, 30 Aug 2012 20:59:37 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208302059.q7UKxbpT013259@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 30 Aug 2012 20:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239922 - in head/sys: arm/broadcom arm/broadcom/bcm2835 arm/conf boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:59:38 -0000 Author: gonzo Date: Thu Aug 30 20:59:37 2012 New Revision: 239922 URL: http://svn.freebsd.org/changeset/base/239922 Log: Add barebone Raspberry Pi port. Supported parts: - Interrupts controller - Watchdog - System timer - Framebuffer (hardcoded resolution/bpp) Added: head/sys/arm/broadcom/ head/sys/arm/broadcom/bcm2835/ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_intr.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_wdog.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bus_space.c (contents, props changed) head/sys/arm/broadcom/bcm2835/common.c (contents, props changed) head/sys/arm/broadcom/bcm2835/files.bcm2835 (contents, props changed) head/sys/arm/conf/RPI-B (contents, props changed) head/sys/boot/fdt/dts/bcm2835-rpi-b.dts (contents, props changed) Added: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Thu Aug 30 20:59:37 2012 (r239922) @@ -0,0 +1,714 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#define BCMFB_FONT_HEIGHT 16 + +#define FB_WIDTH 640 +#define FB_HEIGHT 480 + +struct bcm_fb_config { + uint32_t xres; + uint32_t yres; + uint32_t vxres; + uint32_t vyres; + uint32_t pitch; + uint32_t bpp; + uint32_t xoffset; + uint32_t yoffset; + /* Filled by videocore */ + uint32_t base; + uint32_t screen_size; +}; + +struct bcmsc_softc { + device_t dev; + struct cdev * cdev; + struct mtx mtx; + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + struct bcm_fb_config* fb_config; + bus_addr_t fb_config_phys; + struct intr_config_hook init_hook; + +}; + +struct video_adapter_softc { + /* Videoadpater part */ + video_adapter_t va; + int console; + + intptr_t fb_addr; + unsigned int fb_size; + + unsigned int height; + unsigned int width; + unsigned int stride; + + unsigned int xmargin; + unsigned int ymargin; + + unsigned char *font; + int initialized; +}; + +static struct bcmsc_softc *bcmsc_softc; +static struct video_adapter_softc va_softc; + +#define bcm_fb_lock(_sc) mtx_lock(&(_sc)->mtx) +#define bcm_fb_unlock(_sc) mtx_unlock(&(_sc)->mtx) +#define bcm_fb_lock_assert(sc) mtx_assert(&(_sc)->mtx, MA_OWNED) + +static int bcm_fb_probe(device_t); +static int bcm_fb_attach(device_t); +static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); + +static void +bcm_fb_init(void *arg) +{ + struct bcmsc_softc *sc = arg; + struct video_adapter_softc *va_sc = &va_softc; + int err; + volatile struct bcm_fb_config* fb_config = sc->fb_config; + + /* TODO: replace it with FDT stuff */ + fb_config->xres = FB_WIDTH; + fb_config->yres = FB_HEIGHT; + fb_config->vxres = 0; + fb_config->vyres = 0; + fb_config->xoffset = 0; + fb_config->yoffset = 0; + fb_config->bpp = 24; + fb_config->base = 0; + fb_config->pitch = 0; + fb_config->screen_size = 0; + + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + bcm_mbox_write(BCM2835_MBOX_CHAN_FB, sc->fb_config_phys); + bcm_mbox_read(BCM2835_MBOX_CHAN_FB, &err); + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_POSTREAD); + + if (err == 0) { + device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", + fb_config->xres, fb_config->yres, + fb_config->vxres, fb_config->vyres, + fb_config->xoffset, fb_config->yoffset, + fb_config->bpp); + + + device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", + fb_config->pitch, fb_config->base, + fb_config->screen_size); + + if (fb_config->base) { + va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + va_sc->fb_size = fb_config->screen_size; + va_sc->stride = fb_config->pitch; + } + } + else + device_printf(sc->dev, "Failed to set framebuffer info\n"); + + config_intrhook_disestablish(&sc->init_hook); +} + +static int +bcm_fb_probe(device_t dev) +{ + int error; + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) + return (ENXIO); + + device_set_desc(dev, "BCM2835 framebuffer device"); + + error = sc_probe_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD); + + if (error != 0) + return (error); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_fb_attach(device_t dev) +{ + struct bcmsc_softc *sc = device_get_softc(dev); + int dma_size = sizeof(struct bcm_fb_config); + int err; + + if (bcmsc_softc) + return (ENXIO); + + bcmsc_softc = sc; + + sc->dev = dev; + mtx_init(&sc->mtx, "bcm2835fb", "fb", MTX_DEF); + + err = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), + PAGE_SIZE, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + dma_size, 1, /* maxsize, nsegments */ + dma_size, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dma_tag); + + err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_config, + 0, &sc->dma_map); + if (err) { + device_printf(dev, "cannot allocate framebuffer\n"); + goto fail; + } + + err = bus_dmamap_load(sc->dma_tag, sc->dma_map, sc->fb_config, + dma_size, bcm_fb_dmamap_cb, &sc->fb_config_phys, BUS_DMA_NOWAIT); + + if (err) { + device_printf(dev, "cannot load DMA map\n"); + goto fail; + } + + err = (sc_attach_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD)); + + if (err) { + device_printf(dev, "failed to attach syscons\n"); + goto fail; + } + + /* + * We have to wait until interrupts are enabled. + * Mailbox relies on it to get data from VideoCore + */ + sc->init_hook.ich_func = bcm_fb_init; + sc->init_hook.ich_arg = sc; + + if (config_intrhook_establish(&sc->init_hook) != 0) { + device_printf(dev, "failed to establish intrhook\n"); + return (ENOMEM); + } + + return (0); + +fail: + return (ENXIO); +} + + +static void +bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + + addr = (bus_addr_t*)arg; + *addr = PHYS_TO_VCBUS(segs[0].ds_addr); +} + +static device_method_t bcm_fb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_fb_probe), + DEVMETHOD(device_attach, bcm_fb_attach), + + { 0, 0 } +}; + +static devclass_t bcm_fb_devclass; + +static driver_t bcm_fb_driver = { + "fb", + bcm_fb_methods, + sizeof(struct bcmsc_softc), +}; + +DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0); + +/* + * Video driver routines and glue. + */ +static int bcmfb_configure(int); +static vi_probe_t bcmfb_probe; +static vi_init_t bcmfb_init; +static vi_get_info_t bcmfb_get_info; +static vi_query_mode_t bcmfb_query_mode; +static vi_set_mode_t bcmfb_set_mode; +static vi_save_font_t bcmfb_save_font; +static vi_load_font_t bcmfb_load_font; +static vi_show_font_t bcmfb_show_font; +static vi_save_palette_t bcmfb_save_palette; +static vi_load_palette_t bcmfb_load_palette; +static vi_set_border_t bcmfb_set_border; +static vi_save_state_t bcmfb_save_state; +static vi_load_state_t bcmfb_load_state; +static vi_set_win_org_t bcmfb_set_win_org; +static vi_read_hw_cursor_t bcmfb_read_hw_cursor; +static vi_set_hw_cursor_t bcmfb_set_hw_cursor; +static vi_set_hw_cursor_shape_t bcmfb_set_hw_cursor_shape; +static vi_blank_display_t bcmfb_blank_display; +static vi_mmap_t bcmfb_mmap; +static vi_ioctl_t bcmfb_ioctl; +static vi_clear_t bcmfb_clear; +static vi_fill_rect_t bcmfb_fill_rect; +static vi_bitblt_t bcmfb_bitblt; +static vi_diag_t bcmfb_diag; +static vi_save_cursor_palette_t bcmfb_save_cursor_palette; +static vi_load_cursor_palette_t bcmfb_load_cursor_palette; +static vi_copy_t bcmfb_copy; +static vi_putp_t bcmfb_putp; +static vi_putc_t bcmfb_putc; +static vi_puts_t bcmfb_puts; +static vi_putm_t bcmfb_putm; + +static video_switch_t bcmfbvidsw = { + .probe = bcmfb_probe, + .init = bcmfb_init, + .get_info = bcmfb_get_info, + .query_mode = bcmfb_query_mode, + .set_mode = bcmfb_set_mode, + .save_font = bcmfb_save_font, + .load_font = bcmfb_load_font, + .show_font = bcmfb_show_font, + .save_palette = bcmfb_save_palette, + .load_palette = bcmfb_load_palette, + .set_border = bcmfb_set_border, + .save_state = bcmfb_save_state, + .load_state = bcmfb_load_state, + .set_win_org = bcmfb_set_win_org, + .read_hw_cursor = bcmfb_read_hw_cursor, + .set_hw_cursor = bcmfb_set_hw_cursor, + .set_hw_cursor_shape = bcmfb_set_hw_cursor_shape, + .blank_display = bcmfb_blank_display, + .mmap = bcmfb_mmap, + .ioctl = bcmfb_ioctl, + .clear = bcmfb_clear, + .fill_rect = bcmfb_fill_rect, + .bitblt = bcmfb_bitblt, + .diag = bcmfb_diag, + .save_cursor_palette = bcmfb_save_cursor_palette, + .load_cursor_palette = bcmfb_load_cursor_palette, + .copy = bcmfb_copy, + .putp = bcmfb_putp, + .putc = bcmfb_putc, + .puts = bcmfb_puts, + .putm = bcmfb_putm, +}; + +VIDEO_DRIVER(bcmfb, bcmfbvidsw, bcmfb_configure); + +extern sc_rndr_sw_t txtrndrsw; +RENDERER(bcmfb, 0, txtrndrsw, gfb_set); +RENDERER_MODULE(bcmfb, gfb_set); + +static uint16_t bcmfb_static_window[ROW*COL]; +extern u_char dflt_font_16[]; + +static int +bcmfb_configure(int flags) +{ + struct video_adapter_softc *sc; + + sc = &va_softc; + + if (sc->initialized) + return 0; + + sc->height = FB_HEIGHT; + sc->width = FB_WIDTH; + + bcmfb_init(0, &sc->va, 0); + + sc->initialized = 1; + + return (0); +} + +static int +bcmfb_probe(int unit, video_adapter_t **adp, void *arg, int flags) +{ + + return (0); +} + +static int +bcmfb_init(int unit, video_adapter_t *adp, int flags) +{ + struct video_adapter_softc *sc; + video_info_t *vi; + + sc = (struct video_adapter_softc *)adp; + vi = &adp->va_info; + + vid_init_struct(adp, "bcmfb", -1, unit); + + sc->font = dflt_font_16; + vi->vi_cheight = BCMFB_FONT_HEIGHT; + vi->vi_cwidth = 8; + vi->vi_width = sc->width/8; + vi->vi_height = sc->height/vi->vi_cheight; + + /* + * Clamp width/height to syscons maximums + */ + if (vi->vi_width > COL) + vi->vi_width = COL; + if (vi->vi_height > ROW) + vi->vi_height = ROW; + + sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; + sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; + + adp->va_window = (vm_offset_t) bcmfb_static_window; + adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */; + + vid_register(&sc->va); + + return (0); +} + +static int +bcmfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) +{ + bcopy(&adp->va_info, info, sizeof(*info)); + return (0); +} + +static int +bcmfb_query_mode(video_adapter_t *adp, video_info_t *info) +{ + return (0); +} + +static int +bcmfb_set_mode(video_adapter_t *adp, int mode) +{ + return (0); +} + +static int +bcmfb_save_font(video_adapter_t *adp, int page, int size, int width, + u_char *data, int c, int count) +{ + return (0); +} + +static int +bcmfb_load_font(video_adapter_t *adp, int page, int size, int width, + u_char *data, int c, int count) +{ + struct video_adapter_softc *sc = (struct video_adapter_softc *)adp; + + sc->font = data; + + return (0); +} + +static int +bcmfb_show_font(video_adapter_t *adp, int page) +{ + return (0); +} + +static int +bcmfb_save_palette(video_adapter_t *adp, u_char *palette) +{ + return (0); +} + +static int +bcmfb_load_palette(video_adapter_t *adp, u_char *palette) +{ + return (0); +} + +static int +bcmfb_set_border(video_adapter_t *adp, int border) +{ + return (bcmfb_blank_display(adp, border)); +} + +static int +bcmfb_save_state(video_adapter_t *adp, void *p, size_t size) +{ + return (0); +} + +static int +bcmfb_load_state(video_adapter_t *adp, void *p) +{ + return (0); +} + +static int +bcmfb_set_win_org(video_adapter_t *adp, off_t offset) +{ + return (0); +} + +static int +bcmfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) +{ + *col = *row = 0; + + return (0); +} + +static int +bcmfb_set_hw_cursor(video_adapter_t *adp, int col, int row) +{ + return (0); +} + +static int +bcmfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, + int celsize, int blink) +{ + return (0); +} + +static int +bcmfb_blank_display(video_adapter_t *adp, int mode) +{ + + return (0); +} + +static int +bcmfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) +{ + struct video_adapter_softc *sc; + + sc = (struct video_adapter_softc *)adp; + + /* + * This might be a legacy VGA mem request: if so, just point it at the + * framebuffer, since it shouldn't be touched + */ + if (offset < sc->stride*sc->height) { + *paddr = sc->fb_addr + offset; + return (0); + } + + return (EINVAL); +} + +static int +bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) +{ + + return (0); +} + +static int +bcmfb_clear(video_adapter_t *adp) +{ + + return (bcmfb_blank_display(adp, 0)); +} + +static int +bcmfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) +{ + + return (0); +} + +static int +bcmfb_bitblt(video_adapter_t *adp, ...) +{ + + return (0); +} + +static int +bcmfb_diag(video_adapter_t *adp, int level) +{ + + return (0); +} + +static int +bcmfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) +{ + + return (0); +} + +static int +bcmfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) +{ + + return (0); +} + +static int +bcmfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) +{ + + return (0); +} + +static int +bcmfb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, + int size, int bpp, int bit_ltor, int byte_ltor) +{ + + return (0); +} + +static int +bcmfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) +{ + struct video_adapter_softc *sc; + int row; + int col; + int i, j, k; + uint8_t *addr; + u_char *p; + uint8_t fg, bg, color; + + sc = (struct video_adapter_softc *)adp; + + if (sc->fb_addr == 0) + return (0); + + row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; + col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; + p = sc->font + c*BCMFB_FONT_HEIGHT; + addr = (uint8_t *)sc->fb_addr + + (row + sc->ymargin)*(sc->stride) + + 3 * (col + sc->xmargin); + + /* + * FIXME: hardcoded + */ + bg = 0x00; + fg = 0x80; + + for (i = 0; i < BCMFB_FONT_HEIGHT; i++) { + for (j = 0, k = 7; j < 8; j++, k--) { + if ((p[i] & (1 << k)) == 0) + color = bg; + else + color = fg; + + addr[3*j] = color; + addr[3*j+1] = color; + addr[3*j+2] = color; + } + + addr += (sc->stride); + } + + return (0); +} + +static int +bcmfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) +{ + int i; + + for (i = 0; i < len; i++) + bcmfb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); + + return (0); +} + +static int +bcmfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, + uint32_t pixel_mask, int size, int width) +{ + + return (0); +} + +/* + * Define a stub keyboard driver in case one hasn't been + * compiled into the kernel + */ +#include +#include + +static int dummy_kbd_configure(int flags); + +keyboard_switch_t bcmdummysw; + +static int +dummy_kbd_configure(int flags) +{ + + return (0); +} +KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure); Added: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Thu Aug 30 20:59:37 2012 (r239922) @@ -0,0 +1,203 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Based on OMAP3 INTC code by Ben Gray + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define INTC_PENDING_BASIC 0x00 +#define INTC_PENDING_BANK1 0x04 +#define INTC_PENDING_BANK2 0x08 +#define INTC_FIQ_CONTROL 0x0C +#define INTC_ENABLE_BANK1 0x10 +#define INTC_ENABLE_BANK2 0x14 +#define INTC_ENABLE_BASIC 0x18 +#define INTC_DISABLE_BANK1 0x1C +#define INTC_DISABLE_BANK2 0x20 +#define INTC_DISABLE_BASIC 0x24 + +#define BANK1_START 8 +#define BANK1_END (BANK1_START + 32 - 1) +#define BANK2_START (BANK1_START + 32) +#define BANK2_END (BANK2_START + 32 - 1) + +#define IS_IRQ_BASIC(n) (((n) >= 0) && ((n) < BANK1_START)) +#define IS_IRQ_BANK1(n) (((n) >= BANK1_START) && ((n) <= BANK1_END)) +#define IS_IRQ_BANK2(n) (((n) >= BANK2_START) && ((n) <= BANK2_END)) +#define IRQ_BANK1(n) ((n) - BANK1_START) +#define IRQ_BANK2(n) ((n) - BANK2_START) + +#ifdef DEBUG +#define dprintf(fmt, args...) printf(fmt, ##args) +#else +#define dprintf(fmt, args...) +#endif + +struct bcm_intc_softc { + device_t sc_dev; + struct resource * intc_res; + bus_space_tag_t intc_bst; + bus_space_handle_t intc_bsh; +}; + +static struct bcm_intc_softc *bcm_intc_sc = NULL; + +#define intc_read_4(reg) \ + bus_space_read_4(bcm_intc_sc->intc_bst, bcm_intc_sc->intc_bsh, reg) +#define intc_write_4(reg, val) \ + bus_space_write_4(bcm_intc_sc->intc_bst, bcm_intc_sc->intc_bsh, reg, val) + +static int +bcm_intc_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic")) + return (ENXIO); + device_set_desc(dev, "BCM2835 Interrupt Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_intc_attach(device_t dev) +{ + struct bcm_intc_softc *sc = device_get_softc(dev); + int rid = 0; + + sc->sc_dev = dev; + + if (bcm_intc_sc) + return (ENXIO); + + sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->intc_res == NULL) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + sc->intc_bst = rman_get_bustag(sc->intc_res); + sc->intc_bsh = rman_get_bushandle(sc->intc_res); + + bcm_intc_sc = sc; + + return (0); +} + +static device_method_t bcm_intc_methods[] = { + DEVMETHOD(device_probe, bcm_intc_probe), + DEVMETHOD(device_attach, bcm_intc_attach), + { 0, 0 } +}; + +static driver_t bcm_intc_driver = { + "intc", + bcm_intc_methods, + sizeof(struct bcm_intc_softc), +}; + +static devclass_t bcm_intc_devclass; + +DRIVER_MODULE(intc, simplebus, bcm_intc_driver, bcm_intc_devclass, 0, 0); + +int +arm_get_next_irq(int last_irq) +{ + uint32_t pending; + int32_t irq = last_irq + 1; + + /* Sanity check */ + if (irq < 0) + irq = 0; + + /* TODO: should we mask last_irq? */ + pending = intc_read_4(INTC_PENDING_BASIC); + while (irq < BANK1_START) { + if (pending & (1 << irq)) + return irq; + irq++; + } + + pending = intc_read_4(INTC_PENDING_BANK1); + while (irq < BANK2_START) { + if (pending & (1 << IRQ_BANK1(irq))) + return irq; + irq++; + } + + pending = intc_read_4(INTC_PENDING_BANK2); + while (irq <= BANK2_END) { + if (pending & (1 << IRQ_BANK2(irq))) + return irq; + irq++; + } + + return (-1); +} + +void +arm_mask_irq(uintptr_t nb) +{ + dprintf("%s: %d\n", __func__, nb); + + if (IS_IRQ_BASIC(nb)) + intc_write_4(INTC_DISABLE_BASIC, (1 << nb)); + else if (IS_IRQ_BANK1(nb)) + intc_write_4(INTC_DISABLE_BANK1, (1 << IRQ_BANK1(nb))); + else if (IS_IRQ_BANK2(nb)) + intc_write_4(INTC_DISABLE_BANK2, (1 << IRQ_BANK2(nb))); + else + printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + dprintf("%s: %d\n", __func__, nb); + + if (IS_IRQ_BASIC(nb)) + intc_write_4(INTC_ENABLE_BASIC, (1 << nb)); + else if (IS_IRQ_BANK1(nb)) + intc_write_4(INTC_ENABLE_BANK1, (1 << IRQ_BANK1(nb))); + else if (IS_IRQ_BANK2(nb)) + intc_write_4(INTC_ENABLE_BANK2, (1 << IRQ_BANK2(nb))); + else + printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); +} Added: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Thu Aug 30 20:59:37 2012 (r239922) @@ -0,0 +1,603 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko. + * Copyright (c) 1994-1998 Mark Brinicombe. + * Copyright (c) 1994 Brini. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * 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 Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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. + * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 + */ + +#include "opt_ddb.h" +#include "opt_platform.h" +#include "opt_global.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 21:22:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5B051065678; Thu, 30 Aug 2012 21:22:47 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6A198FC0C; Thu, 30 Aug 2012 21:22:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7ULMl2n016080; Thu, 30 Aug 2012 21:22:47 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7ULMlPa016075; Thu, 30 Aug 2012 21:22:47 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201208302122.q7ULMlPa016075@svn.freebsd.org> From: Attilio Rao Date: Thu, 30 Aug 2012 21:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239923 - in head/sys: conf kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 21:22:48 -0000 Author: attilio Date: Thu Aug 30 21:22:47 2012 New Revision: 239923 URL: http://svn.freebsd.org/changeset/base/239923 Log: Post r222812 KTR_CPUMASK started being initialized only as a tunable handler and not more statically. Unfortunately, it seems that this is not ideal for new platform bringup and boot low level development (which needs ktr_cpumask to be effective before tunables can be setup). Because of this, add a way to statically initialize cpusets, by passing an list of initializers, divided by commas. Also, provide a way to enforce an all-set mask, for above mentioned initializers. This imposes some differences on how KTR_CPUMASK is setup now as a kernel option, and in particular this makes the words specifications backward wrt. what is currently in -CURRENT. In order to avoid mismatches between KTR_CPUMASK definition and other way to setup the mask (tunable, sysctl) and to print it, change the ordering how cpusetobj_print() and cpusetobj_scan() acquire the words belonging to the set. Please give a look to sys/conf/NOTES in order to understand how the new format is supposed to work. Also, ktr manpages will be updated shortly by gjb which volountereed for this. This patch won't be merged because it changes a POLA (at least from the theoretical standpoint) and this is however a patch that proves to be effective only in development environments. Requested by: rpaulo Reviewed by: jeff, rpaulo Modified: head/sys/conf/NOTES head/sys/kern/kern_cpuset.c head/sys/kern/kern_ktr.c head/sys/sys/_cpuset.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/conf/NOTES Thu Aug 30 21:22:47 2012 (r239923) @@ -442,8 +442,8 @@ options KTRACE_REQUEST_POOL=101 # what events to trace. KTR_CPUMASK determines which CPU's log # events, with bit X corresponding to CPU X. The layout of the string # passed as KTR_CPUMASK must match a series of bitmasks each of them -# separated by the ", " characters (ie: -# KTR_CPUMASK=("0xAF, 0xFFFFFFFFFFFFFFFF")). KTR_VERBOSE enables +# separated by the "," character (ie: +# KTR_CPUMASK=0xAF,0xFFFFFFFFFFFFFFFF). KTR_VERBOSE enables # dumping of KTR events to the console by default. This functionality # can be toggled via the debug.ktr_verbose sysctl and defaults to off # if KTR_VERBOSE is not defined. See ktr(4) and ktrdump(8) for details. @@ -452,7 +452,7 @@ options KTR options KTR_ENTRIES=1024 options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR -options KTR_CPUMASK=("0x3") +options KTR_CPUMASK=0x3 options KTR_VERBOSE # Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/kern/kern_cpuset.c Thu Aug 30 21:22:47 2012 (r239923) @@ -651,12 +651,12 @@ cpusetobj_strprint(char *buf, const cpus bytesp = 0; bufsiz = CPUSETBUFSIZ; - for (i = _NCPUWORDS - 1; i > 0; i--) { - bytesp = snprintf(tbuf, bufsiz, "%lx, ", set->__bits[i]); + for (i = 0; i < (_NCPUWORDS - 1); i++) { + bytesp = snprintf(tbuf, bufsiz, "%lx,", set->__bits[i]); bufsiz -= bytesp; tbuf += bytesp; } - snprintf(tbuf, bufsiz, "%lx", set->__bits[0]); + snprintf(tbuf, bufsiz, "%lx", set->__bits[_NCPUWORDS - 1]); return (buf); } @@ -682,16 +682,16 @@ cpusetobj_strscan(cpuset_t *set, const c return (-1); CPU_ZERO(set); - for (i = nwords - 1; i > 0; i--) { - ret = sscanf(buf, "%lx, ", &set->__bits[i]); + for (i = 0; i < (nwords - 1); i++) { + ret = sscanf(buf, "%lx,", &set->__bits[i]); if (ret == 0 || ret == -1) return (-1); - buf = strstr(buf, " "); + buf = strstr(buf, ","); if (buf == NULL) return (-1); buf++; } - ret = sscanf(buf, "%lx", &set->__bits[0]); + ret = sscanf(buf, "%lx", &set->__bits[nwords - 1]); if (ret == 0 || ret == -1) return (-1); return (0); Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/kern/kern_ktr.c Thu Aug 30 21:22:47 2012 (r239923) @@ -70,6 +70,10 @@ __FBSDID("$FreeBSD$"); #define KTR_MASK (0) #endif +#ifndef KTR_CPUMASK +#define KTR_CPUMASK CPUSET_FSET +#endif + #ifndef KTR_TIME #define KTR_TIME get_cyclecount() #endif @@ -99,7 +103,7 @@ int ktr_version = KTR_VERSION; SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD, &ktr_version, 0, "Version of the KTR interface"); -cpuset_t ktr_cpumask; +cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK); static char ktr_cpumask_str[CPUSETBUFSIZ]; TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str)); @@ -107,12 +111,6 @@ static void ktr_cpumask_initializer(void *dummy __unused) { - CPU_FILL(&ktr_cpumask); -#ifdef KTR_CPUMASK - if (cpusetobj_strscan(&ktr_cpumask, KTR_CPUMASK) == -1) - CPU_FILL(&ktr_cpumask); -#endif - /* * TUNABLE_STR() runs with SI_ORDER_MIDDLE priority, thus it must be * already set, if necessary. Modified: head/sys/sys/_cpuset.h ============================================================================== --- head/sys/sys/_cpuset.h Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/sys/_cpuset.h Thu Aug 30 21:22:47 2012 (r239923) @@ -49,4 +49,10 @@ typedef struct _cpuset { long __bits[howmany(CPU_SETSIZE, _NCPUBITS)]; } cpuset_t; +#define CPUSET_FSET \ + [ 0 ... (_NCPUWORDS - 1) ] = (-1L) + +#define CPUSET_T_INITIALIZER(x) \ + { .__bits = { x } } + #endif /* !_SYS__CPUSET_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 22:56:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 298211065676; Thu, 30 Aug 2012 22:56:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEDE08FC18; Thu, 30 Aug 2012 22:56:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UMuWEH027496; Thu, 30 Aug 2012 22:56:32 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UMuWE7027494; Thu, 30 Aug 2012 22:56:32 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208302256.q7UMuWE7027494@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 30 Aug 2012 22:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239927 - head/tools/tools/track X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 22:56:33 -0000 Author: des Date: Thu Aug 30 22:56:32 2012 New Revision: 239927 URL: http://svn.freebsd.org/changeset/base/239927 Log: The error syntax has changed. Modified: head/tools/tools/track/track.sh Modified: head/tools/tools/track/track.sh ============================================================================== --- head/tools/tools/track/track.sh Thu Aug 30 22:18:25 2012 (r239926) +++ head/tools/tools/track/track.sh Thu Aug 30 22:56:32 2012 (r239927) @@ -35,7 +35,7 @@ do \>\>\>*) endl="\r\n" ;; - \*\*\*\ Error*) + \*\*\**) endl="\r\n" ;; \=\=\=*) From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 23:50:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02569106564A; Thu, 30 Aug 2012 23:50:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF8AA8FC14; Thu, 30 Aug 2012 23:50:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UNoBWC033435; Thu, 30 Aug 2012 23:50:11 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UNoBXl033430; Thu, 30 Aug 2012 23:50:11 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201208302350.q7UNoBXl033430@svn.freebsd.org> From: Justin Hibbits Date: Thu, 30 Aug 2012 23:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239928 - in stable/9/sys: conf powerpc/conf powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 23:50:12 -0000 Author: jhibbits Date: Thu Aug 30 23:50:11 2012 New Revision: 239928 URL: http://svn.freebsd.org/changeset/base/239928 Log: MFC r239027 Add backlight support for nVidia-based PowerBooks/iBooks/iMacs. Added: stable/9/sys/powerpc/powermac/nvbl.c - copied unchanged from r239027, head/sys/powerpc/powermac/nvbl.c Modified: stable/9/sys/conf/files.powerpc stable/9/sys/powerpc/conf/GENERIC stable/9/sys/powerpc/conf/GENERIC64 Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files.powerpc ============================================================================== --- stable/9/sys/conf/files.powerpc Thu Aug 30 22:56:32 2012 (r239927) +++ stable/9/sys/conf/files.powerpc Thu Aug 30 23:50:11 2012 (r239928) @@ -155,6 +155,7 @@ powerpc/powermac/hrowpic.c optional powe powerpc/powermac/kiic.c optional powermac kiic powerpc/powermac/macgpio.c optional powermac pci powerpc/powermac/macio.c optional powermac pci +powerpc/powermac/nvbl.c optional powermac nvbl powerpc/powermac/openpic_macio.c optional powermac pci powerpc/powermac/platform_powermac.c optional powermac powerpc/powermac/powermac_thermal.c optional powermac Modified: stable/9/sys/powerpc/conf/GENERIC ============================================================================== --- stable/9/sys/powerpc/conf/GENERIC Thu Aug 30 22:56:32 2012 (r239927) +++ stable/9/sys/powerpc/conf/GENERIC Thu Aug 30 23:50:11 2012 (r239928) @@ -179,6 +179,7 @@ device powermac_nvram # Open Firmware c device smu # Apple System Management Unit device windtunnel # Apple G4 MDD fan controller device atibl # ATI-based backlight driver for PowerBooks/iBooks +device nvbl # nVidia-based backlight driver for PowerBooks/iBooks # ADB support device adb Modified: stable/9/sys/powerpc/conf/GENERIC64 ============================================================================== --- stable/9/sys/powerpc/conf/GENERIC64 Thu Aug 30 22:56:32 2012 (r239927) +++ stable/9/sys/powerpc/conf/GENERIC64 Thu Aug 30 23:50:11 2012 (r239928) @@ -178,6 +178,7 @@ device max6690 # PowerMac7,2 temperatu device powermac_nvram # Open Firmware configuration NVRAM device smu # Apple System Management Unit device atibl # ATI-based backlight driver for PowerBooks/iBooks +device nvbl # nVidia-based backlight driver for PowerBooks/iBooks # ADB support device adb Copied: stable/9/sys/powerpc/powermac/nvbl.c (from r239027, head/sys/powerpc/powermac/nvbl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/powerpc/powermac/nvbl.c Thu Aug 30 23:50:11 2012 (r239928, copy of r239027, head/sys/powerpc/powermac/nvbl.c) @@ -0,0 +1,197 @@ +/*- + * Copyright (c) 2012 Justin Hibbits + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#define NVIDIA_BRIGHT_MIN (0x0ec) +#define NVIDIA_BRIGHT_MAX (0x538) +#define NVIDIA_BRIGHT_SCALE ((NVIDIA_BRIGHT_MAX - NVIDIA_BRIGHT_MIN)/100) +/* nVidia's MMIO registers are at PCI BAR[0] */ +#define NVIDIA_MMIO_PMC (0x0) +#define NVIDIA_PMC_OFF (NVIDIA_MMIO_PMC + 0x10f0) +#define NVIDIA_PMC_BL_SHIFT (16) +#define NVIDIA_PMC_BL_EN (1 << 31) + + +struct nvbl_softc { + device_t dev; + struct resource *sc_memr; +}; + +static void nvbl_identify(driver_t *driver, device_t parent); +static int nvbl_probe(device_t dev); +static int nvbl_attach(device_t dev); +static int nvbl_setlevel(struct nvbl_softc *sc, int newlevel); +static int nvbl_getlevel(struct nvbl_softc *sc); +static int nvbl_sysctl(SYSCTL_HANDLER_ARGS); + +static device_method_t nvbl_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, nvbl_identify), + DEVMETHOD(device_probe, nvbl_probe), + DEVMETHOD(device_attach, nvbl_attach), + {0, 0}, +}; + +static driver_t nvbl_driver = { + "backlight", + nvbl_methods, + sizeof(struct nvbl_softc) +}; + +static devclass_t nvbl_devclass; + +DRIVER_MODULE(nvbl, vgapci, nvbl_driver, nvbl_devclass, 0, 0); + +static void +nvbl_identify(driver_t *driver, device_t parent) +{ + if (device_find_child(parent, "backlight", -1) == NULL) + device_add_child(parent, "backlight", -1); +} + +static int +nvbl_probe(device_t dev) +{ + char control[8]; + phandle_t handle; + + handle = OF_finddevice("mac-io/backlight"); + + if (handle <= 0) + return (ENXIO); + + if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) + return (ENXIO); + + if (strcmp(control, "mnca") != 0) + return (ENXIO); + + device_set_desc(dev, "PowerBook backlight for nVidia graphics"); + + return (0); +} + +static int +nvbl_attach(device_t dev) +{ + struct nvbl_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + int rid; + + sc = device_get_softc(dev); + + rid = 0x10; /* BAR[0], for the MMIO register */ + sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->sc_memr == NULL) { + device_printf(dev, "Could not alloc mem resource!\n"); + return (ENXIO); + } + + /* Turn on big-endian mode */ + if (!(bus_read_stream_4(sc->sc_memr, NVIDIA_MMIO_PMC + 4) & 0x01000001)) { + bus_write_stream_4(sc->sc_memr, NVIDIA_MMIO_PMC + 4, 0x01000001); + mb(); + } + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + nvbl_sysctl, "I", "Backlight level (0-100)"); + + return (0); +} + +static int +nvbl_setlevel(struct nvbl_softc *sc, int newlevel) +{ + uint32_t pmc_reg; + + if (newlevel > 100) + newlevel = 100; + + if (newlevel < 0) + newlevel = 0; + + if (newlevel > 0) + newlevel = (newlevel * NVIDIA_BRIGHT_SCALE) + NVIDIA_BRIGHT_MIN; + + pmc_reg = bus_read_stream_4(sc->sc_memr, NVIDIA_PMC_OFF) & 0xffff; + pmc_reg |= NVIDIA_PMC_BL_EN | (newlevel << NVIDIA_PMC_BL_SHIFT); + bus_write_stream_4(sc->sc_memr, NVIDIA_PMC_OFF, pmc_reg); + + return (0); +} + +static int +nvbl_getlevel(struct nvbl_softc *sc) +{ + uint16_t level; + + level = bus_read_stream_2(sc->sc_memr, NVIDIA_PMC_OFF) & 0x7fff; + + if (level < NVIDIA_BRIGHT_MIN) + return 0; + + level = (level - NVIDIA_BRIGHT_MIN) / NVIDIA_BRIGHT_SCALE; + + return (level); +} + +static int +nvbl_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct nvbl_softc *sc; + int newlevel, error; + + sc = arg1; + + newlevel = nvbl_getlevel(sc); + + error = sysctl_handle_int(oidp, &newlevel, 0, req); + + if (error || !req->newptr) + return (error); + + return (nvbl_setlevel(sc, newlevel)); +} From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 23:54:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C765106564A; Thu, 30 Aug 2012 23:54:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26FCA8FC08; Thu, 30 Aug 2012 23:54:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UNsoXH033974; Thu, 30 Aug 2012 23:54:50 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UNsndS033971; Thu, 30 Aug 2012 23:54:49 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201208302354.q7UNsndS033971@svn.freebsd.org> From: Justin Hibbits Date: Thu, 30 Aug 2012 23:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239929 - stable/9/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 23:54:50 -0000 Author: jhibbits Date: Thu Aug 30 23:54:49 2012 New Revision: 239929 URL: http://svn.freebsd.org/changeset/base/239929 Log: MFC r239548: phandle_t is unsigned, and OF_finddevice() returns (phandle_t)(-1) on failure, so check for that instead of 0. While here, provide a better description for ATI backlight driver. Modified: stable/9/sys/powerpc/powermac/atibl.c stable/9/sys/powerpc/powermac/nvbl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powermac/atibl.c ============================================================================== --- stable/9/sys/powerpc/powermac/atibl.c Thu Aug 30 23:50:11 2012 (r239928) +++ stable/9/sys/powerpc/powermac/atibl.c Thu Aug 30 23:54:49 2012 (r239929) @@ -98,7 +98,7 @@ atibl_probe(device_t dev) handle = OF_finddevice("mac-io/backlight"); - if (handle <= 0) + if (handle == -1) return (ENXIO); if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) @@ -107,7 +107,7 @@ atibl_probe(device_t dev) if (strcmp(control, "ati") != 0) return (ENXIO); - device_set_desc(dev, "PowerBook backlight"); + device_set_desc(dev, "PowerBook backlight for ATI graphics"); return (0); } Modified: stable/9/sys/powerpc/powermac/nvbl.c ============================================================================== --- stable/9/sys/powerpc/powermac/nvbl.c Thu Aug 30 23:50:11 2012 (r239928) +++ stable/9/sys/powerpc/powermac/nvbl.c Thu Aug 30 23:54:49 2012 (r239929) @@ -94,7 +94,7 @@ nvbl_probe(device_t dev) handle = OF_finddevice("mac-io/backlight"); - if (handle <= 0) + if (handle == -1) return (ENXIO); if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 00:32:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 20B19106566C; Fri, 31 Aug 2012 00:32:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 8DADC14EFD1; Fri, 31 Aug 2012 00:31:30 +0000 (UTC) Message-ID: <504005E1.7040602@FreeBSD.org> Date: Thu, 30 Aug 2012 14:31:29 -1000 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbe+/vXJncmF2?= References: <201208302256.q7UMuWE7027494@svn.freebsd.org> In-Reply-To: <201208302256.q7UMuWE7027494@svn.freebsd.org> X-Enigmail-Version: 1.4.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239927 - head/tools/tools/track X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 00:32:02 -0000 On 08/30/2012 12:56 PM, Dag-Erling Sm�rgrav wrote: > Author: des > Date: Thu Aug 30 22:56:32 2012 > New Revision: 239927 > URL: http://svn.freebsd.org/changeset/base/239927 > > Log: > The error syntax has changed. > > Modified: > head/tools/tools/track/track.sh > > Modified: head/tools/tools/track/track.sh > ============================================================================== > --- head/tools/tools/track/track.sh Thu Aug 30 22:18:25 2012 (r239926) > +++ head/tools/tools/track/track.sh Thu Aug 30 22:56:32 2012 (r239927) > @@ -35,7 +35,7 @@ do > \>\>\>*) > endl="\r\n" > ;; > - \*\*\*\ Error*) > + \*\*\**) Are you sure that the double ** is necessary here? > endl="\r\n" > ;; > \=\=\=*) > From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 00:33:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2D44106566C; Fri, 31 Aug 2012 00:33:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A447A8FC18; Fri, 31 Aug 2012 00:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V0X9jO038390; Fri, 31 Aug 2012 00:33:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V0X9SL038386; Fri, 31 Aug 2012 00:33:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208310033.q7V0X9SL038386@svn.freebsd.org> From: Xin LI Date: Fri, 31 Aug 2012 00:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239931 - stable/9/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 00:33:09 -0000 Author: delphij Date: Fri Aug 31 00:33:09 2012 New Revision: 239931 URL: http://svn.freebsd.org/changeset/base/239931 Log: MFC r238964: Teach md5(1) about sha512. Modified: stable/9/sbin/md5/Makefile stable/9/sbin/md5/md5.1 stable/9/sbin/md5/md5.c Directory Properties: stable/9/sbin/md5/ (props changed) Modified: stable/9/sbin/md5/Makefile ============================================================================== --- stable/9/sbin/md5/Makefile Fri Aug 31 00:11:30 2012 (r239930) +++ stable/9/sbin/md5/Makefile Fri Aug 31 00:33:09 2012 (r239931) @@ -5,11 +5,13 @@ PROG= md5 LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ - ${BINDIR}/md5 ${BINDIR}/sha256 + ${BINDIR}/md5 ${BINDIR}/sha256 \ + ${BINDIR}/md5 ${BINDIR}/sha512 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ - md5.1 sha256.1 + md5.1 sha256.1 \ + md5.1 sha512.1 WFORMAT?= 1 Modified: stable/9/sbin/md5/md5.1 ============================================================================== --- stable/9/sbin/md5/md5.1 Fri Aug 31 00:11:30 2012 (r239930) +++ stable/9/sbin/md5/md5.1 Fri Aug 31 00:33:09 2012 (r239931) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd September 7, 2008 +.Dd July 31, 2012 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , rmd160 +.Nm md5 , sha1 , sha256 , sha512, rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -21,6 +21,11 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar +.Nm sha512 +.Op Fl pqrtx +.Op Fl c Ar string +.Op Fl s Ar string +.Op Ar .Nm rmd160 .Op Fl pqrtx .Op Fl c Ar string @@ -28,7 +33,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 +.Nm md5 , sha1 , sha256 , sha512 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -41,7 +46,7 @@ It is conjectured that it is computation produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The -.Tn MD5 , SHA-1 , SHA-256 +.Tn MD5 , SHA-1 , SHA-256 , SHA-512 and .Tn RIPEMD-160 algorithms are intended for digital signature applications, where a @@ -104,7 +109,7 @@ Run a built-in test script. .El .Sh EXIT STATUS The -.Nm md5 , sha1 , sha256 +.Nm md5 , sha1 , sha256 , sha512 and .Nm rmd160 utilities exit 0 on success, @@ -115,7 +120,8 @@ and 2 if at least one file does not have .Xr md5 3 , .Xr ripemd 3 , .Xr sha 3 , -.Xr sha256 3 +.Xr sha256 3 , +.Xr sha512 3 .Rs .%A R. Rivest .%T The MD5 Message-Digest Algorithm Modified: stable/9/sbin/md5/md5.c ============================================================================== --- stable/9/sbin/md5/md5.c Fri Aug 31 00:11:30 2012 (r239930) +++ stable/9/sbin/md5/md5.c Fri Aug 31 00:33:09 2012 (r239931) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ typedef char *(DIGEST_End)(void *, char extern const char *MD5TestOutput[MDTESTCOUNT]; extern const char *SHA1_TestOutput[MDTESTCOUNT]; extern const char *SHA256_TestOutput[MDTESTCOUNT]; +extern const char *SHA512_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { @@ -78,12 +80,14 @@ typedef union { MD5_CTX md5; SHA1_CTX sha1; SHA256_CTX sha256; + SHA512_CTX sha512; RIPEMD160_CTX ripemd160; } DIGEST_CTX; /* max(MD5_DIGEST_LENGTH, SHA_DIGEST_LENGTH, - SHA256_DIGEST_LENGTH, RIPEMD160_DIGEST_LENGTH)*2+1 */ -#define HEX_DIGEST_LENGTH 65 + SHA256_DIGEST_LENGTH, SHA512_DIGEST_LENGTH, + RIPEMD160_DIGEST_LENGTH)*2+1 */ +#define HEX_DIGEST_LENGTH 129 /* algorithm function table */ @@ -97,6 +101,9 @@ struct Algorithm_t Algorithm[] = { { "sha256", "SHA256", &SHA256_TestOutput, (DIGEST_Init*)&SHA256_Init, (DIGEST_Update*)&SHA256_Update, (DIGEST_End*)&SHA256_End, &SHA256_Data, &SHA256_File }, + { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, + (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, + &SHA512_Data, &SHA512_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } @@ -320,6 +327,17 @@ const char *SHA256_TestOutput[MDTESTCOUN "e6eae09f10ad4122a0e2a4075761d185a272ebd9f5aa489e998ff2f09cbfdd9f" }; +const char *SHA512_TestOutput[MDTESTCOUNT] = { + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75", + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", + "107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f3309e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c", + "4dbff86cc2ca1bae1e16468a05cb9881c97f1753bce3619034898faa1aabe429955a1bf8ec483d7421fe3c1646613a59ed5441fb0f321389f77f48a879c7b1f1", + "1e07be23c26a86ea37ea810c8ec7809352515a970e9253c26f536cfc7a9996c45c8370583e0a78fa4a90041d71a4ceab7423f19c71b9d5a3e01249f0bebd5894", + "72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843", + "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" +}; + const char *RIPEMD160_TestOutput[MDTESTCOUNT] = { "9c1185a5c5e9fc54612808977ee8f548b2258d31", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 00:34:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E56E1065675; Fri, 31 Aug 2012 00:34:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0248FC0C; Fri, 31 Aug 2012 00:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V0Ynq8038670; Fri, 31 Aug 2012 00:34:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V0YnwV038666; Fri, 31 Aug 2012 00:34:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208310034.q7V0YnwV038666@svn.freebsd.org> From: Xin LI Date: Fri, 31 Aug 2012 00:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239932 - stable/8/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 00:34:49 -0000 Author: delphij Date: Fri Aug 31 00:34:48 2012 New Revision: 239932 URL: http://svn.freebsd.org/changeset/base/239932 Log: MFC r238964: Teach md5(1) about sha512. Modified: stable/8/sbin/md5/Makefile stable/8/sbin/md5/md5.1 stable/8/sbin/md5/md5.c Directory Properties: stable/8/sbin/md5/ (props changed) Modified: stable/8/sbin/md5/Makefile ============================================================================== --- stable/8/sbin/md5/Makefile Fri Aug 31 00:33:09 2012 (r239931) +++ stable/8/sbin/md5/Makefile Fri Aug 31 00:34:48 2012 (r239932) @@ -5,11 +5,13 @@ PROG= md5 LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ - ${BINDIR}/md5 ${BINDIR}/sha256 + ${BINDIR}/md5 ${BINDIR}/sha256 \ + ${BINDIR}/md5 ${BINDIR}/sha512 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ - md5.1 sha256.1 + md5.1 sha256.1 \ + md5.1 sha512.1 WARNS?= 6 WFORMAT?= 1 Modified: stable/8/sbin/md5/md5.1 ============================================================================== --- stable/8/sbin/md5/md5.1 Fri Aug 31 00:33:09 2012 (r239931) +++ stable/8/sbin/md5/md5.1 Fri Aug 31 00:34:48 2012 (r239932) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd September 7, 2008 +.Dd July 31, 2012 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , rmd160 +.Nm md5 , sha1 , sha256 , sha512, rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -21,6 +21,11 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar +.Nm sha512 +.Op Fl pqrtx +.Op Fl c Ar string +.Op Fl s Ar string +.Op Ar .Nm rmd160 .Op Fl pqrtx .Op Fl c Ar string @@ -28,7 +33,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 +.Nm md5 , sha1 , sha256 , sha512 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -41,7 +46,7 @@ It is conjectured that it is computation produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The -.Tn MD5 , SHA-1 , SHA-256 +.Tn MD5 , SHA-1 , SHA-256 , SHA-512 and .Tn RIPEMD-160 algorithms are intended for digital signature applications, where a @@ -104,7 +109,7 @@ Run a built-in test script. .El .Sh EXIT STATUS The -.Nm md5 , sha1 , sha256 +.Nm md5 , sha1 , sha256 , sha512 and .Nm rmd160 utilities exit 0 on success, @@ -115,7 +120,8 @@ and 2 if at least one file does not have .Xr md5 3 , .Xr ripemd 3 , .Xr sha 3 , -.Xr sha256 3 +.Xr sha256 3 , +.Xr sha512 3 .Rs .%A R. Rivest .%T The MD5 Message-Digest Algorithm Modified: stable/8/sbin/md5/md5.c ============================================================================== --- stable/8/sbin/md5/md5.c Fri Aug 31 00:33:09 2012 (r239931) +++ stable/8/sbin/md5/md5.c Fri Aug 31 00:34:48 2012 (r239932) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ typedef char *(DIGEST_End)(void *, char extern const char *MD5TestOutput[MDTESTCOUNT]; extern const char *SHA1_TestOutput[MDTESTCOUNT]; extern const char *SHA256_TestOutput[MDTESTCOUNT]; +extern const char *SHA512_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { @@ -78,12 +80,14 @@ typedef union { MD5_CTX md5; SHA1_CTX sha1; SHA256_CTX sha256; + SHA512_CTX sha512; RIPEMD160_CTX ripemd160; } DIGEST_CTX; /* max(MD5_DIGEST_LENGTH, SHA_DIGEST_LENGTH, - SHA256_DIGEST_LENGTH, RIPEMD160_DIGEST_LENGTH)*2+1 */ -#define HEX_DIGEST_LENGTH 65 + SHA256_DIGEST_LENGTH, SHA512_DIGEST_LENGTH, + RIPEMD160_DIGEST_LENGTH)*2+1 */ +#define HEX_DIGEST_LENGTH 129 /* algorithm function table */ @@ -97,6 +101,9 @@ struct Algorithm_t Algorithm[] = { { "sha256", "SHA256", &SHA256_TestOutput, (DIGEST_Init*)&SHA256_Init, (DIGEST_Update*)&SHA256_Update, (DIGEST_End*)&SHA256_End, &SHA256_Data, &SHA256_File }, + { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, + (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, + &SHA512_Data, &SHA512_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } @@ -320,6 +327,17 @@ const char *SHA256_TestOutput[MDTESTCOUN "e6eae09f10ad4122a0e2a4075761d185a272ebd9f5aa489e998ff2f09cbfdd9f" }; +const char *SHA512_TestOutput[MDTESTCOUNT] = { + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75", + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", + "107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f3309e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c", + "4dbff86cc2ca1bae1e16468a05cb9881c97f1753bce3619034898faa1aabe429955a1bf8ec483d7421fe3c1646613a59ed5441fb0f321389f77f48a879c7b1f1", + "1e07be23c26a86ea37ea810c8ec7809352515a970e9253c26f536cfc7a9996c45c8370583e0a78fa4a90041d71a4ceab7423f19c71b9d5a3e01249f0bebd5894", + "72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843", + "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" +}; + const char *RIPEMD160_TestOutput[MDTESTCOUNT] = { "9c1185a5c5e9fc54612808977ee8f548b2258d31", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 02:59:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FAB5106564A; Fri, 31 Aug 2012 02:59:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A2198FC14; Fri, 31 Aug 2012 02:59:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V2xjeC055617; Fri, 31 Aug 2012 02:59:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V2xjKS055615; Fri, 31 Aug 2012 02:59:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201208310259.q7V2xjKS055615@svn.freebsd.org> From: Alan Cox Date: Fri, 31 Aug 2012 02:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239934 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 02:59:45 -0000 Author: alc Date: Fri Aug 31 02:59:44 2012 New Revision: 239934 URL: http://svn.freebsd.org/changeset/base/239934 Log: Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap. Tested by: Ian Lepore Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Aug 31 00:39:04 2012 (r239933) +++ head/sys/arm/arm/pmap.c Fri Aug 31 02:59:44 2012 (r239934) @@ -150,6 +150,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -408,6 +409,7 @@ static vm_offset_t pmap_kernel_l2ptp_kva static vm_paddr_t pmap_kernel_l2ptp_phys; static struct vm_object pvzone_obj; static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0; +static struct rwlock pvh_global_lock; /* * This list exists for the benefit of pmap_map_chunk(). It keeps track @@ -866,7 +868,7 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse l1idx = L1_IDX(va); PMAP_ASSERT_LOCKED(pm); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if ((l2 = pm->pm_l2[L2_IDX(l1idx)]) == NULL) { /* * No mapping at this address, as there is @@ -875,19 +877,19 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse */ again_l2table: PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if ((l2 = pmap_alloc_l2_dtable()) == NULL) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); return (NULL); } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); uma_zfree(l2table_zone, l2); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); l2 = pm->pm_l2[L2_IDX(l1idx)]; if (l2 == NULL) @@ -919,16 +921,16 @@ again_l2table: */ again_ptep: PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); ptep = (void*)uma_zalloc(l2zone, M_NOWAIT|M_USE_RESERVE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva != 0) { /* We lost the race. */ PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); uma_zfree(l2zone, ptep); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva == 0) goto again_ptep; @@ -1314,7 +1316,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_ int entries = 0, kentries = 0, uentries = 0; struct pv_entry *pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); /* the cache gets written back/invalidated on context switch. * therefore, if a user page shares an entry in the same page or @@ -1426,7 +1428,7 @@ pmap_clearbit(struct vm_page *pg, u_int u_int oflags; int count = 0; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; @@ -1436,7 +1438,7 @@ pmap_clearbit(struct vm_page *pg, u_int pg->md.pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF)); if (TAILQ_EMPTY(&pg->md.pv_list)) { - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (0); } @@ -1572,7 +1574,7 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) vm_page_aflag_clear(pg, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -1601,7 +1603,7 @@ pmap_enter_pv(struct vm_page *pg, struct int km; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if (pg->md.pv_kva) { /* PMAP_ASSERT_LOCKED(pmap_kernel()); */ @@ -1615,10 +1617,10 @@ pmap_enter_pv(struct vm_page *pg, struct TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list); TAILQ_INSERT_HEAD(&pve->pv_pmap->pm_pvlist, pve, pv_plist); PMAP_UNLOCK(pmap_kernel()); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (km) PMAP_LOCK(pmap_kernel()); } @@ -1647,7 +1649,7 @@ pmap_find_pv(struct vm_page *pg, pmap_t { struct pv_entry *pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) if (pm == pv->pv_pmap && va == pv->pv_va) break; @@ -1691,7 +1693,7 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t { struct pv_entry *pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_ASSERT_LOCKED(pm); TAILQ_REMOVE(&pg->md.pv_list, pve, pv_list); TAILQ_REMOVE(&pm->pm_pvlist, pve, pv_plist); @@ -1737,7 +1739,7 @@ pmap_remove_pv(struct vm_page *pg, pmap_ { struct pv_entry *pve; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); pve = TAILQ_FIRST(&pg->md.pv_list); while (pve) { @@ -1771,7 +1773,7 @@ pmap_modify_pv(struct vm_page *pg, pmap_ u_int flags, oflags; PMAP_ASSERT_LOCKED(pm); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if ((npv = pmap_find_pv(pg, pm, va)) == NULL) return (0); @@ -1878,7 +1880,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t int rv = 0; l1idx = L1_IDX(va); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); /* @@ -2075,7 +2077,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t rv = 1; out: - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); return (rv); } @@ -2400,6 +2402,11 @@ pmap_bootstrap(vm_offset_t firstaddr, vm CPU_FILL(&kernel_pmap->pm_active); kernel_pmap->pm_domain = PMAP_DOMAIN_KERNEL; TAILQ_INIT(&kernel_pmap->pm_pvlist); + + /* + * Initialize the global pv list lock. + */ + rw_init_flags(&pvh_global_lock, "pmap pv global", RW_RECURSE); /* * Reserve some special page table entries/VA space for temporary @@ -2672,7 +2679,7 @@ pmap_remove_pages(pmap_t pmap) vm_page_t m; pt_entry_t *pt; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); @@ -2701,7 +2708,7 @@ pmap_remove_pages(pmap_t pmap) pmap_free_pv_entry(pv); pmap_free_l2_bucket(pmap, l2b, 1); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); cpu_tlb_flushID(); cpu_cpwait(); PMAP_UNLOCK(pmap); @@ -2826,13 +2833,13 @@ pmap_kenter_internal(vm_offset_t va, vm_ * This expects the physical memory to have vm_page_array entry. */ if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa))) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva) { /* release vm_page lock for pv_entry UMA */ - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap_kernel()); pmap_enter_pv(m, pve, pmap_kernel(), va, PVF_WRITE | PVF_UNMAN); @@ -2841,7 +2848,7 @@ pmap_kenter_internal(vm_offset_t va, vm_ } else { m->md.pv_kva = va; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } } @@ -2902,13 +2909,13 @@ pmap_kremove(vm_offset_t va) /* note: should never have to remove an allocation * before the pvzone is initialized. */ - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap_kernel()); if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) && (pve = pmap_remove_pv(m, pmap_kernel(), va))) pmap_free_pv_entry(pve); PMAP_UNLOCK(pmap_kernel()); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); va = va & ~PAGE_MASK; cpu_dcache_wbinv_range(va, PAGE_SIZE); cpu_l2cache_wbinv_range(va, PAGE_SIZE); @@ -3126,7 +3133,7 @@ pmap_remove_all(vm_page_t m) ("pmap_remove_all: page %p is not managed", m)); if (TAILQ_EMPTY(&m->md.pv_list)) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pmap_remove_write(m); curpm = vmspace_pmap(curproc->p_vmspace); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { @@ -3175,7 +3182,7 @@ pmap_remove_all(vm_page_t m) pmap_tlb_flushD(curpm); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } @@ -3208,7 +3215,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); /* @@ -3275,7 +3282,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, if (PV_BEEN_REFD(flags)) pmap_tlb_flushD(pm); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -3299,10 +3306,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t prot, boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); pmap_enter_locked(pmap, va, m, prot, wired, M_WAITOK); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3322,7 +3329,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset vm_paddr_t pa; PMAP_ASSERT_LOCKED(pmap); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if (va == vector_page) { pa = systempage.pv_pa; m = NULL; @@ -3352,9 +3359,9 @@ do_l2b_alloc: if (l2b == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); VM_WAIT; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); goto do_l2b_alloc; } @@ -3594,14 +3601,14 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_locked(pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3618,11 +3625,11 @@ void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3640,7 +3647,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse pt_entry_t *ptep, pte; vm_page_t pg; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); l2b = pmap_get_l2_bucket(pmap, va); KASSERT(l2b, ("No l2b bucket in pmap_change_wiring")); @@ -3649,7 +3656,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse pg = PHYS_TO_VM_PAGE(l2pte_pa(pte)); if (pg) pmap_modify_pv(pg, pmap, va, PVF_WIRED, wired ? PVF_WIRED : 0); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3895,7 +3902,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, * we lock in the pmap => pv_head direction */ - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); total = 0; while (sva < eva) { @@ -3989,7 +3996,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, pmap_free_l2_bucket(pm, l2b, mappings); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if (flushall) cpu_tlb_flushID(); PMAP_UNLOCK(pm); @@ -4405,7 +4412,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { rv = TRUE; @@ -4415,7 +4422,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p if (loops >= 16) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4434,11 +4441,11 @@ pmap_page_wired_mappings(vm_page_t m) count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) if ((pv->pv_flags & PVF_WIRED) != 0) count++; - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 06:34:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6C55106566C; Fri, 31 Aug 2012 06:34:47 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77D0B8FC1A; Fri, 31 Aug 2012 06:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V6Yls4081909; Fri, 31 Aug 2012 06:34:47 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V6YllD081907; Fri, 31 Aug 2012 06:34:47 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201208310634.q7V6YllD081907@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 31 Aug 2012 06:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239935 - stable/9/usr.sbin/ifmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 06:34:47 -0000 Author: maxim Date: Fri Aug 31 06:34:46 2012 New Revision: 239935 URL: http://svn.freebsd.org/changeset/base/239935 Log: MFC r230617: allow to build ifmcstat(8) without kvm(3) support. Modified: stable/9/usr.sbin/ifmcstat/ifmcstat.c Directory Properties: stable/9/usr.sbin/ifmcstat/ (props changed) Modified: stable/9/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- stable/9/usr.sbin/ifmcstat/ifmcstat.c Fri Aug 31 02:59:44 2012 (r239934) +++ stable/9/usr.sbin/ifmcstat/ifmcstat.c Fri Aug 31 06:34:46 2012 (r239935) @@ -440,32 +440,6 @@ ll_addrlist(struct ifaddr *ifap) #ifdef INET6 static void -in6_ifinfo(struct mld_ifinfo *mli) -{ - - printf("\t"); - switch (mli->mli_version) { - case MLD_VERSION_1: - case MLD_VERSION_2: - printf("mldv%d", mli->mli_version); - break; - default: - printf("mldv?(%d)", mli->mli_version); - break; - } - printb(" flags", mli->mli_flags, "\020\1SILENT"); - if (mli->mli_version == MLD_VERSION_2) { - printf(" rv %u qi %u qri %u uri %u", - mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); - } - if (vflag >= 2) { - printf(" v1timer %u v2timer %u", mli->mli_v1_timer, - mli->mli_v2_timer); - } - printf("\n"); -} - -static void if6_addrlist(struct ifaddr *ifap) { struct ifnet ifnet; @@ -762,6 +736,33 @@ in_multientry(struct in_multi *pinm) #endif /* WITH_KVM */ #ifdef INET6 + +static void +in6_ifinfo(struct mld_ifinfo *mli) +{ + + printf("\t"); + switch (mli->mli_version) { + case MLD_VERSION_1: + case MLD_VERSION_2: + printf("mldv%d", mli->mli_version); + break; + default: + printf("mldv?(%d)", mli->mli_version); + break; + } + printb(" flags", mli->mli_flags, "\020\1SILENT"); + if (mli->mli_version == MLD_VERSION_2) { + printf(" rv %u qi %u qri %u uri %u", + mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); + } + if (vflag >= 2) { + printf(" v1timer %u v2timer %u", mli->mli_v1_timer, + mli->mli_v2_timer); + } + printf("\n"); +} + static const char * inet6_n2a(struct in6_addr *p) { From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 06:38:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E492106566C; Fri, 31 Aug 2012 06:38:44 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7D58FC15; Fri, 31 Aug 2012 06:38:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V6cim1082410; Fri, 31 Aug 2012 06:38:44 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V6cim2082406; Fri, 31 Aug 2012 06:38:44 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201208310638.q7V6cim2082406@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 31 Aug 2012 06:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239936 - in stable/9: sys/netinet6 usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 06:38:44 -0000 Author: maxim Date: Fri Aug 31 06:38:43 2012 New Revision: 239936 URL: http://svn.freebsd.org/changeset/base/239936 Log: MFC r228700: convert IPv6 read-only stats sysctls to the read-write ones. Teach netstat(1) -z to reset these sysctls. Modified: stable/9/sys/netinet6/in6_proto.c stable/9/sys/netinet6/ip6_mroute.c stable/9/usr.bin/netstat/inet6.c Directory Properties: stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/sys/netinet6/in6_proto.c ============================================================================== --- stable/9/sys/netinet6/in6_proto.c Fri Aug 31 06:34:46 2012 (r239935) +++ stable/9/sys/netinet6/in6_proto.c Fri Aug 31 06:38:43 2012 (r239936) @@ -520,7 +520,7 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ &VNET_NAME(ip6_sendredirects), 0, ""); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_RW, &VNET_NAME(ip6_defhlim), 0, ""); -SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RD, +SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(ip6stat), ip6stat, ""); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, ""); @@ -573,7 +573,7 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0, "Default value of per-interface flag for automatically adding an IPv6" " link-local address to interfaces when attached"); -SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RD, +SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RW, &VNET_NAME(rip6stat), rip6stat, ""); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_PREFER_TEMPADDR, prefer_tempaddr, CTLFLAG_RW, &VNET_NAME(ip6_prefer_tempaddr), 0, ""); @@ -603,7 +603,7 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, CTLFLAG_RW, &VNET_NAME(icmp6_redirtimeout), 0, ""); -SYSCTL_VNET_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD, +SYSCTL_VNET_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(icmp6stat), icmp6stat, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW, &VNET_NAME(nd6_prune), 0, ""); Modified: stable/9/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/9/sys/netinet6/ip6_mroute.c Fri Aug 31 06:34:46 2012 (r239935) +++ stable/9/sys/netinet6/ip6_mroute.c Fri Aug 31 06:38:43 2012 (r239936) @@ -250,7 +250,7 @@ static mifi_t nummifs = 0; static mifi_t reg_mif_num = (mifi_t)-1; static struct pim6stat pim6stat; -SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RD, +SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RW, &pim6stat, pim6stat, "PIM Statistics (struct pim6stat, netinet6/pim_var.h)"); Modified: stable/9/usr.bin/netstat/inet6.c ============================================================================== --- stable/9/usr.bin/netstat/inet6.c Fri Aug 31 06:34:46 2012 (r239935) +++ stable/9/usr.bin/netstat/inet6.c Fri Aug 31 06:38:43 2012 (r239936) @@ -360,15 +360,17 @@ static char *srcrule_str[] = { void ip6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct ip6stat ip6stat; + struct ip6stat ip6stat, zerostat; int first, i; size_t len; len = sizeof ip6stat; if (live) { memset(&ip6stat, 0, len); - if (sysctlbyname("net.inet6.ip6.stats", &ip6stat, &len, NULL, - 0) < 0) { + if (zflag) + memset(&zerostat, 0, len); + if (sysctlbyname("net.inet6.ip6.stats", &ip6stat, &len, + zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { if (errno != ENOENT) warn("sysctl: net.inet6.ip6.stats"); return; @@ -840,15 +842,17 @@ static const char *icmp6names[] = { void icmp6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct icmp6stat icmp6stat; + struct icmp6stat icmp6stat, zerostat; int i, first; size_t len; len = sizeof icmp6stat; if (live) { memset(&icmp6stat, 0, len); + if (zflag) + memset(&zerostat, 0, len); if (sysctlbyname("net.inet6.icmp6.stats", &icmp6stat, &len, - NULL, 0) < 0) { + zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { if (errno != ENOENT) warn("sysctl: net.inet6.icmp6.stats"); return; @@ -1033,14 +1037,16 @@ pim6_stats(u_long off, const char *name, void rip6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct rip6stat rip6stat; + struct rip6stat rip6stat, zerostat; u_quad_t delivered; size_t len; len = sizeof(rip6stat); if (live) { + if (zflag) + memset(&zerostat, 0, len); if (sysctlbyname("net.inet6.ip6.rip6stats", &rip6stat, &len, - NULL, 0) < 0) { + zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { if (errno != ENOENT) warn("sysctl: net.inet6.ip6.rip6stats"); return; From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 06:42:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A48B106567B; Fri, 31 Aug 2012 06:42:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3D98FC1A; Fri, 31 Aug 2012 06:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V6gqXH083023; Fri, 31 Aug 2012 06:42:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V6gqBt083019; Fri, 31 Aug 2012 06:42:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208310642.q7V6gqBt083019@svn.freebsd.org> From: Xin LI Date: Fri, 31 Aug 2012 06:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239937 - in stable: 8/sbin/md5 9/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 06:42:52 -0000 Author: delphij Date: Fri Aug 31 06:42:51 2012 New Revision: 239937 URL: http://svn.freebsd.org/changeset/base/239937 Log: Revert 239931 and 239932 until I figure out why it breaks on stable branches but not on -HEAD. Noticed by: tinderbox Pointy hat to: delphij Modified: stable/9/sbin/md5/Makefile stable/9/sbin/md5/md5.1 stable/9/sbin/md5/md5.c Directory Properties: stable/9/sbin/md5/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sbin/md5/Makefile stable/8/sbin/md5/md5.1 stable/8/sbin/md5/md5.c Directory Properties: stable/8/sbin/md5/ (props changed) Modified: stable/9/sbin/md5/Makefile ============================================================================== --- stable/9/sbin/md5/Makefile Fri Aug 31 06:38:43 2012 (r239936) +++ stable/9/sbin/md5/Makefile Fri Aug 31 06:42:51 2012 (r239937) @@ -5,13 +5,11 @@ PROG= md5 LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ - ${BINDIR}/md5 ${BINDIR}/sha256 \ - ${BINDIR}/md5 ${BINDIR}/sha512 + ${BINDIR}/md5 ${BINDIR}/sha256 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ - md5.1 sha256.1 \ - md5.1 sha512.1 + md5.1 sha256.1 WFORMAT?= 1 Modified: stable/9/sbin/md5/md5.1 ============================================================================== --- stable/9/sbin/md5/md5.1 Fri Aug 31 06:38:43 2012 (r239936) +++ stable/9/sbin/md5/md5.1 Fri Aug 31 06:42:51 2012 (r239937) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd July 31, 2012 +.Dd September 7, 2008 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , sha512, rmd160 +.Nm md5 , sha1 , sha256 , rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -21,11 +21,6 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar -.Nm sha512 -.Op Fl pqrtx -.Op Fl c Ar string -.Op Fl s Ar string -.Op Ar .Nm rmd160 .Op Fl pqrtx .Op Fl c Ar string @@ -33,7 +28,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -46,7 +41,7 @@ It is conjectured that it is computation produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The -.Tn MD5 , SHA-1 , SHA-256 , SHA-512 +.Tn MD5 , SHA-1 , SHA-256 and .Tn RIPEMD-160 algorithms are intended for digital signature applications, where a @@ -109,7 +104,7 @@ Run a built-in test script. .El .Sh EXIT STATUS The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 and .Nm rmd160 utilities exit 0 on success, @@ -120,8 +115,7 @@ and 2 if at least one file does not have .Xr md5 3 , .Xr ripemd 3 , .Xr sha 3 , -.Xr sha256 3 , -.Xr sha512 3 +.Xr sha256 3 .Rs .%A R. Rivest .%T The MD5 Message-Digest Algorithm Modified: stable/9/sbin/md5/md5.c ============================================================================== --- stable/9/sbin/md5/md5.c Fri Aug 31 06:38:43 2012 (r239936) +++ stable/9/sbin/md5/md5.c Fri Aug 31 06:42:51 2012 (r239937) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -55,7 +54,6 @@ typedef char *(DIGEST_End)(void *, char extern const char *MD5TestOutput[MDTESTCOUNT]; extern const char *SHA1_TestOutput[MDTESTCOUNT]; extern const char *SHA256_TestOutput[MDTESTCOUNT]; -extern const char *SHA512_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { @@ -80,14 +78,12 @@ typedef union { MD5_CTX md5; SHA1_CTX sha1; SHA256_CTX sha256; - SHA512_CTX sha512; RIPEMD160_CTX ripemd160; } DIGEST_CTX; /* max(MD5_DIGEST_LENGTH, SHA_DIGEST_LENGTH, - SHA256_DIGEST_LENGTH, SHA512_DIGEST_LENGTH, - RIPEMD160_DIGEST_LENGTH)*2+1 */ -#define HEX_DIGEST_LENGTH 129 + SHA256_DIGEST_LENGTH, RIPEMD160_DIGEST_LENGTH)*2+1 */ +#define HEX_DIGEST_LENGTH 65 /* algorithm function table */ @@ -101,9 +97,6 @@ struct Algorithm_t Algorithm[] = { { "sha256", "SHA256", &SHA256_TestOutput, (DIGEST_Init*)&SHA256_Init, (DIGEST_Update*)&SHA256_Update, (DIGEST_End*)&SHA256_End, &SHA256_Data, &SHA256_File }, - { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, - (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, - &SHA512_Data, &SHA512_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } @@ -327,17 +320,6 @@ const char *SHA256_TestOutput[MDTESTCOUN "e6eae09f10ad4122a0e2a4075761d185a272ebd9f5aa489e998ff2f09cbfdd9f" }; -const char *SHA512_TestOutput[MDTESTCOUNT] = { - "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", - "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75", - "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", - "107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f3309e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c", - "4dbff86cc2ca1bae1e16468a05cb9881c97f1753bce3619034898faa1aabe429955a1bf8ec483d7421fe3c1646613a59ed5441fb0f321389f77f48a879c7b1f1", - "1e07be23c26a86ea37ea810c8ec7809352515a970e9253c26f536cfc7a9996c45c8370583e0a78fa4a90041d71a4ceab7423f19c71b9d5a3e01249f0bebd5894", - "72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843", - "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" -}; - const char *RIPEMD160_TestOutput[MDTESTCOUNT] = { "9c1185a5c5e9fc54612808977ee8f548b2258d31", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 06:42:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2CD91065673; Fri, 31 Aug 2012 06:42:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2E678FC20; Fri, 31 Aug 2012 06:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V6gqFA083033; Fri, 31 Aug 2012 06:42:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V6gqVR083029; Fri, 31 Aug 2012 06:42:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208310642.q7V6gqVR083029@svn.freebsd.org> From: Xin LI Date: Fri, 31 Aug 2012 06:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239937 - in stable: 8/sbin/md5 9/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 06:42:52 -0000 Author: delphij Date: Fri Aug 31 06:42:51 2012 New Revision: 239937 URL: http://svn.freebsd.org/changeset/base/239937 Log: Revert 239931 and 239932 until I figure out why it breaks on stable branches but not on -HEAD. Noticed by: tinderbox Pointy hat to: delphij Modified: stable/8/sbin/md5/Makefile stable/8/sbin/md5/md5.1 stable/8/sbin/md5/md5.c Directory Properties: stable/8/sbin/md5/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/md5/Makefile stable/9/sbin/md5/md5.1 stable/9/sbin/md5/md5.c Directory Properties: stable/9/sbin/md5/ (props changed) Modified: stable/8/sbin/md5/Makefile ============================================================================== --- stable/8/sbin/md5/Makefile Fri Aug 31 06:38:43 2012 (r239936) +++ stable/8/sbin/md5/Makefile Fri Aug 31 06:42:51 2012 (r239937) @@ -5,13 +5,11 @@ PROG= md5 LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \ ${BINDIR}/md5 ${BINDIR}/sha1 \ - ${BINDIR}/md5 ${BINDIR}/sha256 \ - ${BINDIR}/md5 ${BINDIR}/sha512 + ${BINDIR}/md5 ${BINDIR}/sha256 MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ - md5.1 sha256.1 \ - md5.1 sha512.1 + md5.1 sha256.1 WARNS?= 6 WFORMAT?= 1 Modified: stable/8/sbin/md5/md5.1 ============================================================================== --- stable/8/sbin/md5/md5.1 Fri Aug 31 06:38:43 2012 (r239936) +++ stable/8/sbin/md5/md5.1 Fri Aug 31 06:42:51 2012 (r239937) @@ -1,9 +1,9 @@ .\" $FreeBSD$ -.Dd July 31, 2012 +.Dd September 7, 2008 .Dt MD5 1 .Os .Sh NAME -.Nm md5 , sha1 , sha256 , sha512, rmd160 +.Nm md5 , sha1 , sha256 , rmd160 .Nd calculate a message-digest fingerprint (checksum) for a file .Sh SYNOPSIS .Nm md5 @@ -21,11 +21,6 @@ .Op Fl c Ar string .Op Fl s Ar string .Op Ar -.Nm sha512 -.Op Fl pqrtx -.Op Fl c Ar string -.Op Fl s Ar string -.Op Ar .Nm rmd160 .Op Fl pqrtx .Op Fl c Ar string @@ -33,7 +28,7 @@ .Op Ar .Sh DESCRIPTION The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 and .Nm rmd160 utilities take as input a message of arbitrary length and produce as @@ -46,7 +41,7 @@ It is conjectured that it is computation produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The -.Tn MD5 , SHA-1 , SHA-256 , SHA-512 +.Tn MD5 , SHA-1 , SHA-256 and .Tn RIPEMD-160 algorithms are intended for digital signature applications, where a @@ -109,7 +104,7 @@ Run a built-in test script. .El .Sh EXIT STATUS The -.Nm md5 , sha1 , sha256 , sha512 +.Nm md5 , sha1 , sha256 and .Nm rmd160 utilities exit 0 on success, @@ -120,8 +115,7 @@ and 2 if at least one file does not have .Xr md5 3 , .Xr ripemd 3 , .Xr sha 3 , -.Xr sha256 3 , -.Xr sha512 3 +.Xr sha256 3 .Rs .%A R. Rivest .%T The MD5 Message-Digest Algorithm Modified: stable/8/sbin/md5/md5.c ============================================================================== --- stable/8/sbin/md5/md5.c Fri Aug 31 06:38:43 2012 (r239936) +++ stable/8/sbin/md5/md5.c Fri Aug 31 06:42:51 2012 (r239937) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -55,7 +54,6 @@ typedef char *(DIGEST_End)(void *, char extern const char *MD5TestOutput[MDTESTCOUNT]; extern const char *SHA1_TestOutput[MDTESTCOUNT]; extern const char *SHA256_TestOutput[MDTESTCOUNT]; -extern const char *SHA512_TestOutput[MDTESTCOUNT]; extern const char *RIPEMD160_TestOutput[MDTESTCOUNT]; typedef struct Algorithm_t { @@ -80,14 +78,12 @@ typedef union { MD5_CTX md5; SHA1_CTX sha1; SHA256_CTX sha256; - SHA512_CTX sha512; RIPEMD160_CTX ripemd160; } DIGEST_CTX; /* max(MD5_DIGEST_LENGTH, SHA_DIGEST_LENGTH, - SHA256_DIGEST_LENGTH, SHA512_DIGEST_LENGTH, - RIPEMD160_DIGEST_LENGTH)*2+1 */ -#define HEX_DIGEST_LENGTH 129 + SHA256_DIGEST_LENGTH, RIPEMD160_DIGEST_LENGTH)*2+1 */ +#define HEX_DIGEST_LENGTH 65 /* algorithm function table */ @@ -101,9 +97,6 @@ struct Algorithm_t Algorithm[] = { { "sha256", "SHA256", &SHA256_TestOutput, (DIGEST_Init*)&SHA256_Init, (DIGEST_Update*)&SHA256_Update, (DIGEST_End*)&SHA256_End, &SHA256_Data, &SHA256_File }, - { "sha512", "SHA512", &SHA512_TestOutput, (DIGEST_Init*)&SHA512_Init, - (DIGEST_Update*)&SHA512_Update, (DIGEST_End*)&SHA512_End, - &SHA512_Data, &SHA512_File }, { "rmd160", "RMD160", &RIPEMD160_TestOutput, (DIGEST_Init*)&RIPEMD160_Init, (DIGEST_Update*)&RIPEMD160_Update, (DIGEST_End*)&RIPEMD160_End, &RIPEMD160_Data, &RIPEMD160_File } @@ -327,17 +320,6 @@ const char *SHA256_TestOutput[MDTESTCOUN "e6eae09f10ad4122a0e2a4075761d185a272ebd9f5aa489e998ff2f09cbfdd9f" }; -const char *SHA512_TestOutput[MDTESTCOUNT] = { - "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", - "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75", - "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", - "107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f3309e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c", - "4dbff86cc2ca1bae1e16468a05cb9881c97f1753bce3619034898faa1aabe429955a1bf8ec483d7421fe3c1646613a59ed5441fb0f321389f77f48a879c7b1f1", - "1e07be23c26a86ea37ea810c8ec7809352515a970e9253c26f536cfc7a9996c45c8370583e0a78fa4a90041d71a4ceab7423f19c71b9d5a3e01249f0bebd5894", - "72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843", - "e8a835195e039708b13d9131e025f4441dbdc521ce625f245a436dcd762f54bf5cb298d96235e6c6a304e087ec8189b9512cbdf6427737ea82793460c367b9c3" -}; - const char *RIPEMD160_TestOutput[MDTESTCOUNT] = { "9c1185a5c5e9fc54612808977ee8f548b2258d31", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 08:48:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FE87106566B; Fri, 31 Aug 2012 08:48:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B77B8FC29; Fri, 31 Aug 2012 08:48:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V8msTa099633; Fri, 31 Aug 2012 08:48:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V8msTV099631; Fri, 31 Aug 2012 08:48:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208310848.q7V8msTV099631@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 08:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239938 - head/usr.sbin/ac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 08:48:54 -0000 Author: ed Date: Fri Aug 31 08:48:53 2012 New Revision: 239938 URL: http://svn.freebsd.org/changeset/base/239938 Log: Use better variable naming. MFC after: 1 month Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Fri Aug 31 06:42:51 2012 (r239937) +++ head/usr.sbin/ac/ac.c Fri Aug 31 08:48:53 2012 (r239938) @@ -269,8 +269,7 @@ show_today(struct timeval today) struct user_entry *up; struct utmpx_entry *lp; char date[64]; - struct timeval usec = { 0, 1 }; - struct timeval yesterday; + struct timeval diff, total = { 0, 0 }, usec = { 0, 1 }, yesterday; static int d_first = -1; if (d_first < 0) @@ -280,23 +279,19 @@ show_today(struct timeval today) d_first ? "%e %b total" : "%b %e total", localtime(&yesterday.tv_sec)); - /* restore the missing second */ - timeradd(&today, &usec, &yesterday); - SLIST_FOREACH(lp, &CurUtmpx, next) { - timersub(&yesterday, &lp->time, &today); - update_user(lp->user, today); + timersub(&today, &lp->time, &diff); + update_user(lp->user, diff); /* As if they just logged in. */ - lp->time = yesterday; + lp->time = today; } - timerclear(&today); SLIST_FOREACH(up, &Users, next) { - timeradd(&today, &up->time, &today); + timeradd(&total, &up->time, &total); /* For next day. */ timerclear(&up->time); } - if (timerisset(&today)) - (void)printf("%s %11.2f\n", date, (double)today.tv_sec / 3600); + if (timerisset(&total)) + (void)printf("%s %11.2f\n", date, (double)total.tv_sec / 3600); } /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 09:42:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 982511065673; Fri, 31 Aug 2012 09:42:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832238FC18; Fri, 31 Aug 2012 09:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7V9glkv007018; Fri, 31 Aug 2012 09:42:47 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V9glpp007014; Fri, 31 Aug 2012 09:42:47 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201208310942.q7V9glpp007014@svn.freebsd.org> From: Scott Long Date: Fri, 31 Aug 2012 09:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239939 - head/sys/dev/amr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 09:42:47 -0000 Author: scottl Date: Fri Aug 31 09:42:46 2012 New Revision: 239939 URL: http://svn.freebsd.org/changeset/base/239939 Log: Essentially revert r239912. The amr_periodic function hadn't been armed in over 10 years and was dead code; the previous revision exposed it as such to CLANG. The solution is to cull the whole thing. Modified: head/sys/dev/amr/amr.c head/sys/dev/amr/amr_pci.c head/sys/dev/amr/amrvar.h Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Fri Aug 31 08:48:53 2012 (r239938) +++ head/sys/dev/amr/amr.c Fri Aug 31 09:42:46 2012 (r239939) @@ -139,11 +139,6 @@ static void amr_setup_ccb(void *arg, bus static void amr_abort_load(struct amr_command *ac); /* - * Status monitoring - */ -static void amr_periodic(void *data); - -/* * Interface-specific shims */ static int amr_quartz_submit_command(struct amr_command *ac); @@ -348,11 +343,6 @@ amr_startup(void *arg) /* interrupts will be enabled before we do anything more */ sc->amr_state |= AMR_STATE_INTEN; - /* - * Start the timeout routine. - */ -/* callout_reset(&sc->amr_timeout, hz, amr_periodic, sc);*/ - return; } @@ -391,9 +381,6 @@ amr_free(struct amr_softc *sc) if (sc->amr_pass != NULL) device_delete_child(sc->amr_dev, sc->amr_pass); - /* cancel status timeout */ - callout_drain(&sc->amr_timeout); - /* throw away any command buffers */ while ((acc = TAILQ_FIRST(&sc->amr_cmd_clusters)) != NULL) { TAILQ_REMOVE(&sc->amr_cmd_clusters, acc, acc_link); @@ -959,31 +946,6 @@ out: /******************************************************************************** ******************************************************************************** - Status Monitoring - ******************************************************************************** - ********************************************************************************/ - -/******************************************************************************** - * Perform a periodic check of the controller status - */ -static void -amr_periodic(void *data) -{ - struct amr_softc *sc = (struct amr_softc *)data; - - debug_called(2); - - /* XXX perform periodic status checks here */ - - /* compensate for missed interrupts */ - amr_done(sc); - - /* reschedule */ - callout_reset(&sc->amr_timeout, hz, amr_periodic, sc); -} - -/******************************************************************************** - ******************************************************************************** Command Wrappers ******************************************************************************** ********************************************************************************/ Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Fri Aug 31 08:48:53 2012 (r239938) +++ head/sys/dev/amr/amr_pci.c Fri Aug 31 09:42:46 2012 (r239939) @@ -331,7 +331,6 @@ amr_pci_attach(device_t dev) */ mtx_init(&sc->amr_list_lock, "AMR List Lock", NULL, MTX_DEF); mtx_init(&sc->amr_hw_lock, "AMR HW Lock", NULL, MTX_DEF); - callout_init(&sc->amr_timeout, CALLOUT_MPSAFE); if ((error = amr_setup_mbox(sc)) != 0) goto out; Modified: head/sys/dev/amr/amrvar.h ============================================================================== --- head/sys/dev/amr/amrvar.h Fri Aug 31 08:48:53 2012 (r239938) +++ head/sys/dev/amr/amrvar.h Fri Aug 31 09:42:46 2012 (r239939) @@ -256,7 +256,6 @@ struct amr_softc device_t amr_pass; int (*amr_cam_command)(struct amr_softc *sc, struct amr_command **acp); struct intr_config_hook amr_ich; /* wait-for-interrupts probe hook */ - struct callout amr_timeout; /* periodic status check */ int amr_allow_vol_config; int amr_linux_no_adapters; int amr_ld_del_supported; From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 10:07:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE978106566B; Fri, 31 Aug 2012 10:07:38 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89628FC0C; Fri, 31 Aug 2012 10:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VA7cel011003; Fri, 31 Aug 2012 10:07:38 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VA7cwT010999; Fri, 31 Aug 2012 10:07:38 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201208311007.q7VA7cwT010999@svn.freebsd.org> From: Scott Long Date: Fri, 31 Aug 2012 10:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239940 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 10:07:38 -0000 Author: scottl Date: Fri Aug 31 10:07:38 2012 New Revision: 239940 URL: http://svn.freebsd.org/changeset/base/239940 Log: Heavily optimize the case of small RX packets of 160 bytes or less. For this case, allocate a plain mbuf and copy the frame into it, then send the copy up the stack, leaving the original mbuf+cluster in place in the receive ring for immediate re-use. This saves a trip through 2 of the 3 zones of the compound mbuf allocator, a trip through busdma, and a trip through the 1 of the 3 mbuf destructors. For our load at Netflix, this can lower CPU consumption by as much as 20%. The copy algorithm is based on investigative work from Luigi Rizzo earlier in the year. Reviewed by: jfv Obtained from: Netflix Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_osdep.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Aug 31 09:42:46 2012 (r239939) +++ head/sys/dev/ixgbe/ixgbe.c Fri Aug 31 10:07:38 2012 (r239940) @@ -3734,21 +3734,30 @@ no_split: mp = rxbuf->m_pack; mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->ptag, - rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf("Refresh mbufs: payload dmamap load" - " failure - %d\n", error); - m_free(mp); - rxbuf->m_pack = NULL; - goto update; + + /* If we're dealing with an mbuf that was copied rather + * than replaced, there's no need to go through busdma. + */ + if ((rxbuf->flags & IXGBE_RX_COPY) == 0) { + /* Get the memory mapping */ + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + printf("Refresh mbufs: payload dmamap load" + " failure - %d\n", error); + m_free(mp); + rxbuf->m_pack = NULL; + goto update; + } + rxbuf->m_pack = mp; + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + BUS_DMASYNC_PREREAD); + rxbuf->paddr = rxr->rx_base[i].read.pkt_addr = + htole64(pseg[0].ds_addr); + } else { + rxr->rx_base[i].read.pkt_addr = rxbuf->paddr; + rxbuf->flags &= ~IXGBE_RX_COPY; } - rxbuf->m_pack = mp; - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, - BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.pkt_addr = - htole64(pseg[0].ds_addr); refreshed = TRUE; /* Next is precalculated */ @@ -4061,6 +4070,7 @@ skip_head: rxr->next_to_refresh = 0; rxr->lro_enabled = FALSE; rxr->rx_split_packets = 0; + rxr->rx_copies = 0; rxr->rx_bytes = 0; rxr->discard = FALSE; rxr->vtag_strip = FALSE; @@ -4618,14 +4628,37 @@ ixgbe_rxeof(struct ix_queue *que, int co ** that determines what we are */ sendmp = rbuf->fmp; - rbuf->m_pack = rbuf->fmp = NULL; if (sendmp != NULL) { /* secondary frag */ + rbuf->m_pack = rbuf->fmp = NULL; mp->m_flags &= ~M_PKTHDR; sendmp->m_pkthdr.len += mp->m_len; } else { + /* + * Optimize. This might be a small packet, + * maybe just a TCP ACK. Do a fast copy that + * is cache aligned into a new mbuf, and + * leave the old mbuf+cluster for re-use. + */ + if (eop && plen <= IXGBE_RX_COPY_LEN) { + prefetch(mp->m_data); + sendmp = m_gethdr(M_DONTWAIT, MT_DATA); + if (sendmp != NULL) { + sendmp->m_data += + IXGBE_RX_COPY_ALIGN; + ixgbe_bcopy(mp->m_data, + sendmp->m_data, plen); + sendmp->m_len = plen; + rxr->rx_copies++; + rbuf->flags |= IXGBE_RX_COPY; + } + } + if (sendmp == NULL) { + rbuf->m_pack = rbuf->fmp = NULL; + sendmp = mp; + } + /* first desc of a non-ps chain */ - sendmp = mp; sendmp->m_flags |= M_PKTHDR; sendmp->m_pkthdr.len = mp->m_len; if (staterr & IXGBE_RXD_STAT_VP) { @@ -5476,6 +5509,9 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, &rxr->rx_bytes, "Queue Bytes Received"); + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_copies", + CTLFLAG_RD, &rxr->rx_copies, + "Copied RX Frames"); SYSCTL_ADD_INT(ctx, queue_list, OID_AUTO, "lro_queued", CTLFLAG_RD, &lro->lro_queued, 0, "LRO Queued"); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Aug 31 09:42:46 2012 (r239939) +++ head/sys/dev/ixgbe/ixgbe.h Fri Aug 31 10:07:38 2012 (r239940) @@ -154,6 +154,19 @@ #define IXGBE_FC_HI 0x20000 #define IXGBE_FC_LO 0x10000 +/* + * Used for optimizing small rx mbufs. Effort is made to keep the copy + * small and aligned for the CPU L1 cache. + * + * MHLEN is typically 168 bytes, giving us 8-byte alignment. Getting + * 32 byte alignment needed for the fast bcopy results in 8 bytes being + * wasted. Getting 64 byte alignment, which _should_ be ideal for + * modern Intel CPUs, results in 40 bytes wasted and a significant drop + * in observed efficiency of the optimization, 97.9% -> 81.8%. + */ +#define IXGBE_RX_COPY_LEN 160 +#define IXGBE_RX_COPY_ALIGN (MHLEN - IXGBE_RX_COPY_LEN) + /* Keep older OS drivers building... */ #if !defined(SYSCTL_ADD_UQUAD) #define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD @@ -245,6 +258,9 @@ struct ixgbe_rx_buf { struct mbuf *fmp; bus_dmamap_t hmap; bus_dmamap_t pmap; + u_int flags; +#define IXGBE_RX_COPY 0x01 + uint64_t paddr; }; /* @@ -339,6 +355,7 @@ struct rx_ring { /* Soft stats */ u64 rx_irq; u64 rx_split_packets; + u64 rx_copies; u64 rx_packets; u64 rx_bytes; u64 rx_discarded; Modified: head/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_osdep.h Fri Aug 31 09:42:46 2012 (r239939) +++ head/sys/dev/ixgbe/ixgbe_osdep.h Fri Aug 31 10:07:38 2012 (r239940) @@ -143,6 +143,25 @@ void prefetch(void *x) #define prefetch(x) #endif +/* + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes + * non-overlapping regions and 32-byte padding on both src and dst. + */ +static __inline int +ixgbe_bcopy(void *_src, void *_dst, int l) +{ + uint64_t *src = _src; + uint64_t *dst = _dst; + + for (; l > 0; l -= 32) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } + return (0); +} + struct ixgbe_osdep { bus_space_tag_t mem_bus_space_tag; From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 10:11:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C6AA1065676; Fri, 31 Aug 2012 10:11:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 0086B8FC17; Fri, 31 Aug 2012 10:11:07 +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 q7VAB0nF098129; Fri, 31 Aug 2012 14:11:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q7VAB0Q2098128; Fri, 31 Aug 2012 14:11:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 31 Aug 2012 14:11:00 +0400 From: Gleb Smirnoff To: Scott Long Message-ID: <20120831101100.GL90597@FreeBSD.org> References: <201208311007.q7VA7cwT010999@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201208311007.q7VA7cwT010999@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r239940 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 10:11:08 -0000 Scott, On Fri, Aug 31, 2012 at 10:07:38AM +0000, Scott Long wrote: S> +/* S> + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes S> + * non-overlapping regions and 32-byte padding on both src and dst. S> + */ S> +static __inline int S> +ixgbe_bcopy(void *_src, void *_dst, int l) S> +{ S> + uint64_t *src = _src; S> + uint64_t *dst = _dst; S> + S> + for (; l > 0; l -= 32) { S> + *dst++ = *src++; S> + *dst++ = *src++; S> + *dst++ = *src++; S> + *dst++ = *src++; S> + } S> + return (0); S> +} S> + Shouldn't this go to libkern? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 11:15:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECEFA106564A; Fri, 31 Aug 2012 11:15:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D27A18FC14; Fri, 31 Aug 2012 11:15:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VBF1id020913; Fri, 31 Aug 2012 11:15:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VBF1TK020909; Fri, 31 Aug 2012 11:15:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208311115.q7VBF1TK020909@svn.freebsd.org> From: Marius Strobl Date: Fri, 31 Aug 2012 11:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239941 - in head/sys/sparc64: include pci sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 11:15:02 -0000 Author: marius Date: Fri Aug 31 11:15:01 2012 New Revision: 239941 URL: http://svn.freebsd.org/changeset/base/239941 Log: Add a global MD macro for the VIS block size instead of duplicating it and using magic values all over the place. MFC after: 1 week Modified: head/sys/sparc64/include/fsr.h head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/include/fsr.h ============================================================================== --- head/sys/sparc64/include/fsr.h Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/include/fsr.h Fri Aug 31 11:15:01 2012 (r239941) @@ -31,6 +31,8 @@ #define FPRS_DU (1 << 1) #define FPRS_FEF (1 << 2) +#define VIS_BLOCKSIZE 64 + #ifndef LOCORE #define FSR_EXC_BITS 5 Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/pci/fire.c Fri Aug 31 11:15:01 2012 (r239941) @@ -1503,8 +1503,6 @@ fire_read_ivar(device_t dev, device_t ch return (ENOENT); } -#define VIS_BLOCKSIZE 64 - static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, bus_dmasync_op_t op) Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/pci/schizo.c Fri Aug 31 11:15:01 2012 (r239941) @@ -1214,8 +1214,6 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus membar(Sync); } -#define VIS_BLOCKSIZE 64 - static void ichip_dmamap_sync(bus_dma_tag_t dt, bus_dmamap_t map, bus_dmasync_op_t op) { Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/sparc64/support.S Fri Aug 31 11:15:01 2012 (r239941) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -591,10 +590,10 @@ ENTRY(spitfire_block_copy) andcc %o5, FPRS_FEF, %g0 bz,a,pt %xcc, 1f nop - stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi - stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi - stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi - stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + stda %f0, [PCB_REG + PCB_UFP + (0 * VIS_BLOCKSIZE)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * VIS_BLOCKSIZE)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * VIS_BLOCKSIZE)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * VIS_BLOCKSIZE)] %asi membar #Sync andn %o5, FPRS_FEF, %o5 @@ -606,8 +605,8 @@ ENTRY(spitfire_block_copy) 1: wrpr %o3, 0, %pstate ldda [%o0] %asi, %f0 - add %o0, 64, %o0 - sub %o2, 64, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + sub %o2, VIS_BLOCKSIZE, %o2 2: ldda [%o0] %asi, %f16 fsrc1 %f0, %f32 @@ -619,10 +618,10 @@ ENTRY(spitfire_block_copy) fsrc1 %f12, %f44 fsrc1 %f14, %f46 stda %f32, [%o1] %asi - add %o0, 64, %o0 - subcc %o2, 64, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + subcc %o2, VIS_BLOCKSIZE, %o2 bz,pn %xcc, 3f - add %o1, 64, %o1 + add %o1, VIS_BLOCKSIZE, %o1 ldda [%o0] %asi, %f0 fsrc1 %f16, %f32 fsrc1 %f18, %f34 @@ -633,10 +632,10 @@ ENTRY(spitfire_block_copy) fsrc1 %f28, %f44 fsrc1 %f30, %f46 stda %f32, [%o1] %asi - add %o0, 64, %o0 - sub %o2, 64, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + sub %o2, VIS_BLOCKSIZE, %o2 ba,pt %xcc, 2b - add %o1, 64, %o1 + add %o1, VIS_BLOCKSIZE, %o1 3: membar #Sync @@ -651,7 +650,7 @@ END(spitfire_block_copy) * void zeus_block_copy(void *src, void *dst, size_t len) */ ENTRY(zeus_block_copy) - prefetch [%o0 + (0 * 64)], 0 + prefetch [%o0 + (0 * VIS_BLOCKSIZE)], 0 rdpr %pstate, %o3 wrpr %g0, PSTATE_NORMAL, %pstate @@ -664,10 +663,10 @@ ENTRY(zeus_block_copy) andcc %o5, FPRS_FEF, %g0 bz,a,pt %xcc, 1f nop - stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi - stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi - stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi - stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + stda %f0, [PCB_REG + PCB_UFP + (0 * VIS_BLOCKSIZE)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * VIS_BLOCKSIZE)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * VIS_BLOCKSIZE)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * VIS_BLOCKSIZE)] %asi membar #Sync andn %o5, FPRS_FEF, %o5 @@ -679,32 +678,32 @@ ENTRY(zeus_block_copy) 1: wrpr %o3, 0, %pstate ldd [%o0 + (0 * 8)], %f0 - prefetch [%o0 + (1 * 64)], 0 + prefetch [%o0 + (1 * VIS_BLOCKSIZE)], 0 ldd [%o0 + (1 * 8)], %f2 - prefetch [%o0 + (2 * 64)], 0 + prefetch [%o0 + (2 * VIS_BLOCKSIZE)], 0 fmovd %f0, %f32 ldd [%o0 + (2 * 8)], %f4 - prefetch [%o0 + (3 * 64)], 0 + prefetch [%o0 + (3 * VIS_BLOCKSIZE)], 0 fmovd %f2, %f34 ldd [%o0 + (3 * 8)], %f6 - prefetch [%o0 + (4 * 64)], 1 + prefetch [%o0 + (4 * VIS_BLOCKSIZE)], 1 fmovd %f4, %f36 ldd [%o0 + (4 * 8)], %f8 - prefetch [%o0 + (8 * 64)], 1 + prefetch [%o0 + (8 * VIS_BLOCKSIZE)], 1 fmovd %f6, %f38 ldd [%o0 + (5 * 8)], %f10 - prefetch [%o0 + (12 * 64)], 1 + prefetch [%o0 + (12 * VIS_BLOCKSIZE)], 1 fmovd %f8, %f40 ldd [%o0 + (6 * 8)], %f12 - prefetch [%o0 + (16 * 64)], 1 + prefetch [%o0 + (16 * VIS_BLOCKSIZE)], 1 fmovd %f10, %f42 ldd [%o0 + (7 * 8)], %f14 ldd [%o0 + (8 * 8)], %f0 - sub %o2, 64, %o2 - add %o0, 64, %o0 - prefetch [%o0 + (19 * 64)], 1 + sub %o2, VIS_BLOCKSIZE, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + prefetch [%o0 + (19 * VIS_BLOCKSIZE)], 1 ba,pt %xcc, 2f - prefetch [%o0 + (23 * 64)], 1 + prefetch [%o0 + (23 * VIS_BLOCKSIZE)], 1 .align 32 2: ldd [%o0 + (1 * 8)], %f2 @@ -724,14 +723,14 @@ ENTRY(zeus_block_copy) fmovd %f8, %f40 ldd [%o0 + (8 * 8)], %f0 fmovd %f10, %f42 - sub %o2, 64, %o2 - prefetch [%o0 + (3 * 64)], 0 - add %o1, 64, %o1 - prefetch [%o0 + (24 * 64)], 1 - add %o0, 64, %o0 - cmp %o2, 64 + 8 + sub %o2, VIS_BLOCKSIZE, %o2 + prefetch [%o0 + (3 * VIS_BLOCKSIZE)], 0 + add %o1, VIS_BLOCKSIZE, %o1 + prefetch [%o0 + (24 * VIS_BLOCKSIZE)], 1 + add %o0, VIS_BLOCKSIZE, %o0 + cmp %o2, VIS_BLOCKSIZE + 8 bgu,pt %xcc, 2b - prefetch [%o0 + (12 * 64)], 1 + prefetch [%o0 + (12 * VIS_BLOCKSIZE)], 1 ldd [%o0 + (1 * 8)], %f2 fsrc1 %f12, %f44 ldd [%o0 + (2 * 8)], %f4 @@ -747,7 +746,7 @@ ENTRY(zeus_block_copy) fsrc1 %f6, %f38 ldd [%o0 + (7 * 8)], %f14 fsrc1 %f8, %f40 - add %o1, 64, %o1 + add %o1, VIS_BLOCKSIZE, %o1 fsrc1 %f10, %f42 fsrc1 %f12, %f44 fsrc1 %f14, %f46 @@ -775,10 +774,10 @@ ENTRY(spitfire_block_zero) andcc %o5, FPRS_FEF, %g0 bz,a,pt %xcc, 1f nop - stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi - stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi - stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi - stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + stda %f0, [PCB_REG + PCB_UFP + (0 * VIS_BLOCKSIZE)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * VIS_BLOCKSIZE)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * VIS_BLOCKSIZE)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * VIS_BLOCKSIZE)] %asi membar #Sync andn %o5, FPRS_FEF, %o5 @@ -798,13 +797,13 @@ ENTRY(spitfire_block_zero) fzero %f12 fzero %f14 -1: stda %f0, [%o0] %asi - stda %f0, [%o0 + 64] %asi - stda %f0, [%o0 + 128] %asi - stda %f0, [%o0 + 192] %asi - sub %o1, 256, %o1 +1: stda %f0, [%o0 + (0 * VIS_BLOCKSIZE)] %asi + stda %f0, [%o0 + (1 * VIS_BLOCKSIZE)] %asi + stda %f0, [%o0 + (2 * VIS_BLOCKSIZE)] %asi + stda %f0, [%o0 + (3 * VIS_BLOCKSIZE)] %asi + sub %o1, (4 * VIS_BLOCKSIZE), %o1 brnz,pt %o1, 1b - add %o0, 256, %o0 + add %o0, (4 * VIS_BLOCKSIZE), %o0 membar #Sync retl From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 11:20:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77B091065670; Fri, 31 Aug 2012 11:20:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60ACC8FC08; Fri, 31 Aug 2012 11:20:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VBKD8b021502; Fri, 31 Aug 2012 11:20:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VBKD0i021496; Fri, 31 Aug 2012 11:20:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311120.q7VBKD0i021496@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 11:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239942 - in stable/9/sys: amd64/amd64 amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 11:20:13 -0000 Author: kib Date: Fri Aug 31 11:20:12 2012 New Revision: 239942 URL: http://svn.freebsd.org/changeset/base/239942 Log: MFC r238450: Add support for the XSAVEOPT instruction use. Modified: stable/9/sys/amd64/amd64/cpu_switch.S stable/9/sys/amd64/amd64/fpu.c stable/9/sys/amd64/include/md_var.h stable/9/sys/amd64/include/specialreg.h stable/9/sys/i386/include/specialreg.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/9/sys/amd64/amd64/cpu_switch.S Fri Aug 31 11:15:01 2012 (r239941) +++ stable/9/sys/amd64/amd64/cpu_switch.S Fri Aug 31 11:20:12 2012 (r239942) @@ -122,6 +122,9 @@ done_store_dr: 1: movq %rdx,%rcx movl xsave_mask,%eax movl xsave_mask+4,%edx + .globl ctx_switch_xsave +ctx_switch_xsave: + /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ xsave (%r8) movq %rcx,%rdx 2: smsw %ax Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:15:01 2012 (r239941) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:20:12 2012 (r239942) @@ -132,10 +132,16 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, NULL, 1, "Floating point instructions executed in hardware"); +static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static struct savefpu *fpu_initialstate; +struct xsave_area_elm_descr { + u_int offset; + u_int size; +} *xsave_area_desc; + void fpusave(void *addr) { @@ -182,6 +188,17 @@ fpuinit_bsp1(void) TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user); xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; xsave_mask &= xsave_mask_user; + + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { + /* + * Patch the XSAVE instruction in the cpu_switch code + * to XSAVEOPT. We assume that XSAVE encoding used + * REX byte, and set the bit 4 of the r/m byte. + */ + ctx_switch_xsave[3] |= 0x10; + use_xsaveopt = 1; + } } /* @@ -252,6 +269,7 @@ static void fpuinitstate(void *arg __unused) { register_t saveintr; + int cp[4], i, max_ext_n; fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF, M_WAITOK | M_ZERO); @@ -273,6 +291,28 @@ fpuinitstate(void *arg __unused) */ bzero(&fpu_initialstate->sv_xmm[0], sizeof(struct xmmacc)); + /* + * Create a table describing the layout of the CPU Extended + * Save Area. + */ + if (use_xsaveopt) { + max_ext_n = flsl(xsave_mask); + xsave_area_desc = malloc(max_ext_n * sizeof(struct + xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); + /* x87 state */ + xsave_area_desc[0].offset = 0; + xsave_area_desc[0].size = 160; + /* XMM */ + xsave_area_desc[1].offset = 160; + xsave_area_desc[1].size = 288 - 160; + + for (i = 2; i < max_ext_n; i++) { + cpuid_count(0xd, i, cp); + xsave_area_desc[i].offset = cp[1]; + xsave_area_desc[i].size = cp[0]; + } + } + start_emulating(); intr_restore(saveintr); } @@ -560,8 +600,14 @@ fpudna(void) * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * fpu_initialstate, to ignite the XSAVEOPT + * tracking engine. */ - fpurestore(fpu_initialstate); + bcopy(fpu_initialstate, pcb->pcb_save, cpu_max_ext_state_size); + fpurestore(pcb->pcb_save); if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(pcb->pcb_initial_fpucw); if (PCB_USER_FPU(pcb)) @@ -596,6 +642,9 @@ int fpugetregs(struct thread *td) { struct pcb *pcb; + uint64_t *xstate_bv, bit; + char *sa; + int max_ext_n, i; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -613,6 +662,25 @@ fpugetregs(struct thread *td) return (_MC_FPOWNED_FPU); } else { critical_exit(); + if (use_xsaveopt) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + max_ext_n = flsl(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1 << i; + if ((*xstate_bv & bit) != 0) + continue; + bcopy((char *)fpu_initialstate + + xsave_area_desc[i].offset, + sa + xsave_area_desc[i].offset, + xsave_area_desc[i].size); + *xstate_bv |= bit; + } + } return (_MC_FPOWNED_PCB); } } Modified: stable/9/sys/amd64/include/md_var.h ============================================================================== --- stable/9/sys/amd64/include/md_var.h Fri Aug 31 11:15:01 2012 (r239941) +++ stable/9/sys/amd64/include/md_var.h Fri Aug 31 11:20:12 2012 (r239942) @@ -57,6 +57,7 @@ extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; extern u_int cpu_vendor_id; +extern char ctx_switch_xsave[]; extern char kstack[]; extern char sigcode[]; extern int szsigcode; Modified: stable/9/sys/amd64/include/specialreg.h ============================================================================== --- stable/9/sys/amd64/include/specialreg.h Fri Aug 31 11:15:01 2012 (r239941) +++ stable/9/sys/amd64/include/specialreg.h Fri Aug 31 11:20:12 2012 (r239942) @@ -236,6 +236,11 @@ #define CPUID_TYPE_CORE 2 /* + * CPUID instruction 0xd Processor Extended State Enumeration Sub-leaf 1 + */ +#define CPUID_EXTSTATE_XSAVEOPT 0x00000001 + +/* * AMD extended function 8000_0007h edx info */ #define AMDPM_TS 0x00000001 Modified: stable/9/sys/i386/include/specialreg.h ============================================================================== --- stable/9/sys/i386/include/specialreg.h Fri Aug 31 11:15:01 2012 (r239941) +++ stable/9/sys/i386/include/specialreg.h Fri Aug 31 11:20:12 2012 (r239942) @@ -223,6 +223,11 @@ #define CPUID_TYPE_CORE 2 /* + * CPUID instruction 0xd Processor Extended State Enumeration Sub-leaf 1 + */ +#define CPUID_EXTSTATE_XSAVEOPT 0x00000001 + +/* * AMD extended function 8000_0007h edx info */ #define AMDPM_TS 0x00000001 From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 11:29:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9473D106566C; Fri, 31 Aug 2012 11:29:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7AD8FC08; Fri, 31 Aug 2012 11:29:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VBTe6g022606; Fri, 31 Aug 2012 11:29:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VBTe2m022604; Fri, 31 Aug 2012 11:29:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311129.q7VBTe2m022604@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 11:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239943 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 11:29:40 -0000 Author: kib Date: Fri Aug 31 11:29:39 2012 New Revision: 239943 URL: http://svn.freebsd.org/changeset/base/239943 Log: MFC r238597: Add stmxcsr. MFC r238914, only amd64 part, do not record mi: Change (unused) prototype for stmxcsr() to match reality. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:20:12 2012 (r239942) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:29:39 2012 (r239943) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) +#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) static __inline void xrstor(char *addr, uint64_t mask) @@ -105,6 +106,7 @@ void fnstsw(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); +void stmxcsr(u_int *csr); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 11:33:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 370FD1065674; Fri, 31 Aug 2012 11:33:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 215A98FC0C; Fri, 31 Aug 2012 11:33:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VBXs0w023193; Fri, 31 Aug 2012 11:33:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VBXsaP023189; Fri, 31 Aug 2012 11:33:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311133.q7VBXsaP023189@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 11:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239944 - in stable/9/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 11:33:55 -0000 Author: kib Date: Fri Aug 31 11:33:54 2012 New Revision: 239944 URL: http://svn.freebsd.org/changeset/base/239944 Log: MFC r238598: On AMD64, provide siginfo.si_code for floating point errors when error occurs using the SSE math processor. Update comments describing the handling of the exception status bits in coprocessors control words. Modified: stable/9/sys/amd64/amd64/fpu.c stable/9/sys/amd64/amd64/trap.c stable/9/sys/amd64/include/fpu.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:29:39 2012 (r239943) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:33:54 2012 (r239944) @@ -115,9 +115,6 @@ void xsave(char *addr, uint64_t mask); #define start_emulating() load_cr0(rcr0() | CR0_TS) #define stop_emulating() clts() -#define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) -#define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) - CTASSERT(sizeof(struct savefpu) == 512); CTASSERT(sizeof(struct xstate_hdr) == 64); CTASSERT(sizeof(struct savefpu_ymm) == 832); @@ -516,11 +513,15 @@ static char fpetable[128] = { }; /* - * Preserve the FP status word, clear FP exceptions, then generate a SIGFPE. + * Preserve the FP status word, clear FP exceptions for x87, then + * generate a SIGFPE. + * + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs and is + * engraved in our i386 ABI. We now depend on longjmp() restoring a + * usable state. Restoring the state or examining it might fail if we + * didn't clear exceptions. * - * Clearing exceptions is necessary mainly to avoid IRQ13 bugs. We now - * depend on longjmp() restoring a usable state. Restoring the state - * or examining it might fail if we didn't clear exceptions. + * For SSE exceptions, the exceptions are not cleared. * * The error code chosen will be one of the FPE_... macros. It will be * sent as the second argument to old BSD-style signal handlers and as @@ -533,8 +534,9 @@ static char fpetable[128] = { * solution for signals other than SIGFPE. */ int -fputrap() +fputrap_x87(void) { + struct savefpu *pcb_save; u_short control, status; critical_enter(); @@ -545,19 +547,33 @@ fputrap() * wherever they are. */ if (PCPU_GET(fpcurthread) != curthread) { - control = GET_FPU_CW(curthread); - status = GET_FPU_SW(curthread); + pcb_save = PCPU_GET(curpcb)->pcb_save; + control = pcb_save->sv_env.en_cw; + status = pcb_save->sv_env.en_sw; } else { fnstcw(&control); fnstsw(&status); + fnclex(); } - if (PCPU_GET(fpcurthread) == curthread) - fnclex(); critical_exit(); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } +int +fputrap_sse(void) +{ + u_int mxcsr; + + critical_enter(); + if (PCPU_GET(fpcurthread) != curthread) + mxcsr = PCPU_GET(curpcb)->pcb_save->sv_env.en_mxcsr; + else + stmxcsr(&mxcsr); + critical_exit(); + return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); +} + /* * Implement device not available (DNA) exception * Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Fri Aug 31 11:29:39 2012 (r239943) +++ stable/9/sys/amd64/amd64/trap.c Fri Aug 31 11:33:54 2012 (r239944) @@ -333,7 +333,7 @@ trap(struct trapframe *frame) break; case T_ARITHTRAP: /* arithmetic trap */ - ucode = fputrap(); + ucode = fputrap_x87(); if (ucode == -1) goto userout; i = SIGFPE; @@ -447,7 +447,9 @@ trap(struct trapframe *frame) break; case T_XMMFLT: /* SIMD floating-point exception */ - ucode = 0; /* XXX */ + ucode = fputrap_sse(); + if (ucode == -1) + goto userout; i = SIGFPE; break; } Modified: stable/9/sys/amd64/include/fpu.h ============================================================================== --- stable/9/sys/amd64/include/fpu.h Fri Aug 31 11:29:39 2012 (r239943) +++ stable/9/sys/amd64/include/fpu.h Fri Aug 31 11:33:54 2012 (r239944) @@ -145,7 +145,8 @@ int fpusetregs(struct thread *td, struct char *xfpustate, size_t xfpustate_size); int fpusetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size); -int fputrap(void); +int fputrap_sse(void); +int fputrap_x87(void); void fpuuserinited(struct thread *td); struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags); void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx); From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 11:48:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97F8D106566C; Fri, 31 Aug 2012 11:48:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829C48FC12; Fri, 31 Aug 2012 11:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VBm5oT024867; Fri, 31 Aug 2012 11:48:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VBm5o4024861; Fri, 31 Aug 2012 11:48:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311148.q7VBm5o4024861@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 11:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239945 - in stable/9/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 11:48:05 -0000 Author: kib Date: Fri Aug 31 11:48:04 2012 New Revision: 239945 URL: http://svn.freebsd.org/changeset/base/239945 Log: MFC r238623: Introduce curpcb magic variable, similar to curthread, which is MD amd64. It is implemented as __pure2 inline with non-volatile asm read from pcpu, which allows a compiler to cache its results. Convert most PCPU_GET(pcb) and curthread->td_pcb accesses into curpcb. MFC r238723: Forcibly shut up clang warning about NULL pointer dereference. Modified: stable/9/sys/amd64/amd64/fpu.c stable/9/sys/amd64/amd64/machdep.c stable/9/sys/amd64/amd64/trap.c stable/9/sys/amd64/amd64/vm_machdep.c stable/9/sys/amd64/include/pcpu.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:33:54 2012 (r239944) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:48:04 2012 (r239945) @@ -327,7 +327,7 @@ fpuexit(struct thread *td) critical_enter(); if (curthread == PCPU_GET(fpcurthread)) { stop_emulating(); - fpusave(PCPU_GET(curpcb)->pcb_save); + fpusave(curpcb->pcb_save); start_emulating(); PCPU_SET(fpcurthread, 0); } @@ -547,7 +547,7 @@ fputrap_x87(void) * wherever they are. */ if (PCPU_GET(fpcurthread) != curthread) { - pcb_save = PCPU_GET(curpcb)->pcb_save; + pcb_save = curpcb->pcb_save; control = pcb_save->sv_env.en_cw; status = pcb_save->sv_env.en_sw; } else { @@ -567,7 +567,7 @@ fputrap_sse(void) critical_enter(); if (PCPU_GET(fpcurthread) != curthread) - mxcsr = PCPU_GET(curpcb)->pcb_save->sv_env.en_mxcsr; + mxcsr = curpcb->pcb_save->sv_env.en_mxcsr; else stmxcsr(&mxcsr); critical_exit(); @@ -609,7 +609,7 @@ fpudna(void) * Record new context early in case frstor causes a trap. */ PCPU_SET(fpcurthread, curthread); - pcb = PCPU_GET(curpcb); + pcb = curpcb; fpu_clean_state(); @@ -970,7 +970,7 @@ fpu_kern_thread(u_int flags) { struct pcb *pcb; - pcb = PCPU_GET(curpcb); + pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); KASSERT(pcb->pcb_save == get_pcb_user_save_pcb(pcb), @@ -987,5 +987,5 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((PCPU_GET(curpcb)->pcb_flags & PCB_KERNFPU) != 0); + return ((curpcb->pcb_flags & PCB_KERNFPU) != 0); } Modified: stable/9/sys/amd64/amd64/machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/machdep.c Fri Aug 31 11:33:54 2012 (r239944) +++ stable/9/sys/amd64/amd64/machdep.c Fri Aug 31 11:48:04 2012 (r239945) @@ -967,7 +967,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_dr3 = 0; pcb->pcb_dr6 = 0; pcb->pcb_dr7 = 0; - if (pcb == PCPU_GET(curpcb)) { + if (pcb == curpcb) { /* * Clear the debug registers on the running * CPU, otherwise they will end up affecting Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Fri Aug 31 11:33:54 2012 (r239944) +++ stable/9/sys/amd64/amd64/trap.c Fri Aug 31 11:48:04 2012 (r239945) @@ -525,9 +525,8 @@ trap(struct trapframe *frame) frame->tf_rip = (long)fsbase_load_fault; goto out; } - if (PCPU_GET(curpcb)->pcb_onfault != NULL) { - frame->tf_rip = - (long)PCPU_GET(curpcb)->pcb_onfault; + if (curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; goto out; } break; @@ -730,7 +729,7 @@ trap_pfault(frame, usermode) * it normally, and panic immediately. */ if (!usermode && (td->td_intr_nesting_level != 0 || - PCPU_GET(curpcb)->pcb_onfault == NULL)) { + curpcb->pcb_onfault == NULL)) { trap_fatal(frame, eva); return (-1); } @@ -786,8 +785,8 @@ trap_pfault(frame, usermode) nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && - PCPU_GET(curpcb)->pcb_onfault != NULL) { - frame->tf_rip = (long)PCPU_GET(curpcb)->pcb_onfault; + curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; return (0); } trap_fatal(frame, eva); Modified: stable/9/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/vm_machdep.c Fri Aug 31 11:33:54 2012 (r239944) +++ stable/9/sys/amd64/amd64/vm_machdep.c Fri Aug 31 11:48:04 2012 (r239945) @@ -90,6 +90,10 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +CTASSERT((struct thread **)OFFSETOF_CURTHREAD == + &((struct pcpu *)NULL)->pc_curthread); +CTASSERT((struct pcb **)OFFSETOF_CURPCB == &((struct pcpu *)NULL)->pc_curpcb); + struct savefpu * get_pcb_user_save_td(struct thread *td) { Modified: stable/9/sys/amd64/include/pcpu.h ============================================================================== --- stable/9/sys/amd64/include/pcpu.h Fri Aug 31 11:33:54 2012 (r239944) +++ stable/9/sys/amd64/include/pcpu.h Fri Aug 31 11:48:04 2012 (r239945) @@ -216,16 +216,36 @@ extern struct pcpu *pcpup; #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) +#define OFFSETOF_CURTHREAD 0 +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnull-dereference" +#endif static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm("movq %%gs:0,%0" : "=r" (td)); + __asm("movq %%gs:%1,%0" : "=r" (td) + : "m" (*(char *)OFFSETOF_CURTHREAD)); return (td); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif #define curthread (__curthread()) +#define OFFSETOF_CURPCB 32 +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + + __asm("movq %%gs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + return (pcb); +} +#define curpcb (__curpcb()) + #define IS_BSP() (PCPU_GET(cpuid) == 0) #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 12:01:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A274106568F; Fri, 31 Aug 2012 12:01:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9648FC2A; Fri, 31 Aug 2012 12:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VC1ZNk026669; Fri, 31 Aug 2012 12:01:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VC1Zc8026667; Fri, 31 Aug 2012 12:01:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311201.q7VC1Zc8026667@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 12:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239946 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 12:01:36 -0000 Author: kib Date: Fri Aug 31 12:01:35 2012 New Revision: 239946 URL: http://svn.freebsd.org/changeset/base/239946 Log: MFC r238668: Stop clearing x87 exceptions in the #MF handler on amd64. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 11:48:04 2012 (r239945) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:01:35 2012 (r239946) @@ -513,25 +513,21 @@ static char fpetable[128] = { }; /* - * Preserve the FP status word, clear FP exceptions for x87, then - * generate a SIGFPE. + * Read the FP status and control words, then generate si_code value + * for SIGFPE. The error code chosen will be one of the + * FPE_... macros. It will be sent as the second argument to old + * BSD-style signal handlers and as "siginfo_t->si_code" (second + * argument) to SA_SIGINFO signal handlers. * - * Clearing exceptions was necessary mainly to avoid IRQ13 bugs and is - * engraved in our i386 ABI. We now depend on longjmp() restoring a - * usable state. Restoring the state or examining it might fail if we - * didn't clear exceptions. + * Some time ago, we cleared the x87 exceptions with FNCLEX there. + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The + * usermode code which understands the FPU hardware enough to enable + * the exceptions, can also handle clearing the exception state in the + * handler. The only consequence of not clearing the exception is the + * rethrow of the SIGFPE on return from the signal handler and + * reexecution of the corresponding instruction. * - * For SSE exceptions, the exceptions are not cleared. - * - * The error code chosen will be one of the FPE_... macros. It will be - * sent as the second argument to old BSD-style signal handlers and as - * "siginfo_t->si_code" (second argument) to SA_SIGINFO signal handlers. - * - * XXX the FP state is not preserved across signal handlers. So signal - * handlers cannot afford to do FP unless they preserve the state or - * longjmp() out. Both preserving the state and longjmp()ing may be - * destroyed by IRQ13 bugs. Clearing FP exceptions is not an acceptable - * solution for signals other than SIGFPE. + * For XMM traps, the exceptions were never cleared. */ int fputrap_x87(void) @@ -553,7 +549,6 @@ fputrap_x87(void) } else { fnstcw(&control); fnstsw(&status); - fnclex(); } critical_exit(); From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 12:04:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19A321065670; Fri, 31 Aug 2012 12:04:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030D58FC14; Fri, 31 Aug 2012 12:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VC4TGI027210; Fri, 31 Aug 2012 12:04:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VC4TQM027208; Fri, 31 Aug 2012 12:04:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311204.q7VC4TQM027208@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 12:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239947 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 12:04:30 -0000 Author: kib Date: Fri Aug 31 12:04:29 2012 New Revision: 239947 URL: http://svn.freebsd.org/changeset/base/239947 Log: MFC r238669: Force clean FPU state in PCB user FPU save area by performing getfpuregs(9) before accessing user FPU save area in ptrace_machdep.c for PT_I386_{GET,SET}XMMREGS and PT_{GET,SET}XSTATE. Modified: stable/9/sys/amd64/amd64/ptrace_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/ptrace_machdep.c Fri Aug 31 12:01:35 2012 (r239946) +++ stable/9/sys/amd64/amd64/ptrace_machdep.c Fri Aug 31 12:04:29 2012 (r239947) @@ -50,6 +50,7 @@ cpu_ptrace_xstate(struct thread *td, int switch (req) { case PT_GETXSTATE: + fpugetregs(td); savefpu = (char *)(get_pcb_user_save_td(td) + 1); error = copyout(savefpu, addr, cpu_max_ext_state_size - sizeof(struct savefpu)); @@ -62,8 +63,10 @@ cpu_ptrace_xstate(struct thread *td, int } savefpu = malloc(data, M_TEMP, M_WAITOK); error = copyin(addr, savefpu, data); - if (error == 0) + if (error == 0) { + fpugetregs(td); error = fpusetxstate(td, savefpu, data); + } free(savefpu, M_TEMP); break; @@ -89,11 +92,13 @@ cpu32_ptrace(struct thread *td, int req, switch (req) { case PT_I386_GETXMMREGS: + fpugetregs(td); error = copyout(get_pcb_user_save_td(td), addr, sizeof(*fpstate)); break; case PT_I386_SETXMMREGS: + fpugetregs(td); fpstate = get_pcb_user_save_td(td); error = copyin(addr, fpstate, sizeof(*fpstate)); fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 12:06:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F4981065698; Fri, 31 Aug 2012 12:06:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 501478FC18; Fri, 31 Aug 2012 12:06:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VC6X90027488; Fri, 31 Aug 2012 12:06:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VC6XlS027486; Fri, 31 Aug 2012 12:06:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311206.q7VC6XlS027486@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 12:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239948 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 12:06:33 -0000 Author: kib Date: Fri Aug 31 12:06:32 2012 New Revision: 239948 URL: http://svn.freebsd.org/changeset/base/239948 Log: MFC r238670: Stop caching curpcb in the local variable. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:04:29 2012 (r239947) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:06:32 2012 (r239948) @@ -582,7 +582,6 @@ static int err_count = 0; void fpudna(void) { - struct pcb *pcb; critical_enter(); if (PCPU_GET(fpcurthread) == curthread) { @@ -604,11 +603,10 @@ fpudna(void) * Record new context early in case frstor causes a trap. */ PCPU_SET(fpcurthread, curthread); - pcb = curpcb; fpu_clean_state(); - if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly @@ -619,17 +617,17 @@ fpudna(void) * fpu_initialstate, to ignite the XSAVEOPT * tracking engine. */ - bcopy(fpu_initialstate, pcb->pcb_save, cpu_max_ext_state_size); - fpurestore(pcb->pcb_save); - if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) - fldcw(pcb->pcb_initial_fpucw); - if (PCB_USER_FPU(pcb)) - set_pcb_flags(pcb, + bcopy(fpu_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); + fpurestore(curpcb->pcb_save); + if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) + fldcw(curpcb->pcb_initial_fpucw); + if (PCB_USER_FPU(curpcb)) + set_pcb_flags(curpcb, PCB_FPUINITDONE | PCB_USERFPUINITDONE); else - set_pcb_flags(pcb, PCB_FPUINITDONE); + set_pcb_flags(curpcb, PCB_FPUINITDONE); } else - fpurestore(pcb->pcb_save); + fpurestore(curpcb->pcb_save); critical_exit(); } @@ -963,16 +961,14 @@ fpu_kern_leave(struct thread *td, struct int fpu_kern_thread(u_int flags) { - struct pcb *pcb; - pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); - KASSERT(pcb->pcb_save == get_pcb_user_save_pcb(pcb), + KASSERT(curpcb->pcb_save == get_pcb_user_save_pcb(curpcb), ("mangled pcb_save")); - KASSERT(PCB_USER_FPU(pcb), ("recursive call")); + KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - set_pcb_flags(pcb, PCB_KERNFPU); + set_pcb_flags(curpcb, PCB_KERNFPU); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 12:08:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90503106566B; Fri, 31 Aug 2012 12:08:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A4058FC0A; Fri, 31 Aug 2012 12:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VC8VON027761; Fri, 31 Aug 2012 12:08:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VC8VPe027759; Fri, 31 Aug 2012 12:08:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311208.q7VC8VPe027759@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 12:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239949 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 12:08:31 -0000 Author: kib Date: Fri Aug 31 12:08:31 2012 New Revision: 239949 URL: http://svn.freebsd.org/changeset/base/239949 Log: MFC r238671: Constently use 2-space sentence breaks. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:06:32 2012 (r239948) +++ stable/9/sys/amd64/amd64/fpu.c Fri Aug 31 12:08:31 2012 (r239949) @@ -515,7 +515,7 @@ static char fpetable[128] = { /* * Read the FP status and control words, then generate si_code value * for SIGFPE. The error code chosen will be one of the - * FPE_... macros. It will be sent as the second argument to old + * FPE_... macros. It will be sent as the second argument to old * BSD-style signal handlers and as "siginfo_t->si_code" (second * argument) to SA_SIGINFO signal handlers. * @@ -523,7 +523,7 @@ static char fpetable[128] = { * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The * usermode code which understands the FPU hardware enough to enable * the exceptions, can also handle clearing the exception state in the - * handler. The only consequence of not clearing the exception is the + * handler. The only consequence of not clearing the exception is the * rethrow of the SIGFPE on return from the signal handler and * reexecution of the corresponding instruction. * From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 14:35:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE516106564A; Fri, 31 Aug 2012 14:35:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ABA78FC1C; Fri, 31 Aug 2012 14:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VEZ1sQ046111; Fri, 31 Aug 2012 14:35:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VEZ1e5046109; Fri, 31 Aug 2012 14:35:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208311435.q7VEZ1e5046109@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 14:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239951 - head/bin/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 14:35:02 -0000 Author: jhb Date: Fri Aug 31 14:35:01 2012 New Revision: 239951 URL: http://svn.freebsd.org/changeset/base/239951 Log: Add a -h flag similar to the -h flag for ln to force mv(1) to treat a symbolic link to a directory for the target as a symbolic link instead of a directory. This makes it possible to atomically update a symbolic link using rename(). Reviewed by: gj MFC after: 2 weeks Modified: head/bin/mv/mv.1 head/bin/mv/mv.c Modified: head/bin/mv/mv.1 ============================================================================== --- head/bin/mv/mv.1 Fri Aug 31 14:06:33 2012 (r239950) +++ head/bin/mv/mv.1 Fri Aug 31 14:35:01 2012 (r239951) @@ -32,7 +32,7 @@ .\" @(#)mv.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd May 12, 2007 +.Dd August 28, 2012 .Dt MV 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl f | i | n -.Op Fl v +.Op Fl hv .Ar source target .Nm .Op Fl f | i | n @@ -81,6 +81,21 @@ option overrides any previous or .Fl n options.) +.It Fl h +If the +.Ar target +operand is a symbolic link to a directory, +do not follow it. +This causes the +.Nm +utility to rename the file +.Ar source +to the destination path +.Ar target +rather than moving +.Ar source +into the directory referenced by +.Ar target . .It Fl i Cause .Nm @@ -142,7 +157,8 @@ rm -rf source_file .Ex -std .Sh COMPATIBILITY The -.Fl n +.Fl h , +.Fl n , and .Fl v options are non-standard and their use in scripts is not recommended. Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Fri Aug 31 14:06:33 2012 (r239950) +++ head/bin/mv/mv.c Fri Aug 31 14:35:01 2012 (r239951) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); /* Exit code for a failed exec. */ #define EXEC_FAILED 127 -static int fflg, iflg, nflg, vflg; +static int fflg, hflg, iflg, nflg, vflg; static int copy(const char *, const char *); static int do_move(const char *, const char *); @@ -87,8 +87,11 @@ main(int argc, char *argv[]) int ch; char path[PATH_MAX]; - while ((ch = getopt(argc, argv, "finv")) != -1) + while ((ch = getopt(argc, argv, "fhinv")) != -1) switch (ch) { + case 'h': + hflg = 1; + break; case 'i': iflg = 1; fflg = nflg = 0; @@ -123,6 +126,17 @@ main(int argc, char *argv[]) exit(do_move(argv[0], argv[1])); } + /* + * If -h was specified, treat the target as a symlink instead of + * directory. + */ + if (hflg) { + if (argc > 2) + usage(); + if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode)) + exit(do_move(argv[0], argv[1])); + } + /* It's a directory, move each file into it. */ if (strlen(argv[argc - 1]) > sizeof(path) - 1) errx(1, "%s: destination pathname too long", *argv); @@ -483,7 +497,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: mv [-f | -i | -n] [-v] source target", + "usage: mv [-f | -i | -n] [-hv] source target", " mv [-f | -i | -n] [-v] source ... directory"); exit(EX_USAGE); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 15:02:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DEDA106566B; Fri, 31 Aug 2012 15:02:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from ref10-i386.freebsd.org (unknown [IPv6:2001:4f8:fff6::5e]) by mx1.freebsd.org (Postfix) with ESMTP id 48B508FC12; Fri, 31 Aug 2012 15:02:39 +0000 (UTC) Received: from ref10-i386.freebsd.org (localhost [127.0.0.1]) by ref10-i386.freebsd.org (8.14.5/8.14.5) with ESMTP id q7VF2dcQ098319; Fri, 31 Aug 2012 15:02:39 GMT (envelope-from bde@ref10-i386.freebsd.org) Received: (from bde@localhost) by ref10-i386.freebsd.org (8.14.5/8.14.5/Submit) id q7VF2dEv098318; Fri, 31 Aug 2012 15:02:39 GMT (envelope-from bde) Date: Fri, 31 Aug 2012 15:02:39 GMT From: Bruce Evans Message-Id: <201208311502.q7VF2dEv098318@ref10-i386.freebsd.org> To: glebius@freebsd.org, scottl@freebsd.org In-Reply-To: <20120831101100.GL90597@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239940 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 15:02:39 -0000 glebius wrote: > On Fri, Aug 31, 2012 at 10:07:38AM +0000, Scott Long wrote: > S> +/* > S> + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes > S> + * non-overlapping regions and 32-byte padding on both src and dst. > S> + */ > S> +static __inline int > S> +ixgbe_bcopy(void *_src, void *_dst, int l) > S> +{ > S> + uint64_t *src = _src; > S> + uint64_t *dst = _dst; > S> + > S> + for (; l > 0; l -= 32) { > S> + *dst++ = *src++; > S> + *dst++ = *src++; > S> + *dst++ = *src++; > S> + *dst++ = *src++; > S> + } > S> + return (0); > S> +} > S> + > > Shouldn't this go to libkern? It's bogus, so it belongs in /dev/null. Bogusness starts with its name and its parameter names (its semantics are closer to memcpy() than bcopy(), but its arg order is that of bcopy()...). In a quick test, it is slightly slower than builtin memcpy when l = 64, and when l = 128 on amd64: % #include % % static __inline int % ixgbe_bcopy(void *_src, void *_dst, int l) % { % uint64_t *src = _src; % uint64_t *dst = _dst; % % for (; l > 0; l -= 32) { % *dst++ = *src++; % *dst++ = *src++; % *dst++ = *src++; % *dst++ = *src++; % } % return (0); % } % % int dst[512]; % int src[512]; % % main() % { % int i; % % for (i = 0; i < 100000000; i++) % #if 0 % __builtin_memcpy(dst, src, 64); % #else % ixgbe_bcopy(src, dst, 64); % #endif % } Builtin memcpy generates lots of unrolling, with up to 64 bytes copied in the builtin's inner loop on i386, and up to 128 on amd64. This is excessive, but is what makes the builtin slightly faster than the hand-rolled version in bogus micro-benchmarks like this. Times on FreeBSD cluster machines (core2): amd64 l = 128: builtin 1.00 seconds, hand-rolled 1.16 seconds i386 l = 64: builtin 0.99 seconds, hand-rolled 1.43 seconds Above 64 or 128 bytes, the builtin switches to calling memcpy(). Now the hand-rolled version is faster. This is essentially accidental. gcc knows that it doesn't understand copying memory and switches to the extern memcpy() above a certain threshold for the size, in the hope that the extern memcpy understands. The threshold is hard-coded but depends on -march. The hand-rolled version doesn't know that it doesn't understand copying memory, and uses a hard-coded magic number of 32 related to the threshold. The thresholds of 64/128 are possibly a little too small on the test hardware given the unsmartness of the extern memcpy(), but it is hard to do better without tuning for the CPU, its memory system, and other things. Perhaps ixgbe could know something about the context, but libkern can't. Times: amd64 l = 256: builtin 4.09 seconds, hand-rolled 2.28 seconds i386 l = 128: builtin 4.75 seconds, hand-rolled 2.67 seconds These times show some interesting unrelated pessimizations: - i386 is about twice as slow as amd64, on the same hardware. It is handicapped by only having 32-bit integer registers. With SSE, there would be little difference, but the setup overhead is probably too large to use SSE for such small copies, even in userland. - amd64 goes from being about twice as fast as i386 with builtin memcpy below the threshold to not much faster above the threshold. This is surprising, since the extern memcpy uses "rep movsq" on amd64, and in other benchmarks on other (amd64) machines, using "rep movsq" instead of "rep movsl"" retains the 2-flow speed advantage (because "rep movsq" goes at cache speed, but "rep movsl" can't keep up. String instructions tend to be slower` but are often fast enough. I recently read a claim that movs* is the fastest method on SandyBridge but not fastest on any older CPU. Anyway, the speed of copying from the L1 cache is unimportant. If anyone cared about it, then they would have noticed when automatic use of builtin memcpy was broken for kernels ~20 years ago by turning off all builtins. BTW, NOTES still hasn't caught up with this change. It still has -fno-builtin in makeoptions. I put this there to test the inversion of the default -fbuiltin. But the default was reversed without changing this (-fno-builtin is not explicit, but is implied by -ffreestanding). Bruce From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 16:57:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 413F81065675; Fri, 31 Aug 2012 16:57:18 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904998FC08; Fri, 31 Aug 2012 16:57:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VGvHsv064568; Fri, 31 Aug 2012 16:57:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VGvHfB064566; Fri, 31 Aug 2012 16:57:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208311657.q7VGvHfB064566@svn.freebsd.org> From: Joel Dahl Date: Fri, 31 Aug 2012 16:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239952 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 16:57:18 -0000 Author: joel (doc committer) Date: Fri Aug 31 16:57:16 2012 New Revision: 239952 URL: http://svn.freebsd.org/changeset/base/239952 Log: Remove trailing whitespace. Modified: head/usr.sbin/makefs/makefs.8 Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Fri Aug 31 14:35:01 2012 (r239951) +++ head/usr.sbin/makefs/makefs.8 Fri Aug 31 16:57:16 2012 (r239952) @@ -188,7 +188,7 @@ Set file system specific options. .Ar fs-options is a comma separated list of options. Valid file system specific options are detailed below. -.It Fl p +.It Fl p Create the image as a sparse file. .It Fl S Ar sector-size Set the file system sector size to From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 17:18:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F27AC106564A; Fri, 31 Aug 2012 17:18:41 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD6588FC17; Fri, 31 Aug 2012 17:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VHIfJM067071; Fri, 31 Aug 2012 17:18:41 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VHIfUc067067; Fri, 31 Aug 2012 17:18:41 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208311718.q7VHIfUc067067@svn.freebsd.org> From: Joel Dahl Date: Fri, 31 Aug 2012 17:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239953 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 17:18:42 -0000 Author: joel (doc committer) Date: Fri Aug 31 17:18:41 2012 New Revision: 239953 URL: http://svn.freebsd.org/changeset/base/239953 Log: Mdoc fixes. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Fri Aug 31 16:57:16 2012 (r239952) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Fri Aug 31 17:18:41 2012 (r239953) @@ -67,7 +67,7 @@ however a feature's short name may diffe following the convention would result in name conflicts. .Ss Feature states Features can be in one of three states: -.Bl -tag +.Bl -tag -width "XXXXXXXX" .It Sy active This feature's on\-disk format changes are in effect on the pool. Support for this feature is required to import the pool in read\-write mode. @@ -93,6 +93,7 @@ unless an administrator moves the featur state. Features cannot be disabled once they have been enabled. .El +.Pp The state of supported features is exposed through pool properties of the form .Sy feature@short_name . .Ss Read\-only compatibility @@ -111,7 +112,7 @@ named .Sy unsupported@feature_guid will indicate why the import was allowed despite the unsupported feature. Possible values for this property are: -.Bl -tag +.Bl -tag -width "XXXXXXXX" .It Sy inactive The feature is in the .Sy enabled @@ -127,7 +128,7 @@ properly. Enabling a feature will automatically enable any features it depends on. .Sh FEATURES The following features are supported on this system: -.Bl -tag +.Bl -tag -width "XXXXXXXX" .It Sy async_destroy .Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:async_destroy" .It GUID Ta com.delphix:async_destroy Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Aug 31 16:57:16 2012 (r239952) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Aug 31 17:18:41 2012 (r239953) @@ -193,7 +193,7 @@ A describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported: -.Bl -tag +.Bl -tag -width "XXXXXX" .It Sy disk A block device, typically located under .Pa /dev . @@ -532,7 +532,7 @@ can provide additional information about .It Sy dedupratio The deduplication ratio specified for a pool, expressed as a multiplier. For example, a -.S dedupratio +.Sy dedupratio value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See .Xr zfs 8 for a description of the deduplication feature. @@ -1678,6 +1678,16 @@ This option can only be used to increase supported legacy version number. .El .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a RAID-Z Storage Pool @@ -1915,16 +1925,6 @@ Pool data returned to its state as of Tu Discarded approximately 29 seconds of transactions. .Ed .El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. -.El .Sh SEE ALSO .Xr zfs 8 .Xr zpool-features 5 From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 18:26:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F0AA106568D; Fri, 31 Aug 2012 18:26:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09C3F8FC18; Fri, 31 Aug 2012 18:26:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VIQdqe075603; Fri, 31 Aug 2012 18:26:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VIQdhi075601; Fri, 31 Aug 2012 18:26:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208311826.q7VIQdhi075601@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 18:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239954 - head/usr.sbin/ac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 18:26:40 -0000 Author: ed Date: Fri Aug 31 18:26:39 2012 New Revision: 239954 URL: http://svn.freebsd.org/changeset/base/239954 Log: Relicense ac(8). Though the license of the original ac(8) source code provides many liberties, we are already somewhat violating it. The license requires us to clearly comment any modifications to the source code, as the original authors of course do not want to get bug reports for modified versions of ac(8). This is something we have not done consistently. The need for such a license clause has become less over time. It is very unlikely that end users will contact the original authors, as the copyright is from 1994. I contacted both the copyright holders. They responded in a timely fashion and were more than willing to relicense it to a 2-clause BSD license. To address any concerns about bug reports going to the original authors instead of me, add my own name and email address to the copyright statements as well. MFC after: 1 month Special thanks to: Christopher Demetriou and Simon Gerraty Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Fri Aug 31 17:18:41 2012 (r239953) +++ head/usr.sbin/ac/ac.c Fri Aug 31 18:26:39 2012 (r239954) @@ -1,16 +1,29 @@ -/* - * Copyright (c) 1994 Christopher G. Demetriou. - * @(#)Copyright (c) 1994, Simon J. Gerraty. +/*- + * Copyright (c) 1994 Christopher G. Demetriou + * Copyright (c) 1994 Simon J. Gerraty + * Copyright (c) 2012 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * This is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code - * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice - * are preserved in all copies and that due credit be given - * to the author. - * 2/ that any changes to this code are clearly commented - * as such so that the author does not get blamed for bugs - * other than his own. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 20:54:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A43741065679; Fri, 31 Aug 2012 20:54:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83DDD8FC1C; Fri, 31 Aug 2012 20:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VKsUBu093708; Fri, 31 Aug 2012 20:54:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VKsUMw093705; Fri, 31 Aug 2012 20:54:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208312054.q7VKsUMw093705@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 20:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239955 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 20:54:30 -0000 Author: jhb Date: Fri Aug 31 20:54:30 2012 New Revision: 239955 URL: http://svn.freebsd.org/changeset/base/239955 Log: Add common rules for building firmware object files (NORMAL_FW to run uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those instead of explicit ld/uudecode invocations in sys/conf/files. Apart from increasing readability, this makes it possible to adjust the flags used for firmware objects in one place. MFC after: 2 weeks Modified: head/sys/conf/files head/sys/conf/kern.pre.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 31 18:26:39 2012 (r239954) +++ head/sys/conf/files Fri Aug 31 20:54:30 2012 (r239955) @@ -1337,12 +1337,12 @@ ipwbssfw.c optional ipwbssfw | ipwfw clean "ipwbssfw.c" ipw_bss.fwo optional ipwbssfw | ipwfw \ dependency "ipw_bss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_bss.fwo" ipw_bss.fw optional ipwbssfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_bss.fw" ipwibssfw.c optional ipwibssfw | ipwfw \ @@ -1351,12 +1351,12 @@ ipwibssfw.c optional ipwibssfw | ipwfw clean "ipwibssfw.c" ipw_ibss.fwo optional ipwibssfw | ipwfw \ dependency "ipw_ibss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_ibss.fwo" ipw_ibss.fw optional ipwibssfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_ibss.fw" ipwmonitorfw.c optional ipwmonitorfw | ipwfw \ @@ -1365,12 +1365,12 @@ ipwmonitorfw.c optional ipwmonitorfw | clean "ipwmonitorfw.c" ipw_monitor.fwo optional ipwmonitorfw | ipwfw \ dependency "ipw_monitor.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_monitor.fwo" ipw_monitor.fw optional ipwmonitorfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" dev/iscsi/initiator/iscsi.c optional iscsi_initiator scbus @@ -1395,12 +1395,12 @@ iwibssfw.c optional iwibssfw | iwifw clean "iwibssfw.c" iwi_bss.fwo optional iwibssfw | iwifw \ dependency "iwi_bss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_bss.fwo" iwi_bss.fw optional iwibssfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_bss.fw" iwiibssfw.c optional iwiibssfw | iwifw \ @@ -1409,12 +1409,12 @@ iwiibssfw.c optional iwiibssfw | iwifw clean "iwiibssfw.c" iwi_ibss.fwo optional iwiibssfw | iwifw \ dependency "iwi_ibss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_ibss.fwo" iwi_ibss.fw optional iwiibssfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_ibss.fw" iwimonitorfw.c optional iwimonitorfw | iwifw \ @@ -1423,12 +1423,12 @@ iwimonitorfw.c optional iwimonitorfw | clean "iwimonitorfw.c" iwi_monitor.fwo optional iwimonitorfw | iwifw \ dependency "iwi_monitor.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_monitor.fwo" iwi_monitor.fw optional iwimonitorfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwn/if_iwn.c optional iwn @@ -1438,12 +1438,12 @@ iwn1000fw.c optional iwn1000fw | iwnfw clean "iwn1000fw.c" iwn1000fw.fwo optional iwn1000fw | iwnfw \ dependency "iwn1000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn1000fw.fwo" iwn1000.fw optional iwn1000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn1000.fw" iwn4965fw.c optional iwn4965fw | iwnfw \ @@ -1452,12 +1452,12 @@ iwn4965fw.c optional iwn4965fw | iwnfw clean "iwn4965fw.c" iwn4965fw.fwo optional iwn4965fw | iwnfw \ dependency "iwn4965.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn4965fw.fwo" iwn4965.fw optional iwn4965fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn4965.fw" iwn5000fw.c optional iwn5000fw | iwnfw \ @@ -1466,12 +1466,12 @@ iwn5000fw.c optional iwn5000fw | iwnfw clean "iwn5000fw.c" iwn5000fw.fwo optional iwn5000fw | iwnfw \ dependency "iwn5000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn5000fw.fwo" iwn5000.fw optional iwn5000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn5000.fw" iwn5150fw.c optional iwn5150fw | iwnfw \ @@ -1480,12 +1480,12 @@ iwn5150fw.c optional iwn5150fw | iwnfw clean "iwn5150fw.c" iwn5150fw.fwo optional iwn5150fw | iwnfw \ dependency "iwn5150.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn5150fw.fwo" iwn5150.fw optional iwn5150fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn5150.fw" iwn6000fw.c optional iwn6000fw | iwnfw \ @@ -1494,12 +1494,12 @@ iwn6000fw.c optional iwn6000fw | iwnfw clean "iwn6000fw.c" iwn6000fw.fwo optional iwn6000fw | iwnfw \ dependency "iwn6000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000fw.fwo" iwn6000.fw optional iwn6000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000.fw" iwn6000g2afw.c optional iwn6000g2afw | iwnfw \ @@ -1508,12 +1508,12 @@ iwn6000g2afw.c optional iwn6000g2afw | clean "iwn6000g2afw.c" iwn6000g2afw.fwo optional iwn6000g2afw | iwnfw \ dependency "iwn6000g2a.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2a.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000g2afw.fwo" iwn6000g2a.fw optional iwn6000g2afw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000g2a.fw" iwn6000g2bfw.c optional iwn6000g2bfw | iwnfw \ @@ -1522,12 +1522,12 @@ iwn6000g2bfw.c optional iwn6000g2bfw | clean "iwn6000g2bfw.c" iwn6000g2bfw.fwo optional iwn6000g2bfw | iwnfw \ dependency "iwn6000g2b.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2b.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000g2bfw.fwo" iwn6000g2b.fw optional iwn6000g2bfw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000g2b.fw" iwn6050fw.c optional iwn6050fw | iwnfw \ @@ -1536,12 +1536,12 @@ iwn6050fw.c optional iwn6050fw | iwnfw clean "iwn6050fw.c" iwn6050fw.fwo optional iwn6050fw | iwnfw \ dependency "iwn6050.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6050.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6050fw.fwo" iwn6050.fw optional iwn6050fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6050.fw" dev/ixgb/if_ixgb.c optional ixgb @@ -1673,22 +1673,22 @@ mwlfw.c optional mwlfw \ clean "mwlfw.c" mw88W8363.fwo optional mwlfw \ dependency "mw88W8363.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "mw88W8363.fwo" mw88W8363.fw optional mwlfw \ dependency "$S/contrib/dev/mwl/mw88W8363.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mw88W8363.fw" mwlboot.fwo optional mwlfw \ dependency "mwlboot.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "mwlboot.fwo" mwlboot.fw optional mwlfw \ dependency "$S/contrib/dev/mwl/mwlboot.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mwlboot.fw" dev/mxge/if_mxge.c optional mxge pci @@ -1820,12 +1820,12 @@ rt2561fw.c optional rt2561fw | ralfw clean "rt2561fw.c" rt2561fw.fwo optional rt2561fw | ralfw \ dependency "rt2561.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency "$S/contrib/dev/ral/rt2561.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2561.fw" rt2561sfw.c optional rt2561sfw | ralfw \ @@ -1834,12 +1834,12 @@ rt2561sfw.c optional rt2561sfw | ralfw clean "rt2561sfw.c" rt2561sfw.fwo optional rt2561sfw | ralfw \ dependency "rt2561s.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency "$S/contrib/dev/ral/rt2561s.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2561s.fw" rt2661fw.c optional rt2661fw | ralfw \ @@ -1848,12 +1848,12 @@ rt2661fw.c optional rt2661fw | ralfw clean "rt2661fw.c" rt2661fw.fwo optional rt2661fw | ralfw \ dependency "rt2661.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency "$S/contrib/dev/ral/rt2661.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2661.fw" rt2860fw.c optional rt2860fw | ralfw \ @@ -1862,12 +1862,12 @@ rt2860fw.c optional rt2860fw | ralfw clean "rt2860fw.c" rt2860fw.fwo optional rt2860fw | ralfw \ dependency "rt2860.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency "$S/contrib/dev/ral/rt2860.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" dev/random/harvest.c standard @@ -2154,12 +2154,12 @@ runfw.c optional runfw \ clean "runfw.c" runfw.fwo optional runfw \ dependency "runfw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} runfw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "runfw.fwo" runfw optional runfw \ dependency "$S/contrib/dev/run/rt2870.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/run/rt2870.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "runfw" dev/usb/wlan/if_uath.c optional uath @@ -2277,12 +2277,12 @@ wpifw.c optional wpifw \ clean "wpifw.c" wpifw.fwo optional wpifw \ dependency "wpi.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "wpifw.fwo" wpi.fw optional wpifw \ dependency "$S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "wpi.fw" dev/xe/if_xe.c optional xe Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Aug 31 18:26:39 2012 (r239954) +++ head/sys/conf/kern.pre.mk Fri Aug 31 20:54:30 2012 (r239955) @@ -131,6 +131,9 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c +NORMAL_FW= uudecode -o ${.TARGET} ${.IMPSRC} +NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.IMPSRC} + # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS} From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 21:10:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E79B106564A; Fri, 31 Aug 2012 21:10:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2968C8FC14; Fri, 31 Aug 2012 21:10:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VLAdap095683; Fri, 31 Aug 2012 21:10:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLAcF9095681; Fri, 31 Aug 2012 21:10:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208312110.q7VLAcF9095681@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 21:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239956 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:10:39 -0000 Author: jhb Date: Fri Aug 31 21:10:38 2012 New Revision: 239956 URL: http://svn.freebsd.org/changeset/base/239956 Log: The implied source variable (.IMPSRC) didn't actually work in my previous commit. Change this to use .ALLSRC instead, but be careful to only use the .fw file for NORMAL_FWO to ignore opt_global.h. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Aug 31 20:54:30 2012 (r239955) +++ head/sys/conf/kern.pre.mk Fri Aug 31 21:10:38 2012 (r239956) @@ -131,8 +131,8 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c -NORMAL_FW= uudecode -o ${.TARGET} ${.IMPSRC} -NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.IMPSRC} +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} +NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.ALLSRC:M*.fw} # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 21:25:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 845EA1065676; Fri, 31 Aug 2012 21:25:08 +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 8BCCB8FC08; Fri, 31 Aug 2012 21:25:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CFBA6B977; Fri, 31 Aug 2012 17:25:00 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 31 Aug 2012 17:19:45 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208312110.q7VLAcF9095681@svn.freebsd.org> In-Reply-To: <201208312110.q7VLAcF9095681@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208311719.45910.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 31 Aug 2012 17:25:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r239956 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:25:08 -0000 On Friday, August 31, 2012 5:10:38 pm John Baldwin wrote: > Author: jhb > Date: Fri Aug 31 21:10:38 2012 > New Revision: 239956 > URL: http://svn.freebsd.org/changeset/base/239956 > > Log: > The implied source variable (.IMPSRC) didn't actually work in my previous > commit. Change this to use .ALLSRC instead, but be careful to only use > the .fw file for NORMAL_FWO to ignore opt_global.h. Should have a 'Pointy hat to: jhb'. :-/ -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 21:27:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE6CB106566B; Fri, 31 Aug 2012 21:27:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B00438FC16; Fri, 31 Aug 2012 21:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VLRO4Q097664; Fri, 31 Aug 2012 21:27:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLROpD097662; Fri, 31 Aug 2012 21:27:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208312127.q7VLROpD097662@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 21:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239957 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:27:25 -0000 Author: jhb Date: Fri Aug 31 21:27:23 2012 New Revision: 239957 URL: http://svn.freebsd.org/changeset/base/239957 Log: Similar to how r171350 fixed linking of kernel modules containing firmware objects by adding --no-warn-mismatch to the linker flags, add --no-warn-mismatch when linking firmware objects (*.fwo) as well as to the link of the main kernel file. This permits firmware modules to be statically linked into an ia64 kernel. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Aug 31 21:10:38 2012 (r239956) +++ head/sys/conf/kern.pre.mk Fri Aug 31 21:27:23 2012 (r239957) @@ -132,7 +132,8 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops. ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} -NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.ALLSRC:M*.fw} +NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ + -o ${.TARGET} ${.ALLSRC:M*.fw} # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas @@ -164,7 +165,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS} SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \ +SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \ -warn-common -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 21:44:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E365106564A; Fri, 31 Aug 2012 21:44:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FFE8FC08; Fri, 31 Aug 2012 21:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VLiDAl099583; Fri, 31 Aug 2012 21:44:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLiDlC099581; Fri, 31 Aug 2012 21:44:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208312144.q7VLiDlC099581@svn.freebsd.org> From: Joel Dahl Date: Fri, 31 Aug 2012 21:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239958 - head/cddl/contrib/opensolaris/cmd/zdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:44:13 -0000 Author: joel (doc committer) Date: Fri Aug 31 21:44:12 2012 New Revision: 239958 URL: http://svn.freebsd.org/changeset/base/239958 Log: Minor mdoc fixes. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Aug 31 21:27:23 2012 (r239957) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Aug 31 21:44:12 2012 (r239958) @@ -93,14 +93,14 @@ If specified multiple times, verify the .It Fl C Display information about the configuration. If specified with no other options, instead display information about the cache file -.Ns ( Pa /etc/zfs/zpool.cache Ns ). +.Po Pa /etc/zfs/zpool.cache Pc . To specify the cache file to display, see .Fl U .Pp If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with -.FL e +.Fl e also display the configuration that would be used were the pool to be imported. .It Fl d @@ -253,7 +253,7 @@ MOS Configuration: .Li # Ic zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects -... + ... .Ed .It Xo Sy Example 3 Display basic information about object 0 in .Sy 'rpool/export/home' From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 21:45:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28993106566B; Fri, 31 Aug 2012 21:45:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08BA78FC1E; Fri, 31 Aug 2012 21:45:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VLjnGI099790; Fri, 31 Aug 2012 21:45:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLjniF099787; Fri, 31 Aug 2012 21:45:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208312145.q7VLjniF099787@svn.freebsd.org> From: Dimitry Andric Date: Fri, 31 Aug 2012 21:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239959 - in head/sys: conf modules/xfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:45:50 -0000 Author: dim Date: Fri Aug 31 21:45:49 2012 New Revision: 239959 URL: http://svn.freebsd.org/changeset/base/239959 Log: Work around several warnings from clang in the xfs filesystem, when linking it statically into the kernel. With our gcc in base there are no warnings, so also remove the WERROR= from the module makefile. Noted by: Eir Nym MFC after: 1 week Modified: head/sys/conf/files head/sys/modules/xfs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 31 21:44:12 2012 (r239958) +++ head/sys/conf/files Fri Aug 31 21:45:49 2012 (r239959) @@ -3608,7 +3608,7 @@ xdr/xdr_reference.c optional krpc | nfs xdr/xdr_sizeof.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd # gnu/fs/xfs/xfs_alloc.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ warning "kernel contains GPL contaminated xfs filesystem" gnu/fs/xfs/xfs_alloc_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" @@ -3627,9 +3627,9 @@ gnu/fs/xfs/xfs_da_btree.c optional xfs \ gnu/fs/xfs/xfs_dir.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_block.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_data.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_leaf.c optional xfs \ @@ -3637,7 +3637,7 @@ gnu/fs/xfs/xfs_dir2_leaf.c optional xfs gnu/fs/xfs/xfs_dir2_node.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_sf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_trace.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir_leaf.c optional xfs \ @@ -3685,7 +3685,7 @@ gnu/fs/xfs/xfs_trans_item.c optional xfs gnu/fs/xfs/xfs_utils.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_vfsops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_vnodeops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_rw.c optional xfs \ @@ -3715,9 +3715,9 @@ gnu/fs/xfs/FreeBSD/xfs_globals.c optiona gnu/fs/xfs/FreeBSD/xfs_dmistubs.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_super.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_stats.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vfs.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vnode.c optional xfs \ Modified: head/sys/modules/xfs/Makefile ============================================================================== --- head/sys/modules/xfs/Makefile Fri Aug 31 21:44:12 2012 (r239958) +++ head/sys/modules/xfs/Makefile Fri Aug 31 21:45:49 2012 (r239959) @@ -6,8 +6,6 @@ KMOD= xfs -WERROR= - SRCS = vnode_if.h \ xfs_alloc.c \ xfs_alloc_btree.c \ @@ -86,5 +84,12 @@ CFLAGS+= -I${.CURDIR}/../../gnu/fs/xfs/F -I${.CURDIR}/../../gnu/fs/xfs/FreeBSD/support \ -I${.CURDIR}/../../gnu/fs/xfs +CWARNFLAGS.xfs_alloc.c= ${NO_WSOMETIMES_UNINITIALIZED} +CWARNFLAGS.xfs_dir2.c= ${NO_WARRAY_BOUNDS} +CWARNFLAGS.xfs_dir2_block.c= ${NO_WARRAY_BOUNDS} +CWARNFLAGS.xfs_dir2_sf.c= ${NO_WARRAY_BOUNDS} CWARNFLAGS.xfs_ioctl.c= ${NO_WSELF_ASSIGN} +CWARNFLAGS.xfs_stats.c= ${NO_WFORMAT_SECURITY} +CWARNFLAGS.xfs_super.c= ${NO_WFORMAT_SECURITY} +CWARNFLAGS.xfs_vfsops.c= ${NO_WFORMAT_SECURITY} CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 22:00:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D4691065673; Fri, 31 Aug 2012 22:00:00 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id ECCC68FC08; Fri, 31 Aug 2012 21:59:59 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 75F8E6140; Fri, 31 Aug 2012 23:59:53 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 110BC87CD; Fri, 31 Aug 2012 23:59:52 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <201208302256.q7UMuWE7027494@svn.freebsd.org> <504005E1.7040602@FreeBSD.org> Date: Fri, 31 Aug 2012 23:59:52 +0200 In-Reply-To: <504005E1.7040602@FreeBSD.org> (Doug Barton's message of "Thu, 30 Aug 2012 14:31:29 -1000") Message-ID: <868vcuzprb.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239927 - head/tools/tools/track X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 22:00:00 -0000 Doug Barton writes: > Dag-Erling Sm=C3=B8rgrav writes: > > - \*\*\*\ Error*) > > + \*\*\**) > Are you sure that the double ** is necessary here? Yes, error messages generally include text in addition to the initial three asterisks. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 22:22:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71F7E106577D; Fri, 31 Aug 2012 22:22:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C4E18FC18; Fri, 31 Aug 2012 22:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VMMFAp004050; Fri, 31 Aug 2012 22:22:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VMMFfT004048; Fri, 31 Aug 2012 22:22:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208312222.q7VMMFfT004048@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 22:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239960 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 22:22:15 -0000 Author: ed Date: Fri Aug 31 22:22:14 2012 New Revision: 239960 URL: http://svn.freebsd.org/changeset/base/239960 Log: Properly enable Clang-style atomics when available. In addition to testing against cxx_atomic, we must check c_atomic. The former is only set when building C++ code. Also use __has_extension instead of __has_feature. This allows us to use the atomics outside of C11. Reported by: Ariane van der Steldt PR: threads/170073 Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Fri Aug 31 21:45:49 2012 (r239959) +++ head/include/stdatomic.h Fri Aug 31 22:22:14 2012 (r239960) @@ -33,7 +33,7 @@ #include #include -#if __has_feature(cxx_atomic) +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) #define __GNUC_ATOMICS From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 22:37:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57C46106564A; Fri, 31 Aug 2012 22:37:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4275F8FC12; Fri, 31 Aug 2012 22:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VMb9NM005915; Fri, 31 Aug 2012 22:37:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VMb9Yt005913; Fri, 31 Aug 2012 22:37:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208312237.q7VMb9Yt005913@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 22:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239961 - head/usr.sbin/ac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 22:37:09 -0000 Author: ed Date: Fri Aug 31 22:37:08 2012 New Revision: 239961 URL: http://svn.freebsd.org/changeset/base/239961 Log: Also relicense the ac(8) man page. MFC after: 1 month Discussed with: Simon Gerraty and Chris Demetriou Modified: head/usr.sbin/ac/ac.8 Modified: head/usr.sbin/ac/ac.8 ============================================================================== --- head/usr.sbin/ac/ac.8 Fri Aug 31 22:22:14 2012 (r239960) +++ head/usr.sbin/ac/ac.8 Fri Aug 31 22:37:08 2012 (r239961) @@ -11,11 +11,6 @@ .\" 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. -.\" 3. 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 From owner-svn-src-all@FreeBSD.ORG Fri Aug 31 23:28:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E5751065670; Fri, 31 Aug 2012 23:28:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89A6C8FC18; Fri, 31 Aug 2012 23:28:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VNSfNX012049; Fri, 31 Aug 2012 23:28:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VNSfLK012047; Fri, 31 Aug 2012 23:28:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208312328.q7VNSfLK012047@svn.freebsd.org> From: Dimitry Andric Date: Fri, 31 Aug 2012 23:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239962 - head/contrib/binutils/binutils X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 23:28:41 -0000 Author: dim Date: Fri Aug 31 23:28:41 2012 New Revision: 239962 URL: http://svn.freebsd.org/changeset/base/239962 Log: Fix a twelve year old bug in readelf: when process_dynamic_segment() encounters a DT_RUNPATH entry, the global dynamic_info[] array is overrun, causing some other global variable to be overwritten. In my testcase, this was the section_headers variable, leading to segfaults or jemalloc assertions when it was freed later on. Thanks to Koop Mast for providing samples of a few "bad" .so files. MFC after: 1 week Modified: head/contrib/binutils/binutils/readelf.c Modified: head/contrib/binutils/binutils/readelf.c ============================================================================== --- head/contrib/binutils/binutils/readelf.c Fri Aug 31 22:37:08 2012 (r239961) +++ head/contrib/binutils/binutils/readelf.c Fri Aug 31 23:28:41 2012 (r239962) @@ -174,7 +174,7 @@ static Elf_Internal_Syminfo *dynamic_sym static unsigned long dynamic_syminfo_offset; static unsigned int dynamic_syminfo_nent; static char program_interpreter[PATH_MAX]; -static bfd_vma dynamic_info[DT_JMPREL + 1]; +static bfd_vma dynamic_info[DT_ENCODING]; static bfd_vma dynamic_info_DT_GNU_HASH; static bfd_vma version_info[16]; static Elf_Internal_Ehdr elf_header; From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 01:00:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBAAF106566B; Sat, 1 Sep 2012 01:00:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 691ED8FC18; Sat, 1 Sep 2012 01:00:53 +0000 (UTC) Received: by obbun3 with SMTP id un3so8623641obb.13 for ; Fri, 31 Aug 2012 18:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=noHQcmqTaGS/2tQnD72fEgaF+d0omBwzR1OovT62hz4=; b=CMuN01ZP0Q668kTAABjWG7cfnB7q8NqPPGeTi6zFDoqSxi9aCyUda1dT2a0A7RaPlU ODFBM2ugbxSdilyT1/zizr53hrh3cRT1UGrtAaWQeMAiDYenoqqPyUjf4eiN5vFyNglC E0Nul8IwSXlti1qC6qfZg3UpdHBBOrARGRsUBZIp7XrLiJ97eqdzWHLF+tdbMSl/SL/k gJ5ZA8MhP3gLIfNkbdONw9sAmSqYt/HZmNTEJ2EAYH/N1bEjRSfOlovrc97wfCAYquIm 5jhqTFbHuKDbp5XER7c7MLPRMf16xEVr0UAMmKk2WEZ0y76cFeCfNAkVWeH/h8hqb7YQ eZjw== MIME-Version: 1.0 Received: by 10.182.218.37 with SMTP id pd5mr9400681obc.24.1346461253446; Fri, 31 Aug 2012 18:00:53 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Fri, 31 Aug 2012 18:00:53 -0700 (PDT) In-Reply-To: <201208312328.q7VNSfLK012047@svn.freebsd.org> References: <201208312328.q7VNSfLK012047@svn.freebsd.org> Date: Fri, 31 Aug 2012 18:00:53 -0700 Message-ID: From: Garrett Cooper To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239962 - head/contrib/binutils/binutils X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 01:00:55 -0000 On Fri, Aug 31, 2012 at 4:28 PM, Dimitry Andric wrote: > Author: dim > Date: Fri Aug 31 23:28:41 2012 > New Revision: 239962 > URL: http://svn.freebsd.org/changeset/base/239962 > > Log: > Fix a twelve year old bug in readelf: when process_dynamic_segment() > encounters a DT_RUNPATH entry, the global dynamic_info[] array is > overrun, causing some other global variable to be overwritten. > > In my testcase, this was the section_headers variable, leading to > segfaults or jemalloc assertions when it was freed later on. > > Thanks to Koop Mast for providing samples of a few "bad" .so files. ... Nice! Hopefully this fixes the random tinderbox crashes I've seen! Has this been fixed upstream? Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 02:56:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A2FC106564A; Sat, 1 Sep 2012 02:56:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 643D68FC08; Sat, 1 Sep 2012 02:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q812uIw3037828; Sat, 1 Sep 2012 02:56:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q812uILS037812; Sat, 1 Sep 2012 02:56:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209010256.q812uILS037812@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Sep 2012 02:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239963 - in head: include/rpc lib/libc/rpc sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 02:56:18 -0000 Author: pfg Date: Sat Sep 1 02:56:17 2012 New Revision: 239963 URL: http://svn.freebsd.org/changeset/base/239963 Log: Bring some changes from Bull's NFSv4 libtirpc implementation. We especifically ignored the glibc compatibility changes but this should help interaction with Solaris and Linux. ____ Fixed infinite loop in svc_run() author Steve Dickson Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400) Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. author Steve Dickson Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400) ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. author Steve Dickson Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500) ____ Converted all uid and gid variables of the type uid_t and gid_t. author Steve Dickson Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500) ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. author Jeff Layton Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400) ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. author Jeff Layton Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400) Obtained from: Bull GNU/Linux NFSv4 Project MFC after: 3 weeks Modified: head/include/rpc/auth.h head/include/rpc/auth_unix.h head/lib/libc/rpc/auth_unix.c head/lib/libc/rpc/authunix_prot.c head/lib/libc/rpc/clnt_perror.c head/lib/libc/rpc/clnt_vc.c head/lib/libc/rpc/rpc_generic.c head/lib/libc/rpc/rpc_soc.3 head/lib/libc/rpc/rpcb_clnt.c head/lib/libc/rpc/svc_auth_unix.c head/lib/libc/rpc/svc_run.c head/sys/rpc/auth.h head/sys/rpc/clnt_vc.c head/sys/rpc/rpcb_clnt.c Modified: head/include/rpc/auth.h ============================================================================== --- head/include/rpc/auth.h Fri Aug 31 23:28:41 2012 (r239962) +++ head/include/rpc/auth.h Sat Sep 1 02:56:17 2012 (r239963) @@ -243,14 +243,13 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ __END_DECLS Modified: head/include/rpc/auth_unix.h ============================================================================== --- head/include/rpc/auth_unix.h Fri Aug 31 23:28:41 2012 (r239962) +++ head/include/rpc/auth_unix.h Sat Sep 1 02:56:17 2012 (r239963) @@ -60,10 +60,10 @@ struct authunix_parms { u_long aup_time; char *aup_machname; - int aup_uid; - int aup_gid; + uid_t aup_uid; + gid_t aup_gid; u_int aup_len; - int *aup_gids; + gid_t *aup_gids; }; #define authsys_parms authunix_parms Modified: head/lib/libc/rpc/auth_unix.c ============================================================================== --- head/lib/libc/rpc/auth_unix.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/auth_unix.c Sat Sep 1 02:56:17 2012 (r239963) @@ -94,10 +94,10 @@ struct audata { AUTH * authunix_create(machname, uid, gid, len, aup_gids) char *machname; - int uid; - int gid; + uid_t uid; + gid_t gid; int len; - int *aup_gids; + gid_t *aup_gids; { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -207,9 +207,7 @@ authunix_create_default() abort(); if (ngids > NGRPS) ngids = NGRPS; - /* XXX: interface problem; those should all have been unsigned */ - auth = authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids); + auth = authunix_create(machname, uid, gid, ngids, gids); free(gids); return (auth); } Modified: head/lib/libc/rpc/authunix_prot.c ============================================================================== --- head/lib/libc/rpc/authunix_prot.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/authunix_prot.c Sat Sep 1 02:56:17 2012 (r239963) @@ -60,7 +60,7 @@ xdr_authunix_parms(xdrs, p) XDR *xdrs; struct authunix_parms *p; { - int **paup_gids; + gid_t **paup_gids; assert(xdrs != NULL); assert(p != NULL); @@ -69,8 +69,8 @@ xdr_authunix_parms(xdrs, p) if (xdr_u_long(xdrs, &(p->aup_time)) && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) - && xdr_int(xdrs, &(p->aup_uid)) - && xdr_int(xdrs, &(p->aup_gid)) + && xdr_u_int(xdrs, &(p->aup_uid)) + && xdr_u_int(xdrs, &(p->aup_gid)) && xdr_array(xdrs, (char **) paup_gids, &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) { return (TRUE); Modified: head/lib/libc/rpc/clnt_perror.c ============================================================================== --- head/lib/libc/rpc/clnt_perror.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/clnt_perror.c Sat Sep 1 02:56:17 2012 (r239963) @@ -242,7 +242,7 @@ char * clnt_spcreateerror(s) const char *s; { - char *str; + char *str, *err; size_t len, i; assert(s != NULL); @@ -258,8 +258,21 @@ clnt_spcreateerror(s) switch (rpc_createerr.cf_stat) { case RPC_PMAPFAILURE: (void) strncat(str, " - ", len - 1); - (void) strncat(str, - clnt_sperrno(rpc_createerr.cf_error.re_status), len - 4); + err = clnt_sperrno(rpc_createerr.cf_error.re_status); + if (err) + (void) strncat(str, err+5, len-5); + switch(rpc_createerr.cf_error.re_status) { + case RPC_CANTSEND: + case RPC_CANTRECV: + i = strlen(str); + len -= i; + snprintf(str+i, len, ": errno %d (%s)", + rpc_createerr.cf_error.re_errno, + strerror(rpc_createerr.cf_error.re_errno)); + break; + default: + break; + } break; case RPC_SYSTEMERROR: Modified: head/lib/libc/rpc/clnt_vc.c ============================================================================== --- head/lib/libc/rpc/clnt_vc.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/clnt_vc.c Sat Sep 1 02:56:17 2012 (r239963) @@ -672,6 +672,10 @@ clnt_vc_destroy(cl) if (ct->ct_addr.buf) free(ct->ct_addr.buf); mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); Modified: head/lib/libc/rpc/rpc_generic.c ============================================================================== --- head/lib/libc/rpc/rpc_generic.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/rpc_generic.c Sat Sep 1 02:56:17 2012 (r239963) @@ -269,7 +269,8 @@ __rpc_getconfip(nettype) } while ((nconf = getnetconfig(confighandle)) != NULL) { if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - if (strcmp(nconf->nc_proto, NC_TCP) == 0) { + if (strcmp(nconf->nc_proto, NC_TCP) == 0 && + netid_tcp == NULL) { netid_tcp = strdup(nconf->nc_netid); if (main_thread) netid_tcp_main = netid_tcp; @@ -277,7 +278,8 @@ __rpc_getconfip(nettype) thr_setspecific(tcp_key, (void *) netid_tcp); } else - if (strcmp(nconf->nc_proto, NC_UDP) == 0) { + if (strcmp(nconf->nc_proto, NC_UDP) == 0 && + netid_udp == NULL) { netid_udp = strdup(nconf->nc_netid); if (main_thread) netid_udp_main = netid_udp; @@ -616,6 +618,9 @@ __rpc_taddr2uaddr_af(int af, const struc #endif u_int16_t port; + if (nbuf->len <= 0) + return NULL; + switch (af) { case AF_INET: sin = nbuf->buf; Modified: head/lib/libc/rpc/rpc_soc.3 ============================================================================== --- head/lib/libc/rpc/rpc_soc.3 Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/rpc_soc.3 Sat Sep 1 02:56:17 2012 (r239963) @@ -148,7 +148,7 @@ default authentication used by .Ft "AUTH *" .Xc .It Xo -.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids" +.Fn authunix_create "char *host" "uid_t uid" "gid_t gid" "int len" "gid_t *aup_gids" .Xc .Pp Create and return an Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/rpcb_clnt.c Sat Sep 1 02:56:17 2012 (r239963) @@ -770,6 +770,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. Modified: head/lib/libc/rpc/svc_auth_unix.c ============================================================================== --- head/lib/libc/rpc/svc_auth_unix.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/svc_auth_unix.c Sat Sep 1 02:56:17 2012 (r239963) @@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg) struct area { struct authunix_parms area_aup; char area_machname[MAX_MACHINE_NAME+1]; - int area_gids[NGRPS]; + gid_t area_gids[NGRPS]; } *area; u_int auth_len; size_t str_len, gid_len; Modified: head/lib/libc/rpc/svc_run.c ============================================================================== --- head/lib/libc/rpc/svc_run.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/svc_run.c Sat Sep 1 02:56:17 2012 (r239963) @@ -60,14 +60,13 @@ svc_run() fd_set readfds, cleanfds; struct timeval timeout; - timeout.tv_sec = 30; - timeout.tv_usec = 0; - for (;;) { rwlock_rdlock(&svc_fd_lock); readfds = svc_fdset; cleanfds = svc_fdset; rwlock_unlock(&svc_fd_lock); + timeout.tv_sec = 30; + timeout.tv_usec = 0; switch (_select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) { case -1: FD_ZERO(&readfds); Modified: head/sys/rpc/auth.h ============================================================================== --- head/sys/rpc/auth.h Fri Aug 31 23:28:41 2012 (r239962) +++ head/sys/rpc/auth.h Sat Sep 1 02:56:17 2012 (r239963) @@ -234,18 +234,17 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS #ifdef _KERNEL struct ucred; extern AUTH *authunix_create(struct ucred *); #else -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ #endif extern AUTH *authnone_create(void); /* takes no parameters */ Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/sys/rpc/clnt_vc.c Sat Sep 1 02:56:17 2012 (r239963) @@ -836,6 +836,10 @@ clnt_vc_destroy(CLIENT *cl) soclose(so); } mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); } Modified: head/sys/rpc/rpcb_clnt.c ============================================================================== --- head/sys/rpc/rpcb_clnt.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/sys/rpc/rpcb_clnt.c Sat Sep 1 02:56:17 2012 (r239963) @@ -780,6 +780,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 03:46:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20D271065673; Sat, 1 Sep 2012 03:46:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3138FC0C; Sat, 1 Sep 2012 03:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q813kSvo043880; Sat, 1 Sep 2012 03:46:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q813kSqJ043876; Sat, 1 Sep 2012 03:46:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209010346.q813kSqJ043876@svn.freebsd.org> From: Alan Cox Date: Sat, 1 Sep 2012 03:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239964 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 03:46:29 -0000 Author: alc Date: Sat Sep 1 03:46:28 2012 New Revision: 239964 URL: http://svn.freebsd.org/changeset/base/239964 Log: Introduce a new software PTE flag that indicates whether the mapping is for a managed page. Tested by: jchandra Modified: head/sys/mips/include/pmap.h head/sys/mips/include/pte.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Sat Sep 1 02:56:17 2012 (r239963) +++ head/sys/mips/include/pmap.h Sat Sep 1 03:46:28 2012 (r239964) @@ -171,7 +171,6 @@ void pmap_bootstrap(void); void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); -int page_is_managed(vm_paddr_t pa); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr); void pmap_kremove(vm_offset_t va); Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Sat Sep 1 02:56:17 2012 (r239963) +++ head/sys/mips/include/pte.h Sat Sep 1 03:46:28 2012 (r239964) @@ -57,8 +57,8 @@ typedef pt_entry_t *pd_entry_t; /* * PFN for EntryLo register. Upper bits are 0, which is to say that - * bit 29 is the last hardware bit; Bits 30 and upwards (EntryLo is - * 64 bit though it can be referred to in 32-bits providing 2 software + * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is + * 64 bit though it can be referred to in 32-bits providing 3 software * bits safely. We use it as 64 bits to get many software bits, and * god knows what else.) are unacknowledged by hardware. They may be * written as anything, but otherwise they have as much meaning as @@ -68,11 +68,11 @@ typedef pt_entry_t *pd_entry_t; #define TLBLO_SWBITS_SHIFT (34) #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL #else -#define TLBLO_SWBITS_SHIFT (30) -#define TLBLO_PFN_MASK (0x3FFFFFC0) +#define TLBLO_SWBITS_SHIFT (29) +#define TLBLO_PFN_MASK (0x1FFFFFC0) #endif #define TLBLO_PFN_SHIFT (6) -#define TLBLO_SWBITS_MASK ((pt_entry_t)0x3 << TLBLO_SWBITS_SHIFT) +#define TLBLO_SWBITS_MASK ((pt_entry_t)0x7 << TLBLO_SWBITS_SHIFT) #define TLBLO_PA_TO_PFN(pa) ((((pa) >> TLB_PAGE_SHIFT) << TLBLO_PFN_SHIFT) & TLBLO_PFN_MASK) #define TLBLO_PFN_TO_PA(pfn) ((vm_paddr_t)((pfn) >> TLBLO_PFN_SHIFT) << TLB_PAGE_SHIFT) #define TLBLO_PTE_TO_PFN(pte) ((pte) & TLBLO_PFN_MASK) @@ -132,9 +132,11 @@ typedef pt_entry_t *pd_entry_t; * RO: Read only. Never set PTE_D on this page, and don't * listen to requests to write to it. * W: Wired. ??? + * MANAGED:Managed. This PTE maps a managed page. */ #define PTE_RO ((pt_entry_t)0x01 << TLBLO_SWBITS_SHIFT) #define PTE_W ((pt_entry_t)0x02 << TLBLO_SWBITS_SHIFT) +#define PTE_MANAGED ((pt_entry_t)0x04 << TLBLO_SWBITS_SHIFT) /* * PTE management functions for bits defined above. @@ -160,7 +162,7 @@ typedef pt_entry_t *pd_entry_t; #define PTESIZE 4 #define PTE_L lw #define PTE_MTC0 mtc0 -#define CLEAR_PTE_SWBITS(r) sll r, 2; srl r, 2 /* remove 2 high bits */ +#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 high bits */ #endif /* defined(__mips_n64) || defined(__mips_n32) */ #if defined(__mips_n64) Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Sep 1 02:56:17 2012 (r239963) +++ head/sys/mips/mips/pmap.c Sat Sep 1 03:46:28 2012 (r239964) @@ -1691,9 +1691,9 @@ pmap_remove_pte(struct pmap *pmap, pt_en pmap->pm_stats.wired_count -= 1; pmap->pm_stats.resident_count -= 1; - pa = TLBLO_PTE_TO_PA(oldpte); - if (page_is_managed(pa)) { + if (pte_test(&oldpte, PTE_MANAGED)) { + pa = TLBLO_PTE_TO_PA(oldpte); m = PHYS_TO_VM_PAGE(pa); if (pte_test(&oldpte, PTE_D)) { KASSERT(!pte_test(&oldpte, PTE_RO), @@ -1930,8 +1930,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (!pte_test(pte, PTE_V)) continue; pbits = *pte; - pa = TLBLO_PTE_TO_PA(pbits); - if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { + if (pte_test(&pbits, PTE_MANAGED | PTE_D)) { + pa = TLBLO_PTE_TO_PA(pbits); m = PHYS_TO_VM_PAGE(pa); vm_page_dirty(m); } @@ -1975,6 +1975,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0, ("pmap_enter: page %p is not busy", m)); + pa = VM_PAGE_TO_PHYS(m); + newpte = TLBLO_PA_TO_PFN(pa) | PTE_V; mpte = NULL; @@ -1997,7 +1999,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, panic("pmap_enter: invalid page directory, pdir=%p, va=%p", (void *)pmap->pm_segtab, (void *)va); } - pa = VM_PAGE_TO_PHYS(m); om = NULL; origpte = *pte; opa = TLBLO_PTE_TO_PA(origpte); @@ -2027,8 +2028,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (mpte) mpte->wire_count--; - if (page_is_managed(opa)) { + if (pte_test(&origpte, PTE_MANAGED)) { om = m; + newpte |= PTE_MANAGED; } goto validate; } @@ -2043,7 +2045,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pte_test(&origpte, PTE_W)) pmap->pm_stats.wired_count--; - if (page_is_managed(opa)) { + if (pte_test(&origpte, PTE_MANAGED)) { om = PHYS_TO_VM_PAGE(opa); pv = pmap_pvh_remove(&om->md, pmap, va); } @@ -2068,6 +2070,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + newpte |= PTE_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -2088,7 +2091,7 @@ validate: /* * Now validate mapping with desired protection/wiring. */ - newpte = TLBLO_PA_TO_PFN(pa) | rw | PTE_V; + newpte |= rw; if (is_cacheable_mem(pa)) newpte |= PTE_C_CACHE; @@ -2108,7 +2111,7 @@ validate: if (origpte != newpte) { if (pte_test(&origpte, PTE_V)) { *pte = newpte; - if (page_is_managed(opa) && (opa != pa)) { + if (pte_test(&origpte, PTE_MANAGED) && opa != pa) { if (om->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(om, PGA_REFERENCED); om->md.pv_flags &= ~PV_TABLE_REF; @@ -2117,10 +2120,10 @@ validate: KASSERT(!pte_test(&origpte, PTE_RO), ("pmap_enter: modified page not writable:" " va: %p, pte: %#jx", (void *)va, (uintmax_t)origpte)); - if (page_is_managed(opa)) + if (pte_test(&origpte, PTE_MANAGED)) vm_page_dirty(om); } - if (page_is_managed(opa) && + if (pte_test(&origpte, PTE_MANAGED) && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } else { @@ -2247,6 +2250,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * Now validate mapping with RO protection */ *pte = TLBLO_PA_TO_PFN(pa) | PTE_V; + if ((m->oflags & VPO_UNMANAGED) == 0) + *pte |= PTE_MANAGED; if (is_cacheable_mem(pa)) *pte |= PTE_C_CACHE; @@ -2982,7 +2987,6 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad vm_paddr_t pa; vm_page_t m; int val; - boolean_t managed; PMAP_LOCK(pmap); retry: @@ -2996,8 +3000,7 @@ retry: if (pte_test(&pte, PTE_D)) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; pa = TLBLO_PTE_TO_PA(pte); - managed = page_is_managed(pa); - if (managed) { + if (pte_test(&pte, PTE_MANAGED)) { /* * This may falsely report the given address as * MINCORE_REFERENCED. Unfortunately, due to the lack of @@ -3009,7 +3012,8 @@ retry: val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != - (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + pte_test(&pte, PTE_MANAGED)) { /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) goto retry; @@ -3232,23 +3236,6 @@ pmap_asid_alloc(pmap) } } -int -page_is_managed(vm_paddr_t pa) -{ - vm_offset_t pgnum = atop(pa); - - if (pgnum >= first_page) { - vm_page_t m; - - m = PHYS_TO_VM_PAGE(pa); - if (m == NULL) - return (0); - if ((m->oflags & VPO_UNMANAGED) == 0) - return (1); - } - return (0); -} - static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot) { @@ -3305,9 +3292,9 @@ pmap_emulate_modified(pmap_t pmap, vm_of } pte_set(pte, PTE_D); tlb_update(pmap, va, *pte); - pa = TLBLO_PTE_TO_PA(*pte); - if (!page_is_managed(pa)) + if (!pte_test(pte, PTE_MANAGED)) panic("pmap_emulate_modified: unmanaged page"); + pa = TLBLO_PTE_TO_PA(*pte); m = PHYS_TO_VM_PAGE(pa); m->md.pv_flags |= PV_TABLE_REF; PMAP_UNLOCK(pmap); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 05:35:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C2E910658E1; Sat, 1 Sep 2012 05:35:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 435408FC12; Sat, 1 Sep 2012 05:35:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q815ZnKX055705; Sat, 1 Sep 2012 05:35:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q815Zm9n055697; Sat, 1 Sep 2012 05:35:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209010535.q815Zm9n055697@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Sep 2012 05:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239965 - in stable/9/sys: dev/drm2 dev/drm2/i915 modules/drm2/drm2 modules/drm2/i915kms X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 05:35:49 -0000 Author: kib Date: Sat Sep 1 05:35:48 2012 New Revision: 239965 URL: http://svn.freebsd.org/changeset/base/239965 Log: MFC r239375: Add drm and i915 ioctl translations for 32 bit process on 64 bit host. Added: stable/9/sys/dev/drm2/drm_ioc32.c - copied unchanged from r239375, head/sys/dev/drm2/drm_ioc32.c stable/9/sys/dev/drm2/i915/i915_ioc32.c - copied unchanged from r239375, head/sys/dev/drm2/i915/i915_ioc32.c Modified: stable/9/sys/dev/drm2/drmP.h stable/9/sys/dev/drm2/drm_drv.c stable/9/sys/dev/drm2/i915/i915_dma.c stable/9/sys/dev/drm2/i915/i915_drv.h stable/9/sys/modules/drm2/drm2/Makefile stable/9/sys/modules/drm2/i915kms/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/drm2/drmP.h ============================================================================== --- stable/9/sys/dev/drm2/drmP.h Sat Sep 1 03:46:28 2012 (r239964) +++ stable/9/sys/dev/drm2/drmP.h Sat Sep 1 05:35:48 2012 (r239965) @@ -105,6 +105,7 @@ struct drm_file; #include #include +#include "opt_compat.h" #include "opt_drm.h" #ifdef DRM_DEBUG #undef DRM_DEBUG @@ -760,6 +761,10 @@ struct drm_driver_info { int (*device_is_agp) (struct drm_device * dev); drm_ioctl_desc_t *ioctls; +#ifdef COMPAT_FREEBSD32 + drm_ioctl_desc_t *compat_ioctls; + int *compat_ioctls_nr; +#endif int max_ioctl; int buf_priv_size; Modified: stable/9/sys/dev/drm2/drm_drv.c ============================================================================== --- stable/9/sys/dev/drm2/drm_drv.c Sat Sep 1 03:46:28 2012 (r239964) +++ stable/9/sys/dev/drm2/drm_drv.c Sat Sep 1 05:35:48 2012 (r239965) @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); * open/close, and ioctl dispatch. */ - #include +#include #include #include #include @@ -802,6 +802,8 @@ void drm_close(void *data) DRM_UNLOCK(dev); } +extern drm_ioctl_desc_t drm_compat_ioctls[]; + /* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. */ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, @@ -846,7 +848,22 @@ int drm_ioctl(struct cdev *kdev, u_long return EINVAL; } - ioctl = &drm_ioctls[nr]; +#ifdef COMPAT_FREEBSD32 + /* + * Called whenever a 32-bit process running under a 64-bit + * kernel performs an ioctl on /dev/drm. + */ + if (SV_CURPROC_FLAG(SV_ILP32) && drm_compat_ioctls[nr].func != NULL) + /* + * Assume that ioctls without an explicit compat + * routine will just work. This may not always be a + * good assumption, but it's better than always + * failing. + */ + ioctl = &drm_compat_ioctls[nr]; + else +#endif + ioctl = &drm_ioctls[nr]; /* It's not a core DRM ioctl, try driver-specific. */ if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) { /* The array entries begin at DRM_COMMAND_BASE ioctl nr */ @@ -856,7 +873,14 @@ int drm_ioctl(struct cdev *kdev, u_long nr, dev->driver->max_ioctl); return EINVAL; } - ioctl = &dev->driver->ioctls[nr]; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32) && + nr < *dev->driver->compat_ioctls_nr && + dev->driver->compat_ioctls[nr].func != NULL) + ioctl = &dev->driver->compat_ioctls[nr]; + else +#endif + ioctl = &dev->driver->ioctls[nr]; is_driver_ioctl = 1; } func = ioctl->func; Copied: stable/9/sys/dev/drm2/drm_ioc32.c (from r239375, head/sys/dev/drm2/drm_ioc32.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/drm2/drm_ioc32.c Sat Sep 1 05:35:48 2012 (r239965, copy of r239375, head/sys/dev/drm2/drm_ioc32.c) @@ -0,0 +1,788 @@ +/*- + * Copyright (C) Paul Mackerras 2005. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Paul Mackerras + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#ifdef COMPAT_FREEBSD32 + +#include +#include + +/** @file drm_ioc32.c + * 32-bit ioctl compatibility routines for the DRM. + */ + +#define DRM_IOCTL_VERSION32 DRM_IOWR(0x00, drm_version32_t) +#define DRM_IOCTL_GET_UNIQUE32 DRM_IOWR(0x01, drm_unique32_t) +#define DRM_IOCTL_GET_MAP32 DRM_IOWR(0x04, drm_map32_t) +#define DRM_IOCTL_GET_CLIENT32 DRM_IOWR(0x05, drm_client32_t) +#define DRM_IOCTL_GET_STATS32 DRM_IOR( 0x06, drm_stats32_t) + +#define DRM_IOCTL_SET_UNIQUE32 DRM_IOW( 0x10, drm_unique32_t) +#define DRM_IOCTL_ADD_MAP32 DRM_IOWR(0x15, drm_map32_t) +#define DRM_IOCTL_ADD_BUFS32 DRM_IOWR(0x16, drm_buf_desc32_t) +#define DRM_IOCTL_MARK_BUFS32 DRM_IOW( 0x17, drm_buf_desc32_t) +#define DRM_IOCTL_INFO_BUFS32 DRM_IOWR(0x18, drm_buf_info32_t) +#define DRM_IOCTL_MAP_BUFS32 DRM_IOWR(0x19, drm_buf_map32_t) +#define DRM_IOCTL_FREE_BUFS32 DRM_IOW( 0x1a, drm_buf_free32_t) + +#define DRM_IOCTL_RM_MAP32 DRM_IOW( 0x1b, drm_map32_t) + +#define DRM_IOCTL_SET_SAREA_CTX32 DRM_IOW( 0x1c, drm_ctx_priv_map32_t) +#define DRM_IOCTL_GET_SAREA_CTX32 DRM_IOWR(0x1d, drm_ctx_priv_map32_t) + +#define DRM_IOCTL_RES_CTX32 DRM_IOWR(0x26, drm_ctx_res32_t) +#define DRM_IOCTL_DMA32 DRM_IOWR(0x29, drm_dma32_t) + +#define DRM_IOCTL_AGP_ENABLE32 DRM_IOW( 0x32, drm_agp_mode32_t) +#define DRM_IOCTL_AGP_INFO32 DRM_IOR( 0x33, drm_agp_info32_t) +#define DRM_IOCTL_AGP_ALLOC32 DRM_IOWR(0x34, drm_agp_buffer32_t) +#define DRM_IOCTL_AGP_FREE32 DRM_IOW( 0x35, drm_agp_buffer32_t) +#define DRM_IOCTL_AGP_BIND32 DRM_IOW( 0x36, drm_agp_binding32_t) +#define DRM_IOCTL_AGP_UNBIND32 DRM_IOW( 0x37, drm_agp_binding32_t) + +#define DRM_IOCTL_SG_ALLOC32 DRM_IOW( 0x38, drm_scatter_gather32_t) +#define DRM_IOCTL_SG_FREE32 DRM_IOW( 0x39, drm_scatter_gather32_t) + +#define DRM_IOCTL_UPDATE_DRAW32 DRM_IOW( 0x3f, drm_update_draw32_t) + +#define DRM_IOCTL_WAIT_VBLANK32 DRM_IOWR(0x3a, drm_wait_vblank32_t) + +typedef struct drm_version_32 { + int version_major; /**< Major version */ + int version_minor; /**< Minor version */ + int version_patchlevel; /**< Patch level */ + u32 name_len; /**< Length of name buffer */ + u32 name; /**< Name of driver */ + u32 date_len; /**< Length of date buffer */ + u32 date; /**< User-space buffer to hold date */ + u32 desc_len; /**< Length of desc buffer */ + u32 desc; /**< User-space buffer to hold desc */ +} drm_version32_t; + +static int compat_drm_version(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_version32_t *v32 = data; + struct drm_version version; + int err; + + version.name_len = v32->name_len; + version.name = (void *)(unsigned long)v32->name; + version.date_len = v32->date_len; + version.date = (void *)(unsigned long)v32->date; + version.desc_len = v32->desc_len; + version.desc = (void *)(unsigned long)v32->desc; + + err = drm_version(dev, (void *)&version, file_priv); + if (err) + return err; + + v32->version_major = version.version_major; + v32->version_minor = version.version_minor; + v32->version_patchlevel = version.version_patchlevel; + v32->name_len = version.name_len; + v32->date_len = version.date_len; + v32->desc_len = version.desc_len; + + return 0; +} + +typedef struct drm_unique32 { + u32 unique_len; /**< Length of unique */ + u32 unique; /**< Unique name for driver instantiation */ +} drm_unique32_t; + +static int compat_drm_getunique(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_unique32_t *uq32 = data; + struct drm_unique u; + int err; + + u.unique_len = uq32->unique_len; + u.unique = (void *)(unsigned long)uq32->unique; + + err = drm_getunique(dev, (void *)&u, file_priv); + if (err) + return err; + + uq32->unique_len = u.unique_len; + + return 0; +} + +static int compat_drm_setunique(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_unique32_t *uq32 = data; + struct drm_unique u; + + u.unique_len = uq32->unique_len; + u.unique = (void *)(unsigned long)uq32->unique; + + return drm_setunique(dev, (void *)&u, file_priv); +} + +typedef struct drm_map32 { + u32 offset; /**< Requested physical address (0 for SAREA)*/ + u32 size; /**< Requested physical size (bytes) */ + enum drm_map_type type; /**< Type of memory to map */ + enum drm_map_flags flags; /**< Flags */ + u32 handle; /**< User-space: "Handle" to pass to mmap() */ + int mtrr; /**< MTRR slot used */ +} drm_map32_t; + +static int compat_drm_getmap(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_map32_t *m32 = data; + struct drm_map map; + int err; + void *handle; + + map.offset = (unsigned long)m32->offset; + + err = drm_getmap(dev, (void *)&map, file_priv); + if (err) + return err; + + m32->offset = map.offset; + m32->size = map.size; + m32->type = map.type; + m32->flags = map.flags; + handle = map.handle; + m32->mtrr = map.mtrr; + + m32->handle = (unsigned long)handle; + + return 0; + +} + +static int compat_drm_addmap(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_map32_t *m32 = data; + struct drm_map map; + int err; + void *handle; + + map.offset = (unsigned long)m32->offset; + map.size = (unsigned long)m32->size; + map.type = m32->type; + map.flags = m32->flags; + + err = drm_addmap_ioctl(dev, (void *)&map, file_priv); + if (err) + return err; + + m32->offset = map.offset; + m32->mtrr = map.mtrr; + handle = map.handle; + + m32->handle = (unsigned long)handle; + if (m32->handle != (unsigned long)handle) + DRM_DEBUG("compat_drm_addmap truncated handle" + " %p for type %d offset %x\n", + handle, m32->type, m32->offset); + + return 0; +} + +static int compat_drm_rmmap(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_map32_t *m32 = data; + struct drm_map map; + + map.handle = (void *)(unsigned long)m32->handle; + + return drm_rmmap_ioctl(dev, (void *)&map, file_priv); +} + +typedef struct drm_client32 { + int idx; /**< Which client desired? */ + int auth; /**< Is client authenticated? */ + u32 pid; /**< Process ID */ + u32 uid; /**< User ID */ + u32 magic; /**< Magic */ + u32 iocs; /**< Ioctl count */ +} drm_client32_t; + +static int compat_drm_getclient(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_client32_t *c32 = data; + struct drm_client client; + int err; + + client.idx = c32->idx; + + err = drm_getclient(dev, (void *)&client, file_priv); + if (err) + return err; + + c32->idx = client.idx; + c32->auth = client.auth; + c32->pid = client.pid; + c32->uid = client.uid; + c32->magic = client.magic; + c32->iocs = client.iocs; + + return 0; +} + +typedef struct drm_stats32 { + u32 count; + struct { + u32 value; + enum drm_stat_type type; + } data[15]; +} drm_stats32_t; + +static int compat_drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_stats32_t *s32 = data; + struct drm_stats stats; + int i, err; + + err = drm_getstats(dev, (void *)&stats, file_priv); + if (err) + return err; + + s32->count = stats.count; + for (i = 0; i < stats.count; i++) { + s32->data[i].value = stats.data[i].value; + s32->data[i].type = stats.data[i].type; + } + + return 0; +} + +typedef struct drm_buf_desc32 { + int count; /**< Number of buffers of this size */ + int size; /**< Size in bytes */ + int low_mark; /**< Low water mark */ + int high_mark; /**< High water mark */ + int flags; + u32 agp_start; /**< Start address in the AGP aperture */ +} drm_buf_desc32_t; + +static int compat_drm_addbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_buf_desc32_t *b32 = data; + struct drm_buf_desc buf; + int err; + + buf.count = b32->count; + buf.size = b32->size; + buf.low_mark = b32->low_mark; + buf.high_mark = b32->high_mark; + buf.flags = b32->flags; + buf.agp_start = (unsigned long)b32->agp_start; + + err = drm_addbufs(dev, (void *)&buf, file_priv); + if (err) + return err; + + b32->count = buf.count; + b32->size = buf.size; + b32->low_mark = buf.low_mark; + b32->high_mark = buf.high_mark; + b32->flags = buf.flags; + b32->agp_start = buf.agp_start; + + return 0; +} + +static int compat_drm_markbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_buf_desc32_t *b32 = data; + struct drm_buf_desc buf; + + buf.size = b32->size; + buf.low_mark = b32->low_mark; + buf.high_mark = b32->high_mark; + + return drm_markbufs(dev, (void *)&buf, file_priv); +} + +typedef struct drm_buf_info32 { + int count; /**< Entries in list */ + u32 list; +} drm_buf_info32_t; + +static int compat_drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_buf_info32_t *req32 = data; + drm_buf_desc32_t *to; + struct drm_buf_info *request; + struct drm_buf_desc *list; + size_t nbytes; + int i, err; + int count, actual; + + count = req32->count; + to = (drm_buf_desc32_t *)(unsigned long)req32->list; + if (count < 0) + count = 0; + + nbytes = sizeof(*request) + count * sizeof(struct drm_buf_desc); + request = malloc(nbytes, DRM_MEM_BUFLISTS, M_ZERO | M_NOWAIT); + if (!request) + return -EFAULT; + list = (struct drm_buf_desc *) (request + 1); + + request->count = count; + request->list = list; + + err = drm_infobufs(dev, (void *)request, file_priv); + if (err) + return err; + + actual = request->count; + if (count >= actual) + for (i = 0; i < actual; ++i) { + to[i].count = list[i].count; + to[i].size = list[i].size; + to[i].low_mark = list[i].low_mark; + to[i].high_mark = list[i].high_mark; + to[i].flags = list[i].flags; + } + + req32->count = actual; + + return 0; +} + +typedef struct drm_buf_pub32 { + int idx; /**< Index into the master buffer list */ + int total; /**< Buffer size */ + int used; /**< Amount of buffer in use (for DMA) */ + u32 address; /**< Address of buffer */ +} drm_buf_pub32_t; + +typedef struct drm_buf_map32 { + int count; /**< Length of the buffer list */ + u32 virtual; /**< Mmap'd area in user-virtual */ + u32 list; /**< Buffer information */ +} drm_buf_map32_t; + +static int compat_drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_buf_map32_t *req32 = data; + drm_buf_pub32_t *list32; + struct drm_buf_map *request; + struct drm_buf_pub *list; + int i, err; + int count, actual; + size_t nbytes; + + count = req32->count; + list32 = (void *)(unsigned long)req32->list; + + if (count < 0) + return -EINVAL; + nbytes = sizeof(*request) + count * sizeof(struct drm_buf_pub); + request = malloc(nbytes, DRM_MEM_BUFLISTS, M_ZERO | M_NOWAIT); + if (!request) + return -EFAULT; + list = (struct drm_buf_pub *) (request + 1); + + request->count = count; + request->list = list; + + err = drm_mapbufs(dev, (void *)request, file_priv); + if (err) + return err; + + actual = request->count; + if (count >= actual) + for (i = 0; i < actual; ++i) { + list32[i].idx = list[i].idx; + list32[i].total = list[i].total; + list32[i].used = list[i].used; + list32[i].address = (unsigned long)list[i].address; + } + + req32->count = actual; + req32->virtual = (unsigned long)request->virtual; + + return 0; +} + +typedef struct drm_buf_free32 { + int count; + u32 list; +} drm_buf_free32_t; + +static int compat_drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_buf_free32_t *req32 = data; + struct drm_buf_free request; + + request.count = req32->count; + request.list = (int *)(unsigned long)req32->list; + + return drm_freebufs(dev, (void *)&request, file_priv); +} + +typedef struct drm_ctx_priv_map32 { + unsigned int ctx_id; /**< Context requesting private mapping */ + u32 handle; /**< Handle of map */ +} drm_ctx_priv_map32_t; + +static int compat_drm_setsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_ctx_priv_map32_t *req32 = data; + struct drm_ctx_priv_map request; + + request.ctx_id = req32->ctx_id; + request.handle = (void *)(unsigned long)req32->handle; + + return drm_setsareactx(dev, (void *)&request, file_priv); +} + +static int compat_drm_getsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_ctx_priv_map32_t *req32 = data; + struct drm_ctx_priv_map request; + int err; + + request.ctx_id = req32->ctx_id; + + err = drm_getsareactx(dev, (void *)&request, file_priv); + if (err) + return err; + + req32->handle = (unsigned long)request.handle; + + return 0; +} + +typedef struct drm_ctx_res32 { + int count; + u32 contexts; +} drm_ctx_res32_t; + +static int compat_drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_ctx_res32_t *res32 = data; + struct drm_ctx_res res; + int err; + + res.count = res32->count; + res.contexts = (struct drm_ctx __user *)(unsigned long)res32->contexts; + + err = drm_resctx(dev, (void *)&res, file_priv); + if (err) + return err; + + res32->count = res.count; + + return 0; +} + +typedef struct drm_dma32 { + int context; /**< Context handle */ + int send_count; /**< Number of buffers to send */ + u32 send_indices; /**< List of handles to buffers */ + u32 send_sizes; /**< Lengths of data to send */ + enum drm_dma_flags flags; /**< Flags */ + int request_count; /**< Number of buffers requested */ + int request_size; /**< Desired size for buffers */ + u32 request_indices; /**< Buffer information */ + u32 request_sizes; + int granted_count; /**< Number of buffers granted */ +} drm_dma32_t; + +static int compat_drm_dma(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_dma32_t *d32 = data; + struct drm_dma d; + int err; + + d.context = d32->context; + d.send_count = d32->send_count; + d.send_indices = (int *)(unsigned long)d32->send_indices; + d.send_sizes = (int *)(unsigned long)d32->send_sizes; + d.flags = d32->flags; + d.request_count = d32->request_count; + d.request_indices = (int *)(unsigned long)d32->request_indices; + d.request_sizes = (int *)(unsigned long)d32->request_sizes; + + err = drm_dma(dev, (void *)&d, file_priv); + if (err) + return err; + + d32->request_size = d.request_size; + d32->granted_count = d.granted_count; + + return 0; +} + +typedef struct drm_agp_mode32 { + u32 mode; /**< AGP mode */ +} drm_agp_mode32_t; + +static int compat_drm_agp_enable(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_agp_mode32_t *m32 = data; + struct drm_agp_mode mode; + + mode.mode = m32->mode; + + return drm_agp_enable_ioctl(dev, (void *)&mode, file_priv); +} + +typedef struct drm_agp_info32 { + int agp_version_major; + int agp_version_minor; + u32 mode; + u32 aperture_base; /* physical address */ + u32 aperture_size; /* bytes */ + u32 memory_allowed; /* bytes */ + u32 memory_used; + + /* PCI information */ + unsigned short id_vendor; + unsigned short id_device; +} drm_agp_info32_t; + +static int compat_drm_agp_info(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_agp_info32_t *i32 = data; + struct drm_agp_info info; + int err; + + err = drm_agp_info_ioctl(dev, (void *)&info, file_priv); + if (err) + return err; + + i32->agp_version_major = info.agp_version_major; + i32->agp_version_minor = info.agp_version_minor; + i32->mode = info.mode; + i32->aperture_base = info.aperture_base; + i32->aperture_size = info.aperture_size; + i32->memory_allowed = info.memory_allowed; + i32->memory_used = info.memory_used; + i32->id_vendor = info.id_vendor; + i32->id_device = info.id_device; + + return 0; +} + +typedef struct drm_agp_buffer32 { + u32 size; /**< In bytes -- will round to page boundary */ + u32 handle; /**< Used for binding / unbinding */ + u32 type; /**< Type of memory to allocate */ + u32 physical; /**< Physical used by i810 */ +} drm_agp_buffer32_t; + +static int compat_drm_agp_alloc(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_agp_buffer32_t *req32 = data; + struct drm_agp_buffer request; + int err; + + request.size = req32->size; + request.type = req32->type; + + err = drm_agp_alloc_ioctl(dev, (void *)&request, file_priv); + if (err) + return err; + + req32->handle = request.handle; + req32->physical = request.physical; + + return 0; +} + +static int compat_drm_agp_free(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_agp_buffer32_t *req32 = data; + struct drm_agp_buffer request; + + request.handle = req32->handle; + + return drm_agp_free_ioctl(dev, (void *)&request, file_priv); +} + +typedef struct drm_agp_binding32 { + u32 handle; /**< From drm_agp_buffer */ + u32 offset; /**< In bytes -- will round to page boundary */ +} drm_agp_binding32_t; + +static int compat_drm_agp_bind(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_agp_binding32_t *req32 = data; + struct drm_agp_binding request; + + request.handle = req32->handle; + request.offset = req32->offset; + + return drm_agp_bind_ioctl(dev, (void *)&request, file_priv); +} + +static int compat_drm_agp_unbind(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_agp_binding32_t *req32 = data; + struct drm_agp_binding request; + + request.handle = req32->handle; + + return drm_agp_unbind_ioctl(dev, (void *)&request, file_priv); +} + +typedef struct drm_scatter_gather32 { + u32 size; /**< In bytes -- will round to page boundary */ + u32 handle; /**< Used for mapping / unmapping */ +} drm_scatter_gather32_t; + +static int compat_drm_sg_alloc(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_scatter_gather32_t *req32 = data; + struct drm_scatter_gather request; + int err; + + request.size = (unsigned long)req32->size; + + err = drm_sg_alloc_ioctl(dev, (void *)&request, file_priv); + if (err) + return err; + + /* XXX not sure about the handle conversion here... */ + req32->handle = (unsigned long)request.handle >> PAGE_SHIFT; + + return 0; +} + +static int compat_drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_scatter_gather32_t *req32 = data; + struct drm_scatter_gather request; + + request.handle = (unsigned long)req32->handle << PAGE_SHIFT; + + return drm_sg_free(dev, (void *)&request, file_priv); +} + +typedef struct drm_update_draw32 { + drm_drawable_t handle; + unsigned int type; + unsigned int num; + /* 64-bit version has a 32-bit pad here */ + u64 data; /**< Pointer */ +} __attribute__((packed)) drm_update_draw32_t; + +static int compat_drm_update_draw(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_update_draw32_t *update32 = data; + struct drm_update_draw request; + int err; + + request.handle = update32->handle; + request.type = update32->type; + request.num = update32->num; + request.data = update32->data; + + err = drm_update_draw(dev, (void *)&request, file_priv); + return err; +} + +struct drm_wait_vblank_request32 { + enum drm_vblank_seq_type type; + unsigned int sequence; + u32 signal; +}; + +struct drm_wait_vblank_reply32 { + enum drm_vblank_seq_type type; + unsigned int sequence; + s32 tval_sec; + s32 tval_usec; +}; + +typedef union drm_wait_vblank32 { + struct drm_wait_vblank_request32 request; + struct drm_wait_vblank_reply32 reply; +} drm_wait_vblank32_t; + +static int compat_drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ + drm_wait_vblank32_t *req32 = data; + union drm_wait_vblank request; + int err; + + request.request.type = req32->request.type; + request.request.sequence = req32->request.sequence; + request.request.signal = req32->request.signal; + + err = drm_wait_vblank(dev, (void *)&request, file_priv); + if (err) + return err; + + req32->reply.type = request.reply.type; + req32->reply.sequence = request.reply.sequence; + req32->reply.tval_sec = request.reply.tval_sec; + req32->reply.tval_usec = request.reply.tval_usec; + + return 0; +} + +drm_ioctl_desc_t drm_compat_ioctls[256] = { + DRM_IOCTL_DEF(DRM_IOCTL_VERSION32, compat_drm_version, 0), + DRM_IOCTL_DEF(DRM_IOCTL_GET_UNIQUE32, compat_drm_getunique, 0), + DRM_IOCTL_DEF(DRM_IOCTL_GET_MAP32, compat_drm_getmap, 0), + DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT32, compat_drm_getclient, 0), + DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS32, compat_drm_getstats, 0), + DRM_IOCTL_DEF(DRM_IOCTL_SET_UNIQUE32, compat_drm_setunique, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_ADD_MAP32, compat_drm_addmap, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_ADD_BUFS32, compat_drm_addbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_MARK_BUFS32, compat_drm_markbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_INFO_BUFS32, compat_drm_infobufs, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_MAP_BUFS32, compat_drm_mapbufs, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_FREE_BUFS32, compat_drm_freebufs, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_RM_MAP32, compat_drm_rmmap, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_SET_SAREA_CTX32, compat_drm_setsareactx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_GET_SAREA_CTX32, compat_drm_getsareactx, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_RES_CTX32, compat_drm_resctx, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_DMA32, compat_drm_dma, DRM_AUTH), + + DRM_IOCTL_DEF(DRM_IOCTL_AGP_ENABLE32, compat_drm_agp_enable, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_AGP_INFO32, compat_drm_agp_info, DRM_AUTH), + DRM_IOCTL_DEF(DRM_IOCTL_AGP_ALLOC32, compat_drm_agp_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_AGP_FREE32, compat_drm_agp_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_AGP_BIND32, compat_drm_agp_bind, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_AGP_UNBIND32, compat_drm_agp_unbind, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + + DRM_IOCTL_DEF(DRM_IOCTL_SG_ALLOC32, compat_drm_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_SG_FREE32, compat_drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + + DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW32, compat_drm_update_draw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + + DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK32, compat_drm_wait_vblank, DRM_UNLOCKED), +}; + +#endif Modified: stable/9/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_dma.c Sat Sep 1 03:46:28 2012 (r239964) +++ stable/9/sys/dev/drm2/i915/i915_dma.c Sat Sep 1 05:35:48 2012 (r239965) @@ -627,7 +627,7 @@ i915_flush_ioctl(struct drm_device *dev, return (ret); } -static int i915_batchbuffer(struct drm_device *dev, void *data, +int i915_batchbuffer(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -676,7 +676,7 @@ fail_free: return ret; } -static int i915_cmdbuffer(struct drm_device *dev, void *data, +int i915_cmdbuffer(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -747,7 +747,7 @@ static int i915_flip_bufs(struct drm_dev return ret; } -static int i915_getparam(struct drm_device *dev, void *data, +int i915_getparam(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_i915_private_t *dev_priv = dev->dev_private; @@ -1493,6 +1493,11 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_GET_SPRITE_COLORKEY, intel_sprite_get_colorkey, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), }; +#ifdef COMPAT_FREEBSD32 +extern drm_ioctl_desc_t i915_compat_ioctls[]; +extern int i915_compat_ioctls_nr; +#endif + struct drm_driver_info i915_driver_info = { .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_IRQ | DRIVER_LOCKLESS_IRQ | @@ -1516,6 +1521,10 @@ struct drm_driver_info i915_driver_info .sysctl_cleanup = i915_sysctl_cleanup, .ioctls = i915_ioctls, +#ifdef COMPAT_FREEBSD32 + .compat_ioctls = i915_compat_ioctls, + .compat_ioctls_nr = &i915_compat_ioctls_nr, +#endif .max_ioctl = DRM_ARRAY_SIZE(i915_ioctls), .name = DRIVER_NAME, Modified: stable/9/sys/dev/drm2/i915/i915_drv.h ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_drv.h Sat Sep 1 03:46:28 2012 (r239964) +++ stable/9/sys/dev/drm2/i915/i915_drv.h Sat Sep 1 05:35:48 2012 (r239965) @@ -1034,6 +1034,12 @@ int i915_sysctl_init(struct drm_device * void i915_sysctl_cleanup(struct drm_device *dev); /* i915_dma.c */ +int i915_batchbuffer(struct drm_device *dev, void *data, + struct drm_file *file_priv); +int i915_cmdbuffer(struct drm_device *dev, void *data, + struct drm_file *file_priv); +int i915_getparam(struct drm_device *dev, void *data, + struct drm_file *file_priv); extern void i915_kernel_lost_context(struct drm_device * dev); extern int i915_driver_load(struct drm_device *, unsigned long flags); extern int i915_driver_unload(struct drm_device *); Copied: stable/9/sys/dev/drm2/i915/i915_ioc32.c (from r239375, head/sys/dev/drm2/i915/i915_ioc32.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/drm2/i915/i915_ioc32.c Sat Sep 1 05:35:48 2012 (r239965, copy of r239375, head/sys/dev/drm2/i915/i915_ioc32.c) @@ -0,0 +1,138 @@ +/*- + * Copyright (C) Paul Mackerras 2005 + * Copyright (C) Alan Hourihane 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Paul Mackerras + * Alan Hourihane + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#ifdef COMPAT_FREEBSD32 + +/** @file i915_ioc32.c + * 32-bit ioctl compatibility routines for the i915 DRM. + */ + +#include +#include +#include +#include +#include + +typedef struct _drm_i915_batchbuffer32 { + int start; /* agp offset */ + int used; /* nr bytes in use */ + int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */ + int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */ + int num_cliprects; /* mulitpass with multiple cliprects? */ + u32 cliprects; /* pointer to userspace cliprects */ +} drm_i915_batchbuffer32_t; + +static int compat_i915_batchbuffer(struct drm_device *dev, void *data, struct drm_file *file_priv) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 05:43:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1324A10656D4; Sat, 1 Sep 2012 05:43:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D916C8FC0C; Sat, 1 Sep 2012 05:43:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q815hUAt056696; Sat, 1 Sep 2012 05:43:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q815hUB0056694; Sat, 1 Sep 2012 05:43:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209010543.q815hUB0056694@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Sep 2012 05:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239966 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 05:43:31 -0000 Author: adrian Date: Sat Sep 1 05:43:30 2012 New Revision: 239966 URL: http://svn.freebsd.org/changeset/base/239966 Log: Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops up on (at least) the AR5413. The 30 second summary - if a CRC error frame comes in during PHY error processing, that CRC bit will be set for all subsequent frames until a non-CRC error frame is processed. So to allow for accurate PHY error processing (Radar, and ANI on the AR5212 HAL chips) just tag the frame as being both CRC and PHY - let the driver decide what to do with it. PR: kern/169362 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Sat Sep 1 05:35:48 2012 (r239965) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Sat Sep 1 05:43:30 2012 (r239966) @@ -276,6 +276,14 @@ ar5212ProcRxDesc(struct ath_hal *ah, str rs->rs_antenna = MS(ads->ds_rxstatus0, AR_RcvAntenna); rs->rs_more = (ads->ds_rxstatus0 & AR_More) ? 1 : 0; + /* + * The AR5413 (at least) sometimes sets both AR_CRCErr and + * AR_PHYErr when reporting radar pulses. In this instance + * set HAL_RXERR_PHY as well as HAL_RXERR_CRC and + * let the driver layer figure out what to do. + * + * See PR kern/169362. + */ if ((ads->ds_rxstatus1 & AR_FrmRcvOK) == 0) { /* * These four bits should not be set together. The @@ -286,9 +294,7 @@ ar5212ProcRxDesc(struct ath_hal *ah, str * Consequently we filter them out here so we don't * confuse and/or complicate drivers. */ - if (ads->ds_rxstatus1 & AR_CRCErr) - rs->rs_status |= HAL_RXERR_CRC; - else if (ads->ds_rxstatus1 & AR_PHYErr) { + if (ads->ds_rxstatus1 & AR_PHYErr) { u_int phyerr; rs->rs_status |= HAL_RXERR_PHY; @@ -297,7 +303,11 @@ ar5212ProcRxDesc(struct ath_hal *ah, str if (!AH5212(ah)->ah_hasHwPhyCounters && phyerr != HAL_PHYERR_RADAR) ar5212AniPhyErrReport(ah, rs); - } else if (ads->ds_rxstatus1 & AR_DecryptCRCErr) + } + + if (ads->ds_rxstatus1 & AR_CRCErr) + rs->rs_status |= HAL_RXERR_CRC; + else if (ads->ds_rxstatus1 & AR_DecryptCRCErr) rs->rs_status |= HAL_RXERR_DECRYPT; else if (ads->ds_rxstatus1 & AR_MichaelErr) rs->rs_status |= HAL_RXERR_MIC; From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 06:07:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5991510657CE; Sat, 1 Sep 2012 06:07:28 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44F7D8FC1A; Sat, 1 Sep 2012 06:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8167SJ3059432; Sat, 1 Sep 2012 06:07:28 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8167S8h059430; Sat, 1 Sep 2012 06:07:28 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010607.q8167S8h059430@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 06:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239967 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 06:07:28 -0000 Author: joel (doc committer) Date: Sat Sep 1 06:07:27 2012 New Revision: 239967 URL: http://svn.freebsd.org/changeset/base/239967 Log: Mdoc fixes. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 05:43:30 2012 (r239966) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 06:07:27 2012 (r239967) @@ -56,8 +56,8 @@ .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Nm .Cm snapshot @@ -1496,8 +1496,8 @@ behavior for mounted file systems in use .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Xc .Pp @@ -2472,10 +2472,10 @@ subcommand or change a property. The following permissions are available: .Bl -column -offset 4n "secondarycache" "subcommand" .It NAME Ta TYPE Ta NOTES -.It Xo allow Ta subcommand Ta Must +.It allow Ta subcommand Ta Must Xo also have the permission that is being allowed .Xc -.It Xo clone Ta subcommand Ta Must +.It clone Ta subcommand Ta Must Xo also have the 'create' ability and 'mount' ability in the origin file system .Xc .It create Ta subcommand Ta Must also have the 'mount' ability @@ -2484,14 +2484,14 @@ also have the 'create' ability and 'moun object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets -.It Xo promote Ta subcommand Ta Must +.It promote Ta subcommand Ta Must Xo also have the 'mount' and 'promote' ability in the origin file system .Xc .It receive Ta subcommand Ta Must also have the 'mount' and 'create' ability -.It Xo release Ta subcommand Ta Allows +.It release Ta subcommand Ta Allows Xo releasing a user hold which might destroy the snapshot .Xc -.It Xo rename Ta subcommand Ta Must +.It rename Ta subcommand Ta Must Xo also have the 'mount' and 'create' ability in the new parent .Xc .It rollback Ta subcommand Ta Must also have the 'mount' ability @@ -2507,7 +2507,6 @@ protocol .It userprop Ta other Ta Allows changing any user property .It userquota Ta other Ta Allows accessing any userquota@... property .It userused Ta other Ta Allows reading any userused@... property -.It Ta .It aclinherit Ta property .It aclmode Ta property .It atime Ta property @@ -2705,7 +2704,6 @@ Display an indication of the type of fil .Fl F option of .Xr ls 1 . -.Pp .Bl -column -offset 2n indent .It \&B Ta block device .It \&C Ta character device @@ -2757,6 +2755,16 @@ Detaches the specified from the jail identified by JID .Ar jailid . .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a Tn ZFS No File System Hierarchy @@ -3179,7 +3187,6 @@ The following example shows how to see w snapshot of a ZFS Dataset and its current state. The .Fl F option is used to indicate type information for the files affected. -.Pp .Bd -literal -offset 2n .Li # Ic zfs diff tank/test@before tank/test M / /tank/test/ @@ -3190,16 +3197,6 @@ R F /tank/test/oldname -> /t M F /tank/test/modified .Ed .El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. -.El .Sh SEE ALSO .Xr chmod 2 , .Xr fsync 2 , From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 06:12:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D22E1065AFD; Sat, 1 Sep 2012 06:12:15 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718428FC19; Sat, 1 Sep 2012 06:12:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q816CFss060041; Sat, 1 Sep 2012 06:12:15 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q816CFBC060037; Sat, 1 Sep 2012 06:12:15 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010612.q816CFBC060037@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 06:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239968 - in head/cddl/contrib/opensolaris/cmd: zdb zfs zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 06:12:15 -0000 Author: joel (doc committer) Date: Sat Sep 1 06:12:14 2012 New Revision: 239968 URL: http://svn.freebsd.org/changeset/base/239968 Log: Remove trailing whitespace. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Sep 1 06:07:27 2012 (r239967) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Sep 1 06:12:14 2012 (r239968) @@ -135,7 +135,7 @@ option is also specified, also display t .It Fl L Disable leak tracing and the loading of space maps. By default, -.Nm +.Nm verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. @@ -272,7 +272,7 @@ Dataset rpool/export/home [ZPL], ID 137, .Li # Ic zdb -S rpool Simulated DDT histogram: -bucket allocated referenced +bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 06:07:27 2012 (r239967) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 06:12:14 2012 (r239968) @@ -624,7 +624,7 @@ privilege with .Qq Nm Cm allow , can access everyone's usage. .Pp -The +The .Sy userused@ Ns ... properties are not displayed by .Qq Nm Cm get all . @@ -1134,7 +1134,7 @@ will not use configured pool log devices will instead optimize synchronous operations for global pool throughput and efficient use of resources. .It Sy snapdir Ns = Ns Cm hidden | visible -Controls whether the +Controls whether the .Pa \&.zfs directory is hidden or visible in the root of the file system as discussed in the @@ -1201,7 +1201,7 @@ are not reflected in the reservation. The .Sy vscan property is currently not supported on -.Fx . +.Fx . .It Sy xattr Ns = Ns Cm off | on The .Sy xattr @@ -1288,7 +1288,7 @@ properties. The correlation between prop In addition, these options can be set on a per-mount basis using the .Fl o option, without affecting the property that is stored on disk. The values -specified on the command line override the values stored in the dataset. These +specified on the command line override the values stored in the dataset. These properties are reported as "temporary" by the .Qq Nm Cm get command. If the properties are changed while the dataset is mounted, the new @@ -1327,7 +1327,7 @@ domain name for the .Ar module component of property names to reduce the chance that two independently-developed packages use the same property name for different -purposes. Property names beginning with +purposes. Property names beginning with .Em com.sun are reserved for use by Sun Microsystems. .Pp @@ -2216,7 +2216,7 @@ and it is assumed to be from the same fi .Ar snapshot . .Pp If the destination is a clone, the source may be the origin snapshot, which -must be fully specified (for example, +must be fully specified (for example, .Cm pool/fs@origin , not just .Cm @origin ) . @@ -2830,7 +2830,7 @@ Snapshots are displayed if the .Sy listsnaps property is .Cm on . -The default is +The default is .Cm off . See .Xr zpool 8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 1 06:07:27 2012 (r239967) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 1 06:12:14 2012 (r239968) @@ -731,7 +731,7 @@ The current on-disk version of the pool. decreased. The preferred method of updating pools is with the .Qq Nm Cm upgrade command, though this property can be used when a specific version is needed -for backwards compatibility. +for backwards compatibility. Once feature flags is enabled on a pool this property will no longer have a value. .El From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 06:23:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D904A106566B; Sat, 1 Sep 2012 06:23:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38378FC1B; Sat, 1 Sep 2012 06:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q816NDS4061357; Sat, 1 Sep 2012 06:23:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q816NDn3061353; Sat, 1 Sep 2012 06:23:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010623.q816NDn3061353@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 06:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239969 - in head/cddl: usr.bin/ctfconvert usr.bin/ctfmerge usr.sbin/dtruss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 06:23:14 -0000 Author: joel (doc committer) Date: Sat Sep 1 06:23:13 2012 New Revision: 239969 URL: http://svn.freebsd.org/changeset/base/239969 Log: Remove trailing whitespace. Modified: head/cddl/usr.bin/ctfconvert/ctfconvert.1 head/cddl/usr.bin/ctfmerge/ctfmerge.1 head/cddl/usr.sbin/dtruss/dtruss.1 Modified: head/cddl/usr.bin/ctfconvert/ctfconvert.1 ============================================================================== --- head/cddl/usr.bin/ctfconvert/ctfconvert.1 Sat Sep 1 06:12:14 2012 (r239968) +++ head/cddl/usr.bin/ctfconvert/ctfconvert.1 Sat Sep 1 06:23:13 2012 (r239969) @@ -74,7 +74,7 @@ Write the output to file in .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr ctfmerge 1 , +.Xr ctfmerge 1 , .Xr ctfdump 1 .Sh HISTORY The Modified: head/cddl/usr.bin/ctfmerge/ctfmerge.1 ============================================================================== --- head/cddl/usr.bin/ctfmerge/ctfmerge.1 Sat Sep 1 06:12:14 2012 (r239968) +++ head/cddl/usr.bin/ctfmerge/ctfmerge.1 Sat Sep 1 06:23:13 2012 (r239969) @@ -32,7 +32,7 @@ .Dt CTFMERGE 1 .Os .Sh NAME -.Nm ctfmerge +.Nm ctfmerge .Nd merge several CTF data sections into one .Sh SYNOPSIS .Nm @@ -109,7 +109,7 @@ into .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr ctfconvert 1 , +.Xr ctfconvert 1 , .Xr ctfdump 1 .Sh HISTORY The Modified: head/cddl/usr.sbin/dtruss/dtruss.1 ============================================================================== --- head/cddl/usr.sbin/dtruss/dtruss.1 Sat Sep 1 06:12:14 2012 (r239968) +++ head/cddl/usr.sbin/dtruss/dtruss.1 Sat Sep 1 06:23:13 2012 (r239969) @@ -32,7 +32,7 @@ .Dt DTRUSS 1 .Os .Sh NAME -.Nm dtruss +.Nm dtruss .Nd Trace system calls and userland stacks using DTrace .Sh SYNOPSIS .Nm @@ -79,7 +79,7 @@ Specify the DTrace buffer size. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr dtrace 1 +.Xr dtrace 1 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 07:11:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DA621065673; Sat, 1 Sep 2012 07:11:26 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 593CA8FC0C; Sat, 1 Sep 2012 07:11:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q817BQWC066940; Sat, 1 Sep 2012 07:11:26 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q817BQll066938; Sat, 1 Sep 2012 07:11:26 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010711.q817BQll066938@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 07:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239970 - head/tools/tools/ath/athrd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 07:11:26 -0000 Author: joel (doc committer) Date: Sat Sep 1 07:11:25 2012 New Revision: 239970 URL: http://svn.freebsd.org/changeset/base/239970 Log: Minor mdoc fix. Modified: head/tools/tools/ath/athrd/athrd.1 Modified: head/tools/tools/ath/athrd/athrd.1 ============================================================================== --- head/tools/tools/ath/athrd/athrd.1 Sat Sep 1 06:23:13 2012 (r239969) +++ head/tools/tools/ath/athrd/athrd.1 Sat Sep 1 07:11:25 2012 (r239970) @@ -103,14 +103,12 @@ Display only Turbo channels. .Sh EXAMPLES The following demonstrates how to list the permissible frequencies and maximum transport power per channel for use in Spain: -.Pp -.nf -tubby% athrd es -\& +.Bd -literal -offset 2n +.Li # Ic athrd es SPAIN (ES, 0x2d4, 724) NULL1_WORLD (0x3, 3) 2412G 14.0 2417G 14.0 2422G 14.0 2427G 17.0 2432G 14.0 2437G 17.0 2442G 14.0 2447G 17.0 2452G 17.0 2457G 14.0 2462G 17.0 -.fi +.Ed .Pp Each frequency has a suffix that is one of: .Ql G , From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 07:35:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68F7D106566B; Sat, 1 Sep 2012 07:35:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 540E18FC0A; Sat, 1 Sep 2012 07:35:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q817ZHpQ069651; Sat, 1 Sep 2012 07:35:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q817ZHmH069647; Sat, 1 Sep 2012 07:35:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209010735.q817ZHmH069647@svn.freebsd.org> From: Rui Paulo Date: Sat, 1 Sep 2012 07:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239971 - head/sys/modules/dtrace/dtraceall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 07:35:17 -0000 Author: rpaulo Date: Sat Sep 1 07:35:16 2012 New Revision: 239971 URL: http://svn.freebsd.org/changeset/base/239971 Log: The dtnfsclient module dependency should only be added if the old NFS client support was compiled in. Modified: head/sys/modules/dtrace/dtraceall/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/modules/dtrace/dtraceall/Makefile ============================================================================== --- head/sys/modules/dtrace/dtraceall/Makefile Sat Sep 1 07:11:25 2012 (r239970) +++ head/sys/modules/dtrace/dtraceall/Makefile Sat Sep 1 07:35:16 2012 (r239971) @@ -1,7 +1,7 @@ # $FreeBSD$ KMOD= dtraceall -SRCS= dtraceall.c opt_compat.h +SRCS= dtraceall.c opt_compat.h opt_nfs.h CFLAGS+= -I${.CURDIR}/../../.. Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Sat Sep 1 07:11:25 2012 (r239970) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Sat Sep 1 07:35:16 2012 (r239971) @@ -33,6 +33,7 @@ #include #include #include "opt_compat.h" +#include "opt_nfs.h" static int dtraceall_modevent(module_t mod __unused, int type, void *data __unused) @@ -68,7 +69,9 @@ MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1 MODULE_DEPEND(dtraceall, dtio, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); +#if defined(NFSCLIENT) MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); +#endif #if defined(__amd64__) || defined(__i386__) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 08:14:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA18B106564A; Sat, 1 Sep 2012 08:14:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9DAE8FC0C; Sat, 1 Sep 2012 08:14:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q818EL5L074162; Sat, 1 Sep 2012 08:14:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q818ELEH074159; Sat, 1 Sep 2012 08:14:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209010814.q818ELEH074159@svn.freebsd.org> From: Rui Paulo Date: Sat, 1 Sep 2012 08:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239972 - in head/cddl: contrib/dtracetoolkit lib/libdtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 08:14:21 -0000 Author: rpaulo Date: Sat Sep 1 08:14:21 2012 New Revision: 239972 URL: http://svn.freebsd.org/changeset/base/239972 Log: Finish porting execsnoop to FreeBSD. This includes replacing the zonename with a jail ID and removing the project ID from the list of options. Modified: head/cddl/contrib/dtracetoolkit/execsnoop head/cddl/lib/libdtrace/psinfo.d Modified: head/cddl/contrib/dtracetoolkit/execsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/execsnoop Sat Sep 1 07:35:16 2012 (r239971) +++ head/cddl/contrib/dtracetoolkit/execsnoop Sat Sep 1 08:14:21 2012 (r239972) @@ -5,21 +5,20 @@ # # $Id: execsnoop 3 2007-08-01 10:50:08Z brendan $ # -# USAGE: execsnoop [-a|-A|-ehjsvZ] [-c command] +# USAGE: execsnoop [-a|-A|-ehsvJ] [-c command] # # execsnoop # default output # # -a # print all data # -A # dump all data, space delimited # -e # safe output - parseable -# -j # print project ID # -s # print start time, us # -v # print start time, string -# -Z # print zonename +# -J # print jail ID # -c command # command name to snoop # eg, # execsnoop -v # human readable timestamps -# execsnoop -Z # print zonename +# execsnoop -J # print jail ID # execsnoop -c ls # snoop ls commands only # # The parseable output ensures that the ARGS field doesn't contain @@ -31,8 +30,7 @@ # PPID Parent Process ID # COMM command name for the process # ARGS argument listing for the process -# ZONE zonename -# PROJ project ID +# JAIL ID Jail ID # TIME timestamp for the command, us # STRTIME timestamp for the command, string # @@ -72,34 +70,32 @@ ### default variables opt_dump=0; opt_cmd=0; opt_time=0; opt_timestr=0; filter=0; command=. -opt_zone=0; opt_safe=0; opt_proj=0 +opt_jailid=0; opt_safe=0 ### process options -while getopts aAc:ehjsvZ name +while getopts aAc:ehsvJ name do case $name in - a) opt_time=1; opt_timestr=1; opt_zone=1; opt_proj=1 ;; + a) opt_time=1; opt_timestr=1; opt_jailid=1 ;; A) opt_dump=1 ;; c) opt_cmd=1; command=$OPTARG ;; e) opt_safe=1 ;; - j) opt_proj=1 ;; s) opt_time=1 ;; v) opt_timestr=1 ;; - Z) opt_zone=1 ;; + J) opt_jailid=1 ;; h|?) cat <<-END >&2 - USAGE: execsnoop [-a|-A|-ehjsvZ] [-c command] + USAGE: execsnoop [-a|-A|-ehjsvJ] [-c command] execsnoop # default output -a # print all data -A # dump all data, space delimited -e # safe output, parseable - -j # print project ID -s # print start time, us -v # print start time, string - -Z # print zonename + -J # print jail ID -c command # command name to snoop eg, execsnoop -v # human readable timestamps - execsnoop -Z # print zonename + execsnoop -J # print jail ID execsnoop -c ls # snoop ls commands only END exit 1 @@ -108,7 +104,7 @@ done ### option logic if [ $opt_dump -eq 1 ]; then - opt_time=0; opt_timestr=0; opt_zone=0; opt_proj=0 + opt_time=0; opt_timestr=0; opt_jailid=0 fi if [ $opt_cmd -eq 1 ]; then filter=1 @@ -126,9 +122,8 @@ fi inline int OPT_cmd = '$opt_cmd'; inline int OPT_time = '$opt_time'; inline int OPT_timestr = '$opt_timestr'; - inline int OPT_zone = '$opt_zone'; + inline int OPT_jailid = '$opt_jailid'; inline int OPT_safe = '$opt_safe'; - inline int OPT_proj = '$opt_proj'; inline int FILTER = '$filter'; inline string COMMAND = "'$command'"; @@ -143,12 +138,11 @@ fi /* print optional headers */ OPT_time ? printf("%-14s ", "TIME") : 1; OPT_timestr ? printf("%-20s ", "STRTIME") : 1; - OPT_zone ? printf("%-10s ", "ZONE") : 1; - OPT_proj ? printf("%5s ", "PROJ") : 1; + OPT_jailid ? printf("%-10s ", "JAIL ID") : 1; /* print main headers */ - OPT_dump ? printf("%s %s %s %s %s %s %s %s\n", - "TIME", "ZONE", "PROJ", "UID", "PID", "PPID", "COMM", "ARGS") : + OPT_dump ? printf("%s %s %s %s %s %s %s\n", + "TIME", "JAIL ID", "UID", "PID", "PPID", "COMM", "ARGS") : printf("%5s %6s %6s %s\n", "UID", "PID", "PPID", "ARGS"); } @@ -161,12 +155,11 @@ fi /* print optional fields */ OPT_time ? printf("%-14d ", timestamp/1000) : 1; OPT_timestr ? printf("%-20Y ", walltimestamp) : 1; - OPT_zone ? printf("%-10s ", zonename) : 1; - OPT_proj ? printf("%5d ", curpsinfo->pr_projid) : 1; + OPT_jailid ? printf("%-10d ", curpsinfo->pr_jailid) : 1; /* print main data */ - OPT_dump ? printf("%d %s %d %d %d %d %s ", timestamp/1000, - zonename, curpsinfo->pr_projid, uid, pid, ppid, execname) : + OPT_dump ? printf("%d %d %d %d %d %s ", timestamp/1000, + curpsinfo->pr_jailid, uid, pid, ppid, execname) : printf("%5d %6d %6d ", uid, pid, ppid); OPT_safe ? printf("%S\n", curpsinfo->pr_psargs) : printf("%s\n", curpsinfo->pr_psargs); Modified: head/cddl/lib/libdtrace/psinfo.d ============================================================================== --- head/cddl/lib/libdtrace/psinfo.d Sat Sep 1 07:35:16 2012 (r239971) +++ head/cddl/lib/libdtrace/psinfo.d Sat Sep 1 08:14:21 2012 (r239972) @@ -42,6 +42,7 @@ typedef struct psinfo { pr_addr; /* address of process */ string pr_psargs; /* process arguments */ u_int pr_arglen; /* process argument length */ + u_int pr_jailid; /* jail id */ } psinfo_t; #pragma D binding "1.0" translator @@ -58,6 +59,7 @@ translator psinfo_t < struct proc *T > { pr_addr = 0; pr_psargs = stringof(T->p_args->ar_args); pr_arglen = T->p_args->ar_length; + pr_jailid = T->p_ucred->cr_prison->pr_id; }; typedef struct lwpsinfo { From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 08:45:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D394106566B; Sat, 1 Sep 2012 08:45:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098308FC18; Sat, 1 Sep 2012 08:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q818jJIR077830; Sat, 1 Sep 2012 08:45:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q818jJAc077828; Sat, 1 Sep 2012 08:45:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209010845.q818jJAc077828@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 08:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239973 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 08:45:20 -0000 Author: ed Date: Sat Sep 1 08:45:19 2012 New Revision: 239973 URL: http://svn.freebsd.org/changeset/base/239973 Log: Fix whitespace. MFC after: 1 month Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Sep 1 08:14:21 2012 (r239972) +++ head/sys/sys/time.h Sat Sep 1 08:45:19 2012 (r239973) @@ -31,7 +31,7 @@ */ #ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ +#define _SYS_TIME_H_ #include #include @@ -137,7 +137,7 @@ timespec2bintime(const struct timespec * bt->sec = ts->tv_sec; /* 18446744073 = int(2^64 / 1000000000) */ - bt->frac = ts->tv_nsec * (uint64_t)18446744073LL; + bt->frac = ts->tv_nsec * (uint64_t)18446744073LL; } static __inline void @@ -167,7 +167,7 @@ timeval2bintime(const struct timeval *tv (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) -#define timespecadd(vvp, uvp) \ +#define timespecadd(vvp, uvp) \ do { \ (vvp)->tv_sec += (uvp)->tv_sec; \ (vvp)->tv_nsec += (uvp)->tv_nsec; \ @@ -176,7 +176,7 @@ timeval2bintime(const struct timeval *tv (vvp)->tv_nsec -= 1000000000; \ } \ } while (0) -#define timespecsub(vvp, uvp) \ +#define timespecsub(vvp, uvp) \ do { \ (vvp)->tv_sec -= (uvp)->tv_sec; \ (vvp)->tv_nsec -= (uvp)->tv_nsec; \ @@ -207,7 +207,7 @@ timeval2bintime(const struct timeval *tv (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) -#define timeradd(tvp, uvp, vvp) \ +#define timeradd(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ @@ -216,7 +216,7 @@ timeval2bintime(const struct timeval *tv (vvp)->tv_usec -= 1000000; \ } \ } while (0) -#define timersub(tvp, uvp, vvp) \ +#define timersub(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ @@ -253,25 +253,25 @@ struct clockinfo { /* These macros are also in time.h. */ #ifndef CLOCK_REALTIME -#define CLOCK_REALTIME 0 -#define CLOCK_VIRTUAL 1 -#define CLOCK_PROF 2 -#define CLOCK_MONOTONIC 4 -#define CLOCK_UPTIME 5 /* FreeBSD-specific. */ -#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ -#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ -#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ -#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ -#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ -#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ -#define CLOCK_SECOND 13 /* FreeBSD-specific. */ -#define CLOCK_THREAD_CPUTIME_ID 14 -#define CLOCK_PROCESS_CPUTIME_ID 15 +#define CLOCK_REALTIME 0 +#define CLOCK_VIRTUAL 1 +#define CLOCK_PROF 2 +#define CLOCK_MONOTONIC 4 +#define CLOCK_UPTIME 5 /* FreeBSD-specific. */ +#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ +#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ +#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ +#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ +#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ +#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ +#define CLOCK_SECOND 13 /* FreeBSD-specific. */ +#define CLOCK_THREAD_CPUTIME_ID 14 +#define CLOCK_PROCESS_CPUTIME_ID 15 #endif #ifndef TIMER_ABSTIME -#define TIMER_RELTIME 0x0 /* relative timer */ -#define TIMER_ABSTIME 0x1 /* absolute timer */ +#define TIMER_RELTIME 0x0 /* relative timer */ +#define TIMER_ABSTIME 0x1 /* absolute timer */ #endif #if __BSD_VISIBLE @@ -301,7 +301,7 @@ extern struct timeval boottime; * "bin" == struct bintime == seconds + 64 bit fraction of seconds. * "nano" == struct timespec == seconds + nanoseconds. * "micro" == struct timeval == seconds + microseconds. - * + * * Functions containing "up" returns time relative to boot and * should be used for calculating time intervals. * @@ -310,8 +310,8 @@ extern struct timeval boottime; * Functions with the "get" prefix returns a less precise result * much faster than the functions without "get" prefix and should * be used where a precision of 1/hz seconds is acceptable or where - * performance is priority. (NB: "precision", _not_ "resolution" !) - * + * performance is priority. (NB: "precision", _not_ "resolution" !) + * */ void binuptime(struct bintime *bt); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 08:45:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 622AF106566B; Sat, 1 Sep 2012 08:45:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E0368FC08; Sat, 1 Sep 2012 08:45:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q818jxv5077940; Sat, 1 Sep 2012 08:45:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q818jxxc077938; Sat, 1 Sep 2012 08:45:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209010845.q818jxxc077938@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 08:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239974 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 08:45:59 -0000 Author: ed Date: Sat Sep 1 08:45:58 2012 New Revision: 239974 URL: http://svn.freebsd.org/changeset/base/239974 Log: While there, remove an unneeded blank line. MFC after: 1 month Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Sep 1 08:45:19 2012 (r239973) +++ head/sys/sys/time.h Sat Sep 1 08:45:58 2012 (r239974) @@ -311,7 +311,6 @@ extern struct timeval boottime; * much faster than the functions without "get" prefix and should * be used where a precision of 1/hz seconds is acceptable or where * performance is priority. (NB: "precision", _not_ "resolution" !) - * */ void binuptime(struct bintime *bt); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 09:55:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EDFC106566C; Sat, 1 Sep 2012 09:55:36 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33F4E8FC08; Sat, 1 Sep 2012 09:55:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q819taFV086804; Sat, 1 Sep 2012 09:55:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q819tZHq086802; Sat, 1 Sep 2012 09:55:35 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209010955.q819tZHq086802@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 09:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239975 - stable/9/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 09:55:36 -0000 Author: trociny Date: Sat Sep 1 09:55:35 2012 New Revision: 239975 URL: http://svn.freebsd.org/changeset/base/239975 Log: MFC r238086: Fix style. Modified: stable/9/usr.bin/procstat/procstat_rlimit.c Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_rlimit.c Sat Sep 1 08:45:58 2012 (r239974) +++ stable/9/usr.bin/procstat/procstat_rlimit.c Sat Sep 1 09:55:35 2012 (r239975) @@ -66,8 +66,8 @@ static struct { #error "Resource limits have grown. Add new entries to rlimit_param[]." #endif -static -const char *humanize_rlimit(int indx, rlim_t limit) +static const char * +humanize_rlimit(int indx, rlim_t limit) { static char buf[14]; int scale; From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 09:58:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E04341065670; Sat, 1 Sep 2012 09:58:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB24D8FC16; Sat, 1 Sep 2012 09:58:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q819w9SZ087148; Sat, 1 Sep 2012 09:58:09 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q819w9CO087145; Sat, 1 Sep 2012 09:58:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209010958.q819w9CO087145@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 09:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239976 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 09:58:10 -0000 Author: trociny Date: Sat Sep 1 09:58:09 2012 New Revision: 239976 URL: http://svn.freebsd.org/changeset/base/239976 Log: MFC r238084: Don't check for ifp != NULL before KASSERT, as ifp may not be NULL here (it is dereferenced below). Discussed with: jhb Modified: stable/9/sys/netinet/igmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/igmp.c ============================================================================== --- stable/9/sys/netinet/igmp.c Sat Sep 1 09:55:35 2012 (r239975) +++ stable/9/sys/netinet/igmp.c Sat Sep 1 09:58:09 2012 (r239976) @@ -2284,13 +2284,11 @@ igmp_change_state(struct in_multi *inm) */ KASSERT(inm->inm_ifma != NULL, ("%s: no ifma", __func__)); ifp = inm->inm_ifma->ifma_ifp; - if (ifp != NULL) { - /* - * Sanity check that netinet's notion of ifp is the - * same as net's. - */ - KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); - } + /* + * Sanity check that netinet's notion of ifp is the + * same as net's. + */ + KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); IGMP_LOCK(); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:00:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A47F9106566B; Sat, 1 Sep 2012 10:00:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1048FC1A; Sat, 1 Sep 2012 10:00:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81A0bAn087504; Sat, 1 Sep 2012 10:00:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81A0b1x087502; Sat, 1 Sep 2012 10:00:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011000.q81A0b1x087502@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239977 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:00:37 -0000 Author: trociny Date: Sat Sep 1 10:00:37 2012 New Revision: 239977 URL: http://svn.freebsd.org/changeset/base/239977 Log: MFC r238084: Don't check for ifp != NULL before KASSERT, as ifp may not be NULL here (it is dereferenced below). Discussed with: jhb Modified: stable/8/sys/netinet/igmp.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/igmp.c ============================================================================== --- stable/8/sys/netinet/igmp.c Sat Sep 1 09:58:09 2012 (r239976) +++ stable/8/sys/netinet/igmp.c Sat Sep 1 10:00:37 2012 (r239977) @@ -2284,13 +2284,11 @@ igmp_change_state(struct in_multi *inm) */ KASSERT(inm->inm_ifma != NULL, ("%s: no ifma", __func__)); ifp = inm->inm_ifma->ifma_ifp; - if (ifp != NULL) { - /* - * Sanity check that netinet's notion of ifp is the - * same as net's. - */ - KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); - } + /* + * Sanity check that netinet's notion of ifp is the + * same as net's. + */ + KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); IGMP_LOCK(); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:18:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3BAF1065673; Sat, 1 Sep 2012 10:18:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED898FC0C; Sat, 1 Sep 2012 10:18:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81AI92v092229; Sat, 1 Sep 2012 10:18:09 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AI9Y5092227; Sat, 1 Sep 2012 10:18:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011018.q81AI9Y5092227@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239978 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:18:09 -0000 Author: trociny Date: Sat Sep 1 10:18:09 2012 New Revision: 239978 URL: http://svn.freebsd.org/changeset/base/239978 Log: MFC r238085: Fix KASSERT message. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Sat Sep 1 10:00:37 2012 (r239977) +++ stable/9/sys/kern/uipc_socket.c Sat Sep 1 10:18:09 2012 (r239978) @@ -635,7 +635,7 @@ sofree(struct socket *so) so->so_qstate & SQ_COMP, so->so_qstate & SQ_INCOMP)); if (so->so_options & SO_ACCEPTCONN) { KASSERT((TAILQ_EMPTY(&so->so_comp)), ("sofree: so_comp populated")); - KASSERT((TAILQ_EMPTY(&so->so_incomp)), ("sofree: so_comp populated")); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), ("sofree: so_incomp populated")); } SOCK_UNLOCK(so); ACCEPT_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:21:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1AB11065673; Sat, 1 Sep 2012 10:21:56 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCDE88FC17; Sat, 1 Sep 2012 10:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81ALuRC092703; Sat, 1 Sep 2012 10:21:56 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81ALu4D092701; Sat, 1 Sep 2012 10:21:56 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011021.q81ALu4D092701@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239979 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:21:57 -0000 Author: trociny Date: Sat Sep 1 10:21:56 2012 New Revision: 239979 URL: http://svn.freebsd.org/changeset/base/239979 Log: MFC r238085: Fix KASSERT message. Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Sat Sep 1 10:18:09 2012 (r239978) +++ stable/8/sys/kern/uipc_socket.c Sat Sep 1 10:21:56 2012 (r239979) @@ -626,7 +626,7 @@ sofree(struct socket *so) so->so_qstate & SQ_COMP, so->so_qstate & SQ_INCOMP)); if (so->so_options & SO_ACCEPTCONN) { KASSERT((TAILQ_EMPTY(&so->so_comp)), ("sofree: so_comp populated")); - KASSERT((TAILQ_EMPTY(&so->so_incomp)), ("sofree: so_comp populated")); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), ("sofree: so_incomp populated")); } SOCK_UNLOCK(so); ACCEPT_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:27:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5A8D106566B; Sat, 1 Sep 2012 10:27:18 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B77938FC18; Sat, 1 Sep 2012 10:27:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81ARIMR093390; Sat, 1 Sep 2012 10:27:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81ARIHQ093388; Sat, 1 Sep 2012 10:27:18 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011027.q81ARIHQ093388@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239980 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:27:19 -0000 Author: trociny Date: Sat Sep 1 10:27:18 2012 New Revision: 239980 URL: http://svn.freebsd.org/changeset/base/239980 Log: MFC r238309: In epair_clone_destroy(), when destroying the second half, we have to switch to its vnet before calling ether_ifdetach(). Otherwise if the second half resides in a different vnet, if_detach() silently fails leaving a stale pointer in V_ifnet list, and the system crashes trying to access this pointer later. Another solution could be not to allow to destroy epair unless both ends are in the home vnet. Discussed with: bz Tested by: delphij Modified: stable/9/sys/net/if_epair.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_epair.c ============================================================================== --- stable/9/sys/net/if_epair.c Sat Sep 1 10:21:56 2012 (r239979) +++ stable/9/sys/net/if_epair.c Sat Sep 1 10:27:18 2012 (r239980) @@ -904,39 +904,41 @@ epair_clone_destroy(struct if_clone *ifc if_link_state_change(oifp, LINK_STATE_DOWN); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; oifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + /* + * Get rid of our second half. As the other of the two + * interfaces may reside in a different vnet, we need to + * switch before freeing them. + */ + CURVNET_SET_QUIET(oifp->if_vnet); ether_ifdetach(oifp); - ether_ifdetach(ifp); /* * Wait for all packets to be dispatched to if_input. - * The numbers can only go down as the interfaces are + * The numbers can only go down as the interface is * detached so there is no need to use atomics. */ - DPRINTF("sca refcnt=%u scb refcnt=%u\n", sca->refcount, scb->refcount); - EPAIR_REFCOUNT_ASSERT(sca->refcount == 1 && scb->refcount == 1, - ("%s: ifp=%p sca->refcount!=1: %d || ifp=%p scb->refcount!=1: %d", - __func__, ifp, sca->refcount, oifp, scb->refcount)); - - /* - * Get rid of our second half. - */ + DPRINTF("scb refcnt=%u\n", scb->refcount); + EPAIR_REFCOUNT_ASSERT(scb->refcount == 1, + ("%s: ifp=%p scb->refcount!=1: %d", __func__, oifp, scb->refcount)); oifp->if_softc = NULL; error = if_clone_destroyif(ifc, oifp); if (error) panic("%s: if_clone_destroyif() for our 2nd iface failed: %d", __func__, error); + if_free(oifp); + ifmedia_removeall(&scb->media); + free(scb, M_EPAIR); + CURVNET_RESTORE(); + ether_ifdetach(ifp); /* - * Finish cleaning up. Free them and release the unit. - * As the other of the two interfaces my reside in a different vnet, - * we need to switch before freeing them. + * Wait for all packets to be dispatched to if_input. */ - CURVNET_SET_QUIET(oifp->if_vnet); - if_free(oifp); - CURVNET_RESTORE(); + DPRINTF("sca refcnt=%u\n", sca->refcount); + EPAIR_REFCOUNT_ASSERT(sca->refcount == 1, + ("%s: ifp=%p sca->refcount!=1: %d", __func__, ifp, sca->refcount)); if_free(ifp); ifmedia_removeall(&sca->media); - ifmedia_removeall(&scb->media); - free(scb, M_EPAIR); free(sca, M_EPAIR); ifc_free_unit(ifc, unit); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:28:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5803C1065675; Sat, 1 Sep 2012 10:28:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2933B8FC1A; Sat, 1 Sep 2012 10:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81ASLlA093539; Sat, 1 Sep 2012 10:28:21 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81ASKIM093537; Sat, 1 Sep 2012 10:28:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011028.q81ASKIM093537@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239981 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:28:21 -0000 Author: trociny Date: Sat Sep 1 10:28:20 2012 New Revision: 239981 URL: http://svn.freebsd.org/changeset/base/239981 Log: MFC r238309: In epair_clone_destroy(), when destroying the second half, we have to switch to its vnet before calling ether_ifdetach(). Otherwise if the second half resides in a different vnet, if_detach() silently fails leaving a stale pointer in V_ifnet list, and the system crashes trying to access this pointer later. Another solution could be not to allow to destroy epair unless both ends are in the home vnet. Discussed with: bz Tested by: delphij Modified: stable/8/sys/net/if_epair.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/if_epair.c ============================================================================== --- stable/8/sys/net/if_epair.c Sat Sep 1 10:27:18 2012 (r239980) +++ stable/8/sys/net/if_epair.c Sat Sep 1 10:28:20 2012 (r239981) @@ -904,39 +904,41 @@ epair_clone_destroy(struct if_clone *ifc if_link_state_change(oifp, LINK_STATE_DOWN); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; oifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + /* + * Get rid of our second half. As the other of the two + * interfaces may reside in a different vnet, we need to + * switch before freeing them. + */ + CURVNET_SET_QUIET(oifp->if_vnet); ether_ifdetach(oifp); - ether_ifdetach(ifp); /* * Wait for all packets to be dispatched to if_input. - * The numbers can only go down as the interfaces are + * The numbers can only go down as the interface is * detached so there is no need to use atomics. */ - DPRINTF("sca refcnt=%u scb refcnt=%u\n", sca->refcount, scb->refcount); - EPAIR_REFCOUNT_ASSERT(sca->refcount == 1 && scb->refcount == 1, - ("%s: ifp=%p sca->refcount!=1: %d || ifp=%p scb->refcount!=1: %d", - __func__, ifp, sca->refcount, oifp, scb->refcount)); - - /* - * Get rid of our second half. - */ + DPRINTF("scb refcnt=%u\n", scb->refcount); + EPAIR_REFCOUNT_ASSERT(scb->refcount == 1, + ("%s: ifp=%p scb->refcount!=1: %d", __func__, oifp, scb->refcount)); oifp->if_softc = NULL; error = if_clone_destroyif(ifc, oifp); if (error) panic("%s: if_clone_destroyif() for our 2nd iface failed: %d", __func__, error); + if_free(oifp); + ifmedia_removeall(&scb->media); + free(scb, M_EPAIR); + CURVNET_RESTORE(); + ether_ifdetach(ifp); /* - * Finish cleaning up. Free them and release the unit. - * As the other of the two interfaces my reside in a different vnet, - * we need to switch before freeing them. + * Wait for all packets to be dispatched to if_input. */ - CURVNET_SET_QUIET(oifp->if_vnet); - if_free(oifp); - CURVNET_RESTORE(); + DPRINTF("sca refcnt=%u\n", sca->refcount); + EPAIR_REFCOUNT_ASSERT(sca->refcount == 1, + ("%s: ifp=%p sca->refcount!=1: %d", __func__, ifp, sca->refcount)); if_free(ifp); ifmedia_removeall(&sca->media); - ifmedia_removeall(&scb->media); - free(scb, M_EPAIR); free(sca, M_EPAIR); ifc_free_unit(ifc, unit); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:32:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFCB3106566C; Sat, 1 Sep 2012 10:32:40 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAA858FC15; Sat, 1 Sep 2012 10:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81AWefP094099; Sat, 1 Sep 2012 10:32:40 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AWead094097; Sat, 1 Sep 2012 10:32:40 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011032.q81AWead094097@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239982 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:32:41 -0000 Author: trociny Date: Sat Sep 1 10:32:40 2012 New Revision: 239982 URL: http://svn.freebsd.org/changeset/base/239982 Log: MFC r239075: In tcp timers, check INP_DROPPED flag a little later, after callout_deactivate(), so if INP_DROPPED is set we return with the timer active flag cleared. For me this fixes negative keep timer values reported by `netstat -x' for connections in CLOSE state. Modified: stable/9/sys/netinet/tcp_timer.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Sat Sep 1 10:28:20 2012 (r239981) +++ stable/9/sys/netinet/tcp_timer.c Sat Sep 1 10:32:40 2012 (r239982) @@ -183,13 +183,18 @@ tcp_timer_delack(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack) - || !callout_active(&tp->t_timers->tt_delack)) { + if (callout_pending(&tp->t_timers->tt_delack) || + !callout_active(&tp->t_timers->tt_delack)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_delack); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + CURVNET_RESTORE(); + return; + } tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); @@ -229,7 +234,7 @@ tcp_timer_2msl(void *xtp) } INP_WLOCK(inp); tcp_free_sackholes(tp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) || + if (callout_pending(&tp->t_timers->tt_2msl) || !callout_active(&tp->t_timers->tt_2msl)) { INP_WUNLOCK(tp->t_inpcb); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -237,6 +242,12 @@ tcp_timer_2msl(void *xtp) return; } callout_deactivate(&tp->t_timers->tt_2msl); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle @@ -300,14 +311,20 @@ tcp_timer_keep(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep) - || !callout_active(&tp->t_timers->tt_keep)) { + if (callout_pending(&tp->t_timers->tt_keep) || + !callout_active(&tp->t_timers->tt_keep)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_keep); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } /* * Keep-alive timer went off; send something * or drop connection if idle for too long. @@ -397,14 +414,20 @@ tcp_timer_persist(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist) - || !callout_active(&tp->t_timers->tt_persist)) { + if (callout_pending(&tp->t_timers->tt_persist) || + !callout_active(&tp->t_timers->tt_persist)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_persist); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } /* * Persistance timer into zero window. * Force a byte to be output, if possible. @@ -469,14 +492,20 @@ tcp_timer_rexmt(void * xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt) - || !callout_active(&tp->t_timers->tt_rexmt)) { + if (callout_pending(&tp->t_timers->tt_rexmt) || + !callout_active(&tp->t_timers->tt_rexmt)) { INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_rexmt); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } tcp_free_sackholes(tp); /* * Retransmission timer went off. Message has not From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:33:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ABEA106564A; Sat, 1 Sep 2012 10:33:54 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 852978FC16; Sat, 1 Sep 2012 10:33:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81AXsDA094286; Sat, 1 Sep 2012 10:33:54 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AXsGb094283; Sat, 1 Sep 2012 10:33:54 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011033.q81AXsGb094283@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239983 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:33:54 -0000 Author: trociny Date: Sat Sep 1 10:33:53 2012 New Revision: 239983 URL: http://svn.freebsd.org/changeset/base/239983 Log: MFC r239075: In tcp timers, check INP_DROPPED flag a little later, after callout_deactivate(), so if INP_DROPPED is set we return with the timer active flag cleared. For me this fixes negative keep timer values reported by `netstat -x' for connections in CLOSE state. Modified: stable/8/sys/netinet/tcp_timer.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_timer.c ============================================================================== --- stable/8/sys/netinet/tcp_timer.c Sat Sep 1 10:32:40 2012 (r239982) +++ stable/8/sys/netinet/tcp_timer.c Sat Sep 1 10:33:53 2012 (r239983) @@ -176,13 +176,18 @@ tcp_timer_delack(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack) - || !callout_active(&tp->t_timers->tt_delack)) { + if (callout_pending(&tp->t_timers->tt_delack) || + !callout_active(&tp->t_timers->tt_delack)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_delack); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + CURVNET_RESTORE(); + return; + } tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); @@ -222,7 +227,7 @@ tcp_timer_2msl(void *xtp) } INP_WLOCK(inp); tcp_free_sackholes(tp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) || + if (callout_pending(&tp->t_timers->tt_2msl) || !callout_active(&tp->t_timers->tt_2msl)) { INP_WUNLOCK(tp->t_inpcb); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -230,6 +235,12 @@ tcp_timer_2msl(void *xtp) return; } callout_deactivate(&tp->t_timers->tt_2msl); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle @@ -293,14 +304,20 @@ tcp_timer_keep(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep) - || !callout_active(&tp->t_timers->tt_keep)) { + if (callout_pending(&tp->t_timers->tt_keep) || + !callout_active(&tp->t_timers->tt_keep)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_keep); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } /* * Keep-alive timer went off; send something * or drop connection if idle for too long. @@ -388,14 +405,20 @@ tcp_timer_persist(void *xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist) - || !callout_active(&tp->t_timers->tt_persist)) { + if (callout_pending(&tp->t_timers->tt_persist) || + !callout_active(&tp->t_timers->tt_persist)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_persist); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } /* * Persistance timer into zero window. * Force a byte to be output, if possible. @@ -461,14 +484,20 @@ tcp_timer_rexmt(void * xtp) return; } INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt) - || !callout_active(&tp->t_timers->tt_rexmt)) { + if (callout_pending(&tp->t_timers->tt_rexmt) || + !callout_active(&tp->t_timers->tt_rexmt)) { INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_rexmt); + if ((inp->inp_flags & INP_DROPPED) != 0) { + INP_WUNLOCK(inp); + INP_INFO_RUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } tcp_free_sackholes(tp); /* * Retransmission timer went off. Message has not From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:37:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B70106564A; Sat, 1 Sep 2012 10:37:41 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9168FC12; Sat, 1 Sep 2012 10:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81Abffh094776; Sat, 1 Sep 2012 10:37:41 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81Abfo8094774; Sat, 1 Sep 2012 10:37:41 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011037.q81Abfo8094774@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239984 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:37:42 -0000 Author: trociny Date: Sat Sep 1 10:37:41 2012 New Revision: 239984 URL: http://svn.freebsd.org/changeset/base/239984 Log: MFC r239383: In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. Modified: stable/9/sys/netinet6/ip6_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Sat Sep 1 10:33:53 2012 (r239983) +++ stable/9/sys/netinet6/ip6_output.c Sat Sep 1 10:37:41 2012 (r239984) @@ -1618,18 +1618,22 @@ ip6_ctloutput(struct socket *so, struct break; #define OPTSET(bit) \ do { \ + INP_WLOCK(in6p); \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTSET2292(bit) \ do { \ + INP_WLOCK(in6p); \ in6p->inp_flags |= IN6P_RFC2292; \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0) @@ -1883,6 +1887,7 @@ do { \ if (error) break; + INP_WLOCK(in6p); switch (optval) { case IPV6_PORTRANGE_DEFAULT: in6p->inp_flags &= ~(INP_LOWPORT); @@ -1903,6 +1908,7 @@ do { \ error = EINVAL; break; } + INP_WUNLOCK(in6p); break; #ifdef IPSEC From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:39:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D65F7106566C; Sat, 1 Sep 2012 10:39:01 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C181A8FC0A; Sat, 1 Sep 2012 10:39:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81Ad1RP095038; Sat, 1 Sep 2012 10:39:01 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81Ad1Bn095036; Sat, 1 Sep 2012 10:39:01 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209011039.q81Ad1Bn095036@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 1 Sep 2012 10:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239985 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:39:02 -0000 Author: trociny Date: Sat Sep 1 10:39:01 2012 New Revision: 239985 URL: http://svn.freebsd.org/changeset/base/239985 Log: MFC r239383: In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. Modified: stable/8/sys/netinet6/ip6_output.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/ip6_output.c ============================================================================== --- stable/8/sys/netinet6/ip6_output.c Sat Sep 1 10:37:41 2012 (r239984) +++ stable/8/sys/netinet6/ip6_output.c Sat Sep 1 10:39:01 2012 (r239985) @@ -1472,18 +1472,22 @@ ip6_ctloutput(struct socket *so, struct break; #define OPTSET(bit) \ do { \ + INP_WLOCK(in6p); \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTSET2292(bit) \ do { \ + INP_WLOCK(in6p); \ in6p->inp_flags |= IN6P_RFC2292; \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0) @@ -1737,6 +1741,7 @@ do { \ if (error) break; + INP_WLOCK(in6p); switch (optval) { case IPV6_PORTRANGE_DEFAULT: in6p->inp_flags &= ~(INP_LOWPORT); @@ -1757,6 +1762,7 @@ do { \ error = EINVAL; break; } + INP_WUNLOCK(in6p); break; #ifdef IPSEC From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:48:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C2F106564A; Sat, 1 Sep 2012 10:48:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90A5D8FC0C; Sat, 1 Sep 2012 10:48:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81AmcmC096178; Sat, 1 Sep 2012 10:48:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AmcQ0096175; Sat, 1 Sep 2012 10:48:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209011048.q81AmcQ0096175@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 10:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239986 - head/usr.sbin/lmcconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:48:38 -0000 Author: ed Date: Sat Sep 1 10:48:38 2012 New Revision: 239986 URL: http://svn.freebsd.org/changeset/base/239986 Log: Remove unneeded struct timezone. We're only interested in a timestamp -- not the timezone. Modified: head/usr.sbin/lmcconfig/lmcconfig.c Modified: head/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:39:01 2012 (r239985) +++ head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:48:38 2012 (r239986) @@ -1076,9 +1076,8 @@ print_events(void) { char *time; struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); time = (char *)ctime((time_t *)&tv); printf("Current time:\t\t%s", time); if (status.cntrs.reset_time.tv_sec < 1000) From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCE8E1065676; Sat, 1 Sep 2012 10:52:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89C58FC17; Sat, 1 Sep 2012 10:52:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81AqJxn096629; Sat, 1 Sep 2012 10:52:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AqJqG096627; Sat, 1 Sep 2012 10:52:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209011052.q81AqJqG096627@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 Sep 2012 10:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239987 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:52:19 -0000 Author: pjd Date: Sat Sep 1 10:52:19 2012 New Revision: 239987 URL: http://svn.freebsd.org/changeset/base/239987 Log: Allow to pass providers with /dev/ prefix to g_provider_by_name(). MFC after: 3 days Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sat Sep 1 10:48:38 2012 (r239986) +++ head/sys/geom/geom_subr.c Sat Sep 1 10:52:19 2012 (r239987) @@ -686,6 +686,10 @@ g_resize_provider(struct g_provider *pp, g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL); } +#ifndef _PATH_DEV +#define _PATH_DEV "/dev/" +#endif + struct g_provider * g_provider_by_name(char const *arg) { @@ -693,6 +697,9 @@ g_provider_by_name(char const *arg) struct g_geom *gp; struct g_provider *pp; + if (strncmp(arg, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + arg += sizeof(_PATH_DEV) - 1; + LIST_FOREACH(cp, &g_classes, class) { LIST_FOREACH(gp, &cp->geom, geom) { LIST_FOREACH(pp, &gp->provider, provider) { @@ -701,6 +708,7 @@ g_provider_by_name(char const *arg) } } } + return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 10:56:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78AD106566B; Sat, 1 Sep 2012 10:56:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D28C78FC0C; Sat, 1 Sep 2012 10:56:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81AuFUA097114; Sat, 1 Sep 2012 10:56:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AuFIs097112; Sat, 1 Sep 2012 10:56:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209011056.q81AuFIs097112@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 10:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239988 - head/usr.sbin/lmcconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:56:16 -0000 Author: ed Date: Sat Sep 1 10:56:15 2012 New Revision: 239988 URL: http://svn.freebsd.org/changeset/base/239988 Log: Rework time handling. After I made the previous commit, I noticed the code does some things it shouldn't. It casts a struct timeval to a time_t, assuming tv_sec is the first member. Also, we are not interested in microseconds, so it is better to just call time(NULL). MFC after: 1 month Modified: head/usr.sbin/lmcconfig/lmcconfig.c Modified: head/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:52:19 2012 (r239987) +++ head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:56:15 2012 (r239988) @@ -1074,17 +1074,16 @@ print_hssi_sigs(void) static void print_events(void) { - char *time; - struct timeval tv; + const char *reset_time; + time_t now; - gettimeofday(&tv, NULL); - time = (char *)ctime((time_t *)&tv); - printf("Current time:\t\t%s", time); + now = time(NULL); + printf("Current time:\t\t%s", ctime(&now)); if (status.cntrs.reset_time.tv_sec < 1000) - time = "Never\n"; + reset_time = "Never\n"; else - time = (char *)ctime((time_t *)&status.cntrs.reset_time.tv_sec); - printf("Cntrs reset:\t\t%s", time); + reset_time = ctime(&status.cntrs.reset_time.tv_sec); + printf("Cntrs reset:\t\t%s", reset_time); if (status.cntrs.ibytes) printf("Rx bytes:\t\t%ju\n", (uintmax_t)status.cntrs.ibytes); if (status.cntrs.obytes) printf("Tx bytes:\t\t%ju\n", (uintmax_t)status.cntrs.obytes); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 11:06:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF19106566C; Sat, 1 Sep 2012 11:06:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6994D8FC0C; Sat, 1 Sep 2012 11:06:47 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:2c45:8400:d715:4c2a] (unknown [IPv6:2001:7b8:3a7:0:2c45:8400:d715:4c2a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E3B405C37; Sat, 1 Sep 2012 13:06:45 +0200 (CEST) Message-ID: <5041EC4B.5000501@FreeBSD.org> Date: Sat, 01 Sep 2012 13:06:51 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20120828 Thunderbird/16.0 MIME-Version: 1.0 To: Garrett Cooper References: <201208312328.q7VNSfLK012047@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239962 - head/contrib/binutils/binutils X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 11:06:47 -0000 On 2012-09-01 03:00, Garrett Cooper wrote: > On Fri, Aug 31, 2012 at 4:28 PM, Dimitry Andric wrote: >> Author: dim >> Date: Fri Aug 31 23:28:41 2012 >> New Revision: 239962 >> URL: http://svn.freebsd.org/changeset/base/239962 >> >> Log: >> Fix a twelve year old bug in readelf: when process_dynamic_segment() >> encounters a DT_RUNPATH entry, the global dynamic_info[] array is >> overrun, causing some other global variable to be overwritten. ... > Nice! Hopefully this fixes the random tinderbox crashes I've seen! Koop said it occurred semi-randomly during the openjdk7 port build. It apparently runs "readelf -d" on a whole bunch of produced libraries. So I hope those are now gone. :) > Has this been fixed upstream? Yes, in 2009: http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=839d59b5c25836c05cc5abb401e0b5fe17a98981 From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 11:21:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A874106566B; Sat, 1 Sep 2012 11:21:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9A88FC1C; Sat, 1 Sep 2012 11:21:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81BLvj0000221; Sat, 1 Sep 2012 11:21:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81BLvxV000218; Sat, 1 Sep 2012 11:21:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209011121.q81BLvxV000218@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 Sep 2012 11:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239989 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 11:21:57 -0000 Author: pjd Date: Sat Sep 1 11:21:56 2012 New Revision: 239989 URL: http://svn.freebsd.org/changeset/base/239989 Log: Fix panic in procdesc that can be triggered in the following scenario: 1. Process A pdfork(2)s process B. 2. Process A passes process descriptor of B to unrelated process C. 3. Hit CTRL+C to terminate process A. Process B is also terminated with SIGINT. 4. init(8) collects status of process B. 5. Process C closes process descriptor associated with process B. When we have such order of events, init(8), by collecting status of process B, will call procdesc_reap(). This function sets pd_proc to NULL. Now when process C calls close on this process descriptor, procdesc_close() is called. Unfortunately procdesc_close() assumes that pd_proc points at a valid proc structure, but it was set to NULL earlier, so the kernel panics. The patch also adds setting 'p->p_procdesc' to NULL in procdesc_reap(), which I think should be done. MFC after: 1 week Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Sat Sep 1 10:56:15 2012 (r239988) +++ head/sys/kern/sys_procdesc.c Sat Sep 1 11:21:56 2012 (r239989) @@ -333,6 +333,7 @@ procdesc_reap(struct proc *p) pd = p->p_procdesc; pd->pd_proc = NULL; + p->p_procdesc = NULL; procdesc_free(pd); } @@ -358,14 +359,20 @@ procdesc_close(struct file *fp, struct t pd->pd_flags |= PDF_CLOSED; PROCDESC_UNLOCK(pd); p = pd->pd_proc; - PROC_LOCK(p); - if (p->p_state == PRS_ZOMBIE) { + if (p == NULL) { + /* + * This is the case where process' exit status was already + * collected and procdesc_reap() was already called. + */ + sx_xunlock(&proctree_lock); + } else if (p->p_state == PRS_ZOMBIE) { /* * If the process is already dead and just awaiting reaping, * do that now. This will release the process's reference to * the process descriptor when it calls back into * procdesc_reap(). */ + PROC_LOCK(p); PROC_SLOCK(p); proc_reap(curthread, p, NULL, 0, NULL); } else { @@ -376,6 +383,7 @@ procdesc_close(struct file *fp, struct t * process from its descriptor so that its exit status will * be reported normally. */ + PROC_LOCK(p); pd->pd_proc = NULL; p->p_procdesc = NULL; procdesc_free(pd); From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 11:24:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D0951065670; Sat, 1 Sep 2012 11:24:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 570998FC14; Sat, 1 Sep 2012 11:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81BO3H2000505; Sat, 1 Sep 2012 11:24:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81BO36q000503; Sat, 1 Sep 2012 11:24:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209011124.q81BO36q000503@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 1 Sep 2012 11:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239990 - head/usr.bin/rctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 11:24:03 -0000 Author: trasz Date: Sat Sep 1 11:24:02 2012 New Revision: 239990 URL: http://svn.freebsd.org/changeset/base/239990 Log: Improve description for "rctl -l". MFC after: 2 weeks Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sat Sep 1 11:21:56 2012 (r239989) +++ head/usr.bin/rctl/rctl.8 Sat Sep 1 11:24:02 2012 (r239990) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd September 1, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -68,6 +68,10 @@ to the RCTL database. .It Fl l Ar filter Display rules applicable to the process defined by .Ar filter . +Note that this is different from showing the rules when called without +any options, as it shows not just the rules with subject equal to that +of process, but also rules for the user, jail, and login class applicable +to the process. .It Fl r Ar filter Remove rules matching .Ar filter @@ -90,7 +94,8 @@ Subject defines the kind of entity the r It can be either process, user, login class, or jail. .Pp Subject ID identifies the subject. -It can be user name, numerical user ID, login class name, or jail name. +It can be a process ID, user name, numerical user ID, login class name, +or jail name. .Pp Resource identifies the resource the rule controls. .Pp From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 14:45:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12A1D106566C; Sat, 1 Sep 2012 14:45:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E36FA8FC15; Sat, 1 Sep 2012 14:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81EjFDC025332; Sat, 1 Sep 2012 14:45:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81EjF2j025306; Sat, 1 Sep 2012 14:45:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209011445.q81EjF2j025306@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 14:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239991 - in head: bin/date bin/dd lib/libc/rpc libexec/rbootd libexec/rpc.rstatd release/picobsd/tinyware/login sbin/adjkerntz usr.bin/lock usr.bin/mail usr.bin/systat usr.bin/time usr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 14:45:16 -0000 Author: ed Date: Sat Sep 1 14:45:15 2012 New Revision: 239991 URL: http://svn.freebsd.org/changeset/base/239991 Log: Rework all non-contributed files that use `struct timezone'. This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead. Modified: head/bin/date/date.c head/bin/dd/dd.c head/bin/dd/misc.c head/lib/libc/rpc/auth_des.c head/lib/libc/rpc/svc_auth_des.c head/libexec/rbootd/rbootd.c head/libexec/rbootd/rmpproto.c head/libexec/rpc.rstatd/rstat_proc.c head/release/picobsd/tinyware/login/pico-login.c head/sbin/adjkerntz/adjkerntz.c head/usr.bin/lock/lock.c head/usr.bin/mail/util.c head/usr.bin/systat/ifstat.c head/usr.bin/time/time.c head/usr.sbin/cron/crontab/crontab.c head/usr.sbin/inetd/builtins.c head/usr.sbin/keyserv/keyserv.c head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/measure.c head/usr.sbin/timed/timed/readmsg.c head/usr.sbin/timed/timed/slave.c head/usr.sbin/timed/timed/timed.c head/usr.sbin/timed/timedc/cmds.c Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/bin/date/date.c Sat Sep 1 14:45:15 2012 (r239991) @@ -137,7 +137,7 @@ main(int argc, char *argv[]) * If -d or -t, set the timezone or daylight savings time; this * doesn't belong here; the kernel should not know about either. */ - if (set_timezone && settimeofday((struct timeval *)NULL, &tz)) + if (set_timezone && settimeofday(NULL, &tz) != 0) err(1, "settimeofday (timezone)"); if (!rflag && time(&tval) == -1) @@ -273,14 +273,14 @@ setthetime(const char *fmt, const char * /* set the time */ if (nflag || netsettime(tval)) { utx.ut_type = OLD_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); tv.tv_sec = tval; tv.tv_usec = 0; - if (settimeofday(&tv, (struct timezone *)NULL)) + if (settimeofday(&tv, NULL) != 0) err(1, "settimeofday (timeval)"); utx.ut_type = NEW_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); } Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/bin/dd/dd.c Sat Sep 1 14:45:15 2012 (r239991) @@ -232,8 +232,8 @@ setup(void) ctab = casetab; } - (void)gettimeofday(&tv, (struct timezone *)NULL); - st.start = tv.tv_sec + tv.tv_usec * 1e-6; + (void)gettimeofday(&tv, NULL); + st.start = tv.tv_sec + tv.tv_usec * 1e-6; } static void Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/bin/dd/misc.c Sat Sep 1 14:45:15 2012 (r239991) @@ -59,7 +59,7 @@ summary(void) double secs; char buf[100]; - (void)gettimeofday(&tv, (struct timezone *)NULL); + (void)gettimeofday(&tv, NULL); secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; if (secs < 1e-6) secs = 1e-6; Modified: head/lib/libc/rpc/auth_des.c ============================================================================== --- head/lib/libc/rpc/auth_des.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/lib/libc/rpc/auth_des.c Sat Sep 1 14:45:15 2012 (r239991) @@ -286,7 +286,7 @@ authdes_marshal(AUTH *auth, XDR *xdrs) * Figure out the "time", accounting for any time difference * with the server if necessary. */ - (void) gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL); + (void)gettimeofday(&ad->ad_timestamp, NULL); ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec; ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec; while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) { Modified: head/lib/libc/rpc/svc_auth_des.c ============================================================================== --- head/lib/libc/rpc/svc_auth_des.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/lib/libc/rpc/svc_auth_des.c Sat Sep 1 14:45:15 2012 (r239991) @@ -271,7 +271,7 @@ _svcauth_des(rqst, msg) debug("timestamp before last seen"); return (AUTH_REJECTEDVERF); /* replay */ } - (void) gettimeofday(¤t, (struct timezone *)NULL); + (void)gettimeofday(¤t, NULL); current.tv_sec -= window; /* allow for expiration */ if (!BEFORE(¤t, ×tamp)) { debug("timestamp expired"); Modified: head/libexec/rbootd/rbootd.c ============================================================================== --- head/libexec/rbootd/rbootd.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/libexec/rbootd/rbootd.c Sat Sep 1 14:45:15 2012 (r239991) @@ -310,16 +310,15 @@ void DoTimeout(void) { RMPCONN *rtmp; - struct timeval now; - - (void) gettimeofday(&now, (struct timezone *)0); + time_t now; /* * For each active connection, if RMP_TIMEOUT seconds have passed * since the last packet was sent, delete the connection. */ + now = time(NULL); for (rtmp = RmpConns; rtmp != NULL; rtmp = rtmp->next) - if ((rtmp->tstamp.tv_sec + RMP_TIMEOUT) < now.tv_sec) { + if ((rtmp->tstamp.tv_sec + RMP_TIMEOUT) < now) { syslog(LOG_WARNING, "%s: connection timed out (%u)", EnetStr(rtmp), rtmp->rmp.r_type); RemoveConn(rtmp); Modified: head/libexec/rbootd/rmpproto.c ============================================================================== --- head/libexec/rbootd/rmpproto.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/libexec/rbootd/rmpproto.c Sat Sep 1 14:45:15 2012 (r239991) @@ -575,7 +575,7 @@ SendPacket(RMPCONN *rconn) /* * Last time this connection was active. */ - (void) gettimeofday(&rconn->tstamp, (struct timezone *)0); + (void)gettimeofday(&rconn->tstamp, NULL); if (DbgFp != NULL) /* display packet */ DispPkt(rconn,DIR_SENT); Modified: head/libexec/rpc.rstatd/rstat_proc.c ============================================================================== --- head/libexec/rpc.rstatd/rstat_proc.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/libexec/rpc.rstatd/rstat_proc.c Sat Sep 1 14:45:15 2012 (r239991) @@ -244,7 +244,7 @@ updatestat(void) FETCH_CNT(stats_all.s1.v_pswpout, vm.v_swappgsout); FETCH_CNT(stats_all.s1.v_intr, sys.v_intr); FETCH_CNT(stats_all.s2.v_swtch, sys.v_swtch); - gettimeofday(&tm, (struct timezone *) 0); + (void)gettimeofday(&tm, NULL); stats_all.s1.v_intr -= hz*(tm.tv_sec - btm.tv_sec) + hz*(tm.tv_usec - btm.tv_usec)/1000000; @@ -287,8 +287,9 @@ updatestat(void) stats_all.s1.if_oerrors += ifmd.ifmd_data.ifi_oerrors; stats_all.s1.if_collisions += ifmd.ifmd_data.ifi_collisions; } - gettimeofday((struct timeval *)&stats_all.s3.curtime, - (struct timezone *) 0); + (void)gettimeofday(&tm, NULL); + stats_all.s3.curtime.tv_sec = tm.tv_sec; + stats_all.s3.curtime.tv_usec = tm.tv_usec; alarm(1); } Modified: head/release/picobsd/tinyware/login/pico-login.c ============================================================================== --- head/release/picobsd/tinyware/login/pico-login.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/release/picobsd/tinyware/login/pico-login.c Sat Sep 1 14:45:15 2012 (r239991) @@ -150,12 +150,11 @@ main(argc, argv) extern char **environ; struct group *gr; struct stat st; - struct timeval tp; struct utmpx utmp; int rootok, retries, backoff; int ask, ch, cnt, fflag, hflag, pflag, quietlog, rootlogin, rval; int changepass; - time_t warntime; + time_t now, warntime; uid_t uid, euid; gid_t egid; char *p, *ttyn; @@ -430,8 +429,7 @@ main(argc, argv) if (!quietlog) quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0; - if (pwd->pw_change || pwd->pw_expire) - (void)gettimeofday(&tp, (struct timezone *)NULL); + now = time(NULL); #define DEFAULT_WARN (2L * 7L * 86400L) /* Two weeks */ @@ -439,10 +437,10 @@ main(argc, argv) DEFAULT_WARN); if (pwd->pw_expire) { - if (tp.tv_sec >= pwd->pw_expire) { + if (now >= pwd->pw_expire) { refused("Sorry -- your account has expired", "EXPIRED", 1); - } else if (pwd->pw_expire - tp.tv_sec < warntime && !quietlog) + } else if (pwd->pw_expire - now < warntime && !quietlog) (void)printf("Warning: your account expires on %s", ctime(&pwd->pw_expire)); } @@ -452,12 +450,12 @@ main(argc, argv) changepass = 0; if (pwd->pw_change) { - if (tp.tv_sec >= pwd->pw_change) { + if (now >= pwd->pw_change) { (void)printf("Sorry -- your password has expired.\n"); changepass = 1; syslog(LOG_INFO, "%s Password expired - forcing change", pwd->pw_name); - } else if (pwd->pw_change - tp.tv_sec < warntime && !quietlog) + } else if (pwd->pw_change - now < warntime && !quietlog) (void)printf("Warning: your password expires on %s", ctime(&pwd->pw_change)); } Modified: head/sbin/adjkerntz/adjkerntz.c ============================================================================== --- head/sbin/adjkerntz/adjkerntz.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/sbin/adjkerntz/adjkerntz.c Sat Sep 1 14:45:15 2012 (r239991) @@ -315,10 +315,7 @@ recalculate: * restoring disrtcset, since we don't clean up * anything. */ - if (gettimeofday(&tv, (struct timezone *)NULL)) { - syslog(LOG_ERR, "gettimeofday: %m"); - return 1; - } + (void)gettimeofday(&tv, NULL); tv.tv_sec += diff; stv = &tv; } Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/lock/lock.c Sat Sep 1 14:45:15 2012 (r239991) @@ -54,9 +54,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include + #include #include #include @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TIMEOUT 15 @@ -89,10 +90,9 @@ int main(int argc, char **argv) { struct passwd *pw; - struct timeval timval; - time_t timval_sec; struct itimerval ntimer, otimer; struct tm *timp; + time_t timval; int ch, failures, sectimeout, usemine, vtylock; char *ap, *cryptpw, *mypw, *ttynam, *tzn; char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ]; @@ -138,11 +138,9 @@ main(int argc, char **argv) errx(1, "not a terminal?"); if (strncmp(ttynam, _PATH_DEV, strlen(_PATH_DEV)) == 0) ttynam += strlen(_PATH_DEV); - if (gettimeofday(&timval, (struct timezone *)NULL)) - err(1, "gettimeofday"); - nexttime = timval.tv_sec + (sectimeout * 60); - timval_sec = timval.tv_sec; - timp = localtime(&timval_sec); + timval = time(NULL); + nexttime = timval + (sectimeout * 60); + timp = localtime(&timval); ap = asctime(timp); tzn = timp->tm_zone; @@ -256,17 +254,16 @@ usage(void) static void hi(int signo __unused) { - struct timeval timval; + time_t timval; - if (!gettimeofday(&timval, (struct timezone *)NULL)) { - (void)printf("lock: type in the unlock key. "); - if (no_timeout) { - (void)putchar('\n'); - } else { - (void)printf("timeout in %jd:%jd minutes\n", - (intmax_t)(nexttime - timval.tv_sec) / 60, - (intmax_t)(nexttime - timval.tv_sec) % 60); - } + timval = time(NULL); + (void)printf("lock: type in the unlock key. "); + if (no_timeout) { + (void)putchar('\n'); + } else { + (void)printf("timeout in %jd:%jd minutes\n", + (intmax_t)(nexttime - timval) / 60, + (intmax_t)(nexttime - timval) % 60); } } Modified: head/usr.bin/mail/util.c ============================================================================== --- head/usr.bin/mail/util.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/mail/util.c Sat Sep 1 14:45:15 2012 (r239991) @@ -324,7 +324,7 @@ alter(char *name) if (stat(name, &sb)) return; - (void)gettimeofday(&tv[0], (struct timezone *)NULL); + (void)gettimeofday(&tv[0], NULL); tv[0].tv_sec++; TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); (void)utimes(name, tv); Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/systat/ifstat.c Sat Sep 1 14:45:15 2012 (r239991) @@ -247,8 +247,7 @@ fetchifstat(void) old_outb = ifp->if_mib.ifmd_data.ifi_obytes; ifp->tv_lastchanged = ifp->if_mib.ifmd_data.ifi_lastchange; - if (gettimeofday(&new_tv, (struct timezone *)0) != 0) - IFSTAT_ERR(2, "error getting time of day"); + (void)gettimeofday(&new_tv, NULL); (void)getifmibdata(ifp->if_row, &ifp->if_mib); new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; Modified: head/usr.bin/time/time.c ============================================================================== --- head/usr.bin/time/time.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/time/time.c Sat Sep 1 14:45:15 2012 (r239991) @@ -117,7 +117,7 @@ main(int argc, char **argv) setvbuf(out, (char *)NULL, _IONBF, (size_t)0); } - gettimeofday(&before_tv, (struct timezone *)NULL); + (void)gettimeofday(&before_tv, NULL); switch(pid = fork()) { case -1: /* error */ err(1, "time"); @@ -134,7 +134,7 @@ main(int argc, char **argv) (void)signal(SIGQUIT, SIG_IGN); (void)signal(SIGINFO, siginfo); while (wait4(pid, &status, 0, &ru) != pid); - gettimeofday(&after, (struct timezone *)NULL); + (void)gettimeofday(&after, NULL); if ( ! WIFEXITED(status)) warnx("command terminated abnormally"); exitonsig = WIFSIGNALED(status) ? WTERMSIG(status) : 0; @@ -297,7 +297,7 @@ siginfo(int sig __unused) struct timeval after; struct rusage ru; - gettimeofday(&after, (struct timezone *)NULL); + (void)gettimeofday(&after, NULL); getrusage(RUSAGE_CHILDREN, &ru); showtime(stdout, &before_tv, &after, &ru); } Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/cron/crontab/crontab.c Sat Sep 1 14:45:15 2012 (r239991) @@ -627,9 +627,8 @@ static void poke_daemon() { #ifdef USE_UTIMES struct timeval tvs[2]; - struct timezone tz; - (void) gettimeofday(&tvs[0], &tz); + (void)gettimeofday(&tvs[0], NULL); tvs[1] = tvs[0]; if (utimes(SPOOL_DIR, tvs) < OK) { warn("can't update mtime on spooldir %s", SPOOL_DIR); Modified: head/usr.sbin/inetd/builtins.c ============================================================================== --- head/usr.sbin/inetd/builtins.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/inetd/builtins.c Sat Sep 1 14:45:15 2012 (r239991) @@ -691,15 +691,9 @@ printit: uint32_t machtime(void) { - struct timeval tv; - if (gettimeofday(&tv, (struct timezone *)NULL) < 0) { - if (debug) - warnx("unable to get time of day"); - return (0L); - } #define OFFSET ((uint32_t)25567 * 24*60*60) - return (htonl((uint32_t)(tv.tv_sec + OFFSET))); + return (htonl((uint32_t)(time(NULL) + OFFSET))); #undef OFFSET } Modified: head/usr.sbin/keyserv/keyserv.c ============================================================================== --- head/usr.sbin/keyserv/keyserv.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/keyserv/keyserv.c Sat Sep 1 14:45:15 2012 (r239991) @@ -232,7 +232,7 @@ randomize(master) seed = 0; for (i = 0; i < 1024; i++) { - (void) gettimeofday(&tv, (struct timezone *) NULL); + (void)gettimeofday(&tv, NULL); shift = i % 8 * sizeof (int); seed ^= (tv.tv_usec << shift) | (tv.tv_usec >> (32 - shift)); } @@ -575,7 +575,7 @@ key_gen_1_svc_prog(v, s) static des_block keygen; static des_block key; - (void) gettimeofday(&time, (struct timezone *) NULL); + (void)gettimeofday(&time, NULL); keygen.key.high += (time.tv_sec ^ time.tv_usec); keygen.key.low += (time.tv_sec ^ time.tv_usec); ecb_crypt((char *)&masterkey, (char *)&keygen, sizeof (keygen), Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/master.c Sat Sep 1 14:45:15 2012 (r239991) @@ -85,7 +85,7 @@ master() if (ntp->status == MASTER) masterup(ntp); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec+3; if (justquit) polls = 0; @@ -96,14 +96,14 @@ master() * to update all timers. */ loop: - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); wait.tv_sec = pollingtime - ntime.tv_sec; if (wait.tv_sec < 0) wait.tv_sec = 0; wait.tv_usec = 0; msg = readmsg(TSP_ANY, ANYADDR, &wait, 0); if (!msg) { - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); if (ntime.tv_sec >= pollingtime) { pollingtime = ntime.tv_sec + SAMPLEINTVL; get_goodgroup(0); @@ -175,7 +175,7 @@ loop: } mchgdate(msg); - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec + SAMPLEINTVL; break; @@ -203,7 +203,7 @@ loop: } mchgdate(msg); - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec + SAMPLEINTVL; break; @@ -284,7 +284,7 @@ loop: * do not want to call synch() while waiting * to be killed! */ - (void)gettimeofday(&ntime, (struct timezone *)0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec + SAMPLEINTVL; break; @@ -354,7 +354,7 @@ mchgdate(msg) (void)strcpy(olddate, date()); /* adjust time for residence on the queue */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); adj_msg_time(msg,&otime); tmptv.tv_sec = msg->tsp_time.tv_sec; @@ -368,11 +368,11 @@ mchgdate(msg) synch(tvtomsround(ntime)); } else { utx.ut_type = OLD_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); (void)settimeofday(&tmptv, 0); utx.ut_type = NEW_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); spreadtime(); } @@ -396,7 +396,7 @@ synch(mydelta) if (slvcount > 0) { if (trace) fprintf(fd, "measurements starting at %s\n", date()); - (void)gettimeofday(&check, 0); + (void)gettimeofday(&check, NULL); for (htp = self.l_fwd; htp != &self; htp = htp->l_fwd) { if (htp->noanswer != 0) { measure_status = measure(500, 100, @@ -424,7 +424,7 @@ synch(mydelta) } else { htp->delta = measure_delta; } - (void)gettimeofday(&stop, 0); + (void)gettimeofday(&stop, NULL); timevalsub(&stop, &stop, &check); if (stop.tv_sec >= 1) { if (trace) @@ -437,7 +437,7 @@ synch(mydelta) if (0 != readmsg(TSP_TRACEON,ANYADDR, &wait,0)) traceon(); - (void)gettimeofday(&check, 0); + (void)gettimeofday(&check, NULL); } } if (trace) @@ -474,7 +474,7 @@ spreadtime() for (htp = self.l_fwd; htp != &self; htp = htp->l_fwd) { to.tsp_type = TSP_SETTIME; (void)strcpy(to.tsp_name, hostname); - (void)gettimeofday(&tmptv, 0); + (void)gettimeofday(&tmptv, NULL); to.tsp_time.tv_sec = tmptv.tv_sec; to.tsp_time.tv_usec = tmptv.tv_usec; answer = acksend(&to, &htp->addr, htp->name, @@ -732,7 +732,7 @@ masterup(net) * we do not tell them to start using our time, before we have * found a good master. */ - (void)gettimeofday(&net->slvwait, 0); + (void)gettimeofday(&net->slvwait, NULL); } void @@ -755,12 +755,12 @@ newslave(msg) * If we are stable, send our time to the slave. * Do not go crazy if the date has been changed. */ - (void)gettimeofday(&now, 0); + (void)gettimeofday(&now, NULL); if (now.tv_sec >= fromnet->slvwait.tv_sec+3 || now.tv_sec < fromnet->slvwait.tv_sec) { to.tsp_type = TSP_SETTIME; (void)strcpy(to.tsp_name, hostname); - (void)gettimeofday(&tmptv, 0); + (void)gettimeofday(&tmptv, NULL); to.tsp_time.tv_sec = tmptv.tv_sec; to.tsp_time.tv_usec = tmptv.tv_usec; answer = acksend(&to, &htp->addr, Modified: head/usr.sbin/timed/timed/measure.c ============================================================================== --- head/usr.sbin/timed/timed/measure.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/measure.c Sat Sep 1 14:45:15 2012 (r239991) @@ -128,7 +128,7 @@ measure(maxmsec, wmsec, hname, addr, pri FD_ZERO(&ready); - (void)gettimeofday(&tdone, 0); + (void)gettimeofday(&tdone, NULL); mstotvround(&tout, maxmsec); timevaladd(&tdone, &tout); /* when we give up */ @@ -136,7 +136,7 @@ measure(maxmsec, wmsec, hname, addr, pri rcvcount = 0; while (rcvcount < MSGS) { - (void)gettimeofday(&tcur, 0); + (void)gettimeofday(&tcur, NULL); /* * keep sending until we have sent the max @@ -173,7 +173,7 @@ measure(maxmsec, wmsec, hname, addr, pri FD_SET(sock_raw, &ready); count = select(sock_raw+1, &ready, (fd_set *)0, (fd_set *)0, &tout); - (void)gettimeofday(&tcur, (struct timezone *)0); + (void)gettimeofday(&tcur, NULL); if (count <= 0) break; Modified: head/usr.sbin/timed/timed/readmsg.c ============================================================================== --- head/usr.sbin/timed/timed/readmsg.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/readmsg.c Sat Sep 1 14:45:15 2012 (r239991) @@ -168,11 +168,11 @@ again: * right one, return it, otherwise insert it in the linked list. */ - (void)gettimeofday(&rtout, 0); + (void)gettimeofday(&rtout, NULL); timevaladd(&rtout, intvl); FD_ZERO(&ready); for (;;) { - (void)gettimeofday(&rtime, 0); + (void)gettimeofday(&rtime, NULL); timevalsub(&rwait, &rtout, &rtime); if (rwait.tv_sec < 0) rwait.tv_sec = rwait.tv_usec = 0; @@ -219,7 +219,7 @@ again: inet_ntoa(from.sin_addr)); continue; } - (void)gettimeofday(&from_when, (struct timezone *)0); + (void)gettimeofday(&from_when, NULL); bytehostorder(&msgin); if (msgin.tsp_vers > TSPVERSION) { Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/slave.c Sat Sep 1 14:45:15 2012 (r239991) @@ -83,7 +83,7 @@ slave() refusetime = 0; adjtime = 0; - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; if (justquit) @@ -103,7 +103,7 @@ slave() loop: get_goodgroup(0); - (void)gettimeofday(&ntime, (struct timezone *)0); + (void)gettimeofday(&ntime, NULL); if (ntime.tv_sec > electiontime) { if (trace) fprintf(fd, "election timer expired\n"); @@ -132,7 +132,7 @@ loop: makeslave(slavenet); /* prune extras */ setstatus(); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looktime = ntime.tv_sec + delay2; } if (ntime.tv_sec >= looptime) { @@ -153,7 +153,7 @@ loop: } } } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looptime = ntime.tv_sec + delay2; } @@ -225,7 +225,7 @@ loop: * Otherwise the clocks can race until the loop * is found. */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); if (adjtime < otime.tv_sec) looptime -= (looptime-otime.tv_sec)/2 + 1; @@ -234,7 +234,7 @@ loop: seq = msg->tsp_seq; synch(tvtomsround(msg->tsp_time)); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; adjtime = ntime.tv_sec + SAMPLEINTVL*2; @@ -248,7 +248,7 @@ loop: seq = msg->tsp_seq; /* adjust time for residence on the queue */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); adj_msg_time(msg,&otime); /* * the following line is necessary due to syslog @@ -289,7 +289,7 @@ loop: if (status & MASTER) spreadtime(); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; @@ -327,7 +327,7 @@ loop: setstatus(); answerdelay(); xmit(TSP_SLAVEUP, 0, &from); - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; refusetime = 0; @@ -336,7 +336,7 @@ loop: case TSP_MASTERREQ: if (fromnet->status != SLAVE) break; - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; break; @@ -381,7 +381,7 @@ loop: case TSP_ELECTION: if (fromnet->status == SLAVE) { - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; seq = 0; @@ -538,7 +538,7 @@ loop: electiontime = 0; } } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looptime = ntime.tv_sec + FASTTOUT; } else { if (msg->tsp_hopcnt-- < 1) @@ -590,7 +590,7 @@ loop: (void)remmach(htp); } } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looptime = ntime.tv_sec + FASTTOUT; } break; @@ -660,7 +660,7 @@ schgdate(msg, newdate) msg->tsp_name, newdate); /* adjust time for residence on the queue */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); adj_msg_time(msg, &otime); to.tsp_type = TSP_SETDATEREQ; Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/timed.c Sat Sep 1 14:45:15 2012 (r239991) @@ -232,7 +232,7 @@ main(argc, argv) } /* choose a unique seed for random number generation */ - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); srandom(ntime.tv_sec + ntime.tv_usec); sequence = random(); /* initial seq number */ @@ -701,11 +701,9 @@ casual(inf, sup) char * date() { - struct timeval tv; time_t tv_sec; - (void)gettimeofday(&tv, (struct timezone *)0); - tv_sec = tv.tv_sec; + tv_sec = time(NULL); return (ctime(&tv_sec)); } Modified: head/usr.sbin/timed/timedc/cmds.c ============================================================================== --- head/usr.sbin/timed/timedc/cmds.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timedc/cmds.c Sat Sep 1 14:45:15 2012 (r239991) @@ -131,7 +131,7 @@ daydiff(hostname) } sec -= BU; - (void)gettimeofday(&now, (struct timezone*)0); + (void)gettimeofday(&now, NULL); return (sec - now.tv_sec); } } From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 15:50:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940DF106567B; Sat, 1 Sep 2012 15:50:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B91C8FC23; Sat, 1 Sep 2012 15:50:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81FoqLn033381; Sat, 1 Sep 2012 15:50:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81FoqPD033379; Sat, 1 Sep 2012 15:50:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209011550.q81FoqPD033379@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Sep 2012 15:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239992 - stable/9/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 15:50:52 -0000 Author: kib Date: Sat Sep 1 15:50:52 2012 New Revision: 239992 URL: http://svn.freebsd.org/changeset/base/239992 Log: MFC r238675: Force clean FPU state in PCB user FPU save area for PT_I386_{GET,SET}XMMREGS. Modified: stable/9/sys/i386/i386/ptrace_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/ptrace_machdep.c ============================================================================== --- stable/9/sys/i386/i386/ptrace_machdep.c Sat Sep 1 14:45:15 2012 (r239991) +++ stable/9/sys/i386/i386/ptrace_machdep.c Sat Sep 1 15:50:52 2012 (r239992) @@ -54,10 +54,12 @@ cpu_ptrace(struct thread *td, int req, v fpstate = &td->td_pcb->pcb_user_save.sv_xmm; switch (req) { case PT_GETXMMREGS: + npxgetregs(td); error = copyout(fpstate, addr, sizeof(*fpstate)); break; case PT_SETXMMREGS: + npxgetregs(td); error = copyin(addr, fpstate, sizeof(*fpstate)); fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; break; From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 15:53:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C78D106566B; Sat, 1 Sep 2012 15:53:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 468AF8FC0C; Sat, 1 Sep 2012 15:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81FrRlg033710; Sat, 1 Sep 2012 15:53:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81FrRmO033708; Sat, 1 Sep 2012 15:53:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209011553.q81FrRmO033708@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Sep 2012 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239993 - stable/9/sys/i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 15:53:27 -0000 Author: kib Date: Sat Sep 1 15:53:26 2012 New Revision: 239993 URL: http://svn.freebsd.org/changeset/base/239993 Log: MFC r238676: Add stmxcsr. MFC r238914: Change (unused) prototype for stmxcsr() to match reality. Modified: stable/9/sys/i386/isa/npx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/isa/npx.c ============================================================================== --- stable/9/sys/i386/isa/npx.c Sat Sep 1 15:50:52 2012 (r239992) +++ stable/9/sys/i386/isa/npx.c Sat Sep 1 15:53:26 2012 (r239993) @@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$"); #ifdef CPU_ENABLE_SSE #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) +#define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) #endif #else /* !(__GNUCLIKE_ASM && !lint) */ @@ -113,6 +114,7 @@ void frstor(caddr_t addr); #ifdef CPU_ENABLE_SSE void fxsave(caddr_t addr); void fxrstor(caddr_t addr); +void stmxcsr(u_int *csr); #endif #endif /* __GNUCLIKE_ASM && !lint */ From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 15:55:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45597106566B; Sat, 1 Sep 2012 15:55:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16A418FC0C; Sat, 1 Sep 2012 15:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81FtEqU033985; Sat, 1 Sep 2012 15:55:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81FtEEA033983; Sat, 1 Sep 2012 15:55:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209011555.q81FtEEA033983@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Sep 2012 15:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239994 - stable/9/sys/i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 15:55:15 -0000 Author: kib Date: Sat Sep 1 15:55:14 2012 New Revision: 239994 URL: http://svn.freebsd.org/changeset/base/239994 Log: MFC r238677: Stop clearing x87 exceptions in the #MF handler. Modified: stable/9/sys/i386/isa/npx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/isa/npx.c ============================================================================== --- stable/9/sys/i386/isa/npx.c Sat Sep 1 15:53:26 2012 (r239993) +++ stable/9/sys/i386/isa/npx.c Sat Sep 1 15:55:14 2012 (r239994) @@ -583,21 +583,21 @@ static char fpetable[128] = { }; /* - * Preserve the FP status word, clear FP exceptions, then generate a SIGFPE. + * Read the FP status and control words, then generate si_code value + * for SIGFPE. The error code chosen will be one of the + * FPE_... macros. It will be sent as the second argument to old + * BSD-style signal handlers and as "siginfo_t->si_code" (second + * argument) to SA_SIGINFO signal handlers. * - * Clearing exceptions is necessary mainly to avoid IRQ13 bugs. We now - * depend on longjmp() restoring a usable state. Restoring the state - * or examining it might fail if we didn't clear exceptions. + * Some time ago, we cleared the x87 exceptions with FNCLEX there. + * Clearing exceptions was necessary mainly to avoid IRQ13 bugs. The + * usermode code which understands the FPU hardware enough to enable + * the exceptions, can also handle clearing the exception state in the + * handler. The only consequence of not clearing the exception is the + * rethrow of the SIGFPE on return from the signal handler and + * reexecution of the corresponding instruction. * - * The error code chosen will be one of the FPE_... macros. It will be - * sent as the second argument to old BSD-style signal handlers and as - * "siginfo_t->si_code" (second argument) to SA_SIGINFO signal handlers. - * - * XXX the FP state is not preserved across signal handlers. So signal - * handlers cannot afford to do FP unless they preserve the state or - * longjmp() out. Both preserving the state and longjmp()ing may be - * destroyed by IRQ13 bugs. Clearing FP exceptions is not an acceptable - * solution for signals other than SIGFPE. + * For XMM traps, the exceptions were never cleared. */ int npxtrap() @@ -623,9 +623,6 @@ npxtrap() fnstcw(&control); fnstsw(&status); } - - if (PCPU_GET(fpcurthread) == curthread) - fnclex(); critical_exit(); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 15:57:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6308106566B; Sat, 1 Sep 2012 15:57:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6D0F8FC15; Sat, 1 Sep 2012 15:57:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81FvC0x034397; Sat, 1 Sep 2012 15:57:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81FvCSk034393; Sat, 1 Sep 2012 15:57:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209011557.q81FvCSk034393@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Sep 2012 15:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239995 - in stable/9/sys/i386: i386 include isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 15:57:13 -0000 Author: kib Date: Sat Sep 1 15:57:12 2012 New Revision: 239995 URL: http://svn.freebsd.org/changeset/base/239995 Log: MFC r238678: Provide siginfo.si_code for floating point errors when error occurs using the SSE math processor. Modified: stable/9/sys/i386/i386/trap.c stable/9/sys/i386/include/npx.h stable/9/sys/i386/isa/npx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Sat Sep 1 15:55:14 2012 (r239994) +++ stable/9/sys/i386/i386/trap.c Sat Sep 1 15:57:12 2012 (r239995) @@ -368,7 +368,7 @@ trap(struct trapframe *frame) case T_ARITHTRAP: /* arithmetic trap */ #ifdef DEV_NPX - ucode = npxtrap(); + ucode = npxtrap_x87(); if (ucode == -1) goto userout; #else @@ -531,7 +531,13 @@ trap(struct trapframe *frame) break; case T_XMMFLT: /* SIMD floating-point exception */ - ucode = 0; /* XXX */ +#if defined(DEV_NPX) && !defined(CPU_DISABLE_SSE) && defined(I686_CPU) + ucode = npxtrap_sse(); + if (ucode == -1) + goto userout; +#else + ucode = 0; +#endif i = SIGFPE; break; } Modified: stable/9/sys/i386/include/npx.h ============================================================================== --- stable/9/sys/i386/include/npx.h Sat Sep 1 15:55:14 2012 (r239994) +++ stable/9/sys/i386/include/npx.h Sat Sep 1 15:57:12 2012 (r239995) @@ -175,7 +175,8 @@ int npxgetregs(struct thread *td); void npxinit(void); void npxsave(union savefpu *addr); void npxsetregs(struct thread *td, union savefpu *addr); -int npxtrap(void); +int npxtrap_x87(void); +int npxtrap_sse(void); void npxuserinited(struct thread *); struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags); void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx); Modified: stable/9/sys/i386/isa/npx.c ============================================================================== --- stable/9/sys/i386/isa/npx.c Sat Sep 1 15:55:14 2012 (r239994) +++ stable/9/sys/i386/isa/npx.c Sat Sep 1 15:57:12 2012 (r239995) @@ -600,12 +600,13 @@ static char fpetable[128] = { * For XMM traps, the exceptions were never cleared. */ int -npxtrap() +npxtrap_x87(void) { u_short control, status; if (!hw_float) { - printf("npxtrap: fpcurthread = %p, curthread = %p, hw_float = %d\n", + printf( + "npxtrap_x87: fpcurthread = %p, curthread = %p, hw_float = %d\n", PCPU_GET(fpcurthread), curthread, hw_float); panic("npxtrap from nowhere"); } @@ -627,6 +628,28 @@ npxtrap() return (fpetable[status & ((~control & 0x3f) | 0x40)]); } +#ifdef CPU_ENABLE_SSE +int +npxtrap_sse(void) +{ + u_int mxcsr; + + if (!hw_float) { + printf( + "npxtrap_sse: fpcurthread = %p, curthread = %p, hw_float = %d\n", + PCPU_GET(fpcurthread), curthread, hw_float); + panic("npxtrap from nowhere"); + } + critical_enter(); + if (PCPU_GET(fpcurthread) != curthread) + mxcsr = curthread->td_pcb->pcb_save->sv_xmm.sv_env.en_mxcsr; + else + stmxcsr(&mxcsr); + critical_exit(); + return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); +} +#endif + /* * Implement device not available (DNA) exception * From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 15:59:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6DA9106566C; Sat, 1 Sep 2012 15:59:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0A1A8FC08; Sat, 1 Sep 2012 15:59:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81FxAeh034666; Sat, 1 Sep 2012 15:59:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81FxApd034658; Sat, 1 Sep 2012 15:59:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209011559.q81FxApd034658@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Sep 2012 15:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239996 - in stable/9/sys/i386: i386 include isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 15:59:10 -0000 Author: kib Date: Sat Sep 1 15:59:09 2012 New Revision: 239996 URL: http://svn.freebsd.org/changeset/base/239996 Log: MFC r238792: Introduce curpcb magic variable. Modified: stable/9/sys/i386/i386/machdep.c stable/9/sys/i386/i386/pmap.c stable/9/sys/i386/i386/trap.c stable/9/sys/i386/i386/vm86.c stable/9/sys/i386/i386/vm_machdep.c stable/9/sys/i386/include/pcpu.h stable/9/sys/i386/isa/npx.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/machdep.c ============================================================================== --- stable/9/sys/i386/i386/machdep.c Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/i386/machdep.c Sat Sep 1 15:59:09 2012 (r239996) @@ -1570,7 +1570,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_dr3 = 0; pcb->pcb_dr6 = 0; pcb->pcb_dr7 = 0; - if (pcb == PCPU_GET(curpcb)) { + if (pcb == curpcb) { /* * Clear the debug registers on the running * CPU, otherwise they will end up affecting Modified: stable/9/sys/i386/i386/pmap.c ============================================================================== --- stable/9/sys/i386/i386/pmap.c Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/i386/pmap.c Sat Sep 1 15:59:09 2012 (r239996) @@ -1962,7 +1962,7 @@ pmap_lazyfix_action(void) (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; #endif if (rcr3() == lazyptd) - load_cr3(PCPU_GET(curpcb)->pcb_cr3); + load_cr3(curpcb->pcb_cr3); CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); atomic_store_rel_int(&lazywait, 1); } @@ -1972,7 +1972,7 @@ pmap_lazyfix_self(u_int cpuid) { if (rcr3() == lazyptd) - load_cr3(PCPU_GET(curpcb)->pcb_cr3); + load_cr3(curpcb->pcb_cr3); CPU_CLR_ATOMIC(cpuid, lazymask); } @@ -2039,7 +2039,7 @@ pmap_lazyfix(pmap_t pmap) cr3 = vtophys(pmap->pm_pdir); if (cr3 == rcr3()) { - load_cr3(PCPU_GET(curpcb)->pcb_cr3); + load_cr3(curpcb->pcb_cr3); CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); } } Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/i386/trap.c Sat Sep 1 15:59:09 2012 (r239996) @@ -343,7 +343,7 @@ trap(struct trapframe *frame) if ((ISPL(frame->tf_cs) == SEL_UPL) || ((frame->tf_eflags & PSL_VM) && - !(PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL))) { + !(curpcb->pcb_flags & PCB_VM86CALL))) { /* user trap */ td->td_pticks = 0; @@ -592,7 +592,7 @@ trap(struct trapframe *frame) /* FALL THROUGH */ case T_SEGNPFLT: /* segment not present fault */ - if (PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL) + if (curpcb->pcb_flags & PCB_VM86CALL) break; /* @@ -605,7 +605,7 @@ trap(struct trapframe *frame) * a signal. */ if (frame->tf_eip == (int)cpu_switch_load_gs) { - PCPU_GET(curpcb)->pcb_gs = 0; + curpcb->pcb_gs = 0; #if 0 PROC_LOCK(p); kern_psignal(p, SIGBUS); @@ -643,9 +643,9 @@ trap(struct trapframe *frame) frame->tf_eip = (int)doreti_popl_fs_fault; goto out; } - if (PCPU_GET(curpcb)->pcb_onfault != NULL) { + if (curpcb->pcb_onfault != NULL) { frame->tf_eip = - (int)PCPU_GET(curpcb)->pcb_onfault; + (int)curpcb->pcb_onfault; goto out; } break; @@ -695,7 +695,7 @@ trap(struct trapframe *frame) * debugging the kernel. */ if (user_dbreg_trap() && - !(PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL)) { + !(curpcb->pcb_flags & PCB_VM86CALL)) { /* * Reset breakpoint bits because the * processor doesn't @@ -872,7 +872,7 @@ trap_pfault(frame, usermode, eva) map = &vm->vm_map; if (!usermode && (td->td_intr_nesting_level != 0 || - PCPU_GET(curpcb)->pcb_onfault == NULL)) { + curpcb->pcb_onfault == NULL)) { trap_fatal(frame, eva); return (-1); } @@ -930,8 +930,8 @@ trap_pfault(frame, usermode, eva) nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && - PCPU_GET(curpcb)->pcb_onfault != NULL) { - frame->tf_eip = (int)PCPU_GET(curpcb)->pcb_onfault; + curpcb->pcb_onfault != NULL) { + frame->tf_eip = (int)curpcb->pcb_onfault; return (0); } trap_fatal(frame, eva); Modified: stable/9/sys/i386/i386/vm86.c ============================================================================== --- stable/9/sys/i386/i386/vm86.c Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/i386/vm86.c Sat Sep 1 15:59:09 2012 (r239996) @@ -143,9 +143,9 @@ vm86_emulate(vmf) * the extension is not present. (This check should not be needed, * as we can't enter vm86 mode until we set up an extension area) */ - if (PCPU_GET(curpcb)->pcb_ext == 0) + if (curpcb->pcb_ext == 0) return (SIGBUS); - vm86 = &PCPU_GET(curpcb)->pcb_ext->ext_vm86; + vm86 = &curpcb->pcb_ext->ext_vm86; if (vmf->vmf_eflags & PSL_T) retcode = SIGTRAP; @@ -535,7 +535,7 @@ vm86_prepcall(struct vm86frame *vmf) vmf->kernel_fs = vmf->kernel_es = vmf->kernel_ds = 0; vmf->vmf_eflags = PSL_VIF | PSL_VM | PSL_USER; - vm86 = &PCPU_GET(curpcb)->pcb_ext->ext_vm86; + vm86 = &curpcb->pcb_ext->ext_vm86; if (!vm86->vm86_has_vme) vm86->vm86_eflags = vmf->vmf_eflags; /* save VIF, VIP */ } Modified: stable/9/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/9/sys/i386/i386/vm_machdep.c Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/i386/vm_machdep.c Sat Sep 1 15:59:09 2012 (r239996) @@ -106,6 +106,10 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif +CTASSERT((struct thread **)OFFSETOF_CURTHREAD == + &((struct pcpu *)NULL)->pc_curthread); +CTASSERT((struct pcb **)OFFSETOF_CURPCB == &((struct pcpu *)NULL)->pc_curpcb); + static void cpu_reset_real(void); #ifdef SMP static void cpu_reset_proxy(void); Modified: stable/9/sys/i386/include/pcpu.h ============================================================================== --- stable/9/sys/i386/include/pcpu.h Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/include/pcpu.h Sat Sep 1 15:59:09 2012 (r239996) @@ -236,16 +236,36 @@ extern struct pcpu *pcpup; #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) +#define OFFSETOF_CURTHREAD 0 +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnull-dereference" +#endif static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm("movl %%fs:0,%0" : "=r" (td)); + __asm("movl %%fs:%1,%0" : "=r" (td) + : "m" (*(char *)OFFSETOF_CURTHREAD)); return (td); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif #define curthread (__curthread()) +#define OFFSETOF_CURPCB 16 +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + + __asm("movl %%fs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + return (pcb); +} +#define curpcb (__curpcb()) + #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" Modified: stable/9/sys/i386/isa/npx.c ============================================================================== --- stable/9/sys/i386/isa/npx.c Sat Sep 1 15:57:12 2012 (r239995) +++ stable/9/sys/i386/isa/npx.c Sat Sep 1 15:59:09 2012 (r239996) @@ -378,7 +378,7 @@ npxexit(td) critical_enter(); if (curthread == PCPU_GET(fpcurthread)) - npxsave(PCPU_GET(curpcb)->pcb_save); + npxsave(curpcb->pcb_save); critical_exit(); #ifdef NPX_DEBUG if (hw_float) { @@ -663,7 +663,6 @@ static int err_count = 0; int npxdna(void) { - struct pcb *pcb; if (!hw_float) return (0); @@ -687,25 +686,24 @@ npxdna(void) * Record new context early in case frstor causes an IRQ13. */ PCPU_SET(fpcurthread, curthread); - pcb = PCPU_GET(curpcb); #ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpu_clean_state(); #endif - if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { + if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly * load an initial state. */ fpurstor(&npx_initialstate); - if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) - fldcw(pcb->pcb_initial_npxcw); - pcb->pcb_flags |= PCB_NPXINITDONE; - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_NPXUSERINITDONE; + if (curpcb->pcb_initial_npxcw != __INITIAL_NPXCW__) + fldcw(curpcb->pcb_initial_npxcw); + curpcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(curpcb)) + curpcb->pcb_flags |= PCB_NPXUSERINITDONE; } else { /* * The following fpurstor() may cause an IRQ13 when the @@ -721,7 +719,7 @@ npxdna(void) * fnclex if it is the first FPU instruction after a context * switch. */ - fpurstor(pcb->pcb_save); + fpurstor(curpcb->pcb_save); } critical_exit(); @@ -1099,13 +1097,14 @@ fpu_kern_thread(u_int flags) { struct pcb *pcb; - pcb = PCPU_GET(curpcb); + pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); - KASSERT(pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save")); - KASSERT(PCB_USER_FPU(pcb), ("recursive call")); + KASSERT(curpcb->pcb_save == &curpcb->pcb_user_save, + ("mangled pcb_save")); + KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - pcb->pcb_flags |= PCB_KERNNPX; + curpcb->pcb_flags |= PCB_KERNNPX; return (0); } @@ -1115,5 +1114,5 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((PCPU_GET(curpcb)->pcb_flags & PCB_KERNNPX) != 0); + return ((curpcb->pcb_flags & PCB_KERNNPX) != 0); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 1 23:33:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04828106566B; Sat, 1 Sep 2012 23:33:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2D168FC0A; Sat, 1 Sep 2012 23:33:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q81NXnTH099698; Sat, 1 Sep 2012 23:33:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81NXnas099696; Sat, 1 Sep 2012 23:33:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209012333.q81NXnas099696@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Sep 2012 23:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239997 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 23:33:50 -0000 Author: eadler Date: Sat Sep 1 23:33:49 2012 New Revision: 239997 URL: http://svn.freebsd.org/changeset/base/239997 Log: Mark the ipfw interface type as not being ether. This fixes an issue where uuidgen tried to obtain a ipfw device's mac address which was always zero. PR: 170460 Submitted by: wxs Reviewed by: bdrewery Reviewed by: delphij Approved by: cperciva MFC after: 1 week Modified: head/sys/netinet/ipfw/ip_fw_log.c Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Sat Sep 1 15:59:09 2012 (r239996) +++ head/sys/netinet/ipfw/ip_fw_log.c Sat Sep 1 23:33:49 2012 (r239997) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* for IFT_ETHER */ +#include /* for IFT_PFLOG */ #include /* for BPF */ #include @@ -151,7 +151,7 @@ ipfw_log_clone_create(struct if_clone *i if (error) return (error); - ifp = if_alloc(IFT_ETHER); + ifp = if_alloc(IFT_PFLOG); if (ifp == NULL) { ifc_free_unit(ifc, unit); return (ENOSPC);