From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 01:48:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1EDC106566C; Sun, 2 Sep 2012 01:48:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D7578FC15; Sun, 2 Sep 2012 01:48: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 q821mlgL018012; Sun, 2 Sep 2012 01:48:47 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q821ml0M018010; Sun, 2 Sep 2012 01:48:47 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209020148.q821ml0M018010@svn.freebsd.org> From: Andrew Turner Date: Sun, 2 Sep 2012 01:48: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: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 01:48:47 -0000 Author: andrew Date: Sun Sep 2 01:48:47 2012 New Revision: 239998 URL: http://svn.freebsd.org/changeset/base/239998 Log: Fix a logic inversion in an assert to allow us to use dts files that include other files. Modified: head/contrib/dtc/dtc-lexer.l Modified: head/contrib/dtc/dtc-lexer.l ============================================================================== --- head/contrib/dtc/dtc-lexer.l Sat Sep 1 23:33:49 2012 (r239997) +++ head/contrib/dtc/dtc-lexer.l Sun Sep 2 01:48:47 2012 (r239998) @@ -198,7 +198,7 @@ static void push_input_file(const char * { assert(filename); - assert(include_stack_pointer >= MAX_INCLUDE_NESTING); + assert(include_stack_pointer < MAX_INCLUDE_NESTING); srcfile_push(filename); From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 04:39:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00B9106564A; Sun, 2 Sep 2012 04:39:07 +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 A151F8FC0C; Sun, 2 Sep 2012 04:39: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 q824d7Xd038775; Sun, 2 Sep 2012 04:39:07 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q824d7Rg038773; Sun, 2 Sep 2012 04:39:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209020439.q824d7Rg038773@svn.freebsd.org> From: Alan Cox Date: Sun, 2 Sep 2012 04:39: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: r240000 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 04:39:07 -0000 Author: alc Date: Sun Sep 2 04:39:07 2012 New Revision: 240000 URL: http://svn.freebsd.org/changeset/base/240000 Log: Calculate the new PTE value in pmap_enter() before acquiring any locks. Move an assertion to the beginning of pmap_enter(). Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sun Sep 2 03:36:57 2012 (r239999) +++ head/sys/mips/mips/pmap.c Sun Sep 2 04:39:07 2012 (r240000) @@ -1969,14 +1969,24 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pt_entry_t origpte, newpte; pv_entry_t pv; vm_page_t mpte, om; - pt_entry_t rw; va &= ~PAGE_MASK; KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); + KASSERT((m->oflags & VPO_UNMANAGED) != 0 || va < kmi.clean_sva || + va >= kmi.clean_eva, + ("pmap_enter: managed mapping within the clean submap")); 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; + newpte = TLBLO_PA_TO_PFN(pa) | init_pte_prot(m, access, prot); + if (wired) + newpte |= PTE_W; + if (is_kernel_pmap(pmap)) + newpte |= PTE_G; + if (is_cacheable_mem(pa)) + newpte |= PTE_C_CACHE; + else + newpte |= PTE_C_UNCACHED; mpte = NULL; @@ -2031,6 +2041,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pte_test(&origpte, PTE_MANAGED)) { om = m; newpte |= PTE_MANAGED; + if (!pte_test(&newpte, PTE_RO)) + vm_page_aflag_set(m, PGA_WRITEABLE); } goto validate; } @@ -2059,18 +2071,16 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.resident_count++; /* - * Enter on the PV list if part of our managed memory. Note that we - * raise IPL while manipulating pv_table since pmap_enter can be - * called at interrupt time. + * Enter on the PV list if part of our managed memory. */ if ((m->oflags & VPO_UNMANAGED) == 0) { - KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, - ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); newpte |= PTE_MANAGED; + if (!pte_test(&newpte, PTE_RO)) + vm_page_aflag_set(m, PGA_WRITEABLE); } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -2083,26 +2093,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, validate: if ((access & VM_PROT_WRITE) != 0) m->md.pv_flags |= PV_TABLE_REF; - rw = init_pte_prot(m, access, prot); #ifdef PMAP_DEBUG printf("pmap_enter: va: %p -> pa: %p\n", (void *)va, (void *)pa); #endif - /* - * Now validate mapping with desired protection/wiring. - */ - newpte |= rw; - - if (is_cacheable_mem(pa)) - newpte |= PTE_C_CACHE; - else - newpte |= PTE_C_UNCACHED; - - if (wired) - newpte |= PTE_W; - - if (is_kernel_pmap(pmap)) - newpte |= PTE_G; /* * if the mapping or permission bits are different, we need to @@ -3248,7 +3242,6 @@ init_pte_prot(vm_page_t m, vm_prot_t acc rw = PTE_V | PTE_D; else rw = PTE_V; - vm_page_aflag_set(m, PGA_WRITEABLE); } else /* Needn't emulate a modified bit for unmanaged pages. */ rw = PTE_V | PTE_D; From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 04:56:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 732CE106566C; Sun, 2 Sep 2012 04:56:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44AFC8FC0A; Sun, 2 Sep 2012 04:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q824uT5T041042; Sun, 2 Sep 2012 04:56:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q824uTdv041040; Sun, 2 Sep 2012 04:56:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209020456.q824uTdv041040@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Sep 2012 04:56: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: r240001 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 04:56:30 -0000 Author: adrian Date: Sun Sep 2 04:56:29 2012 New Revision: 240001 URL: http://svn.freebsd.org/changeset/base/240001 Log: AR5212 radar pulse fixes. Fix the strong signal diversity capability setting - I had totally messed up the indentation. Set the default values to match what's in the .ini for now, rather than what values I had previously gleaned from places. This seems to work quite well for the early AR5212 NICs I have. Of course, later NICs have different PHYs and the radar configuration is very card/board dependent.. Tested: * ath1: AR5212 mac 5.3 RF5111 phy 4.1 ath1: 2GHz radio: 0x0023; 5GHz radio: 0x0017 This detects 1, 5, 25, 50, 75, 100uS pulses reliably (with no interference.) However, 10uS pulses don't detect reliably. That may be around the transition between short and long pulses so some further tuning may improve things. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Sun Sep 2 04:39:07 2012 (r240000) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Sun Sep 2 04:56:29 2012 (r240001) @@ -960,13 +960,13 @@ ar5212SetCapability(struct ath_hal *ah, 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); + 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; @@ -1243,11 +1243,11 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ /* * Parameters for the AR5212 PHY. */ -#define AR5212_DFS_FIRPWR -41 -#define AR5212_DFS_RRSSI 12 -#define AR5212_DFS_HEIGHT 20 -#define AR5212_DFS_PRSSI 22 -#define AR5212_DFS_INBAND 6 +#define AR5212_DFS_FIRPWR -35 +#define AR5212_DFS_RRSSI 20 +#define AR5212_DFS_HEIGHT 14 +#define AR5212_DFS_PRSSI 6 +#define AR5212_DFS_INBAND 4 /* * Default parameters for the AR5413 PHY. @@ -1261,7 +1261,6 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ #define AR5413_DFS_RELSTEP 31 #define AR5413_DFS_MAXLEN 255 - HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 05:01:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8917106564A; Sun, 2 Sep 2012 05:01:10 +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 D42168FC0C; Sun, 2 Sep 2012 05:01: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 q8251A17041650; Sun, 2 Sep 2012 05:01:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8251ARi041648; Sun, 2 Sep 2012 05:01:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209020501.q8251ARi041648@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Sep 2012 05:01: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: r240002 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 05:01:11 -0000 Author: adrian Date: Sun Sep 2 05:01:10 2012 New Revision: 240002 URL: http://svn.freebsd.org/changeset/base/240002 Log: Disable strong signal diversity when enabling radar pulse detection for the AR5212 era NICs. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Sun Sep 2 04:56:29 2012 (r240001) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Sun Sep 2 05:01:10 2012 (r240002) @@ -132,6 +132,13 @@ ath_dfs_radar_enable(struct ath_softc *s ath_hal_enabledfs(sc->sc_ah, &pe); + /* + * Disable strong signal fast diversity - needed for + * AR5212 and similar PHYs for reliable short pulse + * duration. + */ + (void) ath_hal_setcapability(sc->sc_ah, HAL_CAP_DIVERSITY, 2, 0, NULL); + return (1); #else return (0); From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 07:07:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id CFC4F106564A; Sun, 2 Sep 2012 07:07:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A55F614DED5; Sun, 2 Sep 2012 07:07:22 +0000 (UTC) Message-ID: <504305AA.3060902@FreeBSD.org> Date: Sun, 02 Sep 2012 00:07:22 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120728 Thunderbird/14.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= References: <201208302256.q7UMuWE7027494@svn.freebsd.org> <504005E1.7040602@FreeBSD.org> <868vcuzprb.fsf@ds4.des.no> In-Reply-To: <868vcuzprb.fsf@ds4.des.no> X-Enigmail-Version: 1.4.3 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 07:07:22 -0000 On 08/31/2012 14:59, Dag-Erling Smørgrav wrote: > Doug Barton writes: >> Dag-Erling Smørgrav writes: >>> - \*\*\*\ Error*) >>> + \*\*\**) >> Are you sure that the double ** is necessary here? > > Yes, error messages generally include text in addition to the initial > three asterisks. D'oh. Misread the diff, sorry. -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 07:29:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41A83106564A; Sun, 2 Sep 2012 07:29:38 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0AB8FC0A; Sun, 2 Sep 2012 07:29: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 q827TcdK059838; Sun, 2 Sep 2012 07:29:38 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q827Tb6s059835; Sun, 2 Sep 2012 07:29:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209020729.q827Tb6s059835@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 2 Sep 2012 07:29: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: r240003 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 07:29:38 -0000 Author: trociny Date: Sun Sep 2 07:29:37 2012 New Revision: 240003 URL: http://svn.freebsd.org/changeset/base/240003 Log: In soreceive_generic() when checking if the type of mbuf has changed check it for MT_CONTROL type too, otherwise the assertion "m->m_type == MT_DATA" below may be triggered by the following scenario: - the sender sends some data (MT_DATA) and then a file descriptor (MT_CONTROL); - the receiver calls recv(2) with a MSG_WAITALL asking for data larger than the receive buffer (uio_resid > hiwat). MFC after: 2 week Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Sep 2 05:01:10 2012 (r240002) +++ head/sys/kern/uipc_socket.c Sun Sep 2 07:29:37 2012 (r240003) @@ -1695,8 +1695,8 @@ dontblock: * examined ('type'), end the receive operation. */ SOCKBUF_LOCK_ASSERT(&so->so_rcv); - if (m->m_type == MT_OOBDATA) { - if (type != MT_OOBDATA) + if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) { + if (type != m->m_type) break; } else if (type == MT_OOBDATA) break; From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 07:33:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8328106566C; Sun, 2 Sep 2012 07:33:52 +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 9A4978FC19; Sun, 2 Sep 2012 07:33: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 q827Xqdl060454; Sun, 2 Sep 2012 07:33:52 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q827Xq3e060452; Sun, 2 Sep 2012 07:33:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209020733.q827Xq3e060452@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 2 Sep 2012 07:33: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: r240004 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 07:33:52 -0000 Author: trociny Date: Sun Sep 2 07:33:52 2012 New Revision: 240004 URL: http://svn.freebsd.org/changeset/base/240004 Log: In soreceive_generic() remove the optimization for the case when MSG_WAITALL is set, and it is possible to do the entire receive operation at once if we block (resid <= hiwat). Actually it might make the recv(2) with MSG_WAITALL flag get stuck when there is enough space in the receiver buffer to satisfy the request but not enough to open the window closed previously due to the buffer being full. The issue can be reproduced using the following scenario: On the sender side do 2 send(2) requests: 1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10); 2) data of size equal to SOBUF_SIZE. On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set: 1) recv() data of SOBUF_SIZE / 10 size; 2) recv() data of SOBUF_SIZE size; We totally fill the receiver buffer with one SOBUF_SIZE/10 size request and partial SOBUF_SIZE request. When the first request is processed we get SOBUF_SIZE/10 free space. It is just enough to receive the rest of bytes for the second request, and soreceive_generic() blocks in the part that is a subject of this change waiting for the rest. But the window was closed when the buffer was filled and to avoid silly window syndrome it opens only when available space is larger than sb_hiwat/4 or maxseg. So it is stuck and pending data is only sent via TCP window probes. Discussed with: kib (long ago) MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Sep 2 07:29:37 2012 (r240003) +++ head/sys/kern/uipc_socket.c Sun Sep 2 07:33:52 2012 (r240004) @@ -1496,17 +1496,11 @@ restart: * If we have less data than requested, block awaiting more (subject * to any timeout) if: * 1. the current count is less than the low water mark, or - * 2. MSG_WAITALL is set, and it is possible to do the entire - * receive operation at once if we block (resid <= hiwat). - * 3. MSG_DONTWAIT is not set - * If MSG_WAITALL is set but resid is larger than the receive buffer, - * we have to do the receive in sections, and thus risk returning a - * short count if a timeout or signal occurs after we start. + * 2. MSG_DONTWAIT is not set */ if (m == NULL || (((flags & MSG_DONTWAIT) == 0 && so->so_rcv.sb_cc < uio->uio_resid) && - (so->so_rcv.sb_cc < so->so_rcv.sb_lowat || - ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) && + so->so_rcv.sb_cc < so->so_rcv.sb_lowat && m->m_nextpkt == NULL && (pr->pr_flags & PR_ATOMIC) == 0)) { KASSERT(m != NULL || !so->so_rcv.sb_cc, ("receive: m == %p so->so_rcv.sb_cc == %u", From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 11:03:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7761106564A; Sun, 2 Sep 2012 11:03:19 +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 846978FC15; Sun, 2 Sep 2012 11:03: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 q82B3Jrk089688; Sun, 2 Sep 2012 11:03:19 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82B3JT6089683; Sun, 2 Sep 2012 11:03:19 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209021103.q82B3JT6089683@svn.freebsd.org> From: Andrey Zonov Date: Sun, 2 Sep 2012 11:03: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: r240005 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 11:03:20 -0000 Author: zont Date: Sun Sep 2 11:03:18 2012 New Revision: 240005 URL: http://svn.freebsd.org/changeset/base/240005 Log: - Style(9) cleanup. Approved by: kib (mentor) Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/ia64-fbsd.c head/usr.bin/truss/main.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/setup.c head/usr.bin/truss/sparc64-fbsd.c head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Sun Sep 2 07:33:52 2012 (r240004) +++ head/usr.bin/truss/amd64-fbsd.c Sun Sep 2 11:03:18 2012 (r240005) @@ -88,18 +88,19 @@ static struct freebsd_syscall { /* Clear up and free parts of the fsc structure. */ static __inline void -clear_fsc(void) { - if (fsc.args) { - free(fsc.args); - } - if (fsc.s_args) { - int i; - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); - } - memset(&fsc, 0, sizeof(fsc)); +clear_fsc(void) +{ + int i; + + if (fsc.args) + free(fsc.args); + if (fsc.s_args) { + for (i = 0; i < fsc.nargs; i++) + if (fsc.s_args[i]) + free(fsc.s_args[i]); + free(fsc.s_args); + } + memset(&fsc, 0, sizeof(fsc)); } /* @@ -110,147 +111,145 @@ clear_fsc(void) { */ void -amd64_syscall_entry(struct trussinfo *trussinfo, int nargs) { - struct reg regs; - int syscall_num; - int i, reg; - struct syscall *sc; - - cpid = trussinfo->curthread->tid; - - clear_fsc(); - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) - { - fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); - return; - } - - /* - * FreeBSD has two special kinds of system call redirctions -- - * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basically; the latter is for quad-aligned arguments. - */ - reg = 0; - syscall_num = regs.r_rax; - switch (syscall_num) { - case SYS_syscall: - case SYS___syscall: - syscall_num = regs.r_rdi; - reg++; - break; - } - - fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; - if (!fsc.name) { - fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); - } - - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) - && ((!strcmp(fsc.name, "fork") - || !strcmp(fsc.name, "rfork") - || !strcmp(fsc.name, "vfork")))) - { - trussinfo->curthread->in_fork = 1; - } - - if (nargs == 0) - return; - - fsc.args = malloc((1+nargs) * sizeof(unsigned long)); - for (i = 0; i < nargs && reg < 6; i++, reg++) { - switch (reg) { - case 0: fsc.args[i] = regs.r_rdi; break; - case 1: fsc.args[i] = regs.r_rsi; break; - case 2: fsc.args[i] = regs.r_rdx; break; - case 3: fsc.args[i] = regs.r_rcx; break; - case 4: fsc.args[i] = regs.r_r8; break; - case 5: fsc.args[i] = regs.r_r9; break; - } - } - if (nargs > i) { - struct ptrace_io_desc iorequest; - iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (void *)(regs.r_rsp + sizeof(register_t)); - iorequest.piod_addr = &fsc.args[i]; - iorequest.piod_len = (nargs - i) * sizeof(register_t); - ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); - if (iorequest.piod_len == 0) - return; - } - - sc = get_syscall(fsc.name); - if (sc) { - fsc.nargs = sc->nargs; - } else { +amd64_syscall_entry(struct trussinfo *trussinfo, int nargs) +{ + struct ptrace_io_desc iorequest; + struct reg regs; + struct syscall *sc; + int i, reg, syscall_num; + + clear_fsc(); + + cpid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return; + } + + /* + * FreeBSD has two special kinds of system call redirctions -- + * SYS_syscall, and SYS___syscall. The former is the old syscall() + * routine, basically; the latter is for quad-aligned arguments. + */ + reg = 0; + syscall_num = regs.r_rax; + switch (syscall_num) { + case SYS_syscall: + case SYS___syscall: + syscall_num = regs.r_rdi; + reg++; + break; + } + + fsc.number = syscall_num; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + NULL : syscallnames[syscall_num]; + if (!fsc.name) { + fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", + syscall_num); + } + + if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc.name, "fork") == 0 || + strcmp(fsc.name, "rfork") == 0|| + strcmp(fsc.name, "vfork") == 0)) + trussinfo->curthread->in_fork = 1; + + if (nargs == 0) + return; + + fsc.args = malloc((1 + nargs) * sizeof(unsigned long)); + for (i = 0; i < nargs && reg < 6; i++, reg++) { + switch (reg) { + case 0: fsc.args[i] = regs.r_rdi; break; + case 1: fsc.args[i] = regs.r_rsi; break; + case 2: fsc.args[i] = regs.r_rdx; break; + case 3: fsc.args[i] = regs.r_rcx; break; + case 4: fsc.args[i] = regs.r_r8; break; + case 5: fsc.args[i] = regs.r_r9; break; + } + } + if (nargs > i) { + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)(regs.r_rsp + sizeof(register_t)); + iorequest.piod_addr = &fsc.args[i]; + iorequest.piod_len = (nargs - i) * sizeof(register_t); + ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + if (iorequest.piod_len == 0) + return; + } + + sc = get_syscall(fsc.name); + if (sc) + fsc.nargs = sc->nargs; + else { #if DEBUG - fprintf(trussinfo->outfile, "unknown syscall %s -- setting args to %d\n", - fsc.name, nargs); + fprintf(trussinfo->outfile, "unknown syscall %s -- setting " + "args to %d\n", fsc.name, nargs); #endif - fsc.nargs = nargs; - } - - fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*)); - fsc.sc = sc; + fsc.nargs = nargs; + } - /* - * At this point, we set up the system call arguments. - * We ignore any OUT ones, however -- those are arguments that - * are set by the system call, and so are probably meaningless - * now. This doesn't currently support arguments that are - * passed in *and* out, however. - */ + fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); + fsc.sc = sc; - if (fsc.name) { + /* + * At this point, we set up the system call arguments. + * We ignore any OUT ones, however -- those are arguments that + * are set by the system call, and so are probably meaningless + * now. This doesn't currently support arguments that are + * passed in *and* out, however. + */ + if (fsc.name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc.name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc.nargs; i++) { #if DEBUG - fprintf(stderr, "0x%lx%s", - sc - ? fsc.args[sc->args[i].offset] - : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fprintf(stderr, "0x%lx%s", sc ? + fsc.args[sc->args[i].offset] : fsc.args[i], + i < (fsc.nargs - 1) ? "," : ""); #endif - if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], fsc.args, 0, trussinfo); - } - } + if (sc && !(sc->args[i].type & OUT)) { + fsc.s_args[i] = print_arg(&sc->args[i], + fsc.args, 0, trussinfo); + } + } #if DEBUG - fprintf(stderr, ")\n"); + fprintf(stderr, ")\n"); #endif - } + } #if DEBUG - fprintf(trussinfo->outfile, "\n"); + fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && - (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { + if (fsc.name != NULL && (strcmp(fsc.name, "execve") == 0 || + strcmp(fsc.name, "exit") == 0)) { + /* + * XXX + * This could be done in a more general + * manner but it still wouldn't be very pretty. + */ + if (strcmp(fsc.name, "execve") == 0) { + if ((trussinfo->flags & EXECVEARGS) == 0) { + if (fsc.s_args[1]) { + free(fsc.s_args[1]); + fsc.s_args[1] = NULL; + } + } + if ((trussinfo->flags & EXECVEENVS) == 0) { + if (fsc.s_args[2]) { + free(fsc.s_args[2]); + fsc.s_args[2] = NULL; + } + } + } + } - /* XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (!strcmp(fsc.name, "execve")) { - if ((trussinfo->flags & EXECVEARGS) == 0) - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; - } - if ((trussinfo->flags & EXECVEENVS) == 0) - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; - } - } - - } - - return; + return; } /* @@ -263,68 +262,69 @@ amd64_syscall_entry(struct trussinfo *tr long amd64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { - struct reg regs; - long retval; - int i; - int errorp; - struct syscall *sc; - - if (fsc.name == NULL) - return (-1); - - cpid = trussinfo->curthread->tid; - - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) - { - fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); - return (-1); - } - retval = regs.r_rax; - errorp = !!(regs.r_rflags & PSL_C); - - /* - * This code, while simpler than the initial versions I used, could - * stand some significant cleaning. - */ - - sc = fsc.sc; - if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); - } else { - /* - * Here, we only look for arguments that have OUT masked in -- - * otherwise, they were handled in the syscall_entry function. - */ - for (i = 0; i < sc->nargs; i++) { - char *temp; - if (sc->args[i].type & OUT) { + struct reg regs; + struct syscall *sc; + long retval; + int errorp, i; + + if (fsc.name == NULL) + return (-1); + + cpid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return (-1); + } + + retval = regs.r_rax; + errorp = !!(regs.r_rflags & PSL_C); + /* - * If an error occurred, than don't bothe getting the data; - * it may not be valid. + * This code, while simpler than the initial versions I used, could + * stand some significant cleaning. */ - if (errorp) - asprintf(&temp, "0x%lx", fsc.args[sc->args[i].offset]); - else - temp = print_arg(&sc->args[i], fsc.args, retval, trussinfo); - fsc.s_args[i] = temp; - } - } - } - - if (fsc.name != NULL && - (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { - trussinfo->curthread->in_syscall = 1; - } - - /* - * It would probably be a good idea to merge the error handling, - * but that complicates things considerably. - */ - - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - retval, fsc.sc); - clear_fsc(); - return (retval); + sc = fsc.sc; + if (!sc) { + for (i = 0; i < fsc.nargs; i++) + asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + } else { + /* + * Here, we only look for arguments that have OUT masked in -- + * otherwise, they were handled in the syscall_entry function. + */ + for (i = 0; i < sc->nargs; i++) { + char *temp; + if (sc->args[i].type & OUT) { + /* + * If an error occurred, then don't bother + * getting the data; it may not be valid. + */ + if (errorp) { + asprintf(&temp, "0x%lx", + fsc.args[sc->args[i].offset]); + } else { + temp = print_arg(&sc->args[i], + fsc.args, retval, trussinfo); + } + fsc.s_args[i] = temp; + } + } + } + + if (fsc.name != NULL && (strcmp(fsc.name, "execve") == 0 || + strcmp(fsc.name, "exit") == 0)) + trussinfo->curthread->in_syscall = 1; + + /* + * It would probably be a good idea to merge the error handling, + * but that complicates things considerably. + */ + + print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, + retval, fsc.sc); + clear_fsc(); + + return (retval); } Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Sun Sep 2 07:33:52 2012 (r240004) +++ head/usr.bin/truss/amd64-fbsd32.c Sun Sep 2 11:03:18 2012 (r240005) @@ -43,8 +43,8 @@ static const char rcsid[] = */ #include -#include #include +#include #include #include @@ -90,21 +90,21 @@ static struct freebsd32_syscall { /* Clear up and free parts of the fsc structure. */ static __inline void -clear_fsc(void) { - if (fsc.args) { - free(fsc.args); - } - if (fsc.args32) { - free(fsc.args32); - } - if (fsc.s_args) { - int i; - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); - } - memset(&fsc, 0, sizeof(fsc)); +clear_fsc(void) +{ + int i; + + if (fsc.args) + free(fsc.args); + if (fsc.args32) + free(fsc.args32); + if (fsc.s_args) { + for (i = 0; i < fsc.nargs; i++) + if (fsc.s_args[i]) + free(fsc.s_args[i]); + free(fsc.s_args); + } + memset(&fsc, 0, sizeof(fsc)); } /* @@ -115,145 +115,143 @@ clear_fsc(void) { */ void -amd64_fbsd32_syscall_entry(struct trussinfo *trussinfo, int nargs) { - struct reg regs; - int syscall_num; - int i; - unsigned long parm_offset; - struct syscall *sc = NULL; - struct ptrace_io_desc iorequest; - cpid = trussinfo->curthread->tid; - - clear_fsc(); - - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) - { - fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); - return; - } - parm_offset = regs.r_rsp + sizeof(int); - - /* - * FreeBSD has two special kinds of system call redirctions -- - * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basically; the latter is for quad-aligned arguments. - */ - syscall_num = regs.r_rax; - switch (syscall_num) { - case SYS_syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); - parm_offset += sizeof(int); - break; - case SYS___syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); - parm_offset += sizeof(quad_t); - break; - } - - fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : - freebsd32_syscallnames[syscall_num]; - if (!fsc.name) { - fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); - } - - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) - && ((!strcmp(fsc.name, "fork") - || !strcmp(fsc.name, "rfork") - || !strcmp(fsc.name, "vfork")))) - { - trussinfo->curthread->in_fork = 1; - } - - if (nargs == 0) - return; - - fsc.args32 = malloc((1+nargs) * sizeof(unsigned int)); - iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (void *)parm_offset; - iorequest.piod_addr = fsc.args32; - iorequest.piod_len = (1+nargs) * sizeof(unsigned int); - ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); - if (iorequest.piod_len == 0) - return; - - fsc.args = malloc((1+nargs) * sizeof(unsigned long)); - for (i = 0; i < nargs + 1; i++) - fsc.args[i] = fsc.args32[i]; - - if (fsc.name) - sc = get_syscall(fsc.name); - if (sc) { - fsc.nargs = sc->nargs; - } else { +amd64_fbsd32_syscall_entry(struct trussinfo *trussinfo, int nargs) +{ + struct ptrace_io_desc iorequest; + struct reg regs; + struct syscall *sc; + unsigned long parm_offset; + int i, syscall_num; + + clear_fsc(); + + cpid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return; + } + parm_offset = regs.r_rsp + sizeof(int); + + /* + * FreeBSD has two special kinds of system call redirctions -- + * SYS_syscall, and SYS___syscall. The former is the old syscall() + * routine, basically; the latter is for quad-aligned arguments. + */ + syscall_num = regs.r_rax; + switch (syscall_num) { + case SYS_syscall: + syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + parm_offset += sizeof(int); + break; + case SYS___syscall: + syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + parm_offset += sizeof(quad_t); + break; + } + + fsc.number = syscall_num; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + NULL : freebsd32_syscallnames[syscall_num]; + if (!fsc.name) { + fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", + syscall_num); + } + + if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc.name, "fork") == 0 || + strcmp(fsc.name, "rfork") == 0|| + strcmp(fsc.name, "vfork") == 0)) + trussinfo->curthread->in_fork = 1; + + if (nargs == 0) + return; + + fsc.args32 = malloc((1 + nargs) * sizeof(unsigned int)); + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)parm_offset; + iorequest.piod_addr = fsc.args32; + iorequest.piod_len = (1 + nargs) * sizeof(unsigned int); + ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + if (iorequest.piod_len == 0) + return; + + fsc.args = malloc((1 + nargs) * sizeof(unsigned long)); + for (i = 0; i < nargs + 1; i++) + fsc.args[i] = fsc.args32[i]; + + sc = NULL; + if (fsc.name) + sc = get_syscall(fsc.name); + if (sc) + fsc.nargs = sc->nargs; + else { #if DEBUG - fprintf(trussinfo->outfile, "unknown syscall %s -- setting args to %d\n", - fsc.name, nargs); + fprintf(trussinfo->outfile, "unknown syscall %s -- setting " + "args to %d\n", fsc.name, nargs); #endif - fsc.nargs = nargs; - } - - fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*)); - fsc.sc = sc; + fsc.nargs = nargs; + } - /* - * At this point, we set up the system call arguments. - * We ignore any OUT ones, however -- those are arguments that - * are set by the system call, and so are probably meaningless - * now. This doesn't currently support arguments that are - * passed in *and* out, however. - */ + fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); + fsc.sc = sc; - if (fsc.name) { + /* + * At this point, we set up the system call arguments. + * We ignore any OUT ones, however -- those are arguments that + * are set by the system call, and so are probably meaningless + * now. This doesn't currently support arguments that are + * passed in *and* out, however. + */ + if (fsc.name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc.name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc.nargs; i++) { #if DEBUG - fprintf(stderr, "0x%x%s", - sc - ? fsc.args[sc->args[i].offset] - : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fprintf(stderr, "0x%x%s", sc ? + fsc.args[sc->args[i].offset] : fsc.args[i], + i < (fsc.nargs - 1) ? "," : ""); #endif - if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], fsc.args, 0, trussinfo); - } - } + if (sc && !(sc->args[i].type & OUT)) { + fsc.s_args[i] = print_arg(&sc->args[i], + fsc.args, 0, trussinfo); + } + } #if DEBUG - fprintf(stderr, ")\n"); + fprintf(stderr, ")\n"); #endif - } + } #if DEBUG - fprintf(trussinfo->outfile, "\n"); + fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && - (!strcmp(fsc.name, "freebsd32_execve") || !strcmp(fsc.name, "exit"))) { - - /* XXX - * This could be done in a more general - * manner but it still wouldn't be very pretty. - */ - if (!strcmp(fsc.name, "freebsd32_execve")) { - if ((trussinfo->flags & EXECVEARGS) == 0) - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; - } - if ((trussinfo->flags & EXECVEENVS) == 0) - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; - } - } + if (fsc.name != NULL && (strcmp(fsc.name, "freebsd32_execve") == 0|| + strcmp(fsc.name, "exit") == 0)) { + /* + * XXX + * This could be done in a more general + * manner but it still wouldn't be very pretty. + */ + if (strcmp(fsc.name, "freebsd32_execve") == 0) { + if ((trussinfo->flags & EXECVEARGS) == 0) { + if (fsc.s_args[1]) { + free(fsc.s_args[1]); + fsc.s_args[1] = NULL; + } + } + if ((trussinfo->flags & EXECVEENVS) == 0) { + if (fsc.s_args[2]) { + free(fsc.s_args[2]); + fsc.s_args[2] = NULL; + } + } + } + } - } - - return; + return; } /* @@ -266,68 +264,69 @@ amd64_fbsd32_syscall_entry(struct trussi long amd64_fbsd32_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { - struct reg regs; - long retval; - int i; - int errorp; - struct syscall *sc; - - if (fsc.name == NULL) - return (-1); - cpid = trussinfo->curthread->tid; - - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) - { - fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); - return (-1); - } - - retval = regs.r_rax; - errorp = !!(regs.r_rflags & PSL_C); - - /* - * This code, while simpler than the initial versions I used, could - * stand some significant cleaning. - */ - - sc = fsc.sc; - if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); - } else { - /* - * Here, we only look for arguments that have OUT masked in -- - * otherwise, they were handled in the syscall_entry function. - */ - for (i = 0; i < sc->nargs; i++) { - char *temp; - if (sc->args[i].type & OUT) { + struct reg regs; + struct syscall *sc; + long retval; + int errorp, i; + + if (fsc.name == NULL) + return (-1); + + cpid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return (-1); + } + + retval = regs.r_rax; + errorp = !!(regs.r_rflags & PSL_C); + /* - * If an error occurred, then don't bother getting the data; - * it may not be valid. + * This code, while simpler than the initial versions I used, could + * stand some significant cleaning. */ - if (errorp) - asprintf(&temp, "0x%lx", fsc.args[sc->args[i].offset]); - else - temp = print_arg(&sc->args[i], fsc.args, retval, trussinfo); - fsc.s_args[i] = temp; - } - } - } - - if (fsc.name != NULL && - (!strcmp(fsc.name, "freebsd32_execve") || !strcmp(fsc.name, "exit"))) { - trussinfo->curthread->in_syscall = 1; - } - - /* - * It would probably be a good idea to merge the error handling, - * but that complicates things considerably. - */ - - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - retval, fsc.sc); - clear_fsc(); - return (retval); + sc = fsc.sc; + if (!sc) { + for (i = 0; i < fsc.nargs; i++) + asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + } else { + /* + * Here, we only look for arguments that have OUT masked in -- + * otherwise, they were handled in the syscall_entry function. + */ + for (i = 0; i < sc->nargs; i++) { + char *temp; + if (sc->args[i].type & OUT) { + /* + * If an error occurred, then don't bother + * getting the data; it may not be valid. + */ + if (errorp) { + asprintf(&temp, "0x%lx", + fsc.args[sc->args[i].offset]); + } else { + temp = print_arg(&sc->args[i], + fsc.args, retval, trussinfo); + } + fsc.s_args[i] = temp; + } + } + } + + if (fsc.name != NULL && (strcmp(fsc.name, "freebsd32_execve") == 0 || + strcmp(fsc.name, "exit") == 0)) + trussinfo->curthread->in_syscall = 1; + + /* + * It would probably be a good idea to merge the error handling, + * but that complicates things considerably. + */ + + print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, + retval, fsc.sc); + clear_fsc(); + + return (retval); } Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Sun Sep 2 07:33:52 2012 (r240004) +++ head/usr.bin/truss/amd64-linux32.c Sun Sep 2 11:03:18 2012 (r240005) @@ -86,15 +86,17 @@ static struct linux_syscall { /* Clear up and free parts of the fsc structure. */ static __inline void -clear_fsc(void) { - if (fsc.s_args) { - int i; - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); - } - memset(&fsc, 0, sizeof(fsc)); +clear_fsc(void) +{ + int i; + + if (fsc.s_args) { + for (i = 0; i < fsc.nargs; i++) + if (fsc.s_args[i]) + free(fsc.s_args[i]); + free(fsc.s_args); + } + memset(&fsc, 0, sizeof(fsc)); } /* @@ -105,211 +107,214 @@ clear_fsc(void) { */ void -amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs) { - struct reg regs; - int syscall_num; - int i; - struct syscall *sc; - - cpid = trussinfo->curthread->tid; - - clear_fsc(); - - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) - { - fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); - return; - } - syscall_num = regs.r_rax; - - fsc.number = syscall_num; - fsc.name = - (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; - if (!fsc.name) { - fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); - } - - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) - && ((!strcmp(fsc.name, "linux_fork") - || !strcmp(fsc.name, "linux_vfork")))) - { - trussinfo->curthread->in_fork = 1; - } - - if (nargs == 0) - return; - - /* - * Linux passes syscall arguments in registers, not - * on the stack. Fortunately, we've got access to the - * register set. Note that we don't bother checking the - * number of arguments. And what does linux do for syscalls - * that have more than five arguments? - */ - - fsc.args[0] = regs.r_rbx; - fsc.args[1] = regs.r_rcx; - fsc.args[2] = regs.r_rdx; - fsc.args[3] = regs.r_rsi; - fsc.args[4] = regs.r_rdi; - - sc = get_syscall(fsc.name); - if (sc) { - fsc.nargs = sc->nargs; - } else { +amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs) +{ + struct reg regs; + struct syscall *sc; + int i, syscall_num; + + clear_fsc(); + + cpid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return; + } + + syscall_num = regs.r_rax; + + fsc.number = syscall_num; + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + NULL : linux32_syscallnames[syscall_num]; + if (!fsc.name) { + fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", + syscall_num); + } + + if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc.name, "linux_fork") == 0|| + strcmp(fsc.name, "linux_vfork") == 0)) + trussinfo->curthread->in_fork = 1; + + if (nargs == 0) + return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 12:37:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD31106566B; Sun, 2 Sep 2012 12:37:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0F488FC0C; Sun, 2 Sep 2012 12:37: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 q82CbURI002556; Sun, 2 Sep 2012 12:37:30 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82CbUJB002554; Sun, 2 Sep 2012 12:37:30 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209021237.q82CbUJB002554@svn.freebsd.org> From: Michael Tuexen Date: Sun, 2 Sep 2012 12:37: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: r240007 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 12:37:31 -0000 Author: tuexen Date: Sun Sep 2 12:37:30 2012 New Revision: 240007 URL: http://svn.freebsd.org/changeset/base/240007 Log: Fix a typo which results in RTT to be off by a factor of 10, if the RTT is larger than 1 second. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Sep 2 11:44:30 2012 (r240006) +++ head/sys/netinet/sctputil.c Sun Sep 2 12:37:30 2012 (r240007) @@ -2384,7 +2384,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb } timevalsub(&now, old); /* store the current RTT in us */ - net->rtt = (uint64_t) 10000000 *(uint64_t) now.tv_sec + + net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + (uint64_t) now.tv_usec; /* computer rtt in ms */ From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 14:35:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEA6C106564A; Sun, 2 Sep 2012 14:35:19 +0000 (UTC) (envelope-from edschouten@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 587E08FC08; Sun, 2 Sep 2012 14:35:18 +0000 (UTC) Received: by obbun3 with SMTP id un3so10440566obb.13 for ; Sun, 02 Sep 2012 07:35:17 -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=VaNhOhGTvkq4A5dnWWZyN+h9ktJhlf/uJHcDrxtGF/Y=; b=NRa+LbwFBxJnz13BvA68oTLcvlfuA9oMl6nDpgaE/sr2hotfnWoay8Wpb0x0QcTE9F UMgoEi29iaD5XnxbYrX0M3a/4Ib5qvrO044NI1vJmWRWMgCh4UI/Qa4MunIdFxbDz8S8 h+sPO5Z5dvd05LAM+QezAQysMjH7fdyWi0hD9n9qw+iGXzJwMPMSzy24Jn/ztyerkyk2 JpVuRyvjY15WShZmnafpbLGNY48SHIZmFA7cp2w8aWakfEE/gC5rf9vXfAj6A93fmYl7 4XoXn3xdBTPxY+EoOl9Ds5T3BR00E9u10rf1gQss3Nbx+MUihbXwUS7+cK0P3GfrfQX3 ZOGA== MIME-Version: 1.0 Received: by 10.60.7.230 with SMTP id m6mr4699758oea.41.1346596517287; Sun, 02 Sep 2012 07:35:17 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.76.1.78 with HTTP; Sun, 2 Sep 2012 07:35:17 -0700 (PDT) In-Reply-To: <201206180734.q5I7YcRv062474@svn.freebsd.org> References: <201206180734.q5I7YcRv062474@svn.freebsd.org> Date: Sun, 2 Sep 2012 16:35:17 +0200 X-Google-Sender-Auth: hMvluQpp3hmmaYdMCpuO_YPd0PQ Message-ID: From: Ed Schouten To: Peter Holm , kib@FreeBSD.org Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237219 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 14:35:20 -0000 Hi Peter, Sorry for replying to this email so late; I moved to Germany in April and I'm still waiting for Deutsche Telekomiker to hook up my internet connection. Fortunately I do have a smartphone with tethering now. All hail German bureaucracy. 2012/6/18 Peter Holm : > In tty_makedev() the following construction: > > dev = make_dev_cred(); > dev->si_drv1 = tp; > > leaves a small window where the newly created device may be opened > and si_drv1 is NULL. > > As this is a vary rare situation, using a lock to close the window > seems overkill. Instead just wait for the assignment of si_drv1. I also thought about this in the past and I guess a lot of drivers in our tree are prone to this issue. I think there's little more we can do here than how you've changed the TTY code, but in my opinion a 'devfs-ng' should solve this by having a two-step creation procedure, similar to, say, fdrop(9). Thanks for fixing this! -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 14:46:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B20F1106567A; Sun, 2 Sep 2012 14:46:19 +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 5F3428FC08; Sun, 2 Sep 2012 14:46: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 q82EkJ7I019418; Sun, 2 Sep 2012 14:46:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82EkJIP019410; Sun, 2 Sep 2012 14:46:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201209021446.q82EkJIP019410@svn.freebsd.org> From: Dimitry Andric Date: Sun, 2 Sep 2012 14:46: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: r240011 - in head/sys: conf gnu/fs/xfs gnu/fs/xfs/FreeBSD modules/xfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 14:46:19 -0000 Author: dim Date: Sun Sep 2 14:46:18 2012 New Revision: 240011 URL: http://svn.freebsd.org/changeset/base/240011 Log: Partially revert r239959, after actually fixing most of the clang warnings in sys/gnu/fs/xfs. The only warnings that still need to be suppressed are those about array bound overruns of flexible array members in xfs_dir2_{block,sf}.c, which are too expensive (in terms of cascading code changes) to fix. MFC after: 1 week X-MFC-With: r239959 Modified: head/sys/conf/files head/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c head/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c head/sys/gnu/fs/xfs/xfs_alloc.c head/sys/gnu/fs/xfs/xfs_vfsops.c head/sys/modules/xfs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/conf/files Sun Sep 2 14:46:18 2012 (r240011) @@ -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} ${NO_WSOMETIMES_UNINITIALIZED} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ + compile-with "${NORMAL_C} -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,7 +3627,7 @@ 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} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/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_block.c optional 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 \ @@ -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} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/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_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} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/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_stats.c optional 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" + 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_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 \ @@ -3727,7 +3727,7 @@ gnu/fs/xfs/FreeBSD/xfs_sysctl.c optional gnu/fs/xfs/FreeBSD/xfs_fs_subr.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_ioctl.c optional xfs \ - compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/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/support/debug.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/support/ktrace.c optional xfs \ Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c Sun Sep 2 14:46:18 2012 (r240011) @@ -1249,7 +1249,6 @@ xfs_ioc_xattr( XFS_AT_NEXTENTS | XFS_AT_PROJID; XVOP_GETATTR(vp, vattr, 0, NULL, error); if (unlikely(error)) { - error = error; break; } @@ -1287,7 +1286,6 @@ xfs_ioc_xattr( if (likely(!error)) __vn_revalidate(vp, vattr); /* update flags */ #endif - error = error; break; } @@ -1296,7 +1294,6 @@ xfs_ioc_xattr( XFS_AT_ANEXTENTS | XFS_AT_PROJID; XVOP_GETATTR(vp, vattr, 0, NULL, error); if (unlikely(error)) { - error = error; break; } @@ -1347,7 +1344,6 @@ xfs_ioc_xattr( if (likely(!error)) __vn_revalidate(vp, vattr); /* update flags */ #endif - error = error; break; } Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_stats.c Sun Sep 2 14:46:18 2012 (r240011) @@ -65,7 +65,7 @@ xfs_read_xfsstats( }; for (i=j=len = 0; i < sizeof(xstats)/sizeof(struct xstats_entry); i++) { - len += sprintf(buffer + len, xstats[i].desc); + len += sprintf(buffer + len, "%s", xstats[i].desc); /* inner loop does each group */ while (j < xstats[i].endpoint) { len += sprintf(buffer + len, " %u", Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c Sun Sep 2 14:46:18 2012 (r240011) @@ -251,7 +251,7 @@ xfs_blkdev_issue_flush( int init_xfs_fs( void ) { - static char message[] = + static const char message[] = XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n"; printf(message); Modified: head/sys/gnu/fs/xfs/xfs_alloc.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_alloc.c Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/gnu/fs/xfs/xfs_alloc.c Sun Sep 2 14:46:18 2012 (r240011) @@ -1479,8 +1479,10 @@ xfs_alloc_ag_vextent_small( /* * Can't allocate from the freelist for some reason. */ - else + else { + fbno = NULLAGBLOCK; flen = 0; + } /* * Can't do the allocation, give up. */ Modified: head/sys/gnu/fs/xfs/xfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_vfsops.c Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/gnu/fs/xfs/xfs_vfsops.c Sun Sep 2 14:46:18 2012 (r240011) @@ -1954,7 +1954,7 @@ xfs_showargs( for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { if (mp->m_flags & xfs_infop->flag) - sbuf_printf(m, xfs_infop->str); + sbuf_printf(m, "%s", xfs_infop->str); } if (mp->m_flags & XFS_MOUNT_IHASHSIZE) Modified: head/sys/modules/xfs/Makefile ============================================================================== --- head/sys/modules/xfs/Makefile Sun Sep 2 14:45:36 2012 (r240010) +++ head/sys/modules/xfs/Makefile Sun Sep 2 14:46:18 2012 (r240011) @@ -84,12 +84,6 @@ 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-head@FreeBSD.ORG Sun Sep 2 17:39:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91BC1106564A; Sun, 2 Sep 2012 17:39:03 +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 643998FC17; Sun, 2 Sep 2012 17:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q82Hd3IT042580; Sun, 2 Sep 2012 17:39:03 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82Hd3CE042578; Sun, 2 Sep 2012 17:39:03 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209021739.q82Hd3CE042578@svn.freebsd.org> From: Andrey Zonov Date: Sun, 2 Sep 2012 17:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 17:39:03 -0000 Author: zont Date: Sun Sep 2 17:39:02 2012 New Revision: 240026 URL: http://svn.freebsd.org/changeset/base/240026 Log: - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz and kern.sgrowsiz sysctls writable. Approved by: kib (mentor) Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Sun Sep 2 15:27:20 2012 (r240025) +++ head/sys/kern/subr_param.c Sun Sep 2 17:39:02 2012 (r240026) @@ -119,18 +119,18 @@ SYSCTL_LONG(_kern, OID_AUTO, maxswzone, "Maximum memory for swap metadata"); SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, "Maximum value of vfs.maxbufspace"); -SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN, &maxtsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxtsiz, 0, "Maximum text size"); -SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN, &dfldsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dfldsiz, 0, "Initial data size limit"); -SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN, &maxdsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxdsiz, 0, "Maximum data size"); -SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN, &dflssiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dflssiz, 0, "Initial stack size limit"); -SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN, &maxssiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxssiz, 0, "Maximum stack size"); -SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, &sgrowsiz, 0, - "Amount to grow stack on a stack fault"); +SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &sgrowsiz, + 0, "Amount to grow stack on a stack fault"); SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest, "A", "Virtual machine guest detected? (none|generic|xen)"); From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 18:14:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE42C106568C; Sun, 2 Sep 2012 18:14:01 +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 BFFB48FC0C; Sun, 2 Sep 2012 18:14: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 q82IE1Nm047270; Sun, 2 Sep 2012 18:14:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82IE1iN047268; Sun, 2 Sep 2012 18:14:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209021814.q82IE1iN047268@svn.freebsd.org> From: Rui Paulo Date: Sun, 2 Sep 2012 18:14: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: r240040 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 18:14:02 -0000 Author: rpaulo Date: Sun Sep 2 18:14:01 2012 New Revision: 240040 URL: http://svn.freebsd.org/changeset/base/240040 Log: Make sure we visit both symbol sections even if one of them doesn't exist. This makes it possible to dtrace some C++ programs like devd. Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Sun Sep 2 18:13:22 2012 (r240039) +++ head/lib/libproc/proc_sym.c Sun Sep 2 18:14:01 2012 (r240040) @@ -254,7 +254,7 @@ proc_addr2sym(struct proc_handle *p, uin */ if ((data = elf_getdata(dynsymscn, NULL)) == NULL) { DPRINTF("ERROR: elf_getdata() failed"); - goto err2; + goto symtab; } i = 0; while (gelf_getsym(data, i++, &sym) != NULL) { @@ -274,11 +274,11 @@ proc_addr2sym(struct proc_handle *p, uin * the function. */ symcopy->st_value = rsym; - error = 0; goto out; } } } +symtab: /* * Iterate over the Symbols Table to find the symbol. * Then look up the string name in STRTAB (.dynstr) @@ -430,18 +430,17 @@ proc_name2sym(struct proc_handle *p, con * Iterate over the Dynamic Symbols table to find the symbol. * Then look up the string name in STRTAB (.dynstr) */ - if ((data = elf_getdata(dynsymscn, NULL)) == NULL) { + if ((data = elf_getdata(dynsymscn, NULL))) { DPRINTF("ERROR: elf_getdata() failed"); - goto err2; - } - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { - s = elf_strptr(e, dynsymstridx, sym.st_name); - if (s && strcmp(s, symbol) == 0) { - memcpy(symcopy, &sym, sizeof(sym)); - symcopy->st_value = map->pr_vaddr + sym.st_value; - error = 0; - goto out; + i = 0; + while (gelf_getsym(data, i++, &sym) != NULL) { + s = elf_strptr(e, dynsymstridx, sym.st_name); + if (s && strcmp(s, symbol) == 0) { + memcpy(symcopy, &sym, sizeof(sym)); + symcopy->st_value = map->pr_vaddr + sym.st_value; + error = 0; + goto out; + } } } /* @@ -450,17 +449,15 @@ proc_name2sym(struct proc_handle *p, con */ if (symtabscn == NULL) goto err2; - if ((data = elf_getdata(symtabscn, NULL)) == NULL) { - DPRINTF("ERROR: elf_getdata() failed"); - goto err2; - } - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { - s = elf_strptr(e, symtabstridx, sym.st_name); - if (s && strcmp(s, symbol) == 0) { - memcpy(symcopy, &sym, sizeof(sym)); - error = 0; - goto out; + if ((data = elf_getdata(symtabscn, NULL))) { + i = 0; + while (gelf_getsym(data, i++, &sym) != NULL) { + s = elf_strptr(e, symtabstridx, sym.st_name); + if (s && strcmp(s, symbol) == 0) { + memcpy(symcopy, &sym, sizeof(sym)); + error = 0; + goto out; + } } } out: From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 19:04:10 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A09D1065676; Sun, 2 Sep 2012 19:04:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9843D8FC0C; Sun, 2 Sep 2012 19:04:08 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA14250; Sun, 02 Sep 2012 22:04:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1T8FSi-000GjY-AU; Sun, 02 Sep 2012 22:04:00 +0300 Message-ID: <5043AD9C.1060508@FreeBSD.org> Date: Sun, 02 Sep 2012 22:03:56 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120728 Thunderbird/14.0 MIME-Version: 1.0 To: Andrey Zonov References: <201209021739.q82Hd3CE042578@svn.freebsd.org> In-Reply-To: <201209021739.q82Hd3CE042578@svn.freebsd.org> X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 19:04:10 -0000 on 02/09/2012 20:39 Andrey Zonov said the following: > CTLFLAG_RDTUN | CTLFLAG_RW This combination looks like nonsense to me (because of "RD"). CTLFLAG_RDTUN Advisory flag that a system tunable also exists for this variable; however, the run-time variable is read-only. Probably you meant CTLFLAG_RW | CTLFLAG_TUN -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 20:22:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5CD106566C for ; Sun, 2 Sep 2012 20:22:14 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF5B8FC12 for ; Sun, 2 Sep 2012 20:22:13 +0000 (UTC) Received: by bkcje9 with SMTP id je9so2282646bkc.13 for ; Sun, 02 Sep 2012 13:22:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=7n660bpXpoeGuJSeZc+c5EYy1Gw0LZvqOXlP80UtU8c=; b=JMJycbel8l8nRB5OQrRz2bCETHN8GKnSgcn7zPhqLxyuCxROnWUijKUletuzswLkgJ MOPmyqZbLY6+16D/+lgh0+4iwB5/fw7cdIesXCqxBNbKfukmkIdKtKR5bJwTudsG5IPO r+T28MPmvH7ByajBhBjcF0X4ZAQZ4VOPQY9uWNYeoF0vXXhmuOtBMJScj8Aym5ogCbcP DSDoBCQVrFvazVMHrGlKoCERt8q73wnKhEkbcU2FjsUeGh0kX+mHfLPBuEDGRG9I2umt ZAeu5CxWB+8+bRyWPqDA6sklTUZ8sK0TDARZdVvzP/GNzqI7khYFc03B8xhF+FQ6qUbv D1OQ== Received: by 10.204.10.92 with SMTP id o28mr6241041bko.39.1346617332168; Sun, 02 Sep 2012 13:22:12 -0700 (PDT) Received: from rnote.ddteam.net (105-190-133-95.pool.ukrtel.net. [95.133.190.105]) by mx.google.com with ESMTPS id hs2sm6546567bkc.1.2012.09.02.13.22.09 (version=SSLv3 cipher=OTHER); Sun, 02 Sep 2012 13:22:11 -0700 (PDT) Date: Sun, 2 Sep 2012 23:22:04 +0300 From: Aleksandr Rybalko To: Andrew Turner Message-Id: <20120902232204.4de5f3a3.ray@ddteam.net> In-Reply-To: <201209020148.q821ml0M018010@svn.freebsd.org> References: <201209020148.q821ml0M018010@svn.freebsd.org> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnQLBtv3kwQGjw2KXcNDyBPyn6MmUyL3O2I7XcPEaEbHG0DnxTMEXOLw2MLgkCm73djQkas Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 20:22:14 -0000 On Sun, 2 Sep 2012 01:48:47 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Sun Sep 2 01:48:47 2012 > New Revision: 239998 > URL: http://svn.freebsd.org/changeset/base/239998 > > Log: > Fix a logic inversion in an assert to allow us to use dts files that > include other files. Big Thanks for that!!! It's hard to add overlapping support also? So second instance of same node will be able to change attributes of previous one, such a "status". Or add new attributes, like GPIO lines usage. Then we will be able to have per-SoC dts and per-board. > > Modified: > head/contrib/dtc/dtc-lexer.l > > Modified: head/contrib/dtc/dtc-lexer.l > ============================================================================== > --- head/contrib/dtc/dtc-lexer.l Sat Sep 1 23:33:49 > 2012 (r239997) +++ head/contrib/dtc/dtc-lexer.l Sun > Sep 2 01:48:47 2012 (r239998) @@ -198,7 +198,7 @@ static void > push_input_file(const char * { > assert(filename); > > - assert(include_stack_pointer >= MAX_INCLUDE_NESTING); > + assert(include_stack_pointer < MAX_INCLUDE_NESTING); > > srcfile_push(filename); > Thanks. WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 20:28:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1931065670 for ; Sun, 2 Sep 2012 20:28:23 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id BC33E8FC1A for ; Sun, 2 Sep 2012 20:28:22 +0000 (UTC) Received: by bkcje9 with SMTP id je9so2283662bkc.13 for ; Sun, 02 Sep 2012 13:28:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=/7Nn6VkiipupgCjHyTnbBZe2g2yw6HyQx7Vy+5VsZBY=; b=WmaeJ9VmnPIjpKap5Jvx1rTjMLQoAUzOMRSBVO86oE/mSDszLr/hc/AonKHRk53hEH 1WOhdTw/QLm2j8boQHYvlGt2SP3oQlC/RYbpPUKyPS57qsVAsCZV9Dh1vz+Lz1f6+NGI +XeU0sNt0zssAxlbZrSQrvOPVY3ylcR2+9vDx4xz6J+uT4GmzFy/W3bdYHDNoOgTdm2x Bve3sw8OQGzwRw+7bEBzrbnfWtHvsux+LAktaUiqzS8JS6W9btAgY6e21/G0xsSnyIN9 0+PjtuaP/cBfnsuS7KCCUDMW4xZTCCoeQjylZ7hyno9V2rsotKBq0p2Ritfp1fJepu1r er5g== Received: by 10.204.41.206 with SMTP id p14mr6008452bke.54.1346617701256; Sun, 02 Sep 2012 13:28:21 -0700 (PDT) Received: from rnote.ddteam.net (105-190-133-95.pool.ukrtel.net. [95.133.190.105]) by mx.google.com with ESMTPS id g6sm6553275bkg.2.2012.09.02.13.28.19 (version=SSLv3 cipher=OTHER); Sun, 02 Sep 2012 13:28:20 -0700 (PDT) Date: Sun, 2 Sep 2012 23:28:13 +0300 From: Aleksandr Rybalko To: Aleksandr Rybalko Message-Id: <20120902232813.6e150eff.ray@ddteam.net> In-Reply-To: <20120902232204.4de5f3a3.ray@ddteam.net> References: <201209020148.q821ml0M018010@svn.freebsd.org> <20120902232204.4de5f3a3.ray@ddteam.net> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQn/vEdjKXBPWZQHsD7gfmMcaeLUpxknuS3IJfzG6KqDk/MZAA4P+R9eGSUYCDjWBkMOgvPP Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 20:28:23 -0000 On Sun, 2 Sep 2012 23:22:04 +0300 Aleksandr Rybalko wrote: > On Sun, 2 Sep 2012 01:48:47 +0000 (UTC) > Andrew Turner wrote: > > > Author: andrew > > Date: Sun Sep 2 01:48:47 2012 > > New Revision: 239998 > > URL: http://svn.freebsd.org/changeset/base/239998 > > > > Log: > > Fix a logic inversion in an assert to allow us to use dts files > > that include other files. > > Big Thanks for that!!! > > It's hard to add overlapping support also? So second instance of same > node will be able to change attributes of previous one, such a > "status". Or add new attributes, like GPIO lines usage. > > Then we will be able to have per-SoC dts and per-board. Sorry, that already supported, just a mistake in my DTS files. :) One have uart@0x00000000, second serial@0x00000000. Address is same, but name different. Thanks again! > > > > > Modified: > > head/contrib/dtc/dtc-lexer.l > > > > Modified: head/contrib/dtc/dtc-lexer.l > > ============================================================================== > > --- head/contrib/dtc/dtc-lexer.l Sat Sep 1 23:33:49 > > 2012 (r239997) +++ head/contrib/dtc/dtc-lexer.l Sun > > Sep 2 01:48:47 2012 (r239998) @@ -198,7 +198,7 @@ static > > void push_input_file(const char * { > > assert(filename); > > > > - assert(include_stack_pointer >= MAX_INCLUDE_NESTING); > > + assert(include_stack_pointer < MAX_INCLUDE_NESTING); > > > > srcfile_push(filename); > > > > Thanks. > > WBW > -- > Aleksandr Rybalko -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 21:04:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EA88106564A; Sun, 2 Sep 2012 21:04:41 +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 4844F8FC14; Sun, 2 Sep 2012 21:04: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 q82L4fJH068981; Sun, 2 Sep 2012 21:04:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82L4eru068961; Sun, 2 Sep 2012 21:04:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209022104.q82L4eru068961@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 2 Sep 2012 21:04: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: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 21:04:41 -0000 Author: pfg Date: Sun Sep 2 21:04:40 2012 New Revision: 240060 URL: http://svn.freebsd.org/changeset/base/240060 Log: Fix RPC headers for C++ C++ mangling will cause trouble with variables like __rpc_xdr in xdr.h so rename this to XDR. While here add proper C++ guards to RPC headers. PR: 137443 MFC after: 2 weeks Modified: head/include/rpc/auth.h head/include/rpc/auth_unix.h head/include/rpc/clnt.h head/include/rpc/clnt_soc.h head/include/rpc/des_crypt.h head/include/rpc/nettype.h head/include/rpc/pmap_clnt.h head/include/rpc/pmap_rmt.h head/include/rpc/rpc_com.h head/include/rpc/rpc_msg.h head/include/rpc/rpcb_clnt.h head/include/rpc/rpcent.h head/include/rpc/rpcsec_gss.h head/include/rpc/svc.h head/include/rpc/svc_soc.h head/include/rpc/xdr.h head/sys/rpc/rpc_com.h head/sys/rpc/xdr.h Modified: head/include/rpc/auth.h ============================================================================== --- head/include/rpc/auth.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/auth.h Sun Sep 2 21:04:40 2012 (r240060) @@ -51,6 +51,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define MAX_AUTH_BYTES 400 #define MAXNETNAMELEN 255 /* maximum length of network user's name */ @@ -366,4 +370,8 @@ __END_DECLS #define RPCSEC_GSS_KRB5I 390004 #define RPCSEC_GSS_KRB5P 390005 +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_AUTH_H */ Modified: head/include/rpc/auth_unix.h ============================================================================== --- head/include/rpc/auth_unix.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/auth_unix.h Sun Sep 2 21:04:40 2012 (r240060) @@ -48,6 +48,10 @@ #define _RPC_AUTH_UNIX_H #include +#ifdef __cplusplus +extern "C" { +#endif + /* The machine name is part of a credential; it may not exceed 255 bytes */ #define MAX_MACHINE_NAME 255 @@ -81,4 +85,8 @@ struct short_hand_verf { struct opaque_auth new_cred; }; +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_AUTH_UNIX_H */ Modified: head/include/rpc/clnt.h ============================================================================== --- head/include/rpc/clnt.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/clnt.h Sun Sep 2 21:04:40 2012 (r240060) @@ -64,6 +64,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * Well-known IPV6 RPC broadcast address. */ @@ -551,6 +555,10 @@ extern enum clnt_stat rpc_broadcast_exp( const int, const char *); __END_DECLS +#ifdef __cplusplus +} +#endif + /* For backward compatibility */ #include Modified: head/include/rpc/clnt_soc.h ============================================================================== --- head/include/rpc/clnt_soc.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/clnt_soc.h Sun Sep 2 21:04:40 2012 (r240060) @@ -49,6 +49,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ /* @@ -103,4 +107,8 @@ extern CLIENT *clntudp_bufcreate(struct struct timeval, int *, u_int, u_int); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* _RPC_CLNT_SOC_H */ Modified: head/include/rpc/des_crypt.h ============================================================================== --- head/include/rpc/des_crypt.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/des_crypt.h Sun Sep 2 21:04:40 2012 (r240060) @@ -47,6 +47,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define DES_MAXDATA 8192 /* max bytes encrypted in one call */ #define DES_DIRMASK (1 << 0) #define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */ @@ -103,4 +107,8 @@ __BEGIN_DECLS void des_setparity( char *); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* _DES_DES_CRYPT_H */ Modified: head/include/rpc/nettype.h ============================================================================== --- head/include/rpc/nettype.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/nettype.h Sun Sep 2 21:04:40 2012 (r240060) @@ -44,6 +44,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define _RPC_NONE 0 #define _RPC_NETPATH 1 #define _RPC_VISIBLE 2 @@ -61,4 +65,8 @@ extern struct netconfig *__rpc_getconf(v extern struct netconfig *__rpc_getconfip(const char *); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_NETTYPE_H */ Modified: head/include/rpc/pmap_clnt.h ============================================================================== --- head/include/rpc/pmap_clnt.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/pmap_clnt.h Sun Sep 2 21:04:40 2012 (r240060) @@ -66,6 +66,10 @@ #define _RPC_PMAP_CLNT_H_ #include +#ifdef __cplusplus +extern "C" { +#endif + __BEGIN_DECLS extern bool_t pmap_set(u_long, u_long, int, int); extern bool_t pmap_unset(u_long, u_long); @@ -83,4 +87,8 @@ extern u_short pmap_getport(struct sock u_long, u_long, u_int); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_PMAP_CLNT_H_ */ Modified: head/include/rpc/pmap_rmt.h ============================================================================== --- head/include/rpc/pmap_rmt.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/pmap_rmt.h Sun Sep 2 21:04:40 2012 (r240060) @@ -44,6 +44,10 @@ #define _RPC_PMAP_RMT_H #include +#ifdef __cplusplus +extern "C" { +#endif + struct rmtcallargs { u_long prog, vers, proc, arglen; caddr_t args_ptr; @@ -62,4 +66,8 @@ extern bool_t xdr_rmtcall_args(XDR *, st extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_PMAP_RMT_H */ Modified: head/include/rpc/rpc_com.h ============================================================================== --- head/include/rpc/rpc_com.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/rpc_com.h Sun Sep 2 21:04:40 2012 (r240060) @@ -42,9 +42,13 @@ #ifndef _RPC_RPCCOM_H #define _RPC_RPCCOM_H +/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ + #include -/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ +#ifdef __cplusplus +extern "C" { +#endif /* * The max size of the transport, if the size cannot be determined @@ -80,4 +84,8 @@ char *_get_next_token(char *, int); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* _RPC_RPCCOM_H */ Modified: head/include/rpc/rpc_msg.h ============================================================================== --- head/include/rpc/rpc_msg.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/rpc_msg.h Sun Sep 2 21:04:40 2012 (r240060) @@ -43,6 +43,10 @@ #ifndef _RPC_RPC_MSG_H #define _RPC_RPC_MSG_H +#ifdef __cplusplus +extern "C" { +#endif + #define RPC_MSG_VERSION ((u_int32_t) 2) #define RPC_SERVICE_PORT ((u_short) 2048) @@ -211,4 +215,8 @@ extern bool_t xdr_rejected_reply(XDR *, extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_RPC_MSG_H */ Modified: head/include/rpc/rpcb_clnt.h ============================================================================== --- head/include/rpc/rpcb_clnt.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/rpcb_clnt.h Sun Sep 2 21:04:40 2012 (r240060) @@ -61,6 +61,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + __BEGIN_DECLS extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t, const struct netconfig *, const struct netbuf *); @@ -82,4 +86,8 @@ extern char *rpcb_taddr2uaddr(struct net extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_RPCB_CLNT_H */ Modified: head/include/rpc/rpcent.h ============================================================================== --- head/include/rpc/rpcent.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/rpcent.h Sun Sep 2 21:04:40 2012 (r240060) @@ -45,6 +45,9 @@ /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */ /* @(#)rpcent.h 1.1 88/12/06 SMI */ +#ifdef __cplusplus +extern "C" { +#endif struct rpcent { char *r_name; /* name of server for this rpc program */ @@ -64,4 +67,8 @@ extern void setrpcent(int); extern void endrpcent(void); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_CENT_H */ Modified: head/include/rpc/rpcsec_gss.h ============================================================================== --- head/include/rpc/rpcsec_gss.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/rpcsec_gss.h Sun Sep 2 21:04:40 2012 (r240060) @@ -29,6 +29,10 @@ #ifndef _RPCSEC_GSS_H #define _RPCSEC_GSS_H +#ifdef __cplusplus +extern "C" { +#endif + #include #ifndef MAX_GSS_MECH @@ -176,4 +180,8 @@ bool_t __rpc_gss_set_error(int rpc_gss_e __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPCSEC_GSS_H */ Modified: head/include/rpc/svc.h ============================================================================== --- head/include/rpc/svc.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/svc.h Sun Sep 2 21:04:40 2012 (r240060) @@ -65,6 +65,10 @@ * parameters, struct svc_req * and SVCXPRT *, defined below. */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Service control requests */ @@ -467,6 +471,9 @@ int __rpc_get_local_uid(SVCXPRT *_transp __END_DECLS +#ifdef __cplusplus +} +#endif /* for backward compatibility */ #include Modified: head/include/rpc/svc_soc.h ============================================================================== --- head/include/rpc/svc_soc.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/svc_soc.h Sun Sep 2 21:04:40 2012 (r240060) @@ -49,6 +49,10 @@ * with TS-RPC */ +#ifdef __cplusplus +extern "C" { +#endif + /* * Approved way of getting address of caller */ @@ -113,4 +117,8 @@ __BEGIN_DECLS extern SVCXPRT *svcfd_create(int, u_int, u_int); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_SVC_SOC_H */ Modified: head/include/rpc/xdr.h ============================================================================== --- head/include/rpc/xdr.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/include/rpc/xdr.h Sun Sep 2 21:04:40 2012 (r240060) @@ -43,6 +43,10 @@ #define _RPC_XDR_H #include +#ifdef __cplusplus +extern "C" { +#endif + /* * XDR provides a conventional way for converting between C data * types and an external bit-string representation. Library supplied @@ -97,26 +101,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ @@ -366,4 +370,8 @@ extern bool_t xdrrec_eof(XDR *); extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RPC_XDR_H */ Modified: head/sys/rpc/rpc_com.h ============================================================================== --- head/sys/rpc/rpc_com.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/sys/rpc/rpc_com.h Sun Sep 2 21:04:40 2012 (r240060) @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock extern int bindresvport(struct socket *so, struct sockaddr *sa); struct xucred; -struct __rpc_xdr; -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred); +struct XDR; +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred); #endif __END_DECLS Modified: head/sys/rpc/xdr.h ============================================================================== --- head/sys/rpc/xdr.h Sun Sep 2 18:54:51 2012 (r240059) +++ head/sys/rpc/xdr.h Sun Sep 2 21:04:40 2012 (r240060) @@ -97,26 +97,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 21:16:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36A69106564A; Sun, 2 Sep 2012 21:16:11 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 321AF8FC15; Sun, 2 Sep 2012 21:16:09 +0000 (UTC) Received: by eeke52 with SMTP id e52so1845586eek.13 for ; Sun, 02 Sep 2012 14:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=b9vmjsxdwk506Ue+SGMsygai5PWXgLd+jULRNUR7W+I=; b=0oG3ir6j4qDu3WdERkXcxo6iQUCfL7JpKbCa0vBtPk/SJZB8etHt0BxvX2OrRH9ntK ua+5vGjVI/zRkggu0Yd8PmxPsHH8BgXbA48wespN3EIDiWTAQL/l+Fhu2pIvqpxPLygE s9hiyT8seimHELKPO6tzsnSRQ+xbZsVyYOjERJU8Pj5y5YPbNFEVUwZoEiZtDAlyaX9b WycfvPB+DP0jswtys9LZqUtRJjlsFB6SbVGvurUhgbxyrNKWyw9o1g0Vbb0CRdiCzBWR KYsfmFqne+hImaddKCBQlKJfLd4LkP4QBB6C+cdVwhtWVwt9RkoVAtecWu0lJk/3ocyA Q+gw== Received: by 10.14.215.193 with SMTP id e41mr18810280eep.44.1346620569034; Sun, 02 Sep 2012 14:16:09 -0700 (PDT) Received: from ?IPv6:2001:470:28:4ba:bd0d:c674:d614:f7e2? ([2001:470:28:4ba:bd0d:c674:d614:f7e2]) by mx.google.com with ESMTPS id l42sm30968756eep.1.2012.09.02.14.16.06 (version=SSLv3 cipher=OTHER); Sun, 02 Sep 2012 14:16:08 -0700 (PDT) Message-ID: <5043CC95.9090707@gmail.com> Date: Mon, 03 Sep 2012 01:16:05 +0400 From: Yuri Pankov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" References: <201209022104.q82L4eru068961@svn.freebsd.org> In-Reply-To: <201209022104.q82L4eru068961@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 21:16:11 -0000 On Sun, 2 Sep 2012 21:04:40 +0000 (UTC), Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Sep 2 21:04:40 2012 > New Revision: 240060 > URL: http://svn.freebsd.org/changeset/base/240060 > > Log: > Fix RPC headers for C++ > > C++ mangling will cause trouble with variables like __rpc_xdr > in xdr.h so rename this to XDR. > While here add proper C++ guards to RPC headers. > > PR: 137443 > MFC after: 2 weeks > > Modified: > head/include/rpc/auth.h > head/include/rpc/auth_unix.h > head/include/rpc/clnt.h > head/include/rpc/clnt_soc.h > head/include/rpc/des_crypt.h > head/include/rpc/nettype.h > head/include/rpc/pmap_clnt.h > head/include/rpc/pmap_rmt.h > head/include/rpc/rpc_com.h > head/include/rpc/rpc_msg.h > head/include/rpc/rpcb_clnt.h > head/include/rpc/rpcent.h > head/include/rpc/rpcsec_gss.h > head/include/rpc/svc.h > head/include/rpc/svc_soc.h > head/include/rpc/xdr.h > head/sys/rpc/rpc_com.h > head/sys/rpc/xdr.h > > Modified: head/include/rpc/auth.h > ============================================================================== > --- head/include/rpc/auth.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/auth.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -51,6 +51,10 @@ > #include > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #define MAX_AUTH_BYTES 400 > #define MAXNETNAMELEN 255 /* maximum length of network user's name */ > > @@ -366,4 +370,8 @@ __END_DECLS > #define RPCSEC_GSS_KRB5I 390004 > #define RPCSEC_GSS_KRB5P 390005 > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_AUTH_H */ > > Modified: head/include/rpc/auth_unix.h > ============================================================================== > --- head/include/rpc/auth_unix.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/auth_unix.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -48,6 +48,10 @@ > #define _RPC_AUTH_UNIX_H > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > /* The machine name is part of a credential; it may not exceed 255 bytes */ > #define MAX_MACHINE_NAME 255 > > @@ -81,4 +85,8 @@ struct short_hand_verf { > struct opaque_auth new_cred; > }; > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_AUTH_UNIX_H */ > > Modified: head/include/rpc/clnt.h > ============================================================================== > --- head/include/rpc/clnt.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/clnt.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -64,6 +64,10 @@ > #include > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > /* > * Well-known IPV6 RPC broadcast address. > */ > @@ -551,6 +555,10 @@ extern enum clnt_stat rpc_broadcast_exp( > const int, const char *); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > /* For backward compatibility */ > #include > > > Modified: head/include/rpc/clnt_soc.h > ============================================================================== > --- head/include/rpc/clnt_soc.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/clnt_soc.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -49,6 +49,10 @@ > > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ > > /* > @@ -103,4 +107,8 @@ extern CLIENT *clntudp_bufcreate(struct > struct timeval, int *, u_int, u_int); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* _RPC_CLNT_SOC_H */ > > Modified: head/include/rpc/des_crypt.h > ============================================================================== > --- head/include/rpc/des_crypt.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/des_crypt.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -47,6 +47,10 @@ > #include > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #define DES_MAXDATA 8192 /* max bytes encrypted in one call */ > #define DES_DIRMASK (1 << 0) > #define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */ > @@ -103,4 +107,8 @@ __BEGIN_DECLS > void des_setparity( char *); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* _DES_DES_CRYPT_H */ > > Modified: head/include/rpc/nettype.h > ============================================================================== > --- head/include/rpc/nettype.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/nettype.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -44,6 +44,10 @@ > > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #define _RPC_NONE 0 > #define _RPC_NETPATH 1 > #define _RPC_VISIBLE 2 > @@ -61,4 +65,8 @@ extern struct netconfig *__rpc_getconf(v > extern struct netconfig *__rpc_getconfip(const char *); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_NETTYPE_H */ > > Modified: head/include/rpc/pmap_clnt.h > ============================================================================== > --- head/include/rpc/pmap_clnt.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/pmap_clnt.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -66,6 +66,10 @@ > #define _RPC_PMAP_CLNT_H_ > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > __BEGIN_DECLS > extern bool_t pmap_set(u_long, u_long, int, int); > extern bool_t pmap_unset(u_long, u_long); > @@ -83,4 +87,8 @@ extern u_short pmap_getport(struct sock > u_long, u_long, u_int); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_PMAP_CLNT_H_ */ > > Modified: head/include/rpc/pmap_rmt.h > ============================================================================== > --- head/include/rpc/pmap_rmt.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/pmap_rmt.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -44,6 +44,10 @@ > #define _RPC_PMAP_RMT_H > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > struct rmtcallargs { > u_long prog, vers, proc, arglen; > caddr_t args_ptr; > @@ -62,4 +66,8 @@ extern bool_t xdr_rmtcall_args(XDR *, st > extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_PMAP_RMT_H */ > > Modified: head/include/rpc/rpc_com.h > ============================================================================== > --- head/include/rpc/rpc_com.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/rpc_com.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -42,9 +42,13 @@ > #ifndef _RPC_RPCCOM_H > #define _RPC_RPCCOM_H > > +/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ > + > #include > > -/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ > +#ifdef __cplusplus > +extern "C" { > +#endif > > /* > * The max size of the transport, if the size cannot be determined > @@ -80,4 +84,8 @@ char *_get_next_token(char *, int); > > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* _RPC_RPCCOM_H */ > > Modified: head/include/rpc/rpc_msg.h > ============================================================================== > --- head/include/rpc/rpc_msg.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/rpc_msg.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -43,6 +43,10 @@ > #ifndef _RPC_RPC_MSG_H > #define _RPC_RPC_MSG_H > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #define RPC_MSG_VERSION ((u_int32_t) 2) > #define RPC_SERVICE_PORT ((u_short) 2048) > > @@ -211,4 +215,8 @@ extern bool_t xdr_rejected_reply(XDR *, > extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_RPC_MSG_H */ > > Modified: head/include/rpc/rpcb_clnt.h > ============================================================================== > --- head/include/rpc/rpcb_clnt.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/rpcb_clnt.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -61,6 +61,10 @@ > #include > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > __BEGIN_DECLS > extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t, > const struct netconfig *, const struct netbuf *); > @@ -82,4 +86,8 @@ extern char *rpcb_taddr2uaddr(struct net > extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_RPCB_CLNT_H */ > > Modified: head/include/rpc/rpcent.h > ============================================================================== > --- head/include/rpc/rpcent.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/rpcent.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -45,6 +45,9 @@ > /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */ > /* @(#)rpcent.h 1.1 88/12/06 SMI */ > > +#ifdef __cplusplus > +extern "C" { > +#endif > > struct rpcent { > char *r_name; /* name of server for this rpc program */ > @@ -64,4 +67,8 @@ extern void setrpcent(int); > extern void endrpcent(void); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_CENT_H */ > > Modified: head/include/rpc/rpcsec_gss.h > ============================================================================== > --- head/include/rpc/rpcsec_gss.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/rpcsec_gss.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -29,6 +29,10 @@ > #ifndef _RPCSEC_GSS_H > #define _RPCSEC_GSS_H > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > #include > > #ifndef MAX_GSS_MECH > @@ -176,4 +180,8 @@ bool_t __rpc_gss_set_error(int rpc_gss_e > > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPCSEC_GSS_H */ > > Modified: head/include/rpc/svc.h > ============================================================================== > --- head/include/rpc/svc.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/svc.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -65,6 +65,10 @@ > * parameters, struct svc_req * and SVCXPRT *, defined below. > */ > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > /* > * Service control requests > */ > @@ -467,6 +471,9 @@ int __rpc_get_local_uid(SVCXPRT *_transp > > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > > /* for backward compatibility */ > #include > > Modified: head/include/rpc/svc_soc.h > ============================================================================== > --- head/include/rpc/svc_soc.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/svc_soc.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -49,6 +49,10 @@ > * with TS-RPC > */ > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > /* > * Approved way of getting address of caller > */ > @@ -113,4 +117,8 @@ __BEGIN_DECLS > extern SVCXPRT *svcfd_create(int, u_int, u_int); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_SVC_SOC_H */ > > Modified: head/include/rpc/xdr.h > ============================================================================== > --- head/include/rpc/xdr.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/include/rpc/xdr.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -43,6 +43,10 @@ > #define _RPC_XDR_H > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > /* > * XDR provides a conventional way for converting between C data > * types and an external bit-string representation. Library supplied > @@ -97,26 +101,26 @@ enum xdr_op { > * an operations vector for the particular implementation (e.g. see xdr_mem.c), > * and two private fields for the use of the particular implementation. > */ > -typedef struct __rpc_xdr { > +typedef struct XDR { > enum xdr_op x_op; /* operation; fast additional param */ > const struct xdr_ops { > /* get a long from underlying stream */ > - bool_t (*x_getlong)(struct __rpc_xdr *, long *); > + bool_t (*x_getlong)(struct XDR *, long *); > /* put a long to " */ > - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); > + bool_t (*x_putlong)(struct XDR *, const long *); > /* get some bytes from " */ > - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); > + bool_t (*x_getbytes)(struct XDR *, char *, u_int); > /* put some bytes to " */ > - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); > + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); > /* returns bytes off from beginning */ > - u_int (*x_getpostn)(struct __rpc_xdr *); > + u_int (*x_getpostn)(struct XDR *); > /* lets you reposition the stream */ > - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); > + bool_t (*x_setpostn)(struct XDR *, u_int); > /* buf quick ptr to buffered data */ > - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); > + int32_t *(*x_inline)(struct XDR *, u_int); > /* free privates of this xdr_stream */ > - void (*x_destroy)(struct __rpc_xdr *); > - bool_t (*x_control)(struct __rpc_xdr *, int, void *); > + void (*x_destroy)(struct XDR *); > + bool_t (*x_control)(struct XDR *, int, void *); > } *x_ops; > char * x_public; /* users' data */ > void * x_private; /* pointer to private data */ > @@ -366,4 +370,8 @@ extern bool_t xdrrec_eof(XDR *); > extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); > __END_DECLS > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* !_RPC_XDR_H */ > > Modified: head/sys/rpc/rpc_com.h > ============================================================================== > --- head/sys/rpc/rpc_com.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/sys/rpc/rpc_com.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -114,8 +114,8 @@ extern int __rpc_sockisbound(struct sock > extern int bindresvport(struct socket *so, struct sockaddr *sa); > > struct xucred; > -struct __rpc_xdr; > -bool_t xdr_authunix_parms(struct __rpc_xdr *xdrs, uint32_t *time, struct xucred *cred); > +struct XDR; > +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred *cred); > #endif > > __END_DECLS > > Modified: head/sys/rpc/xdr.h > ============================================================================== > --- head/sys/rpc/xdr.h Sun Sep 2 18:54:51 2012 (r240059) > +++ head/sys/rpc/xdr.h Sun Sep 2 21:04:40 2012 (r240060) > @@ -97,26 +97,26 @@ enum xdr_op { > * an operations vector for the particular implementation (e.g. see xdr_mem.c), > * and two private fields for the use of the particular implementation. > */ > -typedef struct __rpc_xdr { > +typedef struct XDR { > enum xdr_op x_op; /* operation; fast additional param */ > const struct xdr_ops { > /* get a long from underlying stream */ > - bool_t (*x_getlong)(struct __rpc_xdr *, long *); > + bool_t (*x_getlong)(struct XDR *, long *); > /* put a long to " */ > - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); > + bool_t (*x_putlong)(struct XDR *, const long *); > /* get some bytes from " */ > - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); > + bool_t (*x_getbytes)(struct XDR *, char *, u_int); > /* put some bytes to " */ > - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); > + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); > /* returns bytes off from beginning */ > - u_int (*x_getpostn)(struct __rpc_xdr *); > + u_int (*x_getpostn)(struct XDR *); > /* lets you reposition the stream */ > - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); > + bool_t (*x_setpostn)(struct XDR *, u_int); > /* buf quick ptr to buffered data */ > - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); > + int32_t *(*x_inline)(struct XDR *, u_int); > /* free privates of this xdr_stream */ > - void (*x_destroy)(struct __rpc_xdr *); > - bool_t (*x_control)(struct __rpc_xdr *, int, void *); > + void (*x_destroy)(struct XDR *); > + bool_t (*x_control)(struct XDR *, int, void *); > } *x_ops; > char * x_public; /* users' data */ > void * x_private; /* pointer to private data */ Don't __BEGIN_DECLS and __END_DECLS do exactly that? i.e. it looks like some of the #ifdef's you added are redundant. From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 21:16:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67B2A1065676; Sun, 2 Sep 2012 21:16:11 +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 BE5528FC16; Sun, 2 Sep 2012 21:16:10 +0000 (UTC) Received: by obbun3 with SMTP id un3so10787724obb.13 for ; Sun, 02 Sep 2012 14:16:10 -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=dIAiY9C7UOZ3H958OWVH22XJOvk+ToPB1noCc2A7gYY=; b=SHKH6sS18AStLaJ2KGNLws9cG8AVVZOwLVNI8HtKIz1Geon9A0lCIOJdoB/89Z4J4p /aybi5xiTnM0NLUhewQNsjaFlSpN7MK8B881owNSccEVhX9OSVdna81uKOP4bu3ki4b0 BJeJg1FgI5NnIXV5FkYdmbUJwqFtq/RFLMxFhoGw9IL65RoyQlYFSivPQI0jm75UQCm2 YgY5CHiCAHeKMzb/eWWeWOjm9lJCZKhbmGopIbAXY16PTTpwbI5PGwvJP8IX19odi0+9 acYzvwgx+GVmFIotlQlFKwiqGcSXmE89cXszyEUPM9VCyBAnFhIE+CeOzS89xnmkRYwH N4QA== MIME-Version: 1.0 Received: by 10.60.27.9 with SMTP id p9mr12126825oeg.69.1346620570227; Sun, 02 Sep 2012 14:16:10 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Sun, 2 Sep 2012 14:16:10 -0700 (PDT) In-Reply-To: <201209021739.q82Hd3CE042578@svn.freebsd.org> References: <201209021739.q82Hd3CE042578@svn.freebsd.org> Date: Sun, 2 Sep 2012 14:16:10 -0700 Message-ID: From: Garrett Cooper 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: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 21:16:11 -0000 On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov wrote: > Author: zont > Date: Sun Sep 2 17:39:02 2012 > New Revision: 240026 > URL: http://svn.freebsd.org/changeset/base/240026 > > Log: > - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz > and kern.sgrowsiz sysctls writable. > > Approved by: kib (mentor) > > Modified: > head/sys/kern/subr_param.c > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Sun Sep 2 15:27:20 2012 (r240025) > +++ head/sys/kern/subr_param.c Sun Sep 2 17:39:02 2012 (r240026) > @@ -119,18 +119,18 @@ SYSCTL_LONG(_kern, OID_AUTO, maxswzone, > "Maximum memory for swap metadata"); > SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, > "Maximum value of vfs.maxbufspace"); > -SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN, &maxtsiz, 0, > +SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxtsiz, 0, > "Maximum text size"); > -SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN, &dfldsiz, 0, > +SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dfldsiz, 0, > "Initial data size limit"); > -SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN, &maxdsiz, 0, > +SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxdsiz, 0, > "Maximum data size"); > -SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN, &dflssiz, 0, > +SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dflssiz, 0, > "Initial stack size limit"); > -SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN, &maxssiz, 0, > +SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxssiz, 0, > "Maximum stack size"); > -SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, &sgrowsiz, 0, > - "Amount to grow stack on a stack fault"); > +SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &sgrowsiz, > + 0, "Amount to grow stack on a stack fault"); > SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, > NULL, 0, sysctl_kern_vm_guest, "A", > "Virtual machine guest detected? (none|generic|xen)"); Please add some basic sanity checking to init_param1 -- there's absolutely nothing preventing me from passing in values <= 0 or other non-performant (non-multiple of PAGE_SIZE, whacky ratios, etc) values. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 21:20:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CCBC1065674; Sun, 2 Sep 2012 21:20: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 7F95F8FC26; Sun, 2 Sep 2012 21:20:53 +0000 (UTC) Received: by obbun3 with SMTP id un3so10791604obb.13 for ; Sun, 02 Sep 2012 14:20: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=3nKC5f3hqZ1N8DvLobwF76oILzv/tBCxOYQKpvo+nVQ=; b=X4lSYchn+77iknnRcpfU3EIloGY5OS61eSUcvU2SqQJzi4qgbfWvj1VF6YxnVRGxDP kOQWfPAWa/+ZrHfOnvdcoID37716SfBu3jcQPsUuaFOESFs/7rLXochNS5QnBb0iH0HA meKOF1ywcyxoR0taZeDqfjurQZdaH7KMLl6uTC4KV/xmaN7H5QIrTFLwLfw7IbzUrpQ8 aBYDxSQHLPPV2CYbI0TiZcM/guTGaJcRznQK+nYlIHS6srMYy1bera89ZruUaCVdC+dw 6rohOqwq/lzF+4m76AaZHDu3xpkK9KMN3AbLtTfh6TjtHV6eXsmNqwAu+1lBXpLvj4Fx O1dQ== MIME-Version: 1.0 Received: by 10.182.38.71 with SMTP id e7mr12606915obk.67.1346620853038; Sun, 02 Sep 2012 14:20:53 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Sun, 2 Sep 2012 14:20:53 -0700 (PDT) In-Reply-To: References: <201209021739.q82Hd3CE042578@svn.freebsd.org> Date: Sun, 2 Sep 2012 14:20:53 -0700 Message-ID: From: Garrett Cooper 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: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 21:20:54 -0000 On Sun, Sep 2, 2012 at 2:16 PM, Garrett Cooper wrote: > On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov wrote: >> Author: zont >> Date: Sun Sep 2 17:39:02 2012 >> New Revision: 240026 >> URL: http://svn.freebsd.org/changeset/base/240026 >> >> Log: >> - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz >> and kern.sgrowsiz sysctls writable. >> >> Approved by: kib (mentor) >> >> Modified: >> head/sys/kern/subr_param.c ... > > Please add some basic sanity checking to init_param1 -- there's > absolutely nothing preventing me from passing in values <= 0 or other Correction: values == 0 with little effort (missed the part where it was using TUNABLE_ULONG_FETCH). You could get negative values though if you overflow the value passed in -- in part because the getenv* functions in kern_environment.c don't check for/handle overflow gracefully .. I had a patch out for this a while ago that never made it in. > non-performant (non-multiple of PAGE_SIZE, whacky ratios, etc) values. > Thanks, > -Garrett From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 21:59:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77F2D1065673 for ; Sun, 2 Sep 2012 21:59:38 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm17-vm0.bullet.mail.sp2.yahoo.com (nm17-vm0.bullet.mail.sp2.yahoo.com [98.139.91.212]) by mx1.freebsd.org (Postfix) with SMTP id 44A4F8FC18 for ; Sun, 2 Sep 2012 21:59:38 +0000 (UTC) Received: from [98.139.91.63] by nm17.bullet.mail.sp2.yahoo.com with NNFMP; 02 Sep 2012 21:59:32 -0000 Received: from [98.139.91.35] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 02 Sep 2012 21:59:32 -0000 Received: from [127.0.0.1] by omp1035.mail.sp2.yahoo.com with NNFMP; 02 Sep 2012 21:59:32 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 38903.56037.bm@omp1035.mail.sp2.yahoo.com Received: (qmail 56477 invoked by uid 60001); 2 Sep 2012 21:59:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1346623171; bh=2W/Q9Qjdk1oeB3drHQQOJmgnfbeJiqivXvAsQ6w41NE=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=2SIzumNDzLMlpTdY2Nvx9UoQfcEra0fYSsSyyBLiKP3Pwi1CGw+T8OovmkZefyl+gznwmoDSyGhgXLwCysh8fUQKp2346YUPg6cvz2x9gK4jp0NrDWLb8U2AJhS08oobY5r9e1fIXNyAaK7BdTQ96d8ZZro+/Cfplwa9d+K/Qpo= X-YMail-OSG: pHJCYygVM1kGCtS99A3hfRacHEiJjeHoVw3Cju1II3FZWry 5HjQ1.4Q.IP0K6sb7JNpXxDKosg4P1wjQgdCLH8QY2BB2cgPX_ENhNS807dp xwzXQzaRncaUsUCa03.FgitZMR103rNnpVPvJKo30mXALj4rvmSRCD6mzai. EfoOAuksYV3ooPjYpmn1s4tCVZB2Px._qn3p1wl0Ovog_I32Ir.gel9jzxs2 rOzkyDLqnlvrUF73zYTt78McjX1ypJPDnnd1Odaz_AopF.fgZiwTS5N3EliF hrCQrRPVk_HyufO63Sqai4UMS_akcZ4pJgy1fGHlvERSItE0AaGtA_akrRar zCyllFx94DJ8ZVI7Al8DvXKP9qWZWF6XbDxiriorBeM.T.evxzXC1EfnFnnh uIL2ylJ.JrO2B2LIC3Nc36Al0UofufgYCEZAFhBuf5S6tZo3VKG32A6VbdEX 4.GaIzo.xR_5Ikld4EcLmIMre6eQNAwlVb6h4whIgbRDZkIm5ZSKAzKhzTkB F6T4XcvePB95UPHznSwICGcrHaajbZyrN Received: from [200.118.157.7] by web113517.mail.gq1.yahoo.com via HTTP; Sun, 02 Sep 2012 14:59:31 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailWebService/0.8.121.416 References: <201209022104.q82L4eru068961@svn.freebsd.org> <5043CC95.9090707@gmail.com> Message-ID: <1346623171.31494.YahooMailNeo@web113517.mail.gq1.yahoo.com> Date: Sun, 2 Sep 2012 14:59:31 -0700 (PDT) From: Pedro Giffuni To: Yuri Pankov In-Reply-To: <5043CC95.9090707@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pedro Giffuni List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 21:59:38 -0000 Yes, indeed! I will revert most of it.=0A=A0=0AThanks for checking!=0A=A0= =0APedro.=0A=0A=0A>________________________________=0A> From: Yuri Pankov <= yuri.pankov@gmail.com>=0A>To: Pedro F. Giffuni =0A>Cc: sr= c-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org= =0A>Sent: Sunday, September 2, 2012 4:16 PM=0A>Subject: Re: svn commit: r2= 40060 - in head: include/rpc sys/rpc=0A> =0A>On Sun, 2 Sep 2012 21:04:40 += 0000 (UTC), Pedro F. Giffuni wrote:=0A>> Author: pfg=0A>> Date: Sun Sep=A0 = 2 21:04:40 2012=0A>> New Revision: 240060=0A>> URL: http://svn.freebsd.org/= changeset/base/240060=0A>>=0A>> Log:=0A>>=A0 =A0 Fix RPC headers for C++=0A= >>=0A>>=A0 =A0 C++ mangling will cause trouble with variables like __rpc_xd= r=0A>>=A0 =A0 in xdr.h so rename this to XDR.=0A>>=A0 =A0 While here add pr= oper C++ guards to RPC headers.=0A>>=0A>>=A0 =A0 PR:=A0=A0=A0 =A0=A0=A0 137= 443=0A>>=A0 =A0 MFC after:=A0=A0=A0 2 weeks=0A>>=0A>> Modified:=0A>>=A0 =A0= head/include/rpc/auth.h=0A>>=A0 =A0 head/include/rpc/auth_unix.h=0A>>=A0 = =A0 head/include/rpc/clnt.h=0A>>=A0 =A0 head/include/rpc/clnt_soc.h=0A>>=A0= =A0 head/include/rpc/des_crypt.h=0A>>=A0 =A0 head/include/rpc/nettype.h=0A= >>=A0 =A0 head/include/rpc/pmap_clnt.h=0A>>=A0 =A0 head/include/rpc/pmap_rm= t.h=0A>>=A0 =A0 head/include/rpc/rpc_com.h=0A>>=A0 =A0 head/include/rpc/rpc= _msg.h=0A>>=A0 =A0 head/include/rpc/rpcb_clnt.h=0A>>=A0 =A0 head/include/rp= c/rpcent.h=0A>>=A0 =A0 head/include/rpc/rpcsec_gss.h=0A>>=A0 =A0 head/inclu= de/rpc/svc.h=0A>>=A0 =A0 head/include/rpc/svc_soc.h=0A>>=A0 =A0 head/includ= e/rpc/xdr.h=0A>>=A0 =A0 head/sys/rpc/rpc_com.h=0A>>=A0 =A0 head/sys/rpc/xdr= .h=0A>>=0A>> Modified: head/include/rpc/auth.h=0A>> =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- he= ad/include/rpc/auth.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059= )=0A>> +++ head/include/rpc/auth.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0= =A0=A0 (r240060)=0A>> @@ -51,6 +51,10 @@=0A>>=A0 #include =0A= >>=A0 #include =0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> = +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 #define MAX_AUTH_BYTES=A0=A0=A0 = 400=0A>>=A0 #define MAXNETNAMELEN=A0=A0=A0 255=A0=A0=A0 /* maximum length = of network user's name */=0A>>=0A>> @@ -366,4 +370,8 @@ __END_DECLS=0A>>=A0= #define=A0=A0=A0 RPCSEC_GSS_KRB5I=A0=A0=A0 390004=0A>>=A0 #define=A0=A0= =A0 RPCSEC_GSS_KRB5P=A0=A0=A0 390005=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus= =0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_AUTH_H */=0A>>=0A>> M= odified: head/include/rpc/auth_unix.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/includ= e/rpc/auth_unix.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A= >> +++ head/include/rpc/auth_unix.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0= =A0=A0 (r240060)=0A>> @@ -48,6 +48,10 @@=0A>>=A0 #define _RPC_AUTH_UNIX_H= =0A>>=A0 #include =0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>= > +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 /* The machine name is part of= a credential; it may not exceed 255 bytes */=0A>>=A0 #define MAX_MACHINE_= NAME 255=0A>>=0A>> @@ -81,4 +85,8 @@ struct short_hand_verf {=0A>>=A0 =A0= =A0=A0 struct opaque_auth new_cred;=0A>>=A0 };=0A>>=0A>> +#ifdef=A0=A0=A0 = __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_AUTH_UNIX_= H */=0A>>=0A>> Modified: head/include/rpc/clnt.h=0A>> =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- he= ad/include/rpc/clnt.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059= )=0A>> +++ head/include/rpc/clnt.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0= =A0=A0 (r240060)=0A>> @@ -64,6 +64,10 @@=0A>>=A0 #include =0A= >>=A0 #include =0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +ext= ern "C" {=0A>> +#endif=0A>> +=0A>>=A0 /*=0A>>=A0 =A0 * Well-known IPV6 RPC= broadcast address.=0A>>=A0 =A0 */=0A>> @@ -551,6 +555,10 @@ extern enum cl= nt_stat rpc_broadcast_exp(=0A>>=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0= =A0=A0=A0 const int, const char *);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef= =A0=A0=A0 __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 /* For backward = compatibility */=0A>>=A0 #include =0A>>=0A>>=0A>> Modified= : head/include/rpc/clnt_soc.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/include/rpc/cln= t_soc.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ hea= d/include/rpc/clnt_soc.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r240= 060)=0A>> @@ -49,6 +49,10 @@=0A>>=0A>>=A0 #include =0A>>=0A>>= +#ifdef=A0=A0=A0 __cplusplus=0A>> +extern "C" {=0A>> +#endif=0A>> +=0A>>= =A0 #define UDPMSGSIZE=A0 =A0 =A0 8800=A0 =A0 /* rpc imposed limit on udp = msg size */=0A>>=0A>>=A0 /*=0A>> @@ -103,4 +107,8 @@ extern CLIENT *clntud= p_bufcreate(struct=0A>>=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 struct= timeval, int *, u_int, u_int);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0= =A0=A0 __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* _RPC_CLNT= _SOC_H */=0A>>=0A>> Modified: head/include/rpc/des_crypt.h=0A>> =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =0A>> --- head/include/rpc/des_crypt.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012= =A0=A0=A0 (r240059)=0A>> +++ head/include/rpc/des_crypt.h=A0=A0=A0 Sun Sep= =A0 2 21:04:40 2012=A0=A0=A0 (r240060)=0A>> @@ -47,6 +47,10 @@=0A>>=A0 #in= clude =0A>>=A0 #include =0A>>=0A>> +#ifdef=A0=A0= =A0 __cplusplus=0A>> +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 #define DES= _MAXDATA 8192=A0=A0=A0 /* max bytes encrypted in one call */=0A>>=A0 #defi= ne DES_DIRMASK (1 << 0)=0A>>=A0 #define DES_ENCRYPT (0*DES_DIRMASK)=A0=A0= =A0 /* Encrypt */=0A>> @@ -103,4 +107,8 @@ __BEGIN_DECLS=0A>>=A0 void des_= setparity( char *);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 __cplus= plus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif=A0 /* _DES_DES_CRYPT_H */= =0A>>=0A>> Modified: head/include/rpc/nettype.h=0A>> =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- he= ad/include/rpc/nettype.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240= 059)=0A>> +++ head/include/rpc/nettype.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 201= 2=A0=A0=A0 (r240060)=0A>> @@ -44,6 +44,10 @@=0A>>=0A>>=A0 #include =0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +extern "C" {=0A>> +#end= if=0A>> +=0A>>=A0 #define=A0=A0=A0 _RPC_NONE=A0=A0=A0 0=0A>>=A0 #define= =A0=A0=A0 _RPC_NETPATH=A0=A0=A0 1=0A>>=A0 #define=A0=A0=A0 _RPC_VISIBLE=A0= =A0=A0 2=0A>> @@ -61,4 +65,8 @@ extern struct netconfig *__rpc_getconf(v=0A= >>=A0 extern struct netconfig *__rpc_getconfip(const char *);=0A>>=A0 __E= ND_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +}=0A>> +#endif=0A>> += =0A>>=A0 #endif=A0=A0=A0 /* !_RPC_NETTYPE_H */=0A>>=0A>> Modified: head/in= clude/rpc/pmap_clnt.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/include/rpc/pmap_clnt.h= =A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ head/inclu= de/rpc/pmap_clnt.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r240060)= =0A>> @@ -66,6 +66,10 @@=0A>>=A0 #define _RPC_PMAP_CLNT_H_=0A>>=A0 #inclu= de =0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +extern "C" {= =0A>> +#endif=0A>> +=0A>>=A0 __BEGIN_DECLS=0A>>=A0 extern bool_t=A0=A0=A0= =A0=A0=A0 pmap_set(u_long, u_long, int, int);=0A>>=A0 extern bool_t=A0=A0= =A0 =A0=A0=A0 pmap_unset(u_long, u_long);=0A>> @@ -83,4 +87,8 @@ extern u_s= hort=A0=A0=A0 =A0=A0=A0 pmap_getport(struct sock=0A>>=A0 =A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0 =A0 u_long, u_long, u_int);=0A>>=A0 __END_DEC= LS=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>= =A0 #endif /* !_RPC_PMAP_CLNT_H_ */=0A>>=0A>> Modified: head/include/rpc/p= map_rmt.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/include/rpc/pmap_rmt.h=A0=A0=A0 Sun = Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ head/include/rpc/pmap_rm= t.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r240060)=0A>> @@ -44,6 +4= 4,10 @@=0A>>=A0 #define _RPC_PMAP_RMT_H=0A>>=A0 #include =0A= >>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +extern "C" {=0A>> +#endif=0A>> += =0A>>=A0 struct rmtcallargs {=0A>>=A0 =A0=A0=A0 u_long prog, vers, proc, = arglen;=0A>>=A0 =A0=A0=A0 caddr_t args_ptr;=0A>> @@ -62,4 +66,8 @@ extern = bool_t xdr_rmtcall_args(XDR *, st=0A>>=A0 extern bool_t xdr_rmtcallres(XDR= *, struct rmtcallres *);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 _= _cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_PMAP_RMT_H = */=0A>>=0A>> Modified: head/include/rpc/rpc_com.h=0A>> =3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> ---= head/include/rpc/rpc_com.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r= 240059)=0A>> +++ head/include/rpc/rpc_com.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 = 2012=A0=A0=A0 (r240060)=0A>> @@ -42,9 +42,13 @@=0A>>=A0 #ifndef _RPC_RPCCO= M_H=0A>>=A0 #define=A0=A0=A0 _RPC_RPCCOM_H=0A>>=0A>> +/* #pragma ident=A0= =A0=A0 "@(#)rpc_com.h=A0=A0=A0 1.11=A0=A0=A0 93/07/05 SMI" */=0A>> +=0A>>= =A0 #include =0A>>=0A>> -/* #pragma ident=A0=A0=A0 "@(#)rpc_c= om.h=A0=A0=A0 1.11=A0=A0=A0 93/07/05 SMI" */=0A>> +#ifdef __cplusplus=0A>> = +extern "C" {=0A>> +#endif=0A>>=0A>>=A0 /*=0A>>=A0 =A0 * The max size of t= he transport, if the size cannot be determined=0A>> @@ -80,4 +84,8 @@ char = *_get_next_token(char *, int);=0A>>=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef = __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* _RPC_RPCCOM_H */= =0A>>=0A>> Modified: head/include/rpc/rpc_msg.h=0A>> =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- he= ad/include/rpc/rpc_msg.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240= 059)=0A>> +++ head/include/rpc/rpc_msg.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 201= 2=A0=A0=A0 (r240060)=0A>> @@ -43,6 +43,10 @@=0A>>=A0 #ifndef _RPC_RPC_MSG_= H=0A>>=A0 #define _RPC_RPC_MSG_H=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A= >> +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 #define RPC_MSG_VERSION=A0=A0= =A0 =A0=A0=A0 ((u_int32_t) 2)=0A>>=A0 #define RPC_SERVICE_PORT=A0=A0=A0 ((= u_short) 2048)=0A>>=0A>> @@ -211,4 +215,8 @@ extern bool_t=A0=A0=A0 xdr_rej= ected_reply(XDR *,=0A>>=A0 extern void=A0=A0=A0 _seterr_reply(struct rpc_m= sg *, struct rpc_err *);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 __= cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_RPC_MSG_H */= =0A>>=0A>> Modified: head/include/rpc/rpcb_clnt.h=0A>> =3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> ---= head/include/rpc/rpcb_clnt.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 = (r240059)=0A>> +++ head/include/rpc/rpcb_clnt.h=A0=A0=A0 Sun Sep=A0 2 21:04= :40 2012=A0=A0=A0 (r240060)=0A>> @@ -61,6 +61,10 @@=0A>>=A0 #include =0A>>=A0 #include =0A>>=0A>> +#ifdef=A0=A0=A0 __c= plusplus=0A>> +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 __BEGIN_DECLS=0A>>= =A0 extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,=0A>>=A0 =A0= =A0=A0 =A0=A0=A0 =A0 =A0 =A0 const struct netconfig=A0 *, const struct net= buf *);=0A>> @@ -82,4 +86,8 @@ extern char *rpcb_taddr2uaddr(struct net=0A>= >=A0 extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);= =0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +}=0A>> += #endif=0A>> +=0A>>=A0 #endif=A0=A0=A0 /* !_RPC_RPCB_CLNT_H */=0A>>=0A>> Mo= dified: head/include/rpc/rpcent.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/include/rpc/= rpcent.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ he= ad/include/rpc/rpcent.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r2400= 60)=0A>> @@ -45,6 +45,9 @@=0A>>=A0 /*=A0=A0=A0 #pragma ident "@(#)rpcent.h= =A0 1.13=A0 =A0 94/04/25 SMI"=A0=A0=A0 */=0A>>=A0 /*=A0 =A0 =A0 @(#)rpcen= t.h 1.1 88/12/06 SMI=A0 */=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +ex= tern "C" {=0A>> +#endif=0A>>=0A>>=A0 struct rpcent {=0A>>=A0 =A0 =A0 =A0 = char=A0 =A0 *r_name;=A0 =A0 =A0 =A0 /* name of server for this rpc program = */=0A>> @@ -64,4 +67,8 @@ extern void setrpcent(int);=0A>>=A0 extern void = endrpcent(void);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplu= s=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_CENT_H */=0A>>=0A>> = Modified: head/include/rpc/rpcsec_gss.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/includ= e/rpc/rpcsec_gss.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)= =0A>> +++ head/include/rpc/rpcsec_gss.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012= =A0=A0=A0 (r240060)=0A>> @@ -29,6 +29,10 @@=0A>>=A0 #ifndef _RPCSEC_GSS_H= =0A>>=A0 #define _RPCSEC_GSS_H=0A>>=0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>>= +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 #include =0A>>= =0A>>=A0 #ifndef MAX_GSS_MECH=0A>> @@ -176,4 +180,8 @@ bool_t __rpc_gss_se= t_error(int rpc_gss_e=0A>>=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0=A0=A0 = __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPCSEC_GSS_H *= /=0A>>=0A>> Modified: head/include/rpc/svc.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/= include/rpc/svc.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A= >> +++ head/include/rpc/svc.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 = (r240060)=0A>> @@ -65,6 +65,10 @@=0A>>=A0 =A0 * parameters, struct svc_req = * and SVCXPRT *, defined below.=0A>>=A0 =A0 */=0A>>=0A>> +#ifdef=A0=A0=A0 _= _cplusplus=0A>> +extern "C" {=0A>> +#endif=0A>> +=0A>>=A0 /*=0A>>=A0 =A0 *= =A0 =A0 =A0 Service control requests=0A>>=A0 =A0 */=0A>> @@ -467,6 +471,9 @= @ int __rpc_get_local_uid(SVCXPRT *_transp=0A>>=0A>>=A0 __END_DECLS=0A>>= =0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +}=0A>> +#endif=0A>>=0A>>=A0 /* fo= r backward compatibility */=0A>>=A0 #include =0A>>=0A>> Mod= ified: head/include/rpc/svc_soc.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/include/rpc/= svc_soc.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ h= ead/include/rpc/svc_soc.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r24= 0060)=0A>> @@ -49,6 +49,10 @@=0A>>=A0 =A0 * with TS-RPC=0A>>=A0 =A0 */=0A>>= =0A>> +#ifdef=A0=A0=A0 __cplusplus=0A>> +extern "C" {=0A>> +#endif=0A>> += =0A>>=A0 /*=0A>>=A0 =A0 *=A0 Approved way of getting address of caller=0A>= >=A0 =A0 */=0A>> @@ -113,4 +117,8 @@ __BEGIN_DECLS=0A>>=A0 extern SVCXPRT = *svcfd_create(int, u_int, u_int);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef=A0= =A0=A0 __cplusplus=0A>> +}=0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_SVC= _SOC_H */=0A>>=0A>> Modified: head/include/rpc/xdr.h=0A>> =3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> = --- head/include/rpc/xdr.h=A0=A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r2= 40059)=0A>> +++ head/include/rpc/xdr.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012= =A0=A0=A0 (r240060)=0A>> @@ -43,6 +43,10 @@=0A>>=A0 #define _RPC_XDR_H=0A>= >=A0 #include =0A>>=0A>> +#ifdef __cplusplus=0A>> +extern "C"= {=0A>> +#endif=0A>> +=0A>>=A0 /*=0A>>=A0 =A0 * XDR provides a conventiona= l way for converting between C data=0A>>=A0 =A0 * types and an external bit= -string representation.=A0 Library supplied=0A>> @@ -97,26 +101,26 @@ enum = xdr_op {=0A>>=A0 =A0 * an operations vector for the particular implementati= on (e.g. see xdr_mem.c),=0A>>=A0 =A0 * and two private fields for the use o= f the particular implementation.=0A>>=A0 =A0 */=0A>> -typedef struct __rpc_= xdr {=0A>> +typedef struct XDR {=0A>>=A0 =A0=A0=A0 enum xdr_op=A0=A0=A0 x_= op;=A0=A0=A0 =A0=A0=A0 /* operation; fast additional param */=0A>>=A0 =A0= =A0=A0 const struct xdr_ops {=0A>>=A0 =A0=A0=A0 =A0=A0=A0 /* get a long fr= om underlying stream */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_getlo= ng)(struct __rpc_xdr *, long *);=0A>> +=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 = (*x_getlong)(struct XDR *, long *);=0A>>=A0 =A0=A0=A0 =A0=A0=A0 /* put a l= ong to " */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_putlong)(struct _= _rpc_xdr *, const long *);=0A>> +=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_pu= tlong)(struct XDR *, const long *);=0A>>=A0 =A0=A0=A0 =A0=A0=A0 /* get som= e bytes from " */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_getbytes)(s= truct __rpc_xdr *, char *, u_int);=0A>> +=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0= =A0 (*x_getbytes)(struct XDR *, char *, u_int);=0A>>=A0 =A0=A0=A0 =A0=A0= =A0 /* put some bytes to " */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x= _putbytes)(struct __rpc_xdr *, const char *, u_int);=0A>> +=A0=A0=A0 =A0=A0= =A0 bool_t=A0=A0=A0 (*x_putbytes)(struct XDR *, const char *, u_int);=0A>>= =A0 =A0=A0=A0 =A0=A0=A0 /* returns bytes off from beginning */=0A>> -=A0= =A0=A0 =A0=A0=A0 u_int=A0=A0=A0 (*x_getpostn)(struct __rpc_xdr *);=0A>> += =A0=A0=A0 =A0=A0=A0 u_int=A0=A0=A0 (*x_getpostn)(struct XDR *);=0A>>=A0 = =A0=A0=A0 =A0=A0=A0 /* lets you reposition the stream */=0A>> -=A0=A0=A0 = =A0=A0=A0 bool_t=A0 (*x_setpostn)(struct __rpc_xdr *, u_int);=0A>> +=A0=A0= =A0 =A0=A0=A0 bool_t=A0 (*x_setpostn)(struct XDR *, u_int);=0A>>=A0 =A0=A0= =A0 =A0=A0=A0 /* buf quick ptr to buffered data */=0A>> -=A0=A0=A0 =A0=A0= =A0 int32_t *(*x_inline)(struct __rpc_xdr *, u_int);=0A>> +=A0=A0=A0 =A0=A0= =A0 int32_t *(*x_inline)(struct XDR *, u_int);=0A>>=A0 =A0=A0=A0 =A0=A0=A0= /* free privates of this xdr_stream */=0A>> -=A0=A0=A0 =A0=A0=A0 void=A0= =A0=A0 (*x_destroy)(struct __rpc_xdr *);=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t= =A0=A0=A0 (*x_control)(struct __rpc_xdr *, int, void *);=0A>> +=A0=A0=A0 = =A0=A0=A0 void=A0=A0=A0 (*x_destroy)(struct XDR *);=0A>> +=A0=A0=A0 =A0=A0= =A0 bool_t=A0=A0=A0 (*x_control)(struct XDR *, int, void *);=0A>>=A0 =A0= =A0=A0 } *x_ops;=0A>>=A0 =A0=A0=A0 char *=A0=A0=A0 =A0=A0=A0 x_public;=A0= =A0=A0 /* users' data */=0A>>=A0 =A0=A0=A0 void *=A0=A0=A0 =A0=A0=A0 x_pri= vate;=A0=A0=A0 /* pointer to private data */=0A>> @@ -366,4 +370,8 @@ exter= n bool_t xdrrec_eof(XDR *);=0A>>=A0 extern u_int xdrrec_readbytes(XDR *, c= addr_t, u_int);=0A>>=A0 __END_DECLS=0A>>=0A>> +#ifdef __cplusplus=0A>> +}= =0A>> +#endif=0A>> +=0A>>=A0 #endif /* !_RPC_XDR_H */=0A>>=0A>> Modified: = head/sys/rpc/rpc_com.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/sys/rpc/rpc_com.h=A0= =A0=A0 Sun Sep=A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ head/sys/rpc/= rpc_com.h=A0=A0=A0 Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r240060)=0A>> @@ -1= 14,8 +114,8 @@ extern int __rpc_sockisbound(struct sock=0A>>=A0 extern int= bindresvport(struct socket *so, struct sockaddr *sa);=0A>>=0A>>=A0 struct= xucred;=0A>> -struct __rpc_xdr;=0A>> -bool_t xdr_authunix_parms(struct __r= pc_xdr *xdrs, uint32_t *time, struct xucred *cred);=0A>> +struct XDR;=0A>> = +bool_t xdr_authunix_parms(struct XDR *xdrs, uint32_t *time, struct xucred = *cred);=0A>>=A0 #endif=0A>>=0A>>=A0 __END_DECLS=0A>>=0A>> Modified: head/= sys/rpc/xdr.h=0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> --- head/sys/rpc/xdr.h=A0=A0=A0 Sun Sep= =A0 2 18:54:51 2012=A0=A0=A0 (r240059)=0A>> +++ head/sys/rpc/xdr.h=A0=A0=A0= Sun Sep=A0 2 21:04:40 2012=A0=A0=A0 (r240060)=0A>> @@ -97,26 +97,26 @@ enu= m xdr_op {=0A>>=A0 =A0 * an operations vector for the particular implementa= tion (e.g. see xdr_mem.c),=0A>>=A0 =A0 * and two private fields for the use= of the particular implementation.=0A>>=A0 =A0 */=0A>> -typedef struct __rp= c_xdr {=0A>> +typedef struct XDR {=0A>>=A0 =A0=A0=A0 enum xdr_op=A0=A0=A0 = x_op;=A0=A0=A0 =A0=A0=A0 /* operation; fast additional param */=0A>>=A0 = =A0=A0=A0 const struct xdr_ops {=0A>>=A0 =A0=A0=A0 =A0=A0=A0 /* get a long= from underlying stream */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_ge= tlong)(struct __rpc_xdr *, long *);=0A>> +=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0= =A0 (*x_getlong)(struct XDR *, long *);=0A>>=A0 =A0=A0=A0 =A0=A0=A0 /* put= a long to " */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_putlong)(stru= ct __rpc_xdr *, const long *);=0A>> +=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*= x_putlong)(struct XDR *, const long *);=0A>>=A0 =A0=A0=A0 =A0=A0=A0 /* get= some bytes from " */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 (*x_getbyte= s)(struct __rpc_xdr *, char *, u_int);=0A>> +=A0=A0=A0 =A0=A0=A0 bool_t=A0= =A0=A0 (*x_getbytes)(struct XDR *, char *, u_int);=0A>>=A0 =A0=A0=A0 =A0= =A0=A0 /* put some bytes to " */=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t=A0=A0=A0 = (*x_putbytes)(struct __rpc_xdr *, const char *, u_int);=0A>> +=A0=A0=A0 =A0= =A0=A0 bool_t=A0=A0=A0 (*x_putbytes)(struct XDR *, const char *, u_int);=0A= >>=A0 =A0=A0=A0 =A0=A0=A0 /* returns bytes off from beginning */=0A>> -=A0= =A0=A0 =A0=A0=A0 u_int=A0=A0=A0 (*x_getpostn)(struct __rpc_xdr *);=0A>> += =A0=A0=A0 =A0=A0=A0 u_int=A0=A0=A0 (*x_getpostn)(struct XDR *);=0A>>=A0 = =A0=A0=A0 =A0=A0=A0 /* lets you reposition the stream */=0A>> -=A0=A0=A0 = =A0=A0=A0 bool_t=A0 (*x_setpostn)(struct __rpc_xdr *, u_int);=0A>> +=A0=A0= =A0 =A0=A0=A0 bool_t=A0 (*x_setpostn)(struct XDR *, u_int);=0A>>=A0 =A0=A0= =A0 =A0=A0=A0 /* buf quick ptr to buffered data */=0A>> -=A0=A0=A0 =A0=A0= =A0 int32_t *(*x_inline)(struct __rpc_xdr *, u_int);=0A>> +=A0=A0=A0 =A0=A0= =A0 int32_t *(*x_inline)(struct XDR *, u_int);=0A>>=A0 =A0=A0=A0 =A0=A0=A0= /* free privates of this xdr_stream */=0A>> -=A0=A0=A0 =A0=A0=A0 void=A0= =A0=A0 (*x_destroy)(struct __rpc_xdr *);=0A>> -=A0=A0=A0 =A0=A0=A0 bool_t= =A0=A0=A0 (*x_control)(struct __rpc_xdr *, int, void *);=0A>> +=A0=A0=A0 = =A0=A0=A0 void=A0=A0=A0 (*x_destroy)(struct XDR *);=0A>> +=A0=A0=A0 =A0=A0= =A0 bool_t=A0=A0=A0 (*x_control)(struct XDR *, int, void *);=0A>>=A0 =A0= =A0=A0 } *x_ops;=0A>>=A0 =A0=A0=A0 char *=A0=A0=A0 =A0=A0=A0 x_public;=A0= =A0=A0 /* users' data */=0A>>=A0 =A0=A0=A0 void *=A0=A0=A0 =A0=A0=A0 x_pri= vate;=A0=A0=A0 /* pointer to private data */=0A>=0A>Don't __BEGIN_DECLS and= __END_DECLS do exactly that? i.e. it looks like =0A>some of the #ifdef's y= ou added are redundant.=0A>=0A>=0A> From owner-svn-src-head@FreeBSD.ORG Sun Sep 2 22:23:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E05321065670; Sun, 2 Sep 2012 22:23:24 +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 CA7658FC1A; Sun, 2 Sep 2012 22:23: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 q82MNOeO078030; Sun, 2 Sep 2012 22:23:24 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82MNOQr078013; Sun, 2 Sep 2012 22:23:24 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209022223.q82MNOQr078013@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 2 Sep 2012 22:23: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: r240062 - head/include/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 22:23:25 -0000 Author: pfg Date: Sun Sep 2 22:23:23 2012 New Revision: 240062 URL: http://svn.freebsd.org/changeset/base/240062 Log: Revert r240060: (Partial) __BEGIN_DECLS and __END_DECLS in cdefs.h take care of the __cplusplus mangling issues so most of the definitions were redundant. In the few places where they were not redundant we should use BSD style instead of the guards used upstream. Reported by: Yuri Pankov Modified: head/include/rpc/auth.h head/include/rpc/auth_unix.h head/include/rpc/clnt.h head/include/rpc/clnt_soc.h head/include/rpc/des_crypt.h head/include/rpc/nettype.h head/include/rpc/pmap_clnt.h head/include/rpc/pmap_rmt.h head/include/rpc/rpc_com.h head/include/rpc/rpc_msg.h head/include/rpc/rpcb_clnt.h head/include/rpc/rpcent.h head/include/rpc/rpcsec_gss.h head/include/rpc/svc.h head/include/rpc/svc_soc.h head/include/rpc/xdr.h Modified: head/include/rpc/auth.h ============================================================================== --- head/include/rpc/auth.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/auth.h Sun Sep 2 22:23:23 2012 (r240062) @@ -51,10 +51,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - #define MAX_AUTH_BYTES 400 #define MAXNETNAMELEN 255 /* maximum length of network user's name */ @@ -370,8 +366,4 @@ __END_DECLS #define RPCSEC_GSS_KRB5I 390004 #define RPCSEC_GSS_KRB5P 390005 -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_AUTH_H */ Modified: head/include/rpc/auth_unix.h ============================================================================== --- head/include/rpc/auth_unix.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/auth_unix.h Sun Sep 2 22:23:23 2012 (r240062) @@ -48,10 +48,6 @@ #define _RPC_AUTH_UNIX_H #include -#ifdef __cplusplus -extern "C" { -#endif - /* The machine name is part of a credential; it may not exceed 255 bytes */ #define MAX_MACHINE_NAME 255 @@ -85,8 +81,4 @@ struct short_hand_verf { struct opaque_auth new_cred; }; -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_AUTH_UNIX_H */ Modified: head/include/rpc/clnt.h ============================================================================== --- head/include/rpc/clnt.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/clnt.h Sun Sep 2 22:23:23 2012 (r240062) @@ -64,10 +64,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* * Well-known IPV6 RPC broadcast address. */ @@ -555,10 +551,6 @@ extern enum clnt_stat rpc_broadcast_exp( const int, const char *); __END_DECLS -#ifdef __cplusplus -} -#endif - /* For backward compatibility */ #include Modified: head/include/rpc/clnt_soc.h ============================================================================== --- head/include/rpc/clnt_soc.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/clnt_soc.h Sun Sep 2 22:23:23 2012 (r240062) @@ -49,10 +49,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ /* @@ -107,8 +103,4 @@ extern CLIENT *clntudp_bufcreate(struct struct timeval, int *, u_int, u_int); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* _RPC_CLNT_SOC_H */ Modified: head/include/rpc/des_crypt.h ============================================================================== --- head/include/rpc/des_crypt.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/des_crypt.h Sun Sep 2 22:23:23 2012 (r240062) @@ -47,10 +47,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - #define DES_MAXDATA 8192 /* max bytes encrypted in one call */ #define DES_DIRMASK (1 << 0) #define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */ @@ -107,8 +103,4 @@ __BEGIN_DECLS void des_setparity( char *); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* _DES_DES_CRYPT_H */ Modified: head/include/rpc/nettype.h ============================================================================== --- head/include/rpc/nettype.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/nettype.h Sun Sep 2 22:23:23 2012 (r240062) @@ -44,10 +44,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - #define _RPC_NONE 0 #define _RPC_NETPATH 1 #define _RPC_VISIBLE 2 @@ -65,8 +61,4 @@ extern struct netconfig *__rpc_getconf(v extern struct netconfig *__rpc_getconfip(const char *); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_NETTYPE_H */ Modified: head/include/rpc/pmap_clnt.h ============================================================================== --- head/include/rpc/pmap_clnt.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/pmap_clnt.h Sun Sep 2 22:23:23 2012 (r240062) @@ -66,10 +66,6 @@ #define _RPC_PMAP_CLNT_H_ #include -#ifdef __cplusplus -extern "C" { -#endif - __BEGIN_DECLS extern bool_t pmap_set(u_long, u_long, int, int); extern bool_t pmap_unset(u_long, u_long); @@ -87,8 +83,4 @@ extern u_short pmap_getport(struct sock u_long, u_long, u_int); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_PMAP_CLNT_H_ */ Modified: head/include/rpc/pmap_rmt.h ============================================================================== --- head/include/rpc/pmap_rmt.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/pmap_rmt.h Sun Sep 2 22:23:23 2012 (r240062) @@ -44,10 +44,6 @@ #define _RPC_PMAP_RMT_H #include -#ifdef __cplusplus -extern "C" { -#endif - struct rmtcallargs { u_long prog, vers, proc, arglen; caddr_t args_ptr; @@ -66,8 +62,4 @@ extern bool_t xdr_rmtcall_args(XDR *, st extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_PMAP_RMT_H */ Modified: head/include/rpc/rpc_com.h ============================================================================== --- head/include/rpc/rpc_com.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/rpc_com.h Sun Sep 2 22:23:23 2012 (r240062) @@ -42,13 +42,9 @@ #ifndef _RPC_RPCCOM_H #define _RPC_RPCCOM_H -/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ - #include -#ifdef __cplusplus -extern "C" { -#endif +/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ /* * The max size of the transport, if the size cannot be determined @@ -84,8 +80,4 @@ char *_get_next_token(char *, int); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* _RPC_RPCCOM_H */ Modified: head/include/rpc/rpc_msg.h ============================================================================== --- head/include/rpc/rpc_msg.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/rpc_msg.h Sun Sep 2 22:23:23 2012 (r240062) @@ -43,10 +43,6 @@ #ifndef _RPC_RPC_MSG_H #define _RPC_RPC_MSG_H -#ifdef __cplusplus -extern "C" { -#endif - #define RPC_MSG_VERSION ((u_int32_t) 2) #define RPC_SERVICE_PORT ((u_short) 2048) @@ -215,8 +211,4 @@ extern bool_t xdr_rejected_reply(XDR *, extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_RPC_MSG_H */ Modified: head/include/rpc/rpcb_clnt.h ============================================================================== --- head/include/rpc/rpcb_clnt.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/rpcb_clnt.h Sun Sep 2 22:23:23 2012 (r240062) @@ -61,10 +61,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - __BEGIN_DECLS extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t, const struct netconfig *, const struct netbuf *); @@ -86,8 +82,4 @@ extern char *rpcb_taddr2uaddr(struct net extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_RPCB_CLNT_H */ Modified: head/include/rpc/rpcent.h ============================================================================== --- head/include/rpc/rpcent.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/rpcent.h Sun Sep 2 22:23:23 2012 (r240062) @@ -45,9 +45,6 @@ /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */ /* @(#)rpcent.h 1.1 88/12/06 SMI */ -#ifdef __cplusplus -extern "C" { -#endif struct rpcent { char *r_name; /* name of server for this rpc program */ @@ -67,8 +64,4 @@ extern void setrpcent(int); extern void endrpcent(void); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_CENT_H */ Modified: head/include/rpc/rpcsec_gss.h ============================================================================== --- head/include/rpc/rpcsec_gss.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/rpcsec_gss.h Sun Sep 2 22:23:23 2012 (r240062) @@ -29,10 +29,6 @@ #ifndef _RPCSEC_GSS_H #define _RPCSEC_GSS_H -#ifdef __cplusplus -extern "C" { -#endif - #include #ifndef MAX_GSS_MECH @@ -180,8 +176,4 @@ bool_t __rpc_gss_set_error(int rpc_gss_e __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPCSEC_GSS_H */ Modified: head/include/rpc/svc.h ============================================================================== --- head/include/rpc/svc.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/svc.h Sun Sep 2 22:23:23 2012 (r240062) @@ -65,10 +65,6 @@ * parameters, struct svc_req * and SVCXPRT *, defined below. */ -#ifdef __cplusplus -extern "C" { -#endif - /* * Service control requests */ @@ -471,9 +467,6 @@ int __rpc_get_local_uid(SVCXPRT *_transp __END_DECLS -#ifdef __cplusplus -} -#endif /* for backward compatibility */ #include Modified: head/include/rpc/svc_soc.h ============================================================================== --- head/include/rpc/svc_soc.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/svc_soc.h Sun Sep 2 22:23:23 2012 (r240062) @@ -49,10 +49,6 @@ * with TS-RPC */ -#ifdef __cplusplus -extern "C" { -#endif - /* * Approved way of getting address of caller */ @@ -117,8 +113,4 @@ __BEGIN_DECLS extern SVCXPRT *svcfd_create(int, u_int, u_int); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_SVC_SOC_H */ Modified: head/include/rpc/xdr.h ============================================================================== --- head/include/rpc/xdr.h Sun Sep 2 21:44:24 2012 (r240061) +++ head/include/rpc/xdr.h Sun Sep 2 22:23:23 2012 (r240062) @@ -43,10 +43,6 @@ #define _RPC_XDR_H #include -#ifdef __cplusplus -extern "C" { -#endif - /* * XDR provides a conventional way for converting between C data * types and an external bit-string representation. Library supplied @@ -370,8 +366,4 @@ extern bool_t xdrrec_eof(XDR *); extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); __END_DECLS -#ifdef __cplusplus -} -#endif - #endif /* !_RPC_XDR_H */ From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 00:05:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32E65106564A; Mon, 3 Sep 2012 00:05:22 +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 1D4178FC08; Mon, 3 Sep 2012 00:05: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 q8305Lj7089998; Mon, 3 Sep 2012 00:05:21 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8305LTo089995; Mon, 3 Sep 2012 00:05:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209030005.q8305LTo089995@svn.freebsd.org> From: Glen Barber Date: Mon, 3 Sep 2012 00:05: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: r240063 - in head/cddl/contrib/opensolaris/cmd: zfs zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 00:05:22 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 3 00:05:21 2012 New Revision: 240063 URL: http://svn.freebsd.org/changeset/base/240063 Log: Add myself to copyright sections, per CDDL license. Requested by: mm Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Sep 2 22:23:23 2012 (r240062) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Sep 3 00:05:21 2012 (r240063) @@ -22,6 +22,7 @@ .\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek +.\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Sep 2 22:23:23 2012 (r240062) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Sep 3 00:05:21 2012 (r240063) @@ -21,6 +21,7 @@ .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs .\" Copyright (c) 2012 by Delphix. All Rights Reserved. +.\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 02:32:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F419106564A; Mon, 3 Sep 2012 02:32:01 +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 6AD9B8FC18; Mon, 3 Sep 2012 02:32: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 q832W1cb005868; Mon, 3 Sep 2012 02:32:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q832W13t005866; Mon, 3 Sep 2012 02:32:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209030232.q832W13t005866@svn.freebsd.org> From: Alan Cox Date: Mon, 3 Sep 2012 02:32: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: r240065 - head/sys/dev/gxemul/disk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 02:32:01 -0000 Author: alc Date: Mon Sep 3 02:32:00 2012 New Revision: 240065 URL: http://svn.freebsd.org/changeset/base/240065 Log: Correct an error in gxemul_disk_write(). It was issuing the command to read from rather than write to the emulated disk. Reviewed by: jmallett Modified: head/sys/dev/gxemul/disk/gxemul_disk.c Modified: head/sys/dev/gxemul/disk/gxemul_disk.c ============================================================================== --- head/sys/dev/gxemul/disk/gxemul_disk.c Mon Sep 3 02:25:20 2012 (r240064) +++ head/sys/dev/gxemul/disk/gxemul_disk.c Mon Sep 3 02:32:00 2012 (r240065) @@ -286,7 +286,7 @@ gxemul_disk_write(unsigned diskid, const dst = GXEMUL_DISK_DEV_FUNCTION(GXEMUL_DISK_DEV_BLOCK); memcpy((void *)(uintptr_t)dst, buf, GXEMUL_DISK_DEV_BLOCKSIZE); - GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_START, GXEMUL_DISK_DEV_START_READ); + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_START, GXEMUL_DISK_DEV_START_WRITE); switch (GXEMUL_DISK_DEV_READ(GXEMUL_DISK_DEV_STATUS)) { case GXEMUL_DISK_DEV_STATUS_FAILURE: return (EIO); From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 07:02:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8B3D1065690 for ; Mon, 3 Sep 2012 07:02:39 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 249CF8FC1C for ; Mon, 3 Sep 2012 07:02:38 +0000 (UTC) Received: by lage12 with SMTP id e12so4150084lag.13 for ; Mon, 03 Sep 2012 00:02:37 -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=oX0L5tNG7IAzgeAIJkL2J9me8i7Wn1CkYVegx6TxtBc=; b=pSl4fztQzfsP5lqO/wal2UGgeTZEyUfwMyPShIyq0j4Kfxdv89P5nhYP20Ay9i9BaO 88oiXKzqkSEJ0LzHT+9KQ0aX3k5ROsqvHUissPTXAOOKvXXqmNnJlVTrFydnB20ADE4C LYG8AMEAuNFf6oDXCj5GSeVLy517+aK2rp4Msf3XqV3Nr/YvnRSNdPpr9gzIwSGFuu2I LMifOkAZEIN6iDhmyKuRxthJZnHH/AaEv5WB8rf2cwTnpx+SYLCNnc59TrtioijLP4Tj lN04fZ3pfN/qHV04u1bDogjAk6ym7UP8q4kM0klite4v0G14/NfwmMJK2CZqr65n77by oIwg== Received: by 10.112.103.167 with SMTP id fx7mr2508969lbb.44.1346655757724; Mon, 03 Sep 2012 00:02:37 -0700 (PDT) Received: from zont-osx.local (ppp95-165-143-86.pppoe.spdop.ru. [95.165.143.86]) by mx.google.com with ESMTPS id hg4sm12659134lab.11.2012.09.03.00.02.36 (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 00:02:36 -0700 (PDT) Sender: Andrey Zonov Message-ID: <50445609.8070902@FreeBSD.org> Date: Mon, 03 Sep 2012 11:02:33 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Garrett Cooper References: <201209021739.q82Hd3CE042578@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1DE189EBF5C3297B1F032688" X-Gm-Message-State: ALoCoQkr0d6EXx1n5F3m87AS7XE4tvIvXnLdJLfjiElVVp4xigMVKBe+FSXYZGMeqqgjQqks+jDX Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 07:02:39 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1DE189EBF5C3297B1F032688 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 9/3/12 1:20 AM, Garrett Cooper wrote: > On Sun, Sep 2, 2012 at 2:16 PM, Garrett Cooper wro= te: >> On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov wrote= : >>> Author: zont >>> Date: Sun Sep 2 17:39:02 2012 >>> New Revision: 240026 >>> URL: http://svn.freebsd.org/changeset/base/240026 >>> >>> Log: >>> - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern= =2Emaxssiz >>> and kern.sgrowsiz sysctls writable. >>> >>> Approved by: kib (mentor) >>> >>> Modified: >>> head/sys/kern/subr_param.c >=20 > ... >=20 >> >> Please add some basic sanity checking to init_param1 -- there's >> absolutely nothing preventing me from passing in values <=3D 0 or othe= r >=20 > Correction: values =3D=3D 0 with little effort (missed the part where i= t > was using TUNABLE_ULONG_FETCH). You could get negative values though > if you overflow the value passed in -- in part because the getenv* > functions in kern_environment.c don't check for/handle overflow > gracefully .. I had a patch out for this a while ago that never made > it in. >=20 >> non-performant (non-multiple of PAGE_SIZE, whacky ratios, etc) values.= >> Thanks, >> -Garrett I thought of sanity checking here, but there weren't for tunables and I did't want to add any "magic numbers" in this code. I don't think that we should check for multiple of PAGE_SIZE, may be only for sgrowsiz and even not checking, just rounding up. If you have those "magic numbers" I would love to add it. --=20 Andrey Zonov --------------enig1DE189EBF5C3297B1F032688 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 iQEcBAEBAgAGBQJQRFYLAAoJEBWLemxX/CvT6WAH/RjhZHIPQpHNIMa0hu7i1K6e 5DVNt1MmnBEomlRDYXHKIrYrAienvaoqyyXKjYVVGm3Vmw3Hs6rwNEg+aP2SbF1U mTDqHJdViWoil1K2EjAGMtnRleBUkDe+XyjHKLgyf+gu60br1O09ND77GdVxj0nh cP8SenPUoQs/V+4DEn8Sn9oZDdq3LZQgntJGaxPUs1dfGrDBCdsk4yWUE0blD+f+ Du3kkKUwBh9iJ0cLX46hgYcRhVNBCxejjsPUqpJxbW0QBML3FEejbXtx0bUlETpu pk27Y837KBQETt9ODja5rcF1fw1kGaSLnmkPBr30qaZSYf/wdrRIz2OYHrGk81E= =eRXG -----END PGP SIGNATURE----- --------------enig1DE189EBF5C3297B1F032688-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 07:31:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52615106566C; Mon, 3 Sep 2012 07:31:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C0D7B8FC08; Mon, 3 Sep 2012 07:31:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q837VjUw029667; Mon, 3 Sep 2012 10:31:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q837VX7N031076; Mon, 3 Sep 2012 10:31:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q837VXcD031075; Mon, 3 Sep 2012 10:31:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Sep 2012 10:31:33 +0300 From: Konstantin Belousov To: "Pedro F. Giffuni" Message-ID: <20120903073133.GB33100@deviant.kiev.zoral.com.ua> References: <201209022104.q82L4eru068961@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RzVoCur9CYlE2OzC" Content-Disposition: inline In-Reply-To: <201209022104.q82L4eru068961@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 07:31:41 -0000 --RzVoCur9CYlE2OzC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 02, 2012 at 09:04:40PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Sep 2 21:04:40 2012 > New Revision: 240060 > URL: http://svn.freebsd.org/changeset/base/240060 >=20 > Log: > Fix RPC headers for C++ > =20 > C++ mangling will cause trouble with variables like __rpc_xdr > in xdr.h so rename this to XDR. Which troubles ? Although not very useful due to many other namespace pollution problems in the rpc headers, __rpc_xdr is in the implementation-reserved namespace, while XDR is not. --RzVoCur9CYlE2OzC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBEXNUACgkQC3+MBN1Mb4iMjwCfag464pP60T/2LuGzyTG2XEIU T8oAn0yq4d7OKnirD+dzHyO5q/TKPUz1 =e34s -----END PGP SIGNATURE----- --RzVoCur9CYlE2OzC-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 08:52:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9417E106564A; Mon, 3 Sep 2012 08:52:06 +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 656258FC1B; Mon, 3 Sep 2012 08:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q838q6Z5053407; Mon, 3 Sep 2012 08:52:06 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q838q6lC053405; Mon, 3 Sep 2012 08:52:06 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201209030852.q838q6lC053405@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 3 Sep 2012 08:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 08:52:06 -0000 Author: ray Date: Mon Sep 3 08:52:05 2012 New Revision: 240067 URL: http://svn.freebsd.org/changeset/base/240067 Log: Add kern.hintmode sysctl variable to show current state of hints: 0 - loader hints in environment only; 1 - static hints only 2 - fallback mode (Dynamic KENV with fallback to kernel environment) Add kern.hintmode write handler, accept only value 2. That will switch static KENV to dynamic. So it will be possible to change device hints. Approved by: adrian (mentor) Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Mon Sep 3 07:18:24 2012 (r240066) +++ head/sys/kern/subr_hints.c Mon Sep 3 08:52:05 2012 (r240067) @@ -29,8 +29,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include /* @@ -42,6 +44,81 @@ static int use_kenv; static char *hintp; /* + * Define kern.hintmode sysctl, which only accept value 2, that cause to + * switch from Static KENV mode to Dynamic KENV. So systems that have hints + * compiled into kernel will be able to see/modify KENV (and hints too). + */ + +static int +sysctl_hintmode(SYSCTL_HANDLER_ARGS) +{ + int error, i, from_kenv, value, eqidx; + const char *cp; + char *line, *eq; + + from_kenv = 0; + cp = kern_envp; + value = hintmode; + + /* Fetch candidate for new hintmode value */ + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || !req->newptr) + return (error); + + if (value != 2) + /* Only accept swithing to hintmode 2 */ + return (EINVAL); + + /* Migrate from static to dynamic hints */ + switch (hintmode) { + case 0: + if (dynamic_kenv) + /* Already here */ + hintmode = value; /* XXX: Need we switch or not ? */ + return (0); + from_kenv = 1; + cp = kern_envp; + break; + case 1: + cp = static_hints; + break; + case 2: + /* Nothing to do, hintmode already 2 */ + return (0); + } + + while (cp) { + i = strlen(cp); + if (i == 0) + break; + if (from_kenv) { + if (strncmp(cp, "hint.", 5) != 0) + /* kenv can have not only hints */ + continue; + } + eq = strchr(cp, '='); + if (!eq) + /* Bad hint value */ + continue; + eqidx = eq - cp; + + line = malloc(i+1, M_TEMP, M_WAITOK); + strcpy(line, cp); + line[eqidx] = '\0'; + setenv(line, line + eqidx + 1); + free(line, M_TEMP); + cp += i + 1; + } + + hintmode = value; + use_kenv = 1; + return (0); +} + +SYSCTL_PROC(_kern, OID_AUTO, hintmode, CTLTYPE_INT|CTLFLAG_RW, + &hintmode, 0, sysctl_hintmode, "I", "Get/set current hintmode"); + +/* * Evil wildcarding resource string lookup. * This walks the supplied env string table and returns a match. * The start point can be remembered for incremental searches. From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:05:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 545411065673; Mon, 3 Sep 2012 09:05:14 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1120F8FC16; Mon, 3 Sep 2012 09:05:13 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so7690202pbb.13 for ; Mon, 03 Sep 2012 02:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=3cSlDRen1/L+5dF+Ed2uRAci+Rz5/7ZWHYXBjSO0KSI=; b=SP0JpPA9upyRNft3GHp+2BDqqdjT/ZjNLlI8RuyRCvonqqmXJHnNHj+rhxzpJZZFbR vfevFjJZCNnRuWUzCvsxnU+Ibnn2U76ezVgTwlzJLSingGZhUvgsATJFoqmyKi/wFyGs HRQSzTTa4kz/9WH652pXT1iDk+YqmDDIPpQIMy0y2s4Bvl/+bvUuR87ZRt4B5/6qzlg8 uo2EgziNlqvO3tbRlL8RSwUPbGUI35ol+GoaTFu73wUFyYh/QvQZ9PwaJh1kBmt1DFfd xUMk+aYwLIHJG5JVg0xXIJn64TRygkvNOKCKd4bnf/B/7AUxvBpG1RxvYXCJFrK2IYPG vKpw== Received: by 10.66.74.3 with SMTP id p3mr32539115pav.49.1346663113455; Mon, 03 Sep 2012 02:05:13 -0700 (PDT) Received: from fuji-wireless.local (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id gf8sm9505941pbc.52.2012.09.03.02.05.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Sep 2012 02:05:12 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201209030852.q838q6lC053405@svn.freebsd.org> Date: Mon, 3 Sep 2012 02:05:15 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201209030852.q838q6lC053405@svn.freebsd.org> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:05:14 -0000 On Sep 3, 2012, at 1:52 AM, Aleksandr Rybalko wrote: > Author: ray > Date: Mon Sep 3 08:52:05 2012 > New Revision: 240067 > URL: http://svn.freebsd.org/changeset/base/240067 > > Log: > Add kern.hintmode sysctl variable to show current state of hints: > 0 - loader hints in environment only; > 1 - static hints only > 2 - fallback mode (Dynamic KENV with fallback to kernel environment) > Add kern.hintmode write handler, accept only value 2. That will switch > static KENV to dynamic. So it will be possible to change device hints. ... > + /* Migrate from static to dynamic hints */ > + switch (hintmode) { > + case 0: > + if (dynamic_kenv) > + /* Already here */ > + hintmode = value; /* XXX: Need we switch or not ? */ > + return (0); ^^^^ typo (missing braces)? ^^^^ Also, don't you need extra glue for jails? -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:21:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8692106566B; Mon, 3 Sep 2012 09:21:55 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 900DC8FC19; Mon, 3 Sep 2012 09:21:55 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) by smtp.dlink.ua (Postfix) with SMTP id 705EDC4935; Mon, 3 Sep 2012 12:21:54 +0300 (EEST) Date: Mon, 3 Sep 2012 12:23:52 +0300 From: Aleksandr Rybalko To: Garrett Cooper Message-Id: <20120903122352.951b4253.ray@freebsd.org> In-Reply-To: References: <201209030852.q838q6lC053405@svn.freebsd.org> Organization: FreeBSD Project X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:21:56 -0000 On Mon, 3 Sep 2012 02:05:15 -0700 Garrett Cooper wrote: >> On Sep 3, 2012, at 1:52 AM, Aleksandr Rybalko wrote: >> >> > Author: ray >> > Date: Mon Sep 3 08:52:05 2012 >> > New Revision: 240067 >> > URL: http://svn.freebsd.org/changeset/base/240067 >> > >> > Log: >> > Add kern.hintmode sysctl variable to show current state of hints: >> > 0 - loader hints in environment only; >> > 1 - static hints only >> > 2 - fallback mode (Dynamic KENV with fallback to kernel >> > environment) Add kern.hintmode write handler, accept only value 2. >> > That will switch static KENV to dynamic. So it will be possible to >> > change device hints. >> >> ... >> >> > + /* Migrate from static to dynamic hints */ >> > + switch (hintmode) { >> > + case 0: >> > + if (dynamic_kenv) >> > + /* Already here */ >> > + hintmode = value; /* XXX: Need we switch >> > or not ? */ >> > + return (0); >> >> ^^^^ typo (missing braces)? ^^^^ Ohhh, yeah, testing now. Thank you! >> >> Also, don't you need extra glue for jails? Why, jails uses separate hints/kenv? >> >> -Garrett Thanks. -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:26:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D75121065675; Mon, 3 Sep 2012 09:26:56 +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 A7A898FC15; Mon, 3 Sep 2012 09:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q839Quxn057759; Mon, 3 Sep 2012 09:26:56 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q839Qut7057757; Mon, 3 Sep 2012 09:26:56 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209030926.q839Qut7057757@svn.freebsd.org> From: Andrey Zonov Date: Mon, 3 Sep 2012 09:26: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: r240068 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:26:57 -0000 Author: zont Date: Mon Sep 3 09:26:56 2012 New Revision: 240068 URL: http://svn.freebsd.org/changeset/base/240068 Log: - Mark some sysctls with CTLFLAG_TUN flag instead of CTLFLAG_RDTUN. Pointed out by: avg Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Mon Sep 3 08:52:05 2012 (r240067) +++ head/sys/kern/subr_param.c Mon Sep 3 09:26:56 2012 (r240068) @@ -119,18 +119,18 @@ SYSCTL_LONG(_kern, OID_AUTO, maxswzone, "Maximum memory for swap metadata"); SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, "Maximum value of vfs.maxbufspace"); -SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxtsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RW | CTLFLAG_TUN, &maxtsiz, 0, "Maximum text size"); -SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dfldsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RW | CTLFLAG_TUN, &dfldsiz, 0, "Initial data size limit"); -SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxdsiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxdsiz, CTLFLAG_RW | CTLFLAG_TUN, &maxdsiz, 0, "Maximum data size"); -SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &dflssiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, dflssiz, CTLFLAG_RW | CTLFLAG_TUN, &dflssiz, 0, "Initial stack size limit"); -SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RDTUN | CTLFLAG_RW, &maxssiz, 0, +SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, CTLFLAG_RW | CTLFLAG_TUN, &maxssiz, 0, "Maximum stack size"); -SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN | CTLFLAG_RW, &sgrowsiz, - 0, "Amount to grow stack on a stack fault"); +SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RW | CTLFLAG_TUN, &sgrowsiz, 0, + "Amount to grow stack on a stack fault"); SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest, "A", "Virtual machine guest detected? (none|generic|xen)"); From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:32:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B6881065676 for ; Mon, 3 Sep 2012 09:32:20 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D14E98FC21 for ; Mon, 3 Sep 2012 09:32:19 +0000 (UTC) Received: by lage12 with SMTP id e12so4240196lag.13 for ; Mon, 03 Sep 2012 02:32:13 -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=of/oc5y1FVArsHRTW2NqcTYhHWkALlddvkfxRuFWIZ0=; b=Kx1ksC7D2pYrwkfeztxRfXjdLP4B5UdERGdf8VvMhdwW1WYffuTxg3hPzXyMUBg2ak ymixRFLIUZL2OQ+dq9VA+ujcS4OnWRN9aDLU05tWRYv4jpe6H084lbY0zRew+3TAtoMF bB7e4R1TpR3KeAlNuH+XNQO/7weRfIcKgQ0B7dMc+uWvYbEXPvOJBjo7yCUdGU58oO6i PJDAbBhKdEdghhjZ2ReZMfQZlC0cwyecEVNoOBpvKiM3WD/6xk9VXLlfIJmuGYwM2Lep JYcBEvt0FZ5WPUFnPxI1CkaDSJJuT2xR4E4sdPd7cUIWV1ulgetdl7wsfcYEssTxDsNS EaAw== Received: by 10.112.99.37 with SMTP id en5mr5285841lbb.25.1346664733538; Mon, 03 Sep 2012 02:32:13 -0700 (PDT) Received: from dhcp170-234-red.yandex.net (dhcp170-234-red.yandex.net. [95.108.170.234]) by mx.google.com with ESMTPS id lv13sm12998592lab.8.2012.09.03.02.32.12 (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 02:32:12 -0700 (PDT) Sender: Andrey Zonov Message-ID: <50447918.9070601@FreeBSD.org> Date: Mon, 03 Sep 2012 13:32:08 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Andriy Gapon References: <201209021739.q82Hd3CE042578@svn.freebsd.org> <5043AD9C.1060508@FreeBSD.org> In-Reply-To: <5043AD9C.1060508@FreeBSD.org> X-Enigmail-Version: 1.4.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig52BDC908A4C7A32F13EF3DB8" X-Gm-Message-State: ALoCoQkogfBSU0Lo09Rbv6p51oZB/wnToT5iYpqlchON4wdr5qY2ZEFTLqy7/HJ/vF0bxQqGHd1s Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:32:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig52BDC908A4C7A32F13EF3DB8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 9/2/12 11:03 PM, Andriy Gapon wrote: > on 02/09/2012 20:39 Andrey Zonov said the following: >> CTLFLAG_RDTUN | CTLFLAG_RW >=20 > This combination looks like nonsense to me (because of "RD"). >=20 > CTLFLAG_RDTUN Advisory flag that a system tunable also exists for th= is > variable; however, the run-time variable is read-only.= >=20 > Probably you meant CTLFLAG_RW | CTLFLAG_TUN >=20 Yes, thanks for pointing that out. --=20 Andrey Zonov --------------enig52BDC908A4C7A32F13EF3DB8 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 iQEcBAEBAgAGBQJQRHkbAAoJEBWLemxX/CvTq+gH/0oUyW17t32sFqCm0yQVfKMl FhDFJthictnFyncCwpRXY6BuL9z9BSHKQlih1xXaBSC5QN809rO+nSMeLOg27fJe TThCRcw6zDw6Jd6vr86Ms2NvGOQn7DquHei08gmpMfmCNFFCYB8sQrrKeKBx8HJq eG2EIzgMXl63x5xuEGqYr8raHvdD4jFOPelGk3GSvm8XoAL3kfZUJ8SSsRa74aTr Yn+PKHkI6HKNZUzBfi0aTuF1QSvfNzK9/28yo4qUCpB3fpC+5tNkUqDyAJb9eYbp zoXEHNYDdgrBksZKrz2pUa4/PNOR+2qGrcVtgpeg8wkpu0eMiTkxDRPaoOrxkIg= =TqgX -----END PGP SIGNATURE----- --------------enig52BDC908A4C7A32F13EF3DB8-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:34:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65C731065677; Mon, 3 Sep 2012 09:34:47 +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 4F4E88FC1B; Mon, 3 Sep 2012 09: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 q839YlDo058910; Mon, 3 Sep 2012 09:34:47 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q839YljR058908; Mon, 3 Sep 2012 09:34:47 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209030934.q839YljR058908@svn.freebsd.org> From: Andrey Zonov Date: Mon, 3 Sep 2012 09:34: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: r240069 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:34:47 -0000 Author: zont Date: Mon Sep 3 09:34:46 2012 New Revision: 240069 URL: http://svn.freebsd.org/changeset/base/240069 Log: - After r240026 sgrowsiz should be used in a safer maner. Approved by: kib (mentor) MCF after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Sep 3 09:26:56 2012 (r240068) +++ head/sys/vm/vm_map.c Mon Sep 3 09:34:46 2012 (r240069) @@ -3245,7 +3245,7 @@ vm_map_stack(vm_map_t map, vm_offset_t a { vm_map_entry_t new_entry, prev_entry; vm_offset_t bot, top; - vm_size_t init_ssize; + vm_size_t growsize, init_ssize; int orient, rv; rlim_t vmemlim; @@ -3264,7 +3264,8 @@ vm_map_stack(vm_map_t map, vm_offset_t a addrbos + max_ssize < addrbos) return (KERN_NO_SPACE); - init_ssize = (max_ssize < sgrowsiz) ? max_ssize : sgrowsiz; + growsize = sgrowsiz; + init_ssize = (max_ssize < growsize) ? max_ssize : growsize; PROC_LOCK(curthread->td_proc); vmemlim = lim_cur(curthread->td_proc, RLIMIT_VMEM); @@ -3357,6 +3358,7 @@ vm_map_growstack(struct proc *p, vm_offs struct vmspace *vm = p->p_vmspace; vm_map_t map = &vm->vm_map; vm_offset_t end; + vm_size_t growsize; size_t grow_amount, max_grow; rlim_t stacklim, vmemlim; int is_procstack, rv; @@ -3476,8 +3478,9 @@ Retry: PROC_UNLOCK(p); #endif - /* Round up the grow amount modulo SGROWSIZ */ - grow_amount = roundup (grow_amount, sgrowsiz); + /* Round up the grow amount modulo sgrowsiz */ + growsize = sgrowsiz; + grow_amount = roundup(grow_amount, growsize); if (grow_amount > stack_entry->avail_ssize) grow_amount = stack_entry->avail_ssize; if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:46:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FA5B1065670; Mon, 3 Sep 2012 09:46:47 +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 6AE718FC15; Mon, 3 Sep 2012 09:46: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 q839klsf060464; Mon, 3 Sep 2012 09:46:47 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q839klx0060462; Mon, 3 Sep 2012 09:46:47 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201209030946.q839klx0060462@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 3 Sep 2012 09:46: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: r240070 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:46:47 -0000 Author: ray Date: Mon Sep 3 09:46:46 2012 New Revision: 240070 URL: http://svn.freebsd.org/changeset/base/240070 Log: Add missing braces. Approved by: bschmidt (while mentor offline) Pointed by: gcooper Pointy hat to: ray Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Mon Sep 3 09:34:46 2012 (r240069) +++ head/sys/kern/subr_hints.c Mon Sep 3 09:46:46 2012 (r240070) @@ -72,10 +72,11 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) /* Migrate from static to dynamic hints */ switch (hintmode) { case 0: - if (dynamic_kenv) + if (dynamic_kenv) { /* Already here */ hintmode = value; /* XXX: Need we switch or not ? */ return (0); + } from_kenv = 1; cp = kern_envp; break; From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 09:49:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A365106564A; Mon, 3 Sep 2012 09:49:13 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id F119D8FC0C; Mon, 3 Sep 2012 09:49:12 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) by smtp.dlink.ua (Postfix) with SMTP id 918B7C4936; Mon, 3 Sep 2012 12:49:11 +0300 (EEST) Date: Mon, 3 Sep 2012 12:51:10 +0300 From: Aleksandr Rybalko To: Garrett Cooper Message-Id: <20120903125110.4420a12c.ray@freebsd.org> In-Reply-To: References: <201209030852.q838q6lC053405@svn.freebsd.org> Organization: FreeBSD Project X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 09:49:13 -0000 On Mon, 3 Sep 2012 02:05:15 -0700 Garrett Cooper wrote: >> On Sep 3, 2012, at 1:52 AM, Aleksandr Rybalko wrote: >> >> > Author: ray >> > Date: Mon Sep 3 08:52:05 2012 >> > New Revision: 240067 >> > URL: http://svn.freebsd.org/changeset/base/240067 >> > >> > Log: >> > Add kern.hintmode sysctl variable to show current state of hints: >> > 0 - loader hints in environment only; >> > 1 - static hints only >> > 2 - fallback mode (Dynamic KENV with fallback to kernel >> > environment) Add kern.hintmode write handler, accept only value 2. >> > That will switch static KENV to dynamic. So it will be possible to >> > change device hints. >> >> ... >> >> > + /* Migrate from static to dynamic hints */ >> > + switch (hintmode) { >> > + case 0: >> > + if (dynamic_kenv) >> > + /* Already here */ >> > + hintmode = value; /* XXX: Need we switch >> > or not ? */ >> > + return (0); >> >> ^^^^ typo (missing braces)? ^^^^ Fixed. >> >> Also, don't you need extra glue for jails? >> >> -Garrett Thanks Garrett! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 10:08:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F741065673; Mon, 3 Sep 2012 10:08:21 +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 F314B8FC0A; Mon, 3 Sep 2012 10:08: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 q83A8KV2063385; Mon, 3 Sep 2012 10:08:20 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83A8KYn063383; Mon, 3 Sep 2012 10:08:20 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209031008.q83A8KYn063383@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 3 Sep 2012 10:08: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: r240071 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 10:08:21 -0000 Author: glebius Date: Mon Sep 3 10:08:20 2012 New Revision: 240071 URL: http://svn.freebsd.org/changeset/base/240071 Log: Change bridge(4) to use if_transmit for forwarding packets to underlying interfaces instead of queueing. Tested by: ray Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Mon Sep 3 09:46:46 2012 (r240070) +++ head/sys/net/if_bridge.c Mon Sep 3 10:08:20 2012 (r240071) @@ -245,11 +245,12 @@ static void bridge_ifdetach(void *arg __ static void bridge_init(void *); static void bridge_dummynet(struct mbuf *, struct ifnet *); static void bridge_stop(struct ifnet *, int); -static void bridge_start(struct ifnet *); +static int bridge_transmit(struct ifnet *, struct mbuf *); +static void bridge_qflush(struct ifnet *); static struct mbuf *bridge_input(struct ifnet *, struct mbuf *); static int bridge_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); -static void bridge_enqueue(struct bridge_softc *, struct ifnet *, +static int bridge_enqueue(struct bridge_softc *, struct ifnet *, struct mbuf *); static void bridge_rtdelete(struct bridge_softc *, struct ifnet *ifp, int); @@ -600,12 +601,10 @@ bridge_clone_create(struct if_clone *ifc if_initname(ifp, ifc->ifc_name, unit); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = bridge_ioctl; - ifp->if_start = bridge_start; + ifp->if_transmit = bridge_transmit; + ifp->if_qflush = bridge_qflush; ifp->if_init = bridge_init; ifp->if_type = IFT_BRIDGE; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); /* * Generate an ethernet address with a locally administered address. @@ -1780,7 +1779,7 @@ bridge_stop(struct ifnet *ifp, int disab * Enqueue a packet on a bridge member interface. * */ -static void +static int bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m) { int len, err = 0; @@ -1823,6 +1822,8 @@ bridge_enqueue(struct bridge_softc *sc, if (mflags & M_MCAST) sc->sc_ifp->if_omcasts++; } + + return (err); } /* @@ -1981,44 +1982,43 @@ sendunicast: } /* - * bridge_start: + * bridge_transmit: * - * Start output on a bridge. + * Do output on a bridge. * */ -static void -bridge_start(struct ifnet *ifp) +static int +bridge_transmit(struct ifnet *ifp, struct mbuf *m) { struct bridge_softc *sc; - struct mbuf *m; - struct ether_header *eh; - struct ifnet *dst_if; + int error = 0; sc = ifp->if_softc; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - for (;;) { - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == 0) - break; - ETHER_BPF_MTAP(ifp, m); + ETHER_BPF_MTAP(ifp, m); + + + BRIDGE_LOCK(sc); + if ((m->m_flags & (M_BCAST|M_MCAST)) == 0) { + struct ether_header *eh; + struct ifnet *dst_if; eh = mtod(m, struct ether_header *); - dst_if = NULL; + dst_if = bridge_rtlookup(sc, eh->ether_dhost, 1); + BRIDGE_UNLOCK(sc); + error = bridge_enqueue(sc, dst_if, m); + } else + bridge_broadcast(sc, ifp, m, 0); - BRIDGE_LOCK(sc); - if ((m->m_flags & (M_BCAST|M_MCAST)) == 0) { - dst_if = bridge_rtlookup(sc, eh->ether_dhost, 1); - } + return (error); +} - if (dst_if == NULL) - bridge_broadcast(sc, ifp, m, 0); - else { - BRIDGE_UNLOCK(sc); - bridge_enqueue(sc, dst_if, m); - } - } - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +/* + * The ifp->if_qflush entry point for if_bridge(4) is no-op. + */ +static void +bridge_qflush(struct ifnet *ifp __unused) +{ } /* From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 14:13:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 959731065674 for ; Mon, 3 Sep 2012 14:13:25 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm7-vm0.bullet.mail.sp2.yahoo.com (nm7-vm0.bullet.mail.sp2.yahoo.com [98.139.91.192]) by mx1.freebsd.org (Postfix) with SMTP id 4FDC18FC12 for ; Mon, 3 Sep 2012 14:13:25 +0000 (UTC) Received: from [98.139.91.63] by nm7.bullet.mail.sp2.yahoo.com with NNFMP; 03 Sep 2012 14:13:19 -0000 Received: from [98.139.91.4] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 03 Sep 2012 14:13:19 -0000 Received: from [127.0.0.1] by omp1004.mail.sp2.yahoo.com with NNFMP; 03 Sep 2012 14:13:19 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 472990.30069.bm@omp1004.mail.sp2.yahoo.com Received: (qmail 67716 invoked by uid 60001); 3 Sep 2012 14:13:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1346681599; bh=7Lc9wwkmTki92z01Qz6aAKuaXI1Mo1pU32zD2qq7E8E=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2N4ysIQc2Z5V1MxbyxxPN2wdJZgKKZBbIHclx5qWIeucNy84NzJLMVVli8lLifcCUOExqyoeW2IiKbULHvX3prX3eLK8SOeW0WOVGyVSBw1AnoFaEHiyYENSyiTXFzqZYmCtwSGFpXvcU5LIM2Bn/ViCZD0CpCF2in1XyUkxa+c= X-YMail-OSG: pe9h61wVM1n2FcrsA.NJVGLcD9g1eV4n4DxESpt1Wm_4aP2 DY97.bNts1O4sU7h8eCByINb0YSagQfqA73ghs6OTOnkWAeCN4WzMA5X.6si zC3w4FuCQ37zpm3qzVVJk7Me2EuFGPcBhiAoF3ifWXoMIz7cJmuM.9iW.S1o QQIG93FCXplak739OICcrlwwT_dRipmIFKqVJODeC5wFJYVy6E1U3.ARUgcZ A7yQgLN4znIVgMjdyoRdcQa2IZBtNYAy9g3vN.x24vE0Nn3nnW17vuAh6aYS LFhNyFcxjVt5gLIJ_wbDcCYxDA4_blsnkP3qleCebLqly3QXLaOYOIpNMaW_ 3a5hqyhTp4SON_RaPncAG23y9Dl6G6YPbeCITIsJNR2E2YQ4uwWYDpn8ds9k 5b.nKDJb4VGQKxy0oDlBw3WnaPpIX5BQhmD89h3LR_gvqdgNlQfi1rr1jAwj lwsSYpjy4bH3hgdAPnxEFM_iOhNyxstQ.dUsKMkXOikOh2vQ6UM6NIIqlzPs G1x1aQ6qn5m0JifqVptekMyN9r17Uv2EyoOGEBcMvTYFKtIvSg9rT80NeJbf IACOfx3ftrZosN56b_5HRwSK_EbWlJw-- Received: from [200.118.157.7] by web113502.mail.gq1.yahoo.com via HTTP; Mon, 03 Sep 2012 07:13:19 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.121.416 Message-ID: <1346681599.92069.YahooMailClassic@web113502.mail.gq1.yahoo.com> Date: Mon, 3 Sep 2012 07:13:19 -0700 (PDT) From: Pedro Giffuni To: Konstantin Belousov In-Reply-To: <20120903073133.GB33100@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 14:13:25 -0000 Hello, Sorry for the brevity but I can inly anser on a mobile device right now ... --- Lun 3/9/12, Konstantin Belousov ha scritto: > Da: Konstantin Belousov > Oggetto: Re: svn commit: r240060 - in head: include/rpc sys/rpc > A: "Pedro F. Giffuni" > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@fre= ebsd.org > Data: Luned=EC 3 settembre 2012, 02:31 > On Sun, Sep 02, 2012 at 09:04:40PM > +0000, Pedro F. Giffuni wrote: > > Author: pfg > > Date: Sun Sep=A0 2 21:04:40 2012 > > New Revision: 240060 > > URL: http://svn.freebsd.org/changeset/base/240060 > >=20 > > Log: > >=A0=A0=A0Fix RPC headers for C++ > >=A0=A0=A0 > >=A0=A0=A0C++ mangling will cause trouble with > variables like __rpc_xdr > >=A0=A0=A0in xdr.h so rename this to XDR. > Which troubles ? > =20 PR 137443 > Although not very useful due to many other namespace > pollution problems > in the rpc headers, __rpc_xdr is in the > implementation-reserved namespace, > while XDR is not. >=20 The forced reference here is {Open}Solaris: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/rpc/xdr.= h OpenGrok found no reference to __rpc_xdr in OpenSolaris/illumos. Cheers, Pedro. From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 14:16:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E45901065670; Mon, 3 Sep 2012 14:16:16 +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 B56FC8FC08; Mon, 3 Sep 2012 14:16: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 q83EGGAG095571; Mon, 3 Sep 2012 14:16:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83EGGlK095569; Mon, 3 Sep 2012 14:16:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209031416.q83EGGlK095569@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 3 Sep 2012 14:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240072 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 14:16:17 -0000 Author: glebius Date: Mon Sep 3 14:16:16 2012 New Revision: 240072 URL: http://svn.freebsd.org/changeset/base/240072 Log: Explicitly document all variables in the net.link.ether.inet MIB. Modified: head/usr.sbin/arp/arp.4 Modified: head/usr.sbin/arp/arp.4 ============================================================================== --- head/usr.sbin/arp/arp.4 Mon Sep 3 10:08:20 2012 (r240071) +++ head/usr.sbin/arp/arp.4 Mon Sep 3 14:16:16 2012 (r240072) @@ -28,7 +28,7 @@ .\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 28, 2007 +.Dd September 3, 2012 .Dt ARP 4 .Os .Sh NAME @@ -119,20 +119,53 @@ branch of the .Xr sysctl 3 MIB. -.Bl -tag -width "useloopback" +.Bl -tag -width "log_arp_permanent_modify" +.It Va log_arp_movements +Should the kernel log movements of IP addresses from one hardware +address to an other. +See +.Sx DIAGNOSTICS +below. +Turned on by default. +.It Va log_arp_permanent_modify +Should the kernel log attempts of remote host on network to modify a +permanent ARP entry. +See +.Sx DIAGNOSTICS +below. +Turned on by default. +.It Va log_arp_wrong_iface +Should the kernel log attempts to insert an ARP entry on an interface +when the IP network the address belongs to is connected to an other +interface. +See +.Sx DIAGNOSTICS +below. +Turned on by default. .It Va max_age How long an ARP entry is held in the cache until it needs to be refreshed. +Default is 1200 seconds. +.It Va maxhold +How many packets hold in the per-entry output queue while the entry +is being resolved. +Default is one packet. .It Va maxtries Number of retransmits before host is considered down and error is returned. +Default is 5 tries. +.It Va proxyall +Enables ARP proxying for all hosts on net. +Turned off by default. .It Va useloopback If an ARP entry is added for local address, force the traffic to go through the loopback interface. -.It Va proxyall -Enables ARP proxying for all hosts on net. +Turned on by default. +.It Va wait +Lifetime of an incomplete ARP entry. +Default is 20 seconds. .El .Sh DIAGNOSTICS .Bl -diag -.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d!" +.It "arp: %x:%x:%x:%x:%x:%x is using my IP address %d.%d.%d.%d on %s!" ARP has discovered another host on the local network which responds to mapping requests for its own Internet address with a different Ethernet address, generally indicating that two hosts are attempting to use the From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 14:29:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A5BB1065675; Mon, 3 Sep 2012 14:29:29 +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 CE48F8FC14; Mon, 3 Sep 2012 14:29: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 q83ETST6097183; Mon, 3 Sep 2012 14:29:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83ETSDs097180; Mon, 3 Sep 2012 14:29:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209031429.q83ETSDs097180@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 3 Sep 2012 14:29: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: r240073 - in head: sys/netinet usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 14:29:29 -0000 Author: glebius Date: Mon Sep 3 14:29:28 2012 New Revision: 240073 URL: http://svn.freebsd.org/changeset/base/240073 Log: Provide a sysctl switch that allows to install ARP entries with multicast bit set. FreeBSD refuses to install such entries since 9.0, and this broke installations running Microsoft NLB, which are violating standards. Tested by: Tarasov Oleg Modified: head/sys/netinet/if_ether.c head/usr.sbin/arp/arp.4 Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Sep 3 14:16:16 2012 (r240072) +++ head/sys/netinet/if_ether.c Mon Sep 3 14:29:28 2012 (r240073) @@ -496,6 +496,7 @@ arpintr(struct mbuf *m) static int log_arp_wrong_iface = 1; static int log_arp_movements = 1; static int log_arp_permanent_modify = 1; +static int allow_multicast = 0; SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW, &log_arp_wrong_iface, 0, @@ -506,7 +507,8 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_permanent_modify, CTLFLAG_RW, &log_arp_permanent_modify, 0, "log arp replies from MACs different than the one in the permanent arp entry"); - +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, allow_multicast, CTLFLAG_RW, + &allow_multicast, 0, "accept multicast addresses"); static void in_arpinput(struct mbuf *m) @@ -551,8 +553,8 @@ in_arpinput(struct mbuf *m) return; } - if (ETHER_IS_MULTICAST(ar_sha(ah))) { - log(LOG_NOTICE, "in_arp: %*D is multicast\n", + if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { + log(LOG_NOTICE, "arp: %*D is multicast\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); return; } Modified: head/usr.sbin/arp/arp.4 ============================================================================== --- head/usr.sbin/arp/arp.4 Mon Sep 3 14:16:16 2012 (r240072) +++ head/usr.sbin/arp/arp.4 Mon Sep 3 14:29:28 2012 (r240073) @@ -120,6 +120,12 @@ of the .Xr sysctl 3 MIB. .Bl -tag -width "log_arp_permanent_modify" +.It Va allow_multicast +Should the kernel install ARP entries with multicast bit set in +the hardware address. +Installing such entries is RFC 1812 violation, but some prorietary +load balancing techniques require routers on network to do so. +Turned off by default. .It Va log_arp_movements Should the kernel log movements of IP addresses from one hardware address to an other. @@ -203,6 +209,11 @@ entry in the local ARP table. This error will only be logged if the sysctl .Va net.link.ether.inet.log_arp_permanent_modify is set to 1, which is the system's default behaviour. +.It "arp: %x:%x:%x:%x:%x:%x is multicast" +Kernel refused to install an entry with multicast hardware address. +If you really want such addresses being installed, set the sysctl +.Va net.link.ether.inet.allow_multicast +to a positive value. .El .Sh SEE ALSO .Xr inet 4 , From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 14:41:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1740F106566B; Mon, 3 Sep 2012 14:41:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 8A76B8FC16; Mon, 3 Sep 2012 14:41:03 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q83Ef2CQ061691; Mon, 3 Sep 2012 17:41:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q83EeoVs033620; Mon, 3 Sep 2012 17:40:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q83Eeoai033619; Mon, 3 Sep 2012 17:40:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Sep 2012 17:40:50 +0300 From: Konstantin Belousov To: Pedro Giffuni Message-ID: <20120903144050.GN33100@deviant.kiev.zoral.com.ua> References: <20120903073133.GB33100@deviant.kiev.zoral.com.ua> <1346681599.92069.YahooMailClassic@web113502.mail.gq1.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BfpcaheOxHyW4lRg" Content-Disposition: inline In-Reply-To: <1346681599.92069.YahooMailClassic@web113502.mail.gq1.yahoo.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 14:41:05 -0000 --BfpcaheOxHyW4lRg Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 03, 2012 at 07:13:19AM -0700, Pedro Giffuni wrote: > Hello, >=20 > Sorry for the brevity but I can inly anser on a mobile device > right now ... >=20 > --- Lun 3/9/12, Konstantin Belousov ha scritto: >=20 > > Da: Konstantin Belousov > > Oggetto: Re: svn commit: r240060 - in head: include/rpc sys/rpc > > A: "Pedro F. Giffuni" > > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@f= reebsd.org > > Data: Luned? 3 settembre 2012, 02:31 > > On Sun, Sep 02, 2012 at 09:04:40PM > > +0000, Pedro F. Giffuni wrote: > > > Author: pfg > > > Date: Sun Sep=9A 2 21:04:40 2012 > > > New Revision: 240060 > > > URL: http://svn.freebsd.org/changeset/base/240060 > > >=20 > > > Log: > > >=9A=9A=9AFix RPC headers for C++ > > >=9A=9A=9A > > >=9A=9A=9AC++ mangling will cause trouble with > > variables like __rpc_xdr > > >=9A=9A=9Ain xdr.h so rename this to XDR. > > Which troubles ? > > > =20 > PR 137443 =46rom the PR, I fail to see what is the problem in our headers, and why the issue is not in some third-party C++ code. It is definitely has nothing to do with C++ name mangling. >=20 > > Although not very useful due to many other namespace > > pollution problems > > in the rpc headers, __rpc_xdr is in the > > implementation-reserved namespace, > > while XDR is not. > >=20 >=20 > The forced reference here is {Open}Solaris: >=20 > http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/rpc/xd= r.h >=20 > OpenGrok found no reference to __rpc_xdr > in OpenSolaris/illumos. I see, Solaris does typedef struct XDR { ... } XDR; and we now use the same trick. So my objections, if any, were against the commit message and not the actual code change then. Thanks. --BfpcaheOxHyW4lRg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBEwXIACgkQC3+MBN1Mb4j61gCgiweJgcQqiX2TBPu+ZTFXHF6b K00AoNQWrqMSIQWySdAC2Vbb0x1LDuuv =xCph -----END PGP SIGNATURE----- --BfpcaheOxHyW4lRg-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 15:22:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DB54106566C; Mon, 3 Sep 2012 15:22:03 +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 5EC3D8FC14; Mon, 3 Sep 2012 15:22: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 q83FM37a003454; Mon, 3 Sep 2012 15:22:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83FM3sr003451; Mon, 3 Sep 2012 15:22:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209031522.q83FM3sr003451@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 3 Sep 2012 15:22: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: r240074 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 15:22:03 -0000 Author: hselasky Date: Mon Sep 3 15:22:02 2012 New Revision: 240074 URL: http://svn.freebsd.org/changeset/base/240074 Log: Add more DWC OTG register definitions. Submitted by: Nick Hudson Modified: head/sys/dev/usb/controller/dwc_otgreg.h Modified: head/sys/dev/usb/controller/dwc_otgreg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otgreg.h Mon Sep 3 14:29:28 2012 (r240073) +++ head/sys/dev/usb/controller/dwc_otgreg.h Mon Sep 3 15:22:02 2012 (r240074) @@ -451,10 +451,21 @@ #define DIEPTXFN_INEPNTXFSTADDR_SHIFT 0 #define DIEPTXFN_INEPNTXFSTADDR_MASK 0x0000ffff +#define HCFG_MODECHANGERDY (1<<31) +#define HCFG_PERSCHEDENABLE (1<<26) +#define HCFG_FLENTRIES_SHIFT 24 +#define HCFG_FLENTRIES_MASK 0x03000000 +#define HCFG_FLENTRIES_8 (0) +#define HCFG_FLENTRIES_16 (1) +#define HCFG_FLENTRIES_32 (2) +#define HCFG_FLENTRIES_64 (3) +#define HCFG_MULTISEGDMA (1<<23) +#define HCFG_32KHZSUSPEND (1<<7) #define HCFG_FSLSSUPP (1<<2) #define HCFG_FSLSPCLKSEL_SHIFT 0 #define HCFG_FSLSPCLKSEL_MASK 0x00000003 +#define HFIR_RELOADCTRL (1<<16) #define HFIR_FRINT_SHIFT 0 #define HFIR_FRINT_MASK 0x0000ffff @@ -463,8 +474,15 @@ #define HFNUM_FRNUM_SHIFT 0 #define HFNUM_FRNUM_MASK 0x0000ffff -#define HPTXSTS_PTXQTOP_SHIFT 24 -#define HPTXSTS_PTXQTOP_MASK 0xff000000 +#define HPTXSTS_ODD (1<<31) +#define HPTXSTS_CHAN_SHIFT 27 +#define HPTXSTS_CHAN_MASK 0x78000000 +#define HPTXSTS_TOKEN_SHIFT 25 +#define HPTXSTS_TOKEN_MASK 0x06000000 +#define HPTXSTS_TOKEN_ZL 0 +#define HPTXSTS_TOKEN_PING 1 +#define HPTXSTS_TOKEN_DISABLE 2 +#define HPTXSTS_TERMINATE (1<<24) #define HPTXSTS_PTXQSPCAVAIL_SHIFT 16 #define HPTXSTS_PTXQSPCAVAIL_MASK 0x00ff0000 #define HPTXSTS_PTXFSPCAVAIL_SHIFT 0 @@ -517,7 +535,7 @@ #define HCCHAR_MPS_MASK 0x000007ff #define HCSPLT_SPLTENA (1<<31) -#define HCSPLT_COMPSPLT (1<<16) +#define HCSPLT_COMPSPLT (1<<16) #define HCSPLT_XACTPOS_SHIFT 14 #define HCSPLT_XACTPOS_MASK 0x0000c000 #define HCSPLT_HUBADDR_SHIFT 7 From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 16:09:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD68106566C; Mon, 3 Sep 2012 16:09:14 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2C88FC1F; Mon, 3 Sep 2012 16:09:14 +0000 (UTC) Received: by dadr6 with SMTP id r6so3600389dad.13 for ; Mon, 03 Sep 2012 09:09:08 -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=3caLdzpx6pRAHe34ZsIYxBPNiBwIUcVQ36gZ58UG1kI=; b=d2F0zBD0+vGln+vPrbp68fshsQhmTZYbxWetRLjEaNBJDGrwdKOY78D/tCeu9O2Exp 5rm4DLIwwKl7Bee6xr+zoraFSlkBVI1aKDiyFgzd/CNXKtFv3mtYkLXR3845D1SMDIGe 8wUtIwn3gBVfCvQloNnrqVnXt7QyM1YgZthBjucb4rCLaOaikT81b9sr5lsXyKrfcoEZ bTL3DKm1d1g/zUMvY0DkgnBebVDlz5D8CA1V/wqIO682UG6fHEaFLZKItW7NkTX0c//u VHwCpS6ZCotGSrjMiuSsRywTfJxekjZIsGo/PBiW/EvSswng+tyysTtItnTyrVNmc3TH 4z4g== MIME-Version: 1.0 Received: by 10.66.76.135 with SMTP id k7mr35101594paw.2.1346688548199; Mon, 03 Sep 2012 09:09:08 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.13.170 with HTTP; Mon, 3 Sep 2012 09:09:08 -0700 (PDT) In-Reply-To: <201209030852.q838q6lC053405@svn.freebsd.org> References: <201209030852.q838q6lC053405@svn.freebsd.org> Date: Mon, 3 Sep 2012 09:09:08 -0700 X-Google-Sender-Auth: LOZjx1uEPjZJyO_eZVBeneSJwlA Message-ID: From: mdf@FreeBSD.org To: Aleksandr Rybalko 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: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 16:09:14 -0000 On Mon, Sep 3, 2012 at 1:52 AM, Aleksandr Rybalko wrote: > Author: ray > Date: Mon Sep 3 08:52:05 2012 > New Revision: 240067 > URL: http://svn.freebsd.org/changeset/base/240067 > > Log: > Add kern.hintmode sysctl variable to show current state of hints: > 0 - loader hints in environment only; > 1 - static hints only > 2 - fallback mode (Dynamic KENV with fallback to kernel environment) > Add kern.hintmode write handler, accept only value 2. That will switch > static KENV to dynamic. So it will be possible to change device hints. > > Approved by: adrian (mentor) > > Modified: > head/sys/kern/subr_hints.c > > Modified: head/sys/kern/subr_hints.c > ============================================================================== > --- head/sys/kern/subr_hints.c Mon Sep 3 07:18:24 2012 (r240066) > +++ head/sys/kern/subr_hints.c Mon Sep 3 08:52:05 2012 (r240067) > @@ -29,8 +29,10 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > +#include Putting on my style-nazi hat. sysctl comes before systm alphabetically. > #include > > /* > @@ -42,6 +44,81 @@ static int use_kenv; > static char *hintp; > > /* > + * Define kern.hintmode sysctl, which only accept value 2, that cause to > + * switch from Static KENV mode to Dynamic KENV. So systems that have hints > + * compiled into kernel will be able to see/modify KENV (and hints too). > + */ > + > +static int > +sysctl_hintmode(SYSCTL_HANDLER_ARGS) > +{ > + int error, i, from_kenv, value, eqidx; > + const char *cp; > + char *line, *eq; These are not sorted properly; pointers come before scalars, and within the group they should be sorted alphabetically; e.g. "eqidx" comes before all the other ints. > + > + from_kenv = 0; > + cp = kern_envp; > + value = hintmode; > + > + /* Fetch candidate for new hintmode value */ > + error = sysctl_handle_int(oidp, &value, 0, req); > + if (error || !req->newptr) This may be copying existing code, but style(9) explicitly forbids using '!' except on boolean expressions. Since req->newptr is a pointer, an explicit comparison to NULL should be made. This error is repeated later. Thanks, matthew > + return (error); > + > + if (value != 2) > + /* Only accept swithing to hintmode 2 */ > + return (EINVAL); > + > + /* Migrate from static to dynamic hints */ > + switch (hintmode) { > + case 0: > + if (dynamic_kenv) > + /* Already here */ > + hintmode = value; /* XXX: Need we switch or not ? */ > + return (0); > + from_kenv = 1; > + cp = kern_envp; > + break; > + case 1: > + cp = static_hints; > + break; > + case 2: > + /* Nothing to do, hintmode already 2 */ > + return (0); > + } > + > + while (cp) { > + i = strlen(cp); > + if (i == 0) > + break; > + if (from_kenv) { > + if (strncmp(cp, "hint.", 5) != 0) > + /* kenv can have not only hints */ > + continue; > + } > + eq = strchr(cp, '='); > + if (!eq) > + /* Bad hint value */ > + continue; > + eqidx = eq - cp; > + > + line = malloc(i+1, M_TEMP, M_WAITOK); > + strcpy(line, cp); > + line[eqidx] = '\0'; > + setenv(line, line + eqidx + 1); > + free(line, M_TEMP); > + cp += i + 1; > + } > + > + hintmode = value; > + use_kenv = 1; > + return (0); > +} > + > +SYSCTL_PROC(_kern, OID_AUTO, hintmode, CTLTYPE_INT|CTLFLAG_RW, > + &hintmode, 0, sysctl_hintmode, "I", "Get/set current hintmode"); > + > +/* > * Evil wildcarding resource string lookup. > * This walks the supplied env string table and returns a match. > * The start point can be remembered for incremental searches. From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 16:51:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A4B4106564A; Mon, 3 Sep 2012 16:51:42 +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 31F158FC16; Mon, 3 Sep 2012 16:51: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 q83Gpgae014209; Mon, 3 Sep 2012 16:51:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83GpfHi014195; Mon, 3 Sep 2012 16:51:41 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209031651.q83GpfHi014195@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 3 Sep 2012 16:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 16:51:42 -0000 Author: des Date: Mon Sep 3 16:51:41 2012 New Revision: 240075 URL: http://svn.freebsd.org/changeset/base/240075 Log: Upgrade OpenSSH to 6.1p1. Deleted: head/crypto/openssh/version.c Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/INSTALL head/crypto/openssh/LICENCE head/crypto/openssh/PROTOCOL.certkeys head/crypto/openssh/PROTOCOL.mux head/crypto/openssh/README head/crypto/openssh/addrmatch.c head/crypto/openssh/audit-bsm.c head/crypto/openssh/auth-krb5.c head/crypto/openssh/auth-options.c head/crypto/openssh/auth-passwd.c head/crypto/openssh/auth.c head/crypto/openssh/auth2-pubkey.c head/crypto/openssh/auth2.c head/crypto/openssh/authfile.c head/crypto/openssh/channels.c head/crypto/openssh/channels.h head/crypto/openssh/clientloop.c head/crypto/openssh/clientloop.h head/crypto/openssh/compat.c head/crypto/openssh/compat.h head/crypto/openssh/config.h.in head/crypto/openssh/defines.h head/crypto/openssh/dh.c head/crypto/openssh/dns.c head/crypto/openssh/dns.h head/crypto/openssh/entropy.c head/crypto/openssh/entropy.h head/crypto/openssh/jpake.c head/crypto/openssh/kex.c head/crypto/openssh/key.c head/crypto/openssh/key.h head/crypto/openssh/mac.c head/crypto/openssh/misc.c head/crypto/openssh/moduli head/crypto/openssh/moduli.c head/crypto/openssh/monitor.c head/crypto/openssh/mux.c head/crypto/openssh/myproposal.h head/crypto/openssh/openbsd-compat/bsd-cygwin_util.c head/crypto/openssh/openbsd-compat/bsd-cygwin_util.h head/crypto/openssh/openbsd-compat/bsd-misc.h head/crypto/openssh/openbsd-compat/getcwd.c head/crypto/openssh/openbsd-compat/getgrouplist.c head/crypto/openssh/openbsd-compat/getrrsetbyname.c head/crypto/openssh/openbsd-compat/glob.c head/crypto/openssh/openbsd-compat/inet_ntop.c head/crypto/openssh/openbsd-compat/mktemp.c head/crypto/openssh/openbsd-compat/openbsd-compat.h head/crypto/openssh/openbsd-compat/openssl-compat.h head/crypto/openssh/openbsd-compat/port-linux.c head/crypto/openssh/openbsd-compat/setenv.c head/crypto/openssh/openbsd-compat/sha2.c head/crypto/openssh/openbsd-compat/sha2.h head/crypto/openssh/openbsd-compat/strlcpy.c head/crypto/openssh/packet.c head/crypto/openssh/packet.h head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/roaming.h head/crypto/openssh/roaming_client.c head/crypto/openssh/roaming_common.c head/crypto/openssh/sandbox-rlimit.c head/crypto/openssh/sandbox-systrace.c head/crypto/openssh/scp.1 head/crypto/openssh/scp.c head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/serverloop.c head/crypto/openssh/session.c head/crypto/openssh/sftp-client.c head/crypto/openssh/sftp-glob.c head/crypto/openssh/sftp.1 head/crypto/openssh/sftp.c head/crypto/openssh/ssh-add.1 head/crypto/openssh/ssh-add.c head/crypto/openssh/ssh-ecdsa.c head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-pkcs11-client.c head/crypto/openssh/ssh-pkcs11-helper.c head/crypto/openssh/ssh.1 head/crypto/openssh/ssh.c head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/ssh_namespace.h head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.8 head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/umac.c head/crypto/openssh/version.h head/secure/lib/libssh/Makefile Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ChangeLog ============================================================================== --- head/crypto/openssh/ChangeLog Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/ChangeLog Mon Sep 3 16:51:41 2012 (r240075) @@ -1,3 +1,629 @@ +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 + - (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: head/crypto/openssh/INSTALL ============================================================================== --- head/crypto/openssh/INSTALL Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/INSTALL Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/LICENCE ============================================================================== --- head/crypto/openssh/LICENCE Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/LICENCE Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/PROTOCOL.certkeys ============================================================================== --- head/crypto/openssh/PROTOCOL.certkeys Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/PROTOCOL.certkeys Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/PROTOCOL.mux ============================================================================== --- head/crypto/openssh/PROTOCOL.mux Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/PROTOCOL.mux Mon Sep 3 16:51:41 2012 (r240075) @@ -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. @@ -133,10 +133,11 @@ 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 + 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. @@ -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.9 2012/06/01 00:49:35 djm Exp $ Modified: head/crypto/openssh/README ============================================================================== --- head/crypto/openssh/README Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/README Mon Sep 3 16:51:41 2012 (r240075) @@ -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.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.77.2.2 2011/09/06 23:11:20 djm Exp $ +$Id: README,v 1.81 2012/08/22 11:57:13 djm Exp $ Modified: head/crypto/openssh/addrmatch.c ============================================================================== --- head/crypto/openssh/addrmatch.c Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/addrmatch.c Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/audit-bsm.c ============================================================================== --- head/crypto/openssh/audit-bsm.c Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/audit-bsm.c Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/auth-krb5.c ============================================================================== --- head/crypto/openssh/auth-krb5.c Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/auth-krb5.c Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/auth-options.c ============================================================================== --- head/crypto/openssh/auth-options.c Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/auth-options.c Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/auth-passwd.c ============================================================================== --- head/crypto/openssh/auth-passwd.c Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/auth-passwd.c Mon Sep 3 16:51:41 2012 (r240075) @@ -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: head/crypto/openssh/auth.c ============================================================================== --- head/crypto/openssh/auth.c Mon Sep 3 15:22:02 2012 (r240074) +++ head/crypto/openssh/auth.c Mon Sep 3 16:51:41 2012 (r240075) @@ -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. * @@ -358,7 +358,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); } @@ -545,9 +546,10 @@ getpwnamallow(const char *user) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 17:02:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24ACB106566C; Mon, 3 Sep 2012 17:02:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 72ED18FC12; Mon, 3 Sep 2012 17:02:13 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q83H2L1X072905; Mon, 3 Sep 2012 20:02:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q83H287p034303; Mon, 3 Sep 2012 20:02:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q83H28TT034302; Mon, 3 Sep 2012 20:02:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Sep 2012 20:02:08 +0300 From: Konstantin Belousov To: mdf@freebsd.org Message-ID: <20120903170208.GQ33100@deviant.kiev.zoral.com.ua> References: <201209030852.q838q6lC053405@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xLhNcw00gEcfFoIE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 17:02:15 -0000 --xLhNcw00gEcfFoIE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 03, 2012 at 09:09:08AM -0700, mdf@freebsd.org wrote: > On Mon, Sep 3, 2012 at 1:52 AM, Aleksandr Rybalko wrote: > > Author: ray > > Date: Mon Sep 3 08:52:05 2012 > > New Revision: 240067 > > URL: http://svn.freebsd.org/changeset/base/240067 > > > > Log: > > Add kern.hintmode sysctl variable to show current state of hints: > > 0 - loader hints in environment only; > > 1 - static hints only > > 2 - fallback mode (Dynamic KENV with fallback to kernel environment) > > Add kern.hintmode write handler, accept only value 2. That will switch > > static KENV to dynamic. So it will be possible to change device hints. > > > > Approved by: adrian (mentor) > > > > Modified: > > head/sys/kern/subr_hints.c > > > > Modified: head/sys/kern/subr_hints.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/kern/subr_hints.c Mon Sep 3 07:18:24 2012 (r24006= 6) > > +++ head/sys/kern/subr_hints.c Mon Sep 3 08:52:05 2012 (r24006= 7) > > @@ -29,8 +29,10 @@ __FBSDID("$FreeBSD$"); > > > > #include > > #include > > +#include > > #include > > #include > > +#include >=20 > Putting on my style-nazi hat. sysctl comes before systm alphabetically. Systm.h is very special, it normally comes as the second item in the include list, right after param.h. --xLhNcw00gEcfFoIE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBE4o8ACgkQC3+MBN1Mb4iZlACg6lqUQVLihrkHcVsiKwpshl49 5oQAn3HCfbwiU3OQiIKc3gdFP7uF77OS =niOP -----END PGP SIGNATURE----- --xLhNcw00gEcfFoIE-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 17:26:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2D331065674; Mon, 3 Sep 2012 17:26:20 +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 AD2428FC18; Mon, 3 Sep 2012 17:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q83HQKc7018373; Mon, 3 Sep 2012 17:26:20 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83HQKWJ018371; Mon, 3 Sep 2012 17:26:20 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209031726.q83HQKWJ018371@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 3 Sep 2012 17:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240076 - head/bin/setfacl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 17:26:20 -0000 Author: trasz Date: Mon Sep 3 17:26:20 2012 New Revision: 240076 URL: http://svn.freebsd.org/changeset/base/240076 Log: Fix compact form of "synchronize" permission in setfacl(1) manual page - it should be "s", not "S". PR: docs/162380 MFC after: 2 weeks Modified: head/bin/setfacl/setfacl.1 Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Mon Sep 3 16:51:41 2012 (r240075) +++ head/bin/setfacl/setfacl.1 Mon Sep 3 17:26:20 2012 (r240076) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2011 +.Dd September 2, 2012 .Dt SETFACL 1 .Os .Sh NAME @@ -337,7 +337,7 @@ read_acl write_acl .It o write_owner -.It S +.It s synchronize .El .Pp From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 18:17:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFE8F106567A; Mon, 3 Sep 2012 18:17:21 +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 9AF8D8FC1D; Mon, 3 Sep 2012 18:17: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 q83IHLkj024104; Mon, 3 Sep 2012 18:17:21 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83IHL47024102; Mon, 3 Sep 2012 18:17:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209031817.q83IHL47024102@svn.freebsd.org> From: Glen Barber Date: Mon, 3 Sep 2012 18:17: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: r240077 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 18:17:21 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 3 18:17:21 2012 New Revision: 240077 URL: http://svn.freebsd.org/changeset/base/240077 Log: Fix 'distributeworld' target when WITHOUT_GAMES is set. Reviewed by: des Approved by: des MFC after: 3 days X-MFC-To: 9-only Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Sep 3 17:26:20 2012 (r240076) +++ head/Makefile.inc1 Mon Sep 3 18:17:21 2012 (r240077) @@ -636,7 +636,10 @@ ITOOLS= [ awk cap_mkdb cat chflags chmod # # Non-base distributions produced by the base system -EXTRA_DISTRIBUTIONS= doc games +EXTRA_DISTRIBUTIONS= doc +.if ${MK_GAMES} != "no" +EXTRA_DISTRIBUTIONS+= games +.endif .if defined(LIB32TMP) && ${MK_LIB32} != "no" EXTRA_DISTRIBUTIONS+= lib32 .endif From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 18:21:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F8E3106564A; Mon, 3 Sep 2012 18:21:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 13EEE8FC18; Mon, 3 Sep 2012 18:21:04 +0000 (UTC) Received: from glenbarber.us (75.97.141.105.res-cmts.sewb.ptd.net [75.97.141.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 1F19923F645; Mon, 3 Sep 2012 14:21:02 -0400 (EDT) Date: Mon, 3 Sep 2012 14:21:01 -0400 From: Glen Barber To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120903182101.GC1290@glenbarber.us> References: <201209031817.q83IHL47024102@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WfZ7S8PLGjBY9Voh" Content-Disposition: inline In-Reply-To: <201209031817.q83IHL47024102@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r240077 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 18:21:04 -0000 --WfZ7S8PLGjBY9Voh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 03, 2012 at 06:17:21PM +0000, Glen Barber wrote: > Author: gjb (doc,ports committer) > Date: Mon Sep 3 18:17:21 2012 > New Revision: 240077 > URL: http://svn.freebsd.org/changeset/base/240077 >=20 > Log: > Fix 'distributeworld' target when WITHOUT_GAMES is set. > =20 > Reviewed by: des Also reviewed by gcooper on -hackers. Glen --WfZ7S8PLGjBY9Voh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQRPUNAAoJEFJPDDeguUajTa4IAKCEQjmMI30L9aco3B/KWbq4 njVc/QvYcZExcxvjinOJWmy2VR6zzGtGt6dTDAlE+dk9ZhD2iErpLONvBlKDSw/U 5ixsDfBLoI122IsVv/pu3FXMos3sYArlnFjkHom2cmNUDNcvoe2lz6j3UsWyqX1T lNPzbvSZWoi5Cl8prxpGHnnIieFp9C/VIxgw+7xtfpZt6hfvkRaBL2kMTxNQHhqo O+IK7K+aFvnaQCNkKP3av+pKjeuJbYRph8BlQuN2PRMyDCcTgbGEzOVli1f/wkMi h/oYETLN3INfiN/qfEWzc/VAJVgGhsOvnFrBFdhcYZs2FfDatpFPz1gYXfujC5k= =9Wqy -----END PGP SIGNATURE----- --WfZ7S8PLGjBY9Voh-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 19:17:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9EBC8106566C; Mon, 3 Sep 2012 19:17:26 +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 88E528FC1A; Mon, 3 Sep 2012 19:17: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 q83JHQg3031237; Mon, 3 Sep 2012 19:17:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q83JHQWw031235; Mon, 3 Sep 2012 19:17:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209031917.q83JHQWw031235@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 3 Sep 2012 19:17: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: r240078 - head/sys/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 19:17:26 -0000 Author: hselasky Date: Mon Sep 3 19:17:25 2012 New Revision: 240078 URL: http://svn.freebsd.org/changeset/base/240078 Log: Add required USB AUDIO v2.0 structure definitions. PR: misc/171254 Modified: head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- head/sys/dev/sound/usb/uaudioreg.h Mon Sep 3 18:17:21 2012 (r240077) +++ head/sys/dev/sound/usb/uaudioreg.h Mon Sep 3 19:17:25 2012 (r240078) @@ -31,8 +31,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define UAUDIO_VERSION 0x100 +#ifndef _UAUDIOREG_H_ +#define _UAUDIOREG_H_ +#define UAUDIO_VERSION 0x0100 +#define UAUDIO_VERSION_20 0x0200 + +#define UAUDIO_PROTOCOL_20 0x20 + +#define UDESC_CS_UNDEFINED 0x20 +#define UDESC_CS_DEVICE 0x21 #define UDESC_CS_CONFIG 0x22 #define UDESC_CS_STRING 0x23 #define UDESC_CS_INTERFACE 0x24 @@ -46,6 +54,14 @@ #define UDESCSUB_AC_FEATURE 6 #define UDESCSUB_AC_PROCESSING 7 #define UDESCSUB_AC_EXTENSION 8 +/* ==== USB audio 2.0 ==== */ +#define UDESCSUB_AC_EFFECT 7 +#define UDESCSUB_AC_PROCESSING_V2 8 +#define UDESCSUB_AC_EXTENSION_V2 9 +#define UDESCSUB_AC_CLOCK_SRC 10 +#define UDESCSUB_AC_CLOCK_SEL 11 +#define UDESCSUB_AC_CLOCK_MUL 12 +#define UDESCSUB_AC_SAMPLE_RT 13 /* These macros check if the endpoint descriptor has additional fields */ #define UEP_MINSIZE 7 @@ -250,6 +266,7 @@ struct usb_audio_extension_unit_0 { uByte baSourceId[0]; /* [bNrInPins] */ /* struct usb_audio_extension_unit_1 */ } __packed; + struct usb_audio_extension_unit_1 { uByte bNrChannels; uWord wChannelConfig; @@ -348,6 +365,13 @@ struct usb_audio_extension_unit_1 { #define DELAY_CONTROL 0x08 #define BASS_BOOST_CONTROL 0x09 #define LOUDNESS_CONTROL 0x0a +/* ==== USB audio 2.0 ==== */ +#define INPUT_GAIN_CONTROL 0x0b +#define INPUT_GAIN_PAD_CONTROL 0x0c +#define PHASE_INVERTER_CONTROL 0x0d +#define UNDERFLOW_CONTROL 0x0e +#define OVERFLOW_CONTROL 0x0f +#define LATENCY_CONTROL 0x10 #define FU_MASK(u) (1 << ((u)-1)) @@ -356,6 +380,9 @@ struct usb_audio_extension_unit_1 { #define AS_GENERAL 1 #define FORMAT_TYPE 2 #define FORMAT_SPECIFIC 3 +/* ==== USB audio 2.0 ==== */ +#define FORMAT_ENCODER 3 +#define FORMAT_DECODER 4 #define UA_FMT_PCM 1 #define UA_FMT_PCM8 2 @@ -402,3 +429,369 @@ struct usb_audio_extension_unit_1 { #define DR_THRESHOLD_CONTROL 4 #define DR_ATTACK_TIME_CONTROL 5 #define DR_RELEASE_TIME_CONTROL 6 + +/*------------------------------------------------------------------------* + * USB audio v2.0 definitions + *------------------------------------------------------------------------*/ + +struct usb_audio20_as_iface_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bTerminalLink; + uByte bmControls; + uByte bFormatType; + uDWord bmFormats; + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iChannelNames; +} __packed; + +struct usb_audio20_encoder_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bEncoderID; + uByte bEncoder; + uDWord bmControls; + uByte iParam1; + uByte iParam2; + uByte iParam3; + uByte iParam4; + uByte iParam5; + uByte iParam6; + uByte iParam7; + uByte iParam8; + uByte iEncoder; +} __packed; + +struct usb_audio20_streaming_endpoint_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bmAttributes; +#define UA20_MPS_ONLY 0x80 + uByte bmControls; +#define UA20_PITCH_CONTROL_MASK 0x03 +#define UA20_DATA_OVERRUN_MASK 0x0C +#define UA20_DATA_UNDERRUN_MASK 0x30 + uByte bLockDelayUnits; + uWord wLockDelay; +} __packed; + +struct usb_audio20_feedback_endpoint_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bEndpointAddress; + uByte bmAttributes; + uWord wMaxPacketSize; + uByte bInterval; +} __packed; + +#define UA20_GET_CUR 0x81 +#define UA20_SET_CUR 0x01 +#define UA20_GET_RANGE 0x82 +#define UA20_SET_RANGE 0x02 +#define UA20_GET_MEM 0x83 +#define UA20_SET_MEM 0x03 + +struct usb_audio20_cur1_parameter { + uByte bCur; +} __packed; + +struct usb_audio20_ctl1_range_sub { + uByte bMIN; + uByte bMAX; + uByte bRES; +} __packed; + +struct usb_audio20_ctl1_range { + uWord wNumSubRanges; + struct usb_audio20_ctl1_range_sub sub[1]; +} __packed; + +struct usb_audio20_cur2_parameter { + uWord wCur; +} __packed; + +struct usb_audio20_ctl2_range_sub { + uWord wMIN; + uWord wMAX; + uWord wRES; +} __packed; + +struct usb_audio20_ctl2_range { + uWord wNumSubRanges; + struct usb_audio20_ctl2_range_sub sub[1]; +} __packed; + +struct usb_audio20_cur4_parameter { + uDWord dCur; +} __packed; + +struct usb_audio20_ctl4_range_sub { + uDWord dMIN; + uDWord dMAX; + uDWord dRES; +} __packed; + +struct usb_audio20_ctl4_range { + uWord wNumSubRanges; + struct usb_audio20_ctl4_range_sub sub[1]; +} __packed; + +struct usb_audio20_cc_cluster_descriptor { + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iChannelNames; +} __packed; + +struct usb_audio20_streaming_type1_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bFormatType; + uByte bSubslotSize; + uByte bBitResolution; +} __packed; + +#define UA20_EERROR_NONE 0 +#define UA20_EERROR_MEMORY 1 +#define UA20_EERROR_BANDWIDTH 2 +#define UA20_EERROR_CPU 3 +#define UA20_EERROR_FORMATFR_ER 4 +#define UA20_EERROR_FORMATFR_SM 5 +#define UA20_EERROR_FORMATFR_LG 6 +#define UA20_EERROR_DATAFORMAT 7 +#define UA20_EERROR_NUMCHANNELS 8 +#define UA20_EERROR_SAMPLERATE 9 +#define UA20_EERROR_BITRATE 10 +#define UA20_EERROR_PARAM 11 +#define UA20_EERROR_NREADY 12 +#define UA20_EERROR_BUSY 13 + +struct usb_audio20_cc_alt_setting { + uByte bControlSize; + uDWord bmValidAltSettings; +} __packed; + +struct usb_audio20_interrupt_message { + uByte bInfo; + uByte bAttribute; + uDWord wValue; + uDWord wIndex; +} __packed; + +/* UDESCSUB_AC_CLOCK_SRC */ +struct usb_audio20_clock_source_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bClockId; + uByte bmAttributes; + uByte bmControls; + uByte bAssocTerminal; + uByte iClockSource; +} __packed; + +/* UDESCSUB_AC_CLOCK_SEL */ +struct usb_audio20_clock_selector_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bClockId; + uByte bNrInPins; +} __packed; + +/* UDESCSUB_AC_CLOCK_MUL */ +struct usb_audio20_clock_multiplier_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bClockId; + uByte bCSourceId; + uByte bmControls; + uByte iClockMultiplier; +} __packed; + +/* UDESCSUB_AC_INPUT */ +struct usb_audio20_input_terminal { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bTerminalId; + uWord wTerminalType; + uByte bAssocTerminal; + uByte bCSourceId; + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iCHannelNames; + uWord bmControls; + uByte iTerminal; +} __packed; + +/* UDESCSUB_AC_OUTPUT */ +struct usb_audio20_output_terminal { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bTerminalId; + uWord wTerminalType; + uByte bAssocTerminal; + uByte bSourceId; + uByte bCSourceId; + uWord bmControls; + uByte iTerminal; +} __packed; + +/* UDESCSUB_AC_MIXER */ +struct usb_audio20_mixer_unit_0 { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uByte bNrInPins; + uByte baSourceId[0]; + /* struct usb_audio20_mixer_unit_1 */ +} __packed; + +struct usb_audio20_mixer_unit_1 { + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iChannelNames; + uByte bmControls[0]; + /* uByte iMixer; */ +} __packed; + +/* UDESCSUB_AC_SELECTOR */ +struct usb_audio20_selector_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uByte bNrInPins; + uByte baSourceId[0]; + /* uByte iSelector; */ +} __packed; + +/* UDESCSUB_AC_FEATURE */ +struct usb_audio20_feature_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uByte bSourceId; + uDWord bmaControls[0]; + /* uByte iFeature; */ +} __packed; + +/* UDESCSUB_AC_SAMPLE_RT */ +struct usb_audio20_sample_rate_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uByte bSourceId; + uByte bSourceInId; + uByte bSourceOutId; + uByte iSrc; +} __packed; + +/* UDESCSUB_AC_EFFECT */ +struct usb_audio20_effect_unit { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uWord wEffectType; + uByte bSourceId; + uDWord bmaControls[0]; + uByte iEffects; +} __packed; + +/* UDESCSUB_AC_PROCESSING_V2 */ +struct usb_audio20_processing_unit_0 { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uWord wProcessType; + uByte bNrInPins; + uByte baSourceId[0]; /* [bNrInPins] */ +} __packed; + +struct usb_audio20_processing_unit_1 { + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iChannelNames; + uWord bmControls; + uByte iProcessing; +} __packed; + +/* UDESCSUB_AC_EXTENSION_V2 */ +struct usb_audio20_extension_unit_0 { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bUnitId; + uWord wExtensionCode; + uByte bNrInPins; + uByte baSourceId[0]; +} __packed; + +struct usb_audio20_extension_unit_1 { + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iChannelNames; + uByte bmControls; + uByte iExtension; +} __packed; + +struct usb_audio20_cluster { + uByte bNrChannels; + uDWord bmChannelConfig; + uByte iChannelNames; +} __packed; + +#define UA20_TF_UNDEFINED 0x00 +#define UA20_TF_DESKTOP_SPEAKER 0x01 +#define UA20_TF_HOME_THEATER 0x02 +#define UA20_TF_MICROPHONE 0x03 +#define UA20_TF_HEADSET 0x04 +#define UA20_TF_TELEPHONE 0x05 +#define UA20_TF_CONVERTER 0x06 +#define UA20_TF_SOUND_RECORDER 0x07 +#define UA20_TF_IO_BOX 0x08 +#define UA20_TF_MUSICAL_INSTRUMENT 0x09 +#define UA20_TF_PRO_AUDIO 0x0A +#define UA20_TF_AV 0x0B +#define UA20_TF_CONTROL_PANEL 0x0C +#define UA20_TF_OTHER 0xFF + +#define UA20_EP_GENERAL 0x01 + +#define UA20_CS_SAM_FREQ_CONTROL 0x01 +#define UA20_CS_CLOCK_VALID_CONTROL 0x02 + +#define UA20_TE_COPY_PROTECT_CONTROL 0x01 +#define UA20_TE_CONNECTOR_CONTROL 0x02 +#define UA20_TE_OVERLOAD_CONTROL 0x03 +#define UA20_TE_CLUSTER_CONTROL 0x04 +#define UA20_TE_UNDERFLOW_CONTROL 0x05 +#define UA20_TE_OVERFLOW_CONTROL 0x06 +#define UA20_TE_LATENCY_CONTROL 0x07 + +#define UA20_MU_MIXER_CONTROL 0x01 +#define UA20_MU_CLUSTER_CONTROL 0x02 +#define UA20_MU_UNDERFLOW_CONTROL 0x03 +#define UA20_MU_OVERFLOW_CONTROL 0x04 +#define UA20_MU_LATENCY_CONTROL 0x05 + +#define UA20_FMT_PCM (1U << 0) +#define UA20_FMT_PCM8 (1U << 1) +#define UA20_FMT_FLOAT (1U << 2) +#define UA20_FMT_ALAW (1U << 3) +#define UA20_FMT_MULAW (1U << 4) +#define UA20_FMT_RAW (1U << 31) + +#endif /* _UAUDIOREG_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Sep 3 19:29:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C8C71065679; Mon, 3 Sep 2012 19:29:12 +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 8BF298FC0A; Mon, 3 Sep 2012 19:29:11 +0000 (UTC) Received: by obbun3 with SMTP id un3so12668317obb.13 for ; Mon, 03 Sep 2012 12:29:05 -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=956sGL9ZIOcIg6tFq3dmfkuXsoqQcDZVGplha3fgWbA=; b=P1NKQqUzQfPILegqY0bHxb5jwccPxS+TdrwL10qDepVLMlj/uYQk7WUMso2cPnWbOz sU9n1B0rFfSTrVjVeyalKYi3fW6HC6P9Mz+4M63G5qoZm/A0SEI4qi46xDx6DU4gkd+d pxNG0N40MpXCv8Tnuq3SMrSfZiwckZERNdcjziwAtyUNYhuyAX+SDqgctEY+PQiHfpO9 XIVnNOkP/AJPV3cAUPuebL9B/0eJYFvulPjjYi2snj/052RJQfIVPN/YhzUvdq/yRmGj /fRDSXgOmdmeatQXy41OH8wPYemgDXGst9Z71EruiSyW6wIms1eMaRl5ZtkaszncMf6u aeZQ== MIME-Version: 1.0 Received: by 10.60.29.164 with SMTP id l4mr15056278oeh.4.1346700545172; Mon, 03 Sep 2012 12:29:05 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Mon, 3 Sep 2012 12:29:05 -0700 (PDT) In-Reply-To: <20120903122352.951b4253.ray@freebsd.org> References: <201209030852.q838q6lC053405@svn.freebsd.org> <20120903122352.951b4253.ray@freebsd.org> Date: Mon, 3 Sep 2012 12:29:05 -0700 Message-ID: From: Garrett Cooper To: Aleksandr Rybalko 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: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 19:29:12 -0000 On Mon, Sep 3, 2012 at 2:23 AM, Aleksandr Rybalko wrote: > On Mon, 3 Sep 2012 02:05:15 -0700 > Garrett Cooper wrote: > >>> On Sep 3, 2012, at 1:52 AM, Aleksandr Rybalko wrote: >>> >>> > Author: ray >>> > Date: Mon Sep 3 08:52:05 2012 >>> > New Revision: 240067 >>> > URL: http://svn.freebsd.org/changeset/base/240067 >>> > >>> > Log: >>> > Add kern.hintmode sysctl variable to show current state of hints: >>> > 0 - loader hints in environment only; >>> > 1 - static hints only >>> > 2 - fallback mode (Dynamic KENV with fallback to kernel >>> > environment) Add kern.hintmode write handler, accept only value 2. >>> > That will switch static KENV to dynamic. So it will be possible to >>> > change device hints. >>> >>> ... >>> >>> > + /* Migrate from static to dynamic hints */ >>> > + switch (hintmode) { >>> > + case 0: >>> > + if (dynamic_kenv) >>> > + /* Already here */ >>> > + hintmode = value; /* XXX: Need we switch >>> > or not ? */ >>> > + return (0); >>> >>> ^^^^ typo (missing braces)? ^^^^ > > Ohhh, yeah, testing now. > Thank you! > >>> >>> Also, don't you need extra glue for jails? > > Why, jails uses separate hints/kenv? I was wondering whether or not the tunables could be changed from the jail, thus allowing someone to affect the host system or if this memory space was effectively CoWed in some way, shape or form. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 00:51:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39156106567C for ; Tue, 4 Sep 2012 00:51:55 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm27-vm0.bullet.mail.sp2.yahoo.com (nm27-vm0.bullet.mail.sp2.yahoo.com [98.139.91.232]) by mx1.freebsd.org (Postfix) with SMTP id 079178FC16 for ; Tue, 4 Sep 2012 00:51:55 +0000 (UTC) Received: from [98.139.91.67] by nm27.bullet.mail.sp2.yahoo.com with NNFMP; 04 Sep 2012 00:51:54 -0000 Received: from [98.139.91.40] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 04 Sep 2012 00:51:54 -0000 Received: from [127.0.0.1] by omp1040.mail.sp2.yahoo.com with NNFMP; 04 Sep 2012 00:51:54 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 663441.43893.bm@omp1040.mail.sp2.yahoo.com Received: (qmail 68930 invoked by uid 60001); 4 Sep 2012 00:51:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1346719914; bh=VwzM9lplTDI7wEtvlN2fX9ep4Dq7we2DljWOo3g/NR0=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=En7SqWngZiJdTSZ2v1OgN3/yb49CcugRJ9KktRhlGKccOpMXrUADv4HkEn0qTdGw7MXN1tTlZnSWHt51xshx0A7Ts4VHmiUg8q4+3oufWQn2R6dZoZ2XQdTyXFpn7F7hHiOIRqS9G+KAV2NaNI5yUINCnbKVIw6m/ngZvPOHOGo= X-YMail-OSG: G9j.jJsVM1m1vstG8Jv2ZaVbA4XeRUdba6FUvJ8hEKbbRHB uon3HpGWj7MHN6Q0JRD26qrHaq6zjK89moxj03qPqq9YpsGVPONeqq.cZrgw NrYvklQGzxt00fAIo8SjEOvtmpbTCm_ucP0wKd6blmnQ53F621xJYRs4EvFf OEqNzW1Gobl9jyH.XULKcO8Q02RFrJSSAnAuoftLhzxsMn7xD9ut85tElIlW jG2c6KW3Xy3Ys9N6jE1cHeBML7qyqwCVb3_66g5wMZ_P3E1kETHvKNbwZEOg CktRuayl6uR63uCM5hr9V743GolACPUS9XxRp1VZzjwuZUiMBOslk2VF7oaD 0sZFjTYVCoQX64zTpr54g9_YjZeROszmNA347pM4LzYU5rCz2KR6Jh5o9plv o2HiYOuhByLloiFD.ps1iwDnh2tI5jCkmPba.lT8n.q.RicXCSUDbTlTehwj ooUlbKDbJos0Gn2KJBYNn01SJXZUr6NuX90wiuQxuMGltql3wSPBWrEjEo8f cYTleUbIC.US.jr7ePoiMWSXY6kx3WKl9tEkdOQkNky.QoU9IX8rRvWA5aPL 7yciWLjnxWIm5jnCfZrJUL.OlFbrg5WEE Received: from [200.118.157.7] by web113520.mail.gq1.yahoo.com via HTTP; Mon, 03 Sep 2012 17:51:53 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailWebService/0.8.121.416 References: <20120903073133.GB33100@deviant.kiev.zoral.com.ua> <1346681599.92069.YahooMailClassic@web113502.mail.gq1.yahoo.com> <20120903144050.GN33100@deviant.kiev.zoral.com.ua> Message-ID: <1346719913.68772.YahooMailNeo@web113520.mail.gq1.yahoo.com> Date: Mon, 3 Sep 2012 17:51:53 -0700 (PDT) From: Pedro Giffuni To: Konstantin Belousov In-Reply-To: <20120903144050.GN33100@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r240060 - in head: include/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pedro Giffuni List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 00:51:55 -0000 ...=0A>________________________________=0A>=0A>From: Konstantin Belousov=0A= >=A0=0A>...=0A>=0A>>=A0 =0A>> PR 137443=0A>From the PR, I fail to see what = is the problem in our headers, and why=0A>the issue is not in some third-pa= rty C++ code.=0A>=0A>It is definitely has nothing to do with C++ name mangl= ing.=0A>=0A=A0=0AHmm.. yes, not a mangling issue but it is rather weird tha= t it happens on C++.=0ASalome is not a toy app.=0A=0A>> =0A>> > Although no= t very useful due to many other namespace=0A>> > pollution problems=0A>> > = in the rpc headers, __rpc_xdr is in the=0A>> > implementation-reserved name= space,=0A>> > while XDR is not.=0A>> > =0A>> =0A>> The forced reference her= e is {Open}Solaris:=0A>> =0A>> http://src.illumos.org/source/xref/illumos-g= ate/usr/src/uts/common/rpc/xdr.h=0A>> =0A>> OpenGrok found no reference to = __rpc_xdr=0A>> in OpenSolaris/illumos.=0A>I see, Solaris does=0A>=A0=A0=A0 = typedef struct XDR { ... } XDR;=0A>and we now use the same trick.=0A>=0A>So= my objections, if any, were against the commit message and not the actual= =0A>code change then.=0A>=0A=A0=0AQuite definitely :(=A0.. I mixed two diff= erent issues that I was trying to solve=0A(and one of them was not an issue= at all). I will do a better job when I=0AMFC.=0A=A0=0AThanks for checking = though: I do feel nervous when touching a standard=0Aheader=A0even if it's = just to follow a change from upstream!=0A=A0=0A=A0=0APedro. From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 05:15:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0731E106566B; Tue, 4 Sep 2012 05:15:55 +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 E47968FC14; Tue, 4 Sep 2012 05:15: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 q845FsIW098567; Tue, 4 Sep 2012 05:15:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q845FsNZ098563; Tue, 4 Sep 2012 05:15:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209040515.q845FsNZ098563@svn.freebsd.org> From: Xin LI Date: Tue, 4 Sep 2012 05:15: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: r240079 - in head: share/man/man4 sys/dev/arcmsr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 05:15:55 -0000 Author: delphij Date: Tue Sep 4 05:15:54 2012 New Revision: 240079 URL: http://svn.freebsd.org/changeset/base/240079 Log: Update arcmsr(4) to vendor version 1.20.00.25. Many thanks to Areca for continuing to support FreeBSD. Submitted by: Ching-Lung Huang MFC after: 2 weeks Modified: head/share/man/man4/arcmsr.4 head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/share/man/man4/arcmsr.4 ============================================================================== --- head/share/man/man4/arcmsr.4 Mon Sep 3 19:17:25 2012 (r240078) +++ head/share/man/man4/arcmsr.4 Tue Sep 4 05:15:54 2012 (r240079) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2010 +.Dd September 3, 2012 .Dt ARCMSR 4 .Os .Sh NAME @@ -98,10 +98,14 @@ ARC-1210 .It ARC-1212 .It +ARC-1213 +.It ARC-1220 .It ARC-1222 .It +ARC-1223 +.It ARC-1230 .It ARC-1231 @@ -133,6 +137,8 @@ ARC-1680 ARC-1681 .It ARC-1880 +.It +ARC-1882 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Mon Sep 3 19:17:25 2012 (r240078) +++ head/sys/dev/arcmsr/arcmsr.c Tue Sep 4 05:15:54 2012 (r240079) @@ -37,38 +37,43 @@ ************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter ****************************************************************************************** */ @@ -154,7 +159,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.22 2011-07-04" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.25 2012-08-17" #include #define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) #define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) @@ -296,7 +301,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return 0; + return (0); } /* ************************************************************************** @@ -347,7 +352,7 @@ static struct cdevsw arcmsr_cdevsw = { if(acb==NULL) { return ENXIO; } - return(arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); + return (arcmsr_iop_ioctlcmd(acb, ioctl_cmd, arg)); } /* ********************************************************************** @@ -378,7 +383,7 @@ static u_int32_t arcmsr_disable_allintr( } break; } - return(intmask_org); + return (intmask_org); } /* ********************************************************************** @@ -411,7 +416,6 @@ static void arcmsr_enable_allintr( struc } break; } - return; } /* ********************************************************************** @@ -431,7 +435,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -452,7 +456,7 @@ static u_int8_t arcmsr_hbb_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ********************************************************************** @@ -472,7 +476,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r UDELAY(10000); }/*max 1 seconds*/ }while(Retries++ < 20);/*max 20 sec*/ - return FALSE; + return (FALSE); } /* ************************************************************************ @@ -490,7 +494,6 @@ static void arcmsr_flush_hba_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -509,7 +512,6 @@ static void arcmsr_flush_hbb_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -528,7 +530,6 @@ static void arcmsr_flush_hbc_cache(struc retry_count--; } }while(retry_count!=0); - return; } /* ************************************************************************ @@ -550,7 +551,6 @@ static void arcmsr_flush_adapter_cache(s } break; } - return; } /* ******************************************************************************* @@ -596,7 +596,7 @@ static void arcmsr_async(void *cb_arg, u if((target_id > ARCMSR_MAX_TARGETID) || (target_lun > ARCMSR_MAX_TARGETLUN)) { break; } - printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); + // printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); break; default: break; @@ -612,14 +612,13 @@ static void arcmsr_report_sense_info(str pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { memset(&pccb->csio.sense_data, 0, sizeof(pccb->csio.sense_data)); memcpy(&pccb->csio.sense_data, srb->arcmsr_cdb.SenseData, get_min(sizeof(struct SENSE_DATA), sizeof(pccb->csio.sense_data))); ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ pccb->ccb_h.status |= CAM_AUTOSNS_VALID; } - return; } /* ********************************************************************* @@ -631,7 +630,6 @@ static void arcmsr_abort_hba_allcmd(stru if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -643,7 +641,6 @@ static void arcmsr_abort_hbb_allcmd(stru if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -656,7 +653,6 @@ static void arcmsr_abort_hbc_allcmd(stru if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************* @@ -678,7 +674,6 @@ static void arcmsr_abort_allcmd(struct A } break; } - return; } /* ********************************************************************** @@ -716,7 +711,6 @@ static void arcmsr_srb_complete(struct C acb->pktReturnCount++; #endif xpt_done(pccb); - return; } /* ************************************************************************** @@ -768,7 +762,6 @@ static void arcmsr_report_srb_state(stru break; } } - return; } /* ************************************************************************** @@ -801,7 +794,6 @@ static void arcmsr_drain_donequeue(struc return; } arcmsr_report_srb_state(acb, srb, error); - return; } /* ************************************************************************** @@ -883,7 +875,6 @@ static void arcmsr_done4abort_postqueue( } break; } - return; } /* **************************************************************************** @@ -923,7 +914,6 @@ static void arcmsr_iop_reset(struct Adap acb->pktRequestCount = 0; acb->pktReturnCount = 0; #endif - return; } /* ********************************************************************** @@ -1011,7 +1001,6 @@ static void arcmsr_build_srb(struct Comm arcmsr_cdb->DataLength = 0; } srb->arc_cdb_size=arccdbsize; - return; } /* ************************************************************************** @@ -1072,7 +1061,6 @@ static void arcmsr_post_srb(struct Adapt } break; } - return; } /* ************************************************************************ @@ -1156,7 +1144,6 @@ static void arcmsr_iop_message_read(stru CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK); } } - return; } /* ************************************************************************** @@ -1221,7 +1208,6 @@ static void arcmsr_post_ioctldata2iop(st */ arcmsr_iop_message_wrote(acb); } - return; } /* ************************************************************************ @@ -1236,7 +1222,6 @@ static void arcmsr_stop_hba_bgrb(struct printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1251,7 +1236,6 @@ static void arcmsr_stop_hbb_bgrb(struct printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } - return; } /* ************************************************************************ @@ -1265,7 +1249,6 @@ static void arcmsr_stop_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ************************************************************************ @@ -1287,7 +1270,6 @@ static void arcmsr_stop_adapter_bgrb(str } break; } - return; } /* ************************************************************************ @@ -1305,7 +1287,6 @@ static void arcmsr_poll(struct cam_sim * arcmsr_interrupt(acb); if( mutex == 0 ) ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return; } /* ************************************************************************** @@ -1340,7 +1321,6 @@ static void arcmsr_iop2drv_data_wrote_ha } else { acb->acb_flags|=ACB_F_IOPDATA_OVERFLOW; } - return; } /* ************************************************************************** @@ -1383,7 +1363,6 @@ static void arcmsr_iop2drv_data_read_han if(acb->wqbuf_firstindex==acb->wqbuf_lastindex) { acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; } - return; } static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb) @@ -1417,7 +1396,6 @@ static void arcmsr_rescan_lun(struct Ada ccb->ccb_h.cbfcnp = arcmsr_rescanLun_cb; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); - return; } @@ -1488,6 +1466,7 @@ static void arcmsr_dr_handle(struct Adap } break; } + if(acb->acb_flags & ACB_F_BUS_HANG_ON) { acb->acb_flags &= ~ACB_F_BUS_HANG_ON; @@ -1592,7 +1571,6 @@ static void arcmsr_hba_doorbell_isr(stru if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } - return; } /* ************************************************************************** @@ -1620,7 +1598,6 @@ static void arcmsr_hbc_doorbell_isr(stru if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ } - return; } /* ************************************************************************** @@ -1644,7 +1621,6 @@ static void arcmsr_hba_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1674,7 +1650,6 @@ static void arcmsr_hbb_postqueue_isr(str error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ - return; } /* ************************************************************************** @@ -1704,7 +1679,6 @@ static void arcmsr_hbc_postqueue_isr(str } throttling++; } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -1712,30 +1686,29 @@ static void arcmsr_hbc_postqueue_isr(str */ static void arcmsr_handle_hba_isr( struct AdapterControlBlock *acb) { - u_int32_t outbound_intstatus; + u_int32_t outbound_intStatus; /* ********************************************* ** check outbound intstatus ********************************************* */ - outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; - if(!outbound_intstatus) { + outbound_intStatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; + if(!outbound_intStatus) { /*it must be share irq*/ return; } - CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intStatus);/*clear interrupt*/ /* MU doorbell interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { arcmsr_hba_doorbell_isr(acb); } /* MU post queue interrupts*/ - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { arcmsr_hba_postqueue_isr(acb); } - if(outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { + if(outbound_intStatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { arcmsr_hba_message_isr(acb); } - return; } /* ********************************************************************** @@ -1771,7 +1744,6 @@ static void arcmsr_handle_hbb_isr( struc if(outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { arcmsr_hbb_message_isr(acb); } - return; } /* ********************************************************************** @@ -1798,7 +1770,6 @@ static void arcmsr_handle_hbc_isr( struc if(host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { arcmsr_hbc_postqueue_isr(acb); } - return; } /* ****************************************************************************** @@ -1821,7 +1792,6 @@ static void arcmsr_interrupt(struct Adap " unknow adapter type =%d\n", acb->pci_unit, acb->adapter_type); break; } - return; } /* ********************************************************************** @@ -1844,7 +1814,7 @@ static void arcmsr_polling_devmap(void* struct AdapterControlBlock *acb = (struct AdapterControlBlock *)arg; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: - CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; case ACB_ADAPTER_TYPE_B: @@ -2065,7 +2035,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada break; } ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return retvalue; + return (retvalue); } /* ************************************************************************** @@ -2191,7 +2161,7 @@ static int arcmsr_iop_message_xfer(struc if (wqbuf_lastindex != wqbuf_firstindex) { arcmsr_post_ioctldata2iop(acb); /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2221,7 +2191,7 @@ static int arcmsr_iop_message_xfer(struc } } else { /* has error report sensedata */ - if(&pccb->csio.sense_data) { + if(pccb->csio.sense_len) { ((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70); /* Valid,ErrorCode */ ((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05; @@ -2312,7 +2282,7 @@ static int arcmsr_iop_message_xfer(struc retvalue = ARCMSR_MESSAGE_FAIL; } message_out: - return retvalue; + return (retvalue); } /* ********************************************************************* @@ -2375,7 +2345,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) { + if(acb->srboutstandingcount > ARCMSR_MAX_OUTSTANDING_CMD) { xpt_freeze_simq(acb->psim, 1); pccb->ccb_h.status = CAM_REQUEUE_REQ; acb->acb_flags |= ACB_F_CAM_DEV_QFRZN; @@ -2388,10 +2358,9 @@ static void arcmsr_execute_srb(void *arg if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) { arcmsr_callout_init(&srb->ccb_callout); - callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz ) / 1000, arcmsr_srb_timeout, srb); + callout_reset(&srb->ccb_callout, ((pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)) * hz) / 1000, arcmsr_srb_timeout, srb); srb->srb_flags |= SRB_FLAG_TIMER_START; } - return; } /* ***************************************************************************************** @@ -2455,7 +2424,6 @@ static void arcmsr_bus_reset(struct Adap } arcmsr_iop_reset(acb); acb->acb_flags &= ~ACB_F_BUS_RESET; - return; } /* ************************************************************************** @@ -2607,10 +2575,24 @@ static void arcmsr_action(struct cam_sim strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN); cpi->unit_number=cam_sim_unit(psim); #ifdef CAM_NEW_TRAN_CODE - cpi->transport = XPORT_SPI; - cpi->transport_version = 2; + if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G) + cpi->base_transfer_speed = 600000; + else + cpi->base_transfer_speed = 300000; + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cpi->transport = XPORT_SAS; + cpi->transport_version = 0; + cpi->protocol_version = SCSI_REV_SPC2; + } + else + { + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol_version = SCSI_REV_2; + } cpi->protocol = PROTO_SCSI; - cpi->protocol_version = SCSI_REV_2; #endif cpi->ccb_h.status |= CAM_REQ_CMP; xpt_done(pccb); @@ -2674,28 +2656,46 @@ static void arcmsr_action(struct cam_sim { struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; + struct ccb_trans_settings_sas *sas; scsi = &cts->proto_specific.scsi; - spi = &cts->xport_specific.spi; - cts->protocol = PROTO_SCSI; - cts->protocol_version = SCSI_REV_2; - cts->transport = XPORT_SPI; - cts->transport_version = 2; - spi->flags = CTS_SPI_FLAGS_DISC_ENB; - spi->sync_period=3; - spi->sync_offset=32; - spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; - spi->valid = CTS_SPI_VALID_DISC - | CTS_SPI_VALID_SYNC_RATE - | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_BUS_WIDTH; scsi->valid = CTS_SCSI_VALID_TQ; + cts->protocol = PROTO_SCSI; + + if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1680)) + { + cts->protocol_version = SCSI_REV_SPC2; + cts->transport_version = 0; + cts->transport = XPORT_SAS; + sas = &cts->xport_specific.sas; + sas->valid = CTS_SAS_VALID_SPEED; + if(acb->vendor_device_id == PCIDevVenIDARC1880) + sas->bitrate = 600000; + else if(acb->vendor_device_id == PCIDevVenIDARC1680) + sas->bitrate = 300000; + } + else + { + cts->protocol_version = SCSI_REV_2; + cts->transport_version = 2; + cts->transport = XPORT_SPI; + spi = &cts->xport_specific.spi; + spi->flags = CTS_SPI_FLAGS_DISC_ENB; + spi->sync_period=2; + spi->sync_offset=32; + spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; + spi->valid = CTS_SPI_VALID_DISC + | CTS_SPI_VALID_SYNC_RATE + | CTS_SPI_VALID_SYNC_OFFSET + | CTS_SPI_VALID_BUS_WIDTH; + } } #else { cts->flags=(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - cts->sync_period=3; + cts->sync_period=2; cts->sync_offset=32; cts->bus_width=MSG_EXT_WDTR_BUS_16_BIT; cts->valid=CCB_TRANS_SYNC_RATE_VALID | @@ -2759,7 +2759,6 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - return; } /* ********************************************************************** @@ -2772,7 +2771,6 @@ static void arcmsr_start_hba_bgrb(struct if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2785,7 +2783,6 @@ static void arcmsr_start_hbb_bgrb(struct if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf( "arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2799,7 +2796,6 @@ static void arcmsr_start_hbc_bgrb(struct if(!arcmsr_hbc_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); } - return; } /* ********************************************************************** @@ -2818,7 +2814,6 @@ static void arcmsr_start_adapter_bgrb(st arcmsr_start_hbc_bgrb(acb); break; } - return; } /* ********************************************************************** @@ -2873,7 +2868,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2934,7 +2928,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -2985,7 +2978,6 @@ polling_ccb_retry: } arcmsr_report_srb_state(acb, srb, error); } /*drain reply FIFO*/ - return; } /* ********************************************************************** @@ -3053,7 +3045,6 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3100,7 +3091,6 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version=CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3148,7 +3138,6 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version =CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ - return; } /* ********************************************************************** @@ -3170,7 +3159,6 @@ static void arcmsr_get_firmware_spec(str } break; } - return; } /* ********************************************************************** @@ -3219,7 +3207,6 @@ static void arcmsr_wait_firmware_ready( } break; } - return; } /* ********************************************************************** @@ -3253,7 +3240,6 @@ static void arcmsr_clear_doorbell_queue_ } break; } - return; } /* ************************************************************************ @@ -3336,7 +3322,7 @@ static u_int32_t arcmsr_iop_confirm(stru } break; } - return TRUE; + return (TRUE); } /* ************************************************************************ @@ -3359,7 +3345,6 @@ static void arcmsr_enable_eoi_mode(struc } break; } - return; } /* ********************************************************************** @@ -3382,7 +3367,6 @@ static void arcmsr_iop_init(struct Adapt /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); acb->acb_flags |=ACB_F_IOP_INITED; - return; } /* ********************************************************************** @@ -3414,7 +3398,6 @@ static void arcmsr_map_free_srb(void *ar srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp+SRB_SIZE); } acb->vir2phy_offset=(unsigned long)srb_tmp-(unsigned long)srb_phyaddr; - return; } /* ************************************************************************ @@ -3433,7 +3416,6 @@ static void arcmsr_free_resource(struct bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); - return; } /* ************************************************************************ @@ -3444,16 +3426,24 @@ static u_int32_t arcmsr_initialize(devic struct AdapterControlBlock *acb=device_get_softc(dev); u_int16_t pci_command; int i, j,max_coherent_size; - - switch (pci_get_devid(dev)) { - case PCIDevVenIDARC1880: { + u_int32_t vendor_dev_id; + + vendor_dev_id = pci_get_devid(dev); + acb->vendor_device_id = vendor_dev_id; + switch (vendor_dev_id) { + case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: { acb->adapter_type=ACB_ADAPTER_TYPE_C; + acb->adapter_bus_speed = ACB_BUS_SPEED_6G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: { acb->adapter_type=ACB_ADAPTER_TYPE_B; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE+(sizeof(struct HBB_MessageUnit)); } break; @@ -3477,6 +3467,7 @@ static u_int32_t arcmsr_initialize(devic case PCIDevVenIDARC1680: case PCIDevVenIDARC1681: { acb->adapter_type=ACB_ADAPTER_TYPE_A; + acb->adapter_bus_speed = ACB_BUS_SPEED_3G; max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; @@ -3804,7 +3795,7 @@ static int arcmsr_attach(device_t dev) #endif arcmsr_callout_init(&acb->devmap_callout); callout_reset(&acb->devmap_callout, 60 * hz, arcmsr_polling_devmap, acb); - return 0; + return (0); } /* @@ -3851,6 +3842,9 @@ static int arcmsr_probe(device_t dev) type = "SAS 3G"; break; case PCIDevVenIDARC1880: + case PCIDevVenIDARC1882: + case PCIDevVenIDARC1213: + case PCIDevVenIDARC1223: type = "SAS 6G"; break; default: Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Mon Sep 3 19:17:25 2012 (r240078) +++ head/sys/dev/arcmsr/arcmsr.h Tue Sep 4 05:15:54 2012 (r240079) @@ -52,6 +52,7 @@ #define ARCMSR_MAX_ADAPTER 4 #define ARCMSR_RELEASE_SIMQ_LEVEL 230 #define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ /* ********************************************************************* */ @@ -97,6 +98,13 @@ #define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ +#define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ + #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ @@ -106,8 +114,10 @@ #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ @@ -119,6 +129,7 @@ #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ #ifndef PCIR_BARS #define PCIR_BARS 0x10 @@ -830,6 +841,8 @@ struct AdapterControlBlock { u_int32_t pktRequestCount; u_int32_t pktReturnCount; #endif + u_int32_t vendor_device_id; + u_int32_t adapter_bus_speed; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 @@ -848,6 +861,10 @@ struct AdapterControlBlock { /* devstate */ #define ARECA_RAID_GONE 0x55 #define ARECA_RAID_GOOD 0xaa +/* adapter_bus_speed */ +#define ACB_BUS_SPEED_3G 0 +#define ACB_BUS_SPEED_6G 1 +#define ACB_BUS_SPEED_12G 2 /* ********************************************************************* ** Message Unit structure From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 05:51:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C142106566C; Tue, 4 Sep 2012 05:51:51 +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 378768FC0A; Tue, 4 Sep 2012 05:51: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 q845ppWD002894; Tue, 4 Sep 2012 05:51:51 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q845pp9m002892; Tue, 4 Sep 2012 05:51:51 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209040551.q845pp9m002892@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 4 Sep 2012 05:51: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: r240080 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 05:51:51 -0000 Author: trociny Date: Tue Sep 4 05:51:50 2012 New Revision: 240080 URL: http://svn.freebsd.org/changeset/base/240080 Log: Add __BEGIN_DECLS and __END_DECLS to make libprocstat more C++-friendly. Submitted by: Daniel Dettlaff MFC after: 1 week Modified: head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Tue Sep 4 05:15:54 2012 (r240079) +++ head/lib/libprocstat/libprocstat.h Tue Sep 4 05:51:50 2012 (r240080) @@ -144,6 +144,7 @@ struct sockstat { STAILQ_HEAD(filestat_list, filestat); +__BEGIN_DECLS void procstat_close(struct procstat *procstat); void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); void procstat_freefiles(struct procstat *procstat, @@ -164,5 +165,6 @@ int procstat_get_vnode_info(struct procs struct vnstat *vn, char *errbuf); struct procstat *procstat_open_sysctl(void); struct procstat *procstat_open_kvm(const char *nlistf, const char *memf); +__END_DECLS #endif /* !_LIBPROCSTAT_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 05:54:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D551106566C; Tue, 4 Sep 2012 05:54:44 +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 389EF8FC14; Tue, 4 Sep 2012 05:54: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 q845siOa003252; Tue, 4 Sep 2012 05:54:44 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q845siwH003250; Tue, 4 Sep 2012 05:54:44 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209040554.q845siwH003250@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 4 Sep 2012 05:54: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: r240081 - head/usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 05:54:44 -0000 Author: trociny Date: Tue Sep 4 05:54:43 2012 New Revision: 240081 URL: http://svn.freebsd.org/changeset/base/240081 Log: Free memory allocated by procstat_getfiles(), which may make difference when procstat(1) is run with -a option. Submitted by: Daniel Dettlaff MFC after: 1 week Modified: head/usr.bin/procstat/procstat_files.c Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Tue Sep 4 05:51:50 2012 (r240080) +++ head/usr.bin/procstat/procstat_files.c Tue Sep 4 05:54:43 2012 (r240081) @@ -476,4 +476,5 @@ procstat_files(struct procstat *procstat printf("\n"); } + procstat_freefiles(procstat, head); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 07:48:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D433D106564A; Tue, 4 Sep 2012 07:48:39 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 848868FC0A; Tue, 4 Sep 2012 07:48:39 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) by smtp.dlink.ua (Postfix) with SMTP id 931A3C493D; Tue, 4 Sep 2012 10:48:37 +0300 (EEST) Date: Tue, 4 Sep 2012 10:50:40 +0300 From: Aleksandr Rybalko To: Garrett Cooper Message-Id: <20120904105040.3340c748.ray@freebsd.org> In-Reply-To: References: <201209030852.q838q6lC053405@svn.freebsd.org> <20120903122352.951b4253.ray@freebsd.org> Organization: FreeBSD Project X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 07:48:39 -0000 On Mon, 3 Sep 2012 12:29:05 -0700 Garrett Cooper wrote: >> On Mon, Sep 3, 2012 at 2:23 AM, Aleksandr Rybalko >> wrote: >> > On Mon, 3 Sep 2012 02:05:15 -0700 >> > Garrett Cooper wrote: >> > >> >>> On Sep 3, 2012, at 1:52 AM, Aleksandr Rybalko wrote: >> >>> >> >>> > Author: ray >> >>> > Date: Mon Sep 3 08:52:05 2012 >> >>> > New Revision: 240067 >> >>> > URL: http://svn.freebsd.org/changeset/base/240067 >> >>> > >> >>> > Log: >> >>> > Add kern.hintmode sysctl variable to show current state of >> >>> > hints: 0 - loader hints in environment only; >> >>> > 1 - static hints only >> >>> > 2 - fallback mode (Dynamic KENV with fallback to kernel >> >>> > environment) Add kern.hintmode write handler, accept only >> >>> > value 2. That will switch static KENV to dynamic. So it will >> >>> > be possible to change device hints. >> >>> >> >>> ... >> >>> >> >>> > + /* Migrate from static to dynamic hints */ >> >>> > + switch (hintmode) { >> >>> > + case 0: >> >>> > + if (dynamic_kenv) >> >>> > + /* Already here */ >> >>> > + hintmode = value; /* XXX: Need we switch >> >>> > or not ? */ >> >>> > + return (0); >> >>> >> >>> ^^^^ typo (missing braces)? ^^^^ >> > >> > Ohhh, yeah, testing now. >> > Thank you! >> > >> >>> >> >>> Also, don't you need extra glue for jails? >> > >> > Why, jails uses separate hints/kenv? >> >> I was wondering whether or not the tunables could be changed from the >> jail, thus allowing someone to affect the host system or if this >> memory space was effectively CoWed in some way, shape or form. Think after switch hints will be controlled by the same policy as before. Normal hints 0-16KB, so it will not be big memory waste. Handler allow to do it only one time: user set it to 2, handler copy env. Next time any just check, if 2, do nothing. You think better to add CTLFLAG_PRISON flag, to hide it from jails? >> >> Thanks! >> -Garrett Thank you Garrett! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 08:11:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3ED28106566C; Tue, 4 Sep 2012 08:11:26 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id E480D8FC0C; Tue, 4 Sep 2012 08:11:25 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 0249BC493C; Tue, 4 Sep 2012 11:11:20 +0300 (EEST) Date: Tue, 4 Sep 2012 11:13:22 +0300 From: Aleksandr Rybalko To: Konstantin Belousov Message-Id: <20120904111322.e54bf030.ray@dlink.ua> In-Reply-To: <20120903170208.GQ33100@deviant.kiev.zoral.com.ua> References: <201209030852.q838q6lC053405@svn.freebsd.org> <20120903170208.GQ33100@deviant.kiev.zoral.com.ua> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, mdf@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 08:11:26 -0000 On Mon, 3 Sep 2012 20:02:08 +0300 Konstantin Belousov wrote: >> On Mon, Sep 03, 2012 at 09:09:08AM -0700, mdf@freebsd.org wrote: >> > On Mon, Sep 3, 2012 at 1:52 AM, Aleksandr Rybalko >> > wrote: >> > > Author: ray >> > > Date: Mon Sep 3 08:52:05 2012 >> > > New Revision: 240067 >> > > URL: http://svn.freebsd.org/changeset/base/240067 >> > > >> > > Log: >> > > Add kern.hintmode sysctl variable to show current state of >> > > hints: 0 - loader hints in environment only; >> > > 1 - static hints only >> > > 2 - fallback mode (Dynamic KENV with fallback to kernel >> > > environment) Add kern.hintmode write handler, accept only value >> > > 2. That will switch static KENV to dynamic. So it will be >> > > possible to change device hints. >> > > >> > > Approved by: adrian (mentor) >> > > >> > > Modified: >> > > head/sys/kern/subr_hints.c >> > > >> > > Modified: head/sys/kern/subr_hints.c >> > > ============================================================================== >> > > --- head/sys/kern/subr_hints.c Mon Sep 3 07:18:24 2012 >> > > (r240066) +++ head/sys/kern/subr_hints.c Mon Sep 3 08:52:05 >> > > 2012 (r240067) @@ -29,8 +29,10 @@ __FBSDID("$FreeBSD$"); >> > > >> > > #include >> > > #include >> > > +#include >> > > #include >> > > #include >> > > +#include >> > >> > Putting on my style-nazi hat. sysctl comes before systm >> > alphabetically. >> Systm.h is very special, it normally comes as the second item in the >> include list, right after param.h. Just recheck, in that case there is indeed no requirement to swap sysctl.h and systm.h. Thanks Kostik! Will fix my style(9)ability :) WBW -- Alexandr Rybalko aka Alex RAY From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 09:03:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8292F106564A; Tue, 4 Sep 2012 09:03:18 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id B04D78FC19; Tue, 4 Sep 2012 09:03:17 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) by smtp.dlink.ua (Postfix) with SMTP id 34254C4950; Tue, 4 Sep 2012 12:03:11 +0300 (EEST) Date: Tue, 4 Sep 2012 12:05:13 +0300 From: Aleksandr Rybalko To: mdf@FreeBSD.org Message-Id: <20120904120513.62c7e6b2.ray@freebsd.org> In-Reply-To: References: <201209030852.q838q6lC053405@svn.freebsd.org> Organization: FreeBSD Project X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 09:03:18 -0000 On Mon, 3 Sep 2012 09:09:08 -0700 mdf@FreeBSD.org wrote: >> On Mon, Sep 3, 2012 at 1:52 AM, Aleksandr Rybalko >> wrote: >> > Author: ray >> > Date: Mon Sep 3 08:52:05 2012 >> > New Revision: 240067 >> > URL: http://svn.freebsd.org/changeset/base/240067 >> > >> > Log: >> > Add kern.hintmode sysctl variable to show current state of hints: >> > 0 - loader hints in environment only; >> > 1 - static hints only >> > 2 - fallback mode (Dynamic KENV with fallback to kernel >> > environment) Add kern.hintmode write handler, accept only value 2. >> > That will switch static KENV to dynamic. So it will be possible to >> > change device hints. >> > >> > Approved by: adrian (mentor) >> > >> > Modified: >> > head/sys/kern/subr_hints.c >> > >> > Modified: head/sys/kern/subr_hints.c >> > ============================================================================== >> > --- head/sys/kern/subr_hints.c Mon Sep 3 07:18:24 2012 >> > (r240066) +++ head/sys/kern/subr_hints.c Mon Sep 3 08:52:05 >> > 2012 (r240067) @@ -29,8 +29,10 @@ __FBSDID("$FreeBSD$"); >> > >> > #include >> > #include >> > +#include >> > #include >> > #include >> > +#include >> >> Putting on my style-nazi hat. sysctl comes before systm >> alphabetically. >> >> > #include >> > >> > /* >> > @@ -42,6 +44,81 @@ static int use_kenv; >> > static char *hintp; >> > >> > /* >> > + * Define kern.hintmode sysctl, which only accept value 2, that >> > cause to >> > + * switch from Static KENV mode to Dynamic KENV. So systems that >> > have hints >> > + * compiled into kernel will be able to see/modify KENV (and >> > hints too). >> > + */ >> > + >> > +static int >> > +sysctl_hintmode(SYSCTL_HANDLER_ARGS) >> > +{ >> > + int error, i, from_kenv, value, eqidx; >> > + const char *cp; >> > + char *line, *eq; >> >> These are not sorted properly; pointers come before scalars, and >> within the group they should be sorted alphabetically; e.g. "eqidx" >> comes before all the other ints. >> >> > + >> > + from_kenv = 0; >> > + cp = kern_envp; >> > + value = hintmode; >> > + >> > + /* Fetch candidate for new hintmode value */ >> > + error = sysctl_handle_int(oidp, &value, 0, req); >> > + if (error || !req->newptr) >> >> This may be copying existing code, but style(9) explicitly forbids >> using '!' except on boolean expressions. Since req->newptr is a >> pointer, an explicit comparison to NULL should be made. This error >> is repeated later. >> >> Thanks, >> matthew >> >> > + return (error); >> > + >> > + if (value != 2) >> > + /* Only accept swithing to hintmode 2 */ >> > + return (EINVAL); >> > + >> > + /* Migrate from static to dynamic hints */ >> > + switch (hintmode) { >> > + case 0: >> > + if (dynamic_kenv) >> > + /* Already here */ >> > + hintmode = value; /* XXX: Need we switch >> > or not ? */ >> > + return (0); >> > + from_kenv = 1; >> > + cp = kern_envp; >> > + break; >> > + case 1: >> > + cp = static_hints; >> > + break; >> > + case 2: >> > + /* Nothing to do, hintmode already 2 */ >> > + return (0); >> > + } >> > + >> > + while (cp) { >> > + i = strlen(cp); >> > + if (i == 0) >> > + break; >> > + if (from_kenv) { >> > + if (strncmp(cp, "hint.", 5) != 0) >> > + /* kenv can have not only hints */ >> > + continue; >> > + } >> > + eq = strchr(cp, '='); >> > + if (!eq) >> > + /* Bad hint value */ >> > + continue; >> > + eqidx = eq - cp; >> > + >> > + line = malloc(i+1, M_TEMP, M_WAITOK); >> > + strcpy(line, cp); >> > + line[eqidx] = '\0'; >> > + setenv(line, line + eqidx + 1); >> > + free(line, M_TEMP); >> > + cp += i + 1; >> > + } >> > + >> > + hintmode = value; >> > + use_kenv = 1; >> > + return (0); >> > +} >> > + >> > +SYSCTL_PROC(_kern, OID_AUTO, hintmode, CTLTYPE_INT|CTLFLAG_RW, >> > + &hintmode, 0, sysctl_hintmode, "I", "Get/set current >> > hintmode"); + >> > +/* >> > * Evil wildcarding resource string lookup. >> > * This walks the supplied env string table and returns a match. >> > * The start point can be remembered for incremental searches. Think that one is last version :) http://people.freebsd.org/~ray/subr_hints.c.patch Thank you Matthew! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 10:56:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24C411065673; Tue, 4 Sep 2012 10:56:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F5C78FC0C; Tue, 4 Sep 2012 10:56: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 q84AuUls042512; Tue, 4 Sep 2012 10:56:30 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84AuUCh042509; Tue, 4 Sep 2012 10:56:30 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209041056.q84AuUCh042509@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 4 Sep 2012 10:56: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: r240082 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 10:56:31 -0000 Author: melifaro Date: Tue Sep 4 10:56:30 2012 New Revision: 240082 URL: http://svn.freebsd.org/changeset/base/240082 Log: Remove unneeded ipfw headers introduced in r213447 from Infiniband code. MFC after: 2 weeks Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Tue Sep 4 05:54:43 2012 (r240081) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Tue Sep 4 10:56:30 2012 (r240082) @@ -67,8 +67,6 @@ #include #include #include -#include -#include #endif #ifdef INET6 #include From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 11:43:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA82D1065673; Tue, 4 Sep 2012 11:43:00 +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 D68BA8FC1E; Tue, 4 Sep 2012 11:43: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 q84Bh0BL048263; Tue, 4 Sep 2012 11:43:00 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84Bh0MV048261; Tue, 4 Sep 2012 11:43:00 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209041143.q84Bh0MV048261@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 4 Sep 2012 11:43: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: r240083 - head/bin/setfacl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 11:43:01 -0000 Author: trasz Date: Tue Sep 4 11:43:00 2012 New Revision: 240083 URL: http://svn.freebsd.org/changeset/base/240083 Log: Make setfacl(1) behave properly in situations like "setfacl -kd". MFC after: 1 month Modified: head/bin/setfacl/setfacl.c Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Tue Sep 4 10:56:30 2012 (r240082) +++ head/bin/setfacl/setfacl.c Tue Sep 4 11:43:00 2012 (r240083) @@ -73,6 +73,7 @@ main(int argc, char *argv[]) { acl_t acl; acl_type_t acl_type; + acl_entry_t unused_entry; char filename[PATH_MAX]; int local_error, carried_error, ch, i, entry_number, ret; int h_flag; @@ -296,6 +297,20 @@ main(int argc, char *argv[]) } } + /* + * Don't try to set an empty default ACL; it will always fail. + * Use acl_delete_def_file(3) instead. + */ + if (acl_type == ACL_TYPE_DEFAULT && + acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { + if (acl_delete_def_file(file->filename) == -1) { + warn("%s: acl_delete_def_file() failed", + file->filename); + carried_error++; + } + continue; + } + /* don't bother setting the ACL if something is broken */ if (local_error) { carried_error++; From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 11:50:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CAB3106564A; Tue, 4 Sep 2012 11:50:14 +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 57B2C8FC16; Tue, 4 Sep 2012 11:50: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 q84BoEPt049176; Tue, 4 Sep 2012 11:50:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84BoEqC049173; Tue, 4 Sep 2012 11:50:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209041150.q84BoEqC049173@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 4 Sep 2012 11:50: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: r240084 - head/bin/setfacl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 11:50:14 -0000 Author: trasz Date: Tue Sep 4 11:50:13 2012 New Revision: 240084 URL: http://svn.freebsd.org/changeset/base/240084 Log: Make "setfacl -bd" an alias for "setfacl -k". Previously it would crash on assert. PR: bin/165807 MFC after: 1 month Modified: head/bin/setfacl/setfacl.c Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Tue Sep 4 11:43:00 2012 (r240083) +++ head/bin/setfacl/setfacl.c Tue Sep 4 11:50:13 2012 (r240084) @@ -264,6 +264,17 @@ main(int argc, char *argv[]) need_mask = 1; break; case OP_REMOVE_EXT: + /* + * Don't try to call remove_ext() for empty + * default ACL. + */ + if (acl_type == ACL_TYPE_DEFAULT && + acl_get_entry(acl, ACL_FIRST_ENTRY, + &unused_entry) == 0) { + local_error += remove_default(&acl, + file->filename); + break; + } remove_ext(&acl, file->filename); need_mask = 0; break; From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 12:02:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA568106564A; Tue, 4 Sep 2012 12:02:23 +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 B5BB68FC16; Tue, 4 Sep 2012 12:02:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q84C2Nxa050759; Tue, 4 Sep 2012 12:02:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84C2Nil050757; Tue, 4 Sep 2012 12:02:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209041202.q84C2Nil050757@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 4 Sep 2012 12:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240085 - head/bin/getfacl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 12:02:23 -0000 Author: trasz Date: Tue Sep 4 12:02:23 2012 New Revision: 240085 URL: http://svn.freebsd.org/changeset/base/240085 Log: In getfacl(1) manual page, mention where to read about the ACL syntax. PR submitter suggested adding it to acl(3) instead, but I don't think pointing ordinary users at section 3 is a good idea. PR: docs/162380 MFC after: 1 month Modified: head/bin/getfacl/getfacl.1 Modified: head/bin/getfacl/getfacl.1 ============================================================================== --- head/bin/getfacl/getfacl.1 Tue Sep 4 11:50:13 2012 (r240084) +++ head/bin/getfacl/getfacl.1 Tue Sep 4 12:02:23 2012 (r240085) @@ -97,6 +97,10 @@ then reads a list of pathnames, each terminated by one newline character, from the standard input. .El +.Pp +For an explanation of the ACL syntax, see the +.Xr setfacl 1 +manual page. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 12:07:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 076491065674; Tue, 4 Sep 2012 12:07:34 +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 E46F78FC0C; Tue, 4 Sep 2012 12:07: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 q84C7XCk051371; Tue, 4 Sep 2012 12:07:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84C7Xl4051365; Tue, 4 Sep 2012 12:07:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209041207.q84C7Xl4051365@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Sep 2012 12:07: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: r240086 - in head: share/man/man9 sys/conf sys/libkern sys/net sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 12:07:34 -0000 Author: glebius Date: Tue Sep 4 12:07:33 2012 New Revision: 240086 URL: http://svn.freebsd.org/changeset/base/240086 Log: - Move jenkins.h to jenkins_hash.c - Provide missing function that can do hashing of arbitrary sized buffer. - Refetch lookup3.c and do only minimal edits to it, so that diff between our jenkins_hash.c and lookup3.c is minimal. - Add declarations for jenkins_hash(), jenkins_hash32() to sys/hash.h. - Document these functions in hash(9) Obtained from: http://burtleburtle.net/bob/c/lookup3.c Added: head/sys/libkern/jenkins_hash.c - copied, changed from r240081, head/sys/libkern/jenkins.h Deleted: head/sys/libkern/jenkins.h Modified: head/share/man/man9/hash.9 head/sys/conf/files head/sys/net/flowtable.c head/sys/sys/hash.h Modified: head/share/man/man9/hash.9 ============================================================================== --- head/share/man/man9/hash.9 Tue Sep 4 12:02:23 2012 (r240085) +++ head/share/man/man9/hash.9 Tue Sep 4 12:07:33 2012 (r240086) @@ -26,7 +26,7 @@ .\" $OpenBSD: hash.9,v 1.5 2003/04/17 05:08:39 jmc Exp $ .\" $FreeBSD$ .\" -.Dd April 3, 2007 +.Dd September 4, 2012 .Dt HASH 9 .Os .Sh NAME @@ -36,7 +36,9 @@ .Nm hash32_str , .Nm hash32_strn , .Nm hash32_stre , -.Nm hash32_strne +.Nm hash32_strne , +.Nm jenkins_hash32 , +.Nm jenkins_hash .Nd general kernel hashing functions .Sh SYNOPSIS .In sys/hash.h @@ -50,6 +52,10 @@ .Fn hash32_stre "const void *buf" "int end" "const char **ep" "uint32_t hash" .Ft uint32_t .Fn hash32_strne "const void *buf" "size_t len" "int end" "const char **ep" "uint32_t hash" +.Ft uint32_t +.Fn jenkins_hash "const void *buf" "size_t len" "uint32_t hash" +.Ft uint32_t +.Fn jenkins_hash32 "const uint32_t *buf" "size_t count" "uint32_t hash" .Sh DESCRIPTION The .Fn hash32 @@ -107,6 +113,23 @@ is not .Dv NULL , it is set to the point in the buffer at which the hash function terminated hashing. +.Pp +The +.Fn jenkins_hash +function has same semantics as the +.Fn hash32_buf , +but provides more advanced hashing algorithm with better distribution. +.Pp +The +.Fn jenkins_hash32 +uses same hashing algorithm as the +.Fn jenkins_hash +function, but works only on +.Ft uint32_t +sized arrays, thus is simplier and faster. +It accepts an array of +.Ft uint32_t +values in its first argument and size of this array in the second argument. .Sh RETURN VALUES The .Fn hash32 @@ -150,12 +173,24 @@ be revisited. .Sh HISTORY The .Nm -functions were first committed to +functions first appeared in .Nx 1.6 . -The -.Ox -versions were written and massaged for -.Ox 2.3 -by Tobias Weingartner, -and finally committed for -.Ox 3.2 . +The current implementation of +.Nm hash32 +functions was first committed to +.Ox 3.2 , +and later imported to +.Fx 6.1 . +The +.Nm jenkins_hash +functions were added in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm hash32 +functions were written by +.An Tobias Weingartner . +The +.Nm jenkins_hash +functions was written by +Bob Jenkins . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 4 12:02:23 2012 (r240085) +++ head/sys/conf/files Tue Sep 4 12:07:33 2012 (r240086) @@ -2797,6 +2797,7 @@ libkern/inet_aton.c standard libkern/inet_ntoa.c standard libkern/inet_ntop.c standard libkern/inet_pton.c standard +libkern/jenkins_hash.c standard libkern/mcount.c optional profiling-routine libkern/memcchr.c standard libkern/memcmp.c standard Copied and modified: head/sys/libkern/jenkins_hash.c (from r240081, head/sys/libkern/jenkins.h) ============================================================================== --- head/sys/libkern/jenkins.h Tue Sep 4 05:54:43 2012 (r240081, copy source) +++ head/sys/libkern/jenkins_hash.c Tue Sep 4 12:07:33 2012 (r240086) @@ -1,43 +1,44 @@ -#ifndef __LIBKERN_JENKINS_H__ -#define __LIBKERN_JENKINS_H__ /* * Taken from http://burtleburtle.net/bob/c/lookup3.c * $FreeBSD$ */ +#include +#include + /* ------------------------------------------------------------------------------- - lookup3.c, by Bob Jenkins, May 2006, Public Domain. - - These are functions for producing 32-bit hashes for hash table lookup. - hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() - are externally useful functions. Routines to test the hash are included - if SELF_TEST is defined. You can use this free for any purpose. It's in - the public domain. It has no warranty. - - You probably want to use hashlittle(). hashlittle() and hashbig() - hash byte arrays. hashlittle() is faster than hashbig() on - little-endian machines. Intel and AMD are little-endian machines. - On second thought, you probably want hashlittle2(), which is identical to - hashlittle() except it returns two 32-bit hashes for the price of one. - You could implement hashbig2() if you wanted but I haven't bothered here. +lookup3.c, by Bob Jenkins, May 2006, Public Domain. - If you want to find a hash of, say, exactly 7 integers, do - a = i1; b = i2; c = i3; - mix(a,b,c); - a += i4; b += i5; c += i6; - mix(a,b,c); - a += i7; - final(a,b,c); - then use c as the hash value. If you have a variable length array of - 4-byte integers to hash, use hashword(). If you have a byte array (like - a character string), use hashlittle(). If you have several byte arrays, or - a mix of things, see the comments above hashlittle(). - - Why is this so big? I read 12 bytes at a time into 3 4-byte integers, - then mix those integers. This is fast (you can do a lot more thorough - mixing with 12*3 instructions on 3 integers than you can with 3 instructions - on 1 byte), but shoehorning those bytes into integers efficiently is messy. +These are functions for producing 32-bit hashes for hash table lookup. +hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() +are externally useful functions. Routines to test the hash are included +if SELF_TEST is defined. You can use this free for any purpose. It's in +the public domain. It has no warranty. + +You probably want to use hashlittle(). hashlittle() and hashbig() +hash byte arrays. hashlittle() is is faster than hashbig() on +little-endian machines. Intel and AMD are little-endian machines. +On second thought, you probably want hashlittle2(), which is identical to +hashlittle() except it returns two 32-bit hashes for the price of one. +You could implement hashbig2() if you wanted but I haven't bothered here. + +If you want to find a hash of, say, exactly 7 integers, do + a = i1; b = i2; c = i3; + mix(a,b,c); + a += i4; b += i5; c += i6; + mix(a,b,c); + a += i7; + final(a,b,c); +then use c as the hash value. If you have a variable length array of +4-byte integers to hash, use hashword(). If you have a byte array (like +a character string), use hashlittle(). If you have several byte arrays, or +a mix of things, see the comments above hashlittle(). + +Why is this so big? I read 12 bytes at a time into 3 4-byte integers, +then mix those integers. This is fast (you can do a lot more thorough +mixing with 12*3 instructions on 3 integers than you can with 3 instructions +on 1 byte), but shoehorning those bytes into integers efficiently is messy. ------------------------------------------------------------------------------- */ @@ -146,12 +147,10 @@ and these came close: hashlittle() has to dance around fitting the key bytes into registers. -------------------------------------------------------------------- */ -static uint32_t -jenkins_hashword( - const uint32_t *k, /* the key, an array of uint32_t values */ - size_t length, /* the length of the key, in uint32_ts */ - uint32_t initval /* the previous hash, or an arbitrary value */ -) +uint32_t jenkins_hash32( +const uint32_t *k, /* the key, an array of uint32_t values */ +size_t length, /* the length of the key, in uint32_ts */ +uint32_t initval) /* the previous hash, or an arbitrary value */ { uint32_t a,b,c; @@ -182,4 +181,283 @@ jenkins_hashword( /*------------------------------------------------------ report the result */ return c; } -#endif + +#if BYTE_ORDER == LITTLE_ENDIAN +/* +------------------------------------------------------------------------------- +hashlittle() -- hash a variable-length key into a 32-bit value + k : the key (the unaligned variable-length array of bytes) + length : the length of the key, counting by bytes + initval : can be any 4-byte value +Returns a 32-bit value. Every bit of the key affects every bit of +the return value. Two keys differing by one or two bits will have +totally different hash values. + +The best hash table sizes are powers of 2. There is no need to do +mod a prime (mod is sooo slow!). If you need less than 32 bits, +use a bitmask. For example, if you need only 10 bits, do + h = (h & hashmask(10)); +In which case, the hash table should have hashsize(10) elements. + +If you are hashing n strings (uint8_t **)k, do it like this: + for (i=0, h=0; i 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]&0xffffff" actually reads beyond the end of the string, but + * then masks off the part it's not allowed to read. Because the + * string is aligned, the masked-off tail is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff; a+=k[0]; break; + case 6 : b+=k[1]&0xffff; a+=k[0]; break; + case 5 : b+=k[1]&0xff; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff; break; + case 2 : a+=k[0]&0xffff; break; + case 1 : a+=k[0]&0xff; break; + case 0 : return c; /* zero length strings require no mixing */ + } + + } else if ((u.i & 0x1) == 0) { + const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ + const uint8_t *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((uint32_t)k[1])<<16); + b += k[2] + (((uint32_t)k[3])<<16); + c += k[4] + (((uint32_t)k[5])<<16); + mix(a,b,c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[4]+(((uint32_t)k[5])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=k[4]; + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=k[2]; + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=k[0]; + break; + case 1 : a+=k8[0]; + break; + case 0 : return c; /* zero length requires no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const uint8_t *k = (const uint8_t *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((uint32_t)k[1])<<8; + a += ((uint32_t)k[2])<<16; + a += ((uint32_t)k[3])<<24; + b += k[4]; + b += ((uint32_t)k[5])<<8; + b += ((uint32_t)k[6])<<16; + b += ((uint32_t)k[7])<<24; + c += k[8]; + c += ((uint32_t)k[9])<<8; + c += ((uint32_t)k[10])<<16; + c += ((uint32_t)k[11])<<24; + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=((uint32_t)k[11])<<24; + case 11: c+=((uint32_t)k[10])<<16; + case 10: c+=((uint32_t)k[9])<<8; + case 9 : c+=k[8]; + case 8 : b+=((uint32_t)k[7])<<24; + case 7 : b+=((uint32_t)k[6])<<16; + case 6 : b+=((uint32_t)k[5])<<8; + case 5 : b+=k[4]; + case 4 : a+=((uint32_t)k[3])<<24; + case 3 : a+=((uint32_t)k[2])<<16; + case 2 : a+=((uint32_t)k[1])<<8; + case 1 : a+=k[0]; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} + +#else /* !(BYTE_ORDER == LITTLE_ENDIAN) */ + +/* + * hashbig(): + * This is the same as hashword() on big-endian machines. It is different + * from hashlittle() on all machines. hashbig() takes advantage of + * big-endian byte ordering. + */ +uint32_t jenkins_hash( const void *key, size_t length, uint32_t initval) +{ + uint32_t a,b,c; + union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */ + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; + + u.ptr = key; + if ((u.i & 0x3) == 0) { + const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]<<8" actually reads beyond the end of the string, but + * then shifts out the part it's not allowed to read. Because the + * string is aligned, the illegal read is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff00; a+=k[0]; break; + case 6 : b+=k[1]&0xffff0000; a+=k[0]; break; + case 5 : b+=k[1]&0xff000000; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff00; break; + case 2 : a+=k[0]&0xffff0000; break; + case 1 : a+=k[0]&0xff000000; break; + case 0 : return c; /* zero length strings require no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const uint8_t *k = (const uint8_t *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += ((uint32_t)k[0])<<24; + a += ((uint32_t)k[1])<<16; + a += ((uint32_t)k[2])<<8; + a += ((uint32_t)k[3]); + b += ((uint32_t)k[4])<<24; + b += ((uint32_t)k[5])<<16; + b += ((uint32_t)k[6])<<8; + b += ((uint32_t)k[7]); + c += ((uint32_t)k[8])<<24; + c += ((uint32_t)k[9])<<16; + c += ((uint32_t)k[10])<<8; + c += ((uint32_t)k[11]); + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=k[11]; + case 11: c+=((uint32_t)k[10])<<8; + case 10: c+=((uint32_t)k[9])<<16; + case 9 : c+=((uint32_t)k[8])<<24; + case 8 : b+=k[7]; + case 7 : b+=((uint32_t)k[6])<<8; + case 6 : b+=((uint32_t)k[5])<<16; + case 5 : b+=((uint32_t)k[4])<<24; + case 4 : a+=k[3]; + case 3 : a+=((uint32_t)k[2])<<8; + case 2 : a+=((uint32_t)k[1])<<16; + case 1 : a+=((uint32_t)k[0])<<24; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} +#endif Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Tue Sep 4 12:02:23 2012 (r240085) +++ head/sys/net/flowtable.c Tue Sep 4 12:07:33 2012 (r240086) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include struct ipv4_tuple { @@ -585,7 +585,7 @@ ipv4_flow_lookup_hash_internal( } else offset = V_flow_hashjitter + proto; - return (jenkins_hashword(key, 3, offset)); + return (jenkins_hash32(key, 3, offset)); } static struct flentry * @@ -791,7 +791,7 @@ ipv6_flow_lookup_hash_internal( } else offset = V_flow_hashjitter + proto; - return (jenkins_hashword(key, 9, offset)); + return (jenkins_hash32(key, 9, offset)); } static struct flentry * Modified: head/sys/sys/hash.h ============================================================================== --- head/sys/sys/hash.h Tue Sep 4 12:02:23 2012 (r240085) +++ head/sys/sys/hash.h Tue Sep 4 12:07:33 2012 (r240086) @@ -118,4 +118,13 @@ hash32_strne(const void *buf, size_t len return hash; } + +#ifdef _KERNEL +/* + * Hashing function from Bob Jenkins. Implementation in libkern/jenkins_hash.c. + */ +uint32_t jenkins_hash(const void *, size_t, uint32_t); +uint32_t jenkins_hash32(const uint32_t *, size_t, uint32_t); +#endif /* _KERNEL */ + #endif /* !_SYS_HASH_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 12:19:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDA74106566B; Tue, 4 Sep 2012 12:19:34 +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 AE91E8FC12; Tue, 4 Sep 2012 12:19: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 q84CJYsU052739; Tue, 4 Sep 2012 12:19:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84CJYQK052737; Tue, 4 Sep 2012 12:19:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209041219.q84CJYQK052737@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 4 Sep 2012 12:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240087 - head/bin/setfacl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 12:19:35 -0000 Author: trasz Date: Tue Sep 4 12:19:34 2012 New Revision: 240087 URL: http://svn.freebsd.org/changeset/base/240087 Log: Fix an error in setfacl(1) that manifested like this: # setfacl -m u:trasz:rwx x # setfacl -m u:root:rwx x # getfacl x # file: x # owner: root # group: wheel user::rw- user:root:rwx user:trasz:rwx group::r-- mask::rwx other::r-- # setfacl -m u:root:rwx x setfacl: x: acl_calc_mask() failed: Invalid argument setfacl: x: failed to set ACL mask For NFSv4 ACLs, this sort of situation would result in duplicated entries. MFC after: 1 month Modified: head/bin/setfacl/merge.c Modified: head/bin/setfacl/merge.c ============================================================================== --- head/bin/setfacl/merge.c Tue Sep 4 12:07:33 2012 (r240086) +++ head/bin/setfacl/merge.c Tue Sep 4 12:19:34 2012 (r240087) @@ -94,7 +94,7 @@ merge_acl(acl_t acl, acl_t *prev_acl, co acl_tag_t tag, tag_new; acl_entry_type_t entry_type, entry_type_new; acl_flagset_t flagset; - int entry_id, entry_id_new, have_entry, entry_number = 0; + int entry_id, entry_id_new, have_entry, had_entry, entry_number = 0; int acl_brand, prev_acl_brand; acl_get_brand_np(acl, &acl_brand); @@ -116,6 +116,7 @@ merge_acl(acl_t acl, acl_t *prev_acl, co while (acl_get_entry(acl, entry_id, &entry) == 1) { entry_id = ACL_NEXT_ENTRY; have_entry = 0; + had_entry = 0; /* keep track of existing ACL_MASK entries */ if (acl_get_tag_type(entry, &tag) == -1) @@ -187,7 +188,7 @@ merge_acl(acl_t acl, acl_t *prev_acl, co err(1, "%s: acl_set_flagset_np() failed", filename); } - have_entry = 1; + had_entry = have_entry = 1; break; default: /* should never be here */ @@ -197,7 +198,7 @@ merge_acl(acl_t acl, acl_t *prev_acl, co } /* if this entry has not been found, it must be new */ - if (have_entry == 0) { + if (had_entry == 0) { /* * NFSv4 ACL entries must be prepended to the ACL. From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 12:27:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D29510656D2; Tue, 4 Sep 2012 12:27:24 +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 68D8F8FC1E; Tue, 4 Sep 2012 12: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 q84CROu9053731; Tue, 4 Sep 2012 12:27:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84CRNZU053729; Tue, 4 Sep 2012 12:27:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209041227.q84CRNZU053729@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 4 Sep 2012 12:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240088 - head/bin/cp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 12:27:24 -0000 Author: trasz Date: Tue Sep 4 12:27:23 2012 New Revision: 240088 URL: http://svn.freebsd.org/changeset/base/240088 Log: Explicitly mention that "cp -p" copies ACLs. PR: docs/168962 MFC after: 1 month Modified: head/bin/cp/cp.1 Modified: head/bin/cp/cp.1 ============================================================================== --- head/bin/cp/cp.1 Tue Sep 4 12:19:34 2012 (r240087) +++ head/bin/cp/cp.1 Tue Sep 4 12:27:23 2012 (r240088) @@ -32,7 +32,7 @@ .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd September 4, 2012 .Dt CP 1 .Os .Sh NAME @@ -164,7 +164,7 @@ Cause .Nm to preserve the following attributes of each source file in the copy: modification time, access time, -file flags, file mode, user ID, and group ID, as allowed by permissions. +file flags, file mode, ACL, user ID, and group ID, as allowed by permissions. .Pp If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered. From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 16:00:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6A851065675; Tue, 4 Sep 2012 16:00:51 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0A6A8FC14; Tue, 4 Sep 2012 16:00:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q84G0pSd080314; Tue, 4 Sep 2012 16:00:51 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84G0p4u080312; Tue, 4 Sep 2012 16:00:51 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209041600.q84G0p4u080312@svn.freebsd.org> From: Doug Barton Date: Tue, 4 Sep 2012 16:00: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: r240090 - head/libexec/save-entropy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 16:00:52 -0000 Author: dougb Date: Tue Sep 4 16:00:51 2012 New Revision: 240090 URL: http://svn.freebsd.org/changeset/base/240090 Log: 1. Use install -d to create the entropy_dir if missing so that we can do it all in one command, with no permissions race. 2. Simplify the rotation logic by cd'ing into the directory, with a test to make sure that it succeeds. 3. Remove any files numbered higher than entropy_save_num. This helps when the user reduces the number, and may be useful for other purposes down the road. 4. Simplify the rotation logic by first testing the common case (it's a regular file) then testing if something else exists with the same name using elif. Also switch from using jot to simpler countdown format. 5. Fix logger lines and error messages to be more consistent, and wrap the code more consistently in the 80 column range. The "not a regular file" error message was mistakenly wrapped entirely in "quotes" which caused logger to include line-wrapping whitespace. Change that to wrap only the variables in quotes, which is both consistent and works better. 6. Update copyright to reflect the fact that changes were made this year. Parts of 2-4 were taken from etc/periodic/daily/310.accounting Modified: head/libexec/save-entropy/save-entropy.sh Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Tue Sep 4 15:58:58 2012 (r240089) +++ head/libexec/save-entropy/save-entropy.sh Tue Sep 4 16:00:51 2012 (r240090) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2001-2006 Douglas Barton, DougB@FreeBSD.org +# Copyright (c) 2001-2006,2012 Douglas Barton, dougb@FreeBSD.org # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ # This script is called by cron to store bits of randomness which are # then used to seed /dev/random on boot. -# Originally developed by Doug Barton, DougB@FreeBSD.org +# Originally developed by Doug Barton, dougb@FreeBSD.org PATH=/bin:/usr/bin @@ -55,38 +55,36 @@ entropy_save_sz=${entropy_save_sz:-2048} entropy_save_num=${entropy_save_num:-8} if [ ! -d "${entropy_dir}" ]; then - umask 077 - mkdir "${entropy_dir}" || { - logger -is -t "$0" The entropy directory "${entropy_dir}" does not \ -exist, and cannot be created. Therefore no entropy can be saved. ; - exit 1;} - /usr/sbin/chown operator:operator "${entropy_dir}" - chmod 0700 "${entropy_dir}" + install -d -o operator -g operator -m 0700 "${entropy_dir}" || { + logger -is -t "$0" The entropy directory "${entropy_dir}" does \ + not exist, and cannot be created. Therefore no entropy can \ + be saved.; exit 1; } fi +cd "${entropy_dir}" || { + logger -is -t "$0" Cannot cd to the entropy directory: "${entropy_dir}". \ + Entropy file rotation is aborted.; exit 1; } + +for f in saved-entropy.*; do + case "${f}" in saved-entropy.\*) continue ;; esac # No files match + [ ${f#saved-entropy\.} -ge ${entropy_save_num} ] && unlink ${f} +done + umask 377 -esn_m1=$(( ${entropy_save_num} - 1 )) -for file_num in `jot $esn_m1 $esn_m1 1`; do - if [ -e "${entropy_dir}/saved-entropy.${file_num}" ]; then - if [ -f "${entropy_dir}/saved-entropy.${file_num}" ]; then - new_file=saved-entropy.$(( $file_num + 1 )) - if [ -e "${entropy_dir}/${new_file}" ]; then - unlink ${entropy_dir}/${new_file} - fi - mv "${entropy_dir}/saved-entropy.${file_num}" \ - "${entropy_dir}/${new_file}" - else - logger -is -t "$0" \ -"${entropy_dir}/saved-entropy.${file_num} is not a regular file, and therefore \ -it will not be rotated. Entropy file harvesting is aborted." - exit 1 - fi +n=$(( ${entropy_save_num} - 1 )) +while [ ${n} -ge 1 ]; do + if [ -f "saved-entropy.${n}" ]; then + mv "saved-entropy.${n}" "saved-entropy.$(( ${n} + 1 ))" + elif [ -e "saved-entropy.${n}" -o -L "saved-entropy.${n}" ]; then + logger -is -t "$0" \ + "${entropy_dir}/saved-entropy.${n}" is not a regular file, and so \ + it will not be rotated. Entropy file rotation is aborted. + exit 1 fi + n=$(( ${n} - 1 )) done -dd if=/dev/random of="${entropy_dir}/saved-entropy.1" \ - bs="$entropy_save_sz" count=1 2> /dev/null +dd if=/dev/random of=saved-entropy.1 bs=${entropy_save_sz} count=1 2>/dev/null exit 0 - From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 18:14:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA39A106564A; Tue, 4 Sep 2012 18:14:27 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 688618FC14; Tue, 4 Sep 2012 18:14:26 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id CF7E2119C56; Tue, 4 Sep 2012 20:14:25 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id yiY+hZqZQyIE; Tue, 4 Sep 2012 20:14:25 +0200 (CEST) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id C10EB119C40; Tue, 4 Sep 2012 20:14:24 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <201209020148.q821ml0M018010@svn.freebsd.org> Date: Tue, 4 Sep 2012 20:14:23 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <07899894-3253-4F16-9CAB-8339E23D57F8@semihalf.com> References: <201209020148.q821ml0M018010@svn.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 18:14:27 -0000 On 2012-09-02, at 03:48, Andrew Turner wrote: > Author: andrew > Date: Sun Sep 2 01:48:47 2012 > New Revision: 239998 > URL: http://svn.freebsd.org/changeset/base/239998 >=20 > Log: > Fix a logic inversion in an assert to allow us to use dts files that > include other files. >=20 > Modified: > head/contrib/dtc/dtc-lexer.l Is this a bug in the dtc that should be upstreamed perhaps, or is it = fixed at the point beyond our recent import of the vendor package? Rafal From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 19:04:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98546106566C; Tue, 4 Sep 2012 19:04: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 826C78FC15; Tue, 4 Sep 2012 19:04: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 q84J42so004103; Tue, 4 Sep 2012 19:04:02 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84J42ng004100; Tue, 4 Sep 2012 19:04:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209041904.q84J42ng004100@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 4 Sep 2012 19:04: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: r240096 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 19:04:02 -0000 Author: des Date: Tue Sep 4 19:04:02 2012 New Revision: 240096 URL: http://svn.freebsd.org/changeset/base/240096 Log: No memory barrier is required. This was pointed out by kib@ a while ago, but I got distracted by other matters. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Sep 4 17:29:35 2012 (r240095) +++ head/sys/vm/swap_pager.c Tue Sep 4 19:04:02 2012 (r240096) @@ -50,7 +50,7 @@ * * - on the fly reallocation of swap during putpages. The new system * does not try to keep previously allocated swap blocks for dirty - * pages. + * pages. * * - on the fly deallocation of swap * @@ -154,15 +154,21 @@ int swap_pager_avail; static int swdev_syscall_active = 0; /* serialize swap(on|off) */ static vm_ooffset_t swap_total; -SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, +SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, "Total amount of available swap storage."); static vm_ooffset_t swap_reserved; -SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, +SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, "Amount of swap storage needed to back all allocated anonymous memory."); static int overcommit = 0; -SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, +SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, "Configure virtual memory overcommit behavior. See tuning(7) " "for details."); +static unsigned long swzone; +SYSCTL_ULONG(_vm, OID_AUTO, swzone, CTLFLAG_RD, &swzone, 0, + "Actual size of swap metadata zone"); +static unsigned long swap_maxpages; +SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0, + "Maximum amount of swap supported"); /* bits from overcommit */ #define SWAP_RESERVE_FORCE_ON (1 << 0) @@ -184,7 +190,7 @@ swap_reserve_by_cred(vm_ooffset_t incr, static int curfail; static struct timeval lastfail; struct uidinfo *uip; - + uip = cred->cr_ruidinfo; if (incr & PAGE_MASK) @@ -285,7 +291,7 @@ void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) { struct uidinfo *uip; - + uip = cred->cr_ruidinfo; if (decr & PAGE_MASK) @@ -328,7 +334,7 @@ static struct sx sw_alloc_sx; SYSCTL_INT(_vm, OID_AUTO, swap_async_max, - CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); + CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); /* * "named" and "unnamed" anon region objects. Try to reduce the overhead @@ -340,7 +346,7 @@ SYSCTL_INT(_vm, OID_AUTO, swap_async_max #define NOBJLIST(handle) \ (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) -static struct mtx sw_alloc_mtx; /* protect list manipulation */ +static struct mtx sw_alloc_mtx; /* protect list manipulation */ static struct pagerlst swap_pager_object_list[NOBJLISTS]; static uma_zone_t swap_zone; static struct vm_object swap_zone_obj; @@ -419,7 +425,7 @@ swp_pager_free_nrpage(vm_page_t m) /* * SWP_SIZECHECK() - update swap_pager_full indication - * + * * update the swap_pager_almost_full indication and warn when we are * about to run out of swap space, using lowat/hiwat hysteresis. * @@ -474,7 +480,7 @@ swp_pager_hash(vm_object_t object, vm_pi /* * SWAP_PAGER_INIT() - initialize the swap pager! * - * Expected to be started from system init. NOTE: This code is run + * Expected to be started from system init. NOTE: This code is run * before much else so be careful what you depend on. Most of the VM * system has yet to be initialized at this point. */ @@ -506,7 +512,7 @@ swap_pager_init(void) void swap_pager_swap_init(void) { - int n, n2; + unsigned long n, n2; /* * Number of in-transit swap bp operations. Don't @@ -519,7 +525,7 @@ swap_pager_swap_init(void) * MAX_PAGEOUT_CLUSTER. Also be aware that swap ops are * constrained by the swap device interleave stripe size. * - * Currently we hardwire nsw_wcount_async to 4. This limit is + * Currently we hardwire nsw_wcount_async to 4. This limit is * designed to prevent other I/O from having high latencies due to * our pageout I/O. The value 4 works well for one or two active swap * devices but is probably a little low if you have more. Even so, @@ -548,11 +554,11 @@ swap_pager_swap_init(void) n = cnt.v_page_count / 2; if (maxswzone && n > maxswzone / sizeof(struct swblock)) n = maxswzone / sizeof(struct swblock); - n2 = n; swap_zone = uma_zcreate("SWAPMETA", sizeof(struct swblock), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); if (swap_zone == NULL) panic("failed to create swap_zone."); + n2 = n; do { if (uma_zone_set_obj(swap_zone, &swap_zone_obj, n)) break; @@ -563,12 +569,13 @@ swap_pager_swap_init(void) n -= ((n + 2) / 3); } while (n > 0); if (n2 != n) - printf("Swap zone entries reduced from %d to %d.\n", n2, n); - n2 = n; + printf("Swap zone entries reduced from %lu to %lu.\n", n2, n); + swap_maxpages = n * SWAP_META_PAGES; + swzone = n * sizeof(struct swblock); /* * Initialize our meta-data hash table. The swapper does not need to - * be quite as efficient as the VM system, so we do not use an + * be quite as efficient as the VM system, so we do not use an * oversized hash table. * * n: size of hash table, must be power of 2 @@ -654,7 +661,7 @@ swap_pager_alloc(void *handle, vm_ooffse /* * SWAP_PAGER_DEALLOC() - remove swap metadata from object * - * The swap backing for the object is destroyed. The code is + * The swap backing for the object is destroyed. The code is * designed such that we can reinstantiate it later, but this * routine is typically called only when the entire object is * about to be destroyed. @@ -679,7 +686,7 @@ swap_pager_dealloc(vm_object_t object) vm_object_pip_wait(object, "swpdea"); /* - * Free all remaining metadata. We only bother to free it from + * Free all remaining metadata. We only bother to free it from * the swap meta data. We do not attempt to free swapblk's still * associated with vm_page_t's for this object. We do not care * if paging is still in progress on some objects. @@ -748,7 +755,7 @@ swp_pager_isondev(daddr_t blk, struct sw return (blk >= sp->sw_first && blk < sp->sw_end); } - + static void swp_pager_strategy(struct buf *bp) { @@ -764,10 +771,10 @@ swp_pager_strategy(struct buf *bp) } panic("Swapdev not found"); } - + /* - * SWP_PAGER_FREESWAPSPACE() - free raw swap space + * SWP_PAGER_FREESWAPSPACE() - free raw swap space * * This routine returns the specified swap blocks back to the bitmap. * @@ -785,7 +792,7 @@ swp_pager_freeswapspace(daddr_t blk, int /* * If we are attempting to stop swapping on * this device, we don't want to mark any - * blocks free lest they be reused. + * blocks free lest they be reused. */ if ((sp->sw_flags & SW_CLOSING) == 0) { blist_free(sp->sw_blist, blk - sp->sw_first, @@ -808,8 +815,8 @@ swp_pager_freeswapspace(daddr_t blk, int * * This routine removes swapblk assignments from swap metadata. * - * The external callers of this routine typically have already destroyed - * or renamed vm_page_t's associated with this range in the object so + * The external callers of this routine typically have already destroyed + * or renamed vm_page_t's associated with this range in the object so * we should be ok. */ void @@ -823,7 +830,7 @@ swap_pager_freespace(vm_object_t object, /* * SWAP_PAGER_RESERVE() - reserve swap blocks in object * - * Assigns swap blocks to the specified range within the object. The + * Assigns swap blocks to the specified range within the object. The * swap blocks are not zerod. Any previous swap assignment is destroyed. * * Returns 0 on success, -1 on failure. @@ -869,7 +876,7 @@ swap_pager_reserve(vm_object_t object, v * * This routine is allowed to sleep. It may sleep allocating metadata * indirectly through swp_pager_meta_build() or if paging is still in - * progress on the source. + * progress on the source. * * The source object contains no vm_page_t's (which is just as well) * @@ -888,8 +895,8 @@ swap_pager_copy(vm_object_t srcobject, v VM_OBJECT_LOCK_ASSERT(dstobject, MA_OWNED); /* - * If destroysource is set, we remove the source object from the - * swap_pager internal queue now. + * If destroysource is set, we remove the source object from the + * swap_pager internal queue now. */ if (destroysource) { if (srcobject->handle != NULL) { @@ -925,7 +932,7 @@ swap_pager_copy(vm_object_t srcobject, v daddr_t srcaddr; srcaddr = swp_pager_meta_ctl( - srcobject, + srcobject, i + offset, SWM_POP ); @@ -947,7 +954,7 @@ swap_pager_copy(vm_object_t srcobject, v * Destination has valid swapblk or it is represented * by a resident page. We destroy the sourceblock. */ - + swp_pager_meta_ctl(srcobject, i + offset, SWM_FREE); } } @@ -1042,7 +1049,7 @@ swap_pager_haspage(vm_object_t object, v * SWAP_PAGER_PAGE_UNSWAPPED() - remove swap backing store related to page * * This removes any associated swap backing store, whether valid or - * not, from the page. + * not, from the page. * * This routine is typically called when a page is made dirty, at * which point any associated swap can be freed. MADV_FREE also @@ -1071,7 +1078,7 @@ swap_pager_unswapped(vm_page_t m) * a chunk surrounding m[reqpage] as is contiguous in swap and which * belongs to the same object. * - * The code is designed for asynchronous operation and + * The code is designed for asynchronous operation and * immediate-notification of 'reqpage' but tends not to be * used that way. Please do not optimize-out this algorithmic * feature, I intend to improve on it in the future. @@ -1101,7 +1108,7 @@ swap_pager_getpages(vm_object_t object, * Calculate range to retrieve. The pages have already been assigned * their swapblks. We require a *contiguous* range but we know it to * not span devices. If we do not supply it, bad things - * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the + * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the * loops are set up such that the case(s) are handled implicitly. * * The swp_*() calls must be made with the object locked. @@ -1139,7 +1146,7 @@ swap_pager_getpages(vm_object_t object, } /* - * Return VM_PAGER_FAIL if we have nothing to do. Return mreq + * Return VM_PAGER_FAIL if we have nothing to do. Return mreq * still busy, but the others unbusied. */ if (blk == SWAPBLK_NONE) @@ -1234,21 +1241,21 @@ swap_pager_getpages(vm_object_t object, /* * A final note: in a low swap situation, we cannot deallocate swap * and mark a page dirty here because the caller is likely to mark - * the page clean when we return, causing the page to possibly revert + * the page clean when we return, causing the page to possibly revert * to all-zero's later. */ } /* - * swap_pager_putpages: + * swap_pager_putpages: * * Assign swap (if necessary) and initiate I/O on the specified pages. * * We support both OBJT_DEFAULT and OBJT_SWAP objects. DEFAULT objects * are automatically converted to SWAP objects. * - * In a low memory situation we may block in VOP_STRATEGY(), but the new - * vm_page reservation system coupled with properly written VFS devices + * In a low memory situation we may block in VOP_STRATEGY(), but the new + * vm_page reservation system coupled with properly written VFS devices * should ensure that no low-memory deadlock occurs. This is an area * which needs work. * @@ -1269,8 +1276,8 @@ swap_pager_putpages(vm_object_t object, int n = 0; if (count && m[0]->object != object) { - panic("swap_pager_putpages: object mismatch %p/%p", - object, + panic("swap_pager_putpages: object mismatch %p/%p", + object, m[0]->object ); } @@ -1292,7 +1299,7 @@ swap_pager_putpages(vm_object_t object, /* * Step 2 * - * Update nsw parameters from swap_async_max sysctl values. + * Update nsw parameters from swap_async_max sysctl values. * Do not let the sysop crash the machine with bogus numbers. */ mtx_lock(&pbuf_mtx); @@ -1384,7 +1391,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t mreq = m[i+j]; swp_pager_meta_build( - mreq->object, + mreq->object, mreq->pindex, blk + j ); @@ -1453,10 +1460,10 @@ swap_pager_putpages(vm_object_t object, * Completion routine for asynchronous reads and writes from/to swap. * Also called manually by synchronous code to finish up a bp. * - * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, - * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY - * unbusy all pages except the 'main' request page. For WRITE - * operations, we vm_page_t->busy'd unbusy all pages ( we can do this + * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, + * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY + * unbusy all pages except the 'main' request page. For WRITE + * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). * * This routine may not sleep. @@ -1475,7 +1482,7 @@ swp_pager_async_iodone(struct buf *bp) "swap_pager: I/O error - %s failed; blkno %ld," "size %ld, error %d\n", ((bp->b_iocmd == BIO_READ) ? "pagein" : "pageout"), - (long)bp->b_blkno, + (long)bp->b_blkno, (long)bp->b_bcount, bp->b_error ); @@ -1495,7 +1502,7 @@ swp_pager_async_iodone(struct buf *bp) * cleanup pages. If an error occurs writing to swap, we are in * very serious trouble. If it happens to be a disk error, though, * we may be able to recover by reassigning the swap later on. So - * in this case we remove the m->swapblk assignment for the page + * in this case we remove the m->swapblk assignment for the page * but do not free it in the rlist. The errornous block(s) are thus * never reallocated as swap. Redirty the page and continue. */ @@ -1508,7 +1515,7 @@ swp_pager_async_iodone(struct buf *bp) /* * If an error occurs I'd love to throw the swapblk * away without freeing it back to swapspace, so it - * can never be used again. But I can't from an + * can never be used again. But I can't from an * interrupt. */ if (bp->b_iocmd == BIO_READ) { @@ -1517,7 +1524,7 @@ swp_pager_async_iodone(struct buf *bp) * locked for the parent, but all other * pages can be freed. We still want to * wakeup the parent waiting on the page, - * though. ( also: pg_reqpage can be -1 and + * though. ( also: pg_reqpage can be -1 and * not match anything ). * * We have to wake specifically requested pages @@ -1534,7 +1541,7 @@ swp_pager_async_iodone(struct buf *bp) else vm_page_flash(m); /* - * If i == bp->b_pager.pg_reqpage, do not wake + * If i == bp->b_pager.pg_reqpage, do not wake * the page up. The caller needs to. */ } else { @@ -1551,7 +1558,7 @@ swp_pager_async_iodone(struct buf *bp) } } else if (bp->b_iocmd == BIO_READ) { /* - * NOTE: for reads, m->dirty will probably be + * NOTE: for reads, m->dirty will probably be * overridden by the original caller of getpages so * we cannot set them in order to free the underlying * swap in a low-swap situation. I don't think we'd @@ -1563,7 +1570,7 @@ swp_pager_async_iodone(struct buf *bp) * * Note that the requested page, reqpage, is left * busied, but we still have to wake it up. The - * other pages are released (unbusied) by + * other pages are released (unbusied) by * vm_page_wakeup(). */ KASSERT(!pmap_page_is_mapped(m), @@ -1577,7 +1584,7 @@ swp_pager_async_iodone(struct buf *bp) * up too because we cleared VPO_SWAPINPROG and * could be waiting for it in getpages. However, * be sure to not unbusy getpages specifically - * requested page - getpages expects it to be + * requested page - getpages expects it to be * left busy. */ if (i != bp->b_pager.pg_reqpage) { @@ -1590,7 +1597,7 @@ swp_pager_async_iodone(struct buf *bp) } else { /* * For write success, clear the dirty - * status, then finish the I/O ( which decrements the + * status, then finish the I/O ( which decrements the * busy count and possibly wakes waiter's up ). */ KASSERT(!pmap_page_is_write_mapped(m), @@ -1615,8 +1622,8 @@ swp_pager_async_iodone(struct buf *bp) VM_OBJECT_UNLOCK(object); } - /* - * swapdev_strategy() manually sets b_vp and b_bufobj before calling + /* + * swapdev_strategy() manually sets b_vp and b_bufobj before calling * bstrategy(). Set them back to NULL now we're done with it, or we'll * trigger a KASSERT in relpbuf(). */ @@ -1628,10 +1635,10 @@ swp_pager_async_iodone(struct buf *bp) * release the physical I/O buffer */ relpbuf( - bp, - ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : - ((bp->b_flags & B_ASYNC) ? - &nsw_wcount_async : + bp, + ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : + ((bp->b_flags & B_ASYNC) ? + &nsw_wcount_async : &nsw_wcount_sync ) ) @@ -1744,8 +1751,8 @@ restart: for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { vm_object_t object = swap->swb_object; vm_pindex_t pindex = swap->swb_index; - for (j = 0; j < SWAP_META_PAGES; ++j) { - if (swp_pager_isondev(swap->swb_pages[j], sp)) { + for (j = 0; j < SWAP_META_PAGES; ++j) { + if (swp_pager_isondev(swap->swb_pages[j], sp)) { /* avoid deadlock */ if (!VM_OBJECT_TRYLOCK(object)) { break; @@ -1758,7 +1765,7 @@ restart: goto restart; } } - } + } } } mtx_unlock(&swhash_mtx); @@ -1783,7 +1790,7 @@ restart: * SWAP META DATA * ************************************************************************ * - * These routines manipulate the swap metadata stored in the + * These routines manipulate the swap metadata stored in the * OBJT_SWAP object. * * Swap metadata is implemented with a global hash and not directly @@ -1821,13 +1828,13 @@ swp_pager_meta_build(vm_object_t object, mtx_lock(&sw_alloc_mtx); TAILQ_INSERT_TAIL( NOBJLIST(object->handle), - object, + object, pager_object_list ); mtx_unlock(&sw_alloc_mtx); } } - + /* * Locate hash entry. If not found create, but if we aren't adding * anything just return. If we run out of space in the map we wait @@ -1848,7 +1855,7 @@ retry: mtx_unlock(&swhash_mtx); VM_OBJECT_UNLOCK(object); if (uma_zone_exhausted(swap_zone)) { - if (atomic_cmpset_rel_int(&exhausted, 0, 1)) + if (atomic_cmpset_int(&exhausted, 0, 1)) printf("swap zone exhausted, " "increase kern.maxswzone\n"); vm_pageout_oom(VM_OOM_SWAPZ); @@ -1859,7 +1866,7 @@ retry: goto retry; } - if (atomic_cmpset_rel_int(&exhausted, 1, 0)) + if (atomic_cmpset_int(&exhausted, 1, 0)) printf("swap zone ok\n"); swap->swb_hnext = NULL; @@ -1896,10 +1903,10 @@ done: /* * SWP_PAGER_META_FREE() - free a range of blocks in the object's swap metadata * - * The requested range of blocks is freed, with any associated swap + * The requested range of blocks is freed, with any associated swap * returned to the swap bitmap. * - * This routine will free swap metadata structures as they are cleaned + * This routine will free swap metadata structures as they are cleaned * out. This routine does *NOT* operate on swap metadata associated * with resident pages. */ @@ -1991,14 +1998,14 @@ swp_pager_meta_free_all(vm_object_t obje * swapblk assignments in the swap meta data or in the vm_page_t. * The routine typically returns the swapblk being looked-up, or popped, * or SWAPBLK_NONE if the block was freed, or SWAPBLK_NONE if the block - * was invalid. This routine will automatically free any invalid + * was invalid. This routine will automatically free any invalid * meta-data swapblks. * * It is not possible to store invalid swapblks in the swap meta data * (other then a literal 'SWAPBLK_NONE'), so we don't bother checking. * - * When acting on a busy resident page and paging is in progress, we - * have to wait until paging is complete but otherwise can act on the + * When acting on a busy resident page and paging is in progress, we + * have to wait until paging is complete but otherwise can act on the * busy page. * * SWM_FREE remove and free swap block from metadata @@ -2014,7 +2021,7 @@ swp_pager_meta_ctl(vm_object_t object, v VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); /* - * The meta data only exists of the object is OBJT_SWAP + * The meta data only exists of the object is OBJT_SWAP * and even then might not be allocated yet. */ if (object->type != OBJT_SWAP) @@ -2040,7 +2047,7 @@ swp_pager_meta_ctl(vm_object_t object, v uma_zfree(swap_zone, swap); --object->un_pager.swp.swp_bcount; } - } + } } } mtx_unlock(&swhash_mtx); @@ -2058,7 +2065,7 @@ struct swapon_args { }; #endif -/* +/* * MPSAFE */ /* ARGSUSED */ @@ -2153,7 +2160,7 @@ swaponsomething(struct vnode *vp, void * /* * nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks. * First chop nblks off to page-align it, then convert. - * + * * sw->sw_nblks is in page-sized chunks now too. */ nblks &= ~(ctodb(1) - 1); @@ -2342,12 +2349,12 @@ swapoff_all(void) struct swdevt *sp, *spt; const char *devname; int error; - + mtx_lock(&Giant); while (swdev_syscall_active) tsleep(&swdev_syscall_active, PUSER - 1, "swpoff", 0); swdev_syscall_active = 1; - + mtx_lock(&sw_dev_mtx); TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); @@ -2365,7 +2372,7 @@ swapoff_all(void) mtx_lock(&sw_dev_mtx); } mtx_unlock(&sw_dev_mtx); - + swdev_syscall_active = 0; wakeup_one(&swdev_syscall_active); mtx_unlock(&Giant); @@ -2709,7 +2716,7 @@ swaponvp(struct thread *td, struct vnode } } mtx_unlock(&sw_dev_mtx); - + (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_system_check_swapon(td->td_ucred, vp); From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 19:13:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA1631065738; Tue, 4 Sep 2012 19:13:03 +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 3A81F8FC1F; Tue, 4 Sep 2012 19:13:03 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A4224B972; Tue, 4 Sep 2012 15:13:02 -0400 (EDT) From: John Baldwin To: "Dag-Erling SmXrgrav" Date: Tue, 4 Sep 2012 15:11:56 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201209041904.q84J42ng004100@svn.freebsd.org> In-Reply-To: <201209041904.q84J42ng004100@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209041511.56128.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Sep 2012 15:13:02 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240096 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 19:13:04 -0000 On Tuesday, September 04, 2012 3:04:02 pm Dag-Erling SmXrgrav wrote: > Author: des > Date: Tue Sep 4 19:04:02 2012 > New Revision: 240096 > URL: http://svn.freebsd.org/changeset/base/240096 > > Log: > No memory barrier is required. This was pointed out by kib@ a while ago, > but I got distracted by other matters. Humm, this seemed to have a lot of unrelated changes? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 19:19:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34C541065676; Tue, 4 Sep 2012 19:19: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 5A6798FC1A; Tue, 4 Sep 2012 19:19: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 q84JJbrS006121; Tue, 4 Sep 2012 19:19:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84JJbj7006117; Tue, 4 Sep 2012 19:19:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209041919.q84JJbj7006117@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Sep 2012 19:19: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: r240098 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 19:19:38 -0000 Author: jhb Date: Tue Sep 4 19:19:36 2012 New Revision: 240098 URL: http://svn.freebsd.org/changeset/base/240098 Log: Fix duplicate entries for mwl(4): - Move mwlfw from {amd64,i386}/conf/NOTES to sys/conf/NOTES (mwl(4) is already present in sys/conf/NOTES). - Remove duplicate mwl(4) entries from {amd64,i386}/conf/NOTES. - While here, add a description to the sfxge line in amd64/conf/NOTES. Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Sep 4 19:14:57 2012 (r240097) +++ head/sys/amd64/conf/NOTES Tue Sep 4 19:19:36 2012 (r240098) @@ -306,8 +306,6 @@ options DRM_DEBUG # Include debug print # 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) # nve: nVidia nForce MCP on-board Ethernet Networking # sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters @@ -324,10 +322,9 @@ device iwn # Intel 4965/1000/5000/6000 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 -device sfxge +device sfxge # Solarflare SFC9000 10Gb Ethernet device wpi # Intel 3945ABG wireless NICs. # IEEE 802.11 adapter firmware modules @@ -350,7 +347,6 @@ device wpi # Intel 3945ABG wireless NI # iwn5150fw: Specific module for the 5150 only # iwn6000fw: Specific module for the 6000 only # iwn6050fw: Specific module for the 6050 only -# mwlfw: Marvell 88W8363 firmware # wpifw: Intel 3945ABG Wireless LAN Controller firmware device iwifw @@ -368,7 +364,6 @@ device iwn5000fw device iwn5150fw device iwn6000fw device iwn6050fw -device mwlfw device wpifw # Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Sep 4 19:14:57 2012 (r240097) +++ head/sys/conf/NOTES Tue Sep 4 19:19:36 2012 (r240098) @@ -1968,6 +1968,8 @@ device xmphy # XaQti XMAC II # SMC TigerCard 1000 (SMC9462SX), and some Addtron cards. # malo: Marvell Libertas wireless NICs. # mwl: Marvell 88W8363 802.11n wireless NICs. +# Requires the mwl firmware module +# mwlfw: Marvell 88W8363 firmware # msk: Support for gigabit ethernet adapters based on the Marvell/SysKonnect # Yukon II Gigabit controllers, including 88E8021, 88E8022, 88E8061, # 88E8062, 88E8035, 88E8036, 88E8038, 88E8050, 88E8052, 88E8053, @@ -2163,6 +2165,7 @@ device bwi # Broadcom BCM430* BCM431* device bwn # Broadcom BCM43xx device malo # Marvell Libertas wireless NICs. device mwl # Marvell 88W8363 802.11n wireless NICs. +device mwlfw device ral # Ralink Technology RT2500 wireless NICs. # Use sf_buf(9) interface for jumbo buffers on ti(4) controllers. Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Sep 4 19:14:57 2012 (r240097) +++ head/sys/i386/conf/NOTES Tue Sep 4 19:19:36 2012 (r240098) @@ -577,8 +577,6 @@ hint.mse.0.irq="5" # 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) # nve: nVidia nForce MCP on-board Ethernet Networking # sbni: Granch SBNI12-xx ISA and PCI adapters @@ -624,7 +622,6 @@ 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 device sbni @@ -659,7 +656,6 @@ device wpi # Intel 3945ABG wireless NI # iwn5150fw: Specific module for the 5150 only # iwn6000fw: Specific module for the 6000 only # iwn6050fw: Specific module for the 6050 only -# mwlfw: Marvell 88W8363 firmware # wpifw: Intel 3945ABG Wireless LAN Controller firmware device iwifw @@ -677,7 +673,6 @@ device iwn5000fw device iwn5150fw device iwn6000fw device iwn6050fw -device mwlfw device wpifw # From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 19:43:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6325106564A; Tue, 4 Sep 2012 19:43:26 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE1298FC18; Tue, 4 Sep 2012 19:43: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 q84JhQ9H008925; Tue, 4 Sep 2012 19:43:26 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84JhQ7h008917; Tue, 4 Sep 2012 19:43:26 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209041943.q84JhQ7h008917@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 4 Sep 2012 19:43: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: r240099 - in head/sys: net netinet netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 19:43:26 -0000 Author: melifaro Date: Tue Sep 4 19:43:26 2012 New Revision: 240099 URL: http://svn.freebsd.org/changeset/base/240099 Log: Introduce new link-layer PFIL hook V_link_pfil_hook. Merge ether_ipfw_chk() and part of bridge_pfil() into unified ipfw_check_frame() function called by PFIL. This change was suggested by rwatson? @ DevSummit. Remove ipfw headers from ether/bridge code since they are unneeded now. Note this thange introduce some (temporary) performance penalty since PFIL read lock has to be acquired for every link-level packet. MFC after: 3 weeks Modified: head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/net/if_var.h head/sys/netinet/ip_var.h head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/net/if_bridge.c Tue Sep 4 19:43:26 2012 (r240099) @@ -100,7 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -131,8 +130,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include /* * Size of the route hash table. Must be a power of two. @@ -2981,7 +2978,6 @@ bridge_pfil(struct mbuf **mp, struct ifn { int snap, error, i, hlen; struct ether_header *eh1, eh2; - struct ip_fw_args args; struct ip *ip; struct llc llc1; u_int16_t ether_type; @@ -3055,6 +3051,16 @@ bridge_pfil(struct mbuf **mp, struct ifn goto bad; } + /* Run the packet through pfil before stripping link headers */ + if (PFIL_HOOKED(&V_link_pfil_hook) && pfil_ipfw != 0 && + dir == PFIL_OUT && ifp != NULL) { + + error = pfil_run_hooks(&V_link_pfil_hook, mp, ifp, dir, NULL); + + if (*mp == NULL || error != 0) /* packet consumed by filter */ + return (error); + } + /* Strip off the Ethernet header and keep a copy. */ m_copydata(*mp, 0, ETHER_HDR_LEN, (caddr_t) &eh2); m_adj(*mp, ETHER_HDR_LEN); @@ -3085,63 +3091,6 @@ bridge_pfil(struct mbuf **mp, struct ifn goto bad; } - /* XXX this section is also in if_ethersubr.c */ - // XXX PFIL_OUT or DIR_OUT ? - if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && - dir == PFIL_OUT && ifp != NULL) { - struct m_tag *mtag; - - error = -1; - /* fetch the start point from existing tags, if any */ - mtag = m_tag_locate(*mp, MTAG_IPFW_RULE, 0, NULL); - if (mtag == NULL) { - args.rule.slot = 0; - } else { - struct ipfw_rule_ref *r; - - /* XXX can we free the tag after use ? */ - mtag->m_tag_id = PACKET_TAG_NONE; - r = (struct ipfw_rule_ref *)(mtag + 1); - /* packet already partially processed ? */ - if (r->info & IPFW_ONEPASS) - goto ipfwpass; - args.rule = *r; - } - - args.m = *mp; - args.oif = ifp; - args.next_hop = NULL; - args.next_hop6 = NULL; - args.eh = &eh2; - args.inp = NULL; /* used by ipfw uid/gid/jail rules */ - i = V_ip_fw_chk_ptr(&args); - *mp = args.m; - - if (*mp == NULL) - return (error); - - if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { - - /* put the Ethernet header back on */ - M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); - if (*mp == NULL) - return (error); - bcopy(&eh2, mtod(*mp, caddr_t), ETHER_HDR_LEN); - - /* - * Pass the pkt to dummynet, which consumes it. The - * packet will return to us via bridge_dummynet(). - */ - args.oif = ifp; - ip_dn_io_ptr(mp, DIR_FWD | PROTO_IFB, &args); - return (error); - } - - if (i != IP_FW_PASS) /* drop */ - goto bad; - } - -ipfwpass: error = 0; /* Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/net/if_ethersubr.c Tue Sep 4 19:43:26 2012 (r240099) @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -63,6 +62,7 @@ #include #include #include +#include #include #if defined(INET) || defined(INET6) @@ -71,8 +71,6 @@ #include #include #include -#include -#include #endif #ifdef INET6 #include @@ -106,6 +104,8 @@ CTASSERT(sizeof (struct ether_header) == CTASSERT(sizeof (struct ether_addr) == ETHER_ADDR_LEN); #endif +VNET_DEFINE(struct pfil_head, link_pfil_hook); /* Packet filter hooks */ + /* netgraph node hooks for ng_ether(4) */ void (*ng_ether_input_p)(struct ifnet *ifp, struct mbuf **mp); void (*ng_ether_input_orphan_p)(struct ifnet *ifp, struct mbuf *m); @@ -141,14 +141,6 @@ static MALLOC_DEFINE(M_ARPCOM, "arpcom", #define senderr(e) do { error = (e); goto bad;} while (0) -#if defined(INET) || defined(INET6) -int -ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared); -static VNET_DEFINE(int, ether_ipfw); -#define V_ether_ipfw VNET(ether_ipfw) -#endif - - /* * Ethernet output routine. * Encapsulate a packet of type family for the local net. @@ -427,18 +419,17 @@ bad: if (m != NULL) int ether_output_frame(struct ifnet *ifp, struct mbuf *m) { -#if defined(INET) || defined(INET6) + int i; - if (V_ip_fw_chk_ptr && V_ether_ipfw != 0) { - if (ether_ipfw_chk(&m, ifp, 0) == 0) { - if (m) { - m_freem(m); - return EACCES; /* pkt dropped */ - } else - return 0; /* consumed e.g. in a pipe */ - } + if (PFIL_HOOKED(&V_link_pfil_hook)) { + i = pfil_run_hooks(&V_link_pfil_hook, &m, ifp, PFIL_OUT, NULL); + + if (i != 0) + return (EACCES); + + if (m == NULL) + return (0); } -#endif /* * Queue message on interface, update output statistics if @@ -448,113 +439,6 @@ ether_output_frame(struct ifnet *ifp, st } #if defined(INET) || defined(INET6) -/* - * ipfw processing for ethernet packets (in and out). - * The second parameter is NULL from ether_demux, and ifp from - * ether_output_frame. - */ -int -ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared) -{ - struct ether_header *eh; - struct ether_header save_eh; - struct mbuf *m; - int i; - struct ip_fw_args args; - struct m_tag *mtag; - - /* fetch start point from rule, if any */ - mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); - if (mtag == NULL) { - args.rule.slot = 0; - } else { - /* dummynet packet, already partially processed */ - struct ipfw_rule_ref *r; - - /* XXX can we free it after use ? */ - mtag->m_tag_id = PACKET_TAG_NONE; - r = (struct ipfw_rule_ref *)(mtag + 1); - if (r->info & IPFW_ONEPASS) - return (1); - args.rule = *r; - } - - /* - * I need some amt of data to be contiguous, and in case others need - * the packet (shared==1) also better be in the first mbuf. - */ - m = *m0; - i = min( m->m_pkthdr.len, max_protohdr); - if ( shared || m->m_len < i) { - m = m_pullup(m, i); - if (m == NULL) { - *m0 = m; - return 0; - } - } - eh = mtod(m, struct ether_header *); - save_eh = *eh; /* save copy for restore below */ - m_adj(m, ETHER_HDR_LEN); /* strip ethernet header */ - - args.m = m; /* the packet we are looking at */ - args.oif = dst; /* destination, if any */ - args.next_hop = NULL; /* we do not support forward yet */ - args.next_hop6 = NULL; /* we do not support forward yet */ - args.eh = &save_eh; /* MAC header for bridged/MAC packets */ - args.inp = NULL; /* used by ipfw uid/gid/jail rules */ - i = V_ip_fw_chk_ptr(&args); - m = args.m; - if (m != NULL) { - /* - * Restore Ethernet header, as needed, in case the - * mbuf chain was replaced by ipfw. - */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); - if (m == NULL) { - *m0 = m; - return 0; - } - if (eh != mtod(m, struct ether_header *)) - bcopy(&save_eh, mtod(m, struct ether_header *), - ETHER_HDR_LEN); - } - *m0 = m; - - if (i == IP_FW_DENY) /* drop */ - return 0; - - KASSERT(m != NULL, ("ether_ipfw_chk: m is NULL")); - - if (i == IP_FW_PASS) /* a PASS rule. */ - return 1; - - if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { - int dir; - /* - * Pass the pkt to dummynet, which consumes it. - * If shared, make a copy and keep the original. - */ - if (shared) { - m = m_copypacket(m, M_DONTWAIT); - if (m == NULL) - return 0; - } else { - /* - * Pass the original to dummynet and - * nothing back to the caller - */ - *m0 = NULL ; - } - dir = PROTO_LAYER2 | (dst ? DIR_OUT : DIR_IN); - ip_dn_io_ptr(&m, dir, &args); - return 0; - } - /* - * XXX at some point add support for divert/forward actions. - * If none of the above matches, we have to drop the pkt. - */ - return 0; -} #endif /* @@ -788,6 +672,35 @@ ether_init(__unused void *arg) SYSINIT(ether, SI_SUB_INIT_IF, SI_ORDER_ANY, ether_init, NULL); static void +vnet_ether_init(__unused void *arg) +{ + int i; + + /* Initialize packet filter hooks. */ + V_link_pfil_hook.ph_type = PFIL_TYPE_AF; + V_link_pfil_hook.ph_af = AF_LINK; + if ((i = pfil_head_register(&V_link_pfil_hook)) != 0) + printf("%s: WARNING: unable to register pfil link hook, " + "error %d\n", __func__, i); +} +VNET_SYSINIT(vnet_ether_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, + vnet_ether_init, NULL); + +static void +vnet_ether_destroy(__unused void *arg) +{ + int i; + + if ((i = pfil_head_unregister(&V_link_pfil_hook)) != 0) + printf("%s: WARNING: unable to unregister pfil link hook, " + "error %d\n", __func__, i); +} +VNET_SYSUNINIT(vnet_ether_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, + vnet_ether_destroy, NULL); + + + +static void ether_input(struct ifnet *ifp, struct mbuf *m) { @@ -807,7 +720,7 @@ void ether_demux(struct ifnet *ifp, struct mbuf *m) { struct ether_header *eh; - int isr; + int i, isr; u_short ether_type; #if defined(NETATALK) struct llc *l; @@ -815,19 +728,14 @@ ether_demux(struct ifnet *ifp, struct mb KASSERT(ifp != NULL, ("%s: NULL interface pointer", __func__)); -#if defined(INET) || defined(INET6) - /* - * Allow dummynet and/or ipfw to claim the frame. - * Do not do this for PROMISC frames in case we are re-entered. - */ - if (V_ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { - if (ether_ipfw_chk(&m, NULL, 0) == 0) { - if (m) - m_freem(m); /* dropped; free mbuf chain */ - return; /* consumed */ - } + /* Do not grab PROMISC frames in case we are re-entered. */ + if (PFIL_HOOKED(&V_link_pfil_hook) && !(m->m_flags & M_PROMISC)) { + i = pfil_run_hooks(&V_link_pfil_hook, &m, ifp, PFIL_IN, NULL); + + if (i != 0 || m == NULL) + return; } -#endif + eh = mtod(m, struct ether_header *); ether_type = ntohs(eh->ether_type); @@ -1056,10 +964,6 @@ ether_reassign(struct ifnet *ifp, struct SYSCTL_DECL(_net_link); SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet"); -#if defined(INET) || defined(INET6) -SYSCTL_VNET_INT(_net_link_ether, OID_AUTO, ipfw, CTLFLAG_RW, - &VNET_NAME(ether_ipfw), 0, "Pass ether pkts through firewall"); -#endif #if 0 /* Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/net/if_var.h Tue Sep 4 19:43:26 2012 (r240099) @@ -99,6 +99,9 @@ TAILQ_HEAD(ifaddrhead, ifaddr); /* insta TAILQ_HEAD(ifmultihead, ifmultiaddr); TAILQ_HEAD(ifgrouphead, ifg_group); +VNET_DECLARE(struct pfil_head, link_pfil_hook); /* packet filter hooks */ +#define V_link_pfil_hook VNET(link_pfil_hook) + /* * Structure defining a queue for a network interface. */ Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/netinet/ip_var.h Tue Sep 4 19:43:26 2012 (r240099) @@ -292,9 +292,7 @@ enum { struct ip_fw_args; typedef int (*ip_fw_chk_ptr_t)(struct ip_fw_args *args); typedef int (*ip_fw_ctl_ptr_t)(struct sockopt *); -VNET_DECLARE(ip_fw_chk_ptr_t, ip_fw_chk_ptr); VNET_DECLARE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr); -#define V_ip_fw_chk_ptr VNET(ip_fw_chk_ptr) #define V_ip_fw_ctl_ptr VNET(ip_fw_ctl_ptr) /* Divert hooks. */ Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Sep 4 19:43:26 2012 (r240099) @@ -2645,10 +2645,9 @@ vnet_ipfw_init(const void *unused) V_ipfw_vnet_ready = 1; /* Open for business */ /* - * Hook the sockopt handler, and the layer2 (V_ip_fw_chk_ptr) - * and pfil hooks for ipv4 and ipv6. Even if the latter two fail - * we still keep the module alive because the sockopt and - * layer2 paths are still useful. + * Hook the sockopt handler and pfil hooks for ipv4 and ipv6. + * Even if the latter two fail we still keep the module alive + * because the sockopt and layer2 paths are still useful. * ipfw[6]_hook return 0 on success, ENOENT on failure, * so we can ignore the exact return value and just set a flag. * @@ -2659,7 +2658,6 @@ vnet_ipfw_init(const void *unused) * is checked on each packet because there are no pfil hooks. */ V_ip_fw_ctl_ptr = ipfw_ctl; - V_ip_fw_chk_ptr = ipfw_chk; error = ipfw_attach_hooks(1); return (error); } @@ -2681,7 +2679,6 @@ vnet_ipfw_uninit(const void *unused) * sure the update is propagated and nobody will be in. */ (void)ipfw_attach_hooks(0 /* detach */); - V_ip_fw_chk_ptr = NULL; V_ip_fw_ctl_ptr = NULL; IPFW_UH_WLOCK(chain); IPFW_UH_WUNLOCK(chain); Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Tue Sep 4 19:43:26 2012 (r240099) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -72,10 +73,17 @@ static VNET_DEFINE(int, fw6_enable) = 1; #define V_fw6_enable VNET(fw6_enable) #endif +static VNET_DEFINE(int, fwlink_enable) = 0; +#define V_fwlink_enable VNET(fwlink_enable) + int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); /* Forward declarations. */ static int ipfw_divert(struct mbuf **, int, struct ipfw_rule_ref *, int); +static int ipfw_check_packet(void *, struct mbuf **, struct ifnet *, int, + struct inpcb *); +static int ipfw_check_frame(void *, struct mbuf **, struct ifnet *, int, + struct inpcb *); #ifdef SYSCTL_NODE @@ -92,6 +100,11 @@ SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_ ipfw_chg_hook, "I", "Enable ipfw+6"); #endif /* INET6 */ +SYSCTL_DECL(_net_link_ether); +SYSCTL_VNET_PROC(_net_link_ether, OID_AUTO, ipfw, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fwlink_enable), 0, + ipfw_chg_hook, "I", "Pass ether pkts through firewall"); + SYSEND #endif /* SYSCTL_NODE */ @@ -101,8 +114,8 @@ SYSEND * dummynet, divert, netgraph or other modules. * The packet may be consumed. */ -int -ipfw_check_hook(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, +static int +ipfw_check_packet(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, struct inpcb *inp) { struct ip_fw_args args; @@ -278,6 +291,111 @@ again: return ret; } +/* + * ipfw processing for ethernet packets (in and out). + * Inteface is NULL from ether_demux, and ifp from + * ether_output_frame. + */ +static int +ipfw_check_frame(void *arg, struct mbuf **m0, struct ifnet *dst, int dir, + struct inpcb *inp) +{ + struct ether_header *eh; + struct ether_header save_eh; + struct mbuf *m; + int i, ret; + struct ip_fw_args args; + struct m_tag *mtag; + + /* fetch start point from rule, if any */ + mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); + if (mtag == NULL) { + args.rule.slot = 0; + } else { + /* dummynet packet, already partially processed */ + struct ipfw_rule_ref *r; + + /* XXX can we free it after use ? */ + mtag->m_tag_id = PACKET_TAG_NONE; + r = (struct ipfw_rule_ref *)(mtag + 1); + if (r->info & IPFW_ONEPASS) + return (0); + args.rule = *r; + } + + /* I need some amt of data to be contiguous */ + m = *m0; + i = min(m->m_pkthdr.len, max_protohdr); + if (m->m_len < i) { + m = m_pullup(m, i); + if (m == NULL) { + *m0 = m; + return (0); + } + } + eh = mtod(m, struct ether_header *); + save_eh = *eh; /* save copy for restore below */ + m_adj(m, ETHER_HDR_LEN); /* strip ethernet header */ + + args.m = m; /* the packet we are looking at */ + args.oif = dst; /* destination, if any */ + args.next_hop = NULL; /* we do not support forward yet */ + args.next_hop6 = NULL; /* we do not support forward yet */ + args.eh = &save_eh; /* MAC header for bridged/MAC packets */ + args.inp = NULL; /* used by ipfw uid/gid/jail rules */ + i = ipfw_chk(&args); + m = args.m; + if (m != NULL) { + /* + * Restore Ethernet header, as needed, in case the + * mbuf chain was replaced by ipfw. + */ + M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + if (m == NULL) { + *m0 = NULL; + return (0); + } + if (eh != mtod(m, struct ether_header *)) + bcopy(&save_eh, mtod(m, struct ether_header *), + ETHER_HDR_LEN); + } + *m0 = m; + + ret = 0; + /* Check result of ipfw_chk() */ + switch (i) { + case IP_FW_PASS: + break; + + case IP_FW_DENY: + ret = EACCES; + break; /* i.e. drop */ + + case IP_FW_DUMMYNET: + ret = EACCES; + int dir; + + if (ip_dn_io_ptr == NULL) + break; /* i.e. drop */ + + *m0 = NULL; + dir = PROTO_LAYER2 | (dst ? DIR_OUT : DIR_IN); + ip_dn_io_ptr(&m, dir, &args); + return 0; + + default: + KASSERT(0, ("%s: unknown retval", __func__)); + } + + if (ret != 0) { + if (*m0) + FREE_PKT(*m0); + *m0 = NULL; + } + + return ret; +} + /* do the divert, return 1 on error 0 on success */ static int ipfw_divert(struct mbuf **m0, int incoming, struct ipfw_rule_ref *rule, @@ -379,13 +497,16 @@ static int ipfw_hook(int onoff, int pf) { struct pfil_head *pfh; + void *hook_func; pfh = pfil_head_get(PFIL_TYPE_AF, pf); if (pfh == NULL) return ENOENT; + hook_func = (pf == AF_LINK) ? ipfw_check_frame : ipfw_check_packet; + (void) (onoff ? pfil_add_hook : pfil_remove_hook) - (ipfw_check_hook, NULL, PFIL_IN | PFIL_OUT | PFIL_WAITOK, pfh); + (hook_func, NULL, PFIL_IN | PFIL_OUT | PFIL_WAITOK, pfh); return 0; } @@ -409,51 +530,58 @@ ipfw_attach_hooks(int arg) printf("ipfw6_hook() error\n"); } #endif + if (arg == 0) /* detach */ + ipfw_hook(0, AF_LINK); + else if (V_fwlink_enable && ipfw_hook(1, AF_LINK) != 0) { + error = ENOENT; + printf("ipfw_link_hook() error\n"); + } return error; } int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { - int enable; - int oldenable; + int *enable; + int newval; int error; int af; if (arg1 == &VNET_NAME(fw_enable)) { - enable = V_fw_enable; + enable = &V_fw_enable; af = AF_INET; } #ifdef INET6 else if (arg1 == &VNET_NAME(fw6_enable)) { - enable = V_fw6_enable; + enable = &V_fw6_enable; af = AF_INET6; } #endif + else if (arg1 == &VNET_NAME(fwlink_enable)) { + enable = &V_fwlink_enable; + af = AF_LINK; + } else return (EINVAL); - oldenable = enable; + newval = *enable; - error = sysctl_handle_int(oidp, &enable, 0, req); + /* Handle sysctl change */ + error = sysctl_handle_int(oidp, &newval, 0, req); if (error) return (error); - enable = (enable) ? 1 : 0; + /* Formalize new value */ + newval = (newval) ? 1 : 0; - if (enable == oldenable) + if (*enable == newval) return (0); - error = ipfw_hook(enable, af); + error = ipfw_hook(newval, af); if (error) return (error); - if (af == AF_INET) - V_fw_enable = enable; -#ifdef INET6 - else if (af == AF_INET6) - V_fw6_enable = enable; -#endif + *enable = newval; return (0); } Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Tue Sep 4 19:19:36 2012 (r240098) +++ head/sys/netinet/ipfw/ip_fw_private.h Tue Sep 4 19:43:26 2012 (r240099) @@ -270,10 +270,6 @@ int ipfw_ctl(struct sockopt *sopt); int ipfw_chk(struct ip_fw_args *args); void ipfw_reap_rules(struct ip_fw *head); -/* In ip_fw_pfil */ -int ipfw_check_hook(void *arg, struct mbuf **m0, struct ifnet *ifp, int dir, - struct inpcb *inp); - /* In ip_fw_table.c */ struct radix_node; int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr, From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 20:14:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2EC5106566B; Tue, 4 Sep 2012 20:14:37 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE97F8FC14; Tue, 4 Sep 2012 20:14: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 q84KEbJS012651; Tue, 4 Sep 2012 20:14:37 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84KEbxv012649; Tue, 4 Sep 2012 20:14:37 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201209042014.q84KEbxv012649@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 4 Sep 2012 20:14: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: r240101 - head/tools/test/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 20:14:37 -0000 Author: gnn Date: Tue Sep 4 20:14:37 2012 New Revision: 240101 URL: http://svn.freebsd.org/changeset/base/240101 Log: Add a reasonable error message telling the caller to specify a program to be executed under hwpmc. If there is no program to run then exit. Modified: head/tools/test/hwpmc/pmctest.py Modified: head/tools/test/hwpmc/pmctest.py ============================================================================== --- head/tools/test/hwpmc/pmctest.py Tue Sep 4 19:49:37 2012 (r240100) +++ head/tools/test/hwpmc/pmctest.py Tue Sep 4 20:14:37 2012 (r240101) @@ -67,6 +67,10 @@ def main(): (options, args) = parser.parse_args() + if (options.program == None): + print "specify program, such as ls, with -p/--program" + sys.exit() + p = subprocess.Popen(["pmccontrol", "-L"], stdout=PIPE) counters = p.communicate()[0] From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 20:51:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A90C11065678; Tue, 4 Sep 2012 20:51:25 +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 953378FC18; Tue, 4 Sep 2012 20:51: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 q84KpPSN017084; Tue, 4 Sep 2012 20:51:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84KpPip017082; Tue, 4 Sep 2012 20:51:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201209042051.q84KpPip017082@svn.freebsd.org> From: Ed Maste Date: Tue, 4 Sep 2012 20:51: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: r240103 - head/tools/tools/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 20:51:25 -0000 Author: emaste Date: Tue Sep 4 20:51:25 2012 New Revision: 240103 URL: http://svn.freebsd.org/changeset/base/240103 Log: Failure to open netmap device is unrecoverable. There's no reason to "fail later" since there's nothing this tool can do in netmap mode without /dev/netmap open. Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Tue Sep 4 20:45:59 2012 (r240102) +++ head/tools/tools/netmap/pkt-gen.c Tue Sep 4 20:51:25 2012 (r240103) @@ -892,7 +892,7 @@ main(int arc, char **argv) fd = open("/dev/netmap", O_RDWR); if (fd == -1) { D("Unable to open /dev/netmap"); - // fail later + exit(1); } else { if ((ioctl(fd, NIOCGINFO, &nmr)) == -1) { D("Unable to get if info without name"); From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:02:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8A611065674; Tue, 4 Sep 2012 21:02:57 +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 A3DE28FC16; Tue, 4 Sep 2012 21:02: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 q84L2vJg018525; Tue, 4 Sep 2012 21:02:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84L2v08018522; Tue, 4 Sep 2012 21:02:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209042102.q84L2v08018522@svn.freebsd.org> From: Xin LI Date: Tue, 4 Sep 2012 21:02: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: r240104 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:02:57 -0000 Author: delphij Date: Tue Sep 4 21:02:57 2012 New Revision: 240104 URL: http://svn.freebsd.org/changeset/base/240104 Log: Add hpt27xx to GENERIC kernel for amd64 and i386 systems. MFC after: 2 weeks Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Sep 4 20:51:25 2012 (r240103) +++ head/sys/amd64/conf/GENERIC Tue Sep 4 21:02:57 2012 (r240104) @@ -148,6 +148,7 @@ device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Sep 4 20:51:25 2012 (r240103) +++ head/sys/i386/conf/GENERIC Tue Sep 4 21:02:57 2012 (r240104) @@ -154,6 +154,7 @@ device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:06:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A6A3106564A; Tue, 4 Sep 2012 21:06:54 +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 E74968FC15; Tue, 4 Sep 2012 21:06: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 q84L6rQx019055; Tue, 4 Sep 2012 21:06:53 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84L6rOS019053; Tue, 4 Sep 2012 21:06:53 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209042106.q84L6rOS019053@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 4 Sep 2012 21:06: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: r240105 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:06:54 -0000 Author: des Date: Tue Sep 4 21:06:53 2012 New Revision: 240105 URL: http://svn.freebsd.org/changeset/base/240105 Log: Revert previous commit, which was performed in the wrong tree. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Sep 4 21:02:57 2012 (r240104) +++ head/sys/vm/swap_pager.c Tue Sep 4 21:06:53 2012 (r240105) @@ -50,7 +50,7 @@ * * - on the fly reallocation of swap during putpages. The new system * does not try to keep previously allocated swap blocks for dirty - * pages. + * pages. * * - on the fly deallocation of swap * @@ -154,21 +154,15 @@ int swap_pager_avail; static int swdev_syscall_active = 0; /* serialize swap(on|off) */ static vm_ooffset_t swap_total; -SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, +SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, "Total amount of available swap storage."); static vm_ooffset_t swap_reserved; -SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, +SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, "Amount of swap storage needed to back all allocated anonymous memory."); static int overcommit = 0; -SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, +SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, "Configure virtual memory overcommit behavior. See tuning(7) " "for details."); -static unsigned long swzone; -SYSCTL_ULONG(_vm, OID_AUTO, swzone, CTLFLAG_RD, &swzone, 0, - "Actual size of swap metadata zone"); -static unsigned long swap_maxpages; -SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0, - "Maximum amount of swap supported"); /* bits from overcommit */ #define SWAP_RESERVE_FORCE_ON (1 << 0) @@ -190,7 +184,7 @@ swap_reserve_by_cred(vm_ooffset_t incr, static int curfail; static struct timeval lastfail; struct uidinfo *uip; - + uip = cred->cr_ruidinfo; if (incr & PAGE_MASK) @@ -291,7 +285,7 @@ void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) { struct uidinfo *uip; - + uip = cred->cr_ruidinfo; if (decr & PAGE_MASK) @@ -334,7 +328,7 @@ static struct sx sw_alloc_sx; SYSCTL_INT(_vm, OID_AUTO, swap_async_max, - CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); + CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); /* * "named" and "unnamed" anon region objects. Try to reduce the overhead @@ -346,7 +340,7 @@ SYSCTL_INT(_vm, OID_AUTO, swap_async_max #define NOBJLIST(handle) \ (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) -static struct mtx sw_alloc_mtx; /* protect list manipulation */ +static struct mtx sw_alloc_mtx; /* protect list manipulation */ static struct pagerlst swap_pager_object_list[NOBJLISTS]; static uma_zone_t swap_zone; static struct vm_object swap_zone_obj; @@ -425,7 +419,7 @@ swp_pager_free_nrpage(vm_page_t m) /* * SWP_SIZECHECK() - update swap_pager_full indication - * + * * update the swap_pager_almost_full indication and warn when we are * about to run out of swap space, using lowat/hiwat hysteresis. * @@ -480,7 +474,7 @@ swp_pager_hash(vm_object_t object, vm_pi /* * SWAP_PAGER_INIT() - initialize the swap pager! * - * Expected to be started from system init. NOTE: This code is run + * Expected to be started from system init. NOTE: This code is run * before much else so be careful what you depend on. Most of the VM * system has yet to be initialized at this point. */ @@ -512,7 +506,7 @@ swap_pager_init(void) void swap_pager_swap_init(void) { - unsigned long n, n2; + int n, n2; /* * Number of in-transit swap bp operations. Don't @@ -525,7 +519,7 @@ swap_pager_swap_init(void) * MAX_PAGEOUT_CLUSTER. Also be aware that swap ops are * constrained by the swap device interleave stripe size. * - * Currently we hardwire nsw_wcount_async to 4. This limit is + * Currently we hardwire nsw_wcount_async to 4. This limit is * designed to prevent other I/O from having high latencies due to * our pageout I/O. The value 4 works well for one or two active swap * devices but is probably a little low if you have more. Even so, @@ -554,11 +548,11 @@ swap_pager_swap_init(void) n = cnt.v_page_count / 2; if (maxswzone && n > maxswzone / sizeof(struct swblock)) n = maxswzone / sizeof(struct swblock); + n2 = n; swap_zone = uma_zcreate("SWAPMETA", sizeof(struct swblock), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE | UMA_ZONE_VM); if (swap_zone == NULL) panic("failed to create swap_zone."); - n2 = n; do { if (uma_zone_set_obj(swap_zone, &swap_zone_obj, n)) break; @@ -569,13 +563,12 @@ swap_pager_swap_init(void) n -= ((n + 2) / 3); } while (n > 0); if (n2 != n) - printf("Swap zone entries reduced from %lu to %lu.\n", n2, n); - swap_maxpages = n * SWAP_META_PAGES; - swzone = n * sizeof(struct swblock); + printf("Swap zone entries reduced from %d to %d.\n", n2, n); + n2 = n; /* * Initialize our meta-data hash table. The swapper does not need to - * be quite as efficient as the VM system, so we do not use an + * be quite as efficient as the VM system, so we do not use an * oversized hash table. * * n: size of hash table, must be power of 2 @@ -661,7 +654,7 @@ swap_pager_alloc(void *handle, vm_ooffse /* * SWAP_PAGER_DEALLOC() - remove swap metadata from object * - * The swap backing for the object is destroyed. The code is + * The swap backing for the object is destroyed. The code is * designed such that we can reinstantiate it later, but this * routine is typically called only when the entire object is * about to be destroyed. @@ -686,7 +679,7 @@ swap_pager_dealloc(vm_object_t object) vm_object_pip_wait(object, "swpdea"); /* - * Free all remaining metadata. We only bother to free it from + * Free all remaining metadata. We only bother to free it from * the swap meta data. We do not attempt to free swapblk's still * associated with vm_page_t's for this object. We do not care * if paging is still in progress on some objects. @@ -755,7 +748,7 @@ swp_pager_isondev(daddr_t blk, struct sw return (blk >= sp->sw_first && blk < sp->sw_end); } - + static void swp_pager_strategy(struct buf *bp) { @@ -771,10 +764,10 @@ swp_pager_strategy(struct buf *bp) } panic("Swapdev not found"); } - + /* - * SWP_PAGER_FREESWAPSPACE() - free raw swap space + * SWP_PAGER_FREESWAPSPACE() - free raw swap space * * This routine returns the specified swap blocks back to the bitmap. * @@ -792,7 +785,7 @@ swp_pager_freeswapspace(daddr_t blk, int /* * If we are attempting to stop swapping on * this device, we don't want to mark any - * blocks free lest they be reused. + * blocks free lest they be reused. */ if ((sp->sw_flags & SW_CLOSING) == 0) { blist_free(sp->sw_blist, blk - sp->sw_first, @@ -815,8 +808,8 @@ swp_pager_freeswapspace(daddr_t blk, int * * This routine removes swapblk assignments from swap metadata. * - * The external callers of this routine typically have already destroyed - * or renamed vm_page_t's associated with this range in the object so + * The external callers of this routine typically have already destroyed + * or renamed vm_page_t's associated with this range in the object so * we should be ok. */ void @@ -830,7 +823,7 @@ swap_pager_freespace(vm_object_t object, /* * SWAP_PAGER_RESERVE() - reserve swap blocks in object * - * Assigns swap blocks to the specified range within the object. The + * Assigns swap blocks to the specified range within the object. The * swap blocks are not zerod. Any previous swap assignment is destroyed. * * Returns 0 on success, -1 on failure. @@ -876,7 +869,7 @@ swap_pager_reserve(vm_object_t object, v * * This routine is allowed to sleep. It may sleep allocating metadata * indirectly through swp_pager_meta_build() or if paging is still in - * progress on the source. + * progress on the source. * * The source object contains no vm_page_t's (which is just as well) * @@ -895,8 +888,8 @@ swap_pager_copy(vm_object_t srcobject, v VM_OBJECT_LOCK_ASSERT(dstobject, MA_OWNED); /* - * If destroysource is set, we remove the source object from the - * swap_pager internal queue now. + * If destroysource is set, we remove the source object from the + * swap_pager internal queue now. */ if (destroysource) { if (srcobject->handle != NULL) { @@ -932,7 +925,7 @@ swap_pager_copy(vm_object_t srcobject, v daddr_t srcaddr; srcaddr = swp_pager_meta_ctl( - srcobject, + srcobject, i + offset, SWM_POP ); @@ -954,7 +947,7 @@ swap_pager_copy(vm_object_t srcobject, v * Destination has valid swapblk or it is represented * by a resident page. We destroy the sourceblock. */ - + swp_pager_meta_ctl(srcobject, i + offset, SWM_FREE); } } @@ -1049,7 +1042,7 @@ swap_pager_haspage(vm_object_t object, v * SWAP_PAGER_PAGE_UNSWAPPED() - remove swap backing store related to page * * This removes any associated swap backing store, whether valid or - * not, from the page. + * not, from the page. * * This routine is typically called when a page is made dirty, at * which point any associated swap can be freed. MADV_FREE also @@ -1078,7 +1071,7 @@ swap_pager_unswapped(vm_page_t m) * a chunk surrounding m[reqpage] as is contiguous in swap and which * belongs to the same object. * - * The code is designed for asynchronous operation and + * The code is designed for asynchronous operation and * immediate-notification of 'reqpage' but tends not to be * used that way. Please do not optimize-out this algorithmic * feature, I intend to improve on it in the future. @@ -1108,7 +1101,7 @@ swap_pager_getpages(vm_object_t object, * Calculate range to retrieve. The pages have already been assigned * their swapblks. We require a *contiguous* range but we know it to * not span devices. If we do not supply it, bad things - * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the + * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the * loops are set up such that the case(s) are handled implicitly. * * The swp_*() calls must be made with the object locked. @@ -1146,7 +1139,7 @@ swap_pager_getpages(vm_object_t object, } /* - * Return VM_PAGER_FAIL if we have nothing to do. Return mreq + * Return VM_PAGER_FAIL if we have nothing to do. Return mreq * still busy, but the others unbusied. */ if (blk == SWAPBLK_NONE) @@ -1241,21 +1234,21 @@ swap_pager_getpages(vm_object_t object, /* * A final note: in a low swap situation, we cannot deallocate swap * and mark a page dirty here because the caller is likely to mark - * the page clean when we return, causing the page to possibly revert + * the page clean when we return, causing the page to possibly revert * to all-zero's later. */ } /* - * swap_pager_putpages: + * swap_pager_putpages: * * Assign swap (if necessary) and initiate I/O on the specified pages. * * We support both OBJT_DEFAULT and OBJT_SWAP objects. DEFAULT objects * are automatically converted to SWAP objects. * - * In a low memory situation we may block in VOP_STRATEGY(), but the new - * vm_page reservation system coupled with properly written VFS devices + * In a low memory situation we may block in VOP_STRATEGY(), but the new + * vm_page reservation system coupled with properly written VFS devices * should ensure that no low-memory deadlock occurs. This is an area * which needs work. * @@ -1276,8 +1269,8 @@ swap_pager_putpages(vm_object_t object, int n = 0; if (count && m[0]->object != object) { - panic("swap_pager_putpages: object mismatch %p/%p", - object, + panic("swap_pager_putpages: object mismatch %p/%p", + object, m[0]->object ); } @@ -1299,7 +1292,7 @@ swap_pager_putpages(vm_object_t object, /* * Step 2 * - * Update nsw parameters from swap_async_max sysctl values. + * Update nsw parameters from swap_async_max sysctl values. * Do not let the sysop crash the machine with bogus numbers. */ mtx_lock(&pbuf_mtx); @@ -1391,7 +1384,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t mreq = m[i+j]; swp_pager_meta_build( - mreq->object, + mreq->object, mreq->pindex, blk + j ); @@ -1460,10 +1453,10 @@ swap_pager_putpages(vm_object_t object, * Completion routine for asynchronous reads and writes from/to swap. * Also called manually by synchronous code to finish up a bp. * - * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, - * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY - * unbusy all pages except the 'main' request page. For WRITE - * operations, we vm_page_t->busy'd unbusy all pages ( we can do this + * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, + * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY + * unbusy all pages except the 'main' request page. For WRITE + * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). * * This routine may not sleep. @@ -1482,7 +1475,7 @@ swp_pager_async_iodone(struct buf *bp) "swap_pager: I/O error - %s failed; blkno %ld," "size %ld, error %d\n", ((bp->b_iocmd == BIO_READ) ? "pagein" : "pageout"), - (long)bp->b_blkno, + (long)bp->b_blkno, (long)bp->b_bcount, bp->b_error ); @@ -1502,7 +1495,7 @@ swp_pager_async_iodone(struct buf *bp) * cleanup pages. If an error occurs writing to swap, we are in * very serious trouble. If it happens to be a disk error, though, * we may be able to recover by reassigning the swap later on. So - * in this case we remove the m->swapblk assignment for the page + * in this case we remove the m->swapblk assignment for the page * but do not free it in the rlist. The errornous block(s) are thus * never reallocated as swap. Redirty the page and continue. */ @@ -1515,7 +1508,7 @@ swp_pager_async_iodone(struct buf *bp) /* * If an error occurs I'd love to throw the swapblk * away without freeing it back to swapspace, so it - * can never be used again. But I can't from an + * can never be used again. But I can't from an * interrupt. */ if (bp->b_iocmd == BIO_READ) { @@ -1524,7 +1517,7 @@ swp_pager_async_iodone(struct buf *bp) * locked for the parent, but all other * pages can be freed. We still want to * wakeup the parent waiting on the page, - * though. ( also: pg_reqpage can be -1 and + * though. ( also: pg_reqpage can be -1 and * not match anything ). * * We have to wake specifically requested pages @@ -1541,7 +1534,7 @@ swp_pager_async_iodone(struct buf *bp) else vm_page_flash(m); /* - * If i == bp->b_pager.pg_reqpage, do not wake + * If i == bp->b_pager.pg_reqpage, do not wake * the page up. The caller needs to. */ } else { @@ -1558,7 +1551,7 @@ swp_pager_async_iodone(struct buf *bp) } } else if (bp->b_iocmd == BIO_READ) { /* - * NOTE: for reads, m->dirty will probably be + * NOTE: for reads, m->dirty will probably be * overridden by the original caller of getpages so * we cannot set them in order to free the underlying * swap in a low-swap situation. I don't think we'd @@ -1570,7 +1563,7 @@ swp_pager_async_iodone(struct buf *bp) * * Note that the requested page, reqpage, is left * busied, but we still have to wake it up. The - * other pages are released (unbusied) by + * other pages are released (unbusied) by * vm_page_wakeup(). */ KASSERT(!pmap_page_is_mapped(m), @@ -1584,7 +1577,7 @@ swp_pager_async_iodone(struct buf *bp) * up too because we cleared VPO_SWAPINPROG and * could be waiting for it in getpages. However, * be sure to not unbusy getpages specifically - * requested page - getpages expects it to be + * requested page - getpages expects it to be * left busy. */ if (i != bp->b_pager.pg_reqpage) { @@ -1597,7 +1590,7 @@ swp_pager_async_iodone(struct buf *bp) } else { /* * For write success, clear the dirty - * status, then finish the I/O ( which decrements the + * status, then finish the I/O ( which decrements the * busy count and possibly wakes waiter's up ). */ KASSERT(!pmap_page_is_write_mapped(m), @@ -1622,8 +1615,8 @@ swp_pager_async_iodone(struct buf *bp) VM_OBJECT_UNLOCK(object); } - /* - * swapdev_strategy() manually sets b_vp and b_bufobj before calling + /* + * swapdev_strategy() manually sets b_vp and b_bufobj before calling * bstrategy(). Set them back to NULL now we're done with it, or we'll * trigger a KASSERT in relpbuf(). */ @@ -1635,10 +1628,10 @@ swp_pager_async_iodone(struct buf *bp) * release the physical I/O buffer */ relpbuf( - bp, - ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : - ((bp->b_flags & B_ASYNC) ? - &nsw_wcount_async : + bp, + ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : + ((bp->b_flags & B_ASYNC) ? + &nsw_wcount_async : &nsw_wcount_sync ) ) @@ -1751,8 +1744,8 @@ restart: for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { vm_object_t object = swap->swb_object; vm_pindex_t pindex = swap->swb_index; - for (j = 0; j < SWAP_META_PAGES; ++j) { - if (swp_pager_isondev(swap->swb_pages[j], sp)) { + for (j = 0; j < SWAP_META_PAGES; ++j) { + if (swp_pager_isondev(swap->swb_pages[j], sp)) { /* avoid deadlock */ if (!VM_OBJECT_TRYLOCK(object)) { break; @@ -1765,7 +1758,7 @@ restart: goto restart; } } - } + } } } mtx_unlock(&swhash_mtx); @@ -1790,7 +1783,7 @@ restart: * SWAP META DATA * ************************************************************************ * - * These routines manipulate the swap metadata stored in the + * These routines manipulate the swap metadata stored in the * OBJT_SWAP object. * * Swap metadata is implemented with a global hash and not directly @@ -1828,13 +1821,13 @@ swp_pager_meta_build(vm_object_t object, mtx_lock(&sw_alloc_mtx); TAILQ_INSERT_TAIL( NOBJLIST(object->handle), - object, + object, pager_object_list ); mtx_unlock(&sw_alloc_mtx); } } - + /* * Locate hash entry. If not found create, but if we aren't adding * anything just return. If we run out of space in the map we wait @@ -1855,7 +1848,7 @@ retry: mtx_unlock(&swhash_mtx); VM_OBJECT_UNLOCK(object); if (uma_zone_exhausted(swap_zone)) { - if (atomic_cmpset_int(&exhausted, 0, 1)) + if (atomic_cmpset_rel_int(&exhausted, 0, 1)) printf("swap zone exhausted, " "increase kern.maxswzone\n"); vm_pageout_oom(VM_OOM_SWAPZ); @@ -1866,7 +1859,7 @@ retry: goto retry; } - if (atomic_cmpset_int(&exhausted, 1, 0)) + if (atomic_cmpset_rel_int(&exhausted, 1, 0)) printf("swap zone ok\n"); swap->swb_hnext = NULL; @@ -1903,10 +1896,10 @@ done: /* * SWP_PAGER_META_FREE() - free a range of blocks in the object's swap metadata * - * The requested range of blocks is freed, with any associated swap + * The requested range of blocks is freed, with any associated swap * returned to the swap bitmap. * - * This routine will free swap metadata structures as they are cleaned + * This routine will free swap metadata structures as they are cleaned * out. This routine does *NOT* operate on swap metadata associated * with resident pages. */ @@ -1998,14 +1991,14 @@ swp_pager_meta_free_all(vm_object_t obje * swapblk assignments in the swap meta data or in the vm_page_t. * The routine typically returns the swapblk being looked-up, or popped, * or SWAPBLK_NONE if the block was freed, or SWAPBLK_NONE if the block - * was invalid. This routine will automatically free any invalid + * was invalid. This routine will automatically free any invalid * meta-data swapblks. * * It is not possible to store invalid swapblks in the swap meta data * (other then a literal 'SWAPBLK_NONE'), so we don't bother checking. * - * When acting on a busy resident page and paging is in progress, we - * have to wait until paging is complete but otherwise can act on the + * When acting on a busy resident page and paging is in progress, we + * have to wait until paging is complete but otherwise can act on the * busy page. * * SWM_FREE remove and free swap block from metadata @@ -2021,7 +2014,7 @@ swp_pager_meta_ctl(vm_object_t object, v VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); /* - * The meta data only exists of the object is OBJT_SWAP + * The meta data only exists of the object is OBJT_SWAP * and even then might not be allocated yet. */ if (object->type != OBJT_SWAP) @@ -2047,7 +2040,7 @@ swp_pager_meta_ctl(vm_object_t object, v uma_zfree(swap_zone, swap); --object->un_pager.swp.swp_bcount; } - } + } } } mtx_unlock(&swhash_mtx); @@ -2065,7 +2058,7 @@ struct swapon_args { }; #endif -/* +/* * MPSAFE */ /* ARGSUSED */ @@ -2160,7 +2153,7 @@ swaponsomething(struct vnode *vp, void * /* * nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks. * First chop nblks off to page-align it, then convert. - * + * * sw->sw_nblks is in page-sized chunks now too. */ nblks &= ~(ctodb(1) - 1); @@ -2349,12 +2342,12 @@ swapoff_all(void) struct swdevt *sp, *spt; const char *devname; int error; - + mtx_lock(&Giant); while (swdev_syscall_active) tsleep(&swdev_syscall_active, PUSER - 1, "swpoff", 0); swdev_syscall_active = 1; - + mtx_lock(&sw_dev_mtx); TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); @@ -2372,7 +2365,7 @@ swapoff_all(void) mtx_lock(&sw_dev_mtx); } mtx_unlock(&sw_dev_mtx); - + swdev_syscall_active = 0; wakeup_one(&swdev_syscall_active); mtx_unlock(&Giant); @@ -2716,7 +2709,7 @@ swaponvp(struct thread *td, struct vnode } } mtx_unlock(&sw_dev_mtx); - + (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_system_check_swapon(td->td_ucred, vp); From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:07:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B34310657A5; Tue, 4 Sep 2012 21:07:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9798FC0A; Tue, 4 Sep 2012 21:07:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BC3D0B945; Tue, 4 Sep 2012 17:07:05 -0400 (EDT) From: John Baldwin To: Robert Watson Date: Tue, 4 Sep 2012 15:17:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208251202.q7PC2EL6034670@svn.freebsd.org> In-Reply-To: <201208251202.q7PC2EL6034670@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209041517.52973.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Sep 2012 17:07:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling SmXrgrav Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:07:06 -0000 On Saturday, August 25, 2012 8:02:14 am Robert Watson wrote: > Author: rwatson > Date: Sat Aug 25 12:02:13 2012 > New Revision: 239679 > URL: http://svn.freebsd.org/changeset/base/239679 > > Log: > Add reference kernel configurations for FreeBSD/beri in simulation, on the > Terasic DE-4, and Terasic tPad Altera-based boards. > > Sponsored by: DARPA, AFRL I'm not sure why the tinderbox isn't reporting this, but this breaks 'make tinderbox' for me due to the hardcoded MFS paths in the _MDROOT configs: -------------------------------------------------------------- >>> make universe started on Fri Aug 31 17:26:08 EDT 2012 -------------------------------------------------------------- >> amd64 started on Fri Aug 31 17:26:08 EDT 2012 >> amd64 completed on Fri Aug 31 18:49:29 EDT 2012 >> arm started on Fri Aug 31 18:49:29 EDT 2012 >> arm completed on Fri Aug 31 19:27:59 EDT 2012 >> i386 started on Fri Aug 31 19:27:59 EDT 2012 >> i386 completed on Fri Aug 31 20:55:27 EDT 2012 >> ia64 started on Fri Aug 31 20:55:27 EDT 2012 >> ia64 completed on Fri Aug 31 21:13:10 EDT 2012 >> mips started on Fri Aug 31 21:13:10 EDT 2012 mips BERI_DE4_MDROOT kernel failed, check _.mips.BERI_DE4_MDROOT for details mips BERI_SIM_MDROOT kernel failed, check _.mips.BERI_SIM_MDROOT for details >> mips completed on Fri Aug 31 21:55:59 EDT 2012 >> pc98 started on Fri Aug 31 21:55:59 EDT 2012 >> pc98 completed on Fri Aug 31 22:22:36 EDT 2012 >> powerpc started on Fri Aug 31 22:22:36 EDT 2012 >> powerpc completed on Fri Aug 31 22:44:48 EDT 2012 >> sparc64 started on Fri Aug 31 22:44:48 EDT 2012 >> sparc64 completed on Fri Aug 31 23:00:01 EDT 2012 -------------------------------------------------------------- >>> make universe completed on Fri Aug 31 23:00:01 EDT 2012 (started Fri Aug 31 17:26:08 EDT 2012) -------------------------------------------------------------- Tinderbox failed: mips BERI_DE4_MDROOT kernel failed, check _.mips.BERI_DE4_MDROOT for details mips BERI_SIM_MDROOT kernel failed, check _.mips.BERI_SIM_MDROOT for details > tail _.mips.BERI_DE4_MDROOT ... make: don't know how to make /local/scratch/rnw24/mdroot.img. Stop Hmm, the tinderbox skips the BERI configs: TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_DE4_MDROOT TB --- 2012-09-04 10:38:06 - skipping BERI_DE4_MDROOT kernel TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_DE4_SDROOT TB --- 2012-09-04 10:38:06 - skipping BERI_DE4_SDROOT kernel TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_SIM_MDROOT TB --- 2012-09-04 10:38:06 - skipping BERI_SIM_MDROOT kernel TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_TEMPLATE TB --- 2012-09-04 10:38:06 - skipping BERI_TEMPLATE kernel -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:07:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2054C1065944; Tue, 4 Sep 2012 21:07:21 +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 D4C9B8FC14; Tue, 4 Sep 2012 21:07:20 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 068AF6C92; Tue, 4 Sep 2012 23:07:20 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id C4F798273; Tue, 4 Sep 2012 23:07:19 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <201209041904.q84J42ng004100@svn.freebsd.org> <201209041511.56128.jhb@freebsd.org> Date: Tue, 04 Sep 2012 23:07:19 +0200 In-Reply-To: <201209041511.56128.jhb@freebsd.org> (John Baldwin's message of "Tue, 4 Sep 2012 15:11:56 -0400") Message-ID: <86obllebug.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: r240096 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:07:21 -0000 John Baldwin writes: > Humm, this seemed to have a lot of unrelated changes? *frak* Thanks for noticing. I committed from the wrong tree. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:23:06 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458701065686; Tue, 4 Sep 2012 21:23:06 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0468FC14; Tue, 4 Sep 2012 21:23:05 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id q84LMxxB097228; Tue, 4 Sep 2012 16:22:59 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id q84LMxlF097227; Tue, 4 Sep 2012 16:22:59 -0500 (CDT) (envelope-from brooks) Date: Tue, 4 Sep 2012 16:22:59 -0500 From: Brooks Davis To: John Baldwin Message-ID: <20120904212259.GA95355@lor.one-eyed-alien.net> References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <201209041517.52973.jhb@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, Robert Watson , Dag-Erling SmXrgrav Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:23:06 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 04, 2012 at 03:17:52PM -0400, John Baldwin wrote: > On Saturday, August 25, 2012 8:02:14 am Robert Watson wrote: > > Author: rwatson > > Date: Sat Aug 25 12:02:13 2012 > > New Revision: 239679 > > URL: http://svn.freebsd.org/changeset/base/239679 > >=20 > > Log: > > Add reference kernel configurations for FreeBSD/beri in simulation, o= n the > > Terasic DE-4, and Terasic tPad Altera-based boards. > > =20 > > Sponsored by: DARPA, AFRL >=20 > I'm not sure why the tinderbox isn't reporting this, but this breaks 'mak= e=20 > tinderbox' for me due to the hardcoded MFS paths in the _MDROOT configs: Oops, we should remove those from the versions in the base system. The change that causes the nonexistence of the images to be fatal is fairly recent so I suppose it's possible that tinderbox hasn't picked it up. -- Brooks >=20 > -------------------------------------------------------------- > >>> make universe started on Fri Aug 31 17:26:08 EDT 2012 > -------------------------------------------------------------- > >> amd64 started on Fri Aug 31 17:26:08 EDT 2012 > >> amd64 completed on Fri Aug 31 18:49:29 EDT 2012 > >> arm started on Fri Aug 31 18:49:29 EDT 2012 > >> arm completed on Fri Aug 31 19:27:59 EDT 2012 > >> i386 started on Fri Aug 31 19:27:59 EDT 2012 > >> i386 completed on Fri Aug 31 20:55:27 EDT 2012 > >> ia64 started on Fri Aug 31 20:55:27 EDT 2012 > >> ia64 completed on Fri Aug 31 21:13:10 EDT 2012 > >> mips started on Fri Aug 31 21:13:10 EDT 2012 > mips BERI_DE4_MDROOT kernel failed, check _.mips.BERI_DE4_MDROOT for deta= ils > mips BERI_SIM_MDROOT kernel failed, check _.mips.BERI_SIM_MDROOT for deta= ils > >> mips completed on Fri Aug 31 21:55:59 EDT 2012 > >> pc98 started on Fri Aug 31 21:55:59 EDT 2012 > >> pc98 completed on Fri Aug 31 22:22:36 EDT 2012 > >> powerpc started on Fri Aug 31 22:22:36 EDT 2012 > >> powerpc completed on Fri Aug 31 22:44:48 EDT 2012 > >> sparc64 started on Fri Aug 31 22:44:48 EDT 2012 > >> sparc64 completed on Fri Aug 31 23:00:01 EDT 2012 > -------------------------------------------------------------- > >>> make universe completed on Fri Aug 31 23:00:01 EDT 2012 > (started Fri Aug 31 17:26:08 EDT 2012) > -------------------------------------------------------------- > Tinderbox failed: > mips BERI_DE4_MDROOT kernel failed, check _.mips.BERI_DE4_MDROOT for deta= ils > mips BERI_SIM_MDROOT kernel failed, check _.mips.BERI_SIM_MDROOT for deta= ils >=20 > > tail _.mips.BERI_DE4_MDROOT=20 > ... > make: don't know how to make /local/scratch/rnw24/mdroot.img. Stop >=20 > Hmm, the tinderbox skips the BERI configs: >=20 > TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf > TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_DE4_MDROOT > TB --- 2012-09-04 10:38:06 - skipping BERI_DE4_MDROOT kernel > TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf > TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_DE4_SDROOT > TB --- 2012-09-04 10:38:06 - skipping BERI_DE4_SDROOT kernel > TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf > TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_SIM_MDROOT > TB --- 2012-09-04 10:38:06 - skipping BERI_SIM_MDROOT kernel > TB --- 2012-09-04 10:38:06 - cd /src/sys/mips/conf > TB --- 2012-09-04 10:38:06 - /usr/sbin/config -m BERI_TEMPLATE > TB --- 2012-09-04 10:38:06 - skipping BERI_TEMPLATE kernel >=20 > --=20 > John Baldwin >=20 --DocE+STaALJfprDB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFQRnEyXY6L6fI4GtQRAgCmAJ9nhuqMxODpyFN26HlU5jzwDlF5zgCfT65s qNDZzoVXaDTP7aPP4wEci44= =Axeg -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:40:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70715106566C; Tue, 4 Sep 2012 21:40:54 +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 421888FC0A; Tue, 4 Sep 2012 21:40: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 q84Lesnh023138; Tue, 4 Sep 2012 21:40:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84Les2x023135; Tue, 4 Sep 2012 21:40:54 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209042140.q84Les2x023135@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 4 Sep 2012 21:40: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: r240107 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:40:55 -0000 Author: des Date: Tue Sep 4 21:40:53 2012 New Revision: 240107 URL: http://svn.freebsd.org/changeset/base/240107 Log: Add a prominent warning about these functions' unsuitability for cryptographic purposes, and recommend using arc4random(3) instead. Modified: head/lib/libc/stdlib/rand.3 head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Tue Sep 4 21:38:31 2012 (r240106) +++ head/lib/libc/stdlib/rand.3 Tue Sep 4 21:40:53 2012 (r240107) @@ -55,9 +55,15 @@ .Fn rand_r "unsigned *ctx" .Sh DESCRIPTION .Bf -symbolic +The functions described in this manual page are not cryptographically +secure. +Cryptographic applications should use +.Xr arc4random 3 +instead. +.Ef +.Pp These interfaces are obsoleted by .Xr random 3 . -.Ef .Pp The .Fn rand @@ -88,9 +94,6 @@ The function initializes a seed using the .Xr random 4 random number device which returns good random numbers. -However, the -.Fn rand -function still remains unsuitable for cryptographic use. .Pp The .Fn rand_r @@ -105,8 +108,6 @@ For better generator quality, use .Xr random 3 or .Xr lrand48 3 . -Applications requiring cryptographic quality randomness should use -.Xr arc4random 3 . .Sh SEE ALSO .Xr arc4random 3 , .Xr lrand48 3 , Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Tue Sep 4 21:38:31 2012 (r240106) +++ head/lib/libc/stdlib/random.3 Tue Sep 4 21:40:53 2012 (r240107) @@ -53,6 +53,14 @@ .Ft char * .Fn setstate "char *state" .Sh DESCRIPTION +.Bf -symbolic +The functions described in this manual page are not cryptographically +secure. +Cryptographic applications should use +.Xr arc4random 3 +instead. +.Ef +.Pp The .Fn random function @@ -98,10 +106,8 @@ as the seed. .Pp The .Fn srandomdev -routine initializes a state array using the -.Xr random 4 -random number device which returns good random numbers, -suitable for cryptographic use. +routine initializes a state array using data from +.Xr random 4 . Note that this particular seeding procedure can generate states which are impossible to reproduce by calling @@ -191,6 +197,3 @@ The historical implementation used to ha random sequence did not vary much with the seed. The current implementation employs a better pseudo-random number generator for the initial state calculation. -.Pp -Applications requiring cryptographic quality randomness should use -.Xr arc4random 3 . From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:47:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A56106564A; Tue, 4 Sep 2012 21:47:10 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 316978FC18; Tue, 4 Sep 2012 21:47: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 q84LlAti023834; Tue, 4 Sep 2012 21:47:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84Ll92Y023832; Tue, 4 Sep 2012 21:47:09 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201209042147.q84Ll92Y023832@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 4 Sep 2012 21:47: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: r240108 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:47:10 -0000 Author: obrien Date: Tue Sep 4 21:47:09 2012 New Revision: 240108 URL: http://svn.freebsd.org/changeset/base/240108 Log: * Rather than run the same 'ps' command twice, add 'kenv' which often gives machine unique values from the firmware. * The kernel is more likely to be unique than /bin/ls (but no need to stuff many megabytes into /dev/random, so hash it). * Change ordering to give larger variance across reboots to reduce predictability. Modified: head/etc/rc.d/initrandom Modified: head/etc/rc.d/initrandom ============================================================================== --- head/etc/rc.d/initrandom Tue Sep 4 21:40:53 2012 (r240107) +++ head/etc/rc.d/initrandom Tue Sep 4 21:47:09 2012 (r240108) @@ -27,9 +27,11 @@ better_than_nothing() # harvesting rate. # Entropy below is not great, but better than nothing. # This unblocks the generator at startup - ( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \ + # Note: commands are ordered to cause the most variance across reboots. + ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \ + | dd of=/dev/random bs=8k 2>/dev/null + /sbin/sha256 -q `sysctl -n kern.bootfile` \ | dd of=/dev/random bs=8k 2>/dev/null - cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null } initrandom_start() From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:50:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77ED61065796; Tue, 4 Sep 2012 21:50:52 +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 360888FC14; Tue, 4 Sep 2012 21:50:52 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id AA17A6CBB; Tue, 4 Sep 2012 23:50:50 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 672CC827C; Tue, 4 Sep 2012 23:50:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> Date: Tue, 04 Sep 2012 23:50:50 +0200 In-Reply-To: <201209041517.52973.jhb@freebsd.org> (John Baldwin's message of "Tue, 4 Sep 2012 15:17:52 -0400") Message-ID: <86k3w9e9tx.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, Robert Watson Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:50:52 -0000 John Baldwin writes: > Hmm, the tinderbox skips the BERI configs: It doesn't build the BERI kernels because they're mips64/mips, and it only builds mips/mips. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:54:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD17106564A; Tue, 4 Sep 2012 21:54:35 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB478FC14; Tue, 4 Sep 2012 21:54:34 +0000 (UTC) Received: by iebc12 with SMTP id c12so7698429ieb.13 for ; Tue, 04 Sep 2012 14:54:33 -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:content-transfer-encoding; bh=yFoh2aqKpTLA50DIgDUsBT6telQaj0+R1TjODvnaWe4=; b=eaINdPxt8UD9FaMaKFOf7JjIR58sDVJoQEFltn5DSM91vpL1VFvLMObxbZHkKmzT8M iD3jxSbUVKU/ICeMn5H2LNhuqYo0VhAijQGUq/O/kxurMxBOLNYnohCe8xP9igDpbe9w UVRC6vvPWuNYWmFy+vdUlhRoKWq3UKaYij8rME0SL22jNxMMcHjx5Kir2KwwxzqKXF0v bxFmb3uiUuCRwrjbpiMucAi3dQs3P2oVVw7fxBwUExGsN+ixjRIAQVGhFpP6JfI9KUHQ TSEmeqfgllsrsh04wSdawznbV+WBof6iYlEsGnKytexOvKQ76gXVVRTIRJLRdTlcRKpn ZEgw== MIME-Version: 1.0 Received: by 10.182.174.100 with SMTP id br4mr16316850obc.62.1346795673812; Tue, 04 Sep 2012 14:54:33 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Tue, 4 Sep 2012 14:54:33 -0700 (PDT) In-Reply-To: <86k3w9e9tx.fsf@ds4.des.no> References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> <86k3w9e9tx.fsf@ds4.des.no> Date: Tue, 4 Sep 2012 14:54:33 -0700 Message-ID: From: Garrett Cooper To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson , John Baldwin Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:54:35 -0000 On Tue, Sep 4, 2012 at 2:50 PM, Dag-Erling Sm=F8rgrav wrote: > John Baldwin writes: >> Hmm, the tinderbox skips the BERI configs: > > It doesn't build the BERI kernels because they're mips64/mips, and it > only builds mips/mips. Does it sanitize TARGETS and KERNCONFs properly? -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 21:56:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFE2E106579E; Tue, 4 Sep 2012 21:56:16 +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 DB7B78FC1A; Tue, 4 Sep 2012 21:56: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 q84LuGxL024928; Tue, 4 Sep 2012 21:56:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84LuGxt024926; Tue, 4 Sep 2012 21:56:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209042156.q84LuGxt024926@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 4 Sep 2012 21:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240109 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 21:56:17 -0000 Author: des Date: Tue Sep 4 21:56:16 2012 New Revision: 240109 URL: http://svn.freebsd.org/changeset/base/240109 Log: Add a configtest command. Submitted by: gjb@ MFC after: 1 week Modified: head/etc/rc.d/sshd Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Tue Sep 4 21:47:09 2012 (r240108) +++ head/etc/rc.d/sshd Tue Sep 4 21:56:16 2012 (r240109) @@ -14,8 +14,9 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" +configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" -extra_commands="keygen reload" +extra_commands="configtest keygen reload" timeout=300 @@ -87,6 +88,12 @@ sshd_keygen() ) } +sshd_configtest() +{ + echo "Performing sanity check on ${name} configuration." + eval ${command} ${sshd_flags} -t +} + sshd_precmd() { if [ ! -f /etc/ssh/ssh_host_key -o \ @@ -96,6 +103,7 @@ sshd_precmd() user_reseed run_rc_command keygen fi + sshd_configtest } load_rc_config $name From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 22:01:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1949E106564A; Tue, 4 Sep 2012 22:01:46 +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 C747F8FC1A; Tue, 4 Sep 2012 22:01:45 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 0269E6CD5; Wed, 5 Sep 2012 00:01:45 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id C77888290; Wed, 5 Sep 2012 00:01:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> <86k3w9e9tx.fsf@ds4.des.no> Date: Wed, 05 Sep 2012 00:01:44 +0200 In-Reply-To: (Garrett Cooper's message of "Tue, 4 Sep 2012 14:54:33 -0700") Message-ID: <86fw6xe9br.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, Robert Watson , John Baldwin Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 22:01:46 -0000 Garrett Cooper writes: > Dag-Erling Sm=C3=B8rgrav writes: > > It doesn't build the BERI kernels because they're mips64/mips, and > > it only builds mips/mips. > Does it sanitize TARGETS and KERNCONFs properly? I have no idea what that even means. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 22:03:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CF4D1065670; Tue, 4 Sep 2012 22:03:17 +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 583FD8FC20; Tue, 4 Sep 2012 22:03: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 q84M3HpT025825; Tue, 4 Sep 2012 22:03:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84M3HEN025822; Tue, 4 Sep 2012 22:03:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209042203.q84M3HEN025822@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 4 Sep 2012 22:03: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: r240111 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 22:03:17 -0000 Author: des Date: Tue Sep 4 22:03:16 2012 New Revision: 240111 URL: http://svn.freebsd.org/changeset/base/240111 Log: Bump dates. Reminded by: bz@ Modified: head/lib/libc/stdlib/rand.3 head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Tue Sep 4 21:58:22 2012 (r240110) +++ head/lib/libc/stdlib/rand.3 Tue Sep 4 22:03:16 2012 (r240111) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 6, 2010 +.Dd September 4, 2012 .Dt RAND 3 .Os .Sh NAME Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Tue Sep 4 21:58:22 2012 (r240110) +++ head/lib/libc/stdlib/random.3 Tue Sep 4 22:03:16 2012 (r240111) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd September 4, 2012 .Dt RANDOM 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 22:17:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C81106564A; Tue, 4 Sep 2012 22:17:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C6138FC08; Tue, 4 Sep 2012 22:17: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 q84MHYiW027629; Tue, 4 Sep 2012 22:17:34 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84MHYLl027627; Tue, 4 Sep 2012 22:17:34 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209042217.q84MHYLl027627@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 4 Sep 2012 22:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240112 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 22:17:34 -0000 Author: melifaro Date: Tue Sep 4 22:17:33 2012 New Revision: 240112 URL: http://svn.freebsd.org/changeset/base/240112 Log: Fix the build broken by r240099. Hide link_pfil_hook under _KERNEL macro. MFC after: 3 weeks Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Sep 4 22:03:16 2012 (r240111) +++ head/sys/net/if_var.h Tue Sep 4 22:17:33 2012 (r240112) @@ -99,8 +99,10 @@ TAILQ_HEAD(ifaddrhead, ifaddr); /* insta TAILQ_HEAD(ifmultihead, ifmultiaddr); TAILQ_HEAD(ifgrouphead, ifg_group); +#ifdef _KERNEL VNET_DECLARE(struct pfil_head, link_pfil_hook); /* packet filter hooks */ #define V_link_pfil_hook VNET(link_pfil_hook) +#endif /* _KERNEL */ /* * Structure defining a queue for a network interface. From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 22:19:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01951065670; Tue, 4 Sep 2012 22:19: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 AA0808FC0C; Tue, 4 Sep 2012 22:19: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 q84MJXww027901; Tue, 4 Sep 2012 22:19:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84MJXbv027899; Tue, 4 Sep 2012 22:19:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209042219.q84MJXbv027899@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 4 Sep 2012 22:19: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: r240113 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 22:19:33 -0000 Author: des Date: Tue Sep 4 22:19:33 2012 New Revision: 240113 URL: http://svn.freebsd.org/changeset/base/240113 Log: No memory barrier is required. This was pointed out by kib@ a while ago, but I got distracted by other matters. (for real this time) Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Sep 4 22:17:33 2012 (r240112) +++ head/sys/vm/swap_pager.c Tue Sep 4 22:19:33 2012 (r240113) @@ -1848,7 +1848,7 @@ retry: mtx_unlock(&swhash_mtx); VM_OBJECT_UNLOCK(object); if (uma_zone_exhausted(swap_zone)) { - if (atomic_cmpset_rel_int(&exhausted, 0, 1)) + if (atomic_cmpset_int(&exhausted, 0, 1)) printf("swap zone exhausted, " "increase kern.maxswzone\n"); vm_pageout_oom(VM_OOM_SWAPZ); @@ -1859,7 +1859,7 @@ retry: goto retry; } - if (atomic_cmpset_rel_int(&exhausted, 1, 0)) + if (atomic_cmpset_int(&exhausted, 1, 0)) printf("swap zone ok\n"); swap->swb_hnext = NULL; From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 22:40:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17027106564A; Tue, 4 Sep 2012 22:40:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0320A8FC1C; Tue, 4 Sep 2012 22:40: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 q84MenEG030687; Tue, 4 Sep 2012 22:40:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84Menm5030685; Tue, 4 Sep 2012 22:40:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209042240.q84Menm5030685@svn.freebsd.org> From: Michael Tuexen Date: Tue, 4 Sep 2012 22:40: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: r240114 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 22:40:50 -0000 Author: tuexen Date: Tue Sep 4 22:40:49 2012 New Revision: 240114 URL: http://svn.freebsd.org/changeset/base/240114 Log: Whitespace change. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Sep 4 22:19:33 2012 (r240113) +++ head/sys/netinet/sctputil.c Tue Sep 4 22:40:49 2012 (r240114) @@ -2385,7 +2385,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb timevalsub(&now, old); /* store the current RTT in us */ net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + - (uint64_t) now.tv_usec; + (uint64_t) now.tv_usec; /* computer rtt in ms */ rtt = net->rtt / 1000; From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 22:45:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C89C2106566C; Tue, 4 Sep 2012 22:45:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0B5D8FC14; Tue, 4 Sep 2012 22:45: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 q84Mj0t5031201; Tue, 4 Sep 2012 22:45:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84Mj0fr031199; Tue, 4 Sep 2012 22:45:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209042245.q84Mj0fr031199@svn.freebsd.org> From: Michael Tuexen Date: Tue, 4 Sep 2012 22:45: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: r240115 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 22:45:00 -0000 Author: tuexen Date: Tue Sep 4 22:45:00 2012 New Revision: 240115 URL: http://svn.freebsd.org/changeset/base/240115 Log: Use the consistenly the size of a variable. This helps to keep the code simpler for the userland implementation. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Sep 4 22:40:49 2012 (r240114) +++ head/sys/netinet/sctp_output.c Tue Sep 4 22:45:00 2012 (r240115) @@ -3371,7 +3371,7 @@ sctp_find_cmsg(int c_type, void *data, s return (found); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ return (found); } @@ -3386,11 +3386,11 @@ sctp_find_cmsg(int c_type, void *data, s (cmh.cmsg_type == SCTP_PRINFO) || (cmh.cmsg_type == SCTP_AUTHINFO))))) { if (c_type == cmh.cmsg_type) { - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < cpsize) { return (found); } /* It is exactly what we want. Copy it out. */ - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), cpsize, (caddr_t)data); return (1); } else { struct sctp_sndrcvinfo *sndrcvinfo; @@ -3404,10 +3404,10 @@ sctp_find_cmsg(int c_type, void *data, s } switch (cmh.cmsg_type) { case SCTP_SNDINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_sndinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); sndrcvinfo->sinfo_stream = sndinfo.snd_sid; sndrcvinfo->sinfo_flags = sndinfo.snd_flags; sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; @@ -3415,18 +3415,18 @@ sctp_find_cmsg(int c_type, void *data, s sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; break; case SCTP_PRINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_prinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); sndrcvinfo->sinfo_timetolive = prinfo.pr_value; sndrcvinfo->sinfo_flags |= prinfo.pr_policy; break; case SCTP_AUTHINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_authinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); sndrcvinfo->sinfo_keynumber_valid = 1; sndrcvinfo->sinfo_keynumber = authinfo.auth_keynumber; break; @@ -3466,7 +3466,7 @@ sctp_process_cmsgs_for_init(struct sctp_ return (1); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ *error = EINVAL; return (1); @@ -3479,11 +3479,11 @@ sctp_process_cmsgs_for_init(struct sctp_ if (cmh.cmsg_level == IPPROTO_SCTP) { switch (cmh.cmsg_type) { case SCTP_INIT: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_initmsg)) { *error = EINVAL; return (1); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); if (initmsg.sinit_max_attempts) stcb->asoc.max_init_times = initmsg.sinit_max_attempts; if (initmsg.sinit_num_ostreams) @@ -3523,7 +3523,7 @@ sctp_process_cmsgs_for_init(struct sctp_ break; #ifdef INET case SCTP_DSTADDRV4: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in_addr)) { *error = EINVAL; return (1); } @@ -3531,7 +3531,7 @@ sctp_process_cmsgs_for_init(struct sctp_ sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = stcb->rport; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); if ((sin.sin_addr.s_addr == INADDR_ANY) || (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { @@ -3547,7 +3547,7 @@ sctp_process_cmsgs_for_init(struct sctp_ #endif #ifdef INET6 case SCTP_DSTADDRV6: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in6_addr)) { *error = EINVAL; return (1); } @@ -3555,7 +3555,7 @@ sctp_process_cmsgs_for_init(struct sctp_ sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = stcb->rport; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { *error = EINVAL; @@ -3623,7 +3623,7 @@ sctp_findassociation_cmsgs(struct sctp_i return (NULL); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ *error = EINVAL; return (NULL); @@ -3637,7 +3637,7 @@ sctp_findassociation_cmsgs(struct sctp_i switch (cmh.cmsg_type) { #ifdef INET case SCTP_DSTADDRV4: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in_addr)) { *error = EINVAL; return (NULL); } @@ -3645,13 +3645,13 @@ sctp_findassociation_cmsgs(struct sctp_i sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = port; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); addr = (struct sockaddr *)&sin; break; #endif #ifdef INET6 case SCTP_DSTADDRV6: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in6_addr)) { *error = EINVAL; return (NULL); } @@ -3659,7 +3659,7 @@ sctp_findassociation_cmsgs(struct sctp_i sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = port; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); #ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { in6_sin6_2_sin(&sin, &sin6); From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:13:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90F32106564A; Tue, 4 Sep 2012 23:13:25 +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 7C2DA8FC08; Tue, 4 Sep 2012 23:13: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 q84NDP4N034613; Tue, 4 Sep 2012 23:13:25 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84NDPi2034610; Tue, 4 Sep 2012 23:13:25 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209042313.q84NDPi2034610@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 4 Sep 2012 23:13: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: r240118 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:13:25 -0000 Author: gavin Date: Tue Sep 4 23:13:24 2012 New Revision: 240118 URL: http://svn.freebsd.org/changeset/base/240118 Log: Support another uchcom(4) device. MFC after: 1 week Modified: head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Tue Sep 4 23:08:52 2012 (r240117) +++ head/sys/dev/usb/serial/uchcom.c Tue Sep 4 23:13:24 2012 (r240118) @@ -207,6 +207,7 @@ static const struct uchcom_divider_recor static const STRUCT_USB_HOST_ID uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER_2, 0)}, }; /* protypes */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Sep 4 23:08:52 2012 (r240117) +++ head/sys/dev/usb/usbdevs Tue Sep 4 23:13:24 2012 (r240118) @@ -4163,6 +4163,7 @@ product WAVESENSE JAZZ 0xaaaa Jazz bloo /* WCH products */ product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge product WCH2 DUMMY 0x0000 Dummy product +product WCH2 CH341SER_2 0x5523 CH341/CH340 USB-Serial Bridge product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge product WCH2 U2M 0X752d CH345 USB2.0-MIDI From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:16:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0896106566C; Tue, 4 Sep 2012 23:16:55 +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 DC0988FC0A; Tue, 4 Sep 2012 23:16: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 q84NGt8T035025; Tue, 4 Sep 2012 23:16:55 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84NGtuA035023; Tue, 4 Sep 2012 23:16:55 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201209042316.q84NGtuA035023@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 4 Sep 2012 23:16: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: r240119 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:16:56 -0000 Author: ray Date: Tue Sep 4 23:16:55 2012 New Revision: 240119 URL: http://svn.freebsd.org/changeset/base/240119 Log: Style fixes. Suggested by: mdf Approved by: adrian (menthor) Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Tue Sep 4 23:13:24 2012 (r240118) +++ head/sys/kern/subr_hints.c Tue Sep 4 23:16:55 2012 (r240119) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include /* @@ -52,9 +52,9 @@ static char *hintp; static int sysctl_hintmode(SYSCTL_HANDLER_ARGS) { - int error, i, from_kenv, value, eqidx; const char *cp; char *line, *eq; + int eqidx, error, from_kenv, i, value; from_kenv = 0; cp = kern_envp; @@ -62,7 +62,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) /* Fetch candidate for new hintmode value */ error = sysctl_handle_int(oidp, &value, 0, req); - if (error || !req->newptr) + if (error || req->newptr == NULL) return (error); if (value != 2) @@ -73,8 +73,11 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) switch (hintmode) { case 0: if (dynamic_kenv) { - /* Already here */ - hintmode = value; /* XXX: Need we switch or not ? */ + /* + * Already here. But assign hintmode to 2, to not + * check it in the future. + */ + hintmode = 2; return (0); } from_kenv = 1; @@ -98,7 +101,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) continue; } eq = strchr(cp, '='); - if (!eq) + if (eq == NULL) /* Bad hint value */ continue; eqidx = eq - cp; From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:16:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B29D106564A; Tue, 4 Sep 2012 23:16:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D19B18FC16; Tue, 4 Sep 2012 23:16: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 q84NGwD4035061; Tue, 4 Sep 2012 23:16:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84NGwiP035060; Tue, 4 Sep 2012 23:16:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201209042316.q84NGwiP035060@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 4 Sep 2012 23:16: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: r240120 - head/contrib/atf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:16:59 -0000 Author: marcel Date: Tue Sep 4 23:16:58 2012 New Revision: 240120 URL: http://svn.freebsd.org/changeset/base/240120 Log: Merge ATF 0.16 from vendor/atf/dist. Provenance: http://code.google.com/p/kyua Discussed with: gibbs, gnn, keramida, mdf, mlaier, Discussed with: Garrett Cooper Added: head/contrib/atf/ - copied from r240117, vendor/atf/dist/ From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:27:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBF33106566B; Tue, 4 Sep 2012 23:27:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC48B8FC08; Tue, 4 Sep 2012 23:27: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 q84NR7fR036451; Tue, 4 Sep 2012 23:27:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q84NR7Tj036449; Tue, 4 Sep 2012 23:27:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201209042327.q84NR7Tj036449@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 4 Sep 2012 23:27: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: r240122 - in head/contrib/atf: . atf-c X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:27:07 -0000 Author: marcel Date: Tue Sep 4 23:27:07 2012 New Revision: 240122 URL: http://svn.freebsd.org/changeset/base/240122 Log: Add headers created by running configure. Added: head/contrib/atf/atf-c/defs.h head/contrib/atf/bconfig.h Added: head/contrib/atf/atf-c/defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c/defs.h Tue Sep 4 23:27:07 2012 (r240122) @@ -0,0 +1,37 @@ +/* + * Automated Testing Framework (atf) + * + * Copyright (c) 2008 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND + * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if !defined(ATF_C_DEFS_H) +#define ATF_C_DEFS_H + +#define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(a, b) __attribute__((__format__(__printf__, a, b))) +#define ATF_DEFS_ATTRIBUTE_NORETURN __attribute__((__noreturn__)) +#define ATF_DEFS_ATTRIBUTE_UNUSED __attribute__((__unused__)) + +#endif /* !defined(ATF_C_DEFS_H) */ Added: head/contrib/atf/bconfig.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/bconfig.h Tue Sep 4 23:27:07 2012 (r240122) @@ -0,0 +1,114 @@ +/* bconfig.h. Generated from bconfig.h.in by configure. */ +/* bconfig.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if basename takes a constant pointer */ +#define HAVE_CONST_BASENAME 1 + +/* Define to 1 if dirname takes a constant pointer */ +#define HAVE_CONST_DIRNAME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if getcwd(NULL, 0) works */ +#define HAVE_GETCWD_DYN 1 + +/* Define to 1 if getopt allows a + sign for POSIX behavior */ +/* #undef HAVE_GNU_GETOPT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if getopt has optreset */ +/* #undef HAVE_OPTRESET */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if putenv is in std */ +/* #undef HAVE_PUTENV_IN_STD */ + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if setenv is in std */ +/* #undef HAVE_SETENV_IN_STD */ + +/* Define to 1 if snprintf is in std */ +/* #undef HAVE_SNPRINTF_IN_STD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `unmount' function. */ +#define HAVE_UNMOUNT 1 + +/* Define to 1 if you have the `unsetenv' function. */ +#define HAVE_UNSETENV 1 + +/* Define to 1 if unsetenv is in std */ +/* #undef HAVE_UNSETENV_IN_STD */ + +/* Define to 1 if vsnprintf is in std */ +/* #undef HAVE_VSNPRINTF_IN_STD */ + +/* Define to the last valid signal number */ +#define LAST_SIGNO 128 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "atf" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "atf-devel@NetBSD.org" + +/* Define to the copyright string applicable to this package. */ +#define PACKAGE_COPYRIGHT "Copyright (c) 2007-2012 The NetBSD Foundation, Inc." + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Automated Testing Framework" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Automated Testing Framework 0.16" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "atf" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "http://code.google.com/p/kyua/wiki/ATF" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.16" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.16" From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:31:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D26631065676; Tue, 4 Sep 2012 23:31:07 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 604388FC17; Tue, 4 Sep 2012 23:31:07 +0000 (UTC) Received: by iebc12 with SMTP id c12so7918049ieb.13 for ; Tue, 04 Sep 2012 16:31:07 -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:content-transfer-encoding; bh=RDwAxZPjZjObtg/sCpjhm4Ge3F5BCxcYn48/rG4qmrs=; b=VPqf7tRIELzfS0DWFixiwKkcvfCvrlY18DIpl3zZZg36lGr+C9aXDOq8jFk3kUBejO /0/KjrlqWmoaRq0T0Ae5F8EZH9XI/Sll6YUmkl6EQc1WYx0Fya24q6oMLhjMF/sOSrBc vl65burK3iPfkDGKfu+5b4aJqQCBbqTdbLAUCU5/EZT0NVj49QDCjUjgd7KGSOQZ4QgM p1LwqUQ5fJiSwSJlkvsuBhacbGrSiLTW2ttHm+Zy57FqKMhdxji3sRbakldCgO0OK7NZ Su9wT8JAKhsZogxj7rsSHYLR7jiPwUyrrzGP3Al0yJ5BNsboPr0H+E2OVmwN7xuhOSWL IKZg== MIME-Version: 1.0 Received: by 10.182.218.37 with SMTP id pd5mr16555938obc.24.1346801466967; Tue, 04 Sep 2012 16:31:06 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Tue, 4 Sep 2012 16:31:06 -0700 (PDT) In-Reply-To: <86fw6xe9br.fsf@ds4.des.no> References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> <86k3w9e9tx.fsf@ds4.des.no> <86fw6xe9br.fsf@ds4.des.no> Date: Tue, 4 Sep 2012 16:31:06 -0700 Message-ID: From: Garrett Cooper To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson , John Baldwin Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:31:08 -0000 On Tue, Sep 4, 2012 at 3:01 PM, Dag-Erling Sm=F8rgrav wrote: > Garrett Cooper writes: >> Dag-Erling Sm=F8rgrav writes: >> > It doesn't build the BERI kernels because they're mips64/mips, and >> > it only builds mips/mips. >> Does it sanitize TARGETS and KERNCONFs properly? > > I have no idea what that even means. Answering myself, it should if TARGET isn't explicitly defined to something that the conversion logic wouldn't create collisions for (from .../Makefile in stable/9): 405 KERNCONFS!=3D cd ${KERNSRCDIR}/${TARGET}/conf && \ 406 find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ 407 ! -name DEFAULTS ! -name NOTES 408 universe_kernconfs: 409 .for kernel in ${KERNCONFS} 410 TARGET_ARCH_${kernel}!=3D cd ${KERNSRCDIR}/${TARGET}/conf && \ 411 config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null |= \ 412 grep -v WARNING: | cut -f 2 413 .if empty(TARGET_ARCH_${kernel}) 414 .error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." 415 .endif In particular TARGETS_ARCHS=3Dmips64:mips might not work in all cases, righ= t? $ make -VKERNCONFS TARGET=3Dmips TARGET_ARCH=3Dmips64 tinderbox ADM5120 ALCHEMY AP91 AP93 AP94 AP96 AR71XX_BASE AR724X_BASE AR91XX_BASE BERI_DE4_MDROOT BERI_DE4_SDROOT BERI_SIM_MDROOT BERI_TEMPLATE DIR-825 GXEMUL IDT MALTA MALTA64 OCTEON1 PB47 PB92 QEMU ROUTERSTATION ROUTERSTATION_MFS RSPRO RSPRO_MFS RSPRO_STANDALONE RT305X SENTRY5 SWARM SWARM64 SWARM64_SMP SWARM_SMP TP-WN1043ND XLP XLP64 XLPN32 XLR XLR64 XLRN32 $ make -VKERNCONFS TARGET=3Dmips TARGET_ARCH=3Dmips tinderbox ADM5120 ALCHEMY AP91 AP93 AP94 AP96 AR71XX_BASE AR724X_BASE AR91XX_BASE BERI_DE4_MDROOT BERI_DE4_SDROOT BERI_SIM_MDROOT BERI_TEMPLATE DIR-825 GXEMUL IDT MALTA MALTA64 OCTEON1 PB47 PB92 QEMU ROUTERSTATION ROUTERSTATION_MFS RSPRO RSPRO_MFS RSPRO_STANDALONE RT305X SENTRY5 SWARM SWARM64 SWARM64_SMP SWARM_SMP TP-WN1043ND XLP XLP64 XLPN32 XLR XLR64 XLRN32 You have to explicitly set the machine directive in the KERNCONF in order for it to only compile on one TARGET_ARCH: $ egrep -r 'machine.*64' sys/mips/conf/ sys/mips/conf/XLP64:machine mips mips64 sys/mips/conf/BERI_TEMPLATE:machine mips mips64 sys/mips/conf/GXEMUL:machine mips mips64 sys/mips/conf/XLR64:machine mips mips64 sys/mips/conf/SWARM64:machine mips mips64 sys/mips/conf/SWARM64_SMP:machine mips mips64 sys/mips/conf/MALTA64:machine mips mips64el # Malta supports both, so it isn't in std.malta Thanks! -Garrett PS I think brooks@ is aware of what needs to be fixed and is working on the solution. From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:39:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15E33106566C; Tue, 4 Sep 2012 23:39:54 +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 C4F468FC16; Tue, 4 Sep 2012 23:39:53 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 29ED96D61; Wed, 5 Sep 2012 01:39:53 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 02C9182E4; Wed, 5 Sep 2012 01:39:52 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> <86k3w9e9tx.fsf@ds4.des.no> <86fw6xe9br.fsf@ds4.des.no> Date: Wed, 05 Sep 2012 01:39:52 +0200 In-Reply-To: (Garrett Cooper's message of "Tue, 4 Sep 2012 16:31:06 -0700") Message-ID: <86txvdcq7r.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, Robert Watson , John Baldwin Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:39:54 -0000 Garrett Cooper writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Garrett Cooper writes: > > > Does it sanitize TARGETS and KERNCONFs properly? > > I have no idea what that even means. > Answering myself, it should if TARGET isn't explicitly defined to > something that the conversion logic wouldn't create collisions for > [...] I still have no idea what you mean. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:42:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADA2F106566B; Tue, 4 Sep 2012 23:42:10 +0000 (UTC) (envelope-from yanegomi@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 3B91A8FC19; Tue, 4 Sep 2012 23:42:10 +0000 (UTC) Received: by iayy25 with SMTP id y25so247198iay.13 for ; Tue, 04 Sep 2012 16:42:09 -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:content-transfer-encoding; bh=/rvBY/8k0i4gNfw38GqBvHngUTZronCpuCaXa3BMhEI=; b=fjJkZaycDNPC+HkQLRwvxYJC2eEdfSLHmT510Z3y7G9f5RNd3ISBsgnXl++OLKPpPN ij6XxENHBCNkz2VqLKCaSRGXbzSEThahrtnToa0AajmkHPqCOmnII6daVfo/3xJbn8gN YdTmj0cC6Nj/n+DWfTJgRgfm0tBTfSQbtNKfKHK6b5QC6Qo2hy07ST7ajmAWsQLaCDuY wtOpLNmyeoDJvE34cIR1xXWM+E14uQ4N2IFaiNTsGP7VYdns64QECmB5nIbm39YR9w61 CnR6xDC7H0JWcLEOTxNSickrW0g2GDnZpiVjeA6O1NiHH3noBldD1qsNEhKpj7ug0zAh 1ZWQ== MIME-Version: 1.0 Received: by 10.182.218.37 with SMTP id pd5mr16560743obc.24.1346802129818; Tue, 04 Sep 2012 16:42:09 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Tue, 4 Sep 2012 16:42:09 -0700 (PDT) In-Reply-To: <86txvdcq7r.fsf@ds4.des.no> References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> <86k3w9e9tx.fsf@ds4.des.no> <86fw6xe9br.fsf@ds4.des.no> <86txvdcq7r.fsf@ds4.des.no> Date: Tue, 4 Sep 2012 16:42:09 -0700 Message-ID: From: Garrett Cooper To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson , John Baldwin Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:42:10 -0000 On Tue, Sep 4, 2012 at 4:39 PM, Dag-Erling Sm=F8rgrav wrote: > Garrett Cooper writes: >> Dag-Erling Sm=F8rgrav writes: >> > Garrett Cooper writes: >> > > Does it sanitize TARGETS and KERNCONFs properly? >> > I have no idea what that even means. >> Answering myself, it should if TARGET isn't explicitly defined to >> something that the conversion logic wouldn't create collisions for >> [...] > > I still have no idea what you mean. tl;dr: I [very briefly] thought someone could set KERNCONF in /etc/src.conf or on the command line and it would screw things up, but I quickly realized that assumption was incorrect. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 23:50:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54CDC106566B; Tue, 4 Sep 2012 23:50:10 +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 0D7D58FC16; Tue, 4 Sep 2012 23:50:09 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 456456D6D; Wed, 5 Sep 2012 01:50:09 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 1222282E7; Wed, 5 Sep 2012 01:50:09 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper References: <201208251202.q7PC2EL6034670@svn.freebsd.org> <201209041517.52973.jhb@freebsd.org> <86k3w9e9tx.fsf@ds4.des.no> <86fw6xe9br.fsf@ds4.des.no> <86txvdcq7r.fsf@ds4.des.no> Date: Wed, 05 Sep 2012 01:50:08 +0200 In-Reply-To: (Garrett Cooper's message of "Tue, 4 Sep 2012 16:42:09 -0700") Message-ID: <86pq61cpqn.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, Robert Watson , John Baldwin Subject: Re: svn commit: r239679 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 23:50:10 -0000 Garrett Cooper writes: > I [very briefly] thought someone could set KERNCONF in /etc/src.conf > or on the command line and it would screw things up, but I quickly > realized that assumption was incorrect. The tinderbox points both __MAKE_CONF and SRCCONF at /dev/null anyway. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 04:18:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FCBA1065670; Wed, 5 Sep 2012 04:18:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 132C48FC0C; Wed, 5 Sep 2012 04:18:51 +0000 (UTC) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q854Io7f015497; Wed, 5 Sep 2012 14:18:50 +1000 Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q854IeVb011549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Sep 2012 14:18:42 +1000 Date: Wed, 5 Sep 2012 14:18:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Aleksandr Rybalko In-Reply-To: <201209042316.q84NGtuA035023@svn.freebsd.org> Message-ID: <20120905135841.D1053@besplex.bde.org> References: <201209042316.q84NGtuA035023@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240119 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 04:18:52 -0000 On Tue, 4 Sep 2012, Aleksandr Rybalko wrote: > Log: > Style fixes. > > Suggested by: mdf > Approved by: adrian (menthor) The following style bugs remain. (The density of style bugs is low enough for them to be easy to fix.) > Modified: head/sys/kern/subr_hints.c > ============================================================================== > --- head/sys/kern/subr_hints.c Tue Sep 4 23:13:24 2012 (r240118) > +++ head/sys/kern/subr_hints.c Tue Sep 4 23:16:55 2012 (r240119) > @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > +#include Sorting this correctly would be an unrelated fix (it is a prerequisite for most headers, since almost any header may use KASSERT()). > #include Sorting this correctly woruld be an unrelated fix. > > /* > @@ -52,9 +52,9 @@ static char *hintp; Sorting and indenting the static variables would be an unrelated fix. > static int > sysctl_hintmode(SYSCTL_HANDLER_ARGS) A bug in svn diff is visible. The variable declaration is worse than useless as a header for this block of code. > { > - int error, i, from_kenv, value, eqidx; > const char *cp; > char *line, *eq; > + int eqidx, error, from_kenv, i, value; > > from_kenv = 0; > cp = kern_envp; > @@ -62,7 +62,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > /* Fetch candidate for new hintmode value */ Comments (except possibly ones at the right of code) should be real sentences. This one is missing a ".", unlike all older comments (not at the right of code) in this file. > error = sysctl_handle_int(oidp, &value, 0, req); > - if (error || !req->newptr) > + if (error || req->newptr == NULL) > return (error); > > if (value != 2) This still has a boolean test for the non-boolean `error'. Now the older code sets a bad example in all cases where `error' is tested. > @@ -73,8 +73,11 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > switch (hintmode) { > case 0: > if (dynamic_kenv) { > - /* Already here */ > - hintmode = value; /* XXX: Need we switch or not ? */ > + /* > + * Already here. But assign hintmode to 2, to not > + * check it in the future. > + */ Sentence breaks should be 2 spaces, as in all older comments in this file, starting as usual with the copyright. But outside of the copyright, the style bug of single-space sentence breaks was avoided in this file mostly by using the larger style bug of using a new line for most new sentences. > + hintmode = 2; > return (0); > } > from_kenv = 1; > @@ -98,7 +101,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > continue; > } > eq = strchr(cp, '='); > - if (!eq) > + if (eq == NULL) > /* Bad hint value */ > continue; > eqidx = eq - cp; Bruce From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 05:34:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4B81106566B; Wed, 5 Sep 2012 05:34:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail27.syd.optusnet.com.au (mail27.syd.optusnet.com.au [211.29.133.168]) by mx1.freebsd.org (Postfix) with ESMTP id 488E88FC12; Wed, 5 Sep 2012 05:34:52 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail27.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q855YhW7012201 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Sep 2012 15:34:44 +1000 Date: Wed, 5 Sep 2012 15:34:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Zonov In-Reply-To: <50445609.8070902@FreeBSD.org> Message-ID: <20120905141910.N1053@besplex.bde.org> References: <201209021739.q82Hd3CE042578@svn.freebsd.org> <50445609.8070902@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240026 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 05:34:53 -0000 On Mon, 3 Sep 2012, Andrey Zonov wrote: > On 9/3/12 1:20 AM, Garrett Cooper wrote: >> On Sun, Sep 2, 2012 at 2:16 PM, Garrett Cooper wrote: >>> On Sun, Sep 2, 2012 at 10:39 AM, Andrey Zonov wrote: >>>> Author: zont >>>> Date: Sun Sep 2 17:39:02 2012 >>>> New Revision: 240026 >>>> URL: http://svn.freebsd.org/changeset/base/240026 >>>> >>>> Log: >>>> - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz >>>> and kern.sgrowsiz sysctls writable. >>>> >>>> Approved by: kib (mentor) >>>> >>>> Modified: >>>> head/sys/kern/subr_param.c >> >> ... >> >>> Please add some basic sanity checking to init_param1 -- there's >>> absolutely nothing preventing me from passing in values <= 0 or other Isn't that an old feature, not affected by this commit? init_param1() runs long before sysctl(8) can run to use the new feature, so it is not affected by this commit. And it is a feature, not a bug, for it to use the values passed in -- the user is the sysadmin, who never makes misteaks and knows what is sane better than init_param1(). >> Correction: values == 0 with little effort (missed the part where it >> was using TUNABLE_ULONG_FETCH). Hopefully it only uses TUNABLE_ULONG_FETCH() for u_longs. It starts by using TUNABLE_INT_FIX() for hz. hz == -1 is in-band but is abused to check for the tunable not being passed in, though hz = -1 can be passed in. Zero, and other negative values of hz are silently accepted. This is a feature (unless you want kernel bloat), since it is too hard for init_param() to tell what a sane value is. To do so, it would have to know all about the subsystems that use the variables, and the interactions of the subsystems with each other and with the system's resources, since sane values of the variables depend on the other variables and the system's resources. For hz, it happens to be easy to know that hz = 0 is insane. hz = 0 will in fact be detected and reported immediately as a fatal trap (division by 0). hz < 0 is just insane. Large values of hz may or may not be insane, depending on timecounter and other system capabilities (except hz > 1000000 is obviously insane, since the same immediate division that gives the fatal trap when hz = 0 also gives tick = 0 when hz > 1000000, and tick = 0 can't work). Next, init_param1() uses some TUNABLE_LONG_FETCH()es for variables not touched in this commit. Most of the older parameters use plain int or long. There is sanity checking only for the newer tunable ngroups_max. This mainly breaks the ability of the user to create a non-POSIX system for testing. This sanity checking has a comment about not allowing values greater than INT_MAX - 1. This comment is wrong and not just irrelevant. TUNABLE_INT_FETCH() automatically disallows values larger than INT_MAX. But it allows a value of INT_MAX, and the code does nothing extra to disallow that. This is probably related to old off-by-1 bugs near {NGROUPS_MAX} (it is unclear if the effective gid is "supplementary"). Hopefully we now count the extra 1 in {NGROUPS_MAX}, so never need to add 1 to {NGROUPS_MAX}. >> You could get negative values though >> if you overflow the value passed in -- in part because the getenv* >> functions in kern_environment.c don't check for/handle overflow >> gracefully .. I had a patch out for this a while ago that never made >> it in. The unsigned long variables mainly break any possibility of detecting overflow, since overflow and negative values can't really happen for unsigned longs. But it is a feature for init_param1() to not limit values to say LONG_MAX, since such a limit is almost useless for preventing overflow when the variables are combined, and limits small enough to prevent overflow for all possible reasonable combinations of the variables would probably prevent useful combinations of the variables (when some of the variables can be larger than usual provided others are smaller than usual). The limits related to packing of kva are most interesting here -- even adding up the sizes of the pieces is not easy. The above discussion of {NGROUPS_MAX} shows that even adding 1 is not easy. >>> non-performant (non-multiple of PAGE_SIZE, whacky ratios, etc) values. Since we have to trust users to pack kva delicately (if they want to change the defaults at all), why not trust them to know PAGE_SIZE? > I thought of sanity checking here, but there weren't for tunables and I > did't want to add any "magic numbers" in this code. I don't think that > we should check for multiple of PAGE_SIZE, may be only for sgrowsiz and > even not checking, just rounding up. Indeed. It is possible for sysctl() to do more sanity checking, but even less useful, since doing so mainly breaks testing of the limits. > If you have those "magic numbers" I would love to add it. The limits can't be static magic numbers, since they (should) depend on things like kva size and packing which depend on other limits. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 06:02:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9D51106564A; Wed, 5 Sep 2012 06:02:54 +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 9A1668FC14; Wed, 5 Sep 2012 06:02: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 q8562sXC084962; Wed, 5 Sep 2012 06:02:54 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8562sUo084957; Wed, 5 Sep 2012 06:02:54 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209050602.q8562sUo084957@svn.freebsd.org> From: Alan Cox Date: Wed, 5 Sep 2012 06:02: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: r240126 - in head/sys: amd64/amd64 i386/i386 i386/xen mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 06:02:54 -0000 Author: alc Date: Wed Sep 5 06:02:54 2012 New Revision: 240126 URL: http://svn.freebsd.org/changeset/base/240126 Log: Rename {_,}pmap_unwire_pte_hold() to {_,}pmap_unwire_ptp() and update the comment describing them. Both the function names and the comment had grown stale. Quite some time has passed since these pmap implementations last used the page's hold count to track the number of valid mapping within a page table page. Also, returning TRUE from pmap_unwire_ptp() rather than _pmap_unwire_ptp() eliminates a few instructions from callers like pmap_enter_quick_locked() where pmap_unwire_ptp()'s return value is used directly by a conditional statement. Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/mips/mips/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 5 04:50:20 2012 (r240125) +++ head/sys/amd64/amd64/pmap.c Wed Sep 5 06:02:54 2012 (r240126) @@ -323,8 +323,8 @@ static vm_page_t pmap_allocpde(pmap_t pm static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, struct rwlock **lockp); -static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_page_t* free); +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_page_t *free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, vm_page_t *); static vm_offset_t pmap_kmem_choose(vm_offset_t addr); @@ -1557,23 +1557,25 @@ pmap_remove_pt_page(pmap_t pmap, vm_page } /* - * This routine unholds page table pages, and if the hold count - * drops to zero, then it decrements the wire count. + * Decrements a page table page's wire count, which is used to record the + * number of valid page table entries within the page. If the wire count + * drops to zero, then the page table page is unmapped. Returns TRUE if the + * page table page was unmapped and FALSE otherwise. */ -static __inline int -pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t *free) +static inline boolean_t +pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t *free) { --m->wire_count; - if (m->wire_count == 0) - return (_pmap_unwire_pte_hold(pmap, va, m, free)); - else - return (0); + if (m->wire_count == 0) { + _pmap_unwire_ptp(pmap, va, m, free); + return (TRUE); + } else + return (FALSE); } -static int -_pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_page_t *free) +static void +_pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t *free) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -1602,14 +1604,14 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of vm_page_t pdpg; pdpg = PHYS_TO_VM_PAGE(*pmap_pdpe(pmap, va) & PG_FRAME); - pmap_unwire_pte_hold(pmap, va, pdpg, free); + pmap_unwire_ptp(pmap, va, pdpg, free); } if (m->pindex >= NUPDE && m->pindex < (NUPDE + NUPDPE)) { /* We just released a PD, unhold the matching PDP */ vm_page_t pdppg; pdppg = PHYS_TO_VM_PAGE(*pmap_pml4e(pmap, va) & PG_FRAME); - pmap_unwire_pte_hold(pmap, va, pdppg, free); + pmap_unwire_ptp(pmap, va, pdppg, free); } /* @@ -1624,8 +1626,6 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of * *ALL* TLB shootdown is done */ pmap_add_delayed_free_list(m, free, TRUE); - - return (1); } /* @@ -1641,7 +1641,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return (0); KASSERT(ptepde != 0, ("pmap_unuse_pt: ptepde != 0")); mpte = PHYS_TO_VM_PAGE(ptepde & PG_FRAME); - return (pmap_unwire_pte_hold(pmap, va, mpte, free)); + return (pmap_unwire_ptp(pmap, va, mpte, free)); } void @@ -3666,7 +3666,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t if (!pmap_pv_insert_pde(pmap, va, VM_PAGE_TO_PHYS(m), lockp)) { free = NULL; - if (pmap_unwire_pte_hold(pmap, va, mpde, &free)) { + if (pmap_unwire_ptp(pmap, va, mpde, &free)) { pmap_invalidate_page(pmap, va); pmap_free_zero_pages(free); } @@ -3842,7 +3842,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ !pmap_try_insert_pv_entry(pmap, va, m, lockp)) { if (mpte != NULL) { free = NULL; - if (pmap_unwire_pte_hold(pmap, va, mpte, &free)) { + if (pmap_unwire_ptp(pmap, va, mpte, &free)) { pmap_invalidate_page(pmap, va); pmap_free_zero_pages(free); } @@ -4149,8 +4149,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm pmap_resident_count_inc(dst_pmap, 1); } else { free = NULL; - if (pmap_unwire_pte_hold(dst_pmap, - addr, dstmpte, &free)) { + if (pmap_unwire_ptp(dst_pmap, addr, + dstmpte, &free)) { pmap_invalidate_page(dst_pmap, addr); pmap_free_zero_pages(free); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Sep 5 04:50:20 2012 (r240125) +++ head/sys/i386/i386/pmap.c Wed Sep 5 06:02:54 2012 (r240126) @@ -344,7 +344,7 @@ static void pmap_update_pde_invalidate(v static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t _pmap_allocpte(pmap_t pmap, u_int ptepindex, int flags); -static int _pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m, vm_page_t *free); +static void _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free); static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offset_t va); static void pmap_pte_release(pt_entry_t *pte); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t *); @@ -1672,22 +1672,25 @@ pmap_remove_pt_page(pmap_t pmap, vm_page } /* - * This routine unholds page table pages, and if the hold count - * drops to zero, then it decrements the wire count. + * Decrements a page table page's wire count, which is used to record the + * number of valid page table entries within the page. If the wire count + * drops to zero, then the page table page is unmapped. Returns TRUE if the + * page table page was unmapped and FALSE otherwise. */ -static __inline int -pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m, vm_page_t *free) +static inline boolean_t +pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free) { --m->wire_count; - if (m->wire_count == 0) - return (_pmap_unwire_pte_hold(pmap, m, free)); - else - return (0); + if (m->wire_count == 0) { + _pmap_unwire_ptp(pmap, m, free); + return (TRUE); + } else + return (FALSE); } -static int -_pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m, vm_page_t *free) +static void +_pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free) { vm_offset_t pteva; @@ -1716,8 +1719,6 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_pa * *ALL* TLB shootdown is done */ pmap_add_delayed_free_list(m, free, TRUE); - - return (1); } /* @@ -1734,7 +1735,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return (0); ptepde = *pmap_pde(pmap, va); mpte = PHYS_TO_VM_PAGE(ptepde & PG_FRAME); - return (pmap_unwire_pte_hold(pmap, mpte, free)); + return (pmap_unwire_ptp(pmap, mpte, free)); } /* @@ -3819,7 +3820,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ !pmap_try_insert_pv_entry(pmap, va, m)) { if (mpte != NULL) { free = NULL; - if (pmap_unwire_pte_hold(pmap, mpte, &free)) { + if (pmap_unwire_ptp(pmap, mpte, &free)) { pmap_invalidate_page(pmap, va); pmap_free_zero_pages(free); } @@ -4088,8 +4089,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dst_pmap->pm_stats.resident_count++; } else { free = NULL; - if (pmap_unwire_pte_hold(dst_pmap, - dstmpte, &free)) { + if (pmap_unwire_ptp(dst_pmap, dstmpte, + &free)) { pmap_invalidate_page(dst_pmap, addr); pmap_free_zero_pages(free); Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Wed Sep 5 04:50:20 2012 (r240125) +++ head/sys/i386/xen/pmap.c Wed Sep 5 06:02:54 2012 (r240126) @@ -300,7 +300,7 @@ static boolean_t pmap_try_insert_pv_entr static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t _pmap_allocpte(pmap_t pmap, u_int ptepindex, int flags); -static int _pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m, vm_page_t *free); +static void _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free); static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offset_t va); static void pmap_pte_release(pt_entry_t *pte); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t *); @@ -1333,22 +1333,25 @@ pmap_free_zero_pages(vm_page_t free) } /* - * This routine unholds page table pages, and if the hold count - * drops to zero, then it decrements the wire count. + * Decrements a page table page's wire count, which is used to record the + * number of valid page table entries within the page. If the wire count + * drops to zero, then the page table page is unmapped. Returns TRUE if the + * page table page was unmapped and FALSE otherwise. */ -static __inline int -pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m, vm_page_t *free) +static inline boolean_t +pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free) { --m->wire_count; - if (m->wire_count == 0) - return (_pmap_unwire_pte_hold(pmap, m, free)); - else - return (0); + if (m->wire_count == 0) { + _pmap_unwire_ptp(pmap, m, free); + return (TRUE); + } else + return (FALSE); } -static int -_pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m, vm_page_t *free) +static void +_pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free) { vm_offset_t pteva; @@ -1384,8 +1387,6 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_pa */ m->right = *free; *free = m; - - return (1); } /* @@ -1402,7 +1403,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return (0); ptepde = PT_GET(pmap_pde(pmap, va)); mpte = PHYS_TO_VM_PAGE(ptepde & PG_FRAME); - return (pmap_unwire_pte_hold(pmap, mpte, free)); + return (pmap_unwire_ptp(pmap, mpte, free)); } /* @@ -3015,7 +3016,7 @@ pmap_enter_quick_locked(multicall_entry_ !pmap_try_insert_pv_entry(pmap, va, m)) { if (mpte != NULL) { free = NULL; - if (pmap_unwire_pte_hold(pmap, mpte, &free)) { + if (pmap_unwire_ptp(pmap, mpte, &free)) { pmap_invalidate_page(pmap, va); pmap_free_zero_pages(free); } @@ -3294,8 +3295,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm dst_pmap->pm_stats.resident_count++; } else { free = NULL; - if (pmap_unwire_pte_hold(dst_pmap, - dstmpte, &free)) { + if (pmap_unwire_ptp(dst_pmap, dstmpte, + &free)) { pmap_invalidate_page(dst_pmap, addr); pmap_free_zero_pages(free); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Sep 5 04:50:20 2012 (r240125) +++ head/sys/mips/mips/pmap.c Wed Sep 5 06:02:54 2012 (r240126) @@ -190,7 +190,7 @@ static boolean_t pmap_try_insert_pv_entr static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte); static void pmap_invalidate_all(pmap_t pmap); static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va); -static int _pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m); +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags); @@ -928,29 +928,26 @@ pmap_qremove(vm_offset_t va, int count) * Page table page management routines..... ***************************************************/ -/* Revision 1.507 - * - * Simplify the reference counting of page table pages. Specifically, use - * the page table page's wired count rather than its hold count to contain - * the reference count. - */ - /* - * This routine unholds page table pages, and if the hold count - * drops to zero, then it decrements the wire count. + * Decrements a page table page's wire count, which is used to record the + * number of valid page table entries within the page. If the wire count + * drops to zero, then the page table page is unmapped. Returns TRUE if the + * page table page was unmapped and FALSE otherwise. */ -static PMAP_INLINE int -pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m) +static PMAP_INLINE boolean_t +pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m) { + --m->wire_count; - if (m->wire_count == 0) - return (_pmap_unwire_pte_hold(pmap, va, m)); - else - return (0); + if (m->wire_count == 0) { + _pmap_unwire_ptp(pmap, va, m); + return (TRUE); + } else + return (FALSE); } -static int -_pmap_unwire_pte_hold(pmap_t pmap, vm_offset_t va, vm_page_t m) +static void +_pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m) { pd_entry_t *pde; @@ -979,7 +976,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of */ pdp = (pd_entry_t *)*pmap_segmap(pmap, va); pdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(pdp)); - pmap_unwire_pte_hold(pmap, va, pdpg); + pmap_unwire_ptp(pmap, va, pdpg); } #endif @@ -988,7 +985,6 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of */ vm_page_free_zero(m); atomic_subtract_int(&cnt.v_wire_count, 1); - return (1); } /* @@ -1004,7 +1000,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return (0); KASSERT(pde != 0, ("pmap_unuse_pt: pde != 0")); mpte = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(pde)); - return (pmap_unwire_pte_hold(pmap, va, mpte)); + return (pmap_unwire_ptp(pmap, va, mpte)); } void @@ -2227,7 +2223,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, mpte, va, m)) { if (mpte != NULL) { - pmap_unwire_pte_hold(pmap, va, mpte); + pmap_unwire_ptp(pmap, va, mpte); mpte = NULL; } return (mpte); From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 06:49:58 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFA51065673; Wed, 5 Sep 2012 06:49:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id DD6F48FC12; Wed, 5 Sep 2012 06:49:56 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA13029; Wed, 05 Sep 2012 09:49:55 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1T99Qx-0002NK-2N; Wed, 05 Sep 2012 09:49:55 +0300 Message-ID: <5046F612.5090500@FreeBSD.org> Date: Wed, 05 Sep 2012 09:49:54 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120901 Thunderbird/15.0 MIME-Version: 1.0 To: John Baldwin References: <201208222002.q7MK2gVY089435@svn.freebsd.org> In-Reply-To: <201208222002.q7MK2gVY089435@svn.freebsd.org> X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r239587 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 06:49:58 -0000 on 22/08/2012 23:02 John Baldwin said the following: > Author: jhb > Date: Wed Aug 22 20:02:42 2012 > New Revision: 239587 > URL: http://svn.freebsd.org/changeset/base/239587 > > Log: > Assert that system calls do not leak a pinned thread (via sched_pin()) to > userland. > > Modified: > head/sys/kern/subr_syscall.c > > Modified: head/sys/kern/subr_syscall.c > ============================================================================== > --- head/sys/kern/subr_syscall.c Wed Aug 22 20:01:57 2012 (r239586) > +++ head/sys/kern/subr_syscall.c Wed Aug 22 20:02:42 2012 (r239587) > @@ -188,6 +188,9 @@ syscallret(struct thread *td, int error, I wonder if userret() would be a better place for this assert as well as the asserts that were already there. userret seems to cover more cases and includes the syscallret case. > KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, > ("System call %s returning with sleep disabled", > syscallname(p, sa->code))); > + KASSERT(td->td_pinned == 0, > + ("System call %s returning with pinned thread", > + syscallname(p, sa->code))); > > /* > * Handle reschedule and other end-of-syscall issues > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 06:51:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DCBA1065670; Wed, 5 Sep 2012 06:51:29 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08F858FC15; Wed, 5 Sep 2012 06:51: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 q856pSIg090890; Wed, 5 Sep 2012 06:51:28 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q856pSNB090888; Wed, 5 Sep 2012 06:51:28 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <201209050651.q856pSNB090888@svn.freebsd.org> From: Mike Silbersack Date: Wed, 5 Sep 2012 06:51: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: r240128 - head/sys/dev/bxe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 06:51:29 -0000 Author: silby Date: Wed Sep 5 06:51:28 2012 New Revision: 240128 URL: http://svn.freebsd.org/changeset/base/240128 Log: Only stop the BXE controller if it was first started. Stopping an uninitialized controller can cause IPMI bus errors on some systems. Reviewed by: yongari Obtained from: McAfee, Inc. MFC after: 2 weeks Modified: head/sys/dev/bxe/if_bxe.c Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Wed Sep 5 06:15:15 2012 (r240127) +++ head/sys/dev/bxe/if_bxe.c Wed Sep 5 06:51:28 2012 (r240128) @@ -3554,8 +3554,14 @@ bxe_shutdown(device_t dev) sc = device_get_softc(dev); DBENTER(BXE_INFO_LOAD | BXE_INFO_RESET | BXE_INFO_UNLOAD); + /* Stop the controller, but only if it was ever started. + * Stopping an uninitialized controller can cause + * IPMI bus errors on some systems. + */ BXE_CORE_LOCK(sc); - bxe_stop_locked(sc, UNLOAD_NORMAL); + if (sc->state != BXE_STATE_CLOSED) { + bxe_stop_locked(sc, UNLOAD_NORMAL); + } BXE_CORE_UNLOCK(sc); DBEXIT(BXE_INFO_LOAD | BXE_INFO_RESET | BXE_INFO_UNLOAD); From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 11:55:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 015A5106564A; Wed, 5 Sep 2012 11:55: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 E0A148FC17; Wed, 5 Sep 2012 11:55: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 q85Btrwd032890; Wed, 5 Sep 2012 11:55:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85Btrd0032888; Wed, 5 Sep 2012 11:55:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209051155.q85Btrd0032888@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Sep 2012 11:55: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: r240132 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 11:55:54 -0000 Author: jhb Date: Wed Sep 5 11:55:53 2012 New Revision: 240132 URL: http://svn.freebsd.org/changeset/base/240132 Log: When WIFCONTINUED was added, the number of "first" macros grew from three to four. MFC after: 1 week Modified: head/lib/libc/sys/wait.2 Modified: head/lib/libc/sys/wait.2 ============================================================================== --- head/lib/libc/sys/wait.2 Wed Sep 5 09:02:18 2012 (r240131) +++ head/lib/libc/sys/wait.2 Wed Sep 5 11:55:53 2012 (r240132) @@ -177,7 +177,7 @@ with a value of -1. .Pp The following macros may be used to test the manner of exit of the process. -One of the first three macros will evaluate to a non-zero (true) value: +One of the first four macros will evaluate to a non-zero (true) value: .Bl -tag -width Ds .It Fn WIFCONTINUED status True if the process has not terminated, and From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 12:02:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED086106567B; Wed, 5 Sep 2012 12:02:09 +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 D373B8FC23; Wed, 5 Sep 2012 12:02: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 q85C29oF033821; Wed, 5 Sep 2012 12:02:09 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85C29Wj033805; Wed, 5 Sep 2012 12:02:09 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201209051202.q85C29Wj033805@svn.freebsd.org> From: Martin Matuska Date: Wed, 5 Sep 2012 12:02: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: r240133 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 12:02:10 -0000 Author: mm Date: Wed Sep 5 12:02:09 2012 New Revision: 240133 URL: http://svn.freebsd.org/changeset/base/240133 Log: Merge recent vendor changes and sync code: 1862 incremental zfs receive fails for sparse file > 8PB 3112 ztest does not honor ZFS_DEBUG 3122 zfs destroy filesystem should prefetch blocks 3129 'zpool reopen' restarts resilvers 3130 ztest failure: Assertion failed: 0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10) References: https://www.illumos.org/issues/1862 https://www.illumos.org/issues/3112 https://www.illumos.org/issues/3122 https://www.illumos.org/issues/3129 https://www.illumos.org/issues/3130 Obtained from: illumos (vendor/illumos, vendor/illumos-sys) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Wed Sep 5 12:02:09 2012 (r240133) @@ -5862,6 +5862,8 @@ main(int argc, char **argv) (void) setvbuf(stdout, NULL, _IOLBF, 0); + dprintf_setup(&argc, argv); + if (!ischild) { process_options(argc, argv); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Sep 5 12:02:09 2012 (r240133) @@ -135,6 +135,14 @@ #include +#ifdef illumos +#ifndef _KERNEL +/* set with ZFS_DEBUG=watch, to enable watchpoints on frozen buffers */ +boolean_t arc_watch = B_FALSE; +int arc_procfd; +#endif +#endif /* illumos */ + static kmutex_t arc_reclaim_thr_lock; static kcondvar_t arc_reclaim_thr_cv; /* used to signal reclaim thr */ static uint8_t arc_thread_exit; @@ -534,6 +542,9 @@ static void arc_get_data_buf(arc_buf_t * static void arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock); static int arc_evict_needed(arc_buf_contents_t type); static void arc_evict_ghost(arc_state_t *state, uint64_t spa, int64_t bytes); +#ifdef illumos +static void arc_buf_watch(arc_buf_t *buf); +#endif /* illumos */ static boolean_t l2arc_write_eligible(uint64_t spa_guid, arc_buf_hdr_t *ab); @@ -1069,8 +1080,56 @@ arc_cksum_compute(arc_buf_t *buf, boolea fletcher_2_native(buf->b_data, buf->b_hdr->b_size, buf->b_hdr->b_freeze_cksum); mutex_exit(&buf->b_hdr->b_freeze_lock); +#ifdef illumos + arc_buf_watch(buf); +#endif /* illumos */ +} + +#ifdef illumos +#ifndef _KERNEL +typedef struct procctl { + long cmd; + prwatch_t prwatch; +} procctl_t; +#endif + +/* ARGSUSED */ +static void +arc_buf_unwatch(arc_buf_t *buf) +{ +#ifndef _KERNEL + if (arc_watch) { + int result; + procctl_t ctl; + ctl.cmd = PCWATCH; + ctl.prwatch.pr_vaddr = (uintptr_t)buf->b_data; + ctl.prwatch.pr_size = 0; + ctl.prwatch.pr_wflags = 0; + result = write(arc_procfd, &ctl, sizeof (ctl)); + ASSERT3U(result, ==, sizeof (ctl)); + } +#endif } +/* ARGSUSED */ +static void +arc_buf_watch(arc_buf_t *buf) +{ +#ifndef _KERNEL + if (arc_watch) { + int result; + procctl_t ctl; + ctl.cmd = PCWATCH; + ctl.prwatch.pr_vaddr = (uintptr_t)buf->b_data; + ctl.prwatch.pr_size = buf->b_hdr->b_size; + ctl.prwatch.pr_wflags = WA_WRITE; + result = write(arc_procfd, &ctl, sizeof (ctl)); + ASSERT3U(result, ==, sizeof (ctl)); + } +#endif +} +#endif /* illumos */ + void arc_buf_thaw(arc_buf_t *buf) { @@ -1095,6 +1154,10 @@ arc_buf_thaw(arc_buf_t *buf) } mutex_exit(&buf->b_hdr->b_freeze_lock); + +#ifdef illumos + arc_buf_unwatch(buf); +#endif /* illumos */ } void @@ -1112,6 +1175,7 @@ arc_buf_freeze(arc_buf_t *buf) buf->b_hdr->b_state == arc_anon); arc_cksum_compute(buf, B_FALSE); mutex_exit(hash_lock); + } static void @@ -1496,21 +1560,22 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta * the buffer is placed on l2arc_free_on_write to be freed later. */ static void -arc_buf_data_free(arc_buf_hdr_t *hdr, void (*free_func)(void *, size_t), - void *data, size_t size) +arc_buf_data_free(arc_buf_t *buf, void (*free_func)(void *, size_t)) { + arc_buf_hdr_t *hdr = buf->b_hdr; + if (HDR_L2_WRITING(hdr)) { l2arc_data_free_t *df; df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); - df->l2df_data = data; - df->l2df_size = size; + df->l2df_data = buf->b_data; + df->l2df_size = hdr->b_size; df->l2df_func = free_func; mutex_enter(&l2arc_free_on_write_mtx); list_insert_head(l2arc_free_on_write, df); mutex_exit(&l2arc_free_on_write_mtx); ARCSTAT_BUMP(arcstat_l2_free_on_write); } else { - free_func(data, size); + free_func(buf->b_data, hdr->b_size); } } @@ -1526,16 +1591,17 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ arc_buf_contents_t type = buf->b_hdr->b_type; arc_cksum_verify(buf); +#ifdef illumos + arc_buf_unwatch(buf); +#endif /* illumos */ if (!recycle) { if (type == ARC_BUFC_METADATA) { - arc_buf_data_free(buf->b_hdr, zio_buf_free, - buf->b_data, size); + arc_buf_data_free(buf, zio_buf_free); arc_space_return(size, ARC_SPACE_DATA); } else { ASSERT(type == ARC_BUFC_DATA); - arc_buf_data_free(buf->b_hdr, - zio_data_buf_free, buf->b_data, size); + arc_buf_data_free(buf, zio_data_buf_free); ARCSTAT_INCR(arcstat_data_size, -size); atomic_add_64(&arc_size, -size); } @@ -2803,6 +2869,9 @@ arc_read_done(zio_t *zio) } arc_cksum_compute(buf, B_FALSE); +#ifdef illumos + arc_buf_watch(buf); +#endif /* illumos */ if (hash_lock && zio->io_error == 0 && hdr->b_state == arc_anon) { /* @@ -3367,6 +3436,9 @@ arc_release(arc_buf_t *buf, void *tag) } hdr->b_datacnt -= 1; arc_cksum_verify(buf); +#ifdef illumos + arc_buf_unwatch(buf); +#endif /* illumos */ mutex_exit(hash_lock); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Wed Sep 5 12:02:09 2012 (r240133) @@ -189,7 +189,8 @@ bptree_iterate(objset_t *os, uint64_t ob break; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, + TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, bptree_visit_cb, &ba); if (free) { ASSERT(err == 0 || err == ERESTART); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Wed Sep 5 12:02:09 2012 (r240133) @@ -63,6 +63,8 @@ typedef struct traverse_data { static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, arc_buf_t *buf, uint64_t objset, uint64_t object); +static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *, + arc_buf_t *buf, uint64_t objset, uint64_t object); static int traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) @@ -178,9 +180,34 @@ traverse_pause(traverse_data_t *td, cons bcopy(zb, td->td_resume, sizeof (*td->td_resume)); } +static void +traverse_prefetch_metadata(traverse_data_t *td, + arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb) +{ + uint32_t flags = ARC_NOWAIT | ARC_PREFETCH; + + if (!(td->td_flags & TRAVERSE_PREFETCH_METADATA)) + return; + /* + * If we are in the process of resuming, don't prefetch, because + * some children will not be needed (and in fact may have already + * been freed). + */ + if (td->td_resume != NULL && !ZB_IS_ZERO(td->td_resume)) + return; + if (BP_IS_HOLE(bp) || bp->blk_birth <= td->td_min_txg) + return; + if (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE) + return; + + (void) arc_read(NULL, td->td_spa, bp, + pbuf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, + ZIO_FLAG_CANFAIL, &flags, zb); +} + static int traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp, - arc_buf_t *pbuf, blkptr_t *bp, const zbookmark_t *zb) + arc_buf_t *pbuf, const blkptr_t *bp, const zbookmark_t *zb) { zbookmark_t czb; int err = 0, lasterr = 0; @@ -243,14 +270,21 @@ traverse_visitbp(traverse_data_t *td, co ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); + cbp = buf->b_data; + + for (i = 0; i < epb; i++) { + SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, + zb->zb_level - 1, + zb->zb_blkid * epb + i); + traverse_prefetch_metadata(td, buf, &cbp[i], &czb); + } /* recursively visitbp() blocks below this */ - cbp = buf->b_data; - for (i = 0; i < epb; i++, cbp++) { + for (i = 0; i < epb; i++) { SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, zb->zb_level - 1, zb->zb_blkid * epb + i); - err = traverse_visitbp(td, dnp, buf, cbp, &czb); + err = traverse_visitbp(td, dnp, buf, &cbp[i], &czb); if (err) { if (!hard) break; @@ -267,11 +301,16 @@ traverse_visitbp(traverse_data_t *td, co ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); + dnp = buf->b_data; + + for (i = 0; i < epb; i++) { + prefetch_dnode_metadata(td, &dnp[i], buf, zb->zb_objset, + zb->zb_blkid * epb + i); + } /* recursively visitbp() blocks below this */ - dnp = buf->b_data; - for (i = 0; i < epb; i++, dnp++) { - err = traverse_dnode(td, dnp, buf, zb->zb_objset, + for (i = 0; i < epb; i++) { + err = traverse_dnode(td, &dnp[i], buf, zb->zb_objset, zb->zb_blkid * epb + i); if (err) { if (!hard) @@ -292,6 +331,15 @@ traverse_visitbp(traverse_data_t *td, co osp = buf->b_data; dnp = &osp->os_meta_dnode; + prefetch_dnode_metadata(td, dnp, buf, zb->zb_objset, + DMU_META_DNODE_OBJECT); + if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { + prefetch_dnode_metadata(td, &osp->os_userused_dnode, + buf, zb->zb_objset, DMU_USERUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + buf, zb->zb_objset, DMU_USERUSED_OBJECT); + } + err = traverse_dnode(td, dnp, buf, zb->zb_objset, DMU_META_DNODE_OBJECT); if (err && hard) { @@ -334,6 +382,24 @@ post: return (err != 0 ? err : lasterr); } +static void +prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp, + arc_buf_t *buf, uint64_t objset, uint64_t object) +{ + int j; + zbookmark_t czb; + + for (j = 0; j < dnp->dn_nblkptr; j++) { + SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); + traverse_prefetch_metadata(td, buf, &dnp->dn_blkptr[j], &czb); + } + + if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { + SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); + traverse_prefetch_metadata(td, buf, &dnp->dn_spill, &czb); + } +} + static int traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp, arc_buf_t *buf, uint64_t objset, uint64_t object) @@ -344,8 +410,7 @@ traverse_dnode(traverse_data_t *td, cons for (j = 0; j < dnp->dn_nblkptr; j++) { SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j); - err = traverse_visitbp(td, dnp, buf, - (blkptr_t *)&dnp->dn_blkptr[j], &czb); + err = traverse_visitbp(td, dnp, buf, &dnp->dn_blkptr[j], &czb); if (err) { if (!hard) break; @@ -354,10 +419,8 @@ traverse_dnode(traverse_data_t *td, cons } if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { - SET_BOOKMARK(&czb, objset, - object, 0, DMU_SPILL_BLKID); - err = traverse_visitbp(td, dnp, buf, - (blkptr_t *)&dnp->dn_spill, &czb); + SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); + err = traverse_visitbp(td, dnp, buf, &dnp->dn_spill, &czb); if (err) { if (!hard) return (err); @@ -438,6 +501,12 @@ traverse_impl(spa_t *spa, dsl_dataset_t ASSERT(ds == NULL || objset == ds->ds_object); ASSERT(!(flags & TRAVERSE_PRE) || !(flags & TRAVERSE_POST)); + /* + * The data prefetching mechanism (the prefetch thread) is incompatible + * with resuming from a bookmark. + */ + ASSERT(resume == NULL || !(flags & TRAVERSE_PREFETCH_DATA)); + td.td_spa = spa; td.td_objset = objset; td.td_rootbp = rootbp; @@ -464,7 +533,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t traverse_zil(&td, &os->os_zil_header); } - if (!(flags & TRAVERSE_PREFETCH) || + if (!(flags & TRAVERSE_PREFETCH_DATA) || 0 == taskq_dispatch(system_taskq, traverse_prefetch_thread, &td, TQ_NOQUEUE)) pd.pd_exited = B_TRUE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Sep 5 12:02:09 2012 (r240133) @@ -429,6 +429,7 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; spa_t *spa = txh->txh_tx->tx_pool->dp_spa; int epbs; + uint64_t l0span = 0, nl1blks = 0; if (dn->dn_nlevels == 0) return; @@ -461,6 +462,7 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui nblks = dn->dn_maxblkid - blkid; } + l0span = nblks; /* save for later use to calc level > 1 overhead */ if (dn->dn_nlevels == 1) { int i; for (i = 0; i < nblks; i++) { @@ -473,24 +475,10 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui } unref += BP_GET_ASIZE(bp); } + nl1blks = 1; nblks = 0; } - /* - * Add in memory requirements of higher-level indirects. - * This assumes a worst-possible scenario for dn_nlevels. - */ - { - uint64_t blkcnt = 1 + ((nblks >> epbs) >> epbs); - int level = (dn->dn_nlevels > 1) ? 2 : 1; - - while (level++ < DN_MAX_LEVELS) { - txh->txh_memory_tohold += blkcnt << dn->dn_indblkshift; - blkcnt = 1 + (blkcnt >> epbs); - } - ASSERT(blkcnt <= dn->dn_nblkptr); - } - lastblk = blkid + nblks - 1; while (nblks) { dmu_buf_impl_t *dbuf; @@ -561,11 +549,35 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui } dbuf_rele(dbuf, FTAG); + ++nl1blks; blkid += tochk; nblks -= tochk; } rw_exit(&dn->dn_struct_rwlock); + /* + * Add in memory requirements of higher-level indirects. + * This assumes a worst-possible scenario for dn_nlevels and a + * worst-possible distribution of l1-blocks over the region to free. + */ + { + uint64_t blkcnt = 1 + ((l0span >> epbs) >> epbs); + int level = 2; + /* + * Here we don't use DN_MAX_LEVEL, but calculate it with the + * given datablkshift and indblkshift. This makes the + * difference between 19 and 8 on large files. + */ + int maxlevel = 2 + (DN_MAX_OFFSET_SHIFT - dn->dn_datablkshift) / + (dn->dn_indblkshift - SPA_BLKPTRSHIFT); + + while (level++ < maxlevel) { + txh->txh_memory_tohold += MIN(blkcnt, (nl1blks >> epbs)) + << dn->dn_indblkshift; + blkcnt = 1 + (blkcnt >> epbs); + } + } + /* account for new level 1 indirect blocks that might show up */ if (skipped > 0) { txh->txh_fudge += skipped << dn->dn_indblkshift; 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 Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Sep 5 12:02:09 2012 (r240133) @@ -2343,7 +2343,6 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl } } } - ratio = ds->ds_phys->ds_compressed_bytes == 0 ? 100 : (ds->ds_phys->ds_uncompressed_bytes * 100 / ds->ds_phys->ds_compressed_bytes); 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 Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Wed Sep 5 12:02:09 2012 (r240133) @@ -462,12 +462,14 @@ dsl_dir_destroy_check(void *arg1, void * /* * There should be exactly two holds, both from * dsl_dataset_destroy: one on the dd directory, and one on its - * head ds. Otherwise, someone is trying to lookup something - * inside this dir while we want to destroy it. The - * config_rwlock ensures that nobody else opens it after we - * check. + * head ds. If there are more holds, then a concurrent thread is + * performing a lookup inside this dir while we're trying to destroy + * it. To minimize this possibility, we perform this check only + * in syncing context and fail the operation if we encounter + * additional holds. The dp_config_rwlock ensures that nobody else + * opens it after we check. */ - if (dmu_buf_refcount(dd->dd_dbuf) > 2) + if (dmu_tx_is_syncing(tx) && dmu_buf_refcount(dd->dd_dbuf) > 2) return (EBUSY); err = zap_count(mos, dd->dd_phys->dd_child_dir_zapobj, &count); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c Wed Sep 5 12:02:09 2012 (r240133) @@ -228,12 +228,7 @@ dsl_sync_task_do_nowait(dsl_pool_t *dp, dsl_checkfunc_t *checkfunc, dsl_syncfunc_t *syncfunc, void *arg1, void *arg2, int blocks_modified, dmu_tx_t *tx) { - dsl_sync_task_group_t *dstg; - - if (!spa_writeable(dp->dp_spa)) - return; - - dstg = dsl_sync_task_group_create(dp); + dsl_sync_task_group_t *dstg = dsl_sync_task_group_create(dp); dsl_sync_task_create(dstg, checkfunc, syncfunc, arg1, arg2, blocks_modified); dsl_sync_task_group_nowait(dstg, tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Wed Sep 5 12:02:09 2012 (r240133) @@ -306,6 +306,9 @@ spa_history_log(spa_t *spa, const char * ASSERT(what != LOG_INTERNAL); + if (spa_version(spa) < SPA_VERSION_ZPOOL_HISTORY || !spa_writeable(spa)) + return (EINVAL); + tx = dmu_tx_create_dd(spa_get_dsl(spa)->dp_mos_dir); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { @@ -435,8 +438,9 @@ log_internal(history_internal_events_t e /* * If this is part of creating a pool, not everything is * initialized yet, so don't bother logging the internal events. + * Likewise if the pool is not writeable. */ - if (tx->tx_txg == TXG_INITIAL) + if (tx->tx_txg == TXG_INITIAL || !spa_writeable(spa)) return; va_copy(adx2, adx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Wed Sep 5 12:02:09 2012 (r240133) @@ -1604,6 +1604,19 @@ spa_init(int mode) spa_mode_global = mode; +#ifdef illumos +#ifndef _KERNEL + if (spa_mode_global != FREAD && dprintf_find_string("watch")) { + arc_procfd = open("/proc/self/ctl", O_WRONLY); + if (arc_procfd == -1) { + perror("could not enable watchpoints: " + "opening /proc/self/ctl failed: "); + } else { + arc_watch = B_TRUE; + } + } +#endif +#endif /* illumos */ refcount_sysinit(); unique_init(); zio_init(); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Wed Sep 5 12:02:09 2012 (r240133) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_ARC_H @@ -135,6 +136,13 @@ void l2arc_fini(void); void l2arc_start(void); void l2arc_stop(void); +#ifdef illumos +#ifndef _KERNEL +extern boolean_t arc_watch; +extern int arc_procfd; +#endif +#endif /* illumos */ + #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed Sep 5 12:02:09 2012 (r240133) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DNODE_H @@ -276,7 +277,6 @@ void dnode_byteswap(dnode_phys_t *dnp); void dnode_buf_byteswap(void *buf, size_t size); void dnode_verify(dnode_t *dn); int dnode_set_blksz(dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx); -uint64_t dnode_current_max_length(dnode_t *dn); void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx); void dnode_clear_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Wed Sep 5 12:02:09 2012 (r240133) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_ZFS_DEBUG_H @@ -75,6 +76,12 @@ extern void zfs_dbgmsg_init(void); extern void zfs_dbgmsg_fini(void); extern void zfs_dbgmsg(const char *fmt, ...); +#ifdef illumos +#ifndef _KERNEL +extern int dprintf_find_string(const char *string); +#endif +#endif /* illumos */ + #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Sep 5 12:02:09 2012 (r240133) @@ -4149,7 +4149,17 @@ zfs_ioc_pool_reopen(zfs_cmd_t *zc) return (error); spa_vdev_state_enter(spa, SCL_NONE); + + /* + * If a resilver is already in progress then set the + * spa_scrub_reopen flag to B_TRUE so that we don't restart + * the scan as a side effect of the reopen. Otherwise, let + * vdev_open() decided if a resilver is required. + */ + spa->spa_scrub_reopen = dsl_scan_resilvering(spa->spa_dsl_pool); vdev_reopen(spa->spa_root_vdev); + spa->spa_scrub_reopen = B_FALSE; + (void) spa_vdev_state_exit(spa, NULL, 0); spa_close(spa, FTAG); return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Sep 5 11:55:53 2012 (r240132) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Sep 5 12:02:09 2012 (r240133) @@ -130,11 +130,23 @@ zio_init(void) while (p2 & (p2 - 1)) p2 &= p2 - 1; +#ifdef illumos +#ifndef _KERNEL + /* + * If we are using watchpoints, put each buffer on its own page, + * to eliminate the performance overhead of trapping to the + * kernel when modifying a non-watched buffer that shares the + * page with a watched buffer. + */ + if (arc_watch && !IS_P2ALIGNED(size, PAGESIZE)) + continue; +#endif +#endif /* illumos */ if (size <= 4 * SPA_MINBLOCKSIZE) { align = SPA_MINBLOCKSIZE; - } else if (P2PHASE(size, PAGESIZE) == 0) { + } else if (IS_P2ALIGNED(size, PAGESIZE)) { align = PAGESIZE; - } else if (P2PHASE(size, p2 >> 2) == 0) { + } else if (IS_P2ALIGNED(size, p2 >> 2)) { align = p2 >> 2; } From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 12:24:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C425D1065670; Wed, 5 Sep 2012 12:24:50 +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 ADA7F8FC16; Wed, 5 Sep 2012 12:24: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 q85COoKi036888; Wed, 5 Sep 2012 12:24:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85COoO8036886; Wed, 5 Sep 2012 12:24:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209051224.q85COoO8036886@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 5 Sep 2012 12:24: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: r240134 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 12:24:50 -0000 Author: des Date: Wed Sep 5 12:24:50 2012 New Revision: 240134 URL: http://svn.freebsd.org/changeset/base/240134 Log: Whitespace cleanup. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Sep 5 12:02:09 2012 (r240133) +++ head/sys/vm/swap_pager.c Wed Sep 5 12:24:50 2012 (r240134) @@ -50,7 +50,7 @@ * * - on the fly reallocation of swap during putpages. The new system * does not try to keep previously allocated swap blocks for dirty - * pages. + * pages. * * - on the fly deallocation of swap * @@ -154,13 +154,13 @@ int swap_pager_avail; static int swdev_syscall_active = 0; /* serialize swap(on|off) */ static vm_ooffset_t swap_total; -SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, +SYSCTL_QUAD(_vm, OID_AUTO, swap_total, CTLFLAG_RD, &swap_total, 0, "Total amount of available swap storage."); static vm_ooffset_t swap_reserved; -SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, +SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, "Amount of swap storage needed to back all allocated anonymous memory."); static int overcommit = 0; -SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, +SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, "Configure virtual memory overcommit behavior. See tuning(7) " "for details."); @@ -184,7 +184,7 @@ swap_reserve_by_cred(vm_ooffset_t incr, static int curfail; static struct timeval lastfail; struct uidinfo *uip; - + uip = cred->cr_ruidinfo; if (incr & PAGE_MASK) @@ -285,7 +285,7 @@ void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) { struct uidinfo *uip; - + uip = cred->cr_ruidinfo; if (decr & PAGE_MASK) @@ -328,7 +328,7 @@ static struct sx sw_alloc_sx; SYSCTL_INT(_vm, OID_AUTO, swap_async_max, - CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); + CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); /* * "named" and "unnamed" anon region objects. Try to reduce the overhead @@ -340,7 +340,7 @@ SYSCTL_INT(_vm, OID_AUTO, swap_async_max #define NOBJLIST(handle) \ (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) -static struct mtx sw_alloc_mtx; /* protect list manipulation */ +static struct mtx sw_alloc_mtx; /* protect list manipulation */ static struct pagerlst swap_pager_object_list[NOBJLISTS]; static uma_zone_t swap_zone; static struct vm_object swap_zone_obj; @@ -419,7 +419,7 @@ swp_pager_free_nrpage(vm_page_t m) /* * SWP_SIZECHECK() - update swap_pager_full indication - * + * * update the swap_pager_almost_full indication and warn when we are * about to run out of swap space, using lowat/hiwat hysteresis. * @@ -474,7 +474,7 @@ swp_pager_hash(vm_object_t object, vm_pi /* * SWAP_PAGER_INIT() - initialize the swap pager! * - * Expected to be started from system init. NOTE: This code is run + * Expected to be started from system init. NOTE: This code is run * before much else so be careful what you depend on. Most of the VM * system has yet to be initialized at this point. */ @@ -519,7 +519,7 @@ swap_pager_swap_init(void) * MAX_PAGEOUT_CLUSTER. Also be aware that swap ops are * constrained by the swap device interleave stripe size. * - * Currently we hardwire nsw_wcount_async to 4. This limit is + * Currently we hardwire nsw_wcount_async to 4. This limit is * designed to prevent other I/O from having high latencies due to * our pageout I/O. The value 4 works well for one or two active swap * devices but is probably a little low if you have more. Even so, @@ -568,7 +568,7 @@ swap_pager_swap_init(void) /* * Initialize our meta-data hash table. The swapper does not need to - * be quite as efficient as the VM system, so we do not use an + * be quite as efficient as the VM system, so we do not use an * oversized hash table. * * n: size of hash table, must be power of 2 @@ -654,7 +654,7 @@ swap_pager_alloc(void *handle, vm_ooffse /* * SWAP_PAGER_DEALLOC() - remove swap metadata from object * - * The swap backing for the object is destroyed. The code is + * The swap backing for the object is destroyed. The code is * designed such that we can reinstantiate it later, but this * routine is typically called only when the entire object is * about to be destroyed. @@ -679,7 +679,7 @@ swap_pager_dealloc(vm_object_t object) vm_object_pip_wait(object, "swpdea"); /* - * Free all remaining metadata. We only bother to free it from + * Free all remaining metadata. We only bother to free it from * the swap meta data. We do not attempt to free swapblk's still * associated with vm_page_t's for this object. We do not care * if paging is still in progress on some objects. @@ -748,7 +748,7 @@ swp_pager_isondev(daddr_t blk, struct sw return (blk >= sp->sw_first && blk < sp->sw_end); } - + static void swp_pager_strategy(struct buf *bp) { @@ -764,10 +764,10 @@ swp_pager_strategy(struct buf *bp) } panic("Swapdev not found"); } - + /* - * SWP_PAGER_FREESWAPSPACE() - free raw swap space + * SWP_PAGER_FREESWAPSPACE() - free raw swap space * * This routine returns the specified swap blocks back to the bitmap. * @@ -785,7 +785,7 @@ swp_pager_freeswapspace(daddr_t blk, int /* * If we are attempting to stop swapping on * this device, we don't want to mark any - * blocks free lest they be reused. + * blocks free lest they be reused. */ if ((sp->sw_flags & SW_CLOSING) == 0) { blist_free(sp->sw_blist, blk - sp->sw_first, @@ -808,8 +808,8 @@ swp_pager_freeswapspace(daddr_t blk, int * * This routine removes swapblk assignments from swap metadata. * - * The external callers of this routine typically have already destroyed - * or renamed vm_page_t's associated with this range in the object so + * The external callers of this routine typically have already destroyed + * or renamed vm_page_t's associated with this range in the object so * we should be ok. */ void @@ -823,7 +823,7 @@ swap_pager_freespace(vm_object_t object, /* * SWAP_PAGER_RESERVE() - reserve swap blocks in object * - * Assigns swap blocks to the specified range within the object. The + * Assigns swap blocks to the specified range within the object. The * swap blocks are not zerod. Any previous swap assignment is destroyed. * * Returns 0 on success, -1 on failure. @@ -869,7 +869,7 @@ swap_pager_reserve(vm_object_t object, v * * This routine is allowed to sleep. It may sleep allocating metadata * indirectly through swp_pager_meta_build() or if paging is still in - * progress on the source. + * progress on the source. * * The source object contains no vm_page_t's (which is just as well) * @@ -888,8 +888,8 @@ swap_pager_copy(vm_object_t srcobject, v VM_OBJECT_LOCK_ASSERT(dstobject, MA_OWNED); /* - * If destroysource is set, we remove the source object from the - * swap_pager internal queue now. + * If destroysource is set, we remove the source object from the + * swap_pager internal queue now. */ if (destroysource) { if (srcobject->handle != NULL) { @@ -925,7 +925,7 @@ swap_pager_copy(vm_object_t srcobject, v daddr_t srcaddr; srcaddr = swp_pager_meta_ctl( - srcobject, + srcobject, i + offset, SWM_POP ); @@ -947,7 +947,7 @@ swap_pager_copy(vm_object_t srcobject, v * Destination has valid swapblk or it is represented * by a resident page. We destroy the sourceblock. */ - + swp_pager_meta_ctl(srcobject, i + offset, SWM_FREE); } } @@ -1042,7 +1042,7 @@ swap_pager_haspage(vm_object_t object, v * SWAP_PAGER_PAGE_UNSWAPPED() - remove swap backing store related to page * * This removes any associated swap backing store, whether valid or - * not, from the page. + * not, from the page. * * This routine is typically called when a page is made dirty, at * which point any associated swap can be freed. MADV_FREE also @@ -1071,7 +1071,7 @@ swap_pager_unswapped(vm_page_t m) * a chunk surrounding m[reqpage] as is contiguous in swap and which * belongs to the same object. * - * The code is designed for asynchronous operation and + * The code is designed for asynchronous operation and * immediate-notification of 'reqpage' but tends not to be * used that way. Please do not optimize-out this algorithmic * feature, I intend to improve on it in the future. @@ -1101,7 +1101,7 @@ swap_pager_getpages(vm_object_t object, * Calculate range to retrieve. The pages have already been assigned * their swapblks. We require a *contiguous* range but we know it to * not span devices. If we do not supply it, bad things - * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the + * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the * loops are set up such that the case(s) are handled implicitly. * * The swp_*() calls must be made with the object locked. @@ -1139,7 +1139,7 @@ swap_pager_getpages(vm_object_t object, } /* - * Return VM_PAGER_FAIL if we have nothing to do. Return mreq + * Return VM_PAGER_FAIL if we have nothing to do. Return mreq * still busy, but the others unbusied. */ if (blk == SWAPBLK_NONE) @@ -1234,21 +1234,21 @@ swap_pager_getpages(vm_object_t object, /* * A final note: in a low swap situation, we cannot deallocate swap * and mark a page dirty here because the caller is likely to mark - * the page clean when we return, causing the page to possibly revert + * the page clean when we return, causing the page to possibly revert * to all-zero's later. */ } /* - * swap_pager_putpages: + * swap_pager_putpages: * * Assign swap (if necessary) and initiate I/O on the specified pages. * * We support both OBJT_DEFAULT and OBJT_SWAP objects. DEFAULT objects * are automatically converted to SWAP objects. * - * In a low memory situation we may block in VOP_STRATEGY(), but the new - * vm_page reservation system coupled with properly written VFS devices + * In a low memory situation we may block in VOP_STRATEGY(), but the new + * vm_page reservation system coupled with properly written VFS devices * should ensure that no low-memory deadlock occurs. This is an area * which needs work. * @@ -1269,8 +1269,8 @@ swap_pager_putpages(vm_object_t object, int n = 0; if (count && m[0]->object != object) { - panic("swap_pager_putpages: object mismatch %p/%p", - object, + panic("swap_pager_putpages: object mismatch %p/%p", + object, m[0]->object ); } @@ -1292,7 +1292,7 @@ swap_pager_putpages(vm_object_t object, /* * Step 2 * - * Update nsw parameters from swap_async_max sysctl values. + * Update nsw parameters from swap_async_max sysctl values. * Do not let the sysop crash the machine with bogus numbers. */ mtx_lock(&pbuf_mtx); @@ -1384,7 +1384,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t mreq = m[i+j]; swp_pager_meta_build( - mreq->object, + mreq->object, mreq->pindex, blk + j ); @@ -1453,10 +1453,10 @@ swap_pager_putpages(vm_object_t object, * Completion routine for asynchronous reads and writes from/to swap. * Also called manually by synchronous code to finish up a bp. * - * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, - * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY - * unbusy all pages except the 'main' request page. For WRITE - * operations, we vm_page_t->busy'd unbusy all pages ( we can do this + * For READ operations, the pages are VPO_BUSY'd. For WRITE operations, + * the pages are vm_page_t->busy'd. For READ operations, we VPO_BUSY + * unbusy all pages except the 'main' request page. For WRITE + * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). * * This routine may not sleep. @@ -1475,7 +1475,7 @@ swp_pager_async_iodone(struct buf *bp) "swap_pager: I/O error - %s failed; blkno %ld," "size %ld, error %d\n", ((bp->b_iocmd == BIO_READ) ? "pagein" : "pageout"), - (long)bp->b_blkno, + (long)bp->b_blkno, (long)bp->b_bcount, bp->b_error ); @@ -1495,7 +1495,7 @@ swp_pager_async_iodone(struct buf *bp) * cleanup pages. If an error occurs writing to swap, we are in * very serious trouble. If it happens to be a disk error, though, * we may be able to recover by reassigning the swap later on. So - * in this case we remove the m->swapblk assignment for the page + * in this case we remove the m->swapblk assignment for the page * but do not free it in the rlist. The errornous block(s) are thus * never reallocated as swap. Redirty the page and continue. */ @@ -1508,7 +1508,7 @@ swp_pager_async_iodone(struct buf *bp) /* * If an error occurs I'd love to throw the swapblk * away without freeing it back to swapspace, so it - * can never be used again. But I can't from an + * can never be used again. But I can't from an * interrupt. */ if (bp->b_iocmd == BIO_READ) { @@ -1517,7 +1517,7 @@ swp_pager_async_iodone(struct buf *bp) * locked for the parent, but all other * pages can be freed. We still want to * wakeup the parent waiting on the page, - * though. ( also: pg_reqpage can be -1 and + * though. ( also: pg_reqpage can be -1 and * not match anything ). * * We have to wake specifically requested pages @@ -1534,7 +1534,7 @@ swp_pager_async_iodone(struct buf *bp) else vm_page_flash(m); /* - * If i == bp->b_pager.pg_reqpage, do not wake + * If i == bp->b_pager.pg_reqpage, do not wake * the page up. The caller needs to. */ } else { @@ -1551,7 +1551,7 @@ swp_pager_async_iodone(struct buf *bp) } } else if (bp->b_iocmd == BIO_READ) { /* - * NOTE: for reads, m->dirty will probably be + * NOTE: for reads, m->dirty will probably be * overridden by the original caller of getpages so * we cannot set them in order to free the underlying * swap in a low-swap situation. I don't think we'd @@ -1563,7 +1563,7 @@ swp_pager_async_iodone(struct buf *bp) * * Note that the requested page, reqpage, is left * busied, but we still have to wake it up. The - * other pages are released (unbusied) by + * other pages are released (unbusied) by * vm_page_wakeup(). */ KASSERT(!pmap_page_is_mapped(m), @@ -1577,7 +1577,7 @@ swp_pager_async_iodone(struct buf *bp) * up too because we cleared VPO_SWAPINPROG and * could be waiting for it in getpages. However, * be sure to not unbusy getpages specifically - * requested page - getpages expects it to be + * requested page - getpages expects it to be * left busy. */ if (i != bp->b_pager.pg_reqpage) { @@ -1590,7 +1590,7 @@ swp_pager_async_iodone(struct buf *bp) } else { /* * For write success, clear the dirty - * status, then finish the I/O ( which decrements the + * status, then finish the I/O ( which decrements the * busy count and possibly wakes waiter's up ). */ KASSERT(!pmap_page_is_write_mapped(m), @@ -1615,8 +1615,8 @@ swp_pager_async_iodone(struct buf *bp) VM_OBJECT_UNLOCK(object); } - /* - * swapdev_strategy() manually sets b_vp and b_bufobj before calling + /* + * swapdev_strategy() manually sets b_vp and b_bufobj before calling * bstrategy(). Set them back to NULL now we're done with it, or we'll * trigger a KASSERT in relpbuf(). */ @@ -1628,10 +1628,10 @@ swp_pager_async_iodone(struct buf *bp) * release the physical I/O buffer */ relpbuf( - bp, - ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : - ((bp->b_flags & B_ASYNC) ? - &nsw_wcount_async : + bp, + ((bp->b_iocmd == BIO_READ) ? &nsw_rcount : + ((bp->b_flags & B_ASYNC) ? + &nsw_wcount_async : &nsw_wcount_sync ) ) @@ -1744,8 +1744,8 @@ restart: for (swap = swhash[i]; swap != NULL; swap = swap->swb_hnext) { vm_object_t object = swap->swb_object; vm_pindex_t pindex = swap->swb_index; - for (j = 0; j < SWAP_META_PAGES; ++j) { - if (swp_pager_isondev(swap->swb_pages[j], sp)) { + for (j = 0; j < SWAP_META_PAGES; ++j) { + if (swp_pager_isondev(swap->swb_pages[j], sp)) { /* avoid deadlock */ if (!VM_OBJECT_TRYLOCK(object)) { break; @@ -1758,7 +1758,7 @@ restart: goto restart; } } - } + } } } mtx_unlock(&swhash_mtx); @@ -1783,7 +1783,7 @@ restart: * SWAP META DATA * ************************************************************************ * - * These routines manipulate the swap metadata stored in the + * These routines manipulate the swap metadata stored in the * OBJT_SWAP object. * * Swap metadata is implemented with a global hash and not directly @@ -1821,13 +1821,13 @@ swp_pager_meta_build(vm_object_t object, mtx_lock(&sw_alloc_mtx); TAILQ_INSERT_TAIL( NOBJLIST(object->handle), - object, + object, pager_object_list ); mtx_unlock(&sw_alloc_mtx); } } - + /* * Locate hash entry. If not found create, but if we aren't adding * anything just return. If we run out of space in the map we wait @@ -1896,10 +1896,10 @@ done: /* * SWP_PAGER_META_FREE() - free a range of blocks in the object's swap metadata * - * The requested range of blocks is freed, with any associated swap + * The requested range of blocks is freed, with any associated swap * returned to the swap bitmap. * - * This routine will free swap metadata structures as they are cleaned + * This routine will free swap metadata structures as they are cleaned * out. This routine does *NOT* operate on swap metadata associated * with resident pages. */ @@ -1991,14 +1991,14 @@ swp_pager_meta_free_all(vm_object_t obje * swapblk assignments in the swap meta data or in the vm_page_t. * The routine typically returns the swapblk being looked-up, or popped, * or SWAPBLK_NONE if the block was freed, or SWAPBLK_NONE if the block - * was invalid. This routine will automatically free any invalid + * was invalid. This routine will automatically free any invalid * meta-data swapblks. * * It is not possible to store invalid swapblks in the swap meta data * (other then a literal 'SWAPBLK_NONE'), so we don't bother checking. * - * When acting on a busy resident page and paging is in progress, we - * have to wait until paging is complete but otherwise can act on the + * When acting on a busy resident page and paging is in progress, we + * have to wait until paging is complete but otherwise can act on the * busy page. * * SWM_FREE remove and free swap block from metadata @@ -2014,7 +2014,7 @@ swp_pager_meta_ctl(vm_object_t object, v VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); /* - * The meta data only exists of the object is OBJT_SWAP + * The meta data only exists of the object is OBJT_SWAP * and even then might not be allocated yet. */ if (object->type != OBJT_SWAP) @@ -2040,7 +2040,7 @@ swp_pager_meta_ctl(vm_object_t object, v uma_zfree(swap_zone, swap); --object->un_pager.swp.swp_bcount; } - } + } } } mtx_unlock(&swhash_mtx); @@ -2058,7 +2058,7 @@ struct swapon_args { }; #endif -/* +/* * MPSAFE */ /* ARGSUSED */ @@ -2153,7 +2153,7 @@ swaponsomething(struct vnode *vp, void * /* * nblks is in DEV_BSIZE'd chunks, convert to PAGE_SIZE'd chunks. * First chop nblks off to page-align it, then convert. - * + * * sw->sw_nblks is in page-sized chunks now too. */ nblks &= ~(ctodb(1) - 1); @@ -2342,12 +2342,12 @@ swapoff_all(void) struct swdevt *sp, *spt; const char *devname; int error; - + mtx_lock(&Giant); while (swdev_syscall_active) tsleep(&swdev_syscall_active, PUSER - 1, "swpoff", 0); swdev_syscall_active = 1; - + mtx_lock(&sw_dev_mtx); TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); @@ -2365,7 +2365,7 @@ swapoff_all(void) mtx_lock(&sw_dev_mtx); } mtx_unlock(&sw_dev_mtx); - + swdev_syscall_active = 0; wakeup_one(&swdev_syscall_active); mtx_unlock(&Giant); @@ -2709,7 +2709,7 @@ swaponvp(struct thread *td, struct vnode } } mtx_unlock(&sw_dev_mtx); - + (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_system_check_swapon(td->td_ucred, vp); From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 13:18:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4380B106566B; Wed, 5 Sep 2012 13:18: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 2CEF78FC0A; Wed, 5 Sep 2012 13:18: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 q85DIq7A044084; Wed, 5 Sep 2012 13:18:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85DIpRS044073; Wed, 5 Sep 2012 13:18:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209051318.q85DIpRS044073@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Sep 2012 13:18: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: r240135 - in head/sys: amd64/conf conf dev/random i386/conf modules/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 13:18:52 -0000 Author: kib Date: Wed Sep 5 13:18:51 2012 New Revision: 240135 URL: http://svn.freebsd.org/changeset/base/240135 Log: Add support for new Intel on-CPU Bull Mountain random number generator, found on IvyBridge and supposedly later CPUs, accessible with RDRAND instruction. From the Intel whitepapers and articles about Bull Mountain, it seems that we do not need to perform post-processing of RDRAND results, like AES-encryption of the data with random IV and keys, which was done for Padlock. Intel claims that sanitization is performed in hardware. Make both Padlock and Bull Mountain random generators support code covered by kernel config options, for the benefit of people who prefer minimal kernels. Also add the tunables to disable hardware generator even if detected. Reviewed by: markm, secteam (simon) Tested by: bapt, Michael Moll MFC after: 3 weeks Added: head/sys/dev/random/ivy.c (contents, props changed) Deleted: head/sys/dev/random/nehemiah.h Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/dev/random/nehemiah.c head/sys/dev/random/probe.c head/sys/i386/conf/GENERIC head/sys/modules/random/Makefile Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/amd64/conf/GENERIC Wed Sep 5 13:18:51 2012 (r240135) @@ -292,6 +292,8 @@ device wpi # Intel 3945ABG wireless NI # Pseudo devices. device loop # Network loopback device random # Entropy device +options PADLOCK_RNG # VIA Padlock RNG +options IVY_RNG # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/conf/files.amd64 Wed Sep 5 13:18:51 2012 (r240135) @@ -213,7 +213,8 @@ dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa -dev/random/nehemiah.c optional random +dev/random/ivy.c optional random ivy_rng +dev/random/nehemiah.c optional random padlock_rng dev/qlxgb/qla_dbg.c optional qlxgb pci dev/qlxgb/qla_hw.c optional qlxgb pci dev/qlxgb/qla_ioctl.c optional qlxgb pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/conf/files.i386 Wed Sep 5 13:18:51 2012 (r240135) @@ -226,7 +226,8 @@ dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf -dev/random/nehemiah.c optional random +dev/random/ivy.c optional random ivy_rng +dev/random/nehemiah.c optional random padlock_rng dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/conf/options.amd64 Wed Sep 5 13:18:51 2012 (r240135) @@ -68,3 +68,7 @@ XENHVM opt_global.h # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h + +# hw random number generators for random(4) +PADLOCK_RNG opt_cpu.h +IVY_RNG opt_cpu.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/conf/options.i386 Wed Sep 5 13:18:51 2012 (r240135) @@ -123,3 +123,7 @@ XENHVM opt_global.h # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h + +# hw random number generators for random(4) +PADLOCK_RNG opt_cpu.h +IVY_RNG opt_cpu.h Added: head/sys/dev/random/ivy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/ivy.c Wed Sep 5 13:18:51 2012 (r240135) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2012 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, this list of conditions and the following disclaimer + * in this position and unchanged. + * 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 "opt_cpu.h" + +#ifdef IVY_RNG + +#include +#include +#include +#include +#include +#include +#include + +#define RETRY_COUNT 10 + +static void random_ivy_init(void); +static void random_ivy_deinit(void); +static int random_ivy_read(void *, int); + +struct random_systat random_ivy = { + .ident = "Hardware, Intel IvyBridge+ RNG", + .init = random_ivy_init, + .deinit = random_ivy_deinit, + .read = random_ivy_read, + .write = (random_write_func_t *)random_null_func, + .reseed = (random_reseed_func_t *)random_null_func, + .seeded = 1, +}; + +static inline int +ivy_rng_store(long *tmp) +{ +#ifdef __GNUCLIKE_ASM + uint32_t count; + + __asm __volatile( +#ifdef __amd64__ + ".byte\t0x48,0x0f,0xc7,0xf0\n\t" /* rdrand %rax */ + "jnc\t1f\n\t" + "movq\t%%rax,%1\n\t" + "movl\t$8,%%eax\n" +#else /* i386 */ + ".byte\t0x0f,0xc7,0xf0\n\t" /* rdrand %eax */ + "jnc\t1f\n\t" + "movl\t%%eax,%1\n\t" + "movl\t$4,%%eax\n" +#endif + "1:\n" /* %eax is cleared by processor on failure */ + : "=a" (count), "=g" (*tmp) : "a" (0) : "cc"); + return (count); +#else /* __GNUCLIKE_ASM */ + return (0); +#endif +} + +static void +random_ivy_init(void) +{ +} + +void +random_ivy_deinit(void) +{ +} + +static int +random_ivy_read(void *buf, int c) +{ + char *b; + long tmp; + int count, res, retry; + + for (count = c, b = buf; count > 0; count -= res, b += res) { + for (retry = 0; retry < RETRY_COUNT; retry++) { + res = ivy_rng_store(&tmp); + if (res != 0) + break; + } + if (res == 0) + break; + if (res > count) + res = count; + memcpy(b, &tmp, res); + } + return (c - count); +} + +#endif Modified: head/sys/dev/random/nehemiah.c ============================================================================== --- head/sys/dev/random/nehemiah.c Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/dev/random/nehemiah.c Wed Sep 5 13:18:51 2012 (r240135) @@ -28,6 +28,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_cpu.h" + +#ifdef PADLOCK_RNG + #include #include #include @@ -203,3 +207,5 @@ random_nehemiah_read(void *buf, int c) mtx_unlock(&random_nehemiah_mtx); return (c); } + +#endif Modified: head/sys/dev/random/probe.c ============================================================================== --- head/sys/dev/random/probe.c Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/dev/random/probe.c Wed Sep 5 13:18:51 2012 (r240135) @@ -28,12 +28,17 @@ #include __FBSDID("$FreeBSD$"); +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) +#include "opt_cpu.h" +#endif + #include #include +#include +#include #include #include #include -#include #include #if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) @@ -45,7 +50,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include + +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) +#ifdef PADLOCK_RNG +extern struct random_systat random_nehemiah; +#endif +#ifdef IVY_RNG +extern struct random_systat random_ivy; +#endif +#endif void random_ident_hardware(struct random_systat *systat) @@ -56,8 +69,25 @@ random_ident_hardware(struct random_syst /* Then go looking for hardware */ #if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) +#ifdef PADLOCK_RNG if (via_feature_rng & VIA_HAS_RNG) { - *systat = random_nehemiah; + int enable; + + enable = 1; + TUNABLE_INT_FETCH("hw.nehemiah_rng_enable", &enable); + if (enable) + *systat = random_nehemiah; } #endif +#ifdef IVY_RNG + if (cpu_feature2 & CPUID2_RDRAND) { + int enable; + + enable = 1; + TUNABLE_INT_FETCH("hw.ivy_rng_enable", &enable); + if (enable) + *systat = random_ivy; + } +#endif +#endif } Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/i386/conf/GENERIC Wed Sep 5 13:18:51 2012 (r240135) @@ -305,6 +305,8 @@ device wpi # Intel 3945ABG wireless NI # Pseudo devices. device loop # Network loopback device random # Entropy device +options PADLOCK_RNG # VIA Padlock RNG +options IVY_RNG # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. Modified: head/sys/modules/random/Makefile ============================================================================== --- head/sys/modules/random/Makefile Wed Sep 5 12:24:50 2012 (r240134) +++ head/sys/modules/random/Makefile Wed Sep 5 13:18:51 2012 (r240135) @@ -8,10 +8,11 @@ KMOD= random SRCS= randomdev.c probe.c .if ${MACHINE} == "amd64" || ${MACHINE} == "i386" SRCS+= nehemiah.c +SRCS+= ivy.c .endif SRCS+= randomdev_soft.c yarrow.c hash.c SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c -SRCS+= bus_if.h device_if.h vnode_if.h +SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h CFLAGS+= -I${.CURDIR}/../.. From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 13:54:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB0F21065678; Wed, 5 Sep 2012 13:54:56 +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 B0B778FC08; Wed, 5 Sep 2012 13:54:56 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1FE12B95E; Wed, 5 Sep 2012 09:54:56 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Wed, 5 Sep 2012 08:07:32 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201209051155.q85Btrd0032888@svn.freebsd.org> In-Reply-To: <201209051155.q85Btrd0032888@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209050807.32344.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 05 Sep 2012 09:54:56 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240132 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 13:54:57 -0000 On Wednesday, September 05, 2012 7:55:53 am John Baldwin wrote: > Author: jhb > Date: Wed Sep 5 11:55:53 2012 > New Revision: 240132 > URL: http://svn.freebsd.org/changeset/base/240132 > > Log: > When WIFCONTINUED was added, the number of "first" macros grew from > three to four. FYI, by my reading the state used for to mark a continued process makes both WIFCONTINUED() and WIFSIGNALED() true. I think that is probably a bug, albeit harmless. We could fix it by explicitly excluding SIGCONT from WIFSIGNALED(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 13:54:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D07861065673; Wed, 5 Sep 2012 13:54:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id A2E028FC12; Wed, 5 Sep 2012 13:54:57 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0696BB972; Wed, 5 Sep 2012 09:54:57 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Wed, 5 Sep 2012 08:14:14 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208222002.q7MK2gVY089435@svn.freebsd.org> <5046F612.5090500@FreeBSD.org> In-Reply-To: <5046F612.5090500@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209050814.14578.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 05 Sep 2012 09:54:57 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239587 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 13:54:57 -0000 On Wednesday, September 05, 2012 2:49:54 am Andriy Gapon wrote: > on 22/08/2012 23:02 John Baldwin said the following: > > Author: jhb > > Date: Wed Aug 22 20:02:42 2012 > > New Revision: 239587 > > URL: http://svn.freebsd.org/changeset/base/239587 > > > > Log: > > Assert that system calls do not leak a pinned thread (via sched_pin()) to > > userland. > > > > Modified: > > head/sys/kern/subr_syscall.c > > > > Modified: head/sys/kern/subr_syscall.c > > ============================================================================== > > --- head/sys/kern/subr_syscall.c Wed Aug 22 20:01:57 2012 (r239586) > > +++ head/sys/kern/subr_syscall.c Wed Aug 22 20:02:42 2012 (r239587) > > @@ -188,6 +188,9 @@ syscallret(struct thread *td, int error, > > I wonder if userret() would be a better place for this assert as well as the > asserts that were already there. userret seems to cover more cases and includes > the syscallret case. The one caveat of moving this to userret() is that you lose detail in the panic message (i.e., the name of the system call that caused the problem). However, it would be perfectly logical to move this entire block of assertions to the bottom of userret() to catch any lock or other leaks from ast() or traps. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 14:31:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 696AE106566C; Wed, 5 Sep 2012 14:31:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49E548FC17; Wed, 5 Sep 2012 14:31: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 q85EVxsE053474; Wed, 5 Sep 2012 14:31:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85EVxqm053471; Wed, 5 Sep 2012 14:31:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209051431.q85EVxqm053471@svn.freebsd.org> From: John Baldwin Date: Wed, 5 Sep 2012 14:31: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: r240137 - head/sys/dev/twe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 14:31:59 -0000 Author: jhb Date: Wed Sep 5 14:31:58 2012 New Revision: 240137 URL: http://svn.freebsd.org/changeset/base/240137 Log: - Explicitly call twe_done() to poll the hardware when looping in twe_start() to simulate the behavior on 4.x where the driver dropped spl to allow interrupts to run to free up space in the command queue. Be careful to only poll if we are going to make at least one more attempt to queue the current command. Also, when polling, be careful to not call twe_startio() to queue more commands to avoid recursion. - Move the buffer for formatting AEN messages into the softc instead of using a single driver-wide static buffer. Requested by: scottl (1) Tested by: Mike Tancsa @ Sentex Modified: head/sys/dev/twe/twe.c head/sys/dev/twe/twevar.h Modified: head/sys/dev/twe/twe.c ============================================================================== --- head/sys/dev/twe/twe.c Wed Sep 5 13:51:36 2012 (r240136) +++ head/sys/dev/twe/twe.c Wed Sep 5 14:31:58 2012 (r240137) @@ -68,7 +68,7 @@ static int twe_del_unit(struct twe_softc /* * Command I/O to controller. */ -static void twe_done(struct twe_softc *sc); +static void twe_done(struct twe_softc *sc, int startio); static void twe_complete(struct twe_softc *sc); static int twe_wait_status(struct twe_softc *sc, u_int32_t status, int timeout); static int twe_drain_response_queue(struct twe_softc *sc); @@ -388,7 +388,7 @@ twe_intr(struct twe_softc *sc) if (status_reg & TWE_STATUS_COMMAND_INTERRUPT) twe_command_intr(sc); if (status_reg & TWE_STATUS_RESPONSE_INTERRUPT) - twe_done(sc); + twe_done(sc, 1); }; /******************************************************************************** @@ -996,7 +996,7 @@ twe_immediate_request(struct twe_request /* Wait up to 5 seconds for the command to complete */ while ((count++ < 5000) && (tr->tr_status == TWE_CMD_BUSY)){ DELAY(1000); - twe_done(sc); + twe_done(sc, 1); } if (usetmp && (tr->tr_data != NULL)) bcopy(sc->twe_immediate, tr->tr_data, tr->tr_length); @@ -1144,7 +1144,8 @@ twe_start(struct twe_request *tr) } #endif return(0); - } + } else if (!(status_reg & TWE_STATUS_RESPONSE_QUEUE_EMPTY) && i > 1) + twe_done(sc, 0); } /* @@ -1162,7 +1163,7 @@ twe_start(struct twe_request *tr) * Can be called at any interrupt level, with or without interrupts enabled. */ static void -twe_done(struct twe_softc *sc) +twe_done(struct twe_softc *sc, int startio) { TWE_Response_Queue rq; TWE_Command *cmd; @@ -1198,7 +1199,7 @@ twe_done(struct twe_softc *sc) } /* if we've completed any commands, try posting some more */ - if (found) + if (found && startio) twe_startio(sc); /* handle completion and timeouts */ @@ -1768,7 +1769,6 @@ twe_check_bits(struct twe_softc *sc, u_i static char * twe_format_aen(struct twe_softc *sc, u_int16_t aen) { - static char buf[80]; device_t child; char *code, *msg; @@ -1785,25 +1785,28 @@ twe_format_aen(struct twe_softc *sc, u_i case 'c': if ((child = sc->twe_drive[TWE_AEN_UNIT(aen)].td_disk) != NULL) { - sprintf(buf, "twed%d: %s", device_get_unit(child), msg); + snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf), "twed%d: %s", + device_get_unit(child), msg); } else { - sprintf(buf, "twe%d: %s for unknown unit %d", device_get_unit(sc->twe_dev), - msg, TWE_AEN_UNIT(aen)); + snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf), + "twe%d: %s for unknown unit %d", device_get_unit(sc->twe_dev), + msg, TWE_AEN_UNIT(aen)); } - return(buf); + return(sc->twe_aen_buf); case 'p': - sprintf(buf, "twe%d: port %d: %s", device_get_unit(sc->twe_dev), TWE_AEN_UNIT(aen), - msg); - return(buf); + snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf), + "twe%d: port %d: %s", device_get_unit(sc->twe_dev), + TWE_AEN_UNIT(aen), msg); + return(sc->twe_aen_buf); case 'x': default: break; } - sprintf(buf, "unknown AEN 0x%x", aen); - return(buf); + snprintf(sc->twe_aen_buf, sizeof(sc->twe_aen_buf), "unknown AEN 0x%x", aen); + return(sc->twe_aen_buf); } /******************************************************************************** Modified: head/sys/dev/twe/twevar.h ============================================================================== --- head/sys/dev/twe/twevar.h Wed Sep 5 13:51:36 2012 (r240136) +++ head/sys/dev/twe/twevar.h Wed Sep 5 14:31:58 2012 (r240137) @@ -125,6 +125,7 @@ struct twe_softc u_int16_t twe_aen_queue[TWE_Q_LENGTH]; /* AENs queued for userland tool(s) */ int twe_aen_head, twe_aen_tail; /* ringbuffer pointers for AEN queue */ int twe_wait_aen; /* wait-for-aen notification */ + char twe_aen_buf[80]; /* AEN format buffer */ /* controller status */ int twe_state; From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 15:55:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB2A81065673; Wed, 5 Sep 2012 15:55:51 +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 A60538FC16; Wed, 5 Sep 2012 15: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 q85FtptJ064255; Wed, 5 Sep 2012 15:55:51 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85Ftpcw064252; Wed, 5 Sep 2012 15:55:51 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201209051555.q85Ftpcw064252@svn.freebsd.org> From: Brooks Davis Date: Wed, 5 Sep 2012 15: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: r240139 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 15:55:51 -0000 Author: brooks Date: Wed Sep 5 15:55:51 2012 New Revision: 240139 URL: http://svn.freebsd.org/changeset/base/240139 Log: Don't hardcode paths to MFS_IMAGE in the kernel config. When they don't exist they don't cause "make tinderbox" to fail. Reported by: jhb Modified: head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_SIM_MDROOT Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Wed Sep 5 14:52:54 2012 (r240138) +++ head/sys/mips/conf/BERI_DE4_MDROOT Wed Sep 5 15:55:51 2012 (r240139) @@ -18,7 +18,6 @@ hints "BERI_DE4.hints" #Default places # options MD_ROOT # MD is a potential root device options MD_ROOT_SIZE=8192 -makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img options ROOTDEVNAME=\"ufs:md0\" device altera_avgen Modified: head/sys/mips/conf/BERI_SIM_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_SIM_MDROOT Wed Sep 5 14:52:54 2012 (r240138) +++ head/sys/mips/conf/BERI_SIM_MDROOT Wed Sep 5 15:55:51 2012 (r240139) @@ -17,7 +17,6 @@ hints "BERI_SIM.hints" #Default places # options MD_ROOT # MD is a potential root device options MD_ROOT_SIZE=8192 -makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img options ROOTDEVNAME=\"ufs:md0\" device altera_avgen From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 16:01:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 937BD1065675; Wed, 5 Sep 2012 16:01:08 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4298FC18; Wed, 5 Sep 2012 16:01: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 q85G18kM065092; Wed, 5 Sep 2012 16:01:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85G186D065091; Wed, 5 Sep 2012 16:01:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201209051601.q85G186D065091@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 5 Sep 2012 16:01: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: r240141 - in head/contrib/atf: . atf-c atf-c++ atf-sh bootstrap m4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 16:01:08 -0000 Author: marcel Date: Wed Sep 5 16:01:08 2012 New Revision: 240141 URL: http://svn.freebsd.org/changeset/base/240141 Log: Update to a pruned 0.16. Deleted: head/contrib/atf/INSTALL head/contrib/atf/TODO head/contrib/atf/aclocal.m4 head/contrib/atf/atf-c++/atf-c++.m4 head/contrib/atf/atf-c++/atf-c++.pc.in head/contrib/atf/atf-c/atf-c.m4 head/contrib/atf/atf-c/atf-c.pc.in head/contrib/atf/atf-c/atf-common.m4 head/contrib/atf/atf-sh/atf-sh.m4 head/contrib/atf/atf-sh/atf-sh.pc.in head/contrib/atf/bootstrap/ head/contrib/atf/m4/ Modified: Directory Properties: head/contrib/atf/ (props changed) From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 17:13:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2E7B106564A; Wed, 5 Sep 2012 17:13:08 +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 CEAD68FC15; Wed, 5 Sep 2012 17:13: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 q85HD8DL073284; Wed, 5 Sep 2012 17:13:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85HD8xr073281; Wed, 5 Sep 2012 17:13:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201209051713.q85HD8xr073281@svn.freebsd.org> From: Dimitry Andric Date: Wed, 5 Sep 2012 17:13: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: r240144 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 17:13:09 -0000 Author: dim Date: Wed Sep 5 17:13:08 2012 New Revision: 240144 URL: http://svn.freebsd.org/changeset/base/240144 Log: After r240104, make sure the hpt27xx driver also compiles with clang, when it is statically linked into the kernel. MFC after: 2 weeks X-MFC-With: r240104 Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Sep 5 16:47:00 2012 (r240143) +++ head/sys/conf/files.amd64 Wed Sep 5 17:13:08 2012 (r240144) @@ -190,7 +190,8 @@ dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/osm_bsd.c optional hpt27xx \ + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY}" dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Sep 5 16:47:00 2012 (r240143) +++ head/sys/conf/files.i386 Wed Sep 5 17:13:08 2012 (r240144) @@ -181,7 +181,8 @@ dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/osm_bsd.c optional hpt27xx \ + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY}" dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 18:19:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59A2106564A; Wed, 5 Sep 2012 18:19: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 C10608FC0C; Wed, 5 Sep 2012 18:19: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 q85IJsg3080770; Wed, 5 Sep 2012 18:19:54 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85IJsA6080768; Wed, 5 Sep 2012 18:19:54 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209051819.q85IJsA6080768@svn.freebsd.org> From: Andrey Zonov Date: Wed, 5 Sep 2012 18:19: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: r240145 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 18:19:54 -0000 Author: zont Date: Wed Sep 5 18:19:54 2012 New Revision: 240145 URL: http://svn.freebsd.org/changeset/base/240145 Log: - Simplify VM code by using vmspace_wired_count() for counting wired memory of a process. Reviewed by: avg Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Sep 5 17:13:08 2012 (r240144) +++ head/sys/vm/vm_mmap.c Wed Sep 5 18:19:54 2012 (r240145) @@ -1050,8 +1050,7 @@ sys_mlock(td, uap) return (ENOMEM); proc = td->td_proc; PROC_LOCK(proc); - nsize = ptoa(npages + - pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map))); + nsize = ptoa(npages + vmspace_wired_count(proc->p_vmspace)); if (nsize > lim_cur(proc, RLIMIT_MEMLOCK)) { PROC_UNLOCK(proc); return (ENOMEM); @@ -1072,7 +1071,7 @@ sys_mlock(td, uap) if (error != KERN_SUCCESS) { PROC_LOCK(proc); racct_set(proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map)))); + ptoa(vmspace_wired_count(proc->p_vmspace))); PROC_UNLOCK(proc); } #endif @@ -1148,7 +1147,7 @@ sys_mlockall(td, uap) if (error != KERN_SUCCESS) { PROC_LOCK(td->td_proc); racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&td->td_proc->p_vmspace->vm_map)))); + ptoa(vmspace_wired_count(td->td_proc->p_vmspace))); PROC_UNLOCK(td->td_proc); } #endif From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 18:27:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7C8C106566B; Wed, 5 Sep 2012 18:27:45 +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 D06848FC18; Wed, 5 Sep 2012 18:27: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 q85IRjjH081766; Wed, 5 Sep 2012 18:27:45 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85IRjhk081764; Wed, 5 Sep 2012 18:27:45 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209051827.q85IRjhk081764@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 5 Sep 2012 18:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240146 - head/usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 18:27:46 -0000 Author: gavin Date: Wed Sep 5 18:27:45 2012 New Revision: 240146 URL: http://svn.freebsd.org/changeset/base/240146 Log: - If the PCIe "SLOT" flag is set, include this in the capability output - Fix printing of PCIe interrupt number, the shift was incorrect. MFC after: 1 week Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Wed Sep 5 18:19:54 2012 (r240145) +++ head/usr.sbin/pciconf/cap.c Wed Sep 5 18:27:45 2012 (r240146) @@ -403,8 +403,10 @@ cap_express(int fd, struct pci_conf *p, printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); break; } + if (flags & PCIM_EXP_FLAGS_SLOT) + printf(" slot"); if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 8); + printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); printf(" max data %d(%d)", From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 18:52:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 046B6106566B; Wed, 5 Sep 2012 18:52:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2D6C8FC1E; Wed, 5 Sep 2012 18: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 q85Iq1pr085181; Wed, 5 Sep 2012 18:52:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85Iq1Pm085170; Wed, 5 Sep 2012 18:52:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209051852.q85Iq1Pm085170@svn.freebsd.org> From: Michael Tuexen Date: Wed, 5 Sep 2012 18:52: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: r240148 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 18:52:02 -0000 Author: tuexen Date: Wed Sep 5 18:52:01 2012 New Revision: 240148 URL: http://svn.freebsd.org/changeset/base/240148 Log: Using %p in a format string requires a void *. MFC after: 10 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_asconf.c Wed Sep 5 18:52:01 2012 (r240148) @@ -2278,7 +2278,7 @@ sctp_set_primary_ip_address_sa(struct sc /* set primary queuing succeeded */ SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address_sa: queued on tcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF @@ -2291,7 +2291,7 @@ sctp_set_primary_ip_address_sa(struct sc } } else { SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address_sa: failed to add to queue on tcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); return (-1); } @@ -2314,7 +2314,7 @@ sctp_set_primary_ip_address(struct sctp_ SCTP_SET_PRIM_ADDR)) { /* set primary queuing succeeded */ SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address: queued on stcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &ifa->address.sa); if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_auth.c Wed Sep 5 18:52:01 2012 (r240148) @@ -591,7 +591,7 @@ sctp_auth_key_acquire(struct sctp_tcb *s atomic_add_int(&skey->refcount, 1); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount acquire to %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); } } @@ -612,7 +612,7 @@ sctp_auth_key_release(struct sctp_tcb *s sctp_free_sharedkey(skey); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount release to %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); /* see if a notification should be generated */ if ((skey->refcount <= 1) && (skey->deactivated)) { @@ -621,7 +621,7 @@ sctp_auth_key_release(struct sctp_tcb *s key_id, 0, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); } } } Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_cc_functions.c Wed Sep 5 18:52:01 2012 (r240148) @@ -984,7 +984,7 @@ sctp_cwnd_update_exit_pf_common(struct s stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); + (void *)net, net->cwnd); } Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_indata.c Wed Sep 5 18:52:01 2012 (r240148) @@ -4420,7 +4420,7 @@ sctp_handle_sack(struct mbuf *m, int off cum_ack, send_s); if (tp1) { SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1:%p\n", - tp1->rec.data.TSN_seq, tp1); + tp1->rec.data.TSN_seq, (void *)tp1); } hopeless_peer: *abort_now = 1; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_input.c Wed Sep 5 18:52:01 2012 (r240148) @@ -91,7 +91,7 @@ sctp_handle_init(struct mbuf *m, int iph struct mbuf *op_err; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", - stcb); + (void *)stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); } @@ -2652,7 +2652,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTP_INP_INCR_REF((*stcb)->sctp_ep); if ((*stcb)->sctp_ep != l_inp) { SCTP_PRINTF("Huh? ep:%p diff then l_inp:%p?\n", - (*stcb)->sctp_ep, l_inp); + (void *)(*stcb)->sctp_ep, (void *)l_inp); } } } @@ -4404,7 +4404,7 @@ __attribute__((noinline)) #endif SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_control: iphlen=%u, offset=%u, length=%u stcb:%p\n", - iphlen, *offset, length, stcb); + iphlen, *offset, length, (void *)stcb); /* validate chunk header length... */ if (ntohs(ch->chunk_length) < sizeof(*ch)) { @@ -5023,7 +5023,7 @@ process_control_chunks: break; case SCTP_ABORT_ASSOCIATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ABORT, stcb %p\n", - stcb); + (void *)stcb); if ((stcb) && netp && *netp) sctp_handle_abort((struct sctp_abort_chunk *)ch, stcb, *netp); @@ -5032,7 +5032,7 @@ process_control_chunks: break; case SCTP_SHUTDOWN: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN, stcb %p\n", - stcb); + (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { *offset = length; if (locked_tcb) { @@ -5052,7 +5052,7 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", (void *)stcb); if ((stcb) && (netp) && (*netp)) sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp); *offset = length; @@ -5068,7 +5068,7 @@ process_control_chunks: break; case SCTP_COOKIE_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, - "SCTP_COOKIE-ECHO, stcb %p\n", stcb); + "SCTP_COOKIE-ECHO, stcb %p\n", (void *)stcb); if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { @@ -5170,7 +5170,7 @@ process_control_chunks: } break; case SCTP_COOKIE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); @@ -5260,7 +5260,7 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_COMPLETE: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", (void *)stcb); /* must be first and only chunk */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { @@ -5619,7 +5619,7 @@ sctp_common_input_processing(struct mbuf sh->checksum = check; if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); + calc_check, check, (void *)m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); if ((net != NULL) && (port != 0)) { @@ -5724,13 +5724,13 @@ sctp_common_input_processing(struct mbuf } #endif SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", - m, iphlen, offset, length, stcb); + (void *)m, iphlen, offset, length, (void *)stcb); if (stcb) { /* always clear this before beginning a packet */ stcb->asoc.authenticated = 0; stcb->asoc.seen_a_sack_this_pkt = 0; SCTPDBG(SCTP_DEBUG_INPUT1, "stcb:%p state:%x\n", - stcb, stcb->asoc.state); + (void *)stcb, stcb->asoc.state); if ((stcb->asoc.state & SCTP_STATE_WAS_ABORTED) || (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED)) { @@ -5968,9 +5968,9 @@ static void sctp_print_mbuf_chain(struct mbuf *m) { for (; m; m = SCTP_BUF_NEXT(m)) { - SCTP_PRINTF("%p: m_len = %ld\n", m, SCTP_BUF_LEN(m)); + SCTP_PRINTF("%p: m_len = %ld\n", (void *)m, SCTP_BUF_LEN(m)); if (SCTP_BUF_IS_EXTENDED(m)) - SCTP_PRINTF("%p: extend_size = %d\n", m, SCTP_BUF_EXTEND_SIZE(m)); + SCTP_PRINTF("%p: extend_size = %d\n", (void *)m, SCTP_BUF_EXTEND_SIZE(m)); } } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_output.c Wed Sep 5 18:52:01 2012 (r240148) @@ -2985,7 +2985,7 @@ bound_all_plan_b: } SCTPDBG(SCTP_DEBUG_OUTPUT2, "num preferred:%d on interface:%p cur_addr_num:%d\n", - num_preferred, sctp_ifn, cur_addr_num); + num_preferred, (void *)sctp_ifn, cur_addr_num); /* * Ok we have num_eligible_addr set with how many we can @@ -3022,7 +3022,7 @@ again_with_private_addresses_allowed: goto plan_d; } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { - SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", sctp_ifa); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", (void *)sctp_ifa); if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); @@ -3072,7 +3072,7 @@ plan_d: * out and see if we can find an acceptable address somewhere * amongst all interfaces. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", looked_at); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", (void *)looked_at); LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* wrong base scope */ @@ -3812,7 +3812,7 @@ sctp_handle_no_route(struct sctp_tcb *st SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT1, &net->ro._l_addr.sa); if (net->dest_state & SCTP_ADDR_CONFIRMED) { if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", net); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", (void *)net); sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, (void *)net, @@ -4106,7 +4106,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTPDBG(SCTP_DEBUG_OUTPUT3, "Destination is %x\n", (uint32_t) (ntohl(ip->ip_dst.s_addr))); SCTPDBG(SCTP_DEBUG_OUTPUT3, "RTP route is %p through\n", - ro->ro_rt); + (void *)ro->ro_rt); if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { /* failed to prepend data, give up */ @@ -12157,7 +12157,7 @@ sctp_lower_sosend(struct socket *so, sndlen = SCTP_HEADER_LEN(i_pak); } SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n", - addr, + (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_socket->so_qlimit)) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_pcb.c Wed Sep 5 18:52:01 2012 (r240148) @@ -553,7 +553,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo (sctp_ifap->ifn_p->ifn_index == ifn_index)) { SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", sctp_ifap->ifn_p->ifn_name, ifn_index, - sctp_ifap); + (void *)sctp_ifap); if (new_ifn_af) { /* Remove the created one that we don't want */ sctp_delete_ifn(sctp_ifnp, SCTP_ADDR_LOCKED); @@ -575,7 +575,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo * old one */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", - sctp_ifap, sctp_ifap->ifn_p->ifn_name, + (void *)sctp_ifap, sctp_ifap->ifn_p->ifn_name, sctp_ifap->ifn_p->ifn_index, if_name, ifn_index); /* remove the address from the old ifn */ @@ -587,7 +587,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo /* repair ifnp which was NULL ? */ sctp_ifap->localifa_flags = SCTP_ADDR_VALID; SCTPDBG(SCTP_DEBUG_PCB4, "Repairing ifn %p for ifa %p\n", - sctp_ifnp, sctp_ifap); + (void *)sctp_ifnp, (void *)sctp_ifap); sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); } goto exit_stage_left; @@ -763,7 +763,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, return; } } - SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", sctp_ifap); + SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", (void *)sctp_ifap); sctp_ifap->localifa_flags &= SCTP_ADDR_VALID; sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; vrf->total_ifa_count--; @@ -1678,7 +1678,7 @@ sctp_endpoint_probe(struct sockaddr *nam continue; } SCTPDBG(SCTP_DEBUG_PCB1, "Ok laddr->ifa:%p is possible, ", - laddr->ifa); + (void *)laddr->ifa); if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { SCTPDBG(SCTP_DEBUG_PCB1, "Huh IFA being deleted\n"); continue; @@ -2181,7 +2181,7 @@ sctp_findassociation_addr(struct mbuf *m retval = sctp_findassociation_addr_sa(src, dst, &inp, netp, find_tcp_pool, vrf_id); } - SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", retval, inp); + SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", (void *)retval, (void *)inp); if (retval == NULL && inp) { /* Found a EP but not this address */ if ((ch->chunk_type == SCTP_INITIATION) || @@ -2207,7 +2207,7 @@ sctp_findassociation_addr(struct mbuf *m } } } - SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", retval); + SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", (void *)retval); return (retval); } @@ -3100,7 +3100,7 @@ continue_anyway: /* put it in the bucket */ LIST_INSERT_HEAD(head, inp, sctp_hash); SCTPDBG(SCTP_DEBUG_PCB1, "Main hash to bind at head:%p, bound port:%d - in tcp_pool=%d\n", - head, ntohs(lport), port_reuse_active); + (void *)head, ntohs(lport), port_reuse_active); /* set in the port */ inp->sctp_lport = lport; @@ -3368,7 +3368,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, sctp_streamhead); if (sp == NULL) { SCTP_PRINTF("Error, sp is NULL, locked on sending is %p strm:%d\n", - asoc->asoc.locked_on_sending, + (void *)asoc->asoc.locked_on_sending, asoc->asoc.locked_on_sending->stream_no); } else { if ((sp->length == 0) && (sp->msg_is_complete == 0)) @@ -4341,7 +4341,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, LIST_INSERT_HEAD(head, stcb, sctp_tcbhash); } SCTP_INP_WUNLOCK(inp); - SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", stcb); + SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", (void *)stcb); return (stcb); } Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctp_timer.c Wed Sep 5 18:52:01 2012 (r240148) @@ -90,7 +90,7 @@ sctp_threshold_management(struct sctp_in if (net) { net->error_count++; SCTPDBG(SCTP_DEBUG_TIMER4, "Error count for %p now %d thresh:%d\n", - net, net->error_count, + (void *)net, net->error_count, net->failure_threshold); if (net->error_count > net->failure_threshold) { /* We had a threshold failure */ @@ -138,7 +138,7 @@ sctp_threshold_management(struct sctp_in stcb->asoc.overall_error_count++; } SCTPDBG(SCTP_DEBUG_TIMER4, "Overall error count for %p now %d thresh:%u state:%x\n", - &stcb->asoc, stcb->asoc.overall_error_count, + (void *)&stcb->asoc, stcb->asoc.overall_error_count, (uint32_t) threshold, ((net == NULL) ? (uint32_t) 0 : (uint32_t) net->dest_state)); /* @@ -439,7 +439,7 @@ sctp_recover_sent_list(struct sctp_tcb * TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", - chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); + (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) @@ -460,7 +460,7 @@ sctp_recover_sent_list(struct sctp_tcb * } SCTP_PRINTF("after recover order is as follows\n"); TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { - SCTP_PRINTF("chk:%p TSN:%x\n", chk, chk->rec.data.TSN_seq); + SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.TSN_seq); } } @@ -767,7 +767,7 @@ start_again: if (audit_tf) { SCTPDBG(SCTP_DEBUG_TIMER4, "Audit total flight due to negative value net:%p\n", - net); + (void *)net); stcb->asoc.total_flight = 0; stcb->asoc.total_flight_count = 0; /* Clear all networks flight size */ @@ -775,7 +775,7 @@ start_again: lnets->flight_size = 0; SCTPDBG(SCTP_DEBUG_TIMER4, "Net:%p c-f cwnd:%d ssthresh:%d\n", - lnets, lnets->cwnd, lnets->ssthresh); + (void *)lnets, lnets->cwnd, lnets->ssthresh); } TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { if (chk->sent < SCTP_DATAGRAM_RESEND) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Sep 5 18:49:00 2012 (r240147) +++ head/sys/netinet/sctputil.c Wed Sep 5 18:52:01 2012 (r240148) @@ -686,7 +686,7 @@ sctp_auditing(int from, struct sctp_inpc } if (lnet->flight_size != tot_out) { SCTP_PRINTF("net:%p flight was %d corrected to %d\n", - lnet, lnet->flight_size, + (void *)lnet, lnet->flight_size, tot_out); lnet->flight_size = tot_out; } @@ -1434,7 +1434,7 @@ sctp_timeout_handler(void *t) if (tmr->self != (void *)tmr) { /* * SCTP_PRINTF("Stale SCTP timer fired (%p), ignoring...\n", - * tmr); + * (void *)tmr); */ CURVNET_RESTORE(); return; @@ -2112,7 +2112,7 @@ sctp_timer_start(int t_type, struct sctp } if ((to_ticks <= 0) || (tmr == NULL)) { SCTPDBG(SCTP_DEBUG_TIMER1, "%s: %d:software error to_ticks:%d tmr:%p not set ??\n", - __FUNCTION__, t_type, to_ticks, tmr); + __FUNCTION__, t_type, to_ticks, (void *)tmr); return; } if (SCTP_OS_TIMER_PENDING(&tmr->timer)) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 19:01:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17AC4106564A; Wed, 5 Sep 2012 19:01:40 +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 DDA288FC0C; Wed, 5 Sep 2012 19:01: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 q85J1dPL086505; Wed, 5 Sep 2012 19:01:39 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85J1d7u086503; Wed, 5 Sep 2012 19:01:39 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209051901.q85J1d7u086503@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 5 Sep 2012 19:01: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: r240150 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 19:01:40 -0000 Author: gavin Date: Wed Sep 5 19:01:39 2012 New Revision: 240150 URL: http://svn.freebsd.org/changeset/base/240150 Log: Add #defines for the bits in the PCI Express SLOT registers. Names have been chosen based on the bit names in the PCI Express Base Specification 3.0, and to match the predominant style of the existing bit definitions. MFC after: 1 week Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Wed Sep 5 18:55:35 2012 (r240149) +++ head/sys/dev/pci/pcireg.h Wed Sep 5 19:01:39 2012 (r240150) @@ -663,8 +663,40 @@ #define PCIM_LINK_STA_TRAINING 0x0800 #define PCIM_LINK_STA_SLOT_CLOCK 0x1000 #define PCIR_EXPRESS_SLOT_CAP 0x14 +#define PCIM_EXP_SLOT_CAP_APB 0x00000001 +#define PCIM_EXP_SLOT_CAP_PCP 0x00000002 +#define PCIM_EXP_SLOT_CAP_MRLSP 0x00000004 +#define PCIM_EXP_SLOT_CAP_AIP 0x00000008 +#define PCIM_EXP_SLOT_CAP_PIP 0x00000010 +#define PCIM_EXP_SLOT_CAP_HPS 0x00000020 +#define PCIM_EXP_SLOT_CAP_HPC 0x00000040 +#define PCIM_EXP_SLOT_CAP_SPLV 0x00007f80 +#define PCIM_EXP_SLOT_CAP_SPLS 0x00018000 +#define PCIM_EXP_SLOT_CAP_EIP 0x00020000 +#define PCIM_EXP_SLOT_CAP_NCCS 0x00040000 +#define PCIM_EXP_SLOT_CAP_PSN 0xfff80000 #define PCIR_EXPRESS_SLOT_CTL 0x18 +#define PCIM_EXP_SLOT_CTL_ABPE 0x0001 +#define PCIM_EXP_SLOT_CTL_PFDE 0x0002 +#define PCIM_EXP_SLOT_CTL_MRLSCE 0x0004 +#define PCIM_EXP_SLOT_CTL_PDCE 0x0008 +#define PCIM_EXP_SLOT_CTL_CCIE 0x0010 +#define PCIM_EXP_SLOT_CTL_HPIE 0x0020 +#define PCIM_EXP_SLOT_CTL_AIC 0x00c0 +#define PCIM_EXP_SLOT_CTL_PIC 0x0300 +#define PCIM_EXP_SLOT_CTL_PCC 0x0400 +#define PCIM_EXP_SLOT_CTL_EIC 0x0800 +#define PCIM_EXP_SLOT_CTL_DLLSCE 0x1000 #define PCIR_EXPRESS_SLOT_STA 0x1a +#define PCIM_EXP_SLOT_STA_ABP 0x0001 +#define PCIM_EXP_SLOT_STA_PFD 0x0002 +#define PCIM_EXP_SLOT_STA_MRLSC 0x0004 +#define PCIM_EXP_SLOT_STA_PDC 0x0008 +#define PCIM_EXP_SLOT_STA_CC 0x0010 +#define PCIM_EXP_SLOT_STA_MRLSS 0x0020 +#define PCIM_EXP_SLOT_STA_PDS 0x0040 +#define PCIM_EXP_SLOT_STA_EIS 0x0080 +#define PCIM_EXP_SLOT_STA_DLLSC 0x0100 #define PCIR_EXPRESS_ROOT_CTL 0x1c #define PCIR_EXPRESS_ROOT_STA 0x20 #define PCIR_EXPRESS_DEVICE_CTL2 40 From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 20:13:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CBBF106564A; Wed, 5 Sep 2012 20:13:15 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id 22F688FC17; Wed, 5 Sep 2012 20:13:14 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M9W00H2X85WJJ30@smtp4.clear.net.nz>; Thu, 06 Sep 2012 08:13:08 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Thu, 06 Sep 2012 08:13:08 +1200 Date: Thu, 06 Sep 2012 08:12:24 +1200 From: Andrew Turner In-reply-to: <07899894-3253-4F16-9CAB-8339E23D57F8@semihalf.com> To: Rafal Jaworowski Message-id: <20120906081224.3c3676c6@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201209020148.q821ml0M018010@svn.freebsd.org> <07899894-3253-4F16-9CAB-8339E23D57F8@semihalf.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 20:13:15 -0000 On Tue, 4 Sep 2012 20:14:23 +0200 Rafal Jaworowski wrote: > > On 2012-09-02, at 03:48, Andrew Turner wrote: > > > Author: andrew > > Date: Sun Sep 2 01:48:47 2012 > > New Revision: 239998 > > URL: http://svn.freebsd.org/changeset/base/239998 > > > > Log: > > Fix a logic inversion in an assert to allow us to use dts files > > that include other files. > > > > Modified: > > head/contrib/dtc/dtc-lexer.l > > Is this a bug in the dtc that should be upstreamed perhaps, or is it > fixed at the point beyond our recent import of the vendor package? No, it is a local change as we are missing yypush_buffer_state and yypush_buffer_state and this code emulates them. Andrew From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 21:41:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD2BC1065672; Wed, 5 Sep 2012 21:41:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A74A98FC1B; Wed, 5 Sep 2012 21:41:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q85Lf6d4006345; Wed, 5 Sep 2012 21:41:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85Lf6Mn006333; Wed, 5 Sep 2012 21:41:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209052141.q85Lf6Mn006333@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 5 Sep 2012 21:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240152 - in head/lib/libc/i386: . gen sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 21:41:06 -0000 Author: jilles Date: Wed Sep 5 21:41:05 2012 New Revision: 240152 URL: http://svn.freebsd.org/changeset/base/240152 Log: libc/i386: Do not export .cerror. For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeit in the FBSDprivate_1.0 version. It looks like there is no reason for this since it is not used from other libraries. Given that it cannot be accessed from C and its strange calling convention, it is rather unlikely that other things rely on it. Perhaps it is from a time when symbols could not be hidden. Not exporting .cerror causes it to be jumped to directly instead of via the PLT. This change also takes advantage of .cerror's new status by not saving and loading %ebx before jumping to it. (Therefore, .cerror now saves and loads %ebx itself.) Where there was a conditional jump to a jump to .cerror, the conditional jump has been changed to jump to .cerror directly (many modern CPUs don't do static prediction and in any case it is not much of a benefit anyway). This change makes libc.so.7 a few kilobytes smaller. Reviewed by: kib Modified: head/lib/libc/i386/SYS.h head/lib/libc/i386/Symbol.map head/lib/libc/i386/gen/rfork_thread.S head/lib/libc/i386/sys/Ovfork.S head/lib/libc/i386/sys/brk.S head/lib/libc/i386/sys/cerror.S head/lib/libc/i386/sys/exect.S head/lib/libc/i386/sys/getcontext.S head/lib/libc/i386/sys/ptrace.S head/lib/libc/i386/sys/sbrk.S head/lib/libc/i386/sys/syscall.S Modified: head/lib/libc/i386/SYS.h ============================================================================== --- head/lib/libc/i386/SYS.h Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/SYS.h Wed Sep 5 21:41:05 2012 (r240152) @@ -36,21 +36,21 @@ #include #include -#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(__sys_,x)); \ +#define SYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(x); \ .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror) #define RSYSCALL(x) SYSCALL(x); ret; END(__CONCAT(__sys_,x)) -#define PSEUDO(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(__sys_,x)); \ +#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b; ret; \ + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ END(__CONCAT(__sys_,x)) /* gas messes up offset -- although we don't currently need it, do for BCS */ Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/Symbol.map Wed Sep 5 21:41:05 2012 (r240152) @@ -63,7 +63,6 @@ FBSDprivate_1.0 { __sys_vfork; _vfork; _end; - .cerror; _brk; .curbrk; .minbrk; Modified: head/lib/libc/i386/gen/rfork_thread.S ============================================================================== --- head/lib/libc/i386/gen/rfork_thread.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/gen/rfork_thread.S Wed Sep 5 21:41:05 2012 (r240152) @@ -113,8 +113,7 @@ ENTRY(rfork_thread) popl %esi movl %ebp, %esp popl %ebp - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) + jmp HIDENAME(cerror) END(rfork_thread) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/Ovfork.S ============================================================================== --- head/lib/libc/i386/sys/Ovfork.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/Ovfork.S Wed Sep 5 21:41:05 2012 (r240152) @@ -50,8 +50,7 @@ ENTRY(__sys_vfork) jmp *%ecx 1: pushl %ecx - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) + jmp HIDENAME(cerror) END(__sys_vfork) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/brk.S ============================================================================== --- head/lib/libc/i386/sys/brk.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/brk.S Wed Sep 5 21:41:05 2012 (r240152) @@ -58,14 +58,11 @@ ENTRY(brk) ok: mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) movl 4(%esp),%eax movl %eax,(%edx) movl $0,%eax ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) #else @@ -77,13 +74,11 @@ err: ok: mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) movl 4(%esp),%eax movl %eax,HIDENAME(curbrk) movl $0,%eax ret -err: - jmp HIDENAME(cerror) #endif END(brk) Modified: head/lib/libc/i386/sys/cerror.S ============================================================================== --- head/lib/libc/i386/sys/cerror.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/cerror.S Wed Sep 5 21:41:05 2012 (r240152) @@ -48,13 +48,14 @@ __FBSDID("$FreeBSD$"); .globl CNAME(__error) .type CNAME(__error),@function HIDENAME(cerror): - pushl %eax #ifdef PIC - /* The caller must execute the PIC prologue before jumping to cerror. */ + PIC_PROLOGUE + pushl %eax call PIC_PLT(CNAME(__error)) popl %ecx PIC_EPILOGUE #else + pushl %eax call CNAME(__error) popl %ecx #endif Modified: head/lib/libc/i386/sys/exect.S ============================================================================== --- head/lib/libc/i386/sys/exect.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/exect.S Wed Sep 5 21:41:05 2012 (r240152) @@ -47,8 +47,7 @@ ENTRY(exect) pushl %edx popf KERNCALL - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */ + jmp HIDENAME(cerror) /* exect(file, argv, env); */ END(exect) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/getcontext.S ============================================================================== --- head/lib/libc/i386/sys/getcontext.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/getcontext.S Wed Sep 5 21:41:05 2012 (r240152) @@ -42,12 +42,9 @@ ENTRY(__sys_getcontext) movl (%esp),%ecx /* save getcontext return address */ mov $SYS_getcontext,%eax KERNCALL - jb 1f + jb HIDENAME(cerror) addl $4,%esp /* remove stale (setcontext) return address */ jmp *%ecx /* restore return address */ -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(__sys_getcontext) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/ptrace.S ============================================================================== --- head/lib/libc/i386/sys/ptrace.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/ptrace.S Wed Sep 5 21:41:05 2012 (r240152) @@ -50,11 +50,8 @@ ENTRY(ptrace) #endif mov $SYS_ptrace,%eax KERNCALL - jb err + jb HIDENAME(cerror) ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(ptrace) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/sbrk.S ============================================================================== --- head/lib/libc/i386/sys/sbrk.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/sbrk.S Wed Sep 5 21:41:05 2012 (r240152) @@ -59,7 +59,7 @@ ENTRY(sbrk) addl %eax,4(%esp) mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) PIC_PROLOGUE movl PIC_GOT(HIDENAME(curbrk)),%edx movl (%edx),%eax @@ -67,9 +67,6 @@ ENTRY(sbrk) PIC_EPILOGUE back: ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) #else /* !PIC */ @@ -80,13 +77,11 @@ err: addl %eax,4(%esp) mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) movl HIDENAME(curbrk),%eax addl %ecx,HIDENAME(curbrk) back: ret -err: - jmp HIDENAME(cerror) #endif /* PIC */ END(sbrk) Modified: head/lib/libc/i386/sys/syscall.S ============================================================================== --- head/lib/libc/i386/sys/syscall.S Wed Sep 5 20:40:11 2012 (r240151) +++ head/lib/libc/i386/sys/syscall.S Wed Sep 5 21:41:05 2012 (r240152) @@ -45,11 +45,8 @@ ENTRY(syscall) KERNCALL push %ecx /* need to push a word to keep stack frame intact upon return; the word must be the return address. */ - jb 1f + jb HIDENAME(cerror) ret -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(syscall) .section .note.GNU-stack,"",%progbits From owner-svn-src-head@FreeBSD.ORG Wed Sep 5 23:07:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 972B41065670; Wed, 5 Sep 2012 23:07: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 818388FC15; Wed, 5 Sep 2012 23:07: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 q85N73Pm018175; Wed, 5 Sep 2012 23:07:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q85N730m018172; Wed, 5 Sep 2012 23:07:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209052307.q85N730m018172@svn.freebsd.org> From: Glen Barber Date: Wed, 5 Sep 2012 23:07: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: r240153 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 23:07:03 -0000 Author: gjb (doc,ports committer) Date: Wed Sep 5 23:07:02 2012 New Revision: 240153 URL: http://svn.freebsd.org/changeset/base/240153 Log: Typo fix and minor word swap. PR: 171356 Submitted by: bdrewery MFC After: 3 days 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 Wed Sep 5 21:41:05 2012 (r240152) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 5 23:07:02 2012 (r240153) @@ -23,10 +23,11 @@ .\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber +.\" Copyright (c) 2012, Bryan Drewery .\" .\" $FreeBSD$ .\" -.Dd August 12, 2012 +.Dd September 5, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -1083,7 +1084,7 @@ bit is respected for the file system. Th .It Sy sharesmb Ns = Ns Cm on | off | Ar opts The .Sy sharesmb -property has currently no effect o +property currently has no effect on .Fx . .It Sy sharenfs Ns = Ns Cm on | off | Ar opts Controls whether the file system is shared via @@ -2031,7 +2032,7 @@ The default is .Pp The default can be changed to include group types. .It Fl i -Translate SID to POSIX ID. This flag has currently no effect on +Translate SID to POSIX ID. This flag currently has no effect on .Fx . .El .It Xo From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 01:24:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2EE106564A; Thu, 6 Sep 2012 01:24:19 +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 78F7D8FC17; Thu, 6 Sep 2012 01:24: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 q861OJar035608; Thu, 6 Sep 2012 01:24:19 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q861OJs2035604; Thu, 6 Sep 2012 01:24:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209060124.q861OJs2035604@svn.freebsd.org> From: Rui Paulo Date: Thu, 6 Sep 2012 01:24: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: r240154 - in head/lib/libproc/test: t1-bkpt t3-name2sym X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 01:24:19 -0000 Author: rpaulo Date: Thu Sep 6 01:24:18 2012 New Revision: 240154 URL: http://svn.freebsd.org/changeset/base/240154 Log: Fix test cases to work with the latest version of the API. Modified: head/lib/libproc/test/t1-bkpt/t1-bkpt.c head/lib/libproc/test/t3-name2sym/t3-name2sym.c Modified: head/lib/libproc/test/t1-bkpt/t1-bkpt.c ============================================================================== --- head/lib/libproc/test/t1-bkpt/t1-bkpt.c Wed Sep 5 23:07:02 2012 (r240153) +++ head/lib/libproc/test/t1-bkpt/t1-bkpt.c Thu Sep 6 01:24:18 2012 (r240154) @@ -50,12 +50,12 @@ t1_bkpt_d() unsigned long saved; proc_create("./t1-bkpt", targv, NULL, NULL, &phdl); - proc_bkptset(phdl, (uintptr_t)t1_bkpt_t, &saved); + assert(proc_bkptset(phdl, (uintptr_t)t1_bkpt_t, &saved) == 0); proc_continue(phdl); - assert(WIFSTOPPED(proc_wstatus(phdl))); + assert(proc_wstatus(phdl) == PS_STOP); proc_bkptexec(phdl, saved); proc_continue(phdl); - proc_wait(phdl); + proc_wstatus(phdl); proc_free(phdl); } Modified: head/lib/libproc/test/t3-name2sym/t3-name2sym.c ============================================================================== --- head/lib/libproc/test/t3-name2sym/t3-name2sym.c Wed Sep 5 23:07:02 2012 (r240153) +++ head/lib/libproc/test/t3-name2sym/t3-name2sym.c Thu Sep 6 01:24:18 2012 (r240154) @@ -33,6 +33,7 @@ #include #include #include +#include int main(int argc, char *argv[]) From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 02:07:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60315106564A; Thu, 6 Sep 2012 02:07:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFE88FC08; Thu, 6 Sep 2012 02:07: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 q8627xVU041009; Thu, 6 Sep 2012 02:07:59 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8627xwr041007; Thu, 6 Sep 2012 02:07:59 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209060207.q8627xwr041007@svn.freebsd.org> From: Kevin Lo Date: Thu, 6 Sep 2012 02:07: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: r240155 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 02:07:59 -0000 Author: kevlo Date: Thu Sep 6 02:07:58 2012 New Revision: 240155 URL: http://svn.freebsd.org/changeset/base/240155 Log: Add missing braces Obtained from: DragonFly Modified: head/sys/dev/ixgbe/ixgbe_82599.c Modified: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.c Thu Sep 6 01:24:18 2012 (r240154) +++ head/sys/dev/ixgbe/ixgbe_82599.c Thu Sep 6 02:07:58 2012 (r240155) @@ -868,12 +868,13 @@ s32 ixgbe_setup_mac_link_82599(struct ix link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { /* Set KX4/KX/KR support according to speed requested */ autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP); - if (speed & IXGBE_LINK_SPEED_10GB_FULL) + if (speed & IXGBE_LINK_SPEED_10GB_FULL) { if (orig_autoc & IXGBE_AUTOC_KX4_SUPP) autoc |= IXGBE_AUTOC_KX4_SUPP; if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) && (hw->phy.smart_speed_active == FALSE)) autoc |= IXGBE_AUTOC_KR_SUPP; + } if (speed & IXGBE_LINK_SPEED_1GB_FULL) autoc |= IXGBE_AUTOC_KX_SUPP; } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) && From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 03:19:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5C3E106564A; Thu, 6 Sep 2012 03:19:49 +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 870908FC31; Thu, 6 Sep 2012 03:19: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 q863Jnex050508; Thu, 6 Sep 2012 03:19:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q863JnDe050504; Thu, 6 Sep 2012 03:19:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209060319.q863JnDe050504@svn.freebsd.org> From: Rui Paulo Date: Thu, 6 Sep 2012 03:19: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: r240156 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 03:19:49 -0000 Author: rpaulo Date: Thu Sep 6 03:19:48 2012 New Revision: 240156 URL: http://svn.freebsd.org/changeset/base/240156 Log: Add support for demangling C++ symbols. This requires linking libproc with libc++rt/libsupc++. Discussed with: theraven Modified: head/lib/libproc/Makefile head/lib/libproc/proc_sym.c Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Thu Sep 6 02:07:58 2012 (r240155) +++ head/lib/libproc/Makefile Thu Sep 6 03:19:48 2012 (r240156) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= proc SRCS= proc_bkpt.c \ @@ -13,6 +15,14 @@ INCS= libproc.h CFLAGS+= -I${.CURDIR} +.if ${MK_LIBCPLUSPLUS} != "no" +LDADD+= -lcxxrt +DPADD+= ${LIBCXXRT} +.else +LDADD+= -lsupc++ +DPADD+= ${LIBSTDCPLUSPLUS} +.endif + SHLIB_MAJOR= 2 WITHOUT_MAN= Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Thu Sep 6 02:07:58 2012 (r240155) +++ head/lib/libproc/proc_sym.c Thu Sep 6 03:19:48 2012 (r240156) @@ -46,6 +46,8 @@ #include "_libproc.h" +extern char *__cxa_demangle(const char *, char *, size_t *, int *); + static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); static void @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin if (addr >= rsym && addr <= (rsym + sym.st_size)) { s = elf_strptr(e, dynsymstridx, sym.st_name); if (s) { - strlcpy(name, s, namesz); + if (strlen(s) > 2 && + s[0] == '_' && s[1] == 'Z') + __cxa_demangle(s, name, &namesz, NULL); + else + strlcpy(name, s, namesz); memcpy(symcopy, &sym, sizeof(sym)); /* * DTrace expects the st_value to contain @@ -302,7 +308,11 @@ symtab: if (addr >= rsym && addr <= (rsym + sym.st_size)) { s = elf_strptr(e, symtabstridx, sym.st_name); if (s) { - strlcpy(name, s, namesz); + if (strlen(s) > 2 && + s[0] == '_' && s[1] == 'Z') + __cxa_demangle(s, name, &namesz, NULL); + else + strlcpy(name, s, namesz); memcpy(symcopy, &sym, sizeof(sym)); /* * DTrace expects the st_value to contain From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 04:07:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87F071065674 for ; Thu, 6 Sep 2012 04:07:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id CF43E8FC14 for ; Thu, 6 Sep 2012 04:07:32 +0000 (UTC) Received: by iebc12 with SMTP id c12so2962787ieb.13 for ; Wed, 05 Sep 2012 21:07:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=HCO5VcmQTOCVHFp9iw5Prc335wyf8eCvBxnd38gnDDg=; b=BVIlhqfMUQFI4GpbV3nyG7Ws3kxjJPGrdW8al1nMA/PX2JZnfXiV1oHeaWEk3K0q6m xfseGiLuceYvnfzibZlLqwEM+ZoPiyUv7LevZPXMVnW+k1dvfYsr5yNORMn16JxreFiz nqlPvsRt3WnLqLoPYidD79WnRWIXAltiuqBVzNY8iVjvhsuz5dFMlg1flPOF7G+Riq6E R1az8kOud/OOtssZxClqc75lxxClI/Zp9aiT1b8/cmKyMZSYgX4xAynUs9H15dUFKFTm i874PbTpZ+JgXrGkZuI9gZ7l6P6LtddcHBqEJjPRd2o/F86Jy6r/ZDdcNK9Iu+ao3tRO g0Tg== Received: by 10.50.236.72 with SMTP id us8mr627716igc.70.1346904452017; Wed, 05 Sep 2012 21:07:32 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id a10sm2496592igd.1.2012.09.05.21.07.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 21:07:30 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20120902232204.4de5f3a3.ray@ddteam.net> Date: Wed, 5 Sep 2012 22:07:29 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <1BB2880C-88BA-4918-8C65-6F5E8B0C3058@bsdimp.com> References: <201209020148.q821ml0M018010@svn.freebsd.org> <20120902232204.4de5f3a3.ray@ddteam.net> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQkGl4Rkvux+9T9wTYbhfmbzGZMfTmJ5xzAA8zuT9bwZwjLjXupC7c03jmt6S7h+J7vzWbs8 Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 04:07:33 -0000 On Sep 2, 2012, at 2:22 PM, Aleksandr Rybalko wrote: > On Sun, 2 Sep 2012 01:48:47 +0000 (UTC) > Andrew Turner wrote: >=20 >> Author: andrew >> Date: Sun Sep 2 01:48:47 2012 >> New Revision: 239998 >> URL: http://svn.freebsd.org/changeset/base/239998 >>=20 >> Log: >> Fix a logic inversion in an assert to allow us to use dts files that >> include other files. >=20 > Big Thanks for that!!! >=20 > It's hard to add overlapping support also? So second instance of same > node will be able to change attributes of previous one, such a = "status". > Or add new attributes, like GPIO lines usage. >=20 > Then we will be able to have per-SoC dts and per-board. =20 Should already be fixed. This is the latest dtc from upstream. Warner >>=20 >> Modified: >> head/contrib/dtc/dtc-lexer.l >>=20 >> Modified: head/contrib/dtc/dtc-lexer.l >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/contrib/dtc/dtc-lexer.l Sat Sep 1 23:33:49 >> 2012 (r239997) +++ head/contrib/dtc/dtc-lexer.l Sun >> Sep 2 01:48:47 2012 (r239998) @@ -198,7 +198,7 @@ static void >> push_input_file(const char * { >> assert(filename); >>=20 >> - assert(include_stack_pointer >=3D MAX_INCLUDE_NESTING); >> + assert(include_stack_pointer < MAX_INCLUDE_NESTING); >>=20 >> srcfile_push(filename); >>=20 >=20 > Thanks. >=20 > WBW > --=20 > Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 04:14:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F8F41065673 for ; Thu, 6 Sep 2012 04:14:15 +0000 (UTC) (envelope-from imp@bsdimp.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 50FCA8FC0C for ; Thu, 6 Sep 2012 04:14:14 +0000 (UTC) Received: by iayy25 with SMTP id y25so2023996iay.13 for ; Wed, 05 Sep 2012 21:14:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=X7riznuxazDnX8F1aOYmo7DAzJn/SfYQovl13zJSuxg=; b=ekbr9Qofu40K9zk7Spzp9DzIxGJ7e87rWFm51+b+13sMSi6I2/mpU1AmCnnTZUaUAQ pdwiczQcgyRr92M6SIUiKkBi42U7WfpboayBXibTRUNRlsaECkxCi56E9YPW7SZ78a6w LBa7cS2JHJddJwQJVzBfpdIU7H+UtgJx5l1YuT/6U1wJdJPsLjDP2dqo8XrS6KUUW0f6 38ZorR5MHX49USyqEIrh8C9zgFoIsHhPkddRsRlggEty7NCX+G4IOoFlDf1b0VVhwXkq c2SZp6d976OZ8sHEfPshfLlHaDf4/l8/5IL3zmVJQlFqJxEatWY6o5err4Ykuylwu3NC aYJw== Received: by 10.50.77.131 with SMTP id s3mr722646igw.20.1346904854544; Wed, 05 Sep 2012 21:14:14 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id p8sm1804245igl.16.2012.09.05.21.14.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 21:14:13 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <07899894-3253-4F16-9CAB-8339E23D57F8@semihalf.com> Date: Wed, 5 Sep 2012 22:14:11 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201209020148.q821ml0M018010@svn.freebsd.org> <07899894-3253-4F16-9CAB-8339E23D57F8@semihalf.com> To: Rafal Jaworowski X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQkq0NiuhW5E+MW8ZIrLFwnvDgoqm7cFjCRFvHdxcD7juQDaWe/NJAT8+0ZZE+bcsp8g6u5G Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239998 - head/contrib/dtc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 04:14:15 -0000 On Sep 4, 2012, at 12:14 PM, Rafal Jaworowski wrote: >=20 > On 2012-09-02, at 03:48, Andrew Turner wrote: >=20 >> Author: andrew >> Date: Sun Sep 2 01:48:47 2012 >> New Revision: 239998 >> URL: http://svn.freebsd.org/changeset/base/239998 >>=20 >> Log: >> Fix a logic inversion in an assert to allow us to use dts files that >> include other files. >>=20 >> Modified: >> head/contrib/dtc/dtc-lexer.l >=20 > Is this a bug in the dtc that should be upstreamed perhaps, or is it = fixed at the point beyond our recent import of the vendor package? Neither. This is in the hack I wrote to get around our lex not having = all the features that dtc wants. Warner From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 07:03:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD851106566C; Thu, 6 Sep 2012 07:03:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8C468FC08; Thu, 6 Sep 2012 07:03: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 q8673uMb077870; Thu, 6 Sep 2012 07:03:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8673u2n077866; Thu, 6 Sep 2012 07:03:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209060703.q8673u2n077866@svn.freebsd.org> From: Michael Tuexen Date: Thu, 6 Sep 2012 07:03: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: r240158 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 07:03:57 -0000 Author: tuexen Date: Thu Sep 6 07:03:56 2012 New Revision: 240158 URL: http://svn.freebsd.org/changeset/base/240158 Log: Get rid of a gcc'ism. MFC after: 10 days Modified: head/sys/netinet/sctp_cc_functions.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Thu Sep 6 06:17:39 2012 (r240157) +++ head/sys/netinet/sctp_cc_functions.c Thu Sep 6 07:03:56 2012 (r240158) @@ -1917,10 +1917,9 @@ measure_achieved_throughput(struct sctp_ return; } net->cc_mod.htcp_ca.bytecount += net->net_ack; - - if (net->cc_mod.htcp_ca.bytecount >= net->cwnd - ((net->cc_mod.htcp_ca.alpha >> 7 ? : 1) * net->mtu) - && now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT - && net->cc_mod.htcp_ca.minRTT > 0) { + if ((net->cc_mod.htcp_ca.bytecount >= net->cwnd - (((net->cc_mod.htcp_ca.alpha >> 7) ? (net->cc_mod.htcp_ca.alpha >> 7) : 1) * net->mtu)) && + (now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT) && + (net->cc_mod.htcp_ca.minRTT > 0)) { uint32_t cur_Bi = net->cc_mod.htcp_ca.bytecount / net->mtu * hz / (now - net->cc_mod.htcp_ca.lasttime); if (htcp_ccount(&net->cc_mod.htcp_ca) <= 3) { From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 11:12:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EACA91065672; Thu, 6 Sep 2012 11:12:04 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from fallback2.mail.ru (fallback2.mail.ru [94.100.176.87]) by mx1.freebsd.org (Postfix) with ESMTP id C64FA8FC0C; Thu, 6 Sep 2012 11:12:03 +0000 (UTC) Received: from smtp13.mail.ru (smtp13.mail.ru [94.100.176.90]) by fallback2.mail.ru (mPOP.Fallback_MX) with ESMTP id CA270B6078B5; Thu, 6 Sep 2012 13:43:43 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=kRswVH7JH7e89Vu1th9rhx4J0MT91xaVKIahiO74cPY=; b=q/UN/yh2rOvLmMgmDSLnUacxrmegpBsDZM9GU7J9Hvk1Wxf4vs05CY0n1JqXavo/pD6gxU4kXUk4u+86pW6bKs0wL6wx/UPedJxSAMEfVauqqyHr1XY+QtE+ZM1jSuZY; Received: from [93.185.182.46] (port=59629 helo=gpr.nnz-home.ru) by smtp13.mail.ru with esmtpa (envelope-from ) id 1T9YcY-0005QR-Gl; Thu, 06 Sep 2012 13:43:35 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.80 (FreeBSD)) (envelope-from ) id 1T9Ybe-000Pd3-O8; Thu, 06 Sep 2012 13:42:38 +0400 Date: Thu, 6 Sep 2012 13:42:38 +0400 From: Gennady Proskurin To: Rui Paulo Message-ID: <20120906094238.GF85904@gpr.nnz-home.ru> References: <201209060319.q863JnDe050504@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201209060319.q863JnDe050504@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam: Not detected X-Mras: Ok Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240156 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 11:12:05 -0000 On Thu, Sep 06, 2012 at 03:19:49AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Thu Sep 6 03:19:48 2012 > New Revision: 240156 > URL: http://svn.freebsd.org/changeset/base/240156 > > Log: > Add support for demangling C++ symbols. This requires linking libproc with > libc++rt/libsupc++. > > Discussed with: theraven > > Modified: > head/lib/libproc/Makefile > head/lib/libproc/proc_sym.c > > Modified: head/lib/libproc/Makefile > ============================================================================== > --- head/lib/libproc/Makefile Thu Sep 6 02:07:58 2012 (r240155) > +++ head/lib/libproc/Makefile Thu Sep 6 03:19:48 2012 (r240156) > @@ -1,5 +1,7 @@ > # $FreeBSD$ > > +.include > + > LIB= proc > > SRCS= proc_bkpt.c \ > @@ -13,6 +15,14 @@ INCS= libproc.h > > CFLAGS+= -I${.CURDIR} > > +.if ${MK_LIBCPLUSPLUS} != "no" > +LDADD+= -lcxxrt > +DPADD+= ${LIBCXXRT} > +.else > +LDADD+= -lsupc++ > +DPADD+= ${LIBSTDCPLUSPLUS} > +.endif > + > SHLIB_MAJOR= 2 > > WITHOUT_MAN= > > Modified: head/lib/libproc/proc_sym.c > ============================================================================== > --- head/lib/libproc/proc_sym.c Thu Sep 6 02:07:58 2012 (r240155) > +++ head/lib/libproc/proc_sym.c Thu Sep 6 03:19:48 2012 (r240156) > @@ -46,6 +46,8 @@ > > #include "_libproc.h" > > +extern char *__cxa_demangle(const char *, char *, size_t *, int *); > + > static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); > > static void > @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin > if (addr >= rsym && addr <= (rsym + sym.st_size)) { > s = elf_strptr(e, dynsymstridx, sym.st_name); > if (s) { > - strlcpy(name, s, namesz); > + if (strlen(s) > 2 && > + s[0] == '_' && s[1] == 'Z') checking "strlen(s) > 2" is useless and not optimal here, you can omit it completely checking s[0] and s[1] is enough, it implies that length is >=2 you may add something like "s[2] != 0" if length should be strictly >2 > + __cxa_demangle(s, name, &namesz, NULL); > + else > + strlcpy(name, s, namesz); > memcpy(symcopy, &sym, sizeof(sym)); > /* > * DTrace expects the st_value to contain > @@ -302,7 +308,11 @@ symtab: > if (addr >= rsym && addr <= (rsym + sym.st_size)) { > s = elf_strptr(e, symtabstridx, sym.st_name); > if (s) { > - strlcpy(name, s, namesz); > + if (strlen(s) > 2 && > + s[0] == '_' && s[1] == 'Z') > + __cxa_demangle(s, name, &namesz, NULL); > + else > + strlcpy(name, s, namesz); the same here > memcpy(symcopy, &sym, sizeof(sym)); > /* > * DTrace expects the st_value to contain > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 12:15:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 515B8106564A; Thu, 6 Sep 2012 12:15:17 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2728FC12; Thu, 6 Sep 2012 12:15:15 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep12-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20120906121514.EJAE2716.viefep12-int.chello.at@edge01.upcmail.net>; Thu, 6 Sep 2012 14:15:14 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge01.upcmail.net with edge id voFD1j0252xdvHc01oFDo7; Thu, 06 Sep 2012 14:15:14 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id A0F666D466; Thu, 6 Sep 2012 14:15:13 +0200 (CEST) Date: Thu, 6 Sep 2012 14:15:13 +0200 From: Stefan Farfeleder To: Rui Paulo Message-ID: <20120906121513.GG1361@mole.fafoe.narf.at> References: <201209060319.q863JnDe050504@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201209060319.q863JnDe050504@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: r240156 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 12:15:17 -0000 On Thu, Sep 06, 2012 at 03:19:49AM +0000, Rui Paulo wrote: > @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin > if (addr >= rsym && addr <= (rsym + sym.st_size)) { > s = elf_strptr(e, dynsymstridx, sym.st_name); > if (s) { > - strlcpy(name, s, namesz); > + if (strlen(s) > 2 && > + s[0] == '_' && s[1] == 'Z') > + __cxa_demangle(s, name, &namesz, NULL); > + else > + strlcpy(name, s, namesz); > memcpy(symcopy, &sym, sizeof(sym)); > /* > * DTrace expects the st_value to contain According to the documentation, __cxa_demangle will realloc the buffer if it is too small and return the new buffer. This case is not handled correctly. Stefan From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 13:43:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8C7061065670; Thu, 6 Sep 2012 13:43:49 +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 77B998FC0A; Thu, 6 Sep 2012 13:43: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 q86DhnvJ029113; Thu, 6 Sep 2012 13:43:49 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86Dhn2r029111; Thu, 6 Sep 2012 13:43:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201209061343.q86Dhn2r029111@svn.freebsd.org> From: Martin Matuska Date: Thu, 6 Sep 2012 13:43: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: r240162 - head/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 13:43:49 -0000 Author: mm Date: Thu Sep 6 13:43:48 2012 New Revision: 240162 URL: http://svn.freebsd.org/changeset/base/240162 Log: Make r230454 more readable and vendor-like. PR: kern/171380 MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/sys/sid.h Modified: head/sys/cddl/compat/opensolaris/sys/sid.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/sid.h Thu Sep 6 10:10:56 2012 (r240161) +++ head/sys/cddl/compat/opensolaris/sys/sid.h Thu Sep 6 13:43:48 2012 (r240162) @@ -30,7 +30,8 @@ #define _OPENSOLARIS_SYS_SID_H_ typedef struct ksiddomain { - char kd_name[1]; /* Domain part of SID */ + char *kd_name; /* Domain part of SID */ + uint_t kd_len; } ksiddomain_t; typedef void ksid_t; @@ -38,8 +39,12 @@ static __inline ksiddomain_t * ksid_lookupdomain(const char *domain) { ksiddomain_t *kd; + size_t len; - kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP); + len = strlen(domain) + 1; + kd = kmem_alloc(sizeof(*kd), KM_SLEEP); + kd->kd_len = (uint_t)len; + kd->kd_name = kmem_alloc(len, KM_SLEEP); strcpy(kd->kd_name, domain); return (kd); } @@ -48,6 +53,7 @@ static __inline void ksiddomain_rele(ksiddomain_t *kd) { + kmem_free(kd->kd_name, kd->kd_len); kmem_free(kd, sizeof(*kd)); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 13:47:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7EEE106566B; Thu, 6 Sep 2012 13:47:42 +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 B369C8FC0A; Thu, 6 Sep 2012 13:47: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 q86DlgCF029499; Thu, 6 Sep 2012 13:47:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86Dlgqq029497; Thu, 6 Sep 2012 13:47:42 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201209061347.q86Dlgqq029497@svn.freebsd.org> From: Ed Maste Date: Thu, 6 Sep 2012 13:47: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: r240163 - head/contrib/gdb/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 13:47:42 -0000 Author: emaste Date: Thu Sep 6 13:47:42 2012 New Revision: 240163 URL: http://svn.freebsd.org/changeset/base/240163 Log: Fix "Corrupted DWARF expression" from (k)gdb. Google turned up Debian bug 405116, which describes the problem in sufficient detail to identify the overflowing variables. MFC after: 1 week Modified: head/contrib/gdb/gdb/dwarf2loc.h Modified: head/contrib/gdb/gdb/dwarf2loc.h ============================================================================== --- head/contrib/gdb/gdb/dwarf2loc.h Thu Sep 6 13:43:48 2012 (r240162) +++ head/contrib/gdb/gdb/dwarf2loc.h Thu Sep 6 13:47:42 2012 (r240163) @@ -38,7 +38,7 @@ struct dwarf2_locexpr_baton unsigned char *data; /* Length of the location expression. */ - unsigned short size; + unsigned long size; /* The objfile containing the symbol whose location we're computing. */ struct objfile *objfile; @@ -54,7 +54,7 @@ struct dwarf2_loclist_baton unsigned char *data; /* Length of the location list. */ - unsigned short size; + unsigned long size; /* The objfile containing the symbol whose location we're computing. */ /* Used (only???) by thread local variables. The objfile in which From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 13:54:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2367F106566C; Thu, 6 Sep 2012 13:54:02 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9988FC0A; Thu, 6 Sep 2012 13:54: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 q86Ds1r1030280; Thu, 6 Sep 2012 13:54:02 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86Ds10n030275; Thu, 6 Sep 2012 13:54:01 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201209061354.q86Ds10n030275@svn.freebsd.org> From: Fabien Thomas Date: Thu, 6 Sep 2012 13:54: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: r240164 - in head: lib/libpmc sys/dev/hwpmc sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 13:54:02 -0000 Author: fabient Date: Thu Sep 6 13:54:01 2012 New Revision: 240164 URL: http://svn.freebsd.org/changeset/base/240164 Log: Add Intel Ivy Bridge support to hwpmc(9). Update offcore RSP token for Sandy Bridge. Note: No uncore support. Will works on Family 6 Model 3a. MFC after: 1 month Tested by: bapt, grehan Added: head/lib/libpmc/pmc.ivybridge.3 (contents, props changed) Modified: head/lib/libpmc/Makefile head/lib/libpmc/libpmc.c head/lib/libpmc/pmc.sandybridge.3 head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_core.h head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Thu Sep 6 13:47:42 2012 (r240163) +++ head/lib/libpmc/Makefile Thu Sep 6 13:54:01 2012 (r240164) @@ -28,6 +28,7 @@ MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.iaf.3 +MAN+= pmc.ivybridge.3 MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Thu Sep 6 13:47:42 2012 (r240163) +++ head/lib/libpmc/libpmc.c Thu Sep 6 13:54:01 2012 (r240164) @@ -183,6 +183,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7() }; +static const struct pmc_event_descr ivybridge_event_table[] = +{ + __PMC_EV_ALIAS_IVYBRIDGE() +}; + static const struct pmc_event_descr sandybridge_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGE() @@ -222,6 +227,7 @@ PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -259,6 +265,7 @@ PMC_CLASS_TABLE_DESC(atom, IAP, atom, ia PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); +PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); @@ -365,14 +372,14 @@ static struct pmc_op_getdyneventinfo sof /* Event masks for events */ struct pmc_masks { const char *pm_name; - const uint32_t pm_value; + const uint64_t pm_value; }; #define PMCMASK(N,V) { .pm_name = #N, .pm_value = (V) } #define NULLMASK { .pm_name = NULL } #if defined(__amd64__) || defined(__i386__) static int -pmc_parse_mask(const struct pmc_masks *pmask, char *p, uint32_t *evmask) +pmc_parse_mask(const struct pmc_masks *pmask, char *p, uint64_t *evmask) { const struct pmc_masks *pm; char *q, *r; @@ -561,6 +568,8 @@ static struct pmc_event_alias core2_alia #define atom_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf +#define ivybridge_aliases core2_aliases +#define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf #define westmere_aliases core2_aliases @@ -663,7 +672,7 @@ static struct pmc_masks iap_transition_m NULLMASK }; -static struct pmc_masks iap_rsp_mask[] = { +static struct pmc_masks iap_rsp_mask_i7_wm[] = { PMCMASK(DMND_DATA_RD, (1 << 0)), PMCMASK(DMND_RFO, (1 << 1)), PMCMASK(DMND_IFETCH, (1 << 2)), @@ -682,12 +691,43 @@ static struct pmc_masks iap_rsp_mask[] = NULLMASK }; +static struct pmc_masks iap_rsp_mask_sb_ib[] = { + PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), + PMCMASK(REQ_DMND_RFO, (1ULL << 1)), + PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), + PMCMASK(REQ_WB, (1ULL << 3)), + PMCMASK(REQ_PF_DATA_RD, (1ULL << 4)), + PMCMASK(REQ_PF_RFO, (1ULL << 5)), + PMCMASK(REQ_PF_IFETCH, (1ULL << 6)), + PMCMASK(REQ_PF_LLC_DATA_RD, (1ULL << 7)), + PMCMASK(REQ_PF_LLC_RFO, (1ULL << 8)), + PMCMASK(REQ_PF_LLC_IFETCH, (1ULL << 9)), + PMCMASK(REQ_BUS_LOCKS, (1ULL << 10)), + PMCMASK(REQ_STRM_ST, (1ULL << 11)), + PMCMASK(REQ_OTHER, (1ULL << 15)), + PMCMASK(RES_ANY, (1ULL << 16)), + PMCMASK(RES_SUPPLIER_SUPP, (1ULL << 17)), + PMCMASK(RES_SUPPLIER_LLC_HITM, (1ULL << 18)), + PMCMASK(RES_SUPPLIER_LLC_HITE, (1ULL << 19)), + PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)), + PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)), + PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)), + PMCMASK(RES_SNOOP_SNPI_NONE, (1ULL << 31)), + PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)), + PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)), + PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)), + PMCMASK(RES_SNOOP_HIT_FWD, (1ULL << 35)), + PMCMASK(RES_SNOOP_HITM, (1ULL << 36)), + PMCMASK(RES_NON_DRAM, (1ULL << 37)), + NULLMASK +}; + static int iap_allocate_pmc(enum pmc_event pe, char *ctrspec, struct pmc_op_pmcallocate *pmc_config) { char *e, *p, *q; - uint32_t cachestate, evmask, rsp; + uint64_t cachestate, evmask, rsp; int count, n; pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE | @@ -753,7 +793,13 @@ iap_allocate_pmc(enum pmc_event pe, char } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7 || cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { - n = pmc_parse_mask(iap_rsp_mask, p, &rsp); + n = pmc_parse_mask(iap_rsp_mask_i7_wm, p, &rsp); + } else + return (-1); + } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { + n = pmc_parse_mask(iap_rsp_mask_sb_ib, p, &rsp); } else return (-1); } else @@ -1072,7 +1118,8 @@ k8_allocate_pmc(enum pmc_event pe, char { char *e, *p, *q; int n; - uint32_t count, evmask; + uint32_t count; + uint64_t evmask; const struct pmc_masks *pm, *pmask; pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); @@ -1554,7 +1601,8 @@ p4_allocate_pmc(enum pmc_event pe, char char *e, *p, *q; int count, has_tag, has_busreqtype, n; - uint32_t evmask, cccractivemask; + uint32_t cccractivemask; + uint64_t evmask; const struct pmc_masks *pm, *pmask; pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); @@ -1982,7 +2030,7 @@ p6_allocate_pmc(enum pmc_event pe, char struct pmc_op_pmcallocate *pmc_config) { char *e, *p, *q; - uint32_t evmask; + uint64_t evmask; int count, n; const struct pmc_masks *pm, *pmask; @@ -2622,6 +2670,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7_event_table; count = PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_IVYBRIDGE: + ev = ivybridge_event_table; + count = PMC_EVENT_TABLE_SIZE(ivybridge); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); @@ -2914,6 +2966,9 @@ pmc_init(void) pmc_class_table[n++] = &corei7uc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(corei7); break; + case PMC_CPU_INTEL_IVYBRIDGE: + PMC_MDEP_INIT_INTEL_V2(ivybridge); + break; case PMC_CPU_INTEL_SANDYBRIDGE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &sandybridgeuc_class_table_descr; @@ -3049,6 +3104,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = corei7_event_table; evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_IVYBRIDGE: + ev = ivybridge_event_table; + evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); Added: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmc.ivybridge.3 Thu Sep 6 13:54:01 2012 (r240164) @@ -0,0 +1,880 @@ +.\" Copyright (c) 2012 Fabien Thomas. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 24, 2012 +.Dt PMC.IVYBRIDGE 3 +.Os +.Sh NAME +.Nm pmc.ivybridge +.Nd measurement events for +.Tn Intel +.Tn Ivy Bridge +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Ivy Bridge" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to three classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Ivy Bridge PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +Intel(R) 64 and IA-32 Architectures Software Developers Manual" +.%T "Volume 3B: System Programming Guide, Part 2" +.%N "Order Number: 253669-043US" +.%D May 2012 +.%Q "Intel Corporation" +.Re +.Ss IVYBRIDGE FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss IVYBRIDGE PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li REQ_DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full and partial +cachelines as well as demand data page table entry cacheline reads. Does not +count L2 data read prefetches or instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNPI_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Ivy Bridge programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +loads blocked by overlapping with store buffer that cannot be forwarded . +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store- address uops dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare on address. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 81H +Misses in all TLB levels that cause a page walk of any page size from demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_COMPLETED +.Pq Event 08H , Umask 82H +Misses in all TLB levels that caused page walk completed of any size by demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_DURATION +.Pq Event 08H , Umask 84H +Cycle PMH is busy with a walk due to demand loads. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +Increments each cycle the # of Uops issued by the RAT to RS. +Set Cmask = 1, Inv = 1to count stalled cycles. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such uop has 3 sources (e.g. 2 +sources + immediate) regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SINGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision uops allocated. +.It Li ARITH.FPU_DIV_ACTIVE +.Pq Event 14H , Umask 01H +Cycles that the divider is active, includes INT and FP. Set 'edge =1, +cmask=1' to count the number of divides. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 01H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask 03H +Counts any demand and L1 HW prefetch data load requests to L2. +.It Li L2_RQSTS.RFO_HITS +.Pq Event 24H , Umask 04H +Counts the number of store RFO requests that hit the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 08H +Counts the number of store RFO requests that miss the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask 0CH +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 10H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 20H +Number of instruction fetches that missed the L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask 30H +Counts all L2 code requests. +.It Li L2_RQSTS.PF_HIT +.Pq Event 24H , Umask 40H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.PF_MISS +.Pq Event 24H , Umask 80H +Counts all L2 HW prefetcher requests that missed L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask C0H +Counts all L2 HW prefetcher requests. +.It Li L2_STORE_LOCK_RQSTS.MISS +.Pq Event 27H , Umask 01H +RFOs that miss cache lines. +.It Li L2_STORE_LOCK_RQSTS.HIT_M +.Pq Event 27H , Umask 08H +RFOs that hit cache lines in M state. +.It Li L2_STORE_LOCK_RQSTS.ALL +.Pq Event 27H , Umask 0FH +RFOs that access cache lines in any state. +.It Li L2_L1D_WB_RQSTS.MISS +.Pq Event 28H , Umask 01H +Not rejected writebacks that missed LLC. +.It Li L2_L1D_WB_RQSTS.HIT_E +.Pq Event 28H , Umask 04H +Not rejected writebacks from L1D to L2 cache lines in E state. +.It Li L2_L1D_WB_RQSTS.HIT_M +.Pq Event 28H , Umask 08H +Not rejected writebacks from L1D to L2 cache lines in M state. +.It Li L2_L1D_WB_RQSTS.ALL +.Pq Event 28H , Umask 0FH +Not rejected writebacks from L1D to L2 cache lines in any state. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core that reference a cache +line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for references to the last level +cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread is not in a halt state. +The thread enters the halt state when it is running the HLT instruction. The +core frequency may change from time to time due to power or thermal +throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses every cycle. Set Cmaks = 1 +and Edge =1 to count occurrences. +Counter 2 only. +Set Cmask = 1 to count cycles. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 02H +Miss in all TLB levels causes a page walk that completes of any page size +(4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 04H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 10H +Store operations that miss the first TLB level but hit the second and do not +cause page walks. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 01H +Number of integer Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.SIMD_NOT_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops that were eliminated. +.It Li MOVE_ELIMINATION.SIMD_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is in ring 0. +Use Edge to count transition. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li TLB_ACCESS.LOAD_STLB_HIT +.Pq Event 5FH , Umask 01H +Counts load operations that missed 1st level DTLB but hit the 2nd level. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand Code Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to +count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from MITE path. +Can combine Umask 04H and 20H. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ from DSB path. +Can combine Umask 08H and 10H +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set +Cmask = 1 to count cycles. Add Edge=1 to count # of delivery. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set +Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from MS by either DSB or +MITE. Set Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask = 4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask = 4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. +Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 02H +Misses in all ITLB levels that cause completed page walks. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 04H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 10H +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions executed, but not necessarily +retired. +Must combine with umask 40H, 80H. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions excluding calls and +indirect branches. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions that are not calls nor +returns. +Must combine with umask 80H. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, excluding non call +branch, executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and memory indirect, +executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, +10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions mispredicted. +Must combine with umask 40H, 80H. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch instructions that are not calls +nor returns. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch instructions, excluding +non call branch, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including both register and memory +indirect, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. Must combine with +01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per thread. +Use Cmask to qualify uop b/w. +.It Li UOPS_DISPATCHED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0. +.It Li UOPS_DISPATCHED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +.Pq Event A1H , Umask 04H +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +.Pq Event A1H , Umask 08H +Cycles which a store address uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2 +.Pq Event A1H , Umask 0CH +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +.Pq Event A1H , Umask 10H +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +.Pq Event A1H , Umask 20H +Cycles which a store address uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3 +.Pq Event A1H , Umask 30H +Cycles which a Uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_4 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 4. +.It Li UOPS_DISPATCHED_PORT.PORT_5 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available. (not including draining +form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li DSB2MITE_SWITCHES.COUNT +.Pq Event ABH , Umask 01H +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +.Pq Event ABH , Umask 02H +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.EXCEED_DSB_LINES +.Pq Event ACH , Umask 08H +DSB Fill encountered > 3 DSB lines. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes 4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including regular RFOs, locks, +ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and prefetch). +.It Li UOPS_EXECUTED.THREAD +.Pq Event B1H , Umask 01H +Counts total number of uops to be executed per-thread each cycle. Set Cmask += 1, INV =1 to count stall cycles. +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core each cycle. +Do not need to set ANY. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Off-core Response Performance Monitoring. +PMC0 only. +Requires programming MSR 01A6H. +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Off-core Response Performance Monitoring. +PMC3 only. +Requires programming MSR 01A7H. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread- specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce effect of PEBS shadow in +IP distribution. +PMC1 only. +Must quiesce other PMCs. +.It Li OTHER_ASSISTS.AVX_STORE +.Pq Event C1H , Umask 08H +Number of assists associated with 256-bit AVX store operations. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 10H +Number of transitions from AVX- 256 to legacy SSE when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 20H +Number of transitions from SSE to AVX-256 when penalty applicable. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use cmask=1 and invert to count +active cycles or stalled cycles. +Supports PEBS, use Any=1 for core granular. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load operations that refer to an +illegal address range with the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions retired. +Supports PEBS. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +Supports PEBS. +.It Li BR_MISP_RETIRED.NEAR_CALL +.Pq Event C5H , Umask 02H +Direct and indirect mispredicted near call instructions retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li BR_MISP_RETIRED.NOT_TAKEN +.Pq Event C5H , Umask 10H +Mispredicted not taken branch instructions retired. +.It Li BR_MISP_RETIRED.TAKEN +.Pq Event C5H , Umask 20H +Mispredicted taken branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Sample loads with specified latency threshold. +PMC3 only. +Specify threshold in MSR 0x3F6. +.It Li MEM_TRANS_RETIRED.PRECISE_STORE +.Pq Event CDH , Umask 02H +Sample stores and collect precise store operation via PEBS record. +PMC3 only. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine with umask 10H, 20H, +40H, 80H. +Supports PEBS. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. Combine with umask 10H, 20H, +40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_UOP_RETIRED.SPLIT +.Pq Event D0H , Umask 40H +Qualify retired memory uops with line split. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.ALL +.Pq Event D0H , Umask 80H +Qualify any retired memory uops. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.Pq Event D1H , Umask 01H +Retired load uops with L1 cache hits as data sources. +Supports PEBS. +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.Pq Event D1H , Umask 02H +Retired load uops with L2 cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.Pq Event D1H , Umask 04H +Retired load uops with LLC cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.Pq Event D1H , Umask 40H +Retired load uops which data sources were load uops missed L1 but hit FB due +to preceding miss to the same cache line with data not ready. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS +.Pq Event D2H , Umask 01H +Retired load uops which data sources were LLC hit and cross-core snoop +missed in on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT +.Pq Event D2H , Umask 02H +Retired load uops which data sources were LLC and cross-core snoop hits in +on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM +.Pq Event D2H , Umask 04H +Retired load uops which data sources were HitM responses from shared LLC. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE +.Pq Event D2H , Umask 08H +Retired load uops which data sources were hits in LLC without snoops +required. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM +.Pq Event D3H , Umask 01H +Retired load uops which data sources missed LLC but serviced from local +dram. +Supports PEBS. +.It Li L2_TRANS.DEMAND_DATA_RD +.Pq Event F0H , Umask 01H +Demand Data Read requests that access L2 cache. +.It Li L2_TRANS.RFO +.Pq Event F0H , Umask 02H +RFO requests that access L2 cache. +.It Li L2_TRANS.CODE_RD +.Pq Event F0H , Umask 04H +L2 cache accesses when fetching instructions. +.It Li L2_TRANS.ALL_PF +.Pq Event F0H , Umask 08H *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 14:04:33 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4056106566C; Thu, 6 Sep 2012 14:04:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2A88FC12; Thu, 6 Sep 2012 14:04:32 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q86E4T05031028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Sep 2012 00:04:30 +1000 Date: Fri, 7 Sep 2012 00:04:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201208111547.q7BFlNFD072661@svn.freebsd.org> Message-ID: <20120907000345.Y1834@besplex.bde.org> References: <201208111547.q7BFlNFD072661@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r239195 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 14:04:33 -0000 On Sat, 11 Aug 2012, Dimitry Andric wrote: > Log: > Add __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(), > since some older versions of gcc refuse to inline these otherwise. > > Requested by: bde > MFC after: 1 week Thanks. It works well to reduce unportabilities. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 14:59:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27766106564A; Thu, 6 Sep 2012 14:59:54 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11C888FC15; Thu, 6 Sep 2012 14:59: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 q86ExrEm038514; Thu, 6 Sep 2012 14:59:53 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86Exr56038506; Thu, 6 Sep 2012 14:59:53 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201209061459.q86Exr56038506@svn.freebsd.org> From: Josh Paetzel Date: Thu, 6 Sep 2012 14: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: r240165 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 14:59:54 -0000 Author: jpaetzel Date: Thu Sep 6 14:59:53 2012 New Revision: 240165 URL: http://svn.freebsd.org/changeset/base/240165 Log: Add TRIM support, enabled by default. Fix a bug installing components from a localPath. Allow autosizing of any partition, not just the last partition. Adjust how ZFS is laid out to work with Boot Environments. Submitted by: kmoore Obtained from: PC-BSD MFC after: 3 days Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Thu Sep 6 13:54:01 2012 (r240164) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Thu Sep 6 14:59:53 2012 (r240165) @@ -164,6 +164,38 @@ gen_glabel_name() export VAL="${NAME}${NUM}" }; +# Function to determine the size we can safely use when 0 is specified +get_autosize() +{ + # Disk tag to look for + dTag="$1" + + # Total MB Avail + get_disk_mediasize_mb "$2" + local _aSize=$VAL + + while read line + do + # Check for data on this slice + echo $line | grep -q "^${_dTag}-part=" 2>/dev/null + if [ $? -ne 0 ] ; then continue ; fi + + get_value_from_string "${line}" + STRING="$VAL" + + # Get the size of this partition + SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` + if [ $SIZE -eq 0 ] ; then continue ; fi + _aSize=`expr $_aSize - $SIZE` + done <${CFGF} + + # Pad the size a bit + _aSize=`expr $_aSize - 2` + + VAL="$_aSize" + export VAL +}; + # Function to setup partitions using gpart setup_gpart_partitions() { @@ -173,6 +205,7 @@ setup_gpart_partitions() local _sNum="$4" local _pType="$5" FOUNDPARTS="1" + USEDAUTOSIZE=0 # Lets read in the config file now and setup our partitions if [ "${_pType}" = "gpt" ] ; then @@ -245,7 +278,15 @@ setup_gpart_partitions() if [ "$SIZE" = "0" ] then - SOUT="" + if [ $USEDAUTOSIZE -eq 1 ] ; then + exit_err "ERROR: You can not have two partitions with a size of 0 specified!" + fi + case ${_pType} in + gpt|apm) get_autosize "${_dTag}" "$_pDisk" ;; + *) get_autosize "${_dTag}" "$_wSlice" ;; + esac + SOUT="-s ${VAL}M" + USEDAUTOSIZE=1 else SOUT="-s ${SIZE}M" fi Modified: head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh Thu Sep 6 13:54:01 2012 (r240164) +++ head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh Thu Sep 6 14:59:53 2012 (r240165) @@ -49,7 +49,7 @@ zfs_cleanup_unmount() # Creating a dedicated "/boot" partition cat ${FSMNT}/boot/loader.conf 2>/dev/null | grep -q "vfs.root.mountfrom=" 2>/dev/null if [ $? -ne 0 ] ; then - echo "vfs.root.mountfrom=\"zfs:${ZPOOLNAME}\"" >> ${FSMNT}/boot/loader.conf + echo "vfs.root.mountfrom=\"zfs:${ZPOOLNAME}/ROOT/default\"" >> ${FSMNT}/boot/loader.conf fi export FOUNDZFSROOT="${ZPOOLNAME}" fi @@ -195,8 +195,8 @@ setup_fstab() if [ $? -eq 0 ] ; then if [ "${PARTFS}" = "ZFS" ] ; then ROOTFSTYPE="zfs" - XPOOLNAME=$(get_zpool_name "${PARTDEV}") - ROOTFS="${ZPOOLNAME}" + ZPOOLNAME=$(get_zpool_name "${PARTDEV}") + ROOTFS="${ZPOOLNAME}/ROOT/default" else ROOTFS="${DEVICE}" ROOTFSTYPE="ufs" Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Thu Sep 6 13:54:01 2012 (r240164) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Thu Sep 6 14:59:53 2012 (r240165) @@ -224,6 +224,15 @@ get_disk_mediasize() export VAL="${mediasize}" }; +# Function which returns a target disks mediasize in megabytes +get_disk_mediasize_mb() +{ + mediasize=`diskinfo -v ${1} | grep "# mediasize in bytes" | tr -s ' ' | cut -f 2` + mediasize=`expr $mediasize / 1024` + mediasize=`expr $mediasize / 1024` + export VAL="${mediasize}" +}; + # Function to delete all gparts before starting an install delete_all_gpart() { Modified: head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh Thu Sep 6 13:54:01 2012 (r240164) +++ head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh Thu Sep 6 14:59:53 2012 (r240165) @@ -71,8 +71,16 @@ copy_component() fetch_file "${FTPPATH}/${COMPFILEDIR}/${SUBDIR}/${CFILE}" "${FSMNT}/${COMPTMPDIR}/${CFILE}" "0" RESULT="$?" ;; - - sftp) ;; + local) + get_value_from_cfg localPath + if [ -z "$VAL" ]; then + exit_err "Install medium was set to local, but no localPath was provided!" + fi + LOCALPATH=$VAL + cp ${LOCALPATH}/${COMPFILEDIR}/${SUBDIR}/${CFILE} \ + ${FSMNT}/${COMPTMPDIR} >>${LOGOUT} 2>>${LOGOUT} + RESULT="$?" + ;; esac if [ "${RESULT}" != "0" ] Modified: head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Thu Sep 6 13:54:01 2012 (r240164) +++ head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Thu Sep 6 14:59:53 2012 (r240165) @@ -81,15 +81,34 @@ mount_partition() done if [ "${ZMNT}" = "/" ] ; then - ZNAME="" + # If creating ZFS / dataset, give it name that beadm works with + ZNAME="/ROOT/default" + ZMKMNT="" + echo_log "zfs create $zcopt -p ${ZPOOLNAME}/ROOT" + rc_halt "zfs create $zcopt -p ${ZPOOLNAME}/ROOT" + echo_log "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" + rc_halt "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" else ZNAME="${ZMNT}" + ZMKMNT="${ZMNT}" echo_log "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" rc_halt "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" fi sleep 2 if [ -z "$zcopt" ] ; then - rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}" + rc_halt "zfs set mountpoint=${FSMNT}${ZMKMNT} ${ZPOOLNAME}${ZNAME}" + fi + + # Do we need to make this / zfs dataset bootable? + if [ "$ZMNT" = "/" ] ; then + echo_log "Stamping ${ZPOOLNAME}/ROOT/default as bootfs" + rc_halt "zpool set bootfs=${ZPOOLNAME}/ROOT/default ${ZPOOLNAME}" + fi + + # Do we need to make this /boot zfs dataset bootable? + if [ "$ZMNT" = "/boot" ] ; then + echo_log "Stamping ${ZPOOLNAME}${ZMNT} as bootfs" + rc_halt "zpool set bootfs=${ZPOOLNAME}${ZMNT} ${ZPOOLNAME}" fi # If no ZFS options, we can skip Modified: head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Thu Sep 6 13:54:01 2012 (r240164) +++ head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Thu Sep 6 14:59:53 2012 (r240165) @@ -72,16 +72,6 @@ setup_zfs_filesystem() # Disable atime for this zfs partition, speed increase rc_nohalt "zfs set atime=off ${ZPOOLNAME}" - # Check if we need to set a bootable zpool - for i in `echo ${PARTMNT} | sed 's|,| |g'` - do - if [ "${i}" = "/" -o "${i}" = "/boot" ] ; then - if [ "$HAVEBOOT" = "YES" ] ; then continue ; fi - echo_log "Stamping zpool as bootfs" - rc_halt "zpool set bootfs=${ZPOOLNAME} ${ZPOOLNAME}" - fi - done - }; # Runs newfs on all the partiions which we've setup with bsdlabel @@ -144,7 +134,7 @@ setup_filesystems() UFS) echo_log "NEWFS: ${PARTDEV} - ${PARTFS}" sleep 2 - rc_halt "newfs ${PARTXTRAOPTS} ${PARTDEV}${EXT}" + rc_halt "newfs -t ${PARTXTRAOPTS} ${PARTDEV}${EXT}" sleep 2 rc_halt "sync" rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}" @@ -160,7 +150,7 @@ setup_filesystems() UFS+S) echo_log "NEWFS: ${PARTDEV} - ${PARTFS}" sleep 2 - rc_halt "newfs ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}" + rc_halt "newfs -t ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}" sleep 2 rc_halt "sync" rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}" @@ -175,7 +165,7 @@ setup_filesystems() UFS+SUJ) echo_log "NEWFS: ${PARTDEV} - ${PARTFS}" sleep 2 - rc_halt "newfs ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}" + rc_halt "newfs -t ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}" sleep 2 rc_halt "sync" rc_halt "tunefs -j enable ${PARTDEV}${EXT}" From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 16:26:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4BB08106564A; Thu, 6 Sep 2012 16:26:05 +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 366F38FC08; Thu, 6 Sep 2012 16:26: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 q86GQ5jp050015; Thu, 6 Sep 2012 16:26:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86GQ55u050012; Thu, 6 Sep 2012 16:26:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209061626.q86GQ55u050012@svn.freebsd.org> From: Alan Cox Date: Thu, 6 Sep 2012 16:26: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: r240166 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 16:26:05 -0000 Author: alc Date: Thu Sep 6 16:26:04 2012 New Revision: 240166 URL: http://svn.freebsd.org/changeset/base/240166 Log: There is no need to release the pvh global lock around calls to pmap_get_pv_entry(). In fact, some callers already held it around calls. (In earlier versions, the same statements would apply to the page queues lock.) While I'm here tidy up the style of a few nearby statements and revise some comments. Tested by: Ian Lepore Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Sep 6 14:59:53 2012 (r240165) +++ head/sys/arm/arm/pmap.c Thu Sep 6 16:26:04 2012 (r240166) @@ -1584,13 +1584,13 @@ pmap_clearbit(struct vm_page *pg, u_int * pmap_remove_pv: remove a mappiing from a vm_page list * * NOTE: pmap_enter_pv expects to lock the pvh itself - * pmap_remove_pv expects te caller to lock the pvh before calling + * pmap_remove_pv expects the caller to lock the pvh before calling */ /* * pmap_enter_pv: enter a mapping onto a vm_page lst * - * => caller should hold the proper lock on pmap_main_lock + * => caller should hold the proper lock on pvh_global_lock * => caller should have pmap locked * => we will gain the lock on the vm_page and allocate the new pv_entry * => caller should adjust ptp's wire_count before calling @@ -1600,12 +1600,11 @@ static void pmap_enter_pv(struct vm_page *pg, struct pv_entry *pve, pmap_t pm, vm_offset_t va, u_int flags) { - int km; rw_assert(&pvh_global_lock, RA_WLOCKED); - if (pg->md.pv_kva) { + if (pg->md.pv_kva != 0) { /* PMAP_ASSERT_LOCKED(pmap_kernel()); */ pve->pv_pmap = pmap_kernel(); pve->pv_va = pg->md.pv_kva; @@ -1617,10 +1616,8 @@ 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()); - rw_wunlock(&pvh_global_lock); if ((pve = pmap_get_pv_entry()) == NULL) - panic("pmap_kenter_internal: no pv entries"); - rw_wlock(&pvh_global_lock); + panic("pmap_kenter_pv: no pv entries"); if (km) PMAP_LOCK(pmap_kernel()); } @@ -2824,22 +2821,20 @@ pmap_kenter_internal(vm_offset_t va, vm_ *pte |= L2_S_PROT_U; PTE_SYNC(pte); - /* kernel direct mappings can be shared, so use a pv_entry - * to ensure proper caching. - * - * The pvzone is used to delay the recording of kernel - * mappings until the VM is running. - * - * This expects the physical memory to have vm_page_array entry. - */ - if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa))) { + /* + * A kernel mapping may not be the page's only mapping, so create a PV + * entry to ensure proper caching. + * + * The existence test for the pvzone is used to delay the recording of + * kernel mappings until the VM system is fully initialized. + * + * This expects the physical memory to have a vm_page_array entry. + */ + if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) != NULL) { rw_wlock(&pvh_global_lock); - if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva) { - /* release vm_page lock for pv_entry UMA */ - rw_wunlock(&pvh_global_lock); + if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva != 0) { if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); - rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap_kernel()); pmap_enter_pv(m, pve, pmap_kernel(), va, PVF_WRITE | PVF_UNMAN); From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 16:43:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12094106566B for ; Thu, 6 Sep 2012 16:43:10 +0000 (UTC) (envelope-from bryan@shatow.net) Received: from secure.xzibition.com (secure.xzibition.com [173.160.118.92]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF818FC16 for ; Thu, 6 Sep 2012 16:43:09 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=shatow.net; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=sweb; b=gK73sq UN0gqgq/mvSaN1ca5zn0qdYVccRgBClFuWZLd0zOMYvtLx8DsQOuiyUrUoP6GVuH C3DNDabNiaiHTrRrZOLq0KvcbLuOXrP55AU17MwooPIUh7HtKv8nx75I3YkE6W2I pFKetxrlVLhVftjXMfQdldH7pB898joQ3nqkc= DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=shatow.net; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=sweb; bh=bZsTizdi6CqT 8Gzq/0Eh4YqyVDetY9xdmw7bgClzBeM=; b=jGkCwQZ5SSRbBPQvPJnvwYPP+NFG n9x2VfyOYDlcBtNbrdhmj/lIUW9XODoyHyGfNCOEnD6w5MbjSCxCA3QD6T7oAHHL rmYqF2lhd4WLAYKqey0PYAq2frl7yxtJcJtj/Vaxac2V6TB21VqPhGY0OqZJPNRB FiGww+MIMvQw52g= Received: (qmail 5835 invoked from network); 6 Sep 2012 11:43:00 -0500 Received: from unknown (HELO ?192.168.0.74?) (bryan@shatow.net@74.94.87.209) by sweb.xzibition.com with ESMTPA; 6 Sep 2012 11:43:00 -0500 Message-ID: <5048D2A0.5040205@shatow.net> Date: Thu, 06 Sep 2012 11:43:12 -0500 From: Bryan Drewery User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Josh Paetzel , Kris Moore References: <201209061459.q86Exr56038506@svn.freebsd.org> In-Reply-To: <201209061459.q86Exr56038506@svn.freebsd.org> X-Enigmail-Version: 1.4.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240165 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 16:43:10 -0000 On 9/6/2012 9:59 AM, Josh Paetzel wrote: > Author: jpaetzel > Date: Thu Sep 6 14:59:53 2012 > New Revision: 240165 > URL: http://svn.freebsd.org/changeset/base/240165 > > Log: > Add TRIM support, enabled by default. > Fix a bug installing components from a localPath. > Allow autosizing of any partition, not just the last partition. > Adjust how ZFS is laid out to work with Boot Environments. > > Submitted by: kmoore > Obtained from: PC-BSD > MFC after: 3 days Thanks! The (UFS) TRIM and BE stuff is great to have here. Bryan From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 18:02:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F37731065674; Thu, 6 Sep 2012 18:02: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 DF29C8FC0C; Thu, 6 Sep 2012 18:02: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 q86I2Wv6061914; Thu, 6 Sep 2012 18:02:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86I2Ww2061911; Thu, 6 Sep 2012 18:02:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209061802.q86I2Ww2061911@svn.freebsd.org> From: John Baldwin Date: Thu, 6 Sep 2012 18:02: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: r240170 - in head/sys/modules: . ct X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 18:02:33 -0000 Author: jhb Date: Thu Sep 6 18:02:32 2012 New Revision: 240170 URL: http://svn.freebsd.org/changeset/base/240170 Log: Add a kernel module on pc98 for the ct(4) driver. Added: head/sys/modules/ct/ head/sys/modules/ct/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Sep 6 17:28:47 2012 (r240169) +++ head/sys/modules/Makefile Thu Sep 6 18:02:32 2012 (r240170) @@ -78,6 +78,7 @@ SUBDIR= \ ${_crypto} \ ${_cryptodev} \ ${_cs} \ + ${_ct} \ ${_ctau} \ ${_cxgb} \ cxgbe \ @@ -607,6 +608,7 @@ _x86bios= x86bios .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus +_ct= ct _pmc= pmc _snc= snc .endif Added: head/sys/modules/ct/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ct/Makefile Thu Sep 6 18:02:32 2012 (r240170) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/ct + +KMOD= ct +SRCS= bshw_machdep.c ct.c ct_isa.c +SRCS+= device_if.h bus_if.h isa_if.h +SRCS+= opt_ct.h opt_cam.h opt_scsi.h opt_ddb.h + +.include From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 18:53:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34243106566C; Thu, 6 Sep 2012 18:53: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 1D0F58FC08; Thu, 6 Sep 2012 18:53: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 q86IrY63068374; Thu, 6 Sep 2012 18:53:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86IrX9J068367; Thu, 6 Sep 2012 18:53:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209061853.q86IrX9J068367@svn.freebsd.org> From: John Baldwin Date: Thu, 6 Sep 2012 18:53: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: r240172 - in head/sys: cam/scsi dev/ct dev/ncv dev/nsp dev/stg sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 18:53:34 -0000 Author: jhb Date: Thu Sep 6 18:53:33 2012 New Revision: 240172 URL: http://svn.freebsd.org/changeset/base/240172 Log: Remove NetBSD compat shims for drivers originally shared with NetBSD/pc98. NetBSD/pc98 was never merged into the main NetBSD tree and is no longer developed. Adding locking to these drivers would have made the compat shims hard to impossible to maintain, so remove the shims to ease future changes. These changes were verified by md5. Some additional shims can be removed that do affect the compiled results that I will probably do in another round. Approved by: nyan (tentatively) Deleted: head/sys/sys/device_port.h Modified: head/sys/cam/scsi/scsi_low.c head/sys/cam/scsi/scsi_low.h head/sys/cam/scsi/scsi_low_pisa.c head/sys/cam/scsi/scsi_low_pisa.h head/sys/dev/ct/bshw_machdep.c head/sys/dev/ct/ct.c head/sys/dev/ct/ct_isa.c head/sys/dev/ct/ctvar.h head/sys/dev/ncv/ncr53c500.c head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/ncv/ncr53c500var.h head/sys/dev/nsp/nsp.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/nsp/nspvar.h head/sys/dev/stg/tmc18c30.c head/sys/dev/stg/tmc18c30_pccard.c head/sys/dev/stg/tmc18c30var.h Modified: head/sys/cam/scsi/scsi_low.c ============================================================================== --- head/sys/cam/scsi/scsi_low.c Thu Sep 6 18:31:56 2012 (r240171) +++ head/sys/cam/scsi/scsi_low.c Thu Sep 6 18:53:33 2012 (r240172) @@ -14,13 +14,7 @@ __FBSDID("$FreeBSD$"); /* #define SCSI_LOW_QCLEAR_AFTER_CA */ /* #define SCSI_LOW_FLAGS_QUIRKS_OK */ -#ifdef __NetBSD__ -#define SCSI_LOW_TARGET_OPEN -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ #define SCSI_LOW_FLAGS_QUIRKS_OK -#endif /* __FreeBSD__ */ /*- * [NetBSD for NEC PC-98 series] @@ -71,41 +65,12 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#ifdef __FreeBSD__ -#if __FreeBSD_version >= 500001 #include -#else -#include -#endif -#endif /* __FreeBSD__ */ - #include #include #include #include -#ifdef __NetBSD__ -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ #include #include #include @@ -119,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include -#endif /* __FreeBSD__ */ /************************************************************** * Constants @@ -392,501 +356,6 @@ scsi_low_translate_error_code(cb, tp) return tp->error_code; } -#ifdef SCSI_LOW_INTERFACE_XS -/************************************************************** - * SCSI INTERFACE (XS) - **************************************************************/ -#define SCSI_LOW_MINPHYS 0x10000 -#define SCSI_LOW_MALLOC(size) malloc((size), M_SCSILOW, M_NOWAIT) -#define SCSI_LOW_FREE(pt) free((pt), M_SCSILOW) -#define SCSI_LOW_ALLOC_CCB(flags) scsi_low_get_ccb((flags)) -#define SCSI_LOW_XS_POLL_HZ 1000 - -static int scsi_low_poll_xs(struct scsi_low_softc *, struct slccb *); -static void scsi_low_scsi_minphys_xs(struct buf *); -#ifdef SCSI_LOW_TARGET_OPEN -static int scsi_low_target_open(struct scsipi_link *, struct cfdata *); -#endif /* SCSI_LOW_TARGET_OPEN */ -static int scsi_low_scsi_cmd_xs(struct scsipi_xfer *); -static int scsi_low_enable_xs(void *, int); -static int scsi_low_ioctl_xs(struct scsipi_link *, u_long, caddr_t, int, struct proc *); - -static int scsi_low_attach_xs(struct scsi_low_softc *); -static int scsi_low_world_start_xs(struct scsi_low_softc *); -static int scsi_low_dettach_xs(struct scsi_low_softc *); -static int scsi_low_ccb_setup_xs(struct scsi_low_softc *, struct slccb *); -static int scsi_low_done_xs(struct scsi_low_softc *, struct slccb *); -static void scsi_low_timeout_xs(struct scsi_low_softc *, int, int); -static u_int scsi_low_translate_quirks_xs(u_int); -static void scsi_low_setup_quirks_xs(struct targ_info *, struct lun_info *, u_int); - -struct scsi_low_osdep_funcs scsi_low_osdep_funcs_xs = { - scsi_low_attach_xs, - scsi_low_world_start_xs, - scsi_low_dettach_xs, - scsi_low_ccb_setup_xs, - scsi_low_done_xs, - scsi_low_timeout_xs -}; - -struct scsipi_device scsi_low_dev = { - NULL, /* Use default error handler */ - NULL, /* have a queue, served by this */ - NULL, /* have no async handler */ - NULL, /* Use default 'done' routine */ -}; - -struct scsi_low_error_code scsi_low_error_code_xs[] = { - {0, XS_NOERROR}, - {SENSEIO, XS_SENSE}, - {BUSYERR, XS_BUSY }, - {SELTIMEOUTIO, XS_SELTIMEOUT}, - {TIMEOUTIO, XS_TIMEOUT}, - {-1, XS_DRIVER_STUFFUP} -}; - -static int -scsi_low_ioctl_xs(link, cmd, addr, flag, p) - struct scsipi_link *link; - u_long cmd; - caddr_t addr; - int flag; - struct proc *p; -{ - struct scsi_low_softc *slp; - int s, error = ENOTTY; - - slp = (struct scsi_low_softc *) link->adapter_softc; - if ((slp->sl_flags & HW_INACTIVE) != 0) - return ENXIO; - - if (cmd == SCBUSIORESET) - { - s = SCSI_LOW_SPLSCSI(); - scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL); - splx(s); - error = 0; - } - else if (slp->sl_funcs->scsi_low_ioctl != 0) - { - error = (*slp->sl_funcs->scsi_low_ioctl) - (slp, cmd, addr, flag, p); - } - - return error; -} - -static int -scsi_low_enable_xs(arg, enable) - void *arg; - int enable; -{ - struct scsi_low_softc *slp = arg; - - if (enable != 0) - { - if ((slp->sl_flags & HW_INACTIVE) != 0) - return ENXIO; - } - else - { - if ((slp->sl_flags & HW_INACTIVE) != 0 || - (slp->sl_flags & HW_POWERCTRL) == 0) - return 0; - - slp->sl_flags |= HW_POWDOWN; - if (slp->sl_funcs->scsi_low_power != NULL) - { - (*slp->sl_funcs->scsi_low_power) - (slp, SCSI_LOW_POWDOWN); - } - } - return 0; -} - -static void -scsi_low_scsi_minphys_xs(bp) - struct buf *bp; -{ - - if (bp->b_bcount > SCSI_LOW_MINPHYS) - bp->b_bcount = SCSI_LOW_MINPHYS; - minphys(bp); -} - -static int -scsi_low_poll_xs(slp, cb) - struct scsi_low_softc *slp; - struct slccb *cb; -{ - struct scsipi_xfer *xs = cb->osdep; - int tcount; - - cb->ccb_flags |= CCB_NOSDONE; - tcount = 0; - - while (slp->sl_nio > 0) - { - SCSI_LOW_DELAY((1000 * 1000) / SCSI_LOW_XS_POLL_HZ); - - (*slp->sl_funcs->scsi_low_poll) (slp); - - if ((slp->sl_flags & (HW_INACTIVE | HW_INITIALIZING)) != 0) - { - cb->ccb_flags |= CCB_NORETRY; - cb->ccb_error |= FATALIO; - (void) scsi_low_revoke_ccb(slp, cb, 1); - printf("%s: hardware inactive in poll mode\n", - slp->sl_xname); - } - - if ((xs->flags & ITSDONE) != 0) - break; - - if (tcount ++ < SCSI_LOW_XS_POLL_HZ / SCSI_LOW_TIMEOUT_HZ) - continue; - - tcount = 0; - scsi_low_timeout_check(slp); - } - - xs->flags |= ITSDONE; - scsipi_done(xs); - return COMPLETE; -} - -static int -scsi_low_scsi_cmd_xs(xs) - struct scsipi_xfer *xs; -{ - struct scsipi_link *splp = xs->sc_link; - struct scsi_low_softc *slp = splp->adapter_softc; - struct targ_info *ti; - struct lun_info *li; - struct slccb *cb; - int s, targ, lun, flags, rv; - - if ((cb = SCSI_LOW_ALLOC_CCB(xs->flags & SCSI_NOSLEEP)) == NULL) - return TRY_AGAIN_LATER; - - targ = splp->scsipi_scsi.target, - lun = splp->scsipi_scsi.lun; - ti = slp->sl_ti[targ]; - - cb->osdep = xs; - cb->bp = xs->bp; - - if ((xs->flags & SCSI_POLL) == 0) - flags = CCB_AUTOSENSE; - else - flags = CCB_AUTOSENSE | CCB_POLLED; - - - s = SCSI_LOW_SPLSCSI(); - li = scsi_low_alloc_li(ti, lun, 1); - if ((u_int) splp->quirks != li->li_sloi.sloi_quirks) - { - scsi_low_setup_quirks_xs(ti, li, (u_int) splp->quirks); - } - - if ((xs->flags & SCSI_RESET) != 0) - { - flags |= CCB_NORETRY | CCB_URGENT; - scsi_low_enqueue(slp, ti, li, cb, flags, SCSI_LOW_MSG_RESET); - } - else - { - if (ti->ti_setup_msg != 0) - { - scsi_low_message_enqueue(slp, ti, li, flags); - } - - flags |= CCB_SCSIIO; - scsi_low_enqueue(slp, ti, li, cb, flags, 0); - } - -#ifdef SCSI_LOW_DEBUG - if (SCSI_LOW_DEBUG_TEST_GO(SCSI_LOW_ABORT_CHECK, ti->ti_id) != 0) - { - scsi_low_test_abort(slp, ti, li); - } -#endif /* SCSI_LOW_DEBUG */ - - if ((cb->ccb_flags & CCB_POLLED) != 0) - { - rv = scsi_low_poll_xs(slp, cb); - } - else - { - rv = SUCCESSFULLY_QUEUED; - } - splx(s); - return rv; -} - -static int -scsi_low_attach_xs(slp) - struct scsi_low_softc *slp; -{ - struct scsipi_adapter *sap; - struct scsipi_link *splp; - - strncpy(slp->sl_xname, slp->sl_dev.dv_xname, 16); - - sap = SCSI_LOW_MALLOC(sizeof(*sap)); - if (sap == NULL) - return ENOMEM; - splp = SCSI_LOW_MALLOC(sizeof(*splp)); - if (splp == NULL) - { - SCSI_LOW_FREE(sap); - return ENOMEM; - } - - SCSI_LOW_BZERO(sap, sizeof(*sap)); - SCSI_LOW_BZERO(splp, sizeof(*splp)); - - sap->scsipi_cmd = scsi_low_scsi_cmd_xs; - sap->scsipi_minphys = scsi_low_scsi_minphys_xs; - sap->scsipi_enable = scsi_low_enable_xs; - sap->scsipi_ioctl = scsi_low_ioctl_xs; -#ifdef SCSI_LOW_TARGET_OPEN - sap->open_target_lu = scsi_low_target_open; -#endif /* SCSI_LOW_TARGET_OPEN */ - - splp->adapter_softc = slp; - splp->scsipi_scsi.adapter_target = slp->sl_hostid; - splp->scsipi_scsi.max_target = slp->sl_ntargs - 1; - splp->scsipi_scsi.max_lun = slp->sl_nluns - 1; - splp->scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE; - splp->openings = slp->sl_openings; - splp->type = BUS_SCSI; - splp->adapter_softc = slp; - splp->adapter = sap; - splp->device = &scsi_low_dev; - - slp->sl_si.si_splp = splp; - slp->sl_show_result = SHOW_ALL_NEG; - return 0; -} - -static int -scsi_low_world_start_xs(slp) - struct scsi_low_softc *slp; -{ - - return 0; -} - -static int -scsi_low_dettach_xs(slp) - struct scsi_low_softc *slp; -{ - - /* - * scsipi does not have dettach bus fucntion. - * - scsipi_dettach_scsibus(slp->sl_si.si_splp); - */ - return 0; -} - -static int -scsi_low_ccb_setup_xs(slp, cb) - struct scsi_low_softc *slp; - struct slccb *cb; -{ - struct scsipi_xfer *xs = (struct scsipi_xfer *) cb->osdep; - - if ((cb->ccb_flags & CCB_SCSIIO) != 0) - { - cb->ccb_scp.scp_cmd = (u_int8_t *) xs->cmd; - cb->ccb_scp.scp_cmdlen = xs->cmdlen; - cb->ccb_scp.scp_data = xs->data; - cb->ccb_scp.scp_datalen = xs->datalen; - cb->ccb_scp.scp_direction = (xs->flags & SCSI_DATA_OUT) ? - SCSI_LOW_WRITE : SCSI_LOW_READ; - cb->ccb_tcmax = xs->timeout / 1000; - } - else - { - scsi_low_unit_ready_cmd(cb); - } - return SCSI_LOW_START_QTAG; -} - -static int -scsi_low_done_xs(slp, cb) - struct scsi_low_softc *slp; - struct slccb *cb; -{ - struct scsipi_xfer *xs; - - xs = (struct scsipi_xfer *) cb->osdep; - if (cb->ccb_error == 0) - { - xs->error = XS_NOERROR; - xs->resid = 0; - } - else - { - if (cb->ccb_rcnt >= slp->sl_max_retry) - cb->ccb_error |= ABORTIO; - - if ((cb->ccb_flags & CCB_NORETRY) == 0 && - (cb->ccb_error & ABORTIO) == 0) - return EJUSTRETURN; - - if ((cb->ccb_error & SENSEIO) != 0) - { - xs->sense.scsi_sense = cb->ccb_sense; - } - - xs->error = scsi_low_translate_error_code(cb, - &scsi_low_error_code_xs[0]); - -#ifdef SCSI_LOW_DIAGNOSTIC - if ((cb->ccb_flags & CCB_SILENT) == 0 && - cb->ccb_scp.scp_cmdlen > 0 && - (scsi_low_cmd_flags[cb->ccb_scp.scp_cmd[0]] & - SCSI_LOW_CMD_ABORT_WARNING) != 0) - { - printf("%s: WARNING: scsi_low IO abort\n", - slp->sl_xname); - scsi_low_print(slp, NULL); - } -#endif /* SCSI_LOW_DIAGNOSTIC */ - } - - if (cb->ccb_scp.scp_status == ST_UNKNOWN) - xs->status = 0; /* XXX */ - else - xs->status = cb->ccb_scp.scp_status; - - xs->flags |= ITSDONE; - if ((cb->ccb_flags & CCB_NOSDONE) == 0) - scsipi_done(xs); - - return 0; -} - -static void -scsi_low_timeout_xs(slp, ch, action) - struct scsi_low_softc *slp; - int ch; - int action; -{ - - switch (ch) - { - case SCSI_LOW_TIMEOUT_CH_IO: - switch (action) - { - case SCSI_LOW_TIMEOUT_START: - timeout(scsi_low_timeout, slp, - hz / SCSI_LOW_TIMEOUT_HZ); - break; - case SCSI_LOW_TIMEOUT_STOP: - untimeout(scsi_low_timeout, slp); - break; - } - break; - - case SCSI_LOW_TIMEOUT_CH_ENGAGE: - switch (action) - { - case SCSI_LOW_TIMEOUT_START: - timeout(scsi_low_engage, slp, 1); - break; - case SCSI_LOW_TIMEOUT_STOP: - untimeout(scsi_low_engage, slp); - break; - } - break; - - case SCSI_LOW_TIMEOUT_CH_RECOVER: - break; - } -} - -u_int -scsi_low_translate_quirks_xs(quirks) - u_int quirks; -{ - u_int flags; - - flags = SCSI_LOW_DISK_LFLAGS | SCSI_LOW_DISK_TFLAGS; - -#ifdef SDEV_NODISC - if (quirks & SDEV_NODISC) - flags &= ~SCSI_LOW_DISK_DISC; -#endif /* SDEV_NODISC */ -#ifdef SDEV_NOPARITY - if (quirks & SDEV_NOPARITY) - flags &= ~SCSI_LOW_DISK_PARITY; -#endif /* SDEV_NOPARITY */ -#ifdef SDEV_NOCMDLNK - if (quirks & SDEV_NOCMDLNK) - flags &= ~SCSI_LOW_DISK_LINK; -#endif /* SDEV_NOCMDLNK */ -#ifdef SDEV_NOTAG - if (quirks & SDEV_NOTAG) - flags &= ~SCSI_LOW_DISK_QTAG; -#endif /* SDEV_NOTAG */ -#ifdef SDEV_NOSYNC - if (quirks & SDEV_NOSYNC) - flags &= ~SCSI_LOW_DISK_SYNC; -#endif /* SDEV_NOSYNC */ - - return flags; -} - -static void -scsi_low_setup_quirks_xs(ti, li, flags) - struct targ_info *ti; - struct lun_info *li; - u_int flags; -{ - u_int quirks; - - li->li_sloi.sloi_quirks = flags; - quirks = scsi_low_translate_quirks_xs(flags); - ti->ti_quirks = quirks & SCSI_LOW_DISK_TFLAGS; - li->li_quirks = quirks & SCSI_LOW_DISK_LFLAGS; - ti->ti_flags_valid |= SCSI_LOW_TARG_FLAGS_QUIRKS_VALID; - li->li_flags_valid |= SCSI_LOW_LUN_FLAGS_QUIRKS_VALID; - scsi_low_calcf_target(ti); - scsi_low_calcf_lun(li); - scsi_low_calcf_show(li); -} - -#ifdef SCSI_LOW_TARGET_OPEN -static int -scsi_low_target_open(link, cf) - struct scsipi_link *link; - struct cfdata *cf; -{ - u_int target = link->scsipi_scsi.target; - u_int lun = link->scsipi_scsi.lun; - struct scsi_low_softc *slp; - struct targ_info *ti; - struct lun_info *li; - - slp = (struct scsi_low_softc *) link->adapter_softc; - ti = slp->sl_ti[target]; - li = scsi_low_alloc_li(ti, lun, 0); - if (li == NULL) - return 0; - - li->li_cfgflags = cf->cf_flags; - scsi_low_setup_quirks_xs(ti, li, (u_int) link->quirks); - return 0; -} -#endif /* SCSI_LOW_TARGET_OPEN */ - -#endif /* SCSI_LOW_INTERFACE_XS */ - -#ifdef SCSI_LOW_INTERFACE_CAM /************************************************************** * SCSI INTERFACE (CAM) **************************************************************/ @@ -1001,7 +470,7 @@ scsi_low_scsi_action_cam(sim, ccb) else flags = CCB_SCSIIO; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); li = scsi_low_alloc_li(ti, lun, 1); if (ti->ti_setup_msg != 0) @@ -1040,7 +509,7 @@ scsi_low_scsi_action_cam(sim, ccb) } #endif /* SCSI_LOW_DIAGNOSTIC */ - s = SCSI_LOW_SPLSCSI(); + s = splcam(); cb = scsi_low_find_ccb(slp, target, lun, ccb->cab.abort_ccb); rv = scsi_low_abort_ccb(slp, cb); splx(s); @@ -1072,7 +541,7 @@ scsi_low_scsi_action_cam(sim, ccb) if (lun == CAM_LUN_WILDCARD) lun = 0; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if ((spi->valid & (CTS_SPI_VALID_BUS_WIDTH | @@ -1144,7 +613,7 @@ scsi_low_scsi_action_cam(sim, ccb) if (lun == CAM_LUN_WILDCARD) lun = 0; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); li = scsi_low_alloc_li(ti, lun, 1); if (li != NULL && cts->type == CTS_TYPE_CURRENT_SETTINGS) { struct ccb_trans_settings_scsi *scsi = @@ -1202,7 +671,7 @@ settings_out: } case XPT_RESET_BUS: /* Reset the specified SCSI bus */ - s = SCSI_LOW_SPLSCSI(); + s = splcam(); scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL); splx(s); ccb->ccb_h.status = CAM_REQ_CMP; @@ -1243,7 +712,7 @@ settings_out: else flags = CCB_NORETRY | CCB_URGENT; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); li = scsi_low_alloc_li(ti, lun, 1); scsi_low_enqueue(slp, ti, li, cb, flags, msg); splx(s); @@ -1299,7 +768,7 @@ scsi_low_attach_cam(slp) int tagged_openings; sprintf(slp->sl_xname, "%s%d", - DEVPORT_DEVNAME(slp->sl_dev), DEVPORT_DEVUNIT(slp->sl_dev)); + device_get_name(slp->sl_dev), device_get_unit(slp->sl_dev)); devq = cam_simq_alloc(SCSI_LOW_NCCB); if (devq == NULL) @@ -1311,8 +780,8 @@ scsi_low_attach_cam(slp) tagged_openings = min(slp->sl_openings, SCSI_LOW_MAXNEXUS); slp->sl_si.sim = cam_sim_alloc(scsi_low_scsi_action_cam, scsi_low_poll_cam, - DEVPORT_DEVNAME(slp->sl_dev), slp, - DEVPORT_DEVUNIT(slp->sl_dev), &Giant, + device_get_name(slp->sl_dev), slp, + device_get_unit(slp->sl_dev), &Giant, slp->sl_openings, tagged_openings, devq); if (slp->sl_si.sim == NULL) { @@ -1479,8 +948,6 @@ scsi_low_timeout_cam(slp, ch, action) } } -#endif /* SCSI_LOW_INTERFACE_CAM */ - /*============================================================= * END OF OS switch (All OS depend fucntions should be above) =============================================================*/ @@ -1504,7 +971,7 @@ scsi_low_deactivate(slp) { int s; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); slp->sl_flags |= HW_INACTIVE; (*slp->sl_osdep_fp->scsi_low_osdep_timeout) (slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_STOP); @@ -1520,7 +987,7 @@ scsi_low_activate(slp) { int error, s; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); slp->sl_flags &= ~HW_INACTIVE; if ((error = scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, NULL)) != 0) { @@ -1600,7 +1067,7 @@ scsi_low_engage(arg) void *arg; { struct scsi_low_softc *slp = arg; - int s = SCSI_LOW_SPLSCSI(); + int s = splcam(); switch (slp->sl_rstep) { @@ -1696,7 +1163,7 @@ scsi_low_alloc_li(ti, lun, alloc) if (li == NULL) panic("no lun info mem"); - SCSI_LOW_BZERO(li, ti->ti_lunsize); + bzero(li, ti->ti_lunsize); li->li_lun = lun; li->li_ti = ti; @@ -1738,7 +1205,7 @@ scsi_low_alloc_ti(slp, targ) if (ti == NULL) panic("%s short of memory", slp->sl_xname); - SCSI_LOW_BZERO(ti, slp->sl_targsize); + bzero(ti, slp->sl_targsize); ti->ti_id = targ; ti->ti_sc = slp; @@ -1812,7 +1279,7 @@ scsi_low_timeout(arg) struct scsi_low_softc *slp = arg; int s; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); (void) scsi_low_timeout_check(slp); (*slp->sl_osdep_fp->scsi_low_osdep_timeout) (slp, SCSI_LOW_TIMEOUT_CH_IO, SCSI_LOW_TIMEOUT_START); @@ -1995,12 +1462,7 @@ scsi_low_attach(slp, openings, ntargs, n struct lun_info *li; int s, i, nccb, rv; -#ifdef SCSI_LOW_INTERFACE_XS - slp->sl_osdep_fp = &scsi_low_osdep_funcs_xs; -#endif /* SCSI_LOW_INTERFACE_XS */ -#ifdef SCSI_LOW_INTERFACE_CAM slp->sl_osdep_fp = &scsi_low_osdep_funcs_cam; -#endif /* SCSI_LOW_INTERFACE_CAM */ if (slp->sl_osdep_fp == NULL) panic("scsi_low: interface not spcified"); @@ -2042,7 +1504,7 @@ scsi_low_attach(slp, openings, ntargs, n TAILQ_INIT(&slp->sl_start); /* call os depend attach */ - s = SCSI_LOW_SPLSCSI(); + s = splcam(); rv = (*slp->sl_osdep_fp->scsi_low_osdep_attach) (slp); if (rv != 0) { @@ -2053,7 +1515,7 @@ scsi_low_attach(slp, openings, ntargs, n } /* check hardware */ - SCSI_LOW_DELAY(1000); /* wait for 1ms */ + DELAY(1000); /* wait for 1ms */ if (scsi_low_init(slp, SCSI_LOW_RESTART_HARD) != 0) { splx(s); @@ -2088,7 +1550,7 @@ scsi_low_dettach(slp) { int s, rv; - s = SCSI_LOW_SPLSCSI(); + s = splcam(); if (scsi_low_is_busy(slp) != 0) { splx(s); @@ -2208,7 +1670,7 @@ scsi_low_sense_abort_start(slp, ti, li, { cb->ccb_scp.scp_cmdlen = 6; - SCSI_LOW_BZERO(cb->ccb_scsi_cmd, cb->ccb_scp.scp_cmdlen); + bzero(cb->ccb_scsi_cmd, cb->ccb_scp.scp_cmdlen); cb->ccb_scsi_cmd[0] = REQUEST_SENSE; cb->ccb_scsi_cmd[4] = sizeof(cb->ccb_sense); cb->ccb_scp.scp_cmd = cb->ccb_scsi_cmd; @@ -2223,7 +1685,7 @@ scsi_low_sense_abort_start(slp, ti, li, } else { - SCSI_LOW_BZERO(&cb->ccb_sense, sizeof(cb->ccb_sense)); + bzero(&cb->ccb_sense, sizeof(cb->ccb_sense)); #ifdef SCSI_LOW_NEGOTIATE_BEFORE_SENSE scsi_low_assert_msg(slp, ti, ti->ti_setup_msg_done, 0); #endif /* SCSI_LOW_NEGOTIATE_BEFORE_SENSE */ @@ -2883,7 +2345,7 @@ scsi_low_twiddle_wait(void) cnputc('\b'); cnputc(tw_chars[tw_pos++]); tw_pos %= (sizeof(tw_chars) - 1); - SCSI_LOW_DELAY(TWIDDLEWAIT); + DELAY(TWIDDLEWAIT); } void @@ -4632,7 +4094,7 @@ scsi_low_poll(slp, cb) tcount = 0; while (slp->sl_nio > 0) { - SCSI_LOW_DELAY((1000 * 1000) / SCSI_LOW_POLL_HZ); + DELAY((1000 * 1000) / SCSI_LOW_POLL_HZ); (*slp->sl_funcs->scsi_low_poll) (slp); if (tcount ++ < SCSI_LOW_POLL_HZ / SCSI_LOW_TIMEOUT_HZ) Modified: head/sys/cam/scsi/scsi_low.h ============================================================================== --- head/sys/cam/scsi/scsi_low.h Thu Sep 6 18:31:56 2012 (r240171) +++ head/sys/cam/scsi/scsi_low.h Thu Sep 6 18:53:33 2012 (r240172) @@ -48,24 +48,9 @@ * Scsi low OSDEP * (All os depend structures should be here!) ================================================*/ -/******** interface ******************************/ -#ifdef __NetBSD__ -#define SCSI_LOW_INTERFACE_XS -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ -#define SCSI_LOW_INTERFACE_CAM -#define CAM -#endif /* __FreeBSD__ */ - /******** includes *******************************/ -#ifdef __NetBSD__ -#include -#include -#endif /* __NetBSD__ */ -#ifdef __FreeBSD__ -#include +#include #include #include #include @@ -75,47 +60,16 @@ #include #include -#endif /* __FreeBSD__ */ /******** functions macro ************************/ -#ifdef __NetBSD__ -#define SCSI_LOW_DEBUGGER(dev) Debugger() -#define SCSI_LOW_DELAY(mu) delay((mu)) -#define SCSI_LOW_SPLSCSI splbio -#define SCSI_LOW_BZERO(pt, size) memset((pt), 0, (size)) -#endif /* __NetBSD__ */ -#ifdef __FreeBSD__ #undef MSG_IDENTIFY -#define SCSI_LOW_DEBUGGER(dev) kdb_enter(KDB_WHY_CAM, dev) -#define SCSI_LOW_DELAY(mu) DELAY((mu)) -#define SCSI_LOW_SPLSCSI splcam -#define SCSI_LOW_BZERO(pt, size) bzero((pt), (size)) -#endif /* __FreeBSD__ */ /******** os depend interface structures **********/ -#ifdef __NetBSD__ -typedef struct scsipi_sense_data scsi_low_osdep_sense_data_t; - -struct scsi_low_osdep_interface { - struct device si_dev; - - struct scsipi_link *si_splp; -}; - -struct scsi_low_osdep_targ_interface { -}; - -struct scsi_low_osdep_lun_interface { - u_int sloi_quirks; -}; -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ typedef struct scsi_sense_data scsi_low_osdep_sense_data_t; struct scsi_low_osdep_interface { - DEVPORT_DEVICE si_dev; + device_t si_dev; struct cam_sim *sim; struct cam_path *path; @@ -134,7 +88,6 @@ struct scsi_low_osdep_targ_interface { struct scsi_low_osdep_lun_interface { }; -#endif /* __FreeBSD__ */ /******** os depend interface functions *************/ struct slccb; Modified: head/sys/cam/scsi/scsi_low_pisa.c ============================================================================== --- head/sys/cam/scsi/scsi_low_pisa.c Thu Sep 6 18:31:56 2012 (r240171) +++ head/sys/cam/scsi/scsi_low_pisa.c Thu Sep 6 18:53:33 2012 (r240172) @@ -34,99 +34,13 @@ #include __FBSDID("$FreeBSD$"); -#ifdef __NetBSD__ #include #include #include -#include -#include - -#include -#include - -#include -#include - -#include - -#include - -#include -#include -#include -#include - -#include -#include - -#define SCSIBUS_RESCAN - -int -scsi_low_deactivate_pisa(dh) - pisa_device_handle_t dh; -{ - struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh); - - if (scsi_low_deactivate(sc) != 0) - return EBUSY; - return 0; -} - -int -scsi_low_activate_pisa(dh) - pisa_device_handle_t dh; -{ - struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh); - slot_device_res_t dr = PISA_RES_DR(dh); - - sc->sl_cfgflags = DVCFG_MKCFG(DVCFG_MAJOR(sc->sl_cfgflags), \ - DVCFG_MINOR(PISA_DR_DVCFG(dr))); - sc->sl_irq = PISA_DR_IRQ(dr); - - if (scsi_low_activate(sc) != 0) - return EBUSY; - - /* rescan the scsi bus */ -#ifdef SCSIBUS_RESCAN - if (scsi_low_is_busy(sc) == 0 && - PISA_RES_EVENT(dh) == PISA_EVENT_INSERT) - scsi_probe_busses((int) sc->sl_si.si_splp->scsipi_scsi.scsibus, - -1, -1); -#endif - return 0; -} - -int -scsi_low_notify_pisa(dh, ev) - pisa_device_handle_t dh; - pisa_event_t ev; -{ - struct scsi_low_softc *sc = PISA_DEV_SOFTC(dh); - - switch(ev) - { - case PISA_EVENT_QUERY_SUSPEND: - if (scsi_low_is_busy(sc) != 0) - return SD_EVENT_STATUS_BUSY; - break; - - default: - break; - } - return 0; -} -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ -#include -#include -#include -#if __FreeBSD_version >= 500001 #include -#endif #include #include -#include +#include #include #include @@ -165,4 +79,3 @@ static moduledata_t scsi_low_moduledata DECLARE_MODULE(scsi_low, scsi_low_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_VERSION(scsi_low, 1); MODULE_DEPEND(scsi_low, cam, 1, 1, 1); -#endif /* __FreeBSD__ */ Modified: head/sys/cam/scsi/scsi_low_pisa.h ============================================================================== --- head/sys/cam/scsi/scsi_low_pisa.h Thu Sep 6 18:31:56 2012 (r240171) +++ head/sys/cam/scsi/scsi_low_pisa.h Thu Sep 6 18:53:33 2012 (r240172) @@ -34,14 +34,7 @@ #ifndef _SCSI_LOW_PISA_H_ #define _SCSI_LOW_PISA_H_ -#ifdef __NetBSD__ -int scsi_low_activate_pisa(pisa_device_handle_t); -int scsi_low_deactivate_pisa(pisa_device_handle_t); -int scsi_low_notify_pisa(pisa_device_handle_t, pisa_event_t); -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ int scsi_low_activate_pisa(struct scsi_low_softc *, int); int scsi_low_deactivate_pisa(struct scsi_low_softc *); -#endif /* __FreeBSD__ */ + #endif /* !_SCSI_LOW_PISA_H_ */ Modified: head/sys/dev/ct/bshw_machdep.c ============================================================================== --- head/sys/dev/ct/bshw_machdep.c Thu Sep 6 18:31:56 2012 (r240171) +++ head/sys/dev/ct/bshw_machdep.c Thu Sep 6 18:53:33 2012 (r240172) @@ -41,9 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__FreeBSD__) && __FreeBSD_version > 500001 #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 19:14:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7D8A106566B; Thu, 6 Sep 2012 19:14:03 +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 935158FC12; Thu, 6 Sep 2012 19:14: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 q86JE35x071081; Thu, 6 Sep 2012 19:14:03 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86JE3cE071079; Thu, 6 Sep 2012 19:14:03 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209061914.q86JE3cE071079@svn.freebsd.org> From: Joel Dahl Date: Thu, 6 Sep 2012 19:14: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: r240173 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 19:14:03 -0000 Author: joel (doc committer) Date: Thu Sep 6 19:14:02 2012 New Revision: 240173 URL: http://svn.freebsd.org/changeset/base/240173 Log: Minor mdoc fix. Modified: head/lib/libpmc/pmc.ivybridge.3 Modified: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridge.3 Thu Sep 6 18:53:33 2012 (r240172) +++ head/lib/libpmc/pmc.ivybridge.3 Thu Sep 6 19:14:02 2012 (r240173) @@ -58,7 +58,6 @@ determined at run time by calling Intel Ivy Bridge PMCs are documented in .Rs .%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" -Intel(R) 64 and IA-32 Architectures Software Developers Manual" .%T "Volume 3B: System Programming Guide, Part 2" .%N "Order Number: 253669-043US" .%D May 2012 From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 19:24:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1B68106567E; Thu, 6 Sep 2012 19:24:49 +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 6CF2C8FC12; Thu, 6 Sep 2012 19:24: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 q86JOnoP072358; Thu, 6 Sep 2012 19:24:49 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86JOnJd072356; Thu, 6 Sep 2012 19:24:49 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209061924.q86JOnJd072356@svn.freebsd.org> From: Joel Dahl Date: Thu, 6 Sep 2012 19:24: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: r240174 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 19:24:49 -0000 Author: joel (doc committer) Date: Thu Sep 6 19:24:48 2012 New Revision: 240174 URL: http://svn.freebsd.org/changeset/base/240174 Log: Remove trailing whitespace. Modified: head/lib/libpmc/pmc.ivybridge.3 Modified: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridge.3 Thu Sep 6 19:14:02 2012 (r240173) +++ head/lib/libpmc/pmc.ivybridge.3 Thu Sep 6 19:24:48 2012 (r240174) @@ -199,40 +199,40 @@ Ivy Bridge programmable PMCs support the .Bl -tag -width indent .It Li LD_BLOCKS.STORE_FORWARD .Pq Event 03H , Umask 02H -loads blocked by overlapping with store buffer that cannot be forwarded . +loads blocked by overlapping with store buffer that cannot be forwarded . .It Li MISALIGN_MEM_REF.LOADS .Pq Event 05H , Umask 01H -Speculative cache-line split load uops dispatched to L1D. +Speculative cache-line split load uops dispatched to L1D. .It Li MISALIGN_MEM_REF.STORES .Pq Event 05H , Umask 02H -Speculative cache-line split Store- address uops dispatched to L1D. +Speculative cache-line split Store- address uops dispatched to L1D. .It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS .Pq Event 07H , Umask 01H -False dependencies in MOB due to partial compare on address. +False dependencies in MOB due to partial compare on address. .It Li DTLB_LOAD_MISSES.DEMAND_LD_MISS_CAUSES_A_WALK .Pq Event 08H , Umask 81H -Misses in all TLB levels that cause a page walk of any page size from demand loads. +Misses in all TLB levels that cause a page walk of any page size from demand loads. .It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_COMPLETED .Pq Event 08H , Umask 82H -Misses in all TLB levels that caused page walk completed of any size by demand loads. +Misses in all TLB levels that caused page walk completed of any size by demand loads. .It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_DURATION .Pq Event 08H , Umask 84H -Cycle PMH is busy with a walk due to demand loads. +Cycle PMH is busy with a walk due to demand loads. .It Li UOPS_ISSUED.ANY .Pq Event 0EH , Umask 01H -Increments each cycle the # of Uops issued by the RAT to RS. +Increments each cycle the # of Uops issued by the RAT to RS. Set Cmask = 1, Inv = 1to count stalled cycles. -Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core. .It Li UOPS_ISSUED.FLAGS_MERGE .Pq Event 0EH , Umask 10H -Number of flags-merge uops allocated. Such uops adds delay. +Number of flags-merge uops allocated. Such uops adds delay. .It Li UOPS_ISSUED.SLOW_LEA .Pq Event 0EH , Umask 20H Number of slow LEA or similar uops allocated. Such uop has 3 sources (e.g. 2 sources + immediate) regardless if as a result of LEA instruction or not. .It Li UOPS_ISSUED.SINGLE_MUL .Pq Event 0EH , Umask 40H -Number of multiply packed/scalar single precision uops allocated. +Number of multiply packed/scalar single precision uops allocated. .It Li ARITH.FPU_DIV_ACTIVE .Pq Event 14H , Umask 01H Cycles that the divider is active, includes INT and FP. Set 'edge =1, @@ -245,31 +245,31 @@ Demand Data Read requests that hit L2 ca Counts any demand and L1 HW prefetch data load requests to L2. .It Li L2_RQSTS.RFO_HITS .Pq Event 24H , Umask 04H -Counts the number of store RFO requests that hit the L2 cache. +Counts the number of store RFO requests that hit the L2 cache. .It Li L2_RQSTS.RFO_MISS .Pq Event 24H , Umask 08H -Counts the number of store RFO requests that miss the L2 cache. +Counts the number of store RFO requests that miss the L2 cache. .It Li L2_RQSTS.ALL_RFO .Pq Event 24H , Umask 0CH -Counts all L2 store RFO requests. +Counts all L2 store RFO requests. .It Li L2_RQSTS.CODE_RD_HIT .Pq Event 24H , Umask 10H -Number of instruction fetches that hit the L2 cache. +Number of instruction fetches that hit the L2 cache. .It Li L2_RQSTS.CODE_RD_MISS .Pq Event 24H , Umask 20H -Number of instruction fetches that missed the L2 cache. +Number of instruction fetches that missed the L2 cache. .It Li L2_RQSTS.ALL_CODE_RD .Pq Event 24H , Umask 30H -Counts all L2 code requests. +Counts all L2 code requests. .It Li L2_RQSTS.PF_HIT .Pq Event 24H , Umask 40H -Counts all L2 HW prefetcher requests that hit L2. +Counts all L2 HW prefetcher requests that hit L2. .It Li L2_RQSTS.PF_MISS .Pq Event 24H , Umask 80H -Counts all L2 HW prefetcher requests that missed L2. +Counts all L2 HW prefetcher requests that missed L2. .It Li L2_RQSTS.ALL_PF .Pq Event 24H , Umask C0H -Counts all L2 HW prefetcher requests. +Counts all L2 HW prefetcher requests. .It Li L2_STORE_LOCK_RQSTS.MISS .Pq Event 27H , Umask 01H RFOs that miss cache lines. @@ -307,13 +307,13 @@ core frequency may change from time to t throttling. .It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK .Pq Event 3CH , Umask 01H -Increments at the frequency of XCLK (100 MHz) when not halted. +Increments at the frequency of XCLK (100 MHz) when not halted. .It Li L1D_PEND_MISS.PENDING .Pq Event 48H , Umask 01H Increments the number of outstanding L1D misses every cycle. Set Cmaks = 1 and Edge =1 to count occurrences. Counter 2 only. -Set Cmask = 1 to count cycles. +Set Cmask = 1 to count cycles. .It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK .Pq Event 49H , Umask 01H Miss in all TLB levels causes an page walk of any page size (4K/2M/4M/1G). @@ -339,16 +339,16 @@ Non-SW-prefetch load dispatches that hit Counts the number of lines brought into the L1 data cache. .It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED .Pq Event 58H , Umask 01H -Number of integer Move Elimination candidate uops that were not eliminated. +Number of integer Move Elimination candidate uops that were not eliminated. .It Li MOVE_ELIMINATION.SIMD_NOT_ELIMINATED .Pq Event 58H , Umask 02H -Number of SIMD Move Elimination candidate uops that were not eliminated. +Number of SIMD Move Elimination candidate uops that were not eliminated. .It Li MOVE_ELIMINATION.INT_ELIMINATED .Pq Event 58H , Umask 04H -Number of integer Move Elimination candidate uops that were eliminated. +Number of integer Move Elimination candidate uops that were eliminated. .It Li MOVE_ELIMINATION.SIMD_ELIMINATED .Pq Event 58H , Umask 08H -Number of SIMD Move Elimination candidate uops that were eliminated. +Number of SIMD Move Elimination candidate uops that were eliminated. .It Li CPL_CYCLES.RING0 .Pq Event 5CH , Umask 01H Unhalted core cycles when the thread is in ring 0. @@ -389,14 +389,14 @@ Cycles in which the L1D is locked. Counts cycles the IDQ is empty. .It Li IDQ.MITE_UOPS .Pq Event 79H , Umask 04H -Increment each cycle # of uops delivered to IDQ from MITE path. +Increment each cycle # of uops delivered to IDQ from MITE path. Can combine Umask 04H and 20H. -Set Cmask = 1 to count cycles. +Set Cmask = 1 to count cycles. .It Li IDQ.DSB_UOPS .Pq Event 79H , Umask 08H -Increment each cycle. # of uops delivered to IDQ from DSB path. -Can combine Umask 08H and 10H -Set Cmask = 1 to count cycles. +Increment each cycle. # of uops delivered to IDQ from DSB path. +Can combine Umask 08H and 10H +Set Cmask = 1 to count cycles. .It Li IDQ.MS_DSB_UOPS .Pq Event 79H , Umask 10H Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set @@ -466,7 +466,7 @@ returns. Must combine with umask 80H. .It Li BR_INST_EXEC.RETURN_NEAR .Pq Event 88H , Umask 08H -Qualify indirect near branches that have a return mnemonic. +Qualify indirect near branches that have a return mnemonic. Must combine with umask 80H. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL .Pq Event 88H , Umask 10H @@ -544,7 +544,7 @@ Cycles which a store address uop is disp Cycles which a Uop is dispatched on port 2. .It Li UOPS_DISPATCHED_PORT.PORT_3_LD .Pq Event A1H , Umask 10H -Cycles which a load uop is dispatched on port 3. +Cycles which a load uop is dispatched on port 3. .It Li UOPS_DISPATCHED_PORT.PORT_3_STA .Pq Event A1H , Umask 20H Cycles which a store address uop is dispatched on port 3. @@ -621,7 +621,7 @@ DTLB flush attempts of the thread- speci Count number of STLB flush attempts. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -Number of instructions at retirement. +Number of instructions at retirement. .It Li INST_RETIRED.ALL .Pq Event C0H , Umask 01H Precise instruction retired event with HW to reduce effect of PEBS shadow in @@ -630,7 +630,7 @@ PMC1 only. Must quiesce other PMCs. .It Li OTHER_ASSISTS.AVX_STORE .Pq Event C1H , Umask 08H -Number of assists associated with 256-bit AVX store operations. +Number of assists associated with 256-bit AVX store operations. .It Li OTHER_ASSISTS.AVX_TO_SSE .Pq Event C1H , Umask 10H Number of transitions from AVX- 256 to legacy SSE when penalty applicable. @@ -725,7 +725,7 @@ Specify threshold in MSR 0x3F6. .It Li MEM_TRANS_RETIRED.PRECISE_STORE .Pq Event CDH , Umask 02H Sample stores and collect precise store operation via PEBS record. -PMC3 only. +PMC3 only. .It Li MEM_UOP_RETIRED.LOADS .Pq Event D0H , Umask 01H Qualify retired memory uops that are loads. Combine with umask 10H, 20H, @@ -798,47 +798,47 @@ RFO requests that access L2 cache. L2 cache accesses when fetching instructions. .It Li L2_TRANS.ALL_PF .Pq Event F0H , Umask 08H -Any MLC or LLC HW prefetch accessing L2, including rejects. +Any MLC or LLC HW prefetch accessing L2, including rejects. .It Li L2_TRANS.L1D_WB .Pq Event F0H , Umask 10H -L1D writebacks that access L2 cache. +L1D writebacks that access L2 cache. .It Li L2_TRANS.L2_FILL .Pq Event F0H , Umask 20H -L2 fill requests that access L2 cache. +L2 fill requests that access L2 cache. .It Li L2_TRANS.L2_WB .Pq Event F0H , Umask 40H -L2 writebacks that access L2 cache. +L2 writebacks that access L2 cache. .It Li L2_TRANS.ALL_REQUESTS .Pq Event F0H , Umask 80H -Transactions accessing L2 pipe. +Transactions accessing L2 pipe. .It Li L2_LINES_IN.I .Pq Event F1H , Umask 01H -L2 cache lines in I state filling L2. -Counting does not cover rejects. +L2 cache lines in I state filling L2. +Counting does not cover rejects. .It Li L2_LINES_IN.S .Pq Event F1H , Umask 02H -L2 cache lines in S state filling L2. -Counting does not cover rejects. +L2 cache lines in S state filling L2. +Counting does not cover rejects. .It Li L2_LINES_IN.E .Pq Event F1H , Umask 04H -L2 cache lines in E state filling L2. -Counting does not cover rejects. +L2 cache lines in E state filling L2. +Counting does not cover rejects. .It Li L2_LINES_IN.ALL .Pq Event F1H , Umask 07H -L2 cache lines filling L2. -Counting does not cover rejects. +L2 cache lines filling L2. +Counting does not cover rejects. .It Li L2_LINES_OUT.DEMAND_CLEAN .Pq Event F2H , Umask 01H -Clean L2 cache lines evicted by demand. +Clean L2 cache lines evicted by demand. .It Li L2_LINES_OUT.DEMAND_DIRTY .Pq Event F2H , Umask 02H -Dirty L2 cache lines evicted by demand. +Dirty L2 cache lines evicted by demand. .It Li L2_LINES_OUT.PF_CLEAN .Pq Event F2H , Umask 04H -Clean L2 cache lines evicted by the MLC prefetcher. +Clean L2 cache lines evicted by the MLC prefetcher. .It Li L2_LINES_OUT.PF_DIRTY .Pq Event F2H , Umask 08H -Dirty L2 cache lines evicted by the MLC prefetcher. +Dirty L2 cache lines evicted by the MLC prefetcher. .El .Sh SEE ALSO .Xr pmc 3 , From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 19:26:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C4410656A5; Thu, 6 Sep 2012 19:26:59 +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 C0DB98FC1B; Thu, 6 Sep 2012 19:26: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 q86JQx2q072633; Thu, 6 Sep 2012 19:26:59 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86JQxid072631; Thu, 6 Sep 2012 19:26:59 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209061926.q86JQxid072631@svn.freebsd.org> From: Joel Dahl Date: Thu, 6 Sep 2012 19:26: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: r240175 - head/cddl/usr.sbin/plockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 19:26:59 -0000 Author: joel (doc committer) Date: Thu Sep 6 19:26:59 2012 New Revision: 240175 URL: http://svn.freebsd.org/changeset/base/240175 Log: Remove trailing whitespace. Modified: head/cddl/usr.sbin/plockstat/plockstat.1 Modified: head/cddl/usr.sbin/plockstat/plockstat.1 ============================================================================== --- head/cddl/usr.sbin/plockstat/plockstat.1 Thu Sep 6 19:24:48 2012 (r240174) +++ head/cddl/usr.sbin/plockstat/plockstat.1 Thu Sep 6 19:26:59 2012 (r240175) @@ -49,7 +49,7 @@ .Op Fl s Ar depth .Op Fl e Ar secs .Op Fl x Ar opt Ns = Ns Ar val -.Fl p Ar pid +.Fl p Ar pid .Sh DESCRIPTION The .Nm From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 19:58:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29B9D1065677; Thu, 6 Sep 2012 19:58:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (stark.strangled.net [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id BB9C28FC0A; Thu, 6 Sep 2012 19:58:43 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:6c92:3a9f:f4ca:fb77] (unknown [IPv6:2601:9:4d00:85:6c92:3a9f:f4ca:fb77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 44FDC3981E; Thu, 6 Sep 2012 12:58:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) From: Rui Paulo In-Reply-To: <20120906094238.GF85904@gpr.nnz-home.ru> Date: Thu, 6 Sep 2012 12:58:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <00E6EB72-A6D5-4611-819F-ACEF6135BAFF@FreeBSD.org> References: <201209060319.q863JnDe050504@svn.freebsd.org> <20120906094238.GF85904@gpr.nnz-home.ru> To: Gennady Proskurin X-Mailer: Apple Mail (2.1486) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240156 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 19:58:44 -0000 On 6 Sep 2012, at 02:42, Gennady Proskurin wrote: > On Thu, Sep 06, 2012 at 03:19:49AM +0000, Rui Paulo wrote: >> Author: rpaulo >> Date: Thu Sep 6 03:19:48 2012 >> New Revision: 240156 >> URL: http://svn.freebsd.org/changeset/base/240156 >>=20 >> Log: >> Add support for demangling C++ symbols. This requires linking = libproc with >> libc++rt/libsupc++. >>=20 >> Discussed with: theraven >>=20 >> Modified: >> head/lib/libproc/Makefile >> head/lib/libproc/proc_sym.c >>=20 >> Modified: head/lib/libproc/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libproc/Makefile Thu Sep 6 02:07:58 2012 = (r240155) >> +++ head/lib/libproc/Makefile Thu Sep 6 03:19:48 2012 = (r240156) >> @@ -1,5 +1,7 @@ >> # $FreeBSD$ >>=20 >> +.include >> + >> LIB=3D proc >>=20 >> SRCS=3D proc_bkpt.c \ >> @@ -13,6 +15,14 @@ INCS=3D libproc.h >>=20 >> CFLAGS+=3D -I${.CURDIR} >>=20 >> +.if ${MK_LIBCPLUSPLUS} !=3D "no" >> +LDADD+=3D -lcxxrt >> +DPADD+=3D ${LIBCXXRT} >> +.else >> +LDADD+=3D -lsupc++ >> +DPADD+=3D ${LIBSTDCPLUSPLUS} >> +.endif >> + >> SHLIB_MAJOR=3D 2 >>=20 >> WITHOUT_MAN=3D >>=20 >> Modified: head/lib/libproc/proc_sym.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libproc/proc_sym.c Thu Sep 6 02:07:58 2012 = (r240155) >> +++ head/lib/libproc/proc_sym.c Thu Sep 6 03:19:48 2012 = (r240156) >> @@ -46,6 +46,8 @@ >>=20 >> #include "_libproc.h" >>=20 >> +extern char *__cxa_demangle(const char *, char *, size_t *, int *); >> + >> static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); >>=20 >> static void >> @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin >> if (addr >=3D rsym && addr <=3D (rsym + sym.st_size)) { >> s =3D elf_strptr(e, dynsymstridx, sym.st_name); >> if (s) { >> - strlcpy(name, s, namesz); >> + if (strlen(s) > 2 &&=20 >> + s[0] =3D=3D '_' && s[1] =3D=3D 'Z') > checking "strlen(s) > 2" is useless and not optimal here, you can omit = it completely > checking s[0] and s[1] is enough, it implies that length is >=3D2 > you may add something like "s[2] !=3D 0" if length should be strictly = >2 It's not really useless but can be considered non-optimal, yes. That = said, the C++ demangler we're calling doesn't really care about being = fast :-)=20 Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 20:03:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E17491065670; Thu, 6 Sep 2012 20:03:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (stark.strangled.net [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id C697C8FC1A; Thu, 6 Sep 2012 20:03:07 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:6c92:3a9f:f4ca:fb77] (unknown [IPv6:2601:9:4d00:85:6c92:3a9f:f4ca:fb77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id F0D7139827; Thu, 6 Sep 2012 13:03:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) From: Rui Paulo In-Reply-To: <20120906121513.GG1361@mole.fafoe.narf.at> Date: Thu, 6 Sep 2012 13:03:00 -0700 Content-Transfer-Encoding: 7bit Message-Id: <4C602B3A-9A6E-450C-B135-DE9A459D9053@FreeBSD.org> References: <201209060319.q863JnDe050504@svn.freebsd.org> <20120906121513.GG1361@mole.fafoe.narf.at> To: Stefan Farfeleder X-Mailer: Apple Mail (2.1486) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240156 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 20:03:08 -0000 On 6 Sep 2012, at 05:15, Stefan Farfeleder wrote: > On Thu, Sep 06, 2012 at 03:19:49AM +0000, Rui Paulo wrote: >> @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin >> if (addr >= rsym && addr <= (rsym + sym.st_size)) { >> s = elf_strptr(e, dynsymstridx, sym.st_name); >> if (s) { >> - strlcpy(name, s, namesz); >> + if (strlen(s) > 2 && >> + s[0] == '_' && s[1] == 'Z') >> + __cxa_demangle(s, name, &namesz, NULL); >> + else >> + strlcpy(name, s, namesz); >> memcpy(symcopy, &sym, sizeof(sym)); >> /* >> * DTrace expects the st_value to contain > > According to the documentation, __cxa_demangle will realloc the buffer > if it is too small and return the new buffer. This case is not handled > correctly. You're right. In fact this happens all the time with libcxxrt. Thanks, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 20:15:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC399106566C; Thu, 6 Sep 2012 20:15:44 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4BB98FC12; Thu, 6 Sep 2012 20:15: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 q86KFiwF078386; Thu, 6 Sep 2012 20:15:44 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86KFiHV078384; Thu, 6 Sep 2012 20:15:44 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <201209062015.q86KFiHV078384@svn.freebsd.org> From: Tom Rhodes Date: Thu, 6 Sep 2012 20:15: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: r240176 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 20:15:44 -0000 Author: trhodes Date: Thu Sep 6 20:15:44 2012 New Revision: 240176 URL: http://svn.freebsd.org/changeset/base/240176 Log: Avoid segfault if name is invalid. Basically, only check for CTL_USER if the sysctl fails with ENOENT. PR: 169056 Reviewed by: jhb Modified: head/lib/libc/gen/sysctl.c Modified: head/lib/libc/gen/sysctl.c ============================================================================== --- head/lib/libc/gen/sysctl.c Thu Sep 6 19:26:59 2012 (r240175) +++ head/lib/libc/gen/sysctl.c Thu Sep 6 20:15:44 2012 (r240176) @@ -50,8 +50,11 @@ int sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, const void *newp, size_t newlen) { - if (name[0] != CTL_USER) - return (__sysctl(name, namelen, oldp, oldlenp, newp, newlen)); + int retval; + + retval = __sysctl(name, namelen, oldp, oldlenp, newp, newlen); + if (retval != -1 || errno != ENOENT || name[0] != CTL_USER) + return (retval); if (newp != NULL) { errno = EPERM; From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 20:17:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C59A1065678; Thu, 6 Sep 2012 20:17:00 +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 666798FC0C; Thu, 6 Sep 2012 20:17: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 q86KH07q078648; Thu, 6 Sep 2012 20:17:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86KH0OW078644; Thu, 6 Sep 2012 20:17:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209062017.q86KH0OW078644@svn.freebsd.org> From: John Baldwin Date: Thu, 6 Sep 2012 20:17: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: r240177 - in head/sys: arm/arm mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 20:17:00 -0000 Author: jhb Date: Thu Sep 6 20:16:59 2012 New Revision: 240177 URL: http://svn.freebsd.org/changeset/base/240177 Log: Dynamically allocate the S/G lists passed to callback routines rather than allocating them on the stack of various bus_dmamap_load*() functions. The S/G lists are stored in the DMA tags. This matches the implementation on all other platforms. Discussed with: scottl, gibbs Tested by: stas (arm@) Modified: head/sys/arm/arm/busdma_machdep.c head/sys/mips/mips/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Thu Sep 6 20:15:44 2012 (r240176) +++ head/sys/arm/arm/busdma_machdep.c Thu Sep 6 20:16:59 2012 (r240177) @@ -81,6 +81,7 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; + bus_dma_segment_t *segments; /* * DMA range for this tag. If the page doesn't fall within * one of these ranges, an error is returned. The caller @@ -374,6 +375,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } + newtag->segments = NULL; + /* * Take into account any restrictions imposed by our parent tag */ @@ -447,7 +450,6 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) #endif if (dmat != NULL) { - if (dmat->map_count != 0) return (EBUSY); @@ -457,6 +459,8 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -484,6 +488,17 @@ bus_dmamap_create(bus_dma_tag_t dmat, in bus_dmamap_t newmap; int error = 0; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + newmap = _busdma_alloc_dmamap(); if (newmap == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -585,6 +600,16 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags = M_NOWAIT; else mflags = M_WAITOK; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + } if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; @@ -883,11 +908,6 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ { vm_offset_t lastaddr = 0; int error, nsegs = -1; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); @@ -898,14 +918,14 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, - dm_segments, map, buf, buflen, kernel_pmap, + dmat->segments, map, buf, buflen, kernel_pmap, flags, &lastaddr, &nsegs); if (error == EINPROGRESS) return (error); if (error) (*callback)(callback_arg, NULL, 0, error); else - (*callback)(callback_arg, dm_segments, nsegs + 1, error); + (*callback)(callback_arg, dmat->segments, nsegs + 1, error); CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, nsegs + 1, error); @@ -921,11 +941,6 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs = -1, error = 0; M_ASSERTPKTHDR(m0); @@ -941,7 +956,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, - dm_segments, map, m->m_data, m->m_len, + dmat->segments, map, m->m_data, m->m_len, pmap_kernel(), flags, &lastaddr, &nsegs); map->len += m->m_len; } @@ -954,9 +969,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs + 1, + (*callback)(callback_arg, dmat->segments, nsegs + 1, m0->m_pkthdr.len, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", @@ -1012,11 +1027,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, int flags) { vm_offset_t lastaddr = 0; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs, i, error; bus_size_t resid; struct iovec *iov; @@ -1048,8 +1058,8 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, caddr_t addr = (caddr_t) iov[i].iov_base; if (minlen > 0) { - error = bus_dmamap_load_buffer(dmat, dm_segments, map, - addr, minlen, pmap, flags, &lastaddr, &nsegs); + error = bus_dmamap_load_buffer(dmat, dmat->segments, + map, addr, minlen, pmap, flags, &lastaddr, &nsegs); map->len += minlen; resid -= minlen; @@ -1060,9 +1070,9 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs+1, + (*callback)(callback_arg, dmat->segments, nsegs+1, uio->uio_resid, error); } Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Thu Sep 6 20:15:44 2012 (r240176) +++ head/sys/mips/mips/busdma_machdep.c Thu Sep 6 20:16:59 2012 (r240177) @@ -80,6 +80,7 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; + bus_dma_segment_t *segments; struct bounce_zone *bounce_zone; }; @@ -352,6 +353,8 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } + newtag->segments = NULL; + /* * Take into account any restrictions imposed by our parent tag */ @@ -434,6 +437,8 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -442,7 +447,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) */ dmat = parent; } else - dmat = NULL; + dmat = NULL; } } CTR2(KTR_BUSDMA, "%s tag %p", __func__, dmat_copy); @@ -461,6 +466,17 @@ bus_dmamap_create(bus_dma_tag_t dmat, in bus_dmamap_t newmap; int error = 0; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + newmap = _busdma_alloc_dmamap(); if (newmap == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -563,6 +579,16 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags = M_NOWAIT; else mflags = M_WAITOK; + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + } if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; @@ -824,11 +850,6 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ { vm_offset_t lastaddr = 0; int error, nsegs = -1; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); @@ -839,14 +860,14 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, - dm_segments, map, buf, buflen, kernel_pmap, + dmat->segments, map, buf, buflen, kernel_pmap, flags, &lastaddr, &nsegs); if (error == EINPROGRESS) return (error); if (error) (*callback)(callback_arg, NULL, 0, error); else - (*callback)(callback_arg, dm_segments, nsegs + 1, error); + (*callback)(callback_arg, dmat->segments, nsegs + 1, error); CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, nsegs + 1, error); @@ -862,11 +883,6 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs = -1, error = 0; M_ASSERTPKTHDR(m0); @@ -882,7 +898,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, - dm_segments, map, m->m_data, m->m_len, + dmat->segments, map, m->m_data, m->m_len, kernel_pmap, flags, &lastaddr, &nsegs); map->len += m->m_len; } @@ -895,9 +911,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs + 1, + (*callback)(callback_arg, dmat->segments, nsegs + 1, m0->m_pkthdr.len, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", @@ -953,11 +969,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, int flags) { vm_offset_t lastaddr = 0; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif int nsegs, i, error; bus_size_t resid; struct iovec *iov; @@ -990,8 +1001,8 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, caddr_t addr = (caddr_t) iov[i].iov_base; if (minlen > 0) { - error = bus_dmamap_load_buffer(dmat, dm_segments, map, - addr, minlen, pmap, flags, &lastaddr, &nsegs); + error = bus_dmamap_load_buffer(dmat, dmat->segments, + map, addr, minlen, pmap, flags, &lastaddr, &nsegs); map->len += minlen; resid -= minlen; @@ -1002,9 +1013,9 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, /* * force "no valid mappings" on error in callback. */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs+1, + (*callback)(callback_arg, dmat->segments, nsegs+1, uio->uio_resid, error); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 20:59:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD4651065755; Thu, 6 Sep 2012 20:59:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75F88FC16; Thu, 6 Sep 2012 20: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 q86KxnUH083750; Thu, 6 Sep 2012 20:59:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q86KxnNd083737; Thu, 6 Sep 2012 20:59:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209062059.q86KxnNd083737@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 6 Sep 2012 20: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: r240178 - in head/lib/libc/amd64: . gen sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 20:59:50 -0000 Author: jilles Date: Thu Sep 6 20:59:49 2012 New Revision: 240178 URL: http://svn.freebsd.org/changeset/base/240178 Log: libc/amd64: Do not export .cerror. For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeit in the FBSDprivate_1.0 version. It looks like there is no reason for this since it is not used from other libraries. Given that it cannot be accessed from C and its strange calling convention, it is rather unlikely that other things rely on it. Perhaps it is from a time when symbols could not be hidden. Most of the amd64 assembler code jumps to .cerror using the GOT. It can jump to it directly now, as in non-PIC mode. There are also some minor size optimizations to instructions but they yield virtually no benefit in the size of libc.so.7 due to padding. Reviewed by: kib Modified: head/lib/libc/amd64/SYS.h head/lib/libc/amd64/Symbol.map head/lib/libc/amd64/gen/rfork_thread.S head/lib/libc/amd64/sys/brk.S head/lib/libc/amd64/sys/exect.S head/lib/libc/amd64/sys/getcontext.S head/lib/libc/amd64/sys/pipe.S head/lib/libc/amd64/sys/ptrace.S head/lib/libc/amd64/sys/reboot.S head/lib/libc/amd64/sys/sbrk.S head/lib/libc/amd64/sys/setlogin.S head/lib/libc/amd64/sys/vfork.S Modified: head/lib/libc/amd64/SYS.h ============================================================================== --- head/lib/libc/amd64/SYS.h Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/SYS.h Thu Sep 6 20:59:49 2012 (r240178) @@ -36,38 +36,20 @@ #include #include -#ifdef PIC #define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(x); \ .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ - 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \ + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ END(__CONCAT(__sys_,x)) #define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret ; \ - 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \ + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ END(__CONCAT(__sys_,x)) -#else -#define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ - 2: jmp HIDENAME(cerror); \ - END(__CONCAT(__sys_,x)) - -#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ - 2: jmp HIDENAME(cerror); \ - END(__CONCAT(__sys_,x)) -#endif #define KERNCALL movq %rcx, %r10; syscall Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/Symbol.map Thu Sep 6 20:59:49 2012 (r240178) @@ -66,7 +66,6 @@ FBSDprivate_1.0 { .curbrk; .minbrk; _brk; - .cerror; _end; __sys_vfork; _vfork; Modified: head/lib/libc/amd64/gen/rfork_thread.S ============================================================================== --- head/lib/libc/amd64/gen/rfork_thread.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/gen/rfork_thread.S Thu Sep 6 20:59:49 2012 (r240178) @@ -93,12 +93,7 @@ ENTRY(rfork_thread) 2: popq %r12 popq %rbx -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)), %rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(rfork_thread) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/brk.S ============================================================================== --- head/lib/libc/amd64/sys/brk.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/brk.S Thu Sep 6 20:59:49 2012 (r240178) @@ -76,12 +76,7 @@ ok: ret err: addq $8, %rsp -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(brk) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/exect.S ============================================================================== --- head/lib/libc/amd64/sys/exect.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/exect.S Thu Sep 6 20:59:49 2012 (r240178) @@ -47,12 +47,7 @@ ENTRY(exect) pushq %r8 popfq KERNCALL -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(exect) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/getcontext.S ============================================================================== --- head/lib/libc/amd64/sys/getcontext.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/getcontext.S Thu Sep 6 20:59:49 2012 (r240178) @@ -42,16 +42,9 @@ ENTRY(__sys_getcontext) movq (%rsp),%rsi /* save getcontext return address */ mov $SYS_getcontext,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) addq $8,%rsp /* remove stale (setcontext) return address */ jmp *%rsi /* restore return address */ -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_getcontext) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/pipe.S ============================================================================== --- head/lib/libc/amd64/sys/pipe.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/pipe.S Thu Sep 6 20:59:49 2012 (r240178) @@ -45,18 +45,11 @@ __FBSDID("$FreeBSD$"); ENTRY(__sys_pipe) mov $SYS_pipe,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) movl %eax,(%rdi) /* %rdi is preserved by syscall */ movl %edx,4(%rdi) movq $0,%rax ret -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_pipe) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/ptrace.S ============================================================================== --- head/lib/libc/amd64/sys/ptrace.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/ptrace.S Thu Sep 6 20:59:49 2012 (r240178) @@ -48,15 +48,8 @@ ENTRY(ptrace) #endif mov $SYS_ptrace,%eax KERNCALL - jb err + jb HIDENAME(cerror) ret -err: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(ptrace) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/reboot.S ============================================================================== --- head/lib/libc/amd64/sys/reboot.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/reboot.S Thu Sep 6 20:59:49 2012 (r240178) @@ -45,15 +45,8 @@ __FBSDID("$FreeBSD$"); ENTRY(__sys_reboot) mov $SYS_reboot,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) iretq -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_reboot) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/sbrk.S ============================================================================== --- head/lib/libc/amd64/sys/sbrk.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/sbrk.S Thu Sep 6 20:59:49 2012 (r240178) @@ -79,12 +79,7 @@ back: ret err: addq $8, %rsp -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(sbrk) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/setlogin.S ============================================================================== --- head/lib/libc/amd64/sys/setlogin.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/setlogin.S Thu Sep 6 20:59:49 2012 (r240178) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); ENTRY(__sys_setlogin) mov $SYS_setlogin,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) #ifdef PIC movq PIC_GOT(CNAME(_logname_valid)),%rdx movl $0,(%rdx) @@ -55,13 +55,6 @@ ENTRY(__sys_setlogin) movl $0,CNAME(_logname_valid)(%rip) #endif ret /* setlogin(name) */ -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_setlogin) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/amd64/sys/vfork.S ============================================================================== --- head/lib/libc/amd64/sys/vfork.S Thu Sep 6 20:16:59 2012 (r240177) +++ head/lib/libc/amd64/sys/vfork.S Thu Sep 6 20:59:49 2012 (r240178) @@ -50,12 +50,7 @@ ENTRY(__sys_vfork) jmp *%rsi 1: pushq %rsi -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(__sys_vfork) .section .note.GNU-stack,"",%progbits From owner-svn-src-head@FreeBSD.ORG Thu Sep 6 21:50:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F106A1065672 for ; Thu, 6 Sep 2012 21:50:26 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9CE8FC14 for ; Thu, 6 Sep 2012 21:50:25 +0000 (UTC) Received: by eaak11 with SMTP id k11so799845eaa.13 for ; Thu, 06 Sep 2012 14:50:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=oXKWPh7/gBcUIEbTa1oLYJHgxLIPVueMLYzwEEesQKo=; b=V5amesYq+QmJ/1qVO360M3coSPa2bjafhB49XfHtdidbd9xkLM1vyfmQ3AIrYlBkbh bSlurbEIikAlgbfnyYKuhULRllH2ALn05cPST38YsK/eaOQw+MK/TXl0LkmAYL6ZR86x EQo9kZ2S5pPrgC2L3acA7JWGeyIrWrO0P7WliXGdNBvMccg7PDZyMX3TGqS35E6N3vRa fGI8itVSaRGEwM6uO2WYNzyJED9KMRr1ziFoKihjpKqYJpkLkK+8XVG1cNhuvEMOJKRr +LbAZIBY471UZpy9qzasqXqueRGK/83aRt+LIy6L1okXMRj7Nbm/G+QnFS4zqRjJ3v3i GcDw== MIME-Version: 1.0 Received: by 10.14.218.134 with SMTP id k6mr5218536eep.14.1346968224813; Thu, 06 Sep 2012 14:50:24 -0700 (PDT) Received: by 10.14.174.72 with HTTP; Thu, 6 Sep 2012 14:50:24 -0700 (PDT) In-Reply-To: <201209061459.q86Exr56038506@svn.freebsd.org> References: <201209061459.q86Exr56038506@svn.freebsd.org> Date: Thu, 6 Sep 2012 14:50:24 -0700 Message-ID: From: Jos Backus To: Josh Paetzel X-Gm-Message-State: ALoCoQkhycqmAiOK/Bc/6DykwQApzmmb1vZDGYnebwitAjYpVTx88nQ5BeR8zQmX7SVJ9gLvineJ Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240165 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 21:50:27 -0000 On Thu, Sep 6, 2012 at 7:59 AM, Josh Paetzel wrote: > Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh > > ============================================================================== > --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Thu Sep 6 > 13:54:01 2012 (r240164) > +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Thu Sep 6 > 14:59:53 2012 (r240165) > ... > FOUNDPARTS="1" > + USEDAUTOSIZE=0 > > # Lets read in the config file now and setup our partitions > if [ "${_pType}" = "gpt" ] ; then > @@ -245,7 +278,15 @@ setup_gpart_partitions() > > if [ "$SIZE" = "0" ] > then > - SOUT="" > + if [ $USEDAUTOSIZE -eq 1 ] ; then > Style question: if $USEDAUTOSIZE is treated as a boolean value, why not use `true' and `false' instead of `1' and `0'? No need to make shell code look like C code. That way one can write: if $USEDAUTOSIZE; then Jos -- Jos Backus jos at catnook.com From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 00:24:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3150106566B; Fri, 7 Sep 2012 00:24: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 95AF68FC08; Fri, 7 Sep 2012 00:24: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 q870ORlL008442; Fri, 7 Sep 2012 00:24:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q870ORgZ008440; Fri, 7 Sep 2012 00:24:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209070024.q870ORgZ008440@svn.freebsd.org> From: Adrian Chadd Date: Fri, 7 Sep 2012 00:24: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: r240180 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 00:24:27 -0000 Author: adrian Date: Fri Sep 7 00:24:27 2012 New Revision: 240180 URL: http://svn.freebsd.org/changeset/base/240180 Log: Ensure that single-frame aggregate session frames are retransmitted with the correct configuration. Occasionally an aggregate TX would fail and the first frame would be retransmitted as a non-AMPDU frame. Since bfs_aggr=1 and bfs_nframes > 1 (from the previous AMPDU attempt), the aggr completion function would be called and be very confused about what's going on. Noticed by: Kim PR: kern/171394 Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Fri Sep 7 00:20:46 2012 (r240179) +++ head/sys/dev/ath/if_ath_tx.c Fri Sep 7 00:24:27 2012 (r240180) @@ -2528,6 +2528,25 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s return; } + /* + * This is a temporary check and should be removed once + * all the relevant code paths have been fixed. + * + * During aggregate retries, it's possible that the head + * frame will fail (which has the bfs_aggr and bfs_nframes + * fields set for said aggregate) and will be retried as + * a single frame. In this instance, the values should + * be reset or the completion code will get upset with you. + */ + if (bf->bf_state.bfs_aggr != 0 || bf->bf_state.bfs_nframes > 1) { + device_printf(sc->sc_dev, "%s: bfs_aggr=%d, bfs_nframes=%d\n", + __func__, + bf->bf_state.bfs_aggr, + bf->bf_state.bfs_nframes); + bf->bf_state.bfs_aggr = 0; + bf->bf_state.bfs_nframes = 1; + } + /* Direct dispatch to hardware */ ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); @@ -2624,6 +2643,16 @@ ath_tx_swq(struct ath_softc *sc, struct if (txq->axq_depth < sc->sc_hwq_limit) { bf = TAILQ_FIRST(&atid->axq_q); ATH_TXQ_REMOVE(atid, bf, bf_list); + + /* + * Ensure it's definitely treated as a non-AMPDU + * frame - this information may have been left + * over from a previous attempt. + */ + bf->bf_state.bfs_aggr = 0; + bf->bf_state.bfs_nframes = 1; + + /* Queue to the hardware */ ath_tx_xmit_aggr(sc, an, txq, bf); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_aggr\n", @@ -4018,7 +4047,23 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft "%s: non-baw packet\n", __func__); ATH_TXQ_REMOVE(tid, bf, bf_list); + + if (bf->bf_state.bfs_nframes > 1) + device_printf(sc->sc_dev, + "%s: aggr=%d, nframes=%d\n", + __func__, + bf->bf_state.bfs_aggr, + bf->bf_state.bfs_nframes); + + /* + * This shouldn't happen - such frames shouldn't + * ever have been queued as an aggregate in the + * first place. However, make sure the fields + * are correctly setup just to be totally sure. + */ bf->bf_state.bfs_aggr = 0; + bf->bf_state.bfs_nframes = 1; + ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 01:33:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07EAC106564A; Fri, 7 Sep 2012 01:33:26 +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 E77628FC12; Fri, 7 Sep 2012 01:33: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 q871XPGD016299; Fri, 7 Sep 2012 01:33:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q871XPS8016297; Fri, 7 Sep 2012 01:33:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209070133.q871XPS8016297@svn.freebsd.org> From: Alan Cox Date: Fri, 7 Sep 2012 01:33: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: r240181 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 01:33:26 -0000 Author: alc Date: Fri Sep 7 01:33:25 2012 New Revision: 240181 URL: http://svn.freebsd.org/changeset/base/240181 Log: Eliminate an unused macro. Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Fri Sep 7 00:24:27 2012 (r240180) +++ head/sys/arm/include/pmap.h Fri Sep 7 01:33:25 2012 (r240181) @@ -124,13 +124,6 @@ struct md_page { TAILQ_HEAD(,pv_entry) pv_list; }; -#define VM_MDPAGE_INIT(pg) \ -do { \ - TAILQ_INIT(&pg->pv_list); \ - mtx_init(&(pg)->md_page.pvh_mtx, "MDPAGE Mutex", NULL, MTX_DEV);\ - (pg)->mdpage.pvh_attrs = 0; \ -} while (/*CONSTCOND*/0) - struct l1_ttable; struct l2_dtable; From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 02:38:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34531065672; Fri, 7 Sep 2012 02:38:07 +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 9A2E98FC16; Fri, 7 Sep 2012 02:38: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 q872c7K0023676; Fri, 7 Sep 2012 02:38:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q872c7E6023674; Fri, 7 Sep 2012 02:38:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209070238.q872c7E6023674@svn.freebsd.org> From: Rui Paulo Date: Fri, 7 Sep 2012 02:38: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: r240182 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 02:38:08 -0000 Author: rpaulo Date: Fri Sep 7 02:38:07 2012 New Revision: 240182 URL: http://svn.freebsd.org/changeset/base/240182 Log: When calling the C++ demangler, make sure to free the returned buffer, which might have been reallocated. Pointed out by: stefanf Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Fri Sep 7 01:33:25 2012 (r240181) +++ head/lib/libproc/proc_sym.c Fri Sep 7 02:38:07 2012 (r240182) @@ -51,6 +51,26 @@ extern char *__cxa_demangle(const char * static void proc_rdl2prmap(rd_loadobj_t *, prmap_t *); static void +demangle(const char *symbol, char *buf, size_t len) +{ + char *dembuf; + size_t demlen = len; + + dembuf = malloc(len); + if (!dembuf) + goto fail; + dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL); + if (!dembuf) + goto fail; + strlcpy(buf, dembuf, len); + free(dembuf); + + return; +fail: + strlcpy(buf, symbol, len); +} + +static void proc_rdl2prmap(rd_loadobj_t *rdl, prmap_t *map) { map->pr_vaddr = rdl->rdl_saddr; @@ -268,9 +288,8 @@ proc_addr2sym(struct proc_handle *p, uin if (addr >= rsym && addr <= (rsym + sym.st_size)) { s = elf_strptr(e, dynsymstridx, sym.st_name); if (s) { - if (strlen(s) > 2 && - s[0] == '_' && s[1] == 'Z') - __cxa_demangle(s, name, &namesz, NULL); + if (s[0] == '_' && s[1] == 'Z' && s[2]) + demangle(s, name, namesz); else strlcpy(name, s, namesz); memcpy(symcopy, &sym, sizeof(sym)); @@ -308,9 +327,8 @@ symtab: if (addr >= rsym && addr <= (rsym + sym.st_size)) { s = elf_strptr(e, symtabstridx, sym.st_name); if (s) { - if (strlen(s) > 2 && - s[0] == '_' && s[1] == 'Z') - __cxa_demangle(s, name, &namesz, NULL); + if (s[0] == '_' && s[1] == 'Z' && s[2]) + demangle(s, name, namesz); else strlcpy(name, s, namesz); memcpy(symcopy, &sym, sizeof(sym)); From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 06:02:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34EF7106564A; Fri, 7 Sep 2012 06:02: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 2053C8FC08; Fri, 7 Sep 2012 06:02: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 q87621te048850; Fri, 7 Sep 2012 06:02:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87621nj048848; Fri, 7 Sep 2012 06:02:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209070602.q87621nj048848@svn.freebsd.org> From: Adrian Chadd Date: Fri, 7 Sep 2012 06:02: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: r240183 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 06:02:02 -0000 Author: adrian Date: Fri Sep 7 06:02:01 2012 New Revision: 240183 URL: http://svn.freebsd.org/changeset/base/240183 Log: Make this build again! Modified: head/tools/tools/ath/athratestats/Makefile Modified: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- head/tools/tools/ath/athratestats/Makefile Fri Sep 7 02:38:07 2012 (r240182) +++ head/tools/tools/ath/athratestats/Makefile Fri Sep 7 06:02:01 2012 (r240183) @@ -7,7 +7,7 @@ PROG= athratestats SRCS= main.c opt_ah.h ah_osdep.h -CLEANFILES+= opt_ah.h +CLEANFILES+= opt_ah.h ah_osdep.h .include <../Makefile.inc> @@ -23,5 +23,6 @@ ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h echo 'typedef int HAL_BUS_TAG;' >>ah_osdep.h echo 'typedef void *HAL_BUS_HANDLE;' >>ah_osdep.h + echo 'typedef uint32_t *HAL_DMA_ADDR;' >>ah_osdep.h .include From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 06:02:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87F72106564A; Fri, 7 Sep 2012 06:02: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 73B018FC08; Fri, 7 Sep 2012 06:02:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8762fDD048957; Fri, 7 Sep 2012 06:02:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8762fTE048955; Fri, 7 Sep 2012 06:02:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209070602.q8762fTE048955@svn.freebsd.org> From: Adrian Chadd Date: Fri, 7 Sep 2012 06:02: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: r240184 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 06:02:41 -0000 Author: adrian Date: Fri Sep 7 06:02:40 2012 New Revision: 240184 URL: http://svn.freebsd.org/changeset/base/240184 Log: Tidy up the output quite substantially, making it fit well within 80 columns. This makes it much easier to use in a shell script, to display a "top" style output with live rate control data. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Fri Sep 7 06:02:01 2012 (r240183) +++ head/tools/tools/ath/athratestats/main.c Fri Sep 7 06:02:40 2012 (r240184) @@ -123,21 +123,21 @@ ath_sample_stats(struct ath_ratestats *r sn->packets_since_sample[y], sn->sample_tt[y]); } + printf(" TX Rate TXTOTAL:TXOK EWMA T/ F" + " avg last xmit\n"); for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) continue; for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { if (sn->stats[y][rix].total_packets == 0) continue; - printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) " - "(EWMA %3d.%1d%%) T %8ju F %4d avg %5u last %u\n", + printf("[%2u %s:%4u] %8ju:%-8ju " + "(%3d.%1d%%) %8ju/%4d %5ums %u\n", dot11rate(rt, rix), dot11str(rt, rix), bin_to_size(y), (uintmax_t) sn->stats[y][rix].total_packets, (uintmax_t) sn->stats[y][rix].packets_acked, - (int) ((sn->stats[y][rix].packets_acked * 100ULL) / - sn->stats[y][rix].total_packets), sn->stats[y][rix].ewma_pct / 10, sn->stats[y][rix].ewma_pct % 10, (uintmax_t) sn->stats[y][rix].tries, From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 06:12:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22037106566B; Fri, 7 Sep 2012 06:12: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 0DF6B8FC0A; Fri, 7 Sep 2012 06:12: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 q876CStl050104; Fri, 7 Sep 2012 06:12:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q876CSSD050102; Fri, 7 Sep 2012 06:12:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209070612.q876CSSD050102@svn.freebsd.org> From: Alan Cox Date: Fri, 7 Sep 2012 06:12: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: r240185 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 06:12:29 -0000 Author: alc Date: Fri Sep 7 06:12:28 2012 New Revision: 240185 URL: http://svn.freebsd.org/changeset/base/240185 Log: Eliminate unnecessary NULL checks. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Sep 7 06:02:40 2012 (r240184) +++ head/sys/mips/mips/pmap.c Fri Sep 7 06:12:28 2012 (r240185) @@ -359,7 +359,7 @@ pmap_pde(pmap_t pmap, vm_offset_t va) pd_entry_t *pdpe; pdpe = pmap_segmap(pmap, va); - if (pdpe == NULL || *pdpe == NULL) + if (*pdpe == NULL) return (NULL); return (pmap_pdpe_to_pde(pdpe, va)); @@ -1914,7 +1914,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv va_next = eva; pde = pmap_pdpe_to_pde(pdpe, sva); - if (pde == NULL || *pde == NULL) + if (*pde == NULL) continue; if (va_next > eva) va_next = eva; From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 08:18:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABC94106564A; Fri, 7 Sep 2012 08:18:06 +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 972D68FC16; Fri, 7 Sep 2012 08:18:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q878I6dw065548; Fri, 7 Sep 2012 08:18:06 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q878I6aJ065546; Fri, 7 Sep 2012 08:18:06 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209070818.q878I6aJ065546@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 7 Sep 2012 08:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240190 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 08:18:06 -0000 Author: gavin Date: Fri Sep 7 08:18:06 2012 New Revision: 240190 URL: http://svn.freebsd.org/changeset/base/240190 Log: Prevent indent(1) from reformatting this comment, as it contains a formatting-sensitive table. Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Fri Sep 7 07:28:10 2012 (r240189) +++ head/sys/sparc64/include/vmparam.h Fri Sep 7 08:18:06 2012 (r240190) @@ -126,7 +126,7 @@ #define VM_LEVEL_0_ORDER 9 #endif -/* +/** * Address space layout. * * UltraSPARC I and II implement a 44 bit virtual address space. The address From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 08:58:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F231106564A; Fri, 7 Sep 2012 08:58:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88BAE8FC0A; Fri, 7 Sep 2012 08:58: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 q878wVVc070293; Fri, 7 Sep 2012 08:58:31 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q878wVf2070291; Fri, 7 Sep 2012 08:58:31 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209070858.q878wVf2070291@svn.freebsd.org> From: Kevin Lo Date: Fri, 7 Sep 2012 08:58: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: r240191 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 08:58:31 -0000 Author: kevlo Date: Fri Sep 7 08:58:30 2012 New Revision: 240191 URL: http://svn.freebsd.org/changeset/base/240191 Log: Fully initialize the stack-allocated "struct sockaddr_in sa" structure. Modified: head/contrib/bsnmp/snmpd/trap.c Modified: head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- head/contrib/bsnmp/snmpd/trap.c Fri Sep 7 08:18:06 2012 (r240190) +++ head/contrib/bsnmp/snmpd/trap.c Fri Sep 7 08:58:30 2012 (r240191) @@ -117,7 +117,7 @@ trapsink_create(struct trapsink_dep *tde return (SNMP_ERR_RES_UNAVAIL); } (void)shutdown(t->socket, SHUT_RD); - + memset(&sa, 0, sizeof(sa)); sa.sin_len = sizeof(sa); sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl((t->index.subs[0] << 24) | @@ -725,6 +725,7 @@ target_activate_address(struct target_ad } (void)shutdown(addrs->socket, SHUT_RD); + memset(&sa, 0, sizeof(sa)); sa.sin_len = sizeof(sa); sa.sin_family = AF_INET; From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 09:00:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEAE21065673; Fri, 7 Sep 2012 09:00:25 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA29E8FC18; Fri, 7 Sep 2012 09:00: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 q8790PCl070565; Fri, 7 Sep 2012 09:00:25 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8790PLG070563; Fri, 7 Sep 2012 09:00:25 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209070900.q8790PLG070563@svn.freebsd.org> From: Kevin Lo Date: Fri, 7 Sep 2012 09:00: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: r240192 - head/bin/cat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 09:00:25 -0000 Author: kevlo Date: Fri Sep 7 09:00:25 2012 New Revision: 240192 URL: http://svn.freebsd.org/changeset/base/240192 Log: Use "e.g.", not "i.e.", to introduce an example. Obtained from: NetBSD Modified: head/bin/cat/cat.1 Modified: head/bin/cat/cat.1 ============================================================================== --- head/bin/cat/cat.1 Fri Sep 7 08:58:30 2012 (r240191) +++ head/bin/cat/cat.1 Fri Sep 7 09:00:25 2012 (r240192) @@ -127,7 +127,7 @@ to the file truncating .Pa file3 if it already exists. -See the manual page for your shell (i.e., +See the manual page for your shell (e.g., .Xr sh 1 ) for more information on redirection. .Pp From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 13:36:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD045106566B; Fri, 7 Sep 2012 13:36:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D89E8FC14; Fri, 7 Sep 2012 13:36: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 q87Dahfi008115; Fri, 7 Sep 2012 13:36:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87Dahu1008109; Fri, 7 Sep 2012 13:36:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209071336.q87Dahu1008109@svn.freebsd.org> From: Michael Tuexen Date: Fri, 7 Sep 2012 13:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240198 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 13:36:43 -0000 Author: tuexen Date: Fri Sep 7 13:36:42 2012 New Revision: 240198 URL: http://svn.freebsd.org/changeset/base/240198 Log: Don't include a structure containing a flexible array in another structure. MFC after: 10 days Modified: head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Fri Sep 7 13:17:18 2012 (r240197) +++ head/sys/netinet/sctp_header.h Fri Sep 7 13:36:42 2012 (r240198) @@ -510,16 +510,6 @@ struct sctp_stream_reset_add_strm { * streams then the request will need to be an overlay structure. */ -struct sctp_stream_reset_out_req { - struct sctp_chunkhdr ch; - struct sctp_stream_reset_out_request sr_req; -} SCTP_PACKED; - -struct sctp_stream_reset_in_req { - struct sctp_chunkhdr ch; - struct sctp_stream_reset_in_request sr_req; -} SCTP_PACKED; - struct sctp_stream_reset_tsn_req { struct sctp_chunkhdr ch; struct sctp_stream_reset_tsn_request sr_req; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Fri Sep 7 13:17:18 2012 (r240197) +++ head/sys/netinet/sctp_indata.c Fri Sep 7 13:36:42 2012 (r240198) @@ -2113,7 +2113,7 @@ finish_express_del: */ struct sctp_queued_to_read *ctl, *nctl; - sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams); + sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Sep 7 13:17:18 2012 (r240197) +++ head/sys/netinet/sctp_input.c Fri Sep 7 13:36:42 2012 (r240198) @@ -3455,9 +3455,9 @@ process_chunk_drop(struct sctp_tcb *stcb } void -sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; uint16_t temp; /* @@ -3511,7 +3511,7 @@ struct sctp_stream_reset_out_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk) { struct sctp_association *asoc; - struct sctp_stream_reset_out_req *req; + struct sctp_chunkhdr *ch; struct sctp_stream_reset_out_request *r; struct sctp_tmit_chunk *chk; int len, clen; @@ -3534,8 +3534,8 @@ sctp_find_stream_reset(struct sctp_tcb * *bchk = chk; } clen = chk->send_size; - req = mtod(chk->data, struct sctp_stream_reset_out_req *); - r = &req->sr_req; + ch = mtod(chk->data, struct sctp_chunkhdr *); + r = (struct sctp_stream_reset_out_request *)(ch + 1); if (ntohl(r->request_seq) == seq) { /* found it */ return (r); @@ -3888,8 +3888,7 @@ sctp_handle_str_reset_request_out(struct } liste->tsn = tsn; liste->number_entries = number_entries; - memcpy(&liste->req, req, - (sizeof(struct sctp_stream_reset_out_request) + (number_entries * sizeof(uint16_t)))); + memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t)); TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; } @@ -4059,7 +4058,7 @@ __attribute__((noinline)) #endif static int sctp_handle_stream_reset(struct sctp_tcb *stcb, struct mbuf *m, int offset, - struct sctp_stream_reset_out_req *sr_req) + struct sctp_chunkhdr *ch_req) { int chk_length, param_len, ptype; struct sctp_paramhdr pstore; @@ -4074,7 +4073,7 @@ __attribute__((noinline)) int num_param = 0; /* now it may be a reset or a reset-response */ - chk_length = ntohs(sr_req->ch.chunk_length); + chk_length = ntohs(ch_req->chunk_length); /* setup for adding the response */ sctp_alloc_a_chunk(stcb, chk); @@ -5413,7 +5412,7 @@ process_control_chunks: */ stcb->asoc.peer_supports_strreset = 1; } - if (sctp_handle_stream_reset(stcb, m, *offset, (struct sctp_stream_reset_out_req *)ch)) { + if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ *offset = length; return (NULL); Modified: head/sys/netinet/sctp_input.h ============================================================================== --- head/sys/netinet/sctp_input.h Fri Sep 7 13:17:18 2012 (r240197) +++ head/sys/netinet/sctp_input.h Fri Sep 7 13:36:42 2012 (r240198) @@ -53,7 +53,7 @@ sctp_find_stream_reset(struct sctp_tcb * struct sctp_tmit_chunk **bchk); void -sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, +sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list); Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Fri Sep 7 13:17:18 2012 (r240197) +++ head/sys/netinet/sctp_structs.h Fri Sep 7 13:36:42 2012 (r240198) @@ -77,8 +77,8 @@ TAILQ_HEAD(sctpnetlisthead, sctp_nets); struct sctp_stream_reset_list { TAILQ_ENTRY(sctp_stream_reset_list) next_resp; uint32_t tsn; - int number_entries; - struct sctp_stream_reset_out_request req; + uint32_t number_entries; + uint16_t list_of_streams[]; }; TAILQ_HEAD(sctp_resethead, sctp_stream_reset_list); From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 14:46:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59FEE106564A; Fri, 7 Sep 2012 14:46:00 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6758FC08; Fri, 7 Sep 2012 14:46: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 q87Ek0kH017009; Fri, 7 Sep 2012 14:46:00 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87Ejxkr017007; Fri, 7 Sep 2012 14:45:59 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201209071445.q87Ejxkr017007@svn.freebsd.org> From: Fabien Thomas Date: Fri, 7 Sep 2012 14: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: r240203 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 14:46:00 -0000 Author: fabient Date: Fri Sep 7 14:45:59 2012 New Revision: 240203 URL: http://svn.freebsd.org/changeset/base/240203 Log: Complete and merge the list between Sandy/Ivy bridge of events that can run on specific PMC. MFC after: 1 month Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Sep 7 14:10:22 2012 (r240202) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Sep 7 14:45:59 2012 (r240203) @@ -1695,36 +1695,29 @@ iap_event_westmere_ok_on_counter(enum pm } static int -iap_event_sandybridge_ok_on_counter(enum pmc_event pe, int ri) -{ - uint32_t mask; - - switch (pe) { - /* - * Events valid only on counter 2. - */ - case PMC_EV_IAP_EVENT_48H_01H: - mask = 0x4; - break; - default: - mask = ~0; /* Any row index is ok. */ - } - - return (mask & (1 << ri)); -} - -static int -iap_event_ivybridge_ok_on_counter(enum pmc_event pe, int ri) +iap_event_sb_ib_ok_on_counter(enum pmc_event pe, int ri) { uint32_t mask; switch (pe) { - /* - * Events valid only on counter 2. - */ + /* Events valid only on counter 0. */ + case PMC_EV_IAP_EVENT_B7H_01H: + mask = 0x1; + break; + /* Events valid only on counter 1. */ + case PMC_EV_IAP_EVENT_C0H_01H: + mask = 0x1; + break; + /* Events valid only on counter 2. */ case PMC_EV_IAP_EVENT_48H_01H: mask = 0x4; break; + /* Events valid only on counter 3. */ + case PMC_EV_IAP_EVENT_BBH_01H: + case PMC_EV_IAP_EVENT_CDH_01H: + case PMC_EV_IAP_EVENT_CDH_02H: + mask = 0x8; + break; default: mask = ~0; /* Any row index is ok. */ } @@ -1808,12 +1801,9 @@ iap_allocate_pmc(int cpu, int ri, struct if (iap_event_corei7_ok_on_counter(ev, ri) == 0) return (EINVAL); break; - case PMC_CPU_INTEL_IVYBRIDGE: - if (iap_event_ivybridge_ok_on_counter(ev, ri) == 0) - return (EINVAL); - break; case PMC_CPU_INTEL_SANDYBRIDGE: - if (iap_event_sandybridge_ok_on_counter(ev, ri) == 0) + case PMC_CPU_INTEL_IVYBRIDGE: + if (iap_event_sb_ib_ok_on_counter(ev, ri) == 0) return (EINVAL); break; case PMC_CPU_INTEL_WESTMERE: From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 15:10:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A94F31065680; Fri, 7 Sep 2012 15:10:46 +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 94C1E8FC15; Fri, 7 Sep 2012 15:10: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 q87FAkEj019950; Fri, 7 Sep 2012 15:10:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87FAk17019947; Fri, 7 Sep 2012 15:10:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209071510.q87FAk17019947@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Sep 2012 15:10: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: r240204 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 15:10:46 -0000 Author: jhb Date: Fri Sep 7 15:10:46 2012 New Revision: 240204 URL: http://svn.freebsd.org/changeset/base/240204 Log: A few whitespace and comment fixes. Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Sep 7 14:45:59 2012 (r240203) +++ head/sys/kern/kern_exit.c Fri Sep 7 15:10:46 2012 (r240204) @@ -157,8 +157,8 @@ exit1(struct thread *td, int rv) PROC_LOCK(p); while (p->p_flag & P_HADTHREADS) { /* - * First check if some other thread got here before us.. - * if so, act apropriatly, (exit or suspend); + * First check if some other thread got here before us. + * If so, act appropriately: exit or suspend. */ thread_suspend_check(0); @@ -179,7 +179,7 @@ exit1(struct thread *td, int rv) * re-check all suspension request, the thread should * either be suspended there or exit. */ - if (! thread_single(SINGLE_EXIT)) + if (!thread_single(SINGLE_EXIT)) break; /* Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Fri Sep 7 14:45:59 2012 (r240203) +++ head/sys/kern/kern_thread.c Fri Sep 7 15:10:46 2012 (r240204) @@ -718,7 +718,7 @@ stopme: /* * We have gotten rid of all the other threads and we * are about to either exit or exec. In either case, - * we try our utmost to revert to being a non-threaded + * we try our utmost to revert to being a non-threaded * process. */ p->p_singlethread = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 16:59:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B806106566C; Fri, 7 Sep 2012 16:59:31 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 670398FC0A; Fri, 7 Sep 2012 16:59: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 q87GxVJt032759; Fri, 7 Sep 2012 16:59:31 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87GxUuo032756; Fri, 7 Sep 2012 16:59:30 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209071659.q87GxUuo032756@svn.freebsd.org> From: Niclas Zeising Date: Fri, 7 Sep 2012 16:59: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: r240205 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 16:59:31 -0000 Author: zeising (ports committer) Date: Fri Sep 7 16:59:30 2012 New Revision: 240205 URL: http://svn.freebsd.org/changeset/base/240205 Log: Change the link pointing to more information about the Yarrow algorithm, the current link points to a irrelevant catchall site. PR: docs/171411 Submitted by: Mark Martinec (pr), me (patch) Approved by: joel (mentor) MFC after: 2 weeks Modified: head/share/man/man4/random.4 Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Fri Sep 7 15:10:46 2012 (r240204) +++ head/share/man/man4/random.4 Fri Sep 7 16:59:30 2012 (r240205) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2006 +.Dd September 7, 2012 .Dt RANDOM 4 .Os .Sh NAME @@ -142,7 +142,7 @@ if you wish to use them for entropy harv The other variables are explained in the paper describing the .Em Yarrow algorithm at -.Pa http://www.counterpane.com/yarrow.html . +.Pa http://www.schneier.com/yarrow.html . .Pp These variables are all limited in terms of the values they may contain: From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 18:41:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51239106564A; Fri, 7 Sep 2012 18:41: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 3C62F8FC08; Fri, 7 Sep 2012 18:41: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 q87IfKK8045698; Fri, 7 Sep 2012 18:41:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87IfJEF045693; Fri, 7 Sep 2012 18:41:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209071841.q87IfJEF045693@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Sep 2012 18:41: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: r240209 - head/sys/dev/twe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 18:41:20 -0000 Author: jhb Date: Fri Sep 7 18:41:19 2012 New Revision: 240209 URL: http://svn.freebsd.org/changeset/base/240209 Log: Remove remaining 4.x compat shims. No resulting changes (verified by md5). Modified: head/sys/dev/twe/twe.c head/sys/dev/twe/twe_compat.h head/sys/dev/twe/twe_freebsd.c head/sys/dev/twe/twevar.h Modified: head/sys/dev/twe/twe.c ============================================================================== --- head/sys/dev/twe/twe.c Fri Sep 7 18:03:29 2012 (r240208) +++ head/sys/dev/twe/twe.c Fri Sep 7 18:41:19 2012 (r240209) @@ -400,7 +400,7 @@ twe_startio(struct twe_softc *sc) { struct twe_request *tr; TWE_Command *cmd; - twe_bio *bp; + struct bio *bp; int error; debug_called(4); @@ -431,10 +431,10 @@ twe_startio(struct twe_softc *sc) /* connect the bio to the command */ tr->tr_complete = twe_completeio; tr->tr_private = bp; - tr->tr_data = TWE_BIO_DATA(bp); - tr->tr_length = TWE_BIO_LENGTH(bp); + tr->tr_data = bp->bio_data; + tr->tr_length = bp->bio_bcount; cmd = TWE_FIND_COMMAND(tr); - if (TWE_BIO_IS_READ(bp)) { + if (bp->bio_cmd == BIO_READ) { tr->tr_flags |= TWE_CMD_DATAIN; cmd->io.opcode = TWE_OP_READ; } else { @@ -444,9 +444,9 @@ twe_startio(struct twe_softc *sc) /* build a suitable I/O command (assumes 512-byte rounded transfers) */ cmd->io.size = 3; - cmd->io.unit = TWE_BIO_UNIT(bp); + cmd->io.unit = *(int *)(bp->bio_driver1); cmd->io.block_count = (tr->tr_length + TWE_BLOCK_SIZE - 1) / TWE_BLOCK_SIZE; - cmd->io.lba = TWE_BIO_LBA(bp); + cmd->io.lba = bp->bio_pblkno; } /* did we find something to do? */ @@ -461,8 +461,9 @@ twe_startio(struct twe_softc *sc) break; tr->tr_status = TWE_CMD_ERROR; if (tr->tr_private != NULL) { - bp = (twe_bio *)(tr->tr_private); - TWE_BIO_SET_ERROR(bp, error); + bp = (struct bio *)(tr->tr_private); + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; tr->tr_private = NULL; twed_intr(bp); twe_release_request(tr); @@ -1012,15 +1013,17 @@ twe_completeio(struct twe_request *tr) { TWE_Command *cmd = TWE_FIND_COMMAND(tr); struct twe_softc *sc = tr->tr_sc; - twe_bio *bp = (twe_bio *)tr->tr_private; + struct bio *bp = tr->tr_private; debug_called(4); if (tr->tr_status == TWE_CMD_COMPLETE) { if (cmd->generic.status) - if (twe_report_request(tr)) - TWE_BIO_SET_ERROR(bp, EIO); + if (twe_report_request(tr)) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } } else { twe_panic(sc, "twe_completeio on incomplete command"); Modified: head/sys/dev/twe/twe_compat.h ============================================================================== --- head/sys/dev/twe/twe_compat.h Fri Sep 7 18:03:29 2012 (r240208) +++ head/sys/dev/twe/twe_compat.h Fri Sep 7 18:41:19 2012 (r240209) @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -61,6 +62,8 @@ #include #include +#include + #define TWE_DRIVER_NAME twe #define TWED_DRIVER_NAME twed #define TWE_MALLOC_CLASS M_TWE @@ -108,27 +111,6 @@ #define twe_printf(sc, fmt, args...) device_printf(sc->twe_dev, fmt , ##args) #define twed_printf(twed, fmt, args...) device_printf(twed->twed_dev, fmt , ##args) -# include -# include -typedef struct bio twe_bio; -typedef struct bio_queue_head twe_bioq; -# define TWE_BIO_QINIT(bq) bioq_init(&bq); -# define TWE_BIO_QINSERT(bq, bp) bioq_insert_tail(&bq, bp) -# define TWE_BIO_QFIRST(bq) bioq_first(&bq) -# define TWE_BIO_QREMOVE(bq, bp) bioq_remove(&bq, bp) -# define TWE_BIO_IS_READ(bp) ((bp)->bio_cmd == BIO_READ) -# define TWE_BIO_DATA(bp) (bp)->bio_data -# define TWE_BIO_LENGTH(bp) (bp)->bio_bcount -# define TWE_BIO_LBA(bp) (bp)->bio_pblkno -# define TWE_BIO_SOFTC(bp) (bp)->bio_disk->d_drv1 -# define TWE_BIO_UNIT(bp) *(int *)(bp->bio_driver1) -# define TWE_BIO_SET_ERROR(bp, err) do { (bp)->bio_error = err; (bp)->bio_flags |= BIO_ERROR;} while(0) -# define TWE_BIO_HAS_ERROR(bp) ((bp)->bio_flags & BIO_ERROR) -# define TWE_BIO_RESID(bp) (bp)->bio_resid -# define TWE_BIO_DONE(bp) biodone(bp) -# define TWE_BIO_STATS_START(bp) -# define TWE_BIO_STATS_END(bp) - #define TWE_IO_LOCK(sc) mtx_lock(&(sc)->twe_io_lock) #define TWE_IO_UNLOCK(sc) mtx_unlock(&(sc)->twe_io_lock) #define TWE_IO_ASSERT_LOCKED(sc) mtx_assert(&(sc)->twe_io_lock, MA_OWNED) Modified: head/sys/dev/twe/twe_freebsd.c ============================================================================== --- head/sys/dev/twe/twe_freebsd.c Fri Sep 7 18:03:29 2012 (r240208) +++ head/sys/dev/twe/twe_freebsd.c Fri Sep 7 18:41:19 2012 (r240209) @@ -720,9 +720,9 @@ twed_open(struct disk *dp) * Handle an I/O request. */ static void -twed_strategy(twe_bio *bp) +twed_strategy(struct bio *bp) { - struct twed_softc *sc = (struct twed_softc *)TWE_BIO_SOFTC(bp); + struct twed_softc *sc = bp->bio_disk->d_drv1; debug_called(4); @@ -731,16 +731,14 @@ twed_strategy(twe_bio *bp) /* bogus disk? */ if (sc == NULL || sc->twed_drive->td_disk == NULL) { - TWE_BIO_SET_ERROR(bp, EINVAL); + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; printf("twe: bio for invalid disk!\n"); - TWE_BIO_DONE(bp); + biodone(bp); TWED_BIO_OUT; return; } - /* perform accounting */ - TWE_BIO_STATS_START(bp); - /* queue the bio on the controller */ TWE_IO_LOCK(sc->twed_controller); twe_enqueue_bio(sc->twed_controller, bp); @@ -779,16 +777,15 @@ twed_dump(void *arg, void *virtual, vm_o * Handle completion of an I/O request. */ void -twed_intr(twe_bio *bp) +twed_intr(struct bio *bp) { debug_called(4); /* if no error, transfer completed */ - if (!TWE_BIO_HAS_ERROR(bp)) - TWE_BIO_RESID(bp) = 0; + if (!(bp->bio_flags & BIO_ERROR)) + bp->bio_resid = 0; - TWE_BIO_STATS_END(bp); - TWE_BIO_DONE(bp); + biodone(bp); TWED_BIO_OUT; } Modified: head/sys/dev/twe/twevar.h ============================================================================== --- head/sys/dev/twe/twevar.h Fri Sep 7 18:03:29 2012 (r240208) +++ head/sys/dev/twe/twevar.h Fri Sep 7 18:41:19 2012 (r240209) @@ -114,7 +114,7 @@ struct twe_softc { /* controller queues and arrays */ TAILQ_HEAD(, twe_request) twe_free; /* command structures available for reuse */ - twe_bioq twe_bioq; /* outstanding I/O operations */ + struct bio_queue_head twe_bioq; /* outstanding I/O operations */ TAILQ_HEAD(, twe_request) twe_ready; /* requests ready for the controller */ TAILQ_HEAD(, twe_request) twe_busy; /* requests busy in the controller */ TAILQ_HEAD(, twe_request) twe_complete; /* active commands (busy or waiting for completion) */ @@ -166,7 +166,7 @@ extern int twe_detach_drive(struct twe_s int unit); /* detach drive */ extern void twe_clear_pci_parity_error(struct twe_softc *sc); extern void twe_clear_pci_abort(struct twe_softc *sc); -extern void twed_intr(twe_bio *bp); /* return bio from core */ +extern void twed_intr(struct bio *bp); /* return bio from core */ extern struct twe_request *twe_allocate_request(struct twe_softc *sc, int tag); /* allocate request structure */ extern void twe_free_request(struct twe_request *tr); /* free request structure */ extern int twe_map_request(struct twe_request *tr); /* make request visible to controller, do s/g */ @@ -249,24 +249,24 @@ TWEQ_REQUEST_QUEUE(complete, TWEQ_COMPLE static __inline void twe_initq_bio(struct twe_softc *sc) { - TWE_BIO_QINIT(sc->twe_bioq); + bioq_init(&sc->twe_bioq); TWEQ_INIT(sc, TWEQ_BIO); } static __inline void -twe_enqueue_bio(struct twe_softc *sc, twe_bio *bp) +twe_enqueue_bio(struct twe_softc *sc, struct bio *bp) { - TWE_BIO_QINSERT(sc->twe_bioq, bp); + bioq_insert_tail(&sc->twe_bioq, bp); TWEQ_ADD(sc, TWEQ_BIO); } -static __inline twe_bio * +static __inline struct bio * twe_dequeue_bio(struct twe_softc *sc) { - twe_bio *bp; + struct bio *bp; - if ((bp = TWE_BIO_QFIRST(sc->twe_bioq)) != NULL) { - TWE_BIO_QREMOVE(sc->twe_bioq, bp); + if ((bp = bioq_first(&sc->twe_bioq)) != NULL) { + bioq_remove(&sc->twe_bioq, bp); TWEQ_REMOVE(sc, TWEQ_BIO); } return(bp); From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 19:00:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFA8F106566C; Fri, 7 Sep 2012 19:00:27 +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 9A6DA8FC17; Fri, 7 Sep 2012 19:00: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 q87J0RZm047892; Fri, 7 Sep 2012 19:00:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87J0RO0047890; Fri, 7 Sep 2012 19:00:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201209071900.q87J0RO0047890@svn.freebsd.org> From: Xin LI Date: Fri, 7 Sep 2012 19:00: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: r240210 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 19:00:27 -0000 Author: delphij Date: Fri Sep 7 19:00:27 2012 New Revision: 240210 URL: http://svn.freebsd.org/changeset/base/240210 Log: It seems that what the code really meant is that when a write is completed, do a BUS_DMASYNC_POSTWRITE over the DMA map. The way it currently is would only do POSTREAD for read transactions. Submitted by: Sascha Wildner MFC after: 1 month Modified: head/sys/dev/hptmv/entry.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Fri Sep 7 18:41:19 2012 (r240209) +++ head/sys/dev/hptmv/entry.c Fri Sep 7 19:00:27 2012 (r240210) @@ -3046,7 +3046,7 @@ fOsCommandDone(_VBUS_ARG PCommand pCmd) if (pCmd->cf_data_in) { bus_dmamap_sync(pAdapter->io_dma_parent, pmap->dma_map, BUS_DMASYNC_POSTREAD); } - else if (pCmd->cf_data_in) { + else if (pCmd->cf_data_out) { bus_dmamap_sync(pAdapter->io_dma_parent, pmap->dma_map, BUS_DMASYNC_POSTWRITE); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 19:16:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0167F106567F; Fri, 7 Sep 2012 19:16:47 +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 B5D1E8FC12; Fri, 7 Sep 2012 19:16:47 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 36283B93B; Fri, 7 Sep 2012 15:16:47 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 7 Sep 2012 15:14:30 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201209071841.q87IfJEF045693@svn.freebsd.org> In-Reply-To: <201209071841.q87IfJEF045693@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209071514.30725.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 07 Sep 2012 15:16:47 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240209 - head/sys/dev/twe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 19:16:48 -0000 On Friday, September 07, 2012 2:41:19 pm John Baldwin wrote: > Author: jhb > Date: Fri Sep 7 18:41:19 2012 > New Revision: 240209 > URL: http://svn.freebsd.org/changeset/base/240209 > > Log: > Remove remaining 4.x compat shims. No resulting changes (verified by > md5). FYI, verifying by md5 did require some tweaking. First, I had to hack ensure LOCK_DEBUG was off in so that merely shuffling things around wouldn't introduce noise in __LINE__ args passed to mtx_*(). Second, I had to leave the typedefs for 'twe_bio' and 'twe_bioq' in even if they were unused. With those changes the md5 sums were the same. I removed the 'twe_bio' and 'twe_bioq' typedefs for the commit however. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 19:42:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA72610656D4; Fri, 7 Sep 2012 19:42: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 873498FC16; Fri, 7 Sep 2012 19:42: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 q87JgblG052892; Fri, 7 Sep 2012 19:42:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87Jgb08052890; Fri, 7 Sep 2012 19:42:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209071942.q87Jgb08052890@svn.freebsd.org> From: John Baldwin Date: Fri, 7 Sep 2012 19:42: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: r240211 - head/sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 19:42:38 -0000 Author: jhb Date: Fri Sep 7 19:42:36 2012 New Revision: 240211 URL: http://svn.freebsd.org/changeset/base/240211 Log: Use callout(9) instead of timeout(9) to manage timers. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Fri Sep 7 19:00:27 2012 (r240210) +++ head/sys/dev/atkbdc/psm.c Fri Sep 7 19:42:36 2012 (r240211) @@ -291,8 +291,8 @@ struct psm_softc { /* Driver status inf struct timeval lastinputerr; /* time last sync error happened */ struct timeval taptimeout; /* tap timeout for touchpads */ int watchdog; /* watchdog timer flag */ - struct callout_handle callout; /* watchdog timer call out */ - struct callout_handle softcallout; /* buffer timer call out */ + struct callout callout; /* watchdog timer call out */ + struct callout softcallout; /* buffer timer call out */ struct cdev *dev; struct cdev *bdev; int lasterr; @@ -960,7 +960,7 @@ doopen(struct psm_softc *sc, int command /* start the watchdog timer */ sc->watchdog = FALSE; - sc->callout = timeout(psmtimeout, (void *)(uintptr_t)sc, hz*2); + callout_reset(&sc->callout, hz * 2, psmtimeout, sc); return (0); } @@ -979,8 +979,7 @@ reinitialize(struct psm_softc *sc, int d /* block our watchdog timer */ sc->watchdog = FALSE; - untimeout(psmtimeout, (void *)(uintptr_t)sc, sc->callout); - callout_handle_init(&sc->callout); + callout_stop(&sc->callout); /* save the current controller command byte */ empty_both_buffers(sc->kbdc, 10); @@ -1418,7 +1417,8 @@ psmattach(device_t dev) /* Setup initial state */ sc->state = PSM_VALID; - callout_handle_init(&sc->callout); + callout_init(&sc->callout, 0); + callout_init(&sc->softcallout, 0); /* Setup our interrupt handler */ rid = KBDC_RID_AUX; @@ -1487,6 +1487,9 @@ psmdetach(device_t dev) destroy_dev(sc->dev); destroy_dev(sc->bdev); + callout_drain(&sc->callout); + callout_drain(&sc->softcallout); + return (0); } @@ -1615,8 +1618,7 @@ psmclose(struct cdev *dev, int flag, int splx(s); /* stop the watchdog timer */ - untimeout(psmtimeout, (void *)(uintptr_t)sc, sc->callout); - callout_handle_init(&sc->callout); + callout_stop(&sc->callout); /* remove anything left in the output buffer */ empty_aux_buffer(sc->kbdc, 10); @@ -1839,7 +1841,7 @@ dropqueue(struct psm_softc *sc) sc->queue.tail = 0; if ((sc->state & PSM_SOFTARMED) != 0) { sc->state &= ~PSM_SOFTARMED; - untimeout(psmsoftintr, (void *)(uintptr_t)sc, sc->softcallout); + callout_stop(&sc->softcallout); } sc->pqueue_start = sc->pqueue_end; } @@ -2255,7 +2257,7 @@ psmtimeout(void *arg) } sc->watchdog = TRUE; splx(s); - sc->callout = timeout(psmtimeout, (void *)(uintptr_t)sc, hz); + callout_reset(&sc->callout, hz, psmtimeout, sc); } /* Add all sysctls under the debug.psm and hw.psm nodes */ @@ -2437,13 +2439,13 @@ next: (sc->pqueue_end == sc->pqueue_start)) { if ((sc->state & PSM_SOFTARMED) != 0) { sc->state &= ~PSM_SOFTARMED; - untimeout(psmsoftintr, arg, sc->softcallout); + callout_stop(&sc->softcallout); } psmsoftintr(arg); } else if ((sc->state & PSM_SOFTARMED) == 0) { sc->state |= PSM_SOFTARMED; - sc->softcallout = timeout(psmsoftintr, arg, - psmhz < 1 ? 1 : (hz/psmhz)); + callout_reset(&sc->softcallout, + psmhz < 1 ? 1 : (hz/psmhz), psmsoftintr, arg); } } } From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 21:06:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C583106566B; Fri, 7 Sep 2012 21:06:55 +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 37B138FC12; Fri, 7 Sep 2012 21:06: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 q87L6tSA063353; Fri, 7 Sep 2012 21:06:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87L6tWp063351; Fri, 7 Sep 2012 21:06:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209072106.q87L6tWp063351@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 7 Sep 2012 21:06: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: r240214 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 21:06:55 -0000 Author: glebius Date: Fri Sep 7 21:06:54 2012 New Revision: 240214 URL: http://svn.freebsd.org/changeset/base/240214 Log: Supply the pr_ctloutput method for local datagram sockets, so that setsockopt() and getsockopt() work on them. This makes 'tools/regression/sockets/unix_cmsg -t dgram' more successful. Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Sep 7 20:57:36 2012 (r240213) +++ head/sys/kern/uipc_usrreq.c Fri Sep 7 21:06:54 2012 (r240214) @@ -306,6 +306,7 @@ static struct protosw localsw[] = { .pr_type = SOCK_DGRAM, .pr_domain = &localdomain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS, + .pr_ctloutput = &uipc_ctloutput, .pr_usrreqs = &uipc_usrreqs_dgram }, { From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 22:45:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D35106564A; Fri, 7 Sep 2012 22:45:32 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54C078FC0A; Fri, 7 Sep 2012 22:45:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q87MjWio076547; Fri, 7 Sep 2012 22:45:32 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q87MjWue076544; Fri, 7 Sep 2012 22:45:32 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209072245.q87MjWue076544@svn.freebsd.org> From: Matt Jacob Date: Fri, 7 Sep 2012 22:45: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: r240219 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 22:45:32 -0000 Author: mjacob Date: Fri Sep 7 22:45:31 2012 New Revision: 240219 URL: http://svn.freebsd.org/changeset/base/240219 Log: Remove useless extra test. Pointed out by: Sascha of DragonFly BSD MFC after: 2 weeks Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Fri Sep 7 22:34:30 2012 (r240218) +++ head/sys/dev/isp/isp_pci.c Fri Sep 7 22:45:31 2012 (r240219) @@ -1268,8 +1268,7 @@ isp_pci_rd_reg_1080(ispsoftc_t *isp, int { uint32_t rv, oc = 0; - if ((regoff & _BLK_REG_MASK) == SXP_BLOCK || - (regoff & _BLK_REG_MASK) == (SXP_BLOCK|SXP_BANK1_SELECT)) { + if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { uint32_t tc; /* * We will assume that someone has paused the RISC processor. @@ -1301,8 +1300,7 @@ isp_pci_wr_reg_1080(ispsoftc_t *isp, int { int oc = 0; - if ((regoff & _BLK_REG_MASK) == SXP_BLOCK || - (regoff & _BLK_REG_MASK) == (SXP_BLOCK|SXP_BANK1_SELECT)) { + if ((regoff & _BLK_REG_MASK) == SXP_BLOCK) { uint32_t tc; /* * We will assume that someone has paused the RISC processor. From owner-svn-src-head@FreeBSD.ORG Fri Sep 7 23:02:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B26991065670; Fri, 7 Sep 2012 23:02:18 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 0804E8FC19; Fri, 7 Sep 2012 23:02:17 +0000 (UTC) Received: from rnote.ddteam.net (88-243-133-95.pool.ukrtel.net [95.133.243.88]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id EF2BDC493D; Sat, 8 Sep 2012 02:02:10 +0300 (EEST) Date: Sat, 8 Sep 2012 02:02:05 +0300 From: Aleksandr Rybalko To: Bruce Evans Message-Id: <20120908020205.fd7f0c7f.ray@freebsd.org> In-Reply-To: <20120905135841.D1053@besplex.bde.org> References: <201209042316.q84NGtuA035023@svn.freebsd.org> <20120905135841.D1053@besplex.bde.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Adrian Chadd , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: [PATCH]Re: svn commit: r240119 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 23:02:18 -0000 Hi Bruce! Did not absorb all details of style(9) yet. But I'm working on that :) On Wed, 5 Sep 2012 14:18:40 +1000 (EST) Bruce Evans wrote: > On Tue, 4 Sep 2012, Aleksandr Rybalko wrote: > > > Log: > > Style fixes. > > > > Suggested by: mdf > > Approved by: adrian (menthor) > > The following style bugs remain. (The density of style bugs is low > enough for them to be easy to fix.) > > > Modified: head/sys/kern/subr_hints.c > > ============================================================================== > > --- head/sys/kern/subr_hints.c Tue Sep 4 23:13:24 > > 2012 (r240118) +++ head/sys/kern/subr_hints.c Tue > > Sep 4 23:16:55 2012 (r240119) @@ -31,8 +31,8 @@ __FBSDID > > ("$FreeBSD$"); > > #include > > #include > > #include > > -#include > > #include > > +#include > > Sorting this correctly would be an unrelated fix (it is a prerequisite > for most headers, since almost any header may use KASSERT()). Yeah, now I found right place for it. > > > #include > > Sorting this correctly woruld be an unrelated fix. > Yeah, kind of second for kernel. > > > > /* > > @@ -52,9 +52,9 @@ static char *hintp; > > Sorting and indenting the static variables would be an unrelated fix. I swear, I was not touch hintp. Same with checkmethod and use_kenv. :) > > > static int > > sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > A bug in svn diff is visible. The variable declaration is worse than > useless as a header for this block of code. > Did not get it. About which variable you saying? > > > { > > - int error, i, from_kenv, value, eqidx; > > const char *cp; > > char *line, *eq; > > + int eqidx, error, from_kenv, i, value; > > > > from_kenv = 0; > > cp = kern_envp; > > @@ -62,7 +62,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > > > /* Fetch candidate for new hintmode value */ > > Comments (except possibly ones at the right of code) should be real > sentences. This one is missing a ".", unlike all older comments > (not at the right of code) in this file. Fixed. > > > error = sysctl_handle_int(oidp, &value, 0, req); > > - if (error || !req->newptr) > > + if (error || req->newptr == NULL) > > return (error); > > > > if (value != 2) > > This still has a boolean test for the non-boolean `error'. Now the > older code sets a bad example in all cases where `error' is tested. Fixed. > > > @@ -73,8 +73,11 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > switch (hintmode) { > > case 0: > > if (dynamic_kenv) { > > - /* Already here */ > > - hintmode = value; /* XXX: Need we switch > > or not ? */ > > + /* > > + * Already here. But assign hintmode to 2, > > to not > > + * check it in the future. > > + */ > > Sentence breaks should be 2 spaces, as in all older comments in this > file, starting as usual with the copyright. But outside of the > copyright, the style bug of single-space sentence breaks was avoided > in this file mostly by using the larger style bug of using a new line > for most new sentences. Already start delimiting sentences with double space. When folks last time arguing about it, I found power to read only about 10 first mails. :) > > > + hintmode = 2; > > return (0); > > } > > from_kenv = 1; > > @@ -98,7 +101,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > continue; > > } > > eq = strchr(cp, '='); > > - if (!eq) > > + if (eq == NULL) > > /* Bad hint value */ > > continue; > > eqidx = eq - cp; > > Bruce Thank you very much Bruce! I am understand how much important is code style, but still on the way to that point. Patch: --------------------------------------------------------------------- Index: subr_hints.c =================================================================== --- subr_hints.c (revision 240161) +++ subr_hints.c (working copy) @@ -28,12 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include #include -#include -#include /* * Access functions for device resources. @@ -45,7 +45,7 @@ static char *hintp; /* * Define kern.hintmode sysctl, which only accept value 2, that cause to - * switch from Static KENV mode to Dynamic KENV. So systems that have hints + * switch from Static KENV mode to Dynamic KENV. So systems that have hints * compiled into kernel will be able to see/modify KENV (and hints too). */ @@ -60,21 +60,20 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) cp = kern_envp; value = hintmode; - /* Fetch candidate for new hintmode value */ + /* Fetch candidate for new hintmode value. */ error = sysctl_handle_int(oidp, &value, 0, req); - if (error || req->newptr == NULL) + if (error != 0 || req->newptr == NULL) return (error); - if (value != 2) - /* Only accept swithing to hintmode 2 */ + if (value != 2) /* Only accept swithing to hintmode 2 */ return (EINVAL); - /* Migrate from static to dynamic hints */ + /* Migrate from static to dynamic hints. */ switch (hintmode) { case 0: if (dynamic_kenv) { /* - * Already here. But assign hintmode to 2, to not + * Already here. But assign hintmode to 2, to not * check it in the future. */ hintmode = 2; @@ -87,22 +86,21 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) cp = static_hints; break; case 2: - /* Nothing to do, hintmode already 2 */ + /* Nothing to do, if hintmode already 2. */ return (0); } - while (cp) { + while (cp != '\0') { i = strlen(cp); if (i == 0) break; if (from_kenv) { if (strncmp(cp, "hint.", 5) != 0) - /* kenv can have not only hints */ + /* kenv can have not only hints. */ continue; } eq = strchr(cp, '='); - if (eq == NULL) - /* Bad hint value */ + if (eq == NULL) /* Bad hint value */ continue; eqidx = eq - cp; --------------------------------------------------------------------- WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 01:14:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E20A8106564A; Sat, 8 Sep 2012 01:14: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 872158FC17; Sat, 8 Sep 2012 01:14: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 q881EEvX095387; Sat, 8 Sep 2012 01:14:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q881EEXG095384; Sat, 8 Sep 2012 01:14:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209080114.q881EEXG095384@svn.freebsd.org> From: Adrian Chadd Date: Sat, 8 Sep 2012 01:14: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: r240223 - head/tools/tools/ath/athratestats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 01:14:15 -0000 Author: adrian Date: Sat Sep 8 01:14:13 2012 New Revision: 240223 URL: http://svn.freebsd.org/changeset/base/240223 Log: Add a '-s ' option which will display live rate control statistics. Modified: head/tools/tools/ath/athratestats/Makefile head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- head/tools/tools/ath/athratestats/Makefile Fri Sep 7 23:18:13 2012 (r240222) +++ head/tools/tools/ath/athratestats/Makefile Sat Sep 8 01:14:13 2012 (r240223) @@ -7,6 +7,8 @@ PROG= athratestats SRCS= main.c opt_ah.h ah_osdep.h +LDADD+= -lcurses + CLEANFILES+= opt_ah.h ah_osdep.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Fri Sep 7 23:18:13 2012 (r240222) +++ head/tools/tools/ath/athratestats/main.c Sat Sep 8 01:14:13 2012 (r240223) @@ -48,6 +48,8 @@ #include #include +#include + #include "ah.h" #include "ah_desc.h" #include "net80211/ieee80211_ioctl.h" @@ -57,12 +59,21 @@ #include "ath_rate/sample/sample.h" +static int do_loop = 0; + /* * This needs to be big enough to fit the two TLVs, the rate table * and the rate statistics table for a single node. */ #define STATS_BUF_SIZE 8192 +#define PRINTMSG(...) do { \ + if (do_loop == 0) \ + printf(__VA_ARGS__); \ + else \ + printw(__VA_ARGS__); \ + } while (0) + struct ath_ratestats { int s; struct ath_rateioctl re; @@ -96,12 +107,12 @@ ath_sample_stats(struct ath_ratestats *r uint32_t mask; int rix, y; - printf("static_rix (%d) ratemask 0x%x\n", + PRINTMSG("static_rix (%d) ratemask 0x%x\n", sn->static_rix, sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - printf("[%4u] cur rate %d %s since switch: " + PRINTMSG("[%4u] cur rate %d %s since switch: " "packets %d ticks %u\n", bin_to_size(y), dot11rate(rt, sn->current_rix[y]), @@ -109,7 +120,7 @@ ath_sample_stats(struct ath_ratestats *r sn->packets_since_switch[y], sn->ticks_since_switch[y]); - printf("[%4u] last sample (%d %s) cur sample (%d %s) " + PRINTMSG("[%4u] last sample (%d %s) cur sample (%d %s) " "packets sent %d\n", bin_to_size(y), dot11rate(rt, sn->last_sample_rix[y]), @@ -118,12 +129,12 @@ ath_sample_stats(struct ath_ratestats *r dot11str(rt, sn->current_sample_rix[y]), sn->packets_sent[y]); - printf("[%4u] packets since sample %d sample tt %u\n", + PRINTMSG("[%4u] packets since sample %d sample tt %u\n", bin_to_size(y), sn->packets_since_sample[y], sn->sample_tt[y]); } - printf(" TX Rate TXTOTAL:TXOK EWMA T/ F" + PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) @@ -131,8 +142,8 @@ ath_sample_stats(struct ath_ratestats *r for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { if (sn->stats[y][rix].total_packets == 0) continue; - printf("[%2u %s:%4u] %8ju:%-8ju " - "(%3d.%1d%%) %8ju/%4d %5ums %u\n", + PRINTMSG("[%2u %s:%4u] %8ju:%-8ju " + "(%3d.%1d%%) %8ju/%4d %5uuS %u\n", dot11rate(rt, rix), dot11str(rt, rix), bin_to_size(y), @@ -223,6 +234,29 @@ rate_node_stats(struct ath_ratestats *r, ath_sample_stats(r, rt, sn); } +static void +fetch_and_print_stats(struct ath_ratestats *r, struct ether_addr *e, + uint8_t *buf) +{ + + /* Zero the buffer before it's passed in */ + memset(buf, '\0', STATS_BUF_SIZE); + + /* + * Set the station address for this lookup. + */ + ath_setsta(r, e->octet); + + /* + * Fetch the data from the driver. + */ + ath_rate_ioctl(r); + + /* + * Decode and parse statistics. + */ + rate_node_stats(r, e); +} int main(int argc, char *argv[]) @@ -233,12 +267,14 @@ main(int argc, char *argv[]) struct ether_addr *e; struct ath_ratestats r; uint8_t *buf; + useconds_t sleep_period; + float f; ifname = getenv("ATH"); if (ifname == NULL) ifname = "ath0"; - while ((c = getopt(argc, argv, "ahi:m:")) != -1) { + while ((c = getopt(argc, argv, "ahi:m:s:")) != -1) { switch (c) { case 'a': do_all = 1; @@ -249,10 +285,14 @@ main(int argc, char *argv[]) case 'm': macaddr = optarg; break; - + case 's': + sscanf(optarg, "%f", &f); + do_loop = 1; + sleep_period = (useconds_t) (f * 1000000.0); + break; default: errx(1, - "usage: %s [-h] [-i ifname] [-a] [-m macaddr]\n", + "usage: %s [-h] [-i ifname] [-a] [-m macaddr] [-s sleep period]\n", argv[0]); /* NOTREACHED */ } @@ -283,24 +323,30 @@ main(int argc, char *argv[]) if (r.s < 0) { err(1, "socket"); } + /* XXX error check */ ath_setifname(&r, ifname); - /* Zero the buffer before it's passed in */ - memset(buf, '\0', STATS_BUF_SIZE); - - /* - * Set the station address for this lookup. - */ - ath_setsta(&r, e->octet); - - /* - * Fetch the data from the driver. - */ - ath_rate_ioctl(&r); + if (do_loop) { + initscr(); + start_color(); + use_default_colors(); + cbreak(); + noecho(); + nonl(); + nodelay(stdscr, 1); + intrflush(stdscr, FALSE); + keypad(stdscr, TRUE); + + while (1) { + clear(); + move(0, 0); + fetch_and_print_stats(&r, e, buf); + refresh(); + usleep(sleep_period); + } + } else + fetch_and_print_stats(&r, e, buf); - /* - * Decode and parse statistics. - */ - rate_node_stats(&r, e); + exit(0); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 01:26:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3470106564A; Sat, 8 Sep 2012 01:26:52 +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 AEA358FC16; Sat, 8 Sep 2012 01:26: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 q881Qq72096947; Sat, 8 Sep 2012 01:26:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q881QqVd096945; Sat, 8 Sep 2012 01:26:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209080126.q881QqVd096945@svn.freebsd.org> From: Rui Paulo Date: Sat, 8 Sep 2012 01:26: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: r240224 - head/sys/powerpc/wii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 01:26:52 -0000 Author: rpaulo Date: Sat Sep 8 01:26:52 2012 New Revision: 240224 URL: http://svn.freebsd.org/changeset/base/240224 Log: Add IRQ support to the resource list handling functions. Modified: head/sys/powerpc/wii/wii_bus.c Modified: head/sys/powerpc/wii/wii_bus.c ============================================================================== --- head/sys/powerpc/wii/wii_bus.c Sat Sep 8 01:14:13 2012 (r240223) +++ head/sys/powerpc/wii/wii_bus.c Sat Sep 8 01:26:52 2012 (r240224) @@ -104,6 +104,7 @@ DRIVER_MODULE(wiibus, nexus, wiibus_driv static void wiibus_identify(driver_t *driver, device_t parent) { + if (strcmp(installed_platform(), "wii") != 0) return; @@ -115,7 +116,6 @@ wiibus_identify(driver_t *driver, device static int wiibus_probe(device_t dev) { - /* Do not attach to any OF nodes that may be present */ device_set_desc(dev, "Nintendo Wii System Bus"); @@ -127,6 +127,7 @@ wiibus_init_device_resources(struct rman unsigned int rid, uintptr_t addr, size_t len, unsigned int irq) { + if (!dinfo->di_init) { resource_list_init(&dinfo->di_resources); dinfo->di_init++; @@ -246,7 +247,9 @@ wiibus_alloc_resource(device_t bus, devi } rman_set_rid(rv, *rid); break; - /* XXX IRQ */ + case SYS_RES_IRQ: + return (resource_list_alloc(&dinfo->di_resources, bus, child, + type, rid, start, end, count, flags)); default: device_printf(bus, "unknown resource request from %s\n", device_get_nameunit(child)); @@ -280,7 +283,8 @@ wiibus_activate_resource(device_t bus, d rman_set_bustag(res, &bs_be_tag); rman_set_bushandle(res, (unsigned long)p); break; - /* XXX IRQ */ + case SYS_RES_IRQ: + return (bus_activate_resource(bus, type, rid, res)); default: device_printf(bus, "unknown activate resource request from %s\n", From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 02:56:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8E91065672; Sat, 8 Sep 2012 02:56:09 +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 BA9078FC15; Sat, 8 Sep 2012 02:56: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 q882u9cU007907; Sat, 8 Sep 2012 02:56:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q882u9fY007905; Sat, 8 Sep 2012 02:56:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209080256.q882u9fY007905@svn.freebsd.org> From: Adrian Chadd Date: Sat, 8 Sep 2012 02:56: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: r240226 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 02:56:09 -0000 Author: adrian Date: Sat Sep 8 02:56:09 2012 New Revision: 240226 URL: http://svn.freebsd.org/changeset/base/240226 Log: Correctly mask out the RTS/CTS flags when forming aggregates. This had the side effect of clearing HAL_TXDESC_CLRDMASK for a bunch of frames, meaning they'd end up being potentially filtered if there were an error. This is fine in the previous world as they'd just be software retried but now that I'm working on filtered frames, these descriptors would be endlessly retried until another valid frame would come along that had CLRDMASK set. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sat Sep 8 02:41:50 2012 (r240225) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Sep 8 02:56:09 2012 (r240226) @@ -742,7 +742,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s * subsequent frame with this config. */ bf->bf_state.bfs_txflags &= - (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); + ~ (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); bf->bf_state.bfs_txflags |= bf_first->bf_state.bfs_txflags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA); From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 06:41:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A36F106564A; Sat, 8 Sep 2012 06:41:55 +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 0FB3D8FC14; Sat, 8 Sep 2012 06:41: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 q886fsHJ037209; Sat, 8 Sep 2012 06:41:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q886fslk037192; Sat, 8 Sep 2012 06:41:54 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209080641.q886fslk037192@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 8 Sep 2012 06:41: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: r240233 - in head: . contrib/pf/man contrib/pf/pfctl sys/contrib/altq/altq sys/contrib/pf/net sys/modules/pf sys/net sys/netinet sys/netinet/ipfw sys/netinet6 sys/netipsec sys/sys usr.b... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 06:41:55 -0000 Author: glebius Date: Sat Sep 8 06:41:54 2012 New Revision: 240233 URL: http://svn.freebsd.org/changeset/base/240233 Log: Merge the projects/pf/head branch, that was worked on for last six months, into head. The most significant achievements in the new code: o Fine grained locking, thus much better performance. o Fixes to many problems in pf, that were specific to FreeBSD port. New code doesn't have that many ifdefs and much less OpenBSDisms, thus is more attractive to our developers. Those interested in details, can browse through SVN log of the projects/pf/head branch. And for reference, here is exact list of revisions merged: r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330, r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656, r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782, r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868, r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223, r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456, r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505, r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168, r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230, r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398, r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548, r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672, r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169, r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442, r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522, r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661, r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212. I'd like to thank people who participated in early testing: Tested by: Florian Smeets Tested by: Chekaluk Vitaly Tested by: Ben Wilber Tested by: Ian FREISLICH Deleted: head/sys/contrib/pf/net/if_pflow.h Modified: head/UPDATING head/contrib/pf/man/pf.4 head/contrib/pf/man/pf.conf.5 head/contrib/pf/pfctl/parse.y head/contrib/pf/pfctl/pf_print_state.c head/contrib/pf/pfctl/pfctl.c head/contrib/pf/pfctl/pfctl_parser.c head/contrib/pf/pfctl/pfctl_table.c head/sys/contrib/altq/altq/altq_cbq.c head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_subr.c head/sys/contrib/pf/net/if_pflog.c head/sys/contrib/pf/net/if_pflog.h head/sys/contrib/pf/net/if_pfsync.c head/sys/contrib/pf/net/if_pfsync.h head/sys/contrib/pf/net/pf.c head/sys/contrib/pf/net/pf_if.c head/sys/contrib/pf/net/pf_ioctl.c head/sys/contrib/pf/net/pf_lb.c head/sys/contrib/pf/net/pf_mtag.h head/sys/contrib/pf/net/pf_norm.c head/sys/contrib/pf/net/pf_osfp.c head/sys/contrib/pf/net/pf_ruleset.c head/sys/contrib/pf/net/pf_table.c head/sys/contrib/pf/net/pfvar.h head/sys/modules/pf/Makefile head/sys/net/if.c head/sys/netinet/in_gif.c head/sys/netinet/ip_icmp.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_gif.c head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/xform_ipip.c head/sys/sys/mbuf.h head/sys/sys/param.h head/usr.bin/netstat/if.c head/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c head/usr.sbin/bsnmpd/modules/snmp_pf/pf_tree.def Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Sep 8 04:42:33 2012 (r240232) +++ head/UPDATING Sat Sep 8 06:41:54 2012 (r240233) @@ -24,6 +24,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120908: + The pf(4) packet filter ABI has been changed. pfctl(8) and + snmp_pf module need to be recompiled to work with new kernel. + 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 Modified: head/contrib/pf/man/pf.4 ============================================================================== --- head/contrib/pf/man/pf.4 Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/man/pf.4 Sat Sep 8 06:41:54 2012 (r240233) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17 2011 +.Dd June 29 2012 .Dt PF 4 .Os .Sh NAME @@ -75,6 +75,25 @@ separated by characters, similar to how file system hierarchies are laid out. The final component of the anchor path is the anchor under which operations will be performed. +.Sh SYSCTL VARIABLES AND LOADER TUNABLES +The following +.Xr loader 8 +tunables are available. +.Bl -tag -width indent +.It Va net.pf.states_hashsize +Size of hash tables that store states. +Should be power of 2. +Default value is 32768. +.It Va net.pf.source_nodes_hashsize +Size of hash table that store source nodes. +Should be power of 2. +Default value is 8192. +.El +.Pp +Read only +.Xr sysctl 8 +variables with matching names are provided to obtain current values +at runtime. .Sh IOCTL INTERFACE .Nm supports the following @@ -351,7 +370,6 @@ struct pf_status { u_int64_t scounters[SCNT_MAX]; u_int64_t pcounters[2][2][3]; u_int64_t bcounters[2][2]; - u_int64_t stateid; u_int32_t running; u_int32_t states; u_int32_t src_nodes; @@ -493,7 +511,7 @@ struct pfioc_limit { }; enum { PF_LIMIT_STATES, PF_LIMIT_SRC_NODES, PF_LIMIT_FRAGS, - PF_LIMIT_TABLES, PF_LIMIT_TABLE_ENTRIES, PF_LIMIT_MAX }; + PF_LIMIT_TABLE_ENTRIES, PF_LIMIT_MAX }; .Ed .It Dv DIOCGETLIMIT Fa "struct pfioc_limit *pl" Get the hard Modified: head/contrib/pf/man/pf.conf.5 ============================================================================== --- head/contrib/pf/man/pf.conf.5 Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/man/pf.conf.5 Sat Sep 8 06:41:54 2012 (r240233) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 31 2009 +.Dd June 29 2012 .Dt PF.CONF 5 .Os .Sh NAME @@ -1421,7 +1421,7 @@ has the socket open where the packet is (depending on which socket is local). This is in addition to the normal information logged. .Pp -Due to the problems described in the BUGS section only the first packet +Only the first packet logged via .Ar log (all, user) will have the user credentials logged when using stateful matching. @@ -1479,13 +1479,6 @@ of the following keywords: .Bl -tag -width xxxxxxxxxxxxxx -compact .It Ar any Any address. -.It Ar route Aq Ar label -Any address whose associated route has label -.Aq Ar label . -See -.Xr route 4 -and -.Xr route 8 . .It Ar no-route Any address which is not currently routable. .It Ar urpf-failed @@ -1594,7 +1587,6 @@ pass in proto tcp from any to any port 2 pass in proto tcp from 10.0.0.0/8 port \*(Gt 1024 \e to ! 10.1.2.3 port != ssh pass in proto tcp from any os "OpenBSD" -pass in proto tcp from route "DTAG" .Ed .It Ar all This is equivalent to "from any to any". @@ -2949,9 +2941,9 @@ proto-list = ( proto-name | proto-nu hosts = "all" | "from" ( "any" | "no-route" | "urpf-failed" | "self" | host | - "{" host-list "}" | "route" string ) [ port ] [ os ] + "{" host-list "}" ) [ port ] [ os ] "to" ( "any" | "no-route" | "self" | host | - "{" host-list "}" | "route" string ) [ port ] + "{" host-list "}" ) [ port ] ipspec = "any" | host | "{" host-list "}" host = [ "!" ] ( address [ "/" mask-bits ] | "\*(Lt" string "\*(Gt" ) @@ -3048,28 +3040,6 @@ Protocol name database. .It Pa /etc/services Service name database. .El -.Sh BUGS -Due to a lock order reversal (LOR) with the socket layer, the use of the -.Ar group -and -.Ar user -filter parameter in conjuction with a Giant-free netstack -can result in a deadlock. -A workaround is available under the -.Va debug.pfugidhack -sysctl which is automatically enabled when a -.Ar user -/ -.Ar group -rule is added or -.Ar log (user) -is specified. -.Pp -Route labels are not supported by the -.Fx -.Xr route 4 -system. -Rules with a route label do not match any traffic. .Sh SEE ALSO .Xr altq 4 , .Xr carp 4 , @@ -3080,7 +3050,6 @@ Rules with a route label do not match an .Xr pf 4 , .Xr pflow 4 , .Xr pfsync 4 , -.Xr route 4 , .Xr tcp 4 , .Xr udp 4 , .Xr hosts 5 , @@ -3090,7 +3059,6 @@ Rules with a route label do not match an .Xr ftp-proxy 8 , .Xr pfctl 8 , .Xr pflogd 8 , -.Xr route 8 .Sh HISTORY The .Nm Modified: head/contrib/pf/pfctl/parse.y ============================================================================== --- head/contrib/pf/pfctl/parse.y Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/pfctl/parse.y Sat Sep 8 06:41:54 2012 (r240233) @@ -159,8 +159,7 @@ enum { PF_STATE_OPT_MAX, PF_STATE_OPT_NO PF_STATE_OPT_MAX_SRC_STATES, PF_STATE_OPT_MAX_SRC_CONN, PF_STATE_OPT_MAX_SRC_CONN_RATE, PF_STATE_OPT_MAX_SRC_NODES, PF_STATE_OPT_OVERLOAD, PF_STATE_OPT_STATELOCK, - PF_STATE_OPT_TIMEOUT, PF_STATE_OPT_SLOPPY, - PF_STATE_OPT_PFLOW }; + PF_STATE_OPT_TIMEOUT, PF_STATE_OPT_SLOPPY, }; enum { PF_SRCTRACK_NONE, PF_SRCTRACK, PF_SRCTRACK_GLOBAL, PF_SRCTRACK_RULE }; @@ -451,7 +450,7 @@ int parseport(char *, struct range *r, i %token QUEUE PRIORITY QLIMIT RTABLE %token LOAD RULESET_OPTIMIZATION %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE -%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW +%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS %token DIVERTTO DIVERTREPLY %token STRING @@ -2081,15 +2080,6 @@ pfrule : action dir logquick interface } r.rule_flag |= PFRULE_STATESLOPPY; break; - case PF_STATE_OPT_PFLOW: - if (r.rule_flag & PFRULE_PFLOW) { - yyerror("state pflow " - "option: multiple " - "definitions"); - YYERROR; - } - r.rule_flag |= PFRULE_PFLOW; - break; case PF_STATE_OPT_TIMEOUT: if (o->data.timeout.number == PFTM_ADAPTIVE_START || @@ -2909,26 +2899,6 @@ host : STRING { $$->next = NULL; $$->tail = $$; } - | ROUTE STRING { - $$ = calloc(1, sizeof(struct node_host)); - if ($$ == NULL) { - free($2); - err(1, "host: calloc"); - } - $$->addr.type = PF_ADDR_RTLABEL; - if (strlcpy($$->addr.v.rtlabelname, $2, - sizeof($$->addr.v.rtlabelname)) >= - sizeof($$->addr.v.rtlabelname)) { - yyerror("route label too long, max %u chars", - sizeof($$->addr.v.rtlabelname) - 1); - free($2); - free($$); - YYERROR; - } - $$->next = NULL; - $$->tail = $$; - free($2); - } ; number : NUMBER @@ -3597,14 +3567,6 @@ state_opt_item : MAXIMUM NUMBER { $$->next = NULL; $$->tail = $$; } - | PFLOW { - $$ = calloc(1, sizeof(struct node_state_opt)); - if ($$ == NULL) - err(1, "state_opt_item: calloc"); - $$->type = PF_STATE_OPT_PFLOW; - $$->next = NULL; - $$->tail = $$; - } | STRING NUMBER { int i; @@ -5320,7 +5282,6 @@ lookup(char *s) { "out", OUT}, { "overload", OVERLOAD}, { "pass", PASS}, - { "pflow", PFLOW}, { "port", PORT}, { "priority", PRIORITY}, { "priq", PRIQ}, Modified: head/contrib/pf/pfctl/pf_print_state.c ============================================================================== --- head/contrib/pf/pfctl/pf_print_state.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/pfctl/pf_print_state.c Sat Sep 8 06:41:54 2012 (r240233) @@ -119,9 +119,6 @@ print_addr(struct pf_addr_wrap *addr, sa case PF_ADDR_URPFFAILED: printf("urpf-failed"); return; - case PF_ADDR_RTLABEL: - printf("route \"%s\"", addr->v.rtlabelname); - return; default: printf("?"); return; @@ -339,8 +336,6 @@ print_state(struct pfsync_state *s, int printf(", rule %u", ntohl(s->rule)); if (s->state_flags & PFSTATE_SLOPPY) printf(", sloppy"); - if (s->state_flags & PFSTATE_PFLOW) - printf(", pflow"); if (s->sync_flags & PFSYNC_FLAG_SRCNODE) printf(", source-track"); if (s->sync_flags & PFSYNC_FLAG_NATSRCNODE) Modified: head/contrib/pf/pfctl/pfctl.c ============================================================================== --- head/contrib/pf/pfctl/pfctl.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/pfctl/pfctl.c Sat Sep 8 06:41:54 2012 (r240233) @@ -144,7 +144,6 @@ static const struct { { "states", PF_LIMIT_STATES }, { "src-nodes", PF_LIMIT_SRC_NODES }, { "frags", PF_LIMIT_FRAGS }, - { "tables", PF_LIMIT_TABLES }, { "table-entries", PF_LIMIT_TABLE_ENTRIES }, { NULL, 0 } }; @@ -1553,9 +1552,6 @@ pfctl_fopen(const char *name, const char void pfctl_init_options(struct pfctl *pf) { - int64_t mem; - int mib[2]; - size_t size; pf->timeout[PFTM_TCP_FIRST_PACKET] = PFTM_TCP_FIRST_PACKET_VAL; pf->timeout[PFTM_TCP_OPENING] = PFTM_TCP_OPENING_VAL; @@ -1581,21 +1577,8 @@ pfctl_init_options(struct pfctl *pf) pf->limit[PF_LIMIT_STATES] = PFSTATE_HIWAT; pf->limit[PF_LIMIT_FRAGS] = PFFRAG_FRENT_HIWAT; pf->limit[PF_LIMIT_SRC_NODES] = PFSNODE_HIWAT; - pf->limit[PF_LIMIT_TABLES] = PFR_KTABLE_HIWAT; pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT; - mib[0] = CTL_HW; -#ifdef __FreeBSD__ - mib[1] = HW_PHYSMEM; -#else - mib[1] = HW_PHYSMEM64; -#endif - size = sizeof(mem); - if (sysctl(mib, 2, &mem, &size, NULL, 0) == -1) - err(1, "sysctl"); - if (mem <= 100*1024*1024) - pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT_SMALL; - pf->debug = PF_DEBUG_URGENT; } Modified: head/contrib/pf/pfctl/pfctl_parser.c ============================================================================== --- head/contrib/pf/pfctl/pfctl_parser.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/pfctl/pfctl_parser.c Sat Sep 8 06:41:54 2012 (r240233) @@ -955,12 +955,6 @@ print_rule(struct pf_rule *r, const char printf("sloppy"); opts = 0; } - if (r->rule_flag & PFRULE_PFLOW) { - if (!opts) - printf(", "); - printf("pflow"); - opts = 0; - } for (i = 0; i < PFTM_MAX; ++i) if (r->timeout[i]) { int j; Modified: head/contrib/pf/pfctl/pfctl_table.c ============================================================================== --- head/contrib/pf/pfctl/pfctl_table.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/contrib/pf/pfctl/pfctl_table.c Sat Sep 8 06:41:54 2012 (r240233) @@ -621,8 +621,7 @@ print_iface(struct pfi_kif *p, int opts) if (!(opts & PF_OPT_VERBOSE2)) return; printf("\tCleared: %s", ctime(&tzero)); - printf("\tReferences: [ States: %-18d Rules: %-18d ]\n", - p->pfik_states, p->pfik_rules); + printf("\tReferences: %-18d\n", p->pfik_rulerefs); for (i = 0; i < 8; i++) { af = (i>>2) & 1; dir = (i>>1) &1; Modified: head/sys/contrib/altq/altq/altq_cbq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cbq.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/altq/altq/altq_cbq.c Sat Sep 8 06:41:54 2012 (r240233) @@ -271,10 +271,9 @@ cbq_add_altq(struct pf_altq *a) return (ENODEV); /* allocate and initialize cbq_state_t */ - cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); + cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (cbqp == NULL) return (ENOMEM); - bzero(cbqp, sizeof(cbq_state_t)); CALLOUT_INIT(&cbqp->cbq_callout); cbqp->cbq_qlen = 0; cbqp->ifnp.ifq_ = &ifp->if_snd; /* keep the ifq */ Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/altq/altq/altq_hfsc.c Sat Sep 8 06:41:54 2012 (r240233) @@ -200,10 +200,9 @@ hfsc_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_NOWAIT | M_ZERO); if (hif == NULL) return (ENOMEM); - bzero(hif, sizeof(struct hfsc_if)); hif->hif_eligible = ellist_alloc(); if (hif->hif_eligible == NULL) { Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/altq/altq/altq_priq.c Sat Sep 8 06:41:54 2012 (r240233) @@ -132,11 +132,9 @@ priq_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - pif = malloc(sizeof(struct priq_if), - M_DEVBUF, M_WAITOK); + pif = malloc(sizeof(struct priq_if), M_DEVBUF, M_NOWAIT | M_ZERO); if (pif == NULL) return (ENOMEM); - bzero(pif, sizeof(struct priq_if)); pif->pif_bandwidth = a->ifbandwidth; pif->pif_maxpri = -1; pif->pif_ifq = &ifp->if_snd; Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/altq/altq/altq_subr.c Sat Sep 8 06:41:54 2012 (r240233) @@ -401,14 +401,11 @@ tbr_set(ifq, profile) return (0); } - IFQ_UNLOCK(ifq); - tbr = malloc(sizeof(struct tb_regulator), - M_DEVBUF, M_WAITOK); - if (tbr == NULL) { /* can not happen */ + tbr = malloc(sizeof(struct tb_regulator), M_DEVBUF, M_NOWAIT | M_ZERO); + if (tbr == NULL) { IFQ_UNLOCK(ifq); return (ENOMEM); } - bzero(tbr, sizeof(struct tb_regulator)); tbr->tbr_rate = TBR_SCALE(profile->rate / 8) / machclk_freq; tbr->tbr_depth = TBR_SCALE(profile->depth); @@ -420,7 +417,6 @@ tbr_set(ifq, profile) tbr->tbr_last = read_machclk(); tbr->tbr_lastop = ALTDQ_REMOVE; - IFQ_LOCK(ifq); otbr = ifq->altq_tbr; ifq->altq_tbr = tbr; /* set the new tbr */ Modified: head/sys/contrib/pf/net/if_pflog.c ============================================================================== --- head/sys/contrib/pf/net/if_pflog.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/pf/net/if_pflog.c Sat Sep 8 06:41:54 2012 (r240233) @@ -1,10 +1,10 @@ /* $OpenBSD: if_pflog.c,v 1.26 2007/10/18 21:58:18 mpf Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), - * Angelos D. Keromytis (kermit@csd.uch.gr) and + * Angelos D. Keromytis (kermit@csd.uch.gr) and * Niels Provos (provos@physnet.uni-hamburg.de). * - * This code was written by John Ioannidis for BSD/OS in Athens, Greece, + * This code was written by John Ioannidis for BSD/OS in Athens, Greece, * in November 1995. * * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996, @@ -20,7 +20,7 @@ * Permission to use, copy, and modify this software with or without fee * is hereby granted, provided that this entire notice is included in * all copies of any software which is or includes a copy or - * modification of this software. + * modification of this software. * You may use this code under the GNU public license if you so wish. Please * contribute changes back to the authors under this freer than GPL license * so that we may further the use of strong encryption without limitations to @@ -33,61 +33,34 @@ * PURPOSE. */ -#ifdef __FreeBSD__ +#include +__FBSDID("$FreeBSD$"); + #include "opt_inet.h" #include "opt_inet6.h" #include "opt_bpf.h" #include "opt_pf.h" -#include -__FBSDID("$FreeBSD$"); - -#ifdef DEV_BPF -#define NBPFILTER DEV_BPF -#else -#define NBPFILTER 0 -#endif - -#ifdef DEV_PFLOG -#define NPFLOG DEV_PFLOG -#else -#define NPFLOG 0 -#endif - -#else /* ! __FreeBSD__ */ -#include "bpfilter.h" -#include "pflog.h" -#endif /* __FreeBSD__ */ - #include -#include +#include #include +#include #include #include -#ifdef __FreeBSD__ -#include -#include -#include -#include #include -#else -#include -#endif +#include #include -#ifdef __FreeBSD__ #include -#endif +#include #include -#include -#include +#include #if defined(INET) || defined(INET6) #include #endif #ifdef INET #include -#include #include #endif @@ -96,14 +69,9 @@ __FBSDID("$FreeBSD$"); #include #endif /* INET6 */ -#include -#include - -#ifdef __FreeBSD__ #ifdef INET #include #endif /* INET */ -#endif /* __FreeBSD__ */ #define PFLOGMTU (32768 + MHLEN + MLEN) @@ -113,170 +81,82 @@ __FBSDID("$FreeBSD$"); #define DPRINTF(x) #endif -void pflogattach(int); -int pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *, -#ifdef __FreeBSD__ - struct route *); -#else - struct rtentry *); -#endif -int pflogioctl(struct ifnet *, u_long, caddr_t); -void pflogstart(struct ifnet *); -#ifdef __FreeBSD__ -static int pflog_clone_create(struct if_clone *, int, caddr_t); -static void pflog_clone_destroy(struct ifnet *); -#else -int pflog_clone_create(struct if_clone *, int); -int pflog_clone_destroy(struct ifnet *); -#endif +static int pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *, + struct route *); +static void pflogattach(int); +static int pflogioctl(struct ifnet *, u_long, caddr_t); +static void pflogstart(struct ifnet *); +static int pflog_clone_create(struct if_clone *, int, caddr_t); +static void pflog_clone_destroy(struct ifnet *); -LIST_HEAD(, pflog_softc) pflogif_list; -#ifdef __FreeBSD__ IFC_SIMPLE_DECLARE(pflog, 1); -#else -struct if_clone pflog_cloner = - IF_CLONE_INITIALIZER("pflog", pflog_clone_create, pflog_clone_destroy); -#endif struct ifnet *pflogifs[PFLOGIFS_MAX]; /* for fast access */ -void +static void pflogattach(int npflog) { int i; - LIST_INIT(&pflogif_list); for (i = 0; i < PFLOGIFS_MAX; i++) pflogifs[i] = NULL; if_clone_attach(&pflog_cloner); } -#ifdef __FreeBSD__ static int pflog_clone_create(struct if_clone *ifc, int unit, caddr_t param) -#else -int -pflog_clone_create(struct if_clone *ifc, int unit) -#endif { struct ifnet *ifp; - struct pflog_softc *pflogif; - int s; if (unit >= PFLOGIFS_MAX) return (EINVAL); - if ((pflogif = malloc(sizeof(*pflogif), - M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) - return (ENOMEM); - - pflogif->sc_unit = unit; -#ifdef __FreeBSD__ - ifp = pflogif->sc_ifp = if_alloc(IFT_PFLOG); + ifp = if_alloc(IFT_PFLOG); if (ifp == NULL) { - free(pflogif, M_DEVBUF); return (ENOSPC); } if_initname(ifp, ifc->ifc_name, unit); -#else - ifp = &pflogif->sc_if; - snprintf(ifp->if_xname, sizeof ifp->if_xname, "pflog%d", unit); -#endif - ifp->if_softc = pflogif; ifp->if_mtu = PFLOGMTU; ifp->if_ioctl = pflogioctl; ifp->if_output = pflogoutput; ifp->if_start = pflogstart; -#ifndef __FreeBSD__ - ifp->if_type = IFT_PFLOG; -#endif ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_hdrlen = PFLOG_HDRLEN; if_attach(ifp); -#ifndef __FreeBSD__ - if_alloc_sadl(ifp); -#endif -#if NBPFILTER > 0 -#ifdef __FreeBSD__ bpfattach(ifp, DLT_PFLOG, PFLOG_HDRLEN); -#else - bpfattach(&pflogif->sc_if.if_bpf, ifp, DLT_PFLOG, PFLOG_HDRLEN); -#endif -#endif - s = splnet(); -#ifdef __FreeBSD__ - /* XXX: Why pf(4) lock?! Better add a pflog lock?! */ - PF_LOCK(); -#endif - LIST_INSERT_HEAD(&pflogif_list, pflogif, sc_list); pflogifs[unit] = ifp; -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif - splx(s); return (0); } -#ifdef __FreeBSD__ static void pflog_clone_destroy(struct ifnet *ifp) -#else -int -pflog_clone_destroy(struct ifnet *ifp) -#endif { - struct pflog_softc *pflogif = ifp->if_softc; - int s; + int i; - s = splnet(); -#ifdef __FreeBSD__ - PF_LOCK(); -#endif - pflogifs[pflogif->sc_unit] = NULL; - LIST_REMOVE(pflogif, sc_list); -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif - splx(s); + for (i = 0; i < PFLOGIFS_MAX; i++) + if (pflogifs[i] == ifp) + pflogifs[i] = NULL; -#if NBPFILTER > 0 bpfdetach(ifp); -#endif if_detach(ifp); -#ifdef __FreeBSD__ if_free(ifp); -#endif - free(pflogif, M_DEVBUF); -#ifndef __FreeBSD__ - return (0); -#endif } /* * Start output on the pflog interface. */ -void +static void pflogstart(struct ifnet *ifp) { struct mbuf *m; -#ifndef __FreeBSD__ - int s; -#endif for (;;) { -#ifdef __FreeBSD__ IF_LOCK(&ifp->if_snd); _IF_DROP(&ifp->if_snd); _IF_DEQUEUE(&ifp->if_snd, m); IF_UNLOCK(&ifp->if_snd); -#else - s = splnet(); - IF_DROP(&ifp->if_snd); - IF_DEQUEUE(&ifp->if_snd, m); - splx(s); -#endif if (m == NULL) return; @@ -285,35 +165,24 @@ pflogstart(struct ifnet *ifp) } } -int +static int pflogoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, -#ifdef __FreeBSD__ struct route *rt) -#else - struct rtentry *rt) -#endif { m_freem(m); return (0); } /* ARGSUSED */ -int +static int pflogioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { switch (cmd) { case SIOCSIFFLAGS: -#ifdef __FreeBSD__ if (ifp->if_flags & IFF_UP) ifp->if_drv_flags |= IFF_DRV_RUNNING; else ifp->if_drv_flags &= ~IFF_DRV_RUNNING; -#else - if (ifp->if_flags & IFF_UP) - ifp->if_flags |= IFF_RUNNING; - else - ifp->if_flags &= ~IFF_RUNNING; -#endif break; default: return (ENOTTY); @@ -322,12 +191,11 @@ pflogioctl(struct ifnet *ifp, u_long cmd return (0); } -int +static int pflog_packet(struct pfi_kif *kif, struct mbuf *m, sa_family_t af, u_int8_t dir, u_int8_t reason, struct pf_rule *rm, struct pf_rule *am, - struct pf_ruleset *ruleset, struct pf_pdesc *pd) + struct pf_ruleset *ruleset, struct pf_pdesc *pd, int lookupsafe) { -#if NBPFILTER > 0 struct ifnet *ifn; struct pfloghdr hdr; @@ -354,23 +222,18 @@ pflog_packet(struct pfi_kif *kif, struct strlcpy(hdr.ruleset, ruleset->anchor->name, sizeof(hdr.ruleset)); } - if (rm->log & PF_LOG_SOCKET_LOOKUP && !pd->lookup.done) -#ifdef __FreeBSD__ - /* - * XXX: This should not happen as we force an early lookup - * via debug.pfugidhack - */ - ; /* empty */ -#else - pd->lookup.done = pf_socket_lookup(dir, pd); -#endif - if (pd->lookup.done > 0) { + /* + * XXXGL: we avoid pf_socket_lookup() when we are holding + * state lock, since this leads to unsafe LOR. + * These conditions are very very rare, however. + */ + if (rm->log & PF_LOG_SOCKET_LOOKUP && !pd->lookup.done && lookupsafe) + pd->lookup.done = pf_socket_lookup(dir, pd, m); + if (pd->lookup.done > 0) hdr.uid = pd->lookup.uid; - hdr.pid = pd->lookup.pid; - } else { + else hdr.uid = UID_MAX; - hdr.pid = NO_PID; - } + hdr.pid = NO_PID; hdr.rule_uid = rm->cuid; hdr.rule_pid = rm->cpid; hdr.dir = dir; @@ -387,18 +250,11 @@ pflog_packet(struct pfi_kif *kif, struct ifn->if_opackets++; ifn->if_obytes += m->m_pkthdr.len; -#ifdef __FreeBSD__ BPF_MTAP2(ifn, &hdr, PFLOG_HDRLEN, m); -#else - bpf_mtap_hdr(ifn->if_bpf, (char *)&hdr, PFLOG_HDRLEN, m, - BPF_DIRECTION_OUT); -#endif -#endif return (0); } -#ifdef __FreeBSD__ static int pflog_modevent(module_t mod, int type, void *data) { @@ -407,14 +263,14 @@ pflog_modevent(module_t mod, int type, v switch (type) { case MOD_LOAD: pflogattach(1); - PF_LOCK(); + PF_RULES_WLOCK(); pflog_packet_ptr = pflog_packet; - PF_UNLOCK(); + PF_RULES_WUNLOCK(); break; case MOD_UNLOAD: - PF_LOCK(); + PF_RULES_WLOCK(); pflog_packet_ptr = NULL; - PF_UNLOCK(); + PF_RULES_WUNLOCK(); if_clone_detach(&pflog_cloner); break; default: @@ -432,4 +288,3 @@ static moduledata_t pflog_mod = { "pflog DECLARE_MODULE(pflog, pflog_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(pflog, PFLOG_MODVER); MODULE_DEPEND(pflog, pf, PF_MODVER, PF_MODVER, PF_MODVER); -#endif /* __FreeBSD__ */ Modified: head/sys/contrib/pf/net/if_pflog.h ============================================================================== --- head/sys/contrib/pf/net/if_pflog.h Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/pf/net/if_pflog.h Sat Sep 8 06:41:54 2012 (r240233) @@ -29,16 +29,6 @@ #define PFLOGIFS_MAX 16 -struct pflog_softc { -#ifdef __FreeBSD__ - struct ifnet *sc_ifp; /* the interface pointer */ -#else - struct ifnet sc_if; /* the interface */ -#endif - int sc_unit; - LIST_ENTRY(pflog_softc) sc_list; -}; - #define PFLOG_RULESET_NAME_SIZE 16 struct pfloghdr { @@ -62,40 +52,15 @@ struct pfloghdr { /* minus pad, also used as a signature */ #define PFLOG_REAL_HDRLEN offsetof(struct pfloghdr, pad) -/* XXX remove later when old format logs are no longer needed */ -struct old_pfloghdr { - u_int32_t af; - char ifname[IFNAMSIZ]; - short rnr; - u_short reason; - u_short action; - u_short dir; -}; -#define OLD_PFLOG_HDRLEN sizeof(struct old_pfloghdr) - #ifdef _KERNEL -#ifdef __FreeBSD__ struct pf_rule; struct pf_ruleset; struct pfi_kif; struct pf_pdesc; -#if 0 -typedef int pflog_packet_t(struct pfi_kif *, struct mbuf *, sa_family_t, - u_int8_t, u_int8_t, struct pf_rule *, struct pf_rule *, - struct pf_ruleset *, struct pf_pdesc *); -extern pflog_packet_t *pflog_packet_ptr; -#endif -#define PFLOG_PACKET(i,x,a,b,c,d,e,f,g,h) do { \ +#define PFLOG_PACKET(i,a,b,c,d,e,f,g,h,di) do { \ if (pflog_packet_ptr != NULL) \ - pflog_packet_ptr(i,a,b,c,d,e,f,g,h); \ + pflog_packet_ptr(i,a,b,c,d,e,f,g,h,di); \ } while (0) -#else /* ! __FreeBSD__ */ -#if NPFLOG > 0 -#define PFLOG_PACKET(i,x,a,b,c,d,e,f,g,h) pflog_packet(i,a,b,c,d,e,f,g,h) -#else -#define PFLOG_PACKET(i,x,a,b,c,d,e,f,g,h) ((void)0) -#endif /* NPFLOG > 0 */ -#endif #endif /* _KERNEL */ #endif /* _NET_IF_PFLOG_H_ */ Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Sat Sep 8 04:42:33 2012 (r240232) +++ head/sys/contrib/pf/net/if_pfsync.c Sat Sep 8 06:41:54 2012 (r240233) @@ -54,91 +54,44 @@ * 1.173 - correct expire time processing */ -#ifdef __FreeBSD__ -#include "opt_inet.h" -#include "opt_inet6.h" -#include "opt_pf.h" - #include __FBSDID("$FreeBSD$"); -#define NBPFILTER 1 -#endif /* __FreeBSD__ */ +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_pf.h" #include -#include -#ifdef __FreeBSD__ #include +#include #include -#include -#endif -#include -#include -#include +#include +#include #include -#include -#ifdef __FreeBSD__ -#include -#include #include -#include -#include -#include #include +#include #include -#else -#include -#include -#endif +#include +#include #include -#ifndef __FreeBSD__ -#include -#endif +#include #include -#ifdef __FreeBSD__ #include -#endif #include -#include -#include -#include -#ifdef __FreeBSD__ -#include -#endif +#include +#include -#include #include -#include -#include - -#ifdef INET -#include +#include #include #include -#include -#endif - -#ifdef INET6 -#include -#endif /* INET6 */ - -#ifdef __FreeBSD__ -#include -#else -#include "carp.h" -#if NCARP > 0 #include -#endif -#endif - -#include -#include - -#ifndef __FreeBSD__ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 07:12:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 201BE106566C; Sat, 8 Sep 2012 07:12:01 +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 000CF8FC08; Sat, 8 Sep 2012 07:12: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 q887C0p8041584; Sat, 8 Sep 2012 07:12:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q887C02N041580; Sat, 8 Sep 2012 07:12:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209080712.q887C02N041580@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 8 Sep 2012 07:12: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: r240234 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 07:12:01 -0000 Author: glebius Date: Sat Sep 8 07:12:00 2012 New Revision: 240234 URL: http://svn.freebsd.org/changeset/base/240234 Log: The first part of check_priv() function, that attempts to obtain creds from the control message, actually never worked. This means check_priv() didn't work for local dgram sockets. The SCM_CREDS control messages is received only in two cases: 1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case the message is struct sockcred. 2) If sender did supplied SCM_CREDS control message in his sendmsg() syscall. In this case the message is struct cmsgcred. We can't rely on 2), so we will use 1) for dgram sockets. For stream sockets it is more reliable to obtain accept-time credentials, since SCM_CREDS control message is attached only on first read. Thus: o Do setsockopt(LOCAL_CREDS) on local dgram sockets. o Split check_priv() into check_priv_stream() and check_priv_dgram(), and call them from recv_stream() and recv_dgram() respectively. o Don't provide space for SCM_CREDS control message in recv_stream(). o Provide space for SCM_CREDS control message in recv_dgram(), but there is no need to initialize anything in it. o In recv_dgram() do not blindly expect that first message is SCM_CREDS, instead use correct search cycle through control messages. Modified: head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/trans_lsock.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Sat Sep 8 06:41:54 2012 (r240233) +++ head/contrib/bsnmp/snmpd/main.c Sat Sep 8 07:12:00 2012 (r240234) @@ -1026,34 +1026,31 @@ snmp_input_consume(struct port_input *pi pi->length -= pi->consumed; } -struct credmsg { - struct cmsghdr hdr; - struct cmsgcred cred; -}; +static void +check_priv_dgram(struct port_input *pi, struct sockcred *cred) +{ + + /* process explicitly sends credentials */ + if (cred) + pi->priv = (cred->sc_euid == 0); + else + pi->priv = 0; +} static void -check_priv(struct port_input *pi, struct msghdr *msg) +check_priv_stream(struct port_input *pi) { - struct credmsg *cmsg; struct xucred ucred; socklen_t ucredlen; - pi->priv = 0; - - if (msg->msg_controllen == sizeof(*cmsg)) { - /* process explicitly sends credentials */ - - cmsg = (struct credmsg *)msg->msg_control; - pi->priv = (cmsg->cred.cmcred_euid == 0); - return; - } - - /* ok, obtain the accept time credentials */ + /* obtain the accept time credentials */ ucredlen = sizeof(ucred); if (getsockopt(pi->fd, 0, LOCAL_PEERCRED, &ucred, &ucredlen) == 0 && ucredlen >= sizeof(ucred) && ucred.cr_version == XUCRED_VERSION) pi->priv = (ucred.cr_uid == 0); + else + pi->priv = 0; } /* @@ -1065,7 +1062,6 @@ recv_stream(struct port_input *pi) struct msghdr msg; struct iovec iov[1]; ssize_t len; - struct credmsg cmsg; if (pi->buf == NULL) { /* no buffer yet - allocate one */ @@ -1084,17 +1080,8 @@ recv_stream(struct port_input *pi) msg.msg_namelen = pi->peerlen; msg.msg_iov = iov; msg.msg_iovlen = 1; - if (pi->cred) { - msg.msg_control = &cmsg; - msg.msg_controllen = sizeof(cmsg); - - cmsg.hdr.cmsg_len = sizeof(cmsg); - cmsg.hdr.cmsg_level = SOL_SOCKET; - cmsg.hdr.cmsg_type = SCM_CREDS; - } else { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } + msg.msg_control = NULL; + msg.msg_controllen = 0; msg.msg_flags = 0; iov[0].iov_base = pi->buf + pi->length; @@ -1109,7 +1096,7 @@ recv_stream(struct port_input *pi) pi->length += len; if (pi->cred) - check_priv(pi, &msg); + check_priv_stream(pi); return (0); } @@ -1122,10 +1109,12 @@ static int recv_dgram(struct port_input *pi) { u_char embuf[1000]; + char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX))]; struct msghdr msg; struct iovec iov[1]; ssize_t len; - struct credmsg cmsg; + struct cmsghdr *cmsg; + struct sockcred *cred = NULL; if (pi->buf == NULL) { /* no buffer yet - allocate one */ @@ -1145,17 +1134,9 @@ recv_dgram(struct port_input *pi) msg.msg_namelen = pi->peerlen; msg.msg_iov = iov; msg.msg_iovlen = 1; - if (pi->cred) { - msg.msg_control = &cmsg; - msg.msg_controllen = sizeof(cmsg); - - cmsg.hdr.cmsg_len = sizeof(cmsg); - cmsg.hdr.cmsg_level = SOL_SOCKET; - cmsg.hdr.cmsg_type = SCM_CREDS; - } else { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } + memset(cbuf, 0, sizeof(cbuf)); + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); msg.msg_flags = 0; iov[0].iov_base = pi->buf; @@ -1176,8 +1157,15 @@ recv_dgram(struct port_input *pi) pi->length = (size_t)len; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_CREDS) + cred = (struct sockcred *)CMSG_DATA(cmsg); + } + if (pi->cred) - check_priv(pi, &msg); + check_priv_dgram(pi, cred); return (0); } Modified: head/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_lsock.c Sat Sep 8 06:41:54 2012 (r240233) +++ head/contrib/bsnmp/snmpd/trans_lsock.c Sat Sep 8 07:12:00 2012 (r240234) @@ -343,6 +343,7 @@ lsock_init_port(struct tport *tp) } } else { struct lsock_peer *peer; + const int on = 1; peer = LIST_FIRST(&p->peers); @@ -351,6 +352,14 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_RES_UNAVAIL); } + if (setsockopt(peer->input.fd, 0, LOCAL_CREDS, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(LOCAL_CREDS): %m"); + close(peer->input.fd); + peer->input.fd = -1; + return (SNMP_ERR_GENERR); + } + strcpy(sa.sun_path, p->name); sa.sun_family = AF_LOCAL; sa.sun_len = strlen(p->name) + From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 08:46:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB7CE106564A; Sat, 8 Sep 2012 08:46:44 +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 95FFB8FC0C; Sat, 8 Sep 2012 08:46: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 q888kibK054003; Sat, 8 Sep 2012 08:46:44 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q888kioM054001; Sat, 8 Sep 2012 08:46:44 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209080846.q888kioM054001@svn.freebsd.org> From: Joel Dahl Date: Sat, 8 Sep 2012 08:46: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: r240235 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 08:46:44 -0000 Author: joel (doc committer) Date: Sat Sep 8 08:46:43 2012 New Revision: 240235 URL: http://svn.freebsd.org/changeset/base/240235 Log: mdoc fixes. Modified: head/usr.sbin/ppp/ppp.8.m4 Modified: head/usr.sbin/ppp/ppp.8.m4 ============================================================================== --- head/usr.sbin/ppp/ppp.8.m4 Sat Sep 8 07:12:00 2012 (r240234) +++ head/usr.sbin/ppp/ppp.8.m4 Sat Sep 8 08:46:43 2012 (r240235) @@ -292,7 +292,7 @@ In direct mode, acts as server which accepts incoming .Em PPP connections on stdin/stdout. -.It "Supports PAP and CHAP (rfc 1994, 2433 and 2759) authentication. +.It Supports PAP and CHAP (rfc 1994, 2433 and 2759) authentication. With PAP or CHAP, it is possible to skip the Unix style .Xr login 1 procedure, and use the @@ -1019,12 +1019,11 @@ This behaviour can be changed using the .Dq set redial command: .Pp -.No set redial Ar secs Ns Xo +.No set redial Ar secs Ns .Oo + Ns Ar inc Ns -.Op - Ns Ar max Ns -.Oc Ns Op . Ns Ar next +.Oo - Ns Ar max Ns Oc Oc Ns +.Op . Ns Ar next .Op Ar attempts -.Xc .Pp .Bl -tag -width attempts -compact .It Ar secs @@ -1083,7 +1082,6 @@ are specified, the total number of attem attempt each number 4 times). .Pp Alternatively, -.Pp .Bd -literal -offset indent set redial 10+10-5.3 20 .Ed @@ -2029,11 +2027,8 @@ dialing and redialing separated by eithe or a colon .Pq Dq \&: : .Bd -ragged -offset indent -.No set phone Ar telno Ns Xo -.Oo \&| Ns Ar backupnumber -.Oc Ns ... Ns Oo : Ns Ar nextnumber -.Oc Ns ... -.Xc +.No set phone Ar telno Ns +.Oo \&| Ns Ar backupnumber Oc Ns ... Ns Oo : Ns Ar nextnumber Oc Ns ... .Ed .Pp Numbers after the first in a pipe-separated list are only used if the @@ -2530,7 +2525,6 @@ will show the same information at the link level. .Pp Armed with this information, the following configuration might be used: -.Pp .Bd -literal -offset indent mp: set timeout 0 @@ -2554,13 +2548,11 @@ Usually, the link will be configured fir If you wish all links to be up all the time, you can add the following line to the end of your configuration. -.Pp .Bd -literal -offset indent link 1,2,3 set mode ddial .Ed .Pp If you want the links to dial on demand, this command could be used: -.Pp .Bd -literal -offset indent link * set mode auto .Ed @@ -2570,7 +2562,6 @@ Links may be tied to specific names by r line above, and specifying the following after the .Dq clone command: -.Pp .Bd -literal -offset indent link 1 set device /dev/cuad0 link 2 set device /dev/cuad1 @@ -3218,9 +3209,7 @@ Disabling this option will prevent the r although the .Sq stick route list will still be maintained. -.It Op tcp Ns Xo -.No mssfixup -.Xc +.It Oo tcp Oc Ns No mssfixup Default: Enabled. This option tells .Nm @@ -3474,7 +3463,7 @@ be logged to the file .Ar remotePort Ns .Oo .No - Ns Ar remotePort -.Oc Ns +.Oc .Oc .Xc This command causes incoming @@ -3606,7 +3595,7 @@ These commands are also discussed in the .Pa README.nat which comes with the source distribution. .Pp -.It Op !\& Ns Xo +.It Oo !\& Oc Ns Xo .No bg Ar command .Xc The given @@ -3808,7 +3797,7 @@ command is used .Dq !\& ) , .Nm will not complain if the route does not already exist. -.It dial|call Op Ar label Ns Xo +.It dial|call Oo Ar label Oc Ns Xo .No ... .Xc This command is the equivalent of @@ -3945,10 +3934,9 @@ When invoked with .Ar sub-command , only the synopsis for the given sub-command is shown. .El -.It Op data Ns Xo +.It Oo data Oc Ns Xo .No link -.Ar name Ns Op , Ns Ar name Ns -.No ... Ar command Op Ar args +.Ar name Ns Oo , Ns Ar name Oc Ns ... Ar command Op Ar args .Xc This command may prefix any other command if the user wishes to specify which link the command should affect. @@ -3970,7 +3958,7 @@ is .Dq * , .Ar command is executed on all links. -.It load Op Ar label Ns Xo +.It load Oo Ar label Oc Ns Xo .No ... .Xc Load the given @@ -4196,7 +4184,7 @@ certain characters from end to end (such .Pp For the XON/XOFF scenario, use .Dq set accmap 000a0000 . -.It set Op auth Ns Xo +.It set Oo auth Oc Ns Xo .No key Ar value .Xc This sets the authentication key (or password) used in client mode @@ -4360,7 +4348,6 @@ as an option. The .Ar option Ns No s are as follows (in this order of preference): -.Pp .Bl -tag -width Ds .It auth The callee is expected to decide the callback number based on @@ -4993,11 +4980,8 @@ If you wish to assign a dynamic IP numbe .Ar hisaddr may also be specified as a range of IP numbers in the format .Bd -ragged -offset indent -.Ar \&IP Ns Oo \&- Ns Ar \&IP Ns Xo -.Oc Ns Oo , Ns Ar \&IP Ns -.Op \&- Ns Ar \&IP Ns -.Oc Ns ... -.Xc +.Ar \&IP Ns Oo \&- Ns Ar \&IP Ns Oc Ns Oo , Ns Ar \&IP Ns +.Oo \&- Ns Ar \&IP Ns Oc Oc Ns ... .Ed .Pp for example: @@ -5319,10 +5303,7 @@ This allows the line parity to be set. The default value is .Ar none . .It set phone Ar telno Ns Xo -.Oo \&| Ns Ar backupnumber -.Oc Ns ... Ns Oo : Ns Ar nextnumber -.Oc Ns ... -.Xc +.Oo \&| Ns Ar backupnumber Oc Ns ... Ns Oo : Ns Ar nextnumber Oc Ns ... Xc This allows the specification of the phone number to be used in place of the \\\\T string in the dial and login chat scripts. Multiple phone numbers may be given separated either by a pipe @@ -5350,7 +5331,7 @@ This option configures the underlying .Xr ng_pppoe 4 node to either standard RFC2516 PPPoE or proprietary 3Com mode. If not set the system default will be used. -.It set Op proc Ns Xo +.It set Oo proc Oc Ns Xo .No title Op Ar value .Xc The current process title as displayed by @@ -5599,7 +5580,6 @@ NAS-Port-Id. The .Ar option Ns No s are as follows: -.Pp .Bl -tag -width Ds .It pid PID of the corresponding tunnel. @@ -5634,8 +5614,8 @@ If is unspecified or zero, the default kernel controlled value is used. .It set redial Ar secs Ns Xo .Oo + Ns Ar inc Ns -.Op - Ns Ar max Ns -.Oc Ns Op . Ns Ar next +.Oo - Ns Ar max Ns Oc Oc Ns +.Op . Ns Ar next .Op Ar attempts .Xc .Nm @@ -5935,7 +5915,7 @@ Show the current IPCP statistics. Show the protocol layers currently in use. .It show lcp Show the current LCP statistics. -.It show Op data Ns Xo +.It show Oo data Oc Ns Xo .No link .Xc Show high level link information. From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 12:45:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42B08106564A; Sat, 8 Sep 2012 12:45:49 +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 A94B58FC08; Sat, 8 Sep 2012 12:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q88Cjm3t086885; Sat, 8 Sep 2012 12:45:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88Cjmon086882; Sat, 8 Sep 2012 12:45:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209081245.q88Cjmon086882@svn.freebsd.org> From: Eitan Adler Date: Sat, 8 Sep 2012 12:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240237 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 12:45:49 -0000 Author: eadler Date: Sat Sep 8 12:45:47 2012 New Revision: 240237 URL: http://svn.freebsd.org/changeset/base/240237 Log: Revert r239049: This is the way to assign a range, but not a single IPv4 address. PR: conf/167648 Approved by: cperciva (implicit) Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Sep 8 11:34:22 2012 (r240236) +++ head/share/man/man5/rc.conf.5 Sat Sep 8 12:45:47 2012 (r240237) @@ -1201,7 +1201,7 @@ on with the vlan tag 101 and the optional the IPv4 address 192.0.2.1/24: .Bd -literal vlans_em0="101" -ipv4_addrs_em0_101="192.0.2.1/24" +ifconfig_em0_101="inet 192.0.2.1/24" .Ed .Pp To create a vlan device named From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 17:43:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72501065670; Sat, 8 Sep 2012 17:43:20 +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 C73F88FC14; Sat, 8 Sep 2012 17:43: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 q88HhKAJ029746; Sat, 8 Sep 2012 17:43:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88HhKBw029744; Sat, 8 Sep 2012 17:43:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209081743.q88HhKBw029744@svn.freebsd.org> From: Alan Cox Date: Sat, 8 Sep 2012 17:43: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: r240241 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 17:43:21 -0000 Author: alc Date: Sat Sep 8 17:43:20 2012 New Revision: 240241 URL: http://svn.freebsd.org/changeset/base/240241 Log: pmap_remove: Avoid re-walking the page table from the root for every PTE examined. Tidy up some of pmap_remove()'s helper functions. pmap_enter: Set PV_TABLE_REF whenever the physical page being mapped is managed, not just when it is writeable. Only call pmap_update_page() when the old mapping was valid. If there was no prior valid mapping, then pmap_update_page() serves no useful purpose. However, it will interrupt every processor that has the pmap active. pmap_enter_quick_locked: Always set PTE_RO. pmap_emulate_modified: Don't set PV_TABLE_REF. Eliminate a nonsensical comment. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Sep 8 16:47:52 2012 (r240240) +++ head/sys/mips/mips/pmap.c Sat Sep 8 17:43:20 2012 (r240241) @@ -1677,6 +1677,11 @@ pmap_remove_pte(struct pmap *pmap, pt_en rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + /* + * Write back all cache lines from the page being unmapped. + */ + mips_dcache_wbinv_range_index(va, PAGE_SIZE); + oldpte = *ptq; if (is_kernel_pmap(pmap)) *ptq = PTE_G; @@ -1723,24 +1728,13 @@ pmap_remove_page(struct pmap *pmap, vm_o ptq = pmap_pde_to_pte(pde, va); /* - * if there is no pte for this address, just skip it!!! + * If there is no pte for this address, just skip it! */ - if (!pte_test(ptq, PTE_V)) { + if (!pte_test(ptq, PTE_V)) return; - } - /* - * Write back all caches from the page being destroyed - */ - mips_dcache_wbinv_range_index(va, PAGE_SIZE); - - /* - * get a local va for mappings for this pmap. - */ (void)pmap_remove_pte(pmap, ptq, va, *pde); pmap_invalidate_page(pmap, va); - - return; } /* @@ -1789,9 +1783,12 @@ pmap_remove(struct pmap *pmap, vm_offset continue; if (va_next > eva) va_next = eva; - for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; - pte++, sva += PAGE_SIZE) { - pmap_remove_page(pmap, sva); + for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, + sva += PAGE_SIZE) { + if (!pte_test(pte, PTE_V)) + continue; + pmap_remove_pte(pmap, pte, sva, *pde); + pmap_invalidate_page(pmap, sva); } } out: @@ -2035,6 +2032,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, mpte->wire_count--; if (pte_test(&origpte, PTE_MANAGED)) { + m->md.pv_flags |= PV_TABLE_REF; om = m; newpte |= PTE_MANAGED; if (!pte_test(&newpte, PTE_RO)) @@ -2070,6 +2068,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * Enter on the PV list if part of our managed memory. */ if ((m->oflags & VPO_UNMANAGED) == 0) { + m->md.pv_flags |= PV_TABLE_REF; if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; @@ -2087,8 +2086,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.wired_count++; validate: - if ((access & VM_PROT_WRITE) != 0) - m->md.pv_flags |= PV_TABLE_REF; #ifdef PMAP_DEBUG printf("pmap_enter: va: %p -> pa: %p\n", (void *)va, (void *)pa); @@ -2099,8 +2096,8 @@ validate: * update the pte. */ if (origpte != newpte) { + *pte = newpte; if (pte_test(&origpte, PTE_V)) { - *pte = newpte; if (pte_test(&origpte, PTE_MANAGED) && opa != pa) { if (om->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(om, PGA_REFERENCED); @@ -2116,11 +2113,9 @@ validate: if (pte_test(&origpte, PTE_MANAGED) && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); - } else { - *pte = newpte; + pmap_update_page(pmap, va, newpte); } } - pmap_update_page(pmap, va, newpte); /* * Sync I & D caches for executable pages. Do this only if the @@ -2239,7 +2234,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Now validate mapping with RO protection */ - *pte = TLBLO_PA_TO_PFN(pa) | PTE_V; + *pte = PTE_RO | TLBLO_PA_TO_PFN(pa) | PTE_V; if ((m->oflags & VPO_UNMANAGED) == 0) *pte |= PTE_MANAGED; @@ -2251,7 +2246,6 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ if (is_kernel_pmap(pmap)) *pte |= PTE_G; else { - *pte |= PTE_RO; /* * Sync I & D caches. Do this only if the target pmap * belongs to the current process. Otherwise, an @@ -3255,9 +3249,7 @@ init_pte_prot(vm_page_t m, vm_prot_t acc int pmap_emulate_modified(pmap_t pmap, vm_offset_t va) { - vm_page_t m; pt_entry_t *pte; - vm_paddr_t pa; PMAP_LOCK(pmap); pte = pmap_pte(pmap, va); @@ -3275,7 +3267,6 @@ pmap_emulate_modified(pmap_t pmap, vm_of panic("pmap_emulate_modified: invalid pte"); #endif if (pte_test(pte, PTE_RO)) { - /* write to read only page in the kernel */ PMAP_UNLOCK(pmap); return (1); } @@ -3283,9 +3274,6 @@ pmap_emulate_modified(pmap_t pmap, vm_of tlb_update(pmap, va, *pte); 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); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 18:27:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8490F106564A; Sat, 8 Sep 2012 18:27:12 +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 64AC18FC08; Sat, 8 Sep 2012 18:27: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 q88IRCd2035188; Sat, 8 Sep 2012 18:27:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88IRCnN035177; Sat, 8 Sep 2012 18:27:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201209081827.q88IRCnN035177@svn.freebsd.org> From: Attilio Rao Date: Sat, 8 Sep 2012 18:27: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: r240244 - in head/sys: amd64/amd64 i386/i386 ia64/ia32 ia64/ia64 kern mips/mips powerpc/aim powerpc/booke sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 18:27:12 -0000 Author: attilio Date: Sat Sep 8 18:27:11 2012 New Revision: 240244 URL: http://svn.freebsd.org/changeset/base/240244 Log: userret() already checks for td_locks when INVARIANTS is enabled, so there is no need to check if Giant is acquired after it. Reviewed by: kib MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c head/sys/ia64/ia32/ia32_trap.c head/sys/ia64/ia64/trap.c head/sys/kern/kern_fork.c head/sys/kern/subr_trap.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c head/sys/powerpc/booke/trap.c head/sys/sparc64/sparc64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/amd64/amd64/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -632,7 +632,6 @@ trap(struct trapframe *frame) user: userret(td, frame); - mtx_assert(&Giant, MA_NOTOWNED); KASSERT(PCB_USER_FPU(td->td_pcb), ("Return from trap with kernel FPU ctx leaked")); userout: Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/i386/i386/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -775,7 +775,6 @@ trap(struct trapframe *frame) user: userret(td, frame); - mtx_assert(&Giant, MA_NOTOWNED); KASSERT(PCB_USER_FPU(td->td_pcb), ("Return from trap with kernel FPU ctx leaked")); userout: Modified: head/sys/ia64/ia32/ia32_trap.c ============================================================================== --- head/sys/ia64/ia32/ia32_trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/ia64/ia32/ia32_trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -278,6 +278,5 @@ ia32_trap(int vector, struct trapframe * out: userret(td, tf); - mtx_assert(&Giant, MA_NOTOWNED); do_ast(tf); } Modified: head/sys/ia64/ia64/trap.c ============================================================================== --- head/sys/ia64/ia64/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/ia64/ia64/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -841,7 +841,6 @@ trap(int vector, struct trapframe *tf) out: if (user) { userret(td, tf); - mtx_assert(&Giant, MA_NOTOWNED); do_ast(tf); } return; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/kern/kern_fork.c Sat Sep 8 18:27:11 2012 (r240244) @@ -1055,5 +1055,4 @@ fork_return(struct thread *td, struct tr if (KTRPOINT(td, KTR_SYSRET)) ktrsysret(SYS_fork, 0, 0); #endif - mtx_assert(&Giant, MA_NOTOWNED); } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/kern/subr_trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -260,7 +260,6 @@ ast(struct trapframe *framep) } userret(td, framep); - mtx_assert(&Giant, MA_NOTOWNED); } const char * Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/mips/mips/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -1095,7 +1095,6 @@ out: * Note: we should only get here if returning to user mode. */ userret(td, trapframe); - mtx_assert(&Giant, MA_NOTOWNED); return (trapframe->pc); } Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/powerpc/aim/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -297,7 +297,6 @@ trap(struct trapframe *frame) } userret(td, frame); - mtx_assert(&Giant, MA_NOTOWNED); } static void Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/powerpc/booke/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -249,7 +249,6 @@ trap(struct trapframe *frame) } userret(td, frame); - mtx_assert(&Giant, MA_NOTOWNED); } static void Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Sat Sep 8 18:07:35 2012 (r240243) +++ head/sys/sparc64/sparc64/trap.c Sat Sep 8 18:27:11 2012 (r240244) @@ -329,7 +329,6 @@ trap(struct trapframe *tf) } userret(td, tf); - mtx_assert(&Giant, MA_NOTOWNED); } else { KASSERT((tf->tf_type & T_KERNEL) != 0, ("trap: kernel trap isn't")); From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 18:29:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB24106566B; Sat, 8 Sep 2012 18:29:53 +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 B78CC8FC08; Sat, 8 Sep 2012 18:29: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 q88ITrtU035500; Sat, 8 Sep 2012 18:29:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88ITrk8035498; Sat, 8 Sep 2012 18:29:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201209081829.q88ITrk8035498@svn.freebsd.org> From: Attilio Rao Date: Sat, 8 Sep 2012 18:29: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: r240245 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 18:29:53 -0000 Author: attilio Date: Sat Sep 8 18:29:53 2012 New Revision: 240245 URL: http://svn.freebsd.org/changeset/base/240245 Log: Move PT_UPDATED_FLUSH() before td_locks check in order to have more coverage also in the XEN case. Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Sep 8 18:27:11 2012 (r240244) +++ head/sys/kern/subr_trap.c Sat Sep 8 18:29:53 2012 (r240245) @@ -136,6 +136,9 @@ userret(struct thread *td, struct trapfr * Let the scheduler adjust our priority etc. */ sched_userret(td); +#ifdef XEN + PT_UPDATES_FLUSH(); +#endif KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held.", td->td_locks)); #ifdef VIMAGE @@ -145,9 +148,6 @@ userret(struct thread *td, struct trapfr __func__, td, p->p_pid, td->td_name, curvnet, (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); #endif -#ifdef XEN - PT_UPDATES_FLUSH(); -#endif } /* From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 18:35:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21C8F106564A; Sat, 8 Sep 2012 18:35:16 +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 E8B038FC15; Sat, 8 Sep 2012 18:35: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 q88IZFNS036112; Sat, 8 Sep 2012 18:35:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88IZFhV036109; Sat, 8 Sep 2012 18:35:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201209081835.q88IZFhV036109@svn.freebsd.org> From: Attilio Rao Date: Sat, 8 Sep 2012 18:35: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: r240246 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 18:35:16 -0000 Author: attilio Date: Sat Sep 8 18:35:15 2012 New Revision: 240246 URL: http://svn.freebsd.org/changeset/base/240246 Log: Move the checks for td_pinned, td_critnest, TDP_NOFAULTING and TDP_NOSLEEPING leaking from syscallret() to userret() so that also trap handling is covered. Also, the check on td_locks is not duplicated between the two functions. Reported by: avg Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/subr_syscall.c head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sat Sep 8 18:29:53 2012 (r240245) +++ head/sys/kern/subr_syscall.c Sat Sep 8 18:35:15 2012 (r240246) @@ -172,27 +172,6 @@ syscallret(struct thread *td, int error, p = td->td_proc; /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - syscallname(p, sa->code)); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - syscallname(p, sa->code))); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - syscallname(p, sa->code), td->td_locks)); - KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, - ("System call %s returning with pagefaults disabled", - syscallname(p, sa->code))); - KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, - ("System call %s returning with sleep disabled", - syscallname(p, sa->code))); - KASSERT(td->td_pinned == 0, - ("System call %s returning with pinned thread", - syscallname(p, sa->code))); - - /* * Handle reschedule and other end-of-syscall issues */ userret(td, td->td_frame); Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sat Sep 8 18:29:53 2012 (r240245) +++ head/sys/kern/subr_trap.c Sat Sep 8 18:35:15 2012 (r240246) @@ -139,8 +139,21 @@ userret(struct thread *td, struct trapfr #ifdef XEN PT_UPDATES_FLUSH(); #endif + + /* + * Check for misbehavior. + */ + WITNESS_WARN(WARN_PANIC, NULL, "userret: returning"); + KASSERT(td->td_critnest == 0, + ("userret: Returning in a critical section")); KASSERT(td->td_locks == 0, - ("userret: Returning with %d locks held.", td->td_locks)); + ("userret: Returning with %d locks held", td->td_locks)); + KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, + ("userret: Returning with pagefaults disabled")); + KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, + ("userret: Returning with sleep disabled")); + KASSERT(td->td_pinned == 0, + ("userret: Returning with with pinned thread")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 19:24:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBDE1065672; Sat, 8 Sep 2012 19:24:04 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08FC48FC0A; Sat, 8 Sep 2012 19:24:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q88JO3Y1042161; Sat, 8 Sep 2012 19:24:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88JO3Vg042159; Sat, 8 Sep 2012 19:24:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209081924.q88JO3Vg042159@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 8 Sep 2012 19: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: r240247 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 19:24:04 -0000 Author: jilles Date: Sat Sep 8 19:24:03 2012 New Revision: 240247 URL: http://svn.freebsd.org/changeset/base/240247 Log: sh: Remove XXX comment about removing nextopt(). Using nextopt() avoids depending on the BSD-specific optreset feature in getopt() and reduces code size (both source and binary). Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sat Sep 8 18:35:15 2012 (r240246) +++ head/bin/sh/options.c Sat Sep 8 19:24:03 2012 (r240247) @@ -531,10 +531,6 @@ out: } /* - * XXX - should get rid of. have all builtins use getopt(3). the - * library getopt must have the BSD extension static variable "optreset" - * otherwise it can't be used within the shell safely. - * * Standard option processing (a la getopt) for builtin routines. The * only argument that is passed to nextopt is the option string; the * other arguments are unnecessary. It return the character, or '\0' on From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 20:00:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE6A106564A; Sat, 8 Sep 2012 20:00:32 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267218FC08; Sat, 8 Sep 2012 20:00: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 q88K0VRN046337; Sat, 8 Sep 2012 20:00:31 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88K0VF9046335; Sat, 8 Sep 2012 20:00:31 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201209082000.q88K0VF9046335@svn.freebsd.org> From: Andreas Tobler Date: Sat, 8 Sep 2012 20:00: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: r240249 - head/sys/boot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 20:00:32 -0000 Author: andreast Date: Sat Sep 8 20:00:31 2012 New Revision: 240249 URL: http://svn.freebsd.org/changeset/base/240249 Log: Fix loading of kernel modules at boot time for powerpc64. Reported by: Mathias Breuninger MFC after: 1 week Modified: head/sys/boot/common/load_elf.c Modified: head/sys/boot/common/load_elf.c ============================================================================== --- head/sys/boot/common/load_elf.c Sat Sep 8 19:35:23 2012 (r240248) +++ head/sys/boot/common/load_elf.c Sat Sep 8 20:00:31 2012 (r240249) @@ -588,7 +588,7 @@ fake_modname(const char *name) return fp; } -#if defined(__i386__) && __ELF_WORD_SIZE == 64 +#if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64 struct mod_metadata64 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ @@ -601,7 +601,7 @@ int __elfN(parse_modmetadata)(struct preloaded_file *fp, elf_file_t ef) { struct mod_metadata md; -#if defined(__i386__) && __ELF_WORD_SIZE == 64 +#if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64 struct mod_metadata64 md64; #endif struct mod_depend *mdepend; @@ -626,7 +626,7 @@ __elfN(parse_modmetadata)(struct preload v += ef->off; else if (error != 0) return (error); -#if defined(__i386__) && __ELF_WORD_SIZE == 64 +#if (defined(__i386__) || defined(__powerpc__)) && __ELF_WORD_SIZE == 64 COPYOUT(v, &md64, sizeof(md64)); error = __elfN(reloc_ptr)(fp, ef, v, &md64, sizeof(md64)); if (error == EOPNOTSUPP) { From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 20:54:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 153DD106564A; Sat, 8 Sep 2012 20:54:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F41D58FC08; Sat, 8 Sep 2012 20:54: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 q88KssQ8052730; Sat, 8 Sep 2012 20:54:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88KssEG052728; Sat, 8 Sep 2012 20:54:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209082054.q88KssEG052728@svn.freebsd.org> From: Michael Tuexen Date: Sat, 8 Sep 2012 20:54: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: r240250 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 20:54:55 -0000 Author: tuexen Date: Sat Sep 8 20:54:54 2012 New Revision: 240250 URL: http://svn.freebsd.org/changeset/base/240250 Log: Whitespace cleanup. MFC after: 10 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sat Sep 8 20:00:31 2012 (r240249) +++ head/sys/netinet/sctp_asconf.c Sat Sep 8 20:54:54 2012 (r240250) @@ -1862,7 +1862,6 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * { int status; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 || sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* subset bound, no ASCONF allowed case, so ignore */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 21:38:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 992EF106566B; Sat, 8 Sep 2012 21:38:06 +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 6B2D38FC12; Sat, 8 Sep 2012 21:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q88Lc67s057809; Sat, 8 Sep 2012 21:38:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q88Lc5Rp057807; Sat, 8 Sep 2012 21:38:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209082138.q88Lc5Rp057807@svn.freebsd.org> From: Eitan Adler Date: Sat, 8 Sep 2012 21:38: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: r240251 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 21:38:06 -0000 Author: eadler Date: Sat Sep 8 21:38:05 2012 New Revision: 240251 URL: http://svn.freebsd.org/changeset/base/240251 Log: Regenerate src.conf.5 after the projects/armv6 merge Approved by: des Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Sep 8 20:54:54 2012 (r240250) +++ head/share/man/man5/src.conf.5 Sat Sep 8 21:38:05 2012 (r240251) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd July 14, 2012 +.Dd September 8, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -221,7 +221,7 @@ Set to not build Bluetooth related kerne .\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. .It Va WITH_BSDCONFIG -.\" from FreeBSD: head/tools/build/options/WITH_BSDCONFIG 238438 2012-07-14 03:16:57Z dteske +.\" from FreeBSD: head/tools/build/options/WITH_BSDCONFIG 238448 2012-07-14 10:17:47Z zeising Set to install bsdconfig(8), a BSD-licensed configuration/management utility. .It Va WITHOUT_BSD_CPIO .\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb @@ -273,7 +273,7 @@ When set, it also enforces the following Set to not build the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, arm/armv6eb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. When set, it also enforces the following options: .Pp .Bl -item -compact @@ -390,7 +390,7 @@ Set to build Flattened Device Tree suppo This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on -arm/arm, arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. +arm/arm, arm/armeb, arm/armv6, arm/armv6eb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs From owner-svn-src-head@FreeBSD.ORG Sat Sep 8 23:04:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7666E106564A for ; Sat, 8 Sep 2012 23:04:15 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id F10D58FC0C for ; Sat, 8 Sep 2012 23:04:14 +0000 (UTC) Received: by weyx56 with SMTP id x56so561937wey.13 for ; Sat, 08 Sep 2012 16:04:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=N8QUA3lpJ+mWfN3eeTGB3hnCMCok71/95SIJALv8i1g=; b=nxaTkzyGtwR0dxUxJ37KfFfmxPRS9AqqbGjkZP4rqO0yUDzsyvwjWmspxxWpFLREih hbSYZVJ5lVf4ioRsouoVuYbwZGwNha37gka1OGLzQiCKbQp+eT42lFGwEbFfNhoB9jvM eIW2fsPG44aYgtRGboJiVuFhVxJXs7+omOHIg6bZuV5xQIRtH05+M60qR9BVUJ7rHZrC QfswMpPvXz/8aEcq4TlvEZwd5hs1q4A01WyxKxLYSZpICdTq5S8UOgnUlIibJE+PwnZG d2JVBp7X6kzivx+XPPLLe3eMtfECGO4FfI5tnJ46ZWndLWCSwAgp1ydowgnTU3RWI5AE IRsg== Received: by 10.216.132.25 with SMTP id n25mr5055529wei.25.1347145453887; Sat, 08 Sep 2012 16:04:13 -0700 (PDT) Received: from rnote.ddteam.net (27-246-133-95.pool.ukrtel.net. [95.133.246.27]) by mx.google.com with ESMTPS id t7sm11299561wix.6.2012.09.08.16.04.11 (version=SSLv3 cipher=OTHER); Sat, 08 Sep 2012 16:04:12 -0700 (PDT) Date: Sun, 9 Sep 2012 02:04:04 +0300 From: Aleksandr Rybalko To: Aleksandr Rybalko Message-Id: <20120909020404.403b0b6e.ray@ddteam.net> In-Reply-To: <20120908020205.fd7f0c7f.ray@freebsd.org> References: <201209042316.q84NGtuA035023@svn.freebsd.org> <20120905135841.D1053@besplex.bde.org> <20120908020205.fd7f0c7f.ray@freebsd.org> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnWHz3OLxDUp4Yo/l0ZiVohn1Sm7llRfnxmql5bKC9CtOSSDeHHsZ37IlGV4VxBLA2tbrFS Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: [PATCH]Re: svn commit: r240119 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2012 23:04:15 -0000 On Sat, 8 Sep 2012 02:02:05 +0300 Aleksandr Rybalko wrote: > Hi Bruce! > > Did not absorb all details of style(9) yet. But I'm working on that :) > > On Wed, 5 Sep 2012 14:18:40 +1000 (EST) > Bruce Evans wrote: > > > On Tue, 4 Sep 2012, Aleksandr Rybalko wrote: > > > > > Log: > > > Style fixes. > > > > > > Suggested by: mdf > > > Approved by: adrian (menthor) > > > > The following style bugs remain. (The density of style bugs is low > > enough for them to be easy to fix.) > > > > > Modified: head/sys/kern/subr_hints.c > > > ============================================================================== > > > --- head/sys/kern/subr_hints.c Tue Sep 4 23:13:24 > > > 2012 (r240118) +++ head/sys/kern/subr_hints.c Tue > > > Sep 4 23:16:55 2012 (r240119) @@ -31,8 +31,8 @@ __FBSDID > > > ("$FreeBSD$"); > > > #include > > > #include > > > #include > > > -#include > > > #include > > > +#include > > > > Sorting this correctly would be an unrelated fix (it is a > > prerequisite for most headers, since almost any header may use > > KASSERT()). > > Yeah, now I found right place for it. > > > > > > #include > > > > Sorting this correctly woruld be an unrelated fix. > > > > Yeah, kind of second for kernel. > > > > > > > /* > > > @@ -52,9 +52,9 @@ static char *hintp; > > > > Sorting and indenting the static variables would be an unrelated > > fix. > > I swear, I was not touch hintp. Same with checkmethod and > use_kenv. :) > > > > > > static int > > > sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > > > A bug in svn diff is visible. The variable declaration is worse > > than useless as a header for this block of code. > > > > Did not get it. About which variable you saying? > > > > > > { > > > - int error, i, from_kenv, value, eqidx; > > > const char *cp; > > > char *line, *eq; > > > + int eqidx, error, from_kenv, i, value; > > > > > > from_kenv = 0; > > > cp = kern_envp; > > > @@ -62,7 +62,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > > > > > /* Fetch candidate for new hintmode value */ > > > > Comments (except possibly ones at the right of code) should be real > > sentences. This one is missing a ".", unlike all older comments > > (not at the right of code) in this file. > > Fixed. > > > > > > error = sysctl_handle_int(oidp, &value, 0, req); > > > - if (error || !req->newptr) > > > + if (error || req->newptr == NULL) > > > return (error); > > > > > > if (value != 2) > > > > This still has a boolean test for the non-boolean `error'. Now the > > older code sets a bad example in all cases where `error' is tested. > > Fixed. > > > > > > @@ -73,8 +73,11 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > > switch (hintmode) { > > > case 0: > > > if (dynamic_kenv) { > > > - /* Already here */ > > > - hintmode = value; /* XXX: Need we switch > > > or not ? */ > > > + /* > > > + * Already here. But assign hintmode to > > > 2, to not > > > + * check it in the future. > > > + */ > > > > Sentence breaks should be 2 spaces, as in all older comments in this > > file, starting as usual with the copyright. But outside of the > > copyright, the style bug of single-space sentence breaks was avoided > > in this file mostly by using the larger style bug of using a new > > line for most new sentences. > > Already start delimiting sentences with double space. When folks last > time arguing about it, I found power to read only about 10 first > mails. :) > > > > > > + hintmode = 2; > > > return (0); > > > } > > > from_kenv = 1; > > > @@ -98,7 +101,7 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) > > > continue; > > > } > > > eq = strchr(cp, '='); > > > - if (!eq) > > > + if (eq == NULL) > > > /* Bad hint value */ > > > continue; > > > eqidx = eq - cp; > > > > Bruce > > Thank you very much Bruce! I am understand how much important is > code style, but still on the way to that point. > [skip old patch] http://people.freebsd.org/~ray/subr_hints_style.patch +1 update by mdf@ hint Many Thanks! P.S. Tested - WORKS :) WBW -- Aleksandr Rybalko