From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 00:36: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 39ED1106566C; Sun, 1 Jul 2012 00:36:08 +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 24B1F8FC08; Sun, 1 Jul 2012 00:36: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 q610a7bt050630; Sun, 1 Jul 2012 00:36:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q610a7wc050629; Sun, 1 Jul 2012 00:36:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207010036.q610a7wc050629@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 1 Jul 2012 00:36: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: r237860 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 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, 01 Jul 2012 00:36:08 -0000 Author: pfg Date: Sun Jul 1 00:36:07 2012 New Revision: 237860 URL: http://svn.freebsd.org/changeset/base/237860 Log: Import the dtrace llquantize test files from the vendor area. Now that we have an illumos vendor area, import the llquantize test files directly from there to make it easier to track the code provenance. Special thanks to Martin Matuska for populating the illumos vendor area. Requested by: obrien Replaced: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/ - copied from r237859, vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/ From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 02:34: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 0010A106566C; Sun, 1 Jul 2012 02:34:32 +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 DF7C38FC08; Sun, 1 Jul 2012 02:34:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q612YWG3058973; Sun, 1 Jul 2012 02:34:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q612YWd5058970; Sun, 1 Jul 2012 02:34:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207010234.q612YWd5058970@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jul 2012 02:34: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: r237864 - in head/sys/dev/ath: . ath_hal 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, 01 Jul 2012 02:34:33 -0000 Author: adrian Date: Sun Jul 1 02:34:32 2012 New Revision: 237864 URL: http://svn.freebsd.org/changeset/base/237864 Log: Fix the HAL debugging to only use one bit to mark a message as unmaskable. Whilst I'm here, remove the duplication of the #define. Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ath_hal/ah_debug.h Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Sun Jul 1 00:40:56 2012 (r237863) +++ head/sys/dev/ath/ah_osdep.c Sun Jul 1 02:34:32 2012 (r237864) @@ -47,6 +47,7 @@ #include /* XXX for ether_sprintf */ #include +#include /* * WiSoC boards overload the bus tag with information about the @@ -137,8 +138,6 @@ ath_hal_ether_sprintf(const u_int8_t *ma #ifdef AH_DEBUG -/* This must match the definition in ath_hal/ah_debug.h */ -#define HAL_DEBUG_UNMASKABLE 0xf0000000 void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Sun Jul 1 00:40:56 2012 (r237863) +++ head/sys/dev/ath/ath_hal/ah_debug.h Sun Jul 1 02:34:32 2012 (r237864) @@ -48,7 +48,7 @@ enum { HAL_DEBUG_DFS = 0x00200000, /* DFS debugging */ HAL_DEBUG_HANG = 0x00400000, /* BB/MAC hang debugging */ - HAL_DEBUG_UNMASKABLE = 0xf0000000, /* always printed */ + HAL_DEBUG_UNMASKABLE = 0x80000000, /* always printed */ HAL_DEBUG_ANY = 0xffffffff }; #endif /* _ATH_AH_DEBUG_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 02:37: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 88AE61065673; Sun, 1 Jul 2012 02:37:05 +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 74B3B8FC17; Sun, 1 Jul 2012 02:37:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q612b5aF059243; Sun, 1 Jul 2012 02:37:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q612b5J5059241; Sun, 1 Jul 2012 02:37:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207010237.q612b5J5059241@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jul 2012 02:37: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: r237865 - 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: Sun, 01 Jul 2012 02:37:05 -0000 Author: adrian Date: Sun Jul 1 02:37:04 2012 New Revision: 237865 URL: http://svn.freebsd.org/changeset/base/237865 Log: Add OS_MEMCMP(). Modified: head/sys/dev/ath/ah_osdep.h Modified: head/sys/dev/ath/ah_osdep.h ============================================================================== --- head/sys/dev/ath/ah_osdep.h Sun Jul 1 02:34:32 2012 (r237864) +++ head/sys/dev/ath/ah_osdep.h Sun Jul 1 02:37:04 2012 (r237865) @@ -63,6 +63,7 @@ typedef bus_space_handle_t HAL_BUS_HANDL #define OS_INLINE __inline #define OS_MEMZERO(_a, _n) bzero((_a), (_n)) #define OS_MEMCPY(_d, _s, _n) memcpy(_d,_s,_n) +#define OS_MEMCMP(_a, _b, _l) memcmp((_a), (_b), (_l)) #define abs(_a) __builtin_abs(_a) From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 02:44: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 A5BE6106566C; Sun, 1 Jul 2012 02:44:37 +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 907898FC08; Sun, 1 Jul 2012 02:44: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 q612ibmI059948; Sun, 1 Jul 2012 02:44:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q612ibs0059946; Sun, 1 Jul 2012 02:44:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207010244.q612ibs0059946@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jul 2012 02:44: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: r237866 - head/sys/dev/ath/ath_hal 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, 01 Jul 2012 02:44:37 -0000 Author: adrian Date: Sun Jul 1 02:44:36 2012 New Revision: 237866 URL: http://svn.freebsd.org/changeset/base/237866 Log: Bring over capabilities for the AR9300 and later HAL. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sun Jul 1 02:37:04 2012 (r237865) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sun Jul 1 02:44:36 2012 (r237866) @@ -212,10 +212,24 @@ typedef struct { halBssidMatchSupport : 1, hal4kbSplitTransSupport : 1, halHasRxSelfLinkedTail : 1, - halSupportsFastClock5GHz : 1, /* Hardware supports 5ghz fast clock; check eeprom/channel before using */ + halSupportsFastClock5GHz : 1, halHasLongRxDescTsf : 1, halHasBBReadWar : 1, - halSerialiseRegWar : 1; + halSerialiseRegWar : 1, + halMciSupport : 1, + halRxTxAbortSupport : 1, + halPaprdEnabled : 1, + halHasUapsdSupport : 1, + halWpsPushButtonSupport : 1, + halBtCoexApsmWar : 1, + halGenTimerSupport : 1, + halLDPCSupport : 1, + halHwBeaconProcSupport : 1, + halEnhancedDmaSupport : 1; + uint32_t halIsrRacSupport : 1, + halApmEnable : 1, + halIntrMitigation : 1; + uint32_t halWirelessModes; uint16_t halTotalQueues; uint16_t halKeyCacheSize; @@ -231,6 +245,13 @@ typedef struct { uint32_t halIntrMask; uint8_t halTxStreams; uint8_t halRxStreams; + + int halNumTxMaps; + int halTxDescLen; + int halTxStatusLen; + int halRxStatusLen; + int halRxHpFifoDepth; + int halRxLpFifoDepth; } HAL_CAPABILITIES; struct regDomain; From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 03:15:19 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 18F02106564A; Sun, 1 Jul 2012 03:15:19 +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 D71648FC12; Sun, 1 Jul 2012 03:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q613FIcG062070; Sun, 1 Jul 2012 03:15:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q613FII3062067; Sun, 1 Jul 2012 03:15:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207010315.q613FII3062067@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jul 2012 03:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237868 - in head/sys/dev/ath/ath_hal: . ar5416 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, 01 Jul 2012 03:15:19 -0000 Author: adrian Date: Sun Jul 1 03:15:18 2012 New Revision: 237868 URL: http://svn.freebsd.org/changeset/base/237868 Log: Migrate the MAC/BB hang structures out from ar5416_misc.h into the HAL. The ar9300 HAL also uses these types, so it makes no sense to duplicate them. Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sun Jul 1 02:57:30 2012 (r237867) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sun Jul 1 03:15:18 2012 (r237868) @@ -649,6 +649,46 @@ extern HAL_BOOL ath_hal_setcapability(st /* The diagnostic codes used to be internally defined here -adrian */ #include "ah_diagcodes.h" +/* + * The AR5416 and later HALs have MAC and baseband hang checking. + */ +typedef struct { + uint32_t hang_reg_offset; + uint32_t hang_val; + uint32_t hang_mask; + uint32_t hang_offset; +} hal_hw_hang_check_t; + +typedef struct { + uint32_t dma_dbg_3; + uint32_t dma_dbg_4; + uint32_t dma_dbg_5; + uint32_t dma_dbg_6; +} mac_dbg_regs_t; + +typedef enum { + dcu_chain_state = 0x1, + dcu_complete_state = 0x2, + qcu_state = 0x4, + qcu_fsp_ok = 0x8, + qcu_fsp_state = 0x10, + qcu_stitch_state = 0x20, + qcu_fetch_state = 0x40, + qcu_complete_state = 0x80 +} hal_mac_hangs_t; + +typedef struct { + int states; + uint8_t dcu_chain_state; + uint8_t dcu_complete_state; + uint8_t qcu_state; + uint8_t qcu_fsp_ok; + uint8_t qcu_fsp_state; + uint8_t qcu_stitch_state; + uint8_t qcu_fetch_state; + uint8_t qcu_complete_state; +} hal_mac_hang_check_t; + enum { HAL_BB_HANG_DFS = 0x0001, HAL_BB_HANG_RIFS = 0x0002, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sun Jul 1 02:57:30 2012 (r237867) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sun Jul 1 03:15:18 2012 (r237868) @@ -493,36 +493,6 @@ ar5416GetDiagState(struct ath_hal *ah, i args, argsize, result, resultsize); } -typedef struct { - uint32_t dma_dbg_3; - uint32_t dma_dbg_4; - uint32_t dma_dbg_5; - uint32_t dma_dbg_6; -} mac_dbg_regs_t; - -typedef enum { - dcu_chain_state = 0x1, - dcu_complete_state = 0x2, - qcu_state = 0x4, - qcu_fsp_ok = 0x8, - qcu_fsp_state = 0x10, - qcu_stitch_state = 0x20, - qcu_fetch_state = 0x40, - qcu_complete_state = 0x80 -} hal_mac_hangs_t; - -typedef struct { - int states; - uint8_t dcu_chain_state; - uint8_t dcu_complete_state; - uint8_t qcu_state; - uint8_t qcu_fsp_ok; - uint8_t qcu_fsp_state; - uint8_t qcu_stitch_state; - uint8_t qcu_fetch_state; - uint8_t qcu_complete_state; -} hal_mac_hang_check_t; - HAL_BOOL ar5416SetRifsDelay(struct ath_hal *ah, const struct ieee80211_channel *chan, HAL_BOOL enable) From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 04:25: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 4E3BA106566B; Sun, 1 Jul 2012 04:25:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 393E38FC0A; Sun, 1 Jul 2012 04:25: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 q614Po4C065218; Sun, 1 Jul 2012 04:25:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q614PoJD065215; Sun, 1 Jul 2012 04:25:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207010425.q614PoJD065215@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jul 2012 04:25: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: r237871 - head/sys/net80211 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, 01 Jul 2012 04:25:50 -0000 Author: adrian Date: Sun Jul 1 04:25:49 2012 New Revision: 237871 URL: http://svn.freebsd.org/changeset/base/237871 Log: Add a check for dynamic OFDM/CCK channel types. Modified: head/sys/net80211/_ieee80211.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Sun Jul 1 04:15:14 2012 (r237870) +++ head/sys/net80211/_ieee80211.h Sun Jul 1 04:25:49 2012 (r237871) @@ -242,6 +242,8 @@ struct ieee80211_channel { (((_c)->ic_flags & (IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN)) != 0) #define IEEE80211_IS_CHAN_CCK(_c) \ (((_c)->ic_flags & (IEEE80211_CHAN_CCK | IEEE80211_CHAN_DYN)) != 0) +#define IEEE80211_IS_CHAN_DYN(_c) \ + (((_c)->ic_flags & IEEE80211_CHAN_DYN) == IEEE80211_CHAN_DYN) #define IEEE80211_IS_CHAN_GFSK(_c) \ (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0) #define IEEE80211_IS_CHAN_TURBO(_c) \ From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 05:15:09 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 E85281068139; Sun, 1 Jul 2012 05:14:25 +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 6A70B8FC08; Sun, 1 Jul 2012 05:14: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 q615EPko067238; Sun, 1 Jul 2012 05:14:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q615EP5k067236; Sun, 1 Jul 2012 05:14:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207010514.q615EP5k067236@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jul 2012 05:14: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: r237874 - head/sys/dev/ath/ath_hal 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, 01 Jul 2012 05:15:09 -0000 Author: adrian Date: Sun Jul 1 05:14:24 2012 New Revision: 237874 URL: http://svn.freebsd.org/changeset/base/237874 Log: Add in some further changes from the AR9300 HAL: * Add a new ANI variable, for AR9003 and later chips; * The AR9003 and later series chips support two RX queues now, so start down the road of supporting that; * Add some new TX queue types - uAPSD is possible on earlier chips, but PAPRD is relevant to AR9003 and later. Obtained from: Qualcomm Atheros, Linux ath9k Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sun Jul 1 05:13:50 2012 (r237873) +++ head/sys/dev/ath/ath_hal/ah.h Sun Jul 1 05:14:24 2012 (r237874) @@ -73,6 +73,7 @@ typedef enum { HAL_EINPROGRESS = 15, /* Operation incomplete */ HAL_EEBADREG = 16, /* EEPROM invalid regulatory contents */ HAL_EEBADCC = 17, /* EEPROM invalid country code */ + HAL_INV_PMODE = 18, /* Couldn't bring out of sleep state */ } HAL_STATUS; typedef enum { @@ -180,10 +181,19 @@ typedef enum { HAL_TX_QUEUE_CAB = 3, /* "crap after beacon" xmit q */ HAL_TX_QUEUE_UAPSD = 4, /* u-apsd power save xmit q */ HAL_TX_QUEUE_PSPOLL = 5, /* power save poll xmit q */ + HAL_TX_QUEUE_CFEND = 6, + HAL_TX_QUEUE_PAPRD = 7, } HAL_TX_QUEUE; #define HAL_NUM_TX_QUEUES 10 /* max possible # of queues */ +typedef enum { + HAL_RX_QUEUE_HP = 0, /* high priority recv queue */ + HAL_RX_QUEUE_LP = 0, /* low priority recv queue */ +} HAL_RX_QUEUE; + +#define HAL_NUM_RX_QUEUES 2 /* max possible # of queues */ + /* * Transmit queue subtype. These map directly to * WME Access Categories (except for UPSD). Refer @@ -592,7 +602,7 @@ typedef enum { typedef struct { uint8_t kv_type; /* one of HAL_CIPHER */ - uint8_t kv_pad; + uint8_t kv_apsd; /* Mask for APSD enabled ACs */ uint16_t kv_len; /* length in bits */ uint8_t kv_val[16]; /* enough for 128-bit keys */ uint8_t kv_mic[8]; /* TKIP MIC key */ @@ -721,6 +731,7 @@ typedef enum { HAL_ANI_SPUR_IMMUNITY_LEVEL = 5, /* set level */ HAL_ANI_MODE = 6, /* 0 => manual, 1 => auto (XXX do not change) */ HAL_ANI_PHYERR_RESET = 7, /* reset phy error stats */ + HAL_ANI_MRC_CCK = 8, } HAL_ANI_CMD; /* @@ -738,6 +749,7 @@ typedef enum { HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL = 6 } HAL_CAP_INTMIT_CMD; +/* DFS defines */ typedef struct { int32_t pe_firpwr; /* FIR pwr out threshold */ int32_t pe_rrssi; /* Radar rssi thresh */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 05:23:28 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 2C3D91065D76; Sun, 1 Jul 2012 05:22:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1896E8FC18; Sun, 1 Jul 2012 05:22: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 q615MDv0067607; Sun, 1 Jul 2012 05:22:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q615MDEX067605; Sun, 1 Jul 2012 05:22:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207010522.q615MDEX067605@svn.freebsd.org> From: Warner Losh Date: Sun, 1 Jul 2012 05:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237875 - head/sys/geom 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, 01 Jul 2012 05:23:28 -0000 Author: imp Date: Sun Jul 1 05:22:13 2012 New Revision: 237875 URL: http://svn.freebsd.org/changeset/base/237875 Log: Use %j to match intmax_t. Modified: head/sys/geom/geom_map.c Modified: head/sys/geom/geom_map.c ============================================================================== --- head/sys/geom/geom_map.c Sun Jul 1 05:14:24 2012 (r237874) +++ head/sys/geom/geom_map.c Sun Jul 1 05:22:13 2012 (r237875) @@ -321,7 +321,7 @@ g_map_parse_part(struct g_class *mp, str } if (bootverbose) { - printf("MAP: %lxx%lx, data=%lxx%lx " + printf("MAP: %jxx%jx, data=%jxx%jx " "\"/dev/map/%s\"\n", (intmax_t)start, (intmax_t)size, (intmax_t)offset, (intmax_t)dsize, name); From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 05:34: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 A315910672D5; Sun, 1 Jul 2012 05:32:26 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F74E8FC0C; Sun, 1 Jul 2012 05:32: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 q615WQc7068198; Sun, 1 Jul 2012 05:32:26 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q615WQUq068196; Sun, 1 Jul 2012 05:32:26 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201207010532.q615WQUq068196@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sun, 1 Jul 2012 05:32: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: r237878 - head/sys/powerpc/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: Sun, 01 Jul 2012 05:34:31 -0000 Author: ken Date: Sun Jul 1 05:32:26 2012 New Revision: 237878 URL: http://svn.freebsd.org/changeset/base/237878 Log: Now that the mps(4) driver is endian-safe, add it to the powerpc 32-bit GENERIC config file. MFC after: 3 days Reqested by: nwhitehorn Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Jul 1 05:23:59 2012 (r237877) +++ head/sys/powerpc/conf/GENERIC Sun Jul 1 05:32:26 2012 (r237878) @@ -107,6 +107,7 @@ options AHC_REG_PRETTY_PRINT # Print re device isp # Qlogic family device ispfw # Firmware module for Qlogic host adapters device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D # ATA/SCSI peripherals From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 06:34:18 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 0A053106566B; Sun, 1 Jul 2012 06:34:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8E888FC08; Sun, 1 Jul 2012 06:34:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q616YHtf070845; Sun, 1 Jul 2012 06:34:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q616YHlt070837; Sun, 1 Jul 2012 06:34:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207010634.q616YHlt070837@svn.freebsd.org> From: Warner Losh Date: Sun, 1 Jul 2012 06:34: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: r237881 - head/sys/arm/at91 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, 01 Jul 2012 06:34:18 -0000 Author: imp Date: Sun Jul 1 06:34:17 2012 New Revision: 237881 URL: http://svn.freebsd.org/changeset/base/237881 Log: Opt-in rather than opt-out of the SoC. We don't really support running with multiple SoCs compiled in very well anyway, so this just wastes space. As more and more SoCs arrive in the tree, it is better to edit one master file that builds them all than many board files. Modified: head/sys/arm/at91/std.at91 head/sys/arm/at91/std.at91sam9 head/sys/arm/at91/std.ethernut5 head/sys/arm/at91/std.hl201 head/sys/arm/at91/std.qila9g20 head/sys/arm/at91/std.sam9g20ek head/sys/arm/at91/std.sam9x25ek Modified: head/sys/arm/at91/std.at91 ============================================================================== --- head/sys/arm/at91/std.at91 Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.at91 Sun Jul 1 06:34:17 2012 (r237881) @@ -1,6 +1,6 @@ # $FreeBSD$ -files "../at91/files.at91" +files "../at91/files.at91" cpu CPU_ARM9 makeoptions CONF_CFLAGS=-mcpu=arm9 options PHYSADDR=0x20000000 Modified: head/sys/arm/at91/std.at91sam9 ============================================================================== --- head/sys/arm/at91/std.at91sam9 Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.at91sam9 Sun Jul 1 06:34:17 2012 (r237881) @@ -1,13 +1,9 @@ # $FreeBSD$ -files "../at91/files.at91" +files "../at91/files.at91" cpu CPU_ARM9 makeoptions CONF_CFLAGS=-mcpu=arm9 options PHYSADDR=0x20000000 # bring in the sam specific timers and such device at91sam9 - -device at91sam9260 -device at91sam9g20 -device at91sam9x25 Modified: head/sys/arm/at91/std.ethernut5 ============================================================================== --- head/sys/arm/at91/std.ethernut5 Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.ethernut5 Sun Jul 1 06:34:17 2012 (r237881) @@ -8,5 +8,4 @@ options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_ethernut5 -nodevice at91sam9g20 -nodevice at91sam9x25 +device at91sam9260 Modified: head/sys/arm/at91/std.hl201 ============================================================================== --- head/sys/arm/at91/std.hl201 Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.hl201 Sun Jul 1 06:34:17 2012 (r237881) @@ -8,3 +8,4 @@ options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_hl201 +device at91sam9g20 Modified: head/sys/arm/at91/std.qila9g20 ============================================================================== --- head/sys/arm/at91/std.qila9g20 Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.qila9g20 Sun Jul 1 06:34:17 2012 (r237881) @@ -8,3 +8,4 @@ options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_qila9g20 +device at91sam9g20 Modified: head/sys/arm/at91/std.sam9g20ek ============================================================================== --- head/sys/arm/at91/std.sam9g20ek Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.sam9g20ek Sun Jul 1 06:34:17 2012 (r237881) @@ -8,3 +8,4 @@ options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_sam9g20ek +device at91sam9g20 Modified: head/sys/arm/at91/std.sam9x25ek ============================================================================== --- head/sys/arm/at91/std.sam9x25ek Sun Jul 1 05:40:33 2012 (r237880) +++ head/sys/arm/at91/std.sam9x25ek Sun Jul 1 06:34:17 2012 (r237881) @@ -8,5 +8,4 @@ options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_sam9x25ek -nodevice at91sam9g20 -nodevice at91sam9260 +device at91sam9x25 From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 06:56:42 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 4752F106566B; Sun, 1 Jul 2012 06:56:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320078FC08; Sun, 1 Jul 2012 06:56: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 q616ugSk071882; Sun, 1 Jul 2012 06:56:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q616ufcY071880; Sun, 1 Jul 2012 06:56:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207010656.q616ufcY071880@svn.freebsd.org> From: Warner Losh Date: Sun, 1 Jul 2012 06:56: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: r237883 - in head/sys/arm: at91 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: Sun, 01 Jul 2012 06:56:42 -0000 Author: imp Date: Sun Jul 1 06:56:41 2012 New Revision: 237883 URL: http://svn.freebsd.org/changeset/base/237883 Log: Create a pseudo-lint kernel for all at91 SoCs. This kernel will not currently boot, but will serve as a good linting. make universe could now be altered to skip building all the other at91 kernels... Added: head/sys/arm/at91/std.atmel (contents, props changed) head/sys/arm/conf/ATMEL (contents, props changed) Added: head/sys/arm/at91/std.atmel ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/std.atmel Sun Jul 1 06:56:41 2012 (r237883) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +files "../at91/files.at91" +cpu CPU_ARM9 +makeoptions CONF_CFLAGS=-mcpu=arm9 +options PHYSADDR=0x20000000 + +# Supported SoCs for the at91 platform +device at91rm9200 +device at91sam9260 +device at91sam9g20 +device at91sam9x25 + +# bring in the sam specific timers and such +device at91sam9 Added: head/sys/arm/conf/ATMEL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/ATMEL Sun Jul 1 06:56:41 2012 (r237883) @@ -0,0 +1,166 @@ +# Kernel configuration to test compile all the atmel bits with one +# configuration. This kernel will not (presently) boot. Do not copy +# it to create your own custom config file. +# +# $FreeBSD$ + +ident ATMEL + +include "../at91/std.atmel" + +# Arbitrary values for testing purposes. +options STARTUP_PAGETABLE_ADDR=0x20800000 +makeoptions KERNPHYSADDR=0x20000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNPHYSADDR=0x20000000 +options KERNVIRTADDR=0xc0000000 + +makeoptions MODULES_OVERRIDE="" + +# list all boards here, but not just yet (no multiboard in mainline). +#device at91_board_bwct +#device at91_board_ethernut5 +#device at91_board_hl200 +#device at91_board_hl201 +#device at91_board_kb920x +#device at91_board_qila9g20 +device at91_board_sam9g20ek +#device at91_board_sam9x25ek +#device at91_board_tsc4370 + +#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols + +options SCHED_4BSD # 4BSD scheduler +#options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +#options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +#options AUDIT # Security event auditing +#options CAPABILITY_MODE # Capsicum capability mode +#options CAPABILITIES # Capsicum capabilities +#options MAC # TrustedBSD MAC Framework +#options INCLUDE_CONFIG_FILE # Include this file in kernel + +# required for netbooting +options BOOTP +options BOOTP_COMPAT +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 + +# alternatively, boot from a MMC/SD memory card +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: +options DDB # Support DDB. +options GDB # Support remote GDB. +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet friver + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device pcf8563 # NXP PCF8563 clock/calendar + +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +options AT91_MCI_HAS_4WIRE +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D +device geom_map # GEOM partition mapping + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module + +# SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +device ctl # CAM Target Layer + +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + +# USB support +options USB_DEBUG # enable debug msgs +device ohci # OHCI PCI->USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da + +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer + +device at91_rtc +device at91_ssc +#device at91_tc # missing? From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 08:10: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 97E0D106566B; Sun, 1 Jul 2012 08:10:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8377F8FC0A; Sun, 1 Jul 2012 08:10: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 q618Anpd076191; Sun, 1 Jul 2012 08:10:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q618AniJ076189; Sun, 1 Jul 2012 08:10:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207010810.q618AniJ076189@svn.freebsd.org> From: Xin LI Date: Sun, 1 Jul 2012 08:10: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: r237901 - head/sys/amd64/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: Sun, 01 Jul 2012 08:10:49 -0000 Author: delphij Date: Sun Jul 1 08:10:49 2012 New Revision: 237901 URL: http://svn.freebsd.org/changeset/base/237901 Log: tws(4) is interfaced with CAM so move it to the same section. Reported by: joel MFC after: 3 days Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jul 1 08:09:05 2012 (r237900) +++ head/sys/amd64/conf/GENERIC Sun Jul 1 08:10:49 2012 (r237901) @@ -152,6 +152,7 @@ device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID device twa # 3ware 9000 series PATA/SATA RAID +device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers device aac # Adaptec FSA RAID @@ -162,7 +163,6 @@ device mlx # Mylex DAC960 family #XXX pointer/int warnings #device pst # Promise Supertrak SX6000 device twe # 3ware ATA RAID -device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # atkbdc0 controls both the keyboard and the PS/2 mouse device atkbdc # AT keyboard controller From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 10:05:36 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 229ED106566C; Sun, 1 Jul 2012 10:05:36 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from emx.nitro.dk (emx.nitro.dk [IPv6:2a01:4f8:120:7384::102]) by mx1.freebsd.org (Postfix) with ESMTP id A6E3C8FC08; Sun, 1 Jul 2012 10:05:35 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id 8306B200FC5; Sun, 1 Jul 2012 10:05:34 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id we8oOqPAtzT4; Sun, 1 Jul 2012 10:05:32 +0000 (UTC) Received: from [192.168.4.32] (unknown [89.100.2.68]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id C7891200FC3; Sun, 1 Jul 2012 10:05:31 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: "Simon L. B. Nielsen" In-Reply-To: <201207010036.q610a7wc050629@svn.freebsd.org> Date: Sun, 1 Jul 2012 11:05:32 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <6AB69681-E87A-493C-AE2C-5B4A9218D455@FreeBSD.org> References: <201207010036.q610a7wc050629@svn.freebsd.org> To: Pedro F. Giffuni 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: r237860 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 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, 01 Jul 2012 10:05:36 -0000 On 1 Jul 2012, at 01:36, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Jul 1 00:36:07 2012 > New Revision: 237860 > URL: http://svn.freebsd.org/changeset/base/237860 >=20 > Log: > Import the dtrace llquantize test files from the vendor area. >=20 > Now that we have an illumos vendor area, import the llquantize > test files directly from there to make it easier to track the > code provenance. >=20 > Special thanks to Martin Matuska for populating the illumos > vendor area. >=20 > Requested by: obrien >=20 > Replaced: > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/ > - copied from r237859, = vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/ Don't replace files, and even worse directories, and it breaks svn2cvs. --=20 Simon L. B. Nielsen From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 11:36:36 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 50228106566B; Sun, 1 Jul 2012 11:36:36 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 985D08FC08; Sun, 1 Jul 2012 11:36:35 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q61BN2lH048995; Sun, 1 Jul 2012 13:23:03 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4FF03316.5050609@FreeBSD.org> Date: Sun, 01 Jul 2012 13:23:02 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> In-Reply-To: <201206210926.q5L9Q6nR002030@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 11:36:36 -0000 On 21.06.12 11:26, Konstantin Belousov wrote: > Author: kib > Date: Thu Jun 21 09:26:06 2012 > New Revision: 237367 > URL: http://svn.freebsd.org/changeset/base/237367 > > Log: > Enable deadlock avoidance code for NFS client. Hm, since this commit I fail with my nfs installworld/kernel. I have a builder which installs world/kernel to a nfs mounted directory. Namely used for cross builds. Now since this commit I get the following when I install kernel to the nfs directory: .. install -o root -g wheel -m 555 zfs.ko.symbols /netboot/sparc64/boot/kernel install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or directory *** [_kmodinstall] Error code 71 .. The file is there, a local install of the tree works without problems. Reverting to r237366 also makes it work again. The server is a -CURRENT, r237880, The client, -CURRENT too. How can I help to track down the real issue? TIA, Andreas From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 11:47: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 AF001106566C for ; Sun, 1 Jul 2012 11:47:03 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm20-vm0.bullet.mail.sp2.yahoo.com (nm20-vm0.bullet.mail.sp2.yahoo.com [98.139.91.218]) by mx1.freebsd.org (Postfix) with SMTP id 68CF58FC12 for ; Sun, 1 Jul 2012 11:47:03 +0000 (UTC) Received: from [98.139.91.69] by nm20.bullet.mail.sp2.yahoo.com with NNFMP; 01 Jul 2012 11:44:14 -0000 Received: from [98.139.91.28] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 01 Jul 2012 11:44:14 -0000 Received: from [127.0.0.1] by omp1028.mail.sp2.yahoo.com with NNFMP; 01 Jul 2012 11:44:14 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 84844.15886.bm@omp1028.mail.sp2.yahoo.com Received: (qmail 16778 invoked by uid 60001); 1 Jul 2012 11:44:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1341143053; bh=GYCdA8cZHYhFYq1XETXBK92L8mqPZQb9+ZdOB76IBMk=; 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=zi7DJXMTAg6p7avEF0m7usco5onR5iK36sCIx6NNesdVUUtZoV2OQeevdGSvt5X6PVSIAMibIPaggIG8ocATeJhWPNdO0zlQ6+E3Q4YGxXUmc7ZjLkFSUonCKbYdGgct60SYtn6q4V1ePL9DUV+G0YoVimRTGS07CkZWWOrGqEM= X-YMail-OSG: xiq0aHwVM1krAHMVBs8zmDAqiMZomQpkGNIJuBtTfDkiVUU 7VfoYOiofGYpgZ946rMnGDfi8AzHEYGthQNj4inIhC1Rb9aYklCh.9BHoNea fUlIPhDp3F9u_gebVZzUuhjBBgOghXq4HFfFrv_bBbwU8R4_GKeyWpUW6HLt XwKiaW3u1JqOU_utekDXFRnp.nxCxrPph86R2fNxrT2BM7uLoBdQEUAN_upZ ElOn7JpIELdNFAgTeATDFLZjc8IINIerzMeyfv0zkvLECi89XsxTNXN2EYQm hqUS4D.B4jih7xYUNqe4R1rth2xOK0XYzzcQzIA6ttPdQKDMle7513XDUxq9 3Ltrx4Erj4r1ZfFiSFX.4Xn25hwOPg0HxAatdnf7rUyROMfsrEg8u2SiKoDP RYVNmjS.EaE.bVAOVW4TS0YdAdls90ZcSDFHn_6tmzXx.dt9rH4IMXbKTbZu hpjIg Received: from [200.118.157.7] by web113519.mail.gq1.yahoo.com via HTTP; Sun, 01 Jul 2012 04:44:13 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1341143053.16744.YahooMailClassic@web113519.mail.gq1.yahoo.com> Date: Sun, 1 Jul 2012 04:44:13 -0700 (PDT) From: Pedro Giffuni To: "Simon L. B. Nielsen" In-Reply-To: <6AB69681-E87A-493C-AE2C-5B4A9218D455@FreeBSD.org> 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: r237860 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 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: Sun, 01 Jul 2012 11:47:03 -0000 --- Dom 1/7/12, Simon L. B. Nielsen ha scritto: ... > Data: Domenica 1 luglio 2012, 05:05 >=20 > On 1 Jul 2012, at 01:36, Pedro F. Giffuni wrote: >=20 > > Author: pfg > > Date: Sun Jul=A0 1 00:36:07 2012 > > New Revision: 237860 > > URL: http://svn.freebsd.org/changeset/base/237860 > >=20 > > Log: > >=A0 Import the dtrace llquantize test files from the vendor area. > >=20 > >=A0 Now that we have an illumos vendor area, import the llquantize > >=A0 test files directly from there to make it easier to track the > >=A0 code provenance. > >=20 > >=A0 Special thanks to Martin Matuska for populating the illumos > >=A0 vendor area. > >=20 > >=A0 Requested by:=A0=A0=A0 obrien > >=20 > > Replaced: > >=A0 > head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/ > >=A0 =A0=A0=A0- copied from r237859, > vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/ >=20 >=20 > Don't replace files, and even worse directories, and it > breaks svn2cvs. >=20 > --=20 Sorry, I though SVN would do the same I did: first remove, then copy. I guess I should do it in two commits next time. Thanks for fixing! Pedro. Ps. I didnt see this mentioned in our svn primer From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 12:04:22 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 57AE41065675; Sun, 1 Jul 2012 12:04:22 +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 BF3498FC16; Sun, 1 Jul 2012 12:04:21 +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 q61C4Kxk054412; Sun, 1 Jul 2012 15:04:20 +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 q61C48Jj041208; Sun, 1 Jul 2012 15:04: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 q61C48aH041207; Sun, 1 Jul 2012 15:04: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: Sun, 1 Jul 2012 15:04:08 +0300 From: Konstantin Belousov To: Andreas Tobler Message-ID: <20120701120408.GM2337@deviant.kiev.zoral.com.ua> References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bsvZi3KOaWj8kGde" Content-Disposition: inline In-Reply-To: <4FF03316.5050609@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: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 12:04:22 -0000 --bsvZi3KOaWj8kGde Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: > On 21.06.12 11:26, Konstantin Belousov wrote: > >Author: kib > >Date: Thu Jun 21 09:26:06 2012 > >New Revision: 237367 > >URL: http://svn.freebsd.org/changeset/base/237367 > > > >Log: > > Enable deadlock avoidance code for NFS client. >=20 >=20 > Hm, since this commit I fail with my nfs installworld/kernel. >=20 > I have a builder which installs world/kernel to a nfs mounted directory. > Namely used for cross builds. >=20 > Now since this commit I get the following when I install kernel to the=20 > nfs directory: >=20 > .. > install -o root -g wheel -m 555 zfs.ko.symbols=20 > /netboot/sparc64/boot/kernel > install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or=20 > directory > *** [_kmodinstall] Error code 71 > .. >=20 > The file is there, a local install of the tree works without problems. > Reverting to r237366 also makes it work again. >=20 > The server is a -CURRENT, r237880, The client, -CURRENT too. >=20 > How can I help to track down the real issue? Is it always the same file in the install procedure which causes the failure ? Even more, is the failure pattern always the same ? Might be, start with ktrace-ing the whole make invocation, including the children processes. I used buildworld on the NFS-mounted obj/ as the test for the changes. --bsvZi3KOaWj8kGde Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/wPLcACgkQC3+MBN1Mb4gGFQCeOzAaEwPpwmV8/W60rXd4QWwr eDAAnR9Rui/9/eFOs9vxAPAAZwAaQAbi =0hgv -----END PGP SIGNATURE----- --bsvZi3KOaWj8kGde-- From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 12:34: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 9A2A31065670; Sun, 1 Jul 2012 12:34:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85B458FC0A; Sun, 1 Jul 2012 12:34: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 q61CYKaN001966; Sun, 1 Jul 2012 12:34:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61CYK6T001964; Sun, 1 Jul 2012 12:34:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207011234.q61CYK6T001964@svn.freebsd.org> From: Christian Brueffer Date: Sun, 1 Jul 2012 12:34: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: r237921 - head/etc 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, 01 Jul 2012 12:34:21 -0000 Author: brueffer Date: Sun Jul 1 12:34:19 2012 New Revision: 237921 URL: http://svn.freebsd.org/changeset/base/237921 Log: Similar to all.log, mention that /var/log/console.log has to be created and chmod'ed to make logging work. PR: 168889 Submitted by: Robert Simmons MFC after: 1 week Modified: head/etc/syslog.conf Modified: head/etc/syslog.conf ============================================================================== --- head/etc/syslog.conf Sun Jul 1 12:00:36 2012 (r237920) +++ head/etc/syslog.conf Sun Jul 1 12:34:19 2012 (r237921) @@ -16,6 +16,7 @@ cron.* /var/log/cron *.=debug /var/log/debug.log *.emerg * # uncomment this to log all writes to /dev/console to /var/log/console.log +# touch /var/log/console.log and chmod it to mode 600 before it will work #console.info /var/log/console.log # uncomment this to enable logging of all log messages to /var/log/all.log # touch /var/log/all.log and chmod it to mode 600 before it will work From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 12:59:01 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 08988106566C; Sun, 1 Jul 2012 12:59:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E87C98FC0A; Sun, 1 Jul 2012 12:59: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 q61Cx0sZ003287; Sun, 1 Jul 2012 12:59:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61Cx0LR003284; Sun, 1 Jul 2012 12:59:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207011259.q61Cx0LR003284@svn.freebsd.org> From: Christian Brueffer Date: Sun, 1 Jul 2012 12:59: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: r237924 - head/sys/i386/i386 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, 01 Jul 2012 12:59:01 -0000 Author: brueffer Date: Sun Jul 1 12:59:00 2012 New Revision: 237924 URL: http://svn.freebsd.org/changeset/base/237924 Log: Replace an unreachable panic() in vm86_getptr (been there for 13 years) with a KASSERT() behind the functions's only consumer. Suggested by: kib Reviewed by: kib CID: 4494 Found with: Coverity Prevent(tm) MFC after: 2 weeks Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/vm86.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Jul 1 12:48:56 2012 (r237923) +++ head/sys/i386/i386/machdep.c Sun Jul 1 12:59:00 2012 (r237924) @@ -2176,7 +2176,7 @@ basemem_setup(void) static void getmemsize(int first) { - int has_smap, off, physmap_idx, pa_indx, da_indx; + int has_smap, off, physmap_idx, pa_indx, da_indx, res; u_long physmem_tunable, memtest; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; @@ -2267,7 +2267,8 @@ getmemsize(int first) pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); vmc.npages = 0; smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + (1 << PAGE_SHIFT)); - vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); + res = vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); + KASSERT(res != 0, ("vm86_getptr() failed: address not found")); vmf.vmf_ebx = 0; do { Modified: head/sys/i386/i386/vm86.c ============================================================================== --- head/sys/i386/i386/vm86.c Sun Jul 1 12:48:56 2012 (r237923) +++ head/sys/i386/i386/vm86.c Sun Jul 1 12:59:00 2012 (r237924) @@ -650,7 +650,6 @@ vm86_getptr(vmc, kva, sel, off) return (1); } return (0); - panic("vm86_getptr: address not found"); } int From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 13:37:22 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 A96181065672; Sun, 1 Jul 2012 13:37:22 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 1C12C8FC18; Sun, 1 Jul 2012 13:37:21 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q61DbJLA061284; Sun, 1 Jul 2012 15:37:19 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4FF0528E.50002@FreeBSD.org> Date: Sun, 01 Jul 2012 15:37:18 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> In-Reply-To: <20120701120408.GM2337@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 13:37:22 -0000 On 01.07.12 14:04, Konstantin Belousov wrote: > On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: >> On 21.06.12 11:26, Konstantin Belousov wrote: >>> Author: kib >>> Date: Thu Jun 21 09:26:06 2012 >>> New Revision: 237367 >>> URL: http://svn.freebsd.org/changeset/base/237367 >>> >>> Log: >>> Enable deadlock avoidance code for NFS client. >> >> >> Hm, since this commit I fail with my nfs installworld/kernel. >> >> I have a builder which installs world/kernel to a nfs mounted directory. >> Namely used for cross builds. >> >> Now since this commit I get the following when I install kernel to the >> nfs directory: >> >> .. >> install -o root -g wheel -m 555 zfs.ko.symbols >> /netboot/sparc64/boot/kernel >> install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or >> directory >> *** [_kmodinstall] Error code 71 >> .. >> >> The file is there, a local install of the tree works without problems. >> Reverting to r237366 also makes it work again. >> >> The server is a -CURRENT, r237880, The client, -CURRENT too. >> >> How can I help to track down the real issue? > > Is it always the same file in the install procedure which causes the > failure ? Even more, is the failure pattern always the same ? I'd say so yes. When installing a kernel onto a nfs mounted fs then always (in my cases) the zfs.ko.symbols was the failing pattern. I tried ppc64 and sparc64 as target. With both it was the above file. When doing a installworld, it was, also in both cases, ppc64/sparc64, the cc1 in libexec which failed. > Might be, start with ktrace-ing the whole make invocation, including > the children processes. Some recipes how to start? > I used buildworld on the NFS-mounted obj/ as the test for the changes. Here the obj is local, only the src and the destination is on the nfs/netboot server. Thanks, Andreas From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 13:41:36 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 942A8106564A; Sun, 1 Jul 2012 13:41:36 +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 2D8E28FC08; Sun, 1 Jul 2012 13:41:35 +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 q61Dfj6O060358; Sun, 1 Jul 2012 16:41: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 q61DfWJq041741; Sun, 1 Jul 2012 16:41:32 +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 q61DfWS3041740; Sun, 1 Jul 2012 16:41:32 +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: Sun, 1 Jul 2012 16:41:32 +0300 From: Konstantin Belousov To: Andreas Tobler Message-ID: <20120701134132.GO2337@deviant.kiev.zoral.com.ua> References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+F7KmZy3b6vGqMLF" Content-Disposition: inline In-Reply-To: <4FF0528E.50002@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: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 13:41:36 -0000 --+F7KmZy3b6vGqMLF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: > On 01.07.12 14:04, Konstantin Belousov wrote: > >On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: > >>On 21.06.12 11:26, Konstantin Belousov wrote: > >>>Author: kib > >>>Date: Thu Jun 21 09:26:06 2012 > >>>New Revision: 237367 > >>>URL: http://svn.freebsd.org/changeset/base/237367 > >>> > >>>Log: > >>> Enable deadlock avoidance code for NFS client. > >> > >> > >>Hm, since this commit I fail with my nfs installworld/kernel. > >> > >>I have a builder which installs world/kernel to a nfs mounted directory. > >>Namely used for cross builds. > >> > >>Now since this commit I get the following when I install kernel to the > >>nfs directory: > >> > >>.. > >>install -o root -g wheel -m 555 zfs.ko.symbols > >>/netboot/sparc64/boot/kernel > >>install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or > >>directory > >>*** [_kmodinstall] Error code 71 > >>.. > >> > >>The file is there, a local install of the tree works without problems. > >>Reverting to r237366 also makes it work again. > >> > >>The server is a -CURRENT, r237880, The client, -CURRENT too. > >> > >>How can I help to track down the real issue? > > > >Is it always the same file in the install procedure which causes the > >failure ? Even more, is the failure pattern always the same ? >=20 > I'd say so yes. When installing a kernel onto a nfs mounted fs then=20 > always (in my cases) the zfs.ko.symbols was the failing pattern. > I tried ppc64 and sparc64 as target. With both it was the above file. >=20 > When doing a installworld, it was, also in both cases, ppc64/sparc64,=20 > the cc1 in libexec which failed. >=20 > >Might be, start with ktrace-ing the whole make invocation, including > >the children processes. >=20 > Some recipes how to start? ktrace -o -i make installkernel Then kdump and cut the lines around relevant failure. >=20 > >I used buildworld on the NFS-mounted obj/ as the test for the changes. >=20 > Here the obj is local, only the src and the destination is on the=20 > nfs/netboot server. I just finished build on NFS obj/ and did several rounds of installs for world and kernel into nfs-mounted destdir. It seems I cannot reproduce this locally. --+F7KmZy3b6vGqMLF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/wU4sACgkQC3+MBN1Mb4i3zQCeILWD4lZ8UAw/yY8F6dc/rQ7W 8c0AoMCRA+RZbRgLb1YC6RZGu+9ffq5L =Mt7W -----END PGP SIGNATURE----- --+F7KmZy3b6vGqMLF-- From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 13:56: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 B4D051065673; Sun, 1 Jul 2012 13:56:55 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 2990A8FC19; Sun, 1 Jul 2012 13:56:54 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q61Duq9D092064; Sun, 1 Jul 2012 15:56:53 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4FF05724.3050904@FreeBSD.org> Date: Sun, 01 Jul 2012 15:56:52 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> <20120701134132.GO2337@deviant.kiev.zoral.com.ua> In-Reply-To: <20120701134132.GO2337@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 13:56:55 -0000 On 01.07.12 15:41, Konstantin Belousov wrote: > On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: >> On 01.07.12 14:04, Konstantin Belousov wrote: >>> On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: >>>> On 21.06.12 11:26, Konstantin Belousov wrote: >>>>> Author: kib >>>>> Date: Thu Jun 21 09:26:06 2012 >>>>> New Revision: 237367 >>>>> URL: http://svn.freebsd.org/changeset/base/237367 >>>>> >>>>> Log: >>>>> Enable deadlock avoidance code for NFS client. >>>> >>>> >>>> Hm, since this commit I fail with my nfs installworld/kernel. >>>> >>>> I have a builder which installs world/kernel to a nfs mounted directory. >>>> Namely used for cross builds. >>>> >>>> Now since this commit I get the following when I install kernel to the >>>> nfs directory: >>>> >>>> .. >>>> install -o root -g wheel -m 555 zfs.ko.symbols >>>> /netboot/sparc64/boot/kernel >>>> install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or >>>> directory >>>> *** [_kmodinstall] Error code 71 >>>> .. >>>> >>>> The file is there, a local install of the tree works without problems. >>>> Reverting to r237366 also makes it work again. >>>> >>>> The server is a -CURRENT, r237880, The client, -CURRENT too. >>>> >>>> How can I help to track down the real issue? >>> >>> Is it always the same file in the install procedure which causes the >>> failure ? Even more, is the failure pattern always the same ? >> >> I'd say so yes. When installing a kernel onto a nfs mounted fs then >> always (in my cases) the zfs.ko.symbols was the failing pattern. >> I tried ppc64 and sparc64 as target. With both it was the above file. >> >> When doing a installworld, it was, also in both cases, ppc64/sparc64, >> the cc1 in libexec which failed. >> >>> Might be, start with ktrace-ing the whole make invocation, including >>> the children processes. >> >> Some recipes how to start? > ktrace -o -i make installkernel > Then kdump and cut the lines around relevant failure. ktrace -f, right? I placed the whole kdump here: http://people.freebsd.org/~andreast/dumped_installkernel.log It is not clear to me where the failure starts :) > >> >>> I used buildworld on the NFS-mounted obj/ as the test for the changes. >> >> Here the obj is local, only the src and the destination is on the >> nfs/netboot server. > > I just finished build on NFS obj/ and did several rounds of installs > for world and kernel into nfs-mounted destdir. It seems I cannot reproduce > this locally. Ok. I try with an nfs obj too. Thanks. Andreas From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 15:27: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 72BD7106564A; Sun, 1 Jul 2012 15:27:17 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4E1F48FC15; Sun, 1 Jul 2012 15:27:17 +0000 (UTC) Received: from [192.168.2.58] (wifi.xcllnt.net [70.36.220.6] (may be forged)) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q61FR5bI084048 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 1 Jul 2012 08:27:11 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201207010656.q616ufcY071880@svn.freebsd.org> Date: Sun, 1 Jul 2012 08:27:05 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201207010656.q616ufcY071880@svn.freebsd.org> To: Warner Losh 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: r237883 - in head/sys/arm: at91 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: Sun, 01 Jul 2012 15:27:17 -0000 On Jun 30, 2012, at 11:56 PM, Warner Losh wrote: > Author: imp > Date: Sun Jul 1 06:56:41 2012 > New Revision: 237883 > URL: http://svn.freebsd.org/changeset/base/237883 > > Log: > Create a pseudo-lint kernel for all at91 SoCs. This kernel will not > currently boot, but will serve as a good linting. make universe could > now be altered to skip building all the other at91 kernels... BTW: I've implemented the LINT kernel for ARM. It combines all SoCs. It does have a lot of duplicate definitions, but by not having the linker fail on that, you get a successful build of something we already understand does not boot. It's good coverage with a single kernel and can help to bring the "make universe" time down by only building LINT for ARM. I can port that to FreeBSD. Shall I make some patches for people to look at? -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 15:30:43 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 BCAF6106566B; Sun, 1 Jul 2012 15:30:43 +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 A73838FC12; Sun, 1 Jul 2012 15:30: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 q61FUhEr009689; Sun, 1 Jul 2012 15:30:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61FUhXS009687; Sun, 1 Jul 2012 15:30:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207011530.q61FUhXS009687@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 1 Jul 2012 15:30: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: r237929 - head/sys/geom/mirror 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, 01 Jul 2012 15:30:43 -0000 Author: glebius Date: Sun Jul 1 15:30:43 2012 New Revision: 237929 URL: http://svn.freebsd.org/changeset/base/237929 Log: In g_mirror_regular_request() upon successful delivery treat BIO_DELETE requests same way as BIO_WRITE removing them from queue. This fixes panic with BIO_DELETE operations on geom_mirror. Reviewed by: pjd Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Sun Jul 1 14:56:51 2012 (r237928) +++ head/sys/geom/mirror/g_mirror.c Sun Jul 1 15:30:43 2012 (r237929) @@ -891,7 +891,8 @@ g_mirror_regular_request(struct bio *bp) if (pbp->bio_children == pbp->bio_inbed) { G_MIRROR_LOGREQ(3, pbp, "Request delivered."); pbp->bio_completed = pbp->bio_length; - if (pbp->bio_cmd == BIO_WRITE) { + if (pbp->bio_cmd == BIO_WRITE || + pbp->bio_cmd == BIO_DELETE) { bioq_remove(&sc->sc_inflight, pbp); /* Release delayed sync requests if possible. */ g_mirror_sync_release(sc); From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 15:43:53 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 594961065674; Sun, 1 Jul 2012 15:43:53 +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 43BFD8FC0C; Sun, 1 Jul 2012 15:43: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 q61FhrGG010240; Sun, 1 Jul 2012 15:43:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61FhqSY010237; Sun, 1 Jul 2012 15:43:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207011543.q61FhqSY010237@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 1 Jul 2012 15:43: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: r237930 - head/sys/geom/mirror 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, 01 Jul 2012 15:43:53 -0000 Author: glebius Date: Sun Jul 1 15:43:52 2012 New Revision: 237930 URL: http://svn.freebsd.org/changeset/base/237930 Log: Make geom_mirror more friendly to SSDs. To properly support TRIM, we need to pass BIO_DELETE requests down to providers that support it. Also, we need to announce our support for BIO_DELETE to upper consumer. This requires: - In g_mirror_start() return true for "GEOM::candelete" request. - In g_mirror_init_disk() probe below provider for "GEOM::candelete" attribute, and mark disk with a flag if it does support BIO_DELETE. - In g_mirror_register_request() distribute BIO_DELETE requests only to those disks, that do support it. Note that we announce "GEOM::candelete" as true unconditionally of whether we have TRIM-capable media down below or not. This is made intentionally, because upper consumer (usually UFS) requests the attribite only once at mount time. And if user ever migrates his mirror from HDDs to SSDs, then he/she would get TRIM working without remounting filesystem. Reviewed by: pjd Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Sun Jul 1 15:30:43 2012 (r237929) +++ head/sys/geom/mirror/g_mirror.c Sun Jul 1 15:43:52 2012 (r237930) @@ -440,7 +440,7 @@ g_mirror_init_disk(struct g_mirror_softc struct g_mirror_metadata *md, int *errorp) { struct g_mirror_disk *disk; - int error; + int i, error; disk = malloc(sizeof(*disk), M_MIRROR, M_NOWAIT | M_ZERO); if (disk == NULL) { @@ -455,6 +455,11 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_state = G_MIRROR_DISK_STATE_NONE; disk->d_priority = md->md_priority; disk->d_flags = md->md_dflags; + error = g_getattr("GEOM::candelete", disk->d_consumer, &i); + if (error != 0) + goto fail; + if (i) + disk->d_flags |= G_MIRROR_DISK_FLAG_CANDELETE; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; disk->d_sync.ds_consumer = NULL; @@ -1085,7 +1090,9 @@ g_mirror_start(struct bio *bp) g_mirror_flush(sc, bp); return; case BIO_GETATTR: - if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + if (g_handleattr_int(bp, "GEOM::candelete", 1)) + return; + else if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { g_mirror_kernel_dump(bp); return; } @@ -1632,6 +1639,9 @@ g_mirror_register_request(struct bio *bp default: continue; } + if (bp->bio_cmd == BIO_DELETE && + (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) == 0) + continue; cbp = g_clone_bio(bp); if (cbp == NULL) { for (cbp = bioq_first(&queue); cbp != NULL; Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Sun Jul 1 15:30:43 2012 (r237929) +++ head/sys/geom/mirror/g_mirror.h Sun Jul 1 15:43:52 2012 (r237930) @@ -59,10 +59,12 @@ #define G_MIRROR_DISK_FLAG_INACTIVE 0x0000000000000008ULL #define G_MIRROR_DISK_FLAG_HARDCODED 0x0000000000000010ULL #define G_MIRROR_DISK_FLAG_BROKEN 0x0000000000000020ULL +#define G_MIRROR_DISK_FLAG_CANDELETE 0x0000000000000040ULL #define G_MIRROR_DISK_FLAG_MASK (G_MIRROR_DISK_FLAG_DIRTY | \ G_MIRROR_DISK_FLAG_SYNCHRONIZING | \ G_MIRROR_DISK_FLAG_FORCE_SYNC | \ - G_MIRROR_DISK_FLAG_INACTIVE) + G_MIRROR_DISK_FLAG_INACTIVE | \ + G_MIRROR_DISK_FLAG_CANDELETE) #define G_MIRROR_DEVICE_FLAG_NOAUTOSYNC 0x0000000000000001ULL #define G_MIRROR_DEVICE_FLAG_NOFAILSYNC 0x0000000000000002ULL From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 16:26: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 175AF106566B; Sun, 1 Jul 2012 16:26:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 027BB8FC18; Sun, 1 Jul 2012 16:26: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 q61GQ7RH011980; Sun, 1 Jul 2012 16:26:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61GQ7AQ011978; Sun, 1 Jul 2012 16:26:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207011626.q61GQ7AQ011978@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 1 Jul 2012 16:26: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: r237931 - head/sbin/hastd 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, 01 Jul 2012 16:26:08 -0000 Author: pjd Date: Sun Jul 1 16:26:07 2012 New Revision: 237931 URL: http://svn.freebsd.org/changeset/base/237931 Log: Check if there is cmsg at all. MFC after: 3 days Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Sun Jul 1 15:43:52 2012 (r237930) +++ head/sbin/hastd/proto_common.c Sun Jul 1 16:26:07 2012 (r237931) @@ -181,7 +181,7 @@ proto_descriptor_recv(int sock, int *fdp return (errno); cmsg = CMSG_FIRSTHDR(&msg); - if (cmsg->cmsg_level != SOL_SOCKET || + if (cmsg == NULL || cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) { return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 17:05:57 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 40F891065670; Sun, 1 Jul 2012 17:05:57 +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 B4AE18FC08; Sun, 1 Jul 2012 17:05:56 +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 q61H5u54073179; Sun, 1 Jul 2012 20:05:56 +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 q61H5hfw042574; Sun, 1 Jul 2012 20:05:43 +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 q61H5huU042573; Sun, 1 Jul 2012 20:05:43 +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: Sun, 1 Jul 2012 20:05:43 +0300 From: Konstantin Belousov To: Andreas Tobler Message-ID: <20120701170543.GP2337@deviant.kiev.zoral.com.ua> References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> <20120701134132.GO2337@deviant.kiev.zoral.com.ua> <4FF05724.3050904@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r53EL0ep1aWhd0Bx" Content-Disposition: inline In-Reply-To: <4FF05724.3050904@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: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 17:05:57 -0000 --r53EL0ep1aWhd0Bx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2012 at 03:56:52PM +0200, Andreas Tobler wrote: > On 01.07.12 15:41, Konstantin Belousov wrote: > >On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: > >>On 01.07.12 14:04, Konstantin Belousov wrote: > >>>On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: > >>>>On 21.06.12 11:26, Konstantin Belousov wrote: > >>>>>Author: kib > >>>>>Date: Thu Jun 21 09:26:06 2012 > >>>>>New Revision: 237367 > >>>>>URL: http://svn.freebsd.org/changeset/base/237367 > >>>>> > >>>>>Log: > >>>>> Enable deadlock avoidance code for NFS client. > >>>> > >>>> > >>>>Hm, since this commit I fail with my nfs installworld/kernel. > >>>> > >>>>I have a builder which installs world/kernel to a nfs mounted directo= ry. > >>>>Namely used for cross builds. > >>>> > >>>>Now since this commit I get the following when I install kernel to the > >>>>nfs directory: > >>>> > >>>>.. > >>>>install -o root -g wheel -m 555 zfs.ko.symbols > >>>>/netboot/sparc64/boot/kernel > >>>>install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or > >>>>directory > >>>>*** [_kmodinstall] Error code 71 > >>>>.. > >>>> > >>>>The file is there, a local install of the tree works without problems. > >>>>Reverting to r237366 also makes it work again. > >>>> > >>>>The server is a -CURRENT, r237880, The client, -CURRENT too. > >>>> > >>>>How can I help to track down the real issue? > >>> > >>>Is it always the same file in the install procedure which causes the > >>>failure ? Even more, is the failure pattern always the same ? > >> > >>I'd say so yes. When installing a kernel onto a nfs mounted fs then > >>always (in my cases) the zfs.ko.symbols was the failing pattern. > >>I tried ppc64 and sparc64 as target. With both it was the above file. > >> > >>When doing a installworld, it was, also in both cases, ppc64/sparc64, > >>the cc1 in libexec which failed. > >> > >>>Might be, start with ktrace-ing the whole make invocation, including > >>>the children processes. > >> > >>Some recipes how to start? > >ktrace -o -i make installkernel > >Then kdump and cut the lines around relevant failure. >=20 > ktrace -f, right? Right, but without -i it is useless. >=20 > I placed the whole kdump here: >=20 > http://people.freebsd.org/~andreast/dumped_installkernel.log >=20 > It is not clear to me where the failure starts :) Because logs do not contain tracepoints from the children. See above about -i. I asked about excerpt because I expect the proper log to have an order of magnitude bigger size. >=20 > > > >> > >>>I used buildworld on the NFS-mounted obj/ as the test for the changes. > >> > >>Here the obj is local, only the src and the destination is on the > >>nfs/netboot server. > > > >I just finished build on NFS obj/ and did several rounds of installs > >for world and kernel into nfs-mounted destdir. It seems I cannot reprodu= ce > >this locally. >=20 > Ok. I try with an nfs obj too. > Thanks. > Andreas >=20 --r53EL0ep1aWhd0Bx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/wg2cACgkQC3+MBN1Mb4j7SACggffoplTXGrmcYSo1Y4wRiJMe sYkAoKr8pgaFrS1Xbvln9dqt26lTdA+b =CMW7 -----END PGP SIGNATURE----- --r53EL0ep1aWhd0Bx-- From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 17:48:32 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 593C8106566C; Sun, 1 Jul 2012 17:48:32 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id EA8098FC15; Sun, 1 Jul 2012 17:48:30 +0000 (UTC) Received: by lbon10 with SMTP id n10so8263929lbo.13 for ; Sun, 01 Jul 2012 10:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=yqc8avKMOmQmqccdkJK2plBV3/2eK84u4tCMHIyBMp8=; b=X7kLXf+IvHYmY7mMV+s48O4lvPVhuJVAXVRMvaWiywO5uvcE+fv+mZdsWmkdVXQmbi VCiyXa0grG3e0CYdEkNTBnFZYaA6zE0XWLBdV1l1MyhmZ4Nd9AtcHQ5hvwFn1JXH1+nq /7EbnZSQLkF2mvdigMz2D/bEUdcIGCIAgYEwvWQVk8hWC/LosiN2N/HJtfuMSUhN/qSd 2K7OSC2yyFWJM01B+dNRE0dXLHsKYPeXVG2HJTvzctVqqBVuvIi6+ypxKQa+5WPQs+49 KfKhDJ09g2v/69x8iK8eD195FJ1R/hh1w4OY37o1y4uYrrJLTouWPm349ZaOQi5e2V5n SzcA== Received: by 10.152.109.166 with SMTP id ht6mr9860228lab.46.1341164908544; Sun, 01 Jul 2012 10:48:28 -0700 (PDT) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id fv16sm18571292lab.9.2012.07.01.10.48.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 01 Jul 2012 10:48:27 -0700 (PDT) From: Mikolaj Golub To: John Baldwin References: <201112292041.pBTKfGkj071711@svn.freebsd.org> <201204020848.04775.jhb@freebsd.org> X-Comment-To: John Baldwin Sender: Mikolaj Golub Date: Sun, 01 Jul 2012 20:48:23 +0300 In-Reply-To: <201204020848.04775.jhb@freebsd.org> (John Baldwin's message of "Mon, 2 Apr 2012 08:48:04 -0400") Message-ID: <86sjdbnziw.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@freebsd.org, Bjoern Zeeb , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228969 - 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, 01 Jul 2012 17:48:32 -0000 --=-=-= On Mon, 2 Apr 2012 08:48:04 -0400 John Baldwin wrote: JB> On Sunday, April 01, 2012 8:05:00 am Mikolaj Golub wrote: >> Hi, >> >> On 12/29/11, John Baldwin wrote: >> > Author: jhb >> > Date: Thu Dec 29 20:41:16 2011 >> > New Revision: 228969 >> > URL: http://svn.freebsd.org/changeset/base/228969 >> > >> > Log: >> > Defer the work of freeing IPv4 multicast options from a socket to an >> > asychronous task. This avoids tearing down multicast state including >> > sending IGMP leave messages and reprogramming MAC filters while holding >> > the per-protocol global pcbinfo lock that is used in the receive path of >> > packet processing. >> > >> > Reviewed by: rwatson >> > MFC after: 1 month >> > >> > Modified: >> > head/sys/netinet/in_mcast.c >> > head/sys/netinet/ip_var.h >> > >> > Modified: head/sys/netinet/in_mcast.c >> > ============================================================================== >> > --- head/sys/netinet/in_mcast.c Thu Dec 29 19:01:29 2011 (r228968) >> > +++ head/sys/netinet/in_mcast.c Thu Dec 29 20:41:16 2011 (r228969) >> > @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); >> > #include >> > #include >> > #include >> > +#include >> > #include >> > >> > #include >> > @@ -144,6 +145,8 @@ static void inm_purge(struct in_multi *) >> > static void inm_reap(struct in_multi *); >> > static struct ip_moptions * >> > inp_findmoptions(struct inpcb *); >> > +static void inp_freemoptions_internal(struct ip_moptions *); >> > +static void inp_gcmoptions(void *, int); >> > static int inp_get_source_filters(struct inpcb *, struct sockopt *); >> > static int inp_join_group(struct inpcb *, struct sockopt *); >> > static int inp_leave_group(struct inpcb *, struct sockopt *); >> > @@ -179,6 +182,10 @@ static SYSCTL_NODE(_net_inet_ip_mcast, O >> > CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip_mcast_filters, >> > "Per-interface stack-wide source filters"); >> > >> > +static STAILQ_HEAD(, ip_moptions) imo_gc_list = >> > + STAILQ_HEAD_INITIALIZER(imo_gc_list); >> > +static struct task imo_gc_task = TASK_INITIALIZER(0, inp_gcmoptions, NULL); >> > + >> > /* >> > * Inline function which wraps assertions for a valid ifp. >> > * The ifnet layer will set the ifma's ifp pointer to NULL if the ifp >> > @@ -1518,17 +1525,29 @@ inp_findmoptions(struct inpcb *inp) >> > } >> > >> > /* >> > - * Discard the IP multicast options (and source filters). >> > + * Discard the IP multicast options (and source filters). To minimize >> > + * the amount of work done while holding locks such as the INP's >> > + * pcbinfo lock (which is used in the receive path), the free >> > + * operation is performed asynchronously in a separate task. >> > * >> > * SMPng: NOTE: assumes INP write lock is held. >> > */ >> > void >> > inp_freemoptions(struct ip_moptions *imo) >> > { >> > - struct in_mfilter *imf; >> > - size_t idx, nmships; >> > >> > KASSERT(imo != NULL, ("%s: ip_moptions is NULL", __func__)); >> > + IN_MULTI_LOCK(); >> > + STAILQ_INSERT_TAIL(&imo_gc_list, imo, imo_link); >> > + IN_MULTI_UNLOCK(); >> > + taskqueue_enqueue(taskqueue_thread, &imo_gc_task); >> > +} >> > + >> > +static void >> > +inp_freemoptions_internal(struct ip_moptions *imo) >> > +{ >> > + struct in_mfilter *imf; >> > + size_t idx, nmships; >> > >> > nmships = imo->imo_num_memberships; >> > for (idx = 0; idx < nmships; ++idx) { >> > @@ -1546,6 +1565,22 @@ inp_freemoptions(struct ip_moptions *imo >> > free(imo, M_IPMOPTS); >> > } >> > >> > +static void >> > +inp_gcmoptions(void *context, int pending) >> > +{ >> > + struct ip_moptions *imo; >> > + >> > + IN_MULTI_LOCK(); >> > + while (!STAILQ_EMPTY(&imo_gc_list)) { >> > + imo = STAILQ_FIRST(&imo_gc_list); >> > + STAILQ_REMOVE_HEAD(&imo_gc_list, imo_link); >> > + IN_MULTI_UNLOCK(); >> > + inp_freemoptions_internal(imo); >> > + IN_MULTI_LOCK(); >> > + } >> > + IN_MULTI_UNLOCK(); >> > +} >> > + >> > /* >> > * Atomically get source filters on a socket for an IPv4 multicast group. >> > * Called with INP lock held; returns with lock released. >> > >> > Modified: head/sys/netinet/ip_var.h >> > ============================================================================== >> > --- head/sys/netinet/ip_var.h Thu Dec 29 19:01:29 2011 (r228968) >> > +++ head/sys/netinet/ip_var.h Thu Dec 29 20:41:16 2011 (r228969) >> > @@ -93,6 +93,7 @@ struct ip_moptions { >> > u_short imo_max_memberships; /* max memberships this socket */ >> > struct in_multi **imo_membership; /* group memberships */ >> > struct in_mfilter *imo_mfilters; /* source filters */ >> > + STAILQ_ENTRY(ip_moptions) imo_link; >> > }; >> > >> > struct ipstat { >> > >> >> I have been observing panics like below after recent upgrade on VIMAGE kernel: >> >> #0 doadump (textdump=-2022567936) at pcpu.h:244 >> #1 0x8051b739 in db_fncall (dummy1=1, dummy2=0, dummy3=-2127531040, >> dummy4=0x872b2920 "") >> at /home/golub/freebsd/base/head/sys/ddb/db_command.c:573 >> #2 0x8051bb31 in db_command (last_cmdp=0x8112eefc, cmd_table=0x0, dopager=1) >> at /home/golub/freebsd/base/head/sys/ddb/db_command.c:449 >> #3 0x8051bc8a in db_command_loop () at >> /home/golub/freebsd/base/head/sys/ddb/db_command.c:502 >> #4 0x8051dc7d in db_trap (type=12, code=0) >> at /home/golub/freebsd/base/head/sys/ddb/db_main.c:229 >> #5 0x80a82566 in kdb_trap (type=12, code=0, tf=0x872b2bbc) >> at /home/golub/freebsd/base/head/sys/kern/subr_kdb.c:629 >> #6 0x80ddd26f in trap_fatal (frame=0x872b2bbc, eva=24) >> at /home/golub/freebsd/base/head/sys/i386/i386/trap.c:1014 >> #7 0x80ddd347 in trap_pfault (frame=0x872b2bbc, usermode=0, eva=24) >> at /home/golub/freebsd/base/head/sys/i386/i386/trap.c:835 >> #8 0x80dde411 in trap (frame=0x872b2bbc) >> at /home/golub/freebsd/base/head/sys/i386/i386/trap.c:547 >> #9 0x80dc7c6c in calltrap () at >> /home/golub/freebsd/base/head/sys/i386/i386/exception.s:169 >> #10 0x80b6f1fd in igmp_change_state (inm=0x8ae70480) >> at /home/golub/freebsd/base/head/sys/netinet/igmp.c:2595 >> #11 0x80b76f68 in in_leavegroup_locked (inm=0x8ae70480, imf=0x8a655a00) >> at /home/golub/freebsd/base/head/sys/netinet/in_mcast.c:1239 >> #12 0x80b76fbd in in_leavegroup (inm=0x8ae70480, imf=0x8a655a00) >> at /home/golub/freebsd/base/head/sys/netinet/in_mcast.c:1184 >> #13 0x80b770b4 in inp_gcmoptions (context=0x0, pending=1) >> at /home/golub/freebsd/base/head/sys/netinet/in_mcast.c:1554 >> #14 0x80a8ff2b in taskqueue_run_locked (queue=0x87594880) >> at /home/golub/freebsd/base/head/sys/kern/subr_taskqueue.c:308 >> #15 0x80a90987 in taskqueue_thread_loop (arg=0x81186bcc) >> at /home/golub/freebsd/base/head/sys/kern/subr_taskqueue.c:497 >> #16 0x80a1b2d8 in fork_exit (callout=0x80a90920 >> , arg=0x81186bcc, >> frame=0x872b2d28) at /home/golub/freebsd/base/head/sys/kern/kern_fork.c:992 >> #17 0x80dc7d14 in fork_trampoline () >> at /home/golub/freebsd/base/head/sys/i386/i386/exception.s:276 >> (kgdb) fr 10 >> #10 0x80b6f1fd in igmp_change_state (inm=0x8ae70480) >> at /home/golub/freebsd/base/head/sys/netinet/igmp.c:2595 >> 2595 V_state_change_timers_running = 1; >> >> (kgdb) l >> 2590 ("%s: enqueue record = >> %d", __func__, >> 2591 retval)); >> 2592 >> 2593 inm->inm_state = IGMP_LEAVING_MEMBER; >> 2594 inm->inm_sctimer = 1; >> 2595 V_state_change_timers_running = 1; >> 2596 syncstates = 0; >> 2597 } >> 2598 break; >> 2599 } >> >> VNET context is not set at that point. >> >> The attached patch fixes the issue for me. Not sure about inm->inm_ifp >> != NULL assumption but I need interface to get vnet :-). JB> I will to defer to bz@ (cc'd) on how best to fix this. Another option would JB> be to save the current vnet in the 'ip_moptions' struct (would have to add a JB> new field) when queueing this imo to be free'd via the task. You could JB> then do the curvnet set/restore at a higher level without any locks held, etc. Hi, do you have any news here? I would really appreciate to have this fixed in any way, as currently to avoid the crash I always have to remember to apply the patch when compiling VIMAGE kernels. Here is another version of the patch. It fixes it in the way suggested above (storing vnet in ip_moptions). The thing that worries me though is the case when vnet is destroyed and we still have options that refer it in the queue. I expect panic in this case. BTW, isn't the same problem with stale pointer dereferencing possible when removing interface? -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=in_mcast.c.inp_gcmoptions.1.patch Index: sys/netinet/ip_var.h =================================================================== --- sys/netinet/ip_var.h (revision 237918) +++ sys/netinet/ip_var.h (working copy) @@ -93,6 +93,7 @@ struct ip_moptions { u_short imo_max_memberships; /* max memberships this socket */ struct in_multi **imo_membership; /* group memberships */ struct in_mfilter *imo_mfilters; /* source filters */ + struct vnet *imo_vnet; /* pointer to network stack instance */ STAILQ_ENTRY(ip_moptions) imo_link; }; Index: sys/netinet/in_mcast.c =================================================================== --- sys/netinet/in_mcast.c (revision 237918) +++ sys/netinet/in_mcast.c (working copy) @@ -1504,6 +1504,7 @@ inp_findmoptions(struct inpcb *inp) imo->imo_num_memberships = 0; imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; imo->imo_membership = immp; + imo->imo_vnet = NULL; /* Initialize per-group source filters. */ for (idx = 0; idx < IP_MIN_MEMBERSHIPS; idx++) @@ -1535,6 +1536,7 @@ inp_freemoptions(struct ip_moptions *imo) KASSERT(imo != NULL, ("%s: ip_moptions is NULL", __func__)); IN_MULTI_LOCK(); + imo->imo_vnet = curvnet; STAILQ_INSERT_TAIL(&imo_gc_list, imo, imo_link); IN_MULTI_UNLOCK(); taskqueue_enqueue(taskqueue_thread, &imo_gc_task); @@ -1572,7 +1574,9 @@ inp_gcmoptions(void *context, int pending) imo = STAILQ_FIRST(&imo_gc_list); STAILQ_REMOVE_HEAD(&imo_gc_list, imo_link); IN_MULTI_UNLOCK(); + CURVNET_SET(imo->imo_vnet); inp_freemoptions_internal(imo); + CURVNET_RESTORE(); IN_MULTI_LOCK(); } IN_MULTI_UNLOCK(); --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 18:33: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 94D19106566C; Sun, 1 Jul 2012 18:33:12 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 363328FC15; Sun, 1 Jul 2012 18:33:11 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q61IX9k9031474; Sun, 1 Jul 2012 20:33:10 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4FF097E5.8030909@FreeBSD.org> Date: Sun, 01 Jul 2012 20:33:09 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> <20120701134132.GO2337@deviant.kiev.zoral.com.ua> <4FF05724.3050904@FreeBSD.org> <20120701170543.GP2337@deviant.kiev.zoral.com.ua> In-Reply-To: <20120701170543.GP2337@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 18:33:12 -0000 On 01.07.12 19:05, Konstantin Belousov wrote: > On Sun, Jul 01, 2012 at 03:56:52PM +0200, Andreas Tobler wrote: >> On 01.07.12 15:41, Konstantin Belousov wrote: >>> On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: >>>> On 01.07.12 14:04, Konstantin Belousov wrote: >>>>> On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: >>>>>> On 21.06.12 11:26, Konstantin Belousov wrote: >>>>>>> Author: kib >>>>>>> Date: Thu Jun 21 09:26:06 2012 >>>>>>> New Revision: 237367 >>>>>>> URL: http://svn.freebsd.org/changeset/base/237367 >>>>>>> >>>>>>> Log: >>>>>>> Enable deadlock avoidance code for NFS client. >>>>>> >>>>>> >>>>>> Hm, since this commit I fail with my nfs installworld/kernel. >>>>>> >>>>>> I have a builder which installs world/kernel to a nfs mounted directory. >>>>>> Namely used for cross builds. >>>>>> >>>>>> Now since this commit I get the following when I install kernel to the >>>>>> nfs directory: >>>>>> >>>>>> .. >>>>>> install -o root -g wheel -m 555 zfs.ko.symbols >>>>>> /netboot/sparc64/boot/kernel >>>>>> install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or >>>>>> directory >>>>>> *** [_kmodinstall] Error code 71 >>>>>> .. >>>>>> >>>>>> The file is there, a local install of the tree works without problems. >>>>>> Reverting to r237366 also makes it work again. >>>>>> >>>>>> The server is a -CURRENT, r237880, The client, -CURRENT too. >>>>>> >>>>>> How can I help to track down the real issue? >>>>> >>>>> Is it always the same file in the install procedure which causes the >>>>> failure ? Even more, is the failure pattern always the same ? >>>> >>>> I'd say so yes. When installing a kernel onto a nfs mounted fs then >>>> always (in my cases) the zfs.ko.symbols was the failing pattern. >>>> I tried ppc64 and sparc64 as target. With both it was the above file. >>>> >>>> When doing a installworld, it was, also in both cases, ppc64/sparc64, >>>> the cc1 in libexec which failed. >>>> >>>>> Might be, start with ktrace-ing the whole make invocation, including >>>>> the children processes. >>>> >>>> Some recipes how to start? >>> ktrace -o -i make installkernel >>> Then kdump and cut the lines around relevant failure. >> >> ktrace -f, right? > Right, but without -i it is useless. Ah, yes, seems clear now after reading the man page. >> I placed the whole kdump here: >> >> http://people.freebsd.org/~andreast/dumped_installkernel.log >> >> It is not clear to me where the failure starts :) > Because logs do not contain tracepoints from the children. > See above about -i. > > I asked about excerpt because I expect the proper log to have an order > of magnitude bigger size. Ok. The dump is around 100MB, I hope I extracted as much as needed: http://people.freebsd.org/~andreast/dumped_installkernel-7.log >>>>> I used buildworld on the NFS-mounted obj/ as the test for the changes. >>>> >>>> Here the obj is local, only the src and the destination is on the >>>> nfs/netboot server. >>> >>> I just finished build on NFS obj/ and did several rounds of installs >>> for world and kernel into nfs-mounted destdir. It seems I cannot reproduce >>> this locally. >> >> Ok. I try with an nfs obj too. So, I was not able to reproduce the failure with an nfs mounted obj dir. But I was able to reproduce the failure with three different machines which all have the obj local and the destination mounted via nfs. Are you able to try with a local obj too? Thanks, Andreas From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 18:37: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 6EBC0106566B; Sun, 1 Jul 2012 18:37:05 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4E18FC12; Sun, 1 Jul 2012 18:37:04 +0000 (UTC) Received: by bkwj5 with SMTP id j5so2853469bkw.13 for ; Sun, 01 Jul 2012 11:37:03 -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:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=+CJlCiv2fXjXwofGIDEOggf7WLS5V65F5SQjRu8D2sI=; b=ymPdT5TjpVLb19li3O3z/r20RJjrfqlN2qfQNbNYNYZgvmMtz4AmSwgTa84HT+ioJq VJ7KMS6YGIZ7L8w8Xi1bjyqrk3U49AbH7lc/cp2UGIEm5mdwAyniPBXJnA/wVZVJHFmX 7tIIcjG/QKby49Zasp3XDg60waHPAqlSclrrChC9RQHOoqdg3lM/d149++0YxtaL6EG0 nXzmFtyQLjIKLAF2eAux9VG27Lmtmg2uGWa6ODmpo6gK7DqVvdhKQ+PW+TK6JQ2fScOl LH+ZvW0+WZ/qKcR9NPR8efHfOCrY27kE5quPi6pLinnqg3KpjA/n1y+q1QjPwvm2x1jL SgiA== Received: by 10.205.134.4 with SMTP id ia4mr5588081bkc.57.1341167823522; Sun, 01 Jul 2012 11:37:03 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.204.49.87 with HTTP; Sun, 1 Jul 2012 11:36:33 -0700 (PDT) In-Reply-To: References: <201206061651.q56GpXTk026294@svn.freebsd.org> From: Chris Rees Date: Sun, 1 Jul 2012 19:36:33 +0100 X-Google-Sender-Auth: Xk_B7gHhBlUgED0EYUJzMrF7ndo Message-ID: To: "David E. O'Brien" 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: r236688 - 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: Sun, 01 Jul 2012 18:37:05 -0000 On 6 June 2012 18:07, Chris Rees wrote: > On 6 June 2012 17:51, David E. O'Brien wrote: >> Author: obrien >> Date: Wed Jun 6 16:51:33 2012 >> New Revision: 236688 >> URL: http://svn.freebsd.org/changeset/base/236688 >> >> Log: >> Add to the description and spell check. >> >> Modified: >> head/share/man/man4/filemon.4 >> >> Modified: head/share/man/man4/filemon.4 >> ============================================================================== >> --- head/share/man/man4/filemon.4 Wed Jun 6 16:30:16 2012 (r236687) >> +++ head/share/man/man4/filemon.4 Wed Jun 6 16:51:33 2012 (r236688) >> @@ -10,7 +10,7 @@ >> .\" notice, this list of conditions and the following disclaimer in the >> .\" documentation and/or other materials provided with the distribution. >> .\" 3. All advertising materials mentioning features or use of this software >> -.\" must display the following acknowledgement: >> +.\" must display the following acknowledgment: >> .\" This product includes software developed by David E. O'Brien and >> .\" contributors. > > Aren't we phasing that clause out? Any chance of removing the Clause 3 from that license? http://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html I had a look around the tree and there are several mentions of this clause-- I'll see if I can get a list of other files with it in too. Chris From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 19:07: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 33D08106566B; Sun, 1 Jul 2012 19:07:46 +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 1F6828FC08; Sun, 1 Jul 2012 19:07: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 q61J7jgZ018883; Sun, 1 Jul 2012 19:07:45 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61J7jKX018881; Sun, 1 Jul 2012 19:07:45 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201207011907.q61J7jKX018881@svn.freebsd.org> From: Rui Paulo Date: Sun, 1 Jul 2012 19:07: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: r237936 - head/sys/powerpc/powermac 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, 01 Jul 2012 19:07:46 -0000 Author: rpaulo Date: Sun Jul 1 19:07:45 2012 New Revision: 237936 URL: http://svn.freebsd.org/changeset/base/237936 Log: Remove bogus __unused attribute from hrowpic_eoi(). Modified: head/sys/powerpc/powermac/hrowpic.c Modified: head/sys/powerpc/powermac/hrowpic.c ============================================================================== --- head/sys/powerpc/powermac/hrowpic.c Sun Jul 1 18:27:13 2012 (r237935) +++ head/sys/powerpc/powermac/hrowpic.c Sun Jul 1 19:07:45 2012 (r237936) @@ -245,7 +245,7 @@ hrowpic_enable(device_t dev, u_int irq, } static void -hrowpic_eoi(device_t dev __unused, u_int irq __unused) +hrowpic_eoi(device_t dev, u_int irq) { struct hrowpic_softc *sc; int bank; From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 19:40: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 41DA3106566B; Sun, 1 Jul 2012 19:40:52 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DF2D8FC08; Sun, 1 Jul 2012 19:40: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 q61JeqHD020264; Sun, 1 Jul 2012 19:40:52 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61Jep1S020262; Sun, 1 Jul 2012 19:40:51 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201207011940.q61Jep1S020262@svn.freebsd.org> From: Jens Schweikhardt Date: Sun, 1 Jul 2012 19:40: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: r237937 - head/share/man/man9 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, 01 Jul 2012 19:40:52 -0000 Author: schweikh Date: Sun Jul 1 19:40:51 2012 New Revision: 237937 URL: http://svn.freebsd.org/changeset/base/237937 Log: Correct a grammo. Modified: head/share/man/man9/cd.9 Modified: head/share/man/man9/cd.9 ============================================================================== --- head/share/man/man9/cd.9 Sun Jul 1 19:07:45 2012 (r237936) +++ head/share/man/man9/cd.9 Sun Jul 1 19:40:51 2012 (r237937) @@ -57,7 +57,7 @@ This can lead to drives requiring specia The following is a list of quirks that the driver recognize. .Bl -tag -width CD_Q_BCD_TRACKS .It Dv CD_Q_NO_TOUCH -This flag tell the driver not to probe the drive at attach time to see if +This flag tells the driver not to probe the drive at attach time to see if there is a disk in the drive and find out what size it is. This flag is currently unimplemented in the CAM .Nm From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 21:41:51 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 4B940106564A for ; Sun, 1 Jul 2012 21:41:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-gh0-f182.google.com (mail-gh0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id EEE138FC0C for ; Sun, 1 Jul 2012 21:41:50 +0000 (UTC) Received: by ghbz22 with SMTP id z22so4430186ghb.13 for ; Sun, 01 Jul 2012 14:41:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=cMIkLZVOxy9ZhXonrfPgDwHIUuh2Le6VrR2isPjJSyQ=; b=jla3EtV995ENVo621pbKPlzgkJyKsfhTXJPdTTwv90Dnr6MFimAafeM7Id/DnCrNEh JaTx9yL3DlERUnzNEqKZ7y/62UwxaXpGjQh4ZyrZ5FSpT2wzmkbFdJTzFQ9wN+x8Yy4I ubiiHim0npjoHQFh1LPYR1xGBEitNig9mOs3zqjeDxrGOmAlLNKc+n3PdCQUzhTRoxSn kMXmOvGj7w2PYBDsKVnGOH4liv6YJwdPBvx59pDSPP0yZdKfE7dbU3zCifajS9cDCyCx 3yEDoWrl373SZtQb4kW55r9WZEC0palmG4PNKlp2sJf5y0wX4PVMEbu5cujQBPpsTyct Owxw== Received: by 10.42.39.17 with SMTP id f17mr4909943ice.3.1341178910066; Sun, 01 Jul 2012 14:41:50 -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 ai6sm15826856igc.0.2012.07.01.14.41.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 01 Jul 2012 14:41:49 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sun, 1 Jul 2012 15:41:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <370956AA-D028-4C44-B808-3160F0193069@bsdimp.com> References: <201207010656.q616ufcY071880@svn.freebsd.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQkC5GWI88l/vwkE2mijxazKdGCQIXuRmt/XKiwNGhpnOD+RfCd7AX5pXpy+DN9xBS+zdy5U Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r237883 - in head/sys/arm: at91 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: Sun, 01 Jul 2012 21:41:51 -0000 On Jul 1, 2012, at 9:27 AM, Marcel Moolenaar wrote: >=20 > On Jun 30, 2012, at 11:56 PM, Warner Losh wrote: >=20 >> Author: imp >> Date: Sun Jul 1 06:56:41 2012 >> New Revision: 237883 >> URL: http://svn.freebsd.org/changeset/base/237883 >>=20 >> Log: >> Create a pseudo-lint kernel for all at91 SoCs. This kernel will not >> currently boot, but will serve as a good linting. make universe = could >> now be altered to skip building all the other at91 kernels... >=20 > BTW: I've implemented the LINT kernel for ARM. It combines all > SoCs. It does have a lot of duplicate definitions, but by not > having the linker fail on that, you get a successful build of > something we already understand does not boot. It's good coverage > with a single kernel and can help to bring the "make universe" > time down by only building LINT for ARM. I was thinking of adding NOUNIVERSE tags to the kernels that we didn't = want routinely built. I'd rather have a single ARM kernel that can be = built for testing purposes. Don't like the multiple defined error being = suppressed, but short of some uglyish macros, I can't think of a better = way. I've written those 'ugly' macros for my multi-board work, and plan = on re-using them for the multi-soc work I intend to do to replace the = current "selected too late" SoC support for Atmel. I was thinking we = could expand the current set of platform/MD calls (initarm, etc), wrap = them in some macros so they could all be compiled together. Not sure if = you did this or not... > I can port that to FreeBSD. Shall I make some patches for people > to look at? Sure. I'd love to see it. I'd be happy to preview any partial work if = you want early feedbac. Warner From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 21:43: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 6ECDB106564A; Sun, 1 Jul 2012 21:43:12 +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 C05178FC1A; Sun, 1 Jul 2012 21:43:11 +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 q61LhE4H090676; Mon, 2 Jul 2012 00:43:14 +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 q61Lh1f4057241; Mon, 2 Jul 2012 00:43:01 +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 q61Lh1Gl057240; Mon, 2 Jul 2012 00:43:01 +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, 2 Jul 2012 00:43:01 +0300 From: Konstantin Belousov To: Andreas Tobler Message-ID: <20120701214301.GQ2337@deviant.kiev.zoral.com.ua> References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> <20120701134132.GO2337@deviant.kiev.zoral.com.ua> <4FF05724.3050904@FreeBSD.org> <20120701170543.GP2337@deviant.kiev.zoral.com.ua> <4FF097E5.8030909@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pZGq8xo7gUAgOQb5" Content-Disposition: inline In-Reply-To: <4FF097E5.8030909@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: r237367 - head/sys/fs/nfsclient 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, 01 Jul 2012 21:43:12 -0000 --pZGq8xo7gUAgOQb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2012 at 08:33:09PM +0200, Andreas Tobler wrote: > On 01.07.12 19:05, Konstantin Belousov wrote: > >On Sun, Jul 01, 2012 at 03:56:52PM +0200, Andreas Tobler wrote: > >>On 01.07.12 15:41, Konstantin Belousov wrote: > >>>On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: > >>>>On 01.07.12 14:04, Konstantin Belousov wrote: > >>>>>On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: > >>>>>>On 21.06.12 11:26, Konstantin Belousov wrote: > >>>>>>>Author: kib > >>>>>>>Date: Thu Jun 21 09:26:06 2012 > >>>>>>>New Revision: 237367 > >>>>>>>URL: http://svn.freebsd.org/changeset/base/237367 > >>>>>>> > >>>>>>>Log: > >>>>>>> Enable deadlock avoidance code for NFS client. > >>>>>> > >>>>>> > >>>>>>Hm, since this commit I fail with my nfs installworld/kernel. > >>>>>> > >>>>>>I have a builder which installs world/kernel to a nfs mounted=20 > >>>>>>directory. > >>>>>>Namely used for cross builds. > >>>>>> > >>>>>>Now since this commit I get the following when I install kernel to = the > >>>>>>nfs directory: > >>>>>> > >>>>>>.. > >>>>>>install -o root -g wheel -m 555 zfs.ko.symbols > >>>>>>/netboot/sparc64/boot/kernel > >>>>>>install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file = or > >>>>>>directory > >>>>>>*** [_kmodinstall] Error code 71 > >>>>>>.. > >>>>>> > >>>>>>The file is there, a local install of the tree works without proble= ms. > >>>>>>Reverting to r237366 also makes it work again. > >>>>>> > >>>>>>The server is a -CURRENT, r237880, The client, -CURRENT too. > >>>>>> > >>>>>>How can I help to track down the real issue? > >>>>> > >>>>>Is it always the same file in the install procedure which causes the > >>>>>failure ? Even more, is the failure pattern always the same ? > >>>> > >>>>I'd say so yes. When installing a kernel onto a nfs mounted fs then > >>>>always (in my cases) the zfs.ko.symbols was the failing pattern. > >>>>I tried ppc64 and sparc64 as target. With both it was the above file. > >>>> > >>>>When doing a installworld, it was, also in both cases, ppc64/sparc64, > >>>>the cc1 in libexec which failed. > >>>> > >>>>>Might be, start with ktrace-ing the whole make invocation, including > >>>>>the children processes. > >>>> > >>>>Some recipes how to start? > >>>ktrace -o -i make installkernel > >>>Then kdump and cut the lines around relevant failure. > >> > >>ktrace -f, right? > >Right, but without -i it is useless. >=20 > Ah, yes, seems clear now after reading the man page. >=20 > >>I placed the whole kdump here: > >> > >>http://people.freebsd.org/~andreast/dumped_installkernel.log > >> > >>It is not clear to me where the failure starts :) > >Because logs do not contain tracepoints from the children. > >See above about -i. > > > >I asked about excerpt because I expect the proper log to have an order > >of magnitude bigger size. >=20 > Ok. The dump is around 100MB, I hope I extracted as much as needed: >=20 > http://people.freebsd.org/~andreast/dumped_installkernel-7.log >=20 > >>>>>I used buildworld on the NFS-mounted obj/ as the test for the change= s. > >>>> > >>>>Here the obj is local, only the src and the destination is on the > >>>>nfs/netboot server. > >>> > >>>I just finished build on NFS obj/ and did several rounds of installs > >>>for world and kernel into nfs-mounted destdir. It seems I cannot=20 > >>>reproduce > >>>this locally. > >> > >>Ok. I try with an nfs obj too. >=20 > So, I was not able to reproduce the failure with an nfs mounted obj dir. >=20 > But I was able to reproduce the failure with three different machines=20 > which all have the obj local and the destination mounted via nfs. >=20 > Are you able to try with a local obj too? Below are two patches. Please follow my instructions literally to get most of your bug report. First, please apply the usr.bin/xinstall patch only, and retry installkernel (no need to use ktrace). It should show the proper error, short write, with zero-sized result, instead of garbage ENOENT from errno. Next, please apply the sys/fs/nfsclient patch, which should fix the core cause. diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 71286e3..f7af6fb 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -897,7 +897,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp =3D VFSTONFS(vp->v_mount); daddr_t lbn; int bcount; - int bp_cached, n, on, error =3D 0; + int bp_cached, n, on, error =3D 0, error1; size_t orig_resid, local_resid; off_t orig_size, tmp_off; =20 @@ -1259,9 +1259,12 @@ again: if ((ioflag & IO_SYNC)) { if (ioflag & IO_INVAL) bp->b_flags |=3D B_NOCACHE; - error =3D bwrite(bp); - if (error) + error1 =3D bwrite(bp); + if (error1 !=3D 0) { + if (error =3D=3D 0) + error =3D error1; break; + } } else if ((n + on) =3D=3D biosize) { bp->b_flags |=3D B_ASYNC; (void) ncl_writebp(bp, 0, NULL); diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index a920f85..3eba4f7 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -671,11 +672,18 @@ copy(int from_fd, const char *from_name, int to_fd, c= onst char *to_name, if (size <=3D 8 * 1048576 && trymmap(from_fd) && (p =3D mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) !=3D (char *)MAP_FAILED) { - if ((nw =3D write(to_fd, p, size)) !=3D size) { + nw =3D write(to_fd, p, size); + if (nw !=3D size) { serrno =3D errno; (void)unlink(to_name); - errno =3D nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >=3D 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, (uintmax_t)size); + } else { + errno =3D serrno; + err(EX_OSERR, "%s", to_name); + } } done_copy =3D 1; } @@ -684,8 +692,15 @@ copy(int from_fd, const char *from_name, int to_fd, co= nst char *to_name, if ((nw =3D write(to_fd, buf, nr)) !=3D nr) { serrno =3D errno; (void)unlink(to_name); - errno =3D nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >=3D 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, + (uintmax_t)size); + } else { + errno =3D serrno; + err(EX_OSERR, "%s", to_name); + } } if (nr !=3D 0) { serrno =3D errno; --pZGq8xo7gUAgOQb5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/wxGUACgkQC3+MBN1Mb4jp9QCgu2hlRy+3BKQb2ADZnRCzpBPL CLYAoM7c4jnQNMKAzfkTeAtZXvWfAJbc =tF1M -----END PGP SIGNATURE----- --pZGq8xo7gUAgOQb5-- From owner-svn-src-head@FreeBSD.ORG Sun Jul 1 22:18: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 849991065670; Sun, 1 Jul 2012 22:18:21 +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 705D98FC08; Sun, 1 Jul 2012 22:18: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 q61MILRW026988; Sun, 1 Jul 2012 22:18:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q61MILbY026986; Sun, 1 Jul 2012 22:18:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207012218.q61MILbY026986@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jul 2012 22:18: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: r237939 - head/lib/libc/locale 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, 01 Jul 2012 22:18:21 -0000 Author: jilles Date: Sun Jul 1 22:18:20 2012 New Revision: 237939 URL: http://svn.freebsd.org/changeset/base/237939 Log: ctype_l(3): Note that not all these functions are specified by POSIX.1-2008. The function isascii_l() is not in POSIX even though isascii() is, probably because isascii() is marked as obsolete. The other functions, like digittoint_l() and ishexnumber_l(), are FreeBSD-specific just like their non-_l versions. Modified: head/lib/libc/locale/ctype_l.3 Modified: head/lib/libc/locale/ctype_l.3 ============================================================================== --- head/lib/libc/locale/ctype_l.3 Sun Jul 1 21:51:57 2012 (r237938) +++ head/lib/libc/locale/ctype_l.3 Sun Jul 1 22:18:20 2012 (r237939) @@ -135,4 +135,17 @@ See the specific manual pages for more i .Xr xlocale 3 .Sh STANDARDS These functions conform to -.St -p1003.1-2008 . +.St -p1003.1-2008 , +except for +.Fn digittoint_l , +.Fn isascii_l , +.Fn ishexnumber_l , +.Fn isideogram_l , +.Fn isnumber_l , +.Fn isphonogram_l , +.Fn isrune_l +and +.Fn isspecial_l +which are +.Fx +extensions. From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 02:38: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 DB1081065672; Mon, 2 Jul 2012 02:38: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 C5D598FC14; Mon, 2 Jul 2012 02:38: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 q622cR2R038054; Mon, 2 Jul 2012 02:38:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q622cR4q038051; Mon, 2 Jul 2012 02:38:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207020238.q622cR4q038051@svn.freebsd.org> From: Xin LI Date: Mon, 2 Jul 2012 02:38: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: r237942 - head/sbin/ping 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, 02 Jul 2012 02:38:28 -0000 Author: delphij Date: Mon Jul 2 02:38:27 2012 New Revision: 237942 URL: http://svn.freebsd.org/changeset/base/237942 Log: Use timeclear() instead of home grown version. MFC after: 2 weeks Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Mon Jul 2 02:36:05 2012 (r237941) +++ head/sbin/ping/ping.c Mon Jul 2 02:38:27 2012 (r237942) @@ -832,7 +832,7 @@ main(int argc, char *const *argv) timeout.tv_sec++; } if (timeout.tv_sec < 0) - timeout.tv_sec = timeout.tv_usec = 0; + timerclear(&timeout); n = select(s + 1, &rfds, NULL, NULL, &timeout); if (n < 0) continue; /* Must be EINTR. */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 03:32:42 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 8D914106566C; Mon, 2 Jul 2012 03:32:42 +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 D6E3514E6AC; Mon, 2 Jul 2012 03:32:41 +0000 (UTC) Message-ID: <4FF11659.8060405@FreeBSD.org> Date: Sun, 01 Jul 2012 20:32:41 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: pfg@freebsd.org References: <1340992732.19144.YahooMailClassic@web113501.mail.gq1.yahoo.com> In-Reply-To: <1340992732.19144.YahooMailClassic@web113501.mail.gq1.yahoo.com> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, George Neville-Neil , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, obrien@FreeBSD.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/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: Mon, 02 Jul 2012 03:32:42 -0000 On 06/29/2012 10:58, Pedro Giffuni wrote: > Now .. David pointed out I am not respecting the code > provenance since I didn't add them to the opensolaris > vendor area, but these files are copyrighted Joyent > Inc (not even Illumos) so I cannot put them there > unless we create a new vendor for Joyent Creating a new vendor area would be the right solution, yes. Doug -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 04:04:00 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 316B1106564A; Mon, 2 Jul 2012 04:04:00 +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 22BC414DAB0; Mon, 2 Jul 2012 04:03:59 +0000 (UTC) Message-ID: <4FF11DAE.6070404@FreeBSD.org> Date: Sun, 01 Jul 2012 21:03:58 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: "Simon L. B. Nielsen" References: <201207010036.q610a7wc050629@svn.freebsd.org> <6AB69681-E87A-493C-AE2C-5B4A9218D455@FreeBSD.org> In-Reply-To: <6AB69681-E87A-493C-AE2C-5B4A9218D455@FreeBSD.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org Subject: Re: svn commit: r237860 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 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, 02 Jul 2012 04:04:00 -0000 On 07/01/2012 03:05, Simon L. B. Nielsen wrote: > Don't replace files, and even worse directories, and it breaks svn2cvs. Isn't it possible to write a pre-commit hook to avoid this issue? -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 04:40: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 1D483106564A; Mon, 2 Jul 2012 04:40:31 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id B77D98FC08; Mon, 2 Jul 2012 04:40:30 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q624eRoF001818; Mon, 2 Jul 2012 06:40:28 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4FF1263B.20704@FreeBSD.org> Date: Mon, 02 Jul 2012 06:40:27 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> <20120701134132.GO2337@deviant.kiev.zoral.com.ua> <4FF05724.3050904@FreeBSD.org> <20120701170543.GP2337@deviant.kiev.zoral.com.ua> <4FF097E5.8030909@FreeBSD.org> <20120701214301.GQ2337@deviant.kiev.zoral.com.ua> In-Reply-To: <20120701214301.GQ2337@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237367 - head/sys/fs/nfsclient 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, 02 Jul 2012 04:40:31 -0000 On 01.07.12 23:43, Konstantin Belousov wrote: > On Sun, Jul 01, 2012 at 08:33:09PM +0200, Andreas Tobler wrote: >> On 01.07.12 19:05, Konstantin Belousov wrote: >>> On Sun, Jul 01, 2012 at 03:56:52PM +0200, Andreas Tobler wrote: >>>> On 01.07.12 15:41, Konstantin Belousov wrote: >>>>> On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: >>>>>> On 01.07.12 14:04, Konstantin Belousov wrote: >>>>>>> On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: >>>>>>>> On 21.06.12 11:26, Konstantin Belousov wrote: >>>>>>>>> Author: kib >>>>>>>>> Date: Thu Jun 21 09:26:06 2012 >>>>>>>>> New Revision: 237367 >>>>>>>>> URL: http://svn.freebsd.org/changeset/base/237367 >>>>>>>>> >>>>>>>>> Log: >>>>>>>>> Enable deadlock avoidance code for NFS client. >>>>>>>> >>>>>>>> >>>>>>>> Hm, since this commit I fail with my nfs installworld/kernel. >>>>>>>> >>>>>>>> I have a builder which installs world/kernel to a nfs mounted >>>>>>>> directory. >>>>>>>> Namely used for cross builds. >>>>>>>> >>>>>>>> Now since this commit I get the following when I install kernel to the >>>>>>>> nfs directory: >>>>>>>> >>>>>>>> .. >>>>>>>> install -o root -g wheel -m 555 zfs.ko.symbols >>>>>>>> /netboot/sparc64/boot/kernel >>>>>>>> install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or >>>>>>>> directory >>>>>>>> *** [_kmodinstall] Error code 71 >>>>>>>> .. >>>>>>>> >>>>>>>> The file is there, a local install of the tree works without problems. >>>>>>>> Reverting to r237366 also makes it work again. >>>>>>>> >>>>>>>> The server is a -CURRENT, r237880, The client, -CURRENT too. >>>>>>>> >>>>>>>> How can I help to track down the real issue? >>>>>>> >>>>>>> Is it always the same file in the install procedure which causes the >>>>>>> failure ? Even more, is the failure pattern always the same ? >>>>>> >>>>>> I'd say so yes. When installing a kernel onto a nfs mounted fs then >>>>>> always (in my cases) the zfs.ko.symbols was the failing pattern. >>>>>> I tried ppc64 and sparc64 as target. With both it was the above file. >>>>>> >>>>>> When doing a installworld, it was, also in both cases, ppc64/sparc64, >>>>>> the cc1 in libexec which failed. >>>>>> >>>>>>> Might be, start with ktrace-ing the whole make invocation, including >>>>>>> the children processes. >>>>>> >>>>>> Some recipes how to start? >>>>> ktrace -o -i make installkernel >>>>> Then kdump and cut the lines around relevant failure. >>>> >>>> ktrace -f, right? >>> Right, but without -i it is useless. >> >> Ah, yes, seems clear now after reading the man page. >> >>>> I placed the whole kdump here: >>>> >>>> http://people.freebsd.org/~andreast/dumped_installkernel.log >>>> >>>> It is not clear to me where the failure starts :) >>> Because logs do not contain tracepoints from the children. >>> See above about -i. >>> >>> I asked about excerpt because I expect the proper log to have an order >>> of magnitude bigger size. >> >> Ok. The dump is around 100MB, I hope I extracted as much as needed: >> >> http://people.freebsd.org/~andreast/dumped_installkernel-7.log >> >>>>>>> I used buildworld on the NFS-mounted obj/ as the test for the changes. >>>>>> >>>>>> Here the obj is local, only the src and the destination is on the >>>>>> nfs/netboot server. >>>>> >>>>> I just finished build on NFS obj/ and did several rounds of installs >>>>> for world and kernel into nfs-mounted destdir. It seems I cannot >>>>> reproduce >>>>> this locally. >>>> >>>> Ok. I try with an nfs obj too. >> >> So, I was not able to reproduce the failure with an nfs mounted obj dir. >> >> But I was able to reproduce the failure with three different machines >> which all have the obj local and the destination mounted via nfs. >> >> Are you able to try with a local obj too? > Below are two patches. Please follow my instructions literally to get > most of your bug report. > > First, please apply the usr.bin/xinstall patch only, and retry installkernel > (no need to use ktrace). It should show the proper error, short write, with > zero-sized result, instead of garbage ENOENT from errno. Done. No expected output. Iow, no message containing this: short write to %s: %jd bytes written, %jd bytes asked to write > Next, please apply the sys/fs/nfsclient patch, which should fix the core > cause. Still the same failure: ===> zfs (install) install -o root -g wheel -m 555 zfs.ko /netboot/powerpc64/boot/kernel install -o root -g wheel -m 555 zfs.ko.symbols /netboot/powerpc64/boot/kernel install: /netboot/powerpc64/boot/kernel/zfs.ko.symbols: No such file or directory *** [_kmodinstall] Error code 71 Does it matter what filesystem the local dir is on? Here the output from mount: /dev/ada0p4 on /export (ufs, NFS exported, local, journaled soft-updates) [root@tcx58] /usr/obj/> df -k . Filesystem 1024-blocks Used Avail Capacity Mounted on /dev/ada0p4 132098652 30672276 90858484 25% /export I'm off at work for the rest of the day. I'll try if I can reproduce the issue there as well. Thanks a lot! Andreas From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 05:26: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 D2FD9106564A; Mon, 2 Jul 2012 05:26:54 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 7CA2A8FC12; Mon, 2 Jul 2012 05:26:54 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q625QpNE080706; Mon, 2 Jul 2012 07:26:52 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4FF1311B.1090906@FreeBSD.org> Date: Mon, 02 Jul 2012 07:26:51 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201206210926.q5L9Q6nR002030@svn.freebsd.org> <4FF03316.5050609@FreeBSD.org> <20120701120408.GM2337@deviant.kiev.zoral.com.ua> <4FF0528E.50002@FreeBSD.org> <20120701134132.GO2337@deviant.kiev.zoral.com.ua> <4FF05724.3050904@FreeBSD.org> <20120701170543.GP2337@deviant.kiev.zoral.com.ua> <4FF097E5.8030909@FreeBSD.org> <20120701214301.GQ2337@deviant.kiev.zoral.com.ua> <4FF1263B.20704@FreeBSD.org> In-Reply-To: <4FF1263B.20704@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237367 - head/sys/fs/nfsclient 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, 02 Jul 2012 05:26:54 -0000 On 02.07.12 06:40, Andreas Tobler wrote: > On 01.07.12 23:43, Konstantin Belousov wrote: >> On Sun, Jul 01, 2012 at 08:33:09PM +0200, Andreas Tobler wrote: >>> On 01.07.12 19:05, Konstantin Belousov wrote: >>>> On Sun, Jul 01, 2012 at 03:56:52PM +0200, Andreas Tobler wrote: >>>>> On 01.07.12 15:41, Konstantin Belousov wrote: >>>>>> On Sun, Jul 01, 2012 at 03:37:18PM +0200, Andreas Tobler wrote: >>>>>>> On 01.07.12 14:04, Konstantin Belousov wrote: >>>>>>>> On Sun, Jul 01, 2012 at 01:23:02PM +0200, Andreas Tobler wrote: >>>>>>>>> On 21.06.12 11:26, Konstantin Belousov wrote: >>>>>>>>>> Author: kib >>>>>>>>>> Date: Thu Jun 21 09:26:06 2012 >>>>>>>>>> New Revision: 237367 >>>>>>>>>> URL: http://svn.freebsd.org/changeset/base/237367 >>>>>>>>>> >>>>>>>>>> Log: >>>>>>>>>> Enable deadlock avoidance code for NFS client. >>>>>>>>> >>>>>>>>> >>>>>>>>> Hm, since this commit I fail with my nfs installworld/kernel. >>>>>>>>> >>>>>>>>> I have a builder which installs world/kernel to a nfs mounted >>>>>>>>> directory. >>>>>>>>> Namely used for cross builds. >>>>>>>>> >>>>>>>>> Now since this commit I get the following when I install kernel to the >>>>>>>>> nfs directory: >>>>>>>>> >>>>>>>>> .. >>>>>>>>> install -o root -g wheel -m 555 zfs.ko.symbols >>>>>>>>> /netboot/sparc64/boot/kernel >>>>>>>>> install: /netboot/sparc64/boot/kernel/zfs.ko.symbols: No such file or >>>>>>>>> directory >>>>>>>>> *** [_kmodinstall] Error code 71 >>>>>>>>> .. >>>>>>>>> >>>>>>>>> The file is there, a local install of the tree works without problems. >>>>>>>>> Reverting to r237366 also makes it work again. >>>>>>>>> >>>>>>>>> The server is a -CURRENT, r237880, The client, -CURRENT too. >>>>>>>>> >>>>>>>>> How can I help to track down the real issue? >>>>>>>> >>>>>>>> Is it always the same file in the install procedure which causes the >>>>>>>> failure ? Even more, is the failure pattern always the same ? >>>>>>> >>>>>>> I'd say so yes. When installing a kernel onto a nfs mounted fs then >>>>>>> always (in my cases) the zfs.ko.symbols was the failing pattern. >>>>>>> I tried ppc64 and sparc64 as target. With both it was the above file. >>>>>>> >>>>>>> When doing a installworld, it was, also in both cases, ppc64/sparc64, >>>>>>> the cc1 in libexec which failed. >>>>>>> >>>>>>>> Might be, start with ktrace-ing the whole make invocation, including >>>>>>>> the children processes. >>>>>>> >>>>>>> Some recipes how to start? >>>>>> ktrace -o -i make installkernel >>>>>> Then kdump and cut the lines around relevant failure. >>>>> >>>>> ktrace -f, right? >>>> Right, but without -i it is useless. >>> >>> Ah, yes, seems clear now after reading the man page. >>> >>>>> I placed the whole kdump here: >>>>> >>>>> http://people.freebsd.org/~andreast/dumped_installkernel.log >>>>> >>>>> It is not clear to me where the failure starts :) >>>> Because logs do not contain tracepoints from the children. >>>> See above about -i. >>>> >>>> I asked about excerpt because I expect the proper log to have an order >>>> of magnitude bigger size. >>> >>> Ok. The dump is around 100MB, I hope I extracted as much as needed: >>> >>> http://people.freebsd.org/~andreast/dumped_installkernel-7.log >>> >>>>>>>> I used buildworld on the NFS-mounted obj/ as the test for the changes. >>>>>>> >>>>>>> Here the obj is local, only the src and the destination is on the >>>>>>> nfs/netboot server. >>>>>> >>>>>> I just finished build on NFS obj/ and did several rounds of installs >>>>>> for world and kernel into nfs-mounted destdir. It seems I cannot >>>>>> reproduce >>>>>> this locally. >>>>> >>>>> Ok. I try with an nfs obj too. >>> >>> So, I was not able to reproduce the failure with an nfs mounted obj dir. >>> >>> But I was able to reproduce the failure with three different machines >>> which all have the obj local and the destination mounted via nfs. >>> >>> Are you able to try with a local obj too? >> Below are two patches. Please follow my instructions literally to get >> most of your bug report. >> >> First, please apply the usr.bin/xinstall patch only, and retry installkernel >> (no need to use ktrace). It should show the proper error, short write, with >> zero-sized result, instead of garbage ENOENT from errno. > > Done. No expected output. Iow, no message containing this: > > short write to %s: %jd bytes written, %jd bytes asked to write Sorry for the confusion, I learned that I have to patch install from the buildworld and not only the host one: ===> zfs (install) install -o root -g wheel -m 555 zfs.ko /netboot/powerpc64/boot/kernel install -o root -g wheel -m 555 zfs.ko.symbols /netboot/powerpc64/boot/kernel install: short write to /netboot/powerpc64/boot/kernel/zfs.ko.symbols: 0 bytes written, 6959816 bytes asked to write *** [_kmodinstall] Error code 71 >> Next, please apply the sys/fs/nfsclient patch, which should fix the core >> cause. And it really helps if I install the fresh built kernel to the right place :( ===> zfs (install) install -o root -g wheel -m 555 zfs.ko /netboot/powerpc64/boot/kernel install -o root -g wheel -m 555 zfs.ko.symbols /netboot/powerpc64/boot/kernel ===> zlib (install) install -o root -g wheel -m 555 zlib.ko /netboot/powerpc64/boot/kernel install -o root -g wheel -m 555 zlib.ko.symbols /netboot/powerpc64/boot/kernel kldxref /netboot/powerpc64/boot/kernel Thank you very much for the patience and the solution! Andreas From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 06:02: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 70BAF106566B; Mon, 2 Jul 2012 06:02:13 +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 5C33D8FC12; Mon, 2 Jul 2012 06:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6262DmW048067; Mon, 2 Jul 2012 06:02:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6262Du9048064; Mon, 2 Jul 2012 06:02:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207020602.q6262Du9048064@svn.freebsd.org> From: Adrian Chadd Date: Mon, 2 Jul 2012 06:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237953 - in head/sys/dev/ath: . ath_hal 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, 02 Jul 2012 06:02:13 -0000 Author: adrian Date: Mon Jul 2 06:02:12 2012 New Revision: 237953 URL: http://svn.freebsd.org/changeset/base/237953 Log: Bring over some further HAL capabilities from the Atheros HAL, as well as an EDMA check function. For the AR9003 and later NICs, different TX/RX DMA and descriptor handling code will be conditional on the EDMA check. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 05:57:44 2012 (r237952) +++ head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:02:12 2012 (r237953) @@ -110,7 +110,7 @@ typedef enum { HAL_CAP_TPC_ACK = 26, /* ack txpower with per-packet tpc */ HAL_CAP_TPC_CTS = 27, /* cts txpower with per-packet tpc */ HAL_CAP_11D = 28, /* 11d beacon support for changing cc */ - + HAL_CAP_PCIE_PS = 29, HAL_CAP_HT = 30, /* hardware can support HT */ HAL_CAP_GTXTO = 31, /* hardware supports global tx timeout */ HAL_CAP_FAST_CC = 32, /* hardware supports fast channel change */ @@ -120,6 +120,9 @@ typedef enum { HAL_CAP_CST = 38, /* hardware supports carrier sense timeout */ + HAL_CAP_RIFS_RX = 39, + HAL_CAP_RIFS_TX = 40, + HAL_CAP_FORCE_PPM = 41, HAL_CAP_RTS_AGGR_LIMIT = 42, /* aggregation limit with RTS */ HAL_CAP_4ADDR_AGGR = 43, /* hardware is capable of 4addr aggregation */ HAL_CAP_DFS_DMN = 44, /* current DFS domain */ @@ -131,8 +134,27 @@ typedef enum { HAL_CAP_MBSSID_AGGR_SUPPORT = 49, /* Support for mBSSID Aggregation */ HAL_CAP_SPLIT_4KB_TRANS = 50, /* hardware supports descriptors straddling a 4k page boundary */ HAL_CAP_REG_FLAG = 51, /* Regulatory domain flags */ + HAL_CAP_BB_RIFS_HANG = 52, + HAL_CAP_RIFS_RX_ENABLED = 53, + HAL_CAP_BB_DFS_HANG = 54, HAL_CAP_BT_COEX = 60, /* hardware is capable of bluetooth coexistence */ + HAL_CAP_DYNAMIC_SMPS = 61, /* Dynamic MIMO Power Save hardware support */ + + HAL_CAP_DS = 67, /* 2 stream */ + HAL_CAP_BB_RX_CLEAR_STUCK_HANG = 68, + HAL_CAP_MAC_HANG = 69, /* can MAC hang */ + HAL_CAP_MFP = 70, /* Manangement Frame Protection in hardware */ + + HAL_CAP_TS = 72, /* 3 stream */ + + HAL_CAP_ENHANCED_DMA_SUPPORT = 75, /* DMA FIFO support */ + + HAL_CAP_RX_BUFSIZE = 81, + HAL_CAP_NUM_MR_ENTRIES = 82, + HAL_CAP_OL_PWRCTRL = 84, /* Open loop TX power control */ + + HAL_CAP_BB_PANIC_WATCHDOG = 92, HAL_CAP_HT20_SGI = 96, /* hardware supports HT20 short GI */ @@ -144,7 +166,6 @@ typedef enum { HAL_CAP_INTMIT = 229, /* interference mitigation */ HAL_CAP_RXORN_FATAL = 230, /* HAL_INT_RXORN treated as fatal */ HAL_CAP_BB_HANG = 235, /* can baseband hang */ - HAL_CAP_MAC_HANG = 236, /* can MAC hang */ HAL_CAP_INTRMASK = 237, /* bitmask of supported interrupts */ HAL_CAP_BSSIDMATCH = 238, /* hardware has disable bssid match */ HAL_CAP_STREAMS = 239, /* how many 802.11n spatial streams are available */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 2 05:57:44 2012 (r237952) +++ head/sys/dev/ath/if_athvar.h Mon Jul 2 06:02:12 2012 (r237953) @@ -942,6 +942,9 @@ void ath_intr(void *); #define ath_hal_setintmit(_ah, _v) \ ath_hal_setcapability(_ah, HAL_CAP_INTMIT, \ HAL_CAP_INTMIT_ENABLE, _v, NULL) +#define ath_hal_hasedma(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_ENHANCED_DMA_SUPPORT, \ + 0, NULL) == HAL_OK) #define ath_hal_getchannoise(_ah, _c) \ ((*(_ah)->ah_getChanNoise)((_ah), (_c))) #define ath_hal_getrxchainmask(_ah, _prxchainmask) \ From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 06:05: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 8F218106566B; Mon, 2 Jul 2012 06:05:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A9A38FC0C; Mon, 2 Jul 2012 06:05: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 q6265QSC048302; Mon, 2 Jul 2012 06:05:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6265Q2t048300; Mon, 2 Jul 2012 06:05:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207020605.q6265Q2t048300@svn.freebsd.org> From: Adrian Chadd Date: Mon, 2 Jul 2012 06:05: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: r237955 - head/sys/dev/ath/ath_hal 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, 02 Jul 2012 06:05:26 -0000 Author: adrian Date: Mon Jul 2 06:05:25 2012 New Revision: 237955 URL: http://svn.freebsd.org/changeset/base/237955 Log: Fix typo. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:02:56 2012 (r237954) +++ head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:05:25 2012 (r237955) @@ -144,7 +144,7 @@ typedef enum { HAL_CAP_DS = 67, /* 2 stream */ HAL_CAP_BB_RX_CLEAR_STUCK_HANG = 68, HAL_CAP_MAC_HANG = 69, /* can MAC hang */ - HAL_CAP_MFP = 70, /* Manangement Frame Protection in hardware */ + HAL_CAP_MFP = 70, /* Management Frame Protection in hardware */ HAL_CAP_TS = 72, /* 3 stream */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 06:06:27 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 B30961065672; Mon, 2 Jul 2012 06:06: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 9E6D58FC20; Mon, 2 Jul 2012 06:06: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 q6266RsS048385; Mon, 2 Jul 2012 06:06:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6266RU6048383; Mon, 2 Jul 2012 06:06:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207020606.q6266RU6048383@svn.freebsd.org> From: Adrian Chadd Date: Mon, 2 Jul 2012 06:06: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: r237956 - head/sys/dev/ath/ath_hal 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, 02 Jul 2012 06:06:27 -0000 Author: adrian Date: Mon Jul 2 06:06:27 2012 New Revision: 237956 URL: http://svn.freebsd.org/changeset/base/237956 Log: Fix another typo. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:05:25 2012 (r237955) +++ head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:06:27 2012 (r237956) @@ -150,7 +150,7 @@ typedef enum { HAL_CAP_ENHANCED_DMA_SUPPORT = 75, /* DMA FIFO support */ - HAL_CAP_RX_BUFSIZE = 81, + HAL_CAP_RXBUFSIZE = 81, HAL_CAP_NUM_MR_ENTRIES = 82, HAL_CAP_OL_PWRCTRL = 84, /* Open loop TX power control */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 06:07:46 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 A7E26106564A; Mon, 2 Jul 2012 06:07:46 +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 940C48FC0C; Mon, 2 Jul 2012 06:07: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 q6267kqq048474; Mon, 2 Jul 2012 06:07:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6267kGO048472; Mon, 2 Jul 2012 06:07:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207020607.q6267kGO048472@svn.freebsd.org> From: Adrian Chadd Date: Mon, 2 Jul 2012 06:07: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: r237957 - head/sys/dev/ath/ath_hal 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, 02 Jul 2012 06:07:46 -0000 Author: adrian Date: Mon Jul 2 06:07:46 2012 New Revision: 237957 URL: http://svn.freebsd.org/changeset/base/237957 Log: .. And fix another typo. Grr. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:06:27 2012 (r237956) +++ head/sys/dev/ath/ath_hal/ah.h Mon Jul 2 06:07:46 2012 (r237957) @@ -151,7 +151,7 @@ typedef enum { HAL_CAP_ENHANCED_DMA_SUPPORT = 75, /* DMA FIFO support */ HAL_CAP_RXBUFSIZE = 81, - HAL_CAP_NUM_MR_ENTRIES = 82, + HAL_CAP_NUM_MR_RETRIES = 82, HAL_CAP_OL_PWRCTRL = 84, /* Open loop TX power control */ HAL_CAP_BB_PANIC_WATCHDOG = 92, From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 06:22:07 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 BBB29106566B; Mon, 2 Jul 2012 06:22:06 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9088FC19; Mon, 2 Jul 2012 06:22:04 +0000 (UTC) Received: by bkwj5 with SMTP id j5so3035289bkw.13 for ; Sun, 01 Jul 2012 23:22:04 -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=9HsvwV65argEOgAxp+TKviJ56wuaXYAarn/9KHS3x6Y=; b=BFInbzBmCuugqsJTWcHkwdIYgvUgdwfe+r0wrhdys+Qre6g/tkq0zQM6ghjkzHqZqU c9D8d9acuMCVxsu7s5PxJda4HbKmxgtGCn4VTq51J7Az1uWDl5PqD2z4AWo5BYvl14db Z55scWk8QC9kN+3kpQR5mMYfR4LxYqrB+dVoIxtewq+qk2JzYzorNJlzT4uhvqPKY3nx EkI/jUD7dPm0x6Cag9qigSVbOMxiZ6AG9KtOsdYNBx/EY3nUTSA4HzvYwaLWE/Kx4tdF GhSC0IztiqPtBWk+eyMvk9iv/iee0Ifa7ezk7IC2aaZybXxOqPqvTIjj15yROfkZtADx fd4g== MIME-Version: 1.0 Received: by 10.204.152.4 with SMTP id e4mr1005600bkw.2.1341210123866; Sun, 01 Jul 2012 23:22:03 -0700 (PDT) Received: by 10.204.49.87 with HTTP; Sun, 1 Jul 2012 23:22:03 -0700 (PDT) Received: by 10.204.49.87 with HTTP; Sun, 1 Jul 2012 23:22:03 -0700 (PDT) In-Reply-To: <4FF11DAE.6070404@FreeBSD.org> References: <201207010036.q610a7wc050629@svn.freebsd.org> <6AB69681-E87A-493C-AE2C-5B4A9218D455@FreeBSD.org> <4FF11DAE.6070404@FreeBSD.org> Date: Mon, 2 Jul 2012 07:22:03 +0100 Message-ID: From: Chris Rees To: Doug Barton , Beat Gaetzi 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, "Pedro F. Giffuni" , "Simon L. B. Nielsen" Subject: Re: svn commit: r237860 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 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, 02 Jul 2012 06:22:07 -0000 On Jul 2, 2012 5:05 AM, "Doug Barton" wrote: > > On 07/01/2012 03:05, Simon L. B. Nielsen wrote: > > Don't replace files, and even worse directories, and it breaks svn2cvs. > > Isn't it possible to write a pre-commit hook to avoid this issue? I'm sure beat wrote one for ports.... Chris From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 06:22:20 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 C072810657FD; Mon, 2 Jul 2012 06:22:20 +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 ACA268FC0C; Mon, 2 Jul 2012 06:22: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 q626MKUL049110; Mon, 2 Jul 2012 06:22:20 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q626MK19049108; Mon, 2 Jul 2012 06:22:20 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207020622.q626MK19049108@svn.freebsd.org> From: Doug Barton Date: Mon, 2 Jul 2012 06:22: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: r237958 - 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: Mon, 02 Jul 2012 06:22:20 -0000 Author: dougb Date: Mon Jul 2 06:22:20 2012 New Revision: 237958 URL: http://svn.freebsd.org/changeset/base/237958 Log: For the ports modules building code, clean WRKDIR before building. This is important for those that use -DNO_CLEAN routinely, since it will prevent installing stale stuff, and even more important when the port is upgraded to a newer version. When the user doesn't use -DNO_CLEAN, this will create an infinitesimal amount of extra work, but won't hurt anything. This is necessary because the ports tree has flags that prevent the ususal 'update the build if newer source files exist' logic from doing what it would do in the base. Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Jul 2 06:07:46 2012 (r237957) +++ head/sys/conf/kern.post.mk Mon Jul 2 06:22:20 2012 (r237958) @@ -64,7 +64,7 @@ PORTSMODULESENV=\ ${__target}: ports-${__target} ports-${__target}: .for __i in ${PORTS_MODULES} - cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/} + cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/all/clean all/:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/} .endfor .endfor .endif From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 07:27: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 A6F50106564A; Mon, 2 Jul 2012 07:27:15 +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 89DAF8FC0C; Mon, 2 Jul 2012 07:27: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 q627RFd9054916; Mon, 2 Jul 2012 07:27:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q627RFDH054913; Mon, 2 Jul 2012 07:27:15 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207020727.q627RFDH054913@svn.freebsd.org> From: Martin Matuska Date: Mon, 2 Jul 2012 07:27: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: r237972 - head/sys/cddl/contrib/opensolaris/uts/common/fs/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: Mon, 02 Jul 2012 07:27:15 -0000 Author: mm Date: Mon Jul 2 07:27:14 2012 New Revision: 237972 URL: http://svn.freebsd.org/changeset/base/237972 Log: Expose scrub and resilver tunables. This allows the user to tune the priority trade-off between scrub/resilver and other ZFS I/O. MFC after: 2 weeks Discussed with: pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Jul 2 07:22:22 2012 (r237971) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Jul 2 07:27:14 2012 (r237972) @@ -58,16 +58,47 @@ static scan_cb_t dsl_scan_remove_cb; static dsl_syncfunc_t dsl_scan_cancel_sync; static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx); -int zfs_top_maxinflight = 32; /* maximum I/Os per top-level */ -int zfs_resilver_delay = 2; /* number of ticks to delay resilver */ -int zfs_scrub_delay = 4; /* number of ticks to delay scrub */ -int zfs_scan_idle = 50; /* idle window in clock ticks */ - -int zfs_scan_min_time_ms = 1000; /* min millisecs to scrub per txg */ -int zfs_free_min_time_ms = 1000; /* min millisecs to free per txg */ -int zfs_resilver_min_time_ms = 3000; /* min millisecs to resilver per txg */ +unsigned int zfs_top_maxinflight = 32; /* maximum I/Os per top-level */ +unsigned int zfs_resilver_delay = 2; /* number of ticks to delay resilver */ +unsigned int zfs_scrub_delay = 4; /* number of ticks to delay scrub */ +unsigned int zfs_scan_idle = 50; /* idle window in clock ticks */ + +unsigned int zfs_scan_min_time_ms = 1000; /* min millisecs to scrub per txg */ +unsigned int zfs_free_min_time_ms = 1000; /* min millisecs to free per txg */ +unsigned int zfs_resilver_min_time_ms = 3000; /* min millisecs to resilver + per txg */ boolean_t zfs_no_scrub_io = B_FALSE; /* set to disable scrub i/o */ boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */ + +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.top_maxinflight", &zfs_top_maxinflight); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RW, + &zfs_top_maxinflight, 0, "Maximum I/Os per top-level vdev"); +TUNABLE_INT("vfs.zfs.resilver_delay", &zfs_resilver_delay); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RW, + &zfs_resilver_delay, 0, "Number of ticks to delay resilver"); +TUNABLE_INT("vfs.zfs.scrub_delay", &zfs_scrub_delay); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RW, + &zfs_scrub_delay, 0, "Number of ticks to delay scrub"); +TUNABLE_INT("vfs.zfs.scan_idle", &zfs_scan_idle); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RW, + &zfs_scan_idle, 0, "Idle scan window in clock ticks"); +TUNABLE_INT("vfs.zfs.scan_min_time_ms", &zfs_scan_min_time_ms); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RW, + &zfs_scan_min_time_ms, 0, "Min millisecs to scrub per txg"); +TUNABLE_INT("vfs.zfs.free_min_time_ms", &zfs_free_min_time_ms); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RW, + &zfs_free_min_time_ms, 0, "Min millisecs to free per txg"); +TUNABLE_INT("vfs.zfs.resilver_min_time_ms", &zfs_resilver_min_time_ms); +SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RW, + &zfs_resilver_min_time_ms, 0, "Min millisecs to resilver per txg"); +TUNABLE_INT("vfs.zfs.no_scrub_io", &zfs_no_scrub_io); +SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RW, + &zfs_no_scrub_io, 0, "Disable scrub I/O"); +TUNABLE_INT("vfs.zfs.no_scrub_prefetch", &zfs_no_scrub_prefetch); +SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RW, + &zfs_no_scrub_prefetch, 0, "Disable scrub prefetching"); + enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE; #define DSL_SCAN_IS_SCRUB_RESILVER(scn) \ @@ -405,7 +436,7 @@ static boolean_t dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_t *zb) { uint64_t elapsed_nanosecs; - int mintime; + unsigned int mintime; /* we never skip user/group accounting objects */ if (zb && (int64_t)zb->zb_object < 0) @@ -1638,7 +1669,7 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, boolean_t needs_io; int zio_flags = ZIO_FLAG_SCAN_THREAD | ZIO_FLAG_RAW | ZIO_FLAG_CANFAIL; int zio_priority; - int scan_delay = 0; + unsigned int scan_delay = 0; if (phys_birth <= scn->scn_phys.scn_min_txg || phys_birth >= scn->scn_phys.scn_max_txg) @@ -1695,7 +1726,8 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, if (needs_io && !zfs_no_scrub_io) { vdev_t *rvd = spa->spa_root_vdev; - uint64_t maxinflight = rvd->vdev_children * zfs_top_maxinflight; + uint64_t maxinflight = rvd->vdev_children * + MAX(zfs_top_maxinflight, 1); void *data = zio_data_buf_alloc(size); mutex_enter(&spa->spa_scrub_lock); @@ -1709,7 +1741,7 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, * then throttle our workload to limit the impact of a scan. */ if (ddi_get_lbolt64() - spa->spa_last_io <= zfs_scan_idle) - delay(scan_delay); + delay(MAX((int)scan_delay, 0)); zio_nowait(zio_read(NULL, spa, bp, data, size, dsl_scan_scrub_done, NULL, zio_priority, From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 07:39: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 4EF5910657EA; Mon, 2 Jul 2012 07:39: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 D345A8FC12; Mon, 2 Jul 2012 07:39: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 q627dt6h055584; Mon, 2 Jul 2012 07:39:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q627dtMm055582; Mon, 2 Jul 2012 07:39:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207020739.q627dtMm055582@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 2 Jul 2012 07:39: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: r237975 - head/sys/dev/sound/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: Mon, 02 Jul 2012 07:39:56 -0000 Author: glebius Date: Mon Jul 2 07:39:55 2012 New Revision: 237975 URL: http://svn.freebsd.org/changeset/base/237975 Log: - Call bus_generic_attach() at end of hdspe_attach(). - Use own devclass_t in DRIVER_MODULE(). This fixes operation of hdspe(4) when built as loadable module. Submitted by: Ruslan Bukin
Modified: head/sys/dev/sound/pci/hdspe.c Modified: head/sys/dev/sound/pci/hdspe.c ============================================================================== --- head/sys/dev/sound/pci/hdspe.c Mon Jul 2 07:39:33 2012 (r237974) +++ head/sys/dev/sound/pci/hdspe.c Mon Jul 2 07:39:55 2012 (r237975) @@ -347,7 +347,7 @@ hdspe_attach(device_t dev) hdspe_map_dmabuf(sc); - return 0; + return (bus_generic_attach(dev)); } static void @@ -407,4 +407,6 @@ static driver_t hdspe_driver = { PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_hdspe, pci, hdspe_driver, pcm_devclass, 0, 0); +static devclass_t hdspe_devclass; + +DRIVER_MODULE(snd_hdspe, pci, hdspe_driver, hdspe_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 07:51: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 9F1961065670; Mon, 2 Jul 2012 07:51:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id 214F48FC1F; Mon, 2 Jul 2012 07:51:10 +0000 (UTC) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q627p3qU008989; Mon, 2 Jul 2012 17:51:03 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q627osdq031071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jul 2012 17:50:55 +1000 Date: Mon, 2 Jul 2012 17:50:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI In-Reply-To: <201207020238.q622cR4q038051@svn.freebsd.org> Message-ID: <20120702171933.I807@besplex.bde.org> References: <201207020238.q622cR4q038051@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: r237942 - head/sbin/ping 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, 02 Jul 2012 07:51:11 -0000 On Mon, 2 Jul 2012, Xin LI wrote: > Log: > Use timeclear() instead of home grown version. > > MFC after: 2 weeks timerclear() is a NetBSD/OpenBSD compatibility mistake. It should at least have been named timevalclear(). (timevalclear() is the kernel name, and is intentionally left out of sys/time.h for !_KERNEL.) ping remains fairly portable by not using NetBSD/OpenBSD APIs for any other timeval access, despite most of the others taking longer to spell out than clearing. In .c files in /usr/src/*bin, the timerclear() mistake is only used in usr.bin/talk. The more useful timeradd() is only used in netstat (once), rtsold (thrice) and bsnpd (once). The even more useful timercmp() is used in pkill (once), routed (lots, but this is really contrib code), netstat (once), rtsold (lots) and bsnpd (lots). In .c files in /usr/src/contrib, timerclear() only used in ofed and pf. So these mistakes would be easy to avoid (except in ports). Mistakes for the timevalfoo() kernel API in userland are less common. For timevaladd(): - routed uses timevaladd() and supplies its own copy of the kernel code. This is approximately correct. It is portable, and the kernel version is hard to abuse since it is an extern function. Optimizing timevaladd() as a macro would be silly and is not done by either. The uglieness in routed is that it mixes this with timerfoo(). - ktrace. Like routed, except it copies the kernel code even more directly. (In the kernel and in ktrace, timevaladd() just adds then calls timevalfix() to handle wrap around. In routed, wrap around is handled directly. timeradd() handles wrap directly using a bloated macro. Another bug in the timeradd() API is that the macro is unsafe, but its name indicates that it is safe. Using extern functions avoids this bug for some of the timeval*() APIs.) - timed: like routed. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 07:55:10 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id EB6C7106566B; Mon, 2 Jul 2012 07:55:09 +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 02BF214D867; Mon, 2 Jul 2012 07:55:07 +0000 (UTC) Message-ID: <4FF153DB.7080904@FreeBSD.org> Date: Mon, 02 Jul 2012 00:55:07 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Andriy Gapon References: <201206290735.q5T7ZbSk026312@svn.freebsd.org> <4FED5C51.9060603@FreeBSD.org> In-Reply-To: <4FED5C51.9060603@FreeBSD.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 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, 02 Jul 2012 07:55:10 -0000 On 06/29/2012 00:42, Andriy Gapon wrote: > I haven't studied at all what the newer code brings in, but it must be some > fixes and improvements, I guess :-) Seriously? -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 07:58:15 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 CD2A41065673; Mon, 2 Jul 2012 07:58:15 +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 3A2AD14EEEB; Mon, 2 Jul 2012 07:58:15 +0000 (UTC) Message-ID: <4FF15496.7070307@FreeBSD.org> Date: Mon, 02 Jul 2012 00:58:14 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Marius Strobl References: <201206181911.q5IJB7NL095734@svn.freebsd.org> In-Reply-To: <201206181911.q5IJB7NL095734@svn.freebsd.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237234 - 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: Mon, 02 Jul 2012 07:58:15 -0000 FYI, you didn't change the substance of the text, so there is no reason to bump .Dd. Doug On 06/18/2012 12:11, Marius Strobl wrote: > Author: marius > Date: Mon Jun 18 19:11:07 2012 > New Revision: 237234 > URL: http://svn.freebsd.org/changeset/base/237234 > > Log: > Avoid hard sentence break. > > MFC after: 3 days > > Modified: > head/share/man/man4/ahci.4 > > Modified: head/share/man/man4/ahci.4 > ============================================================================== > --- head/share/man/man4/ahci.4 Mon Jun 18 18:25:57 2012 (r237233) > +++ head/share/man/man4/ahci.4 Mon Jun 18 19:11:07 2012 (r237234) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 6, 2011 > +.Dd June 18, 2012 > .Dt AHCI 4 > .Os > .Sh NAME > @@ -101,7 +101,8 @@ setting to nonzero value limits maximum > Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. > .It Va hw.ahci.force > setting to nonzero value forces driver attach to some known AHCI-capable > -chips even if they are configured for legacy IDE emulation. Default is 1. > +chips even if they are configured for legacy IDE emulation. > +Default is 1. > .El > .Sh DESCRIPTION > This driver provides the > -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 08:00: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 E7775106566B; Mon, 2 Jul 2012 08:00:17 +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 7C0F68FC14; Mon, 2 Jul 2012 08:00:16 +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 LAA05779; Mon, 02 Jul 2012 11:00:07 +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 1SlbYE-000HDN-OI; Mon, 02 Jul 2012 11:00:06 +0300 Message-ID: <4FF15506.8080206@FreeBSD.org> Date: Mon, 02 Jul 2012 11:00:06 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120620 Thunderbird/13.0.1 MIME-Version: 1.0 To: Doug Barton References: <201206290735.q5T7ZbSk026312@svn.freebsd.org> <4FED5C51.9060603@FreeBSD.org> <4FF153DB.7080904@FreeBSD.org> In-Reply-To: <4FF153DB.7080904@FreeBSD.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 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, 02 Jul 2012 08:00:18 -0000 on 02/07/2012 10:55 Doug Barton said the following: > On 06/29/2012 00:42, Andriy Gapon wrote: >> I haven't studied at all what the newer code brings in, but it must be some >> fixes and improvements, I guess :-) > > Seriously? > I expected to hear from you :-) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 08:31: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 B15F71065674; Mon, 2 Jul 2012 08:31:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BACB8FC1B; Mon, 2 Jul 2012 08:31: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 q628VTaG058113; Mon, 2 Jul 2012 08:31:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q628VTOO058104; Mon, 2 Jul 2012 08:31:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207020831.q628VTOO058104@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jul 2012 08:31: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: r237981 - in head: share/man/man4 sys/conf sys/dev/acpi_support sys/modules/acpi sys/modules/acpi/acpi_asus_wmi 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, 02 Jul 2012 08:31:29 -0000 Author: mav Date: Mon Jul 2 08:31:29 2012 New Revision: 237981 URL: http://svn.freebsd.org/changeset/base/237981 Log: Add acpi_asus_wmi(4) -- driver for random extras found on WMI-compatible Asus laptops. It is alike to acpi_asus(4), but uses WMI interface instead of separate ACPI device. On Asus EeePC T101MT netbook it allows to handle hotkeys and on/off WLAN, Bluetooth, LCD backlight, camera, cardreader and touchpad. On Asus UX31A ultrabook it allows to handle hotkeys, on/off WLAN, Bluetooth, Wireless LED, control keyboard backlight brightness, monitor temperature and fan speed. LCD brightness control doesn't work now for unknown reason, possibly requiring some video card initialization. Sponsored by: iXsystems, Inc. Added: head/share/man/man4/acpi_asus_wmi.4 (contents, props changed) head/sys/dev/acpi_support/acpi_asus_wmi.c (contents, props changed) head/sys/modules/acpi/acpi_asus_wmi/ head/sys/modules/acpi/acpi_asus_wmi/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/acpi_asus.4 head/sys/conf/files head/sys/modules/acpi/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Jul 2 08:28:16 2012 (r237980) +++ head/share/man/man4/Makefile Mon Jul 2 08:31:29 2012 (r237981) @@ -4,6 +4,7 @@ MAN= aac.4 \ acpi.4 \ ${_acpi_asus.4} \ + ${_acpi_asus_wmi.4} \ ${_acpi_dock.4} \ ${_acpi_fujitsu.4} \ ${_acpi_hp.4} \ @@ -698,6 +699,7 @@ MLINKS+=zyd.4 if_zyd.4 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _acpi_asus.4= acpi_asus.4 +_acpi_asus_wmi.4= acpi_asus_wmi.4 _acpi_dock.4= acpi_dock.4 _acpi_fujitsu.4=acpi_fujitsu.4 _acpi_hp.4= acpi_hp.4 Modified: head/share/man/man4/acpi_asus.4 ============================================================================== --- head/share/man/man4/acpi_asus.4 Mon Jul 2 08:28:16 2012 (r237980) +++ head/share/man/man4/acpi_asus.4 Mon Jul 2 08:31:29 2012 (r237981) @@ -157,6 +157,7 @@ Defaults for these variables can be set which is parsed at boot-time. .Sh SEE ALSO .Xr acpi 4 , +.Xr acpi_asus_wmi 4 , .Xr acpi_video 4 , .Xr sysctl.conf 5 , .Xr sysctl 8 Added: head/share/man/man4/acpi_asus_wmi.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/acpi_asus_wmi.4 Mon Jul 2 08:31:29 2012 (r237981) @@ -0,0 +1,90 @@ +.\" +.\" Copyright (c) 2012 Alexander Motin +.\" 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 July 2, 2012 +.Dt ACPI_ASUS_WMI 4 +.Os +.Sh NAME +.Nm acpi_asus_wmi +.Nd Asus Laptop WMI Extras +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device acpi_asus_wmi" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +acpi_asus_wmi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the extra WMI-controlled gadgets, such as hotkeys +and leds, found on Asus laptops. +It allows one to use the +.Xr sysctl 8 +interface to manipulate the brightness of the LCD panel and keyboard backlight, +power on/off different internal components, such as WiFi, Bluetooth, camera, +cardreader, etc, read some sensors. +Hotkey events are passed to +.Xr devd 8 +for easy handling in userspace with the default configuration in +.Pa /etc/devd/asus.conf . +Some hotkey events, such as keyboard backlight and touchpad control, are +handled inside the driver. +.Sh SYSCTL VARIABLES +The following sysctls are currently implemented: +.Bl -tag -width indent +.It Va dev.acpi_asus_wmi.0.handle_keys +Specifies whether driver should handle some harwdare keys, such as keyboard +backlight, internally. +.El +.Pp +Number of other variables under the same sysctl branch are model-specific. +.Pp +Defaults for these variables can be set in +.Xr sysctl.conf 5 , +which is parsed at boot-time. +.Sh SEE ALSO +.Xr acpi 4 , +.Xr acpi_asus 4 , +.Xr acpi_video 4 , +.Xr sysctl.conf 5 , +.Xr devd 8 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An Alexander Motib Aq mav@FreeBSD.org . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jul 2 08:28:16 2012 (r237980) +++ head/sys/conf/files Mon Jul 2 08:31:29 2012 (r237981) @@ -576,6 +576,7 @@ dev/aac/aac_linux.c optional aac compat dev/aac/aac_pci.c optional aac pci dev/acpi_support/acpi_wmi.c optional acpi_wmi acpi dev/acpi_support/acpi_asus.c optional acpi_asus acpi +dev/acpi_support/acpi_asus_wmi.c optional acpi_asus_wmi acpi dev/acpi_support/acpi_fujitsu.c optional acpi_fujitsu acpi dev/acpi_support/acpi_hp.c optional acpi_hp acpi dev/acpi_support/acpi_ibm.c optional acpi_ibm acpi Added: head/sys/dev/acpi_support/acpi_asus_wmi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/acpi_support/acpi_asus_wmi.c Mon Jul 2 08:31:29 2012 (r237981) @@ -0,0 +1,651 @@ +/*- + * Copyright (c) 2012 Alexander Motin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "acpi_wmi_if.h" + +#define _COMPONENT ACPI_OEM +ACPI_MODULE_NAME("ASUS-WMI") + +#define ACPI_ASUS_WMI_MGMT_GUID "97845ED0-4E6D-11DE-8A39-0800200C9A66" +#define ACPI_ASUS_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C" +#define ACPI_EEEPC_WMI_EVENT_GUID "ABBC0F72-8EA1-11D1-00A0-C90629100000" + +/* WMI Methods */ +#define ASUS_WMI_METHODID_SPEC 0x43455053 +#define ASUS_WMI_METHODID_SFUN 0x4E554653 +#define ASUS_WMI_METHODID_DSTS 0x53544344 +#define ASUS_WMI_METHODID_DSTS2 0x53545344 +#define ASUS_WMI_METHODID_DEVS 0x53564544 +#define ASUS_WMI_METHODID_INIT 0x54494E49 +#define ASUS_WMI_METHODID_HKEY 0x59454B48 + +#define ASUS_WMI_UNSUPPORTED_METHOD 0xFFFFFFFE + +/* Wireless */ +#define ASUS_WMI_DEVID_HW_SWITCH 0x00010001 +#define ASUS_WMI_DEVID_WIRELESS_LED 0x00010002 +#define ASUS_WMI_DEVID_CWAP 0x00010003 +#define ASUS_WMI_DEVID_WLAN 0x00010011 +#define ASUS_WMI_DEVID_BLUETOOTH 0x00010013 +#define ASUS_WMI_DEVID_GPS 0x00010015 +#define ASUS_WMI_DEVID_WIMAX 0x00010017 +#define ASUS_WMI_DEVID_WWAN3G 0x00010019 +#define ASUS_WMI_DEVID_UWB 0x00010021 + +/* LEDs */ +#define ASUS_WMI_DEVID_LED1 0x00020011 +#define ASUS_WMI_DEVID_LED2 0x00020012 +#define ASUS_WMI_DEVID_LED3 0x00020013 +#define ASUS_WMI_DEVID_LED4 0x00020014 +#define ASUS_WMI_DEVID_LED5 0x00020015 +#define ASUS_WMI_DEVID_LED6 0x00020016 + +/* Backlight and Brightness */ +#define ASUS_WMI_DEVID_BACKLIGHT 0x00050011 +#define ASUS_WMI_DEVID_BRIGHTNESS 0x00050012 +#define ASUS_WMI_DEVID_KBD_BACKLIGHT 0x00050021 +#define ASUS_WMI_DEVID_LIGHT_SENSOR 0x00050022 + +/* Misc */ +#define ASUS_WMI_DEVID_CAMERA 0x00060013 +#define ASUS_WMI_DEVID_CARDREADER 0x00080013 +#define ASUS_WMI_DEVID_TOUCHPAD 0x00100011 +#define ASUS_WMI_DEVID_TOUCHPAD_LED 0x00100012 +#define ASUS_WMI_DEVID_THERMAL_CTRL 0x00110011 +#define ASUS_WMI_DEVID_FAN_CTRL 0x00110012 +#define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012 + +/* DSTS masks */ +#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001 +#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002 +#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000 +#define ASUS_WMI_DSTS_USER_BIT 0x00020000 +#define ASUS_WMI_DSTS_BIOS_BIT 0x00040000 +#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF +#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00 + + +struct acpi_asus_wmi_softc { + device_t dev; + device_t wmi_dev; + const char *notify_guid; + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; + int dsts_id; + int handle_keys; +}; + +static struct { + char *name; + int dev_id; + char *description; + int access; +} acpi_asus_wmi_sysctls[] = { + { + .name = "hw_switch", + .dev_id = ASUS_WMI_DEVID_HW_SWITCH, + .description = "hw_switch", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "wireless_led", + .dev_id = ASUS_WMI_DEVID_WIRELESS_LED, + .description = "Wireless LED control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "cwap", + .dev_id = ASUS_WMI_DEVID_CWAP, + .description = "Alt+F2 function", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "wlan", + .dev_id = ASUS_WMI_DEVID_WLAN, + .description = "WLAN power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "bluetooth", + .dev_id = ASUS_WMI_DEVID_BLUETOOTH, + .description = "Bluetooth power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "gps", + .dev_id = ASUS_WMI_DEVID_GPS, + .description = "GPS power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "wimax", + .dev_id = ASUS_WMI_DEVID_WIMAX, + .description = "WiMAX power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "wwan3g", + .dev_id = ASUS_WMI_DEVID_WWAN3G, + .description = "WWAN-3G power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "uwb", + .dev_id = ASUS_WMI_DEVID_UWB, + .description = "UWB power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "led1", + .dev_id = ASUS_WMI_DEVID_LED1, + .description = "LED1 control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "led2", + .dev_id = ASUS_WMI_DEVID_LED2, + .description = "LED2 control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "led3", + .dev_id = ASUS_WMI_DEVID_LED3, + .description = "LED3 control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "led4", + .dev_id = ASUS_WMI_DEVID_LED4, + .description = "LED4 control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "led5", + .dev_id = ASUS_WMI_DEVID_LED5, + .description = "LED5 control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "led6", + .dev_id = ASUS_WMI_DEVID_LED6, + .description = "LED6 control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "backlight", + .dev_id = ASUS_WMI_DEVID_BACKLIGHT, + .description = "LCD backlight on/off control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "brightness", + .dev_id = ASUS_WMI_DEVID_BRIGHTNESS, + .description = "LCD backlight brightness control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "kbd_backlight", + .dev_id = ASUS_WMI_DEVID_KBD_BACKLIGHT, + .description = "Keyboard backlight brightness control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "light_sensor", + .dev_id = ASUS_WMI_DEVID_LIGHT_SENSOR, + .description = "Ambient light sensor", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "camera", + .dev_id = ASUS_WMI_DEVID_CAMERA, + .description = "Camera power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "cardreader", + .dev_id = ASUS_WMI_DEVID_CARDREADER, + .description = "Cardreader power control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "touchpad", + .dev_id = ASUS_WMI_DEVID_TOUCHPAD, + .description = "Touchpad control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "touchpad_led", + .dev_id = ASUS_WMI_DEVID_TOUCHPAD_LED, + .description = "Touchpad LED control", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { + .name = "themperature", + .dev_id = ASUS_WMI_DEVID_THERMAL_CTRL, + .description = "Temperature (C)", + .access = CTLTYPE_INT | CTLFLAG_RD + }, + { + .name = "fan_speed", + .dev_id = ASUS_WMI_DEVID_FAN_CTRL, + .description = "Fan speed (0-3)", + .access = CTLTYPE_INT | CTLFLAG_RD + }, + { + .name = "processor_state", + .dev_id = ASUS_WMI_DEVID_PROCESSOR_STATE, + .description = "Processor state", + .access = CTLTYPE_INT | CTLFLAG_RW + }, + { NULL, 0, NULL, 0 } +}; + +ACPI_SERIAL_DECL(asus_wmi, "ASUS WMI device"); + +static void acpi_asus_wmi_identify(driver_t *driver, device_t parent); +static int acpi_asus_wmi_probe(device_t dev); +static int acpi_asus_wmi_attach(device_t dev); +static int acpi_asus_wmi_detach(device_t dev); + +static int acpi_asus_wmi_sysctl(SYSCTL_HANDLER_ARGS); +static int acpi_asus_wmi_sysctl_set(struct acpi_asus_wmi_softc *sc, int dev_id, + int arg, int oldarg); +static int acpi_asus_wmi_sysctl_get(struct acpi_asus_wmi_softc *sc, int dev_id); +static int acpi_asus_wmi_evaluate_method(device_t wmi_dev, int method, + UINT32 arg0, UINT32 arg1, UINT32 *retval); +static int acpi_wpi_asus_get_devstate(struct acpi_asus_wmi_softc *sc, + UINT32 dev_id, UINT32 *retval); +static int acpi_wpi_asus_set_devstate(struct acpi_asus_wmi_softc *sc, + UINT32 dev_id, UINT32 ctrl_param, UINT32 *retval); +static void acpi_asus_wmi_notify(ACPI_HANDLE h, UINT32 notify, void *context); + +static device_method_t acpi_asus_wmi_methods[] = { + DEVMETHOD(device_identify, acpi_asus_wmi_identify), + DEVMETHOD(device_probe, acpi_asus_wmi_probe), + DEVMETHOD(device_attach, acpi_asus_wmi_attach), + DEVMETHOD(device_detach, acpi_asus_wmi_detach), + {0, 0} +}; + +static driver_t acpi_asus_wmi_driver = { + "acpi_asus_wmi", + acpi_asus_wmi_methods, + sizeof(struct acpi_asus_wmi_softc), +}; + +static devclass_t acpi_asus_wmi_devclass; + +DRIVER_MODULE(acpi_asus_wmi, acpi_wmi, acpi_asus_wmi_driver, + acpi_asus_wmi_devclass, 0, 0); +MODULE_DEPEND(acpi_asus_wmi, acpi_wmi, 1, 1, 1); +MODULE_DEPEND(acpi_asus_wmi, acpi, 1, 1, 1); + +static void +acpi_asus_wmi_identify(driver_t *driver, device_t parent) +{ + + /* Don't do anything if driver is disabled. */ + if (acpi_disabled("asus_wmi")) + return; + + /* Add only a single device instance. */ + if (device_find_child(parent, "acpi_asus_wmi", -1) != NULL) + return; + + /* Check management GUID to see whether system is compatible. */ + if (!ACPI_WMI_PROVIDES_GUID_STRING(parent, + ACPI_ASUS_WMI_MGMT_GUID)) + return; + + if (BUS_ADD_CHILD(parent, 0, "acpi_asus_wmi", -1) == NULL) + device_printf(parent, "add acpi_asus_wmi child failed\n"); +} + +static int +acpi_asus_wmi_probe(device_t dev) +{ + + if (!ACPI_WMI_PROVIDES_GUID_STRING(device_get_parent(dev), + ACPI_ASUS_WMI_MGMT_GUID)) + return (EINVAL); + device_set_desc(dev, "ASUS WMI device"); + return (0); +} + +static int +acpi_asus_wmi_attach(device_t dev) +{ + struct acpi_asus_wmi_softc *sc; + UINT32 val; + int dev_id, i; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); + + sc = device_get_softc(dev); + sc->dev = dev; + sc->wmi_dev = device_get_parent(dev); + sc->handle_keys = 1; + + /* Check management GUID. */ + if (!ACPI_WMI_PROVIDES_GUID_STRING(sc->wmi_dev, + ACPI_ASUS_WMI_MGMT_GUID)) { + device_printf(dev, + "WMI device does not provide the ASUS management GUID\n"); + return (EINVAL); + } + + /* Find proper DSTS method. */ + sc->dsts_id = ASUS_WMI_METHODID_DSTS; +next: + for (i = 0; acpi_asus_wmi_sysctls[i].name != NULL; ++i) { + dev_id = acpi_asus_wmi_sysctls[i].dev_id; + if (acpi_wpi_asus_get_devstate(sc, dev_id, &val)) + continue; + break; + } + if (acpi_asus_wmi_sysctls[i].name == NULL) { + if (sc->dsts_id == ASUS_WMI_METHODID_DSTS) { + sc->dsts_id = ASUS_WMI_METHODID_DSTS2; + goto next; + } else { + device_printf(dev, "Can not detect DSTS method ID\n"); + return (EINVAL); + } + } + + /* Find proper and attach to notufy GUID. */ + if (ACPI_WMI_PROVIDES_GUID_STRING(sc->wmi_dev, + ACPI_ASUS_WMI_EVENT_GUID)) + sc->notify_guid = ACPI_ASUS_WMI_EVENT_GUID; + else if (ACPI_WMI_PROVIDES_GUID_STRING(sc->wmi_dev, + ACPI_EEEPC_WMI_EVENT_GUID)) + sc->notify_guid = ACPI_EEEPC_WMI_EVENT_GUID; + else + sc->notify_guid = NULL; + if (sc->notify_guid != NULL) { + if (ACPI_WMI_INSTALL_EVENT_HANDLER(sc->wmi_dev, + sc->notify_guid, acpi_asus_wmi_notify, dev)) + sc->notify_guid = NULL; + } + if (sc->notify_guid == NULL) + device_printf(dev, "Could not install event handler!\n"); + + /* Initialize. */ + if (!acpi_asus_wmi_evaluate_method(sc->wmi_dev, + ASUS_WMI_METHODID_INIT, 0, 0, &val) && bootverbose) + device_printf(dev, "Initialization: %#x\n", val); + if (!acpi_asus_wmi_evaluate_method(sc->wmi_dev, + ASUS_WMI_METHODID_SPEC, 0, 0x9, &val) && bootverbose) + device_printf(dev, "WMI BIOS version: %d.%d\n", + val >> 16, val & 0xFF); + if (!acpi_asus_wmi_evaluate_method(sc->wmi_dev, + ASUS_WMI_METHODID_SFUN, 0, 0, &val) && bootverbose) + device_printf(dev, "SFUN value: %#x\n", val); + + ACPI_SERIAL_BEGIN(asus_wmi); + + sc->sysctl_ctx = device_get_sysctl_ctx(dev); + sc->sysctl_tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_INT(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + "handle_keys", CTLFLAG_RW, &sc->handle_keys, + 0, "Handle some hardware keys inside the driver"); + for (i = 0; acpi_asus_wmi_sysctls[i].name != NULL; ++i) { + dev_id = acpi_asus_wmi_sysctls[i].dev_id; + if (acpi_wpi_asus_get_devstate(sc, dev_id, &val)) + continue; + switch (dev_id) { + case ASUS_WMI_DEVID_THERMAL_CTRL: + case ASUS_WMI_DEVID_PROCESSOR_STATE: + case ASUS_WMI_DEVID_FAN_CTRL: + case ASUS_WMI_DEVID_BRIGHTNESS: + if (val == 0) + continue; + break; + default: + if ((val & ASUS_WMI_DSTS_PRESENCE_BIT) == 0) + continue; + break; + } + + SYSCTL_ADD_PROC(sc->sysctl_ctx, + SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, + acpi_asus_wmi_sysctls[i].name, + acpi_asus_wmi_sysctls[i].access, + sc, i, acpi_asus_wmi_sysctl, "I", + acpi_asus_wmi_sysctls[i].description); + } + ACPI_SERIAL_END(asus_wmi); + + return (0); +} + +static int +acpi_asus_wmi_detach(device_t dev) +{ + struct acpi_asus_wmi_softc *sc = device_get_softc(dev); + + ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); + + if (sc->notify_guid) + ACPI_WMI_REMOVE_EVENT_HANDLER(dev, sc->notify_guid); + + return (0); +} + +static int +acpi_asus_wmi_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct acpi_asus_wmi_softc *sc; + int arg; + int oldarg; + int error = 0; + int function; + int dev_id; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + sc = (struct acpi_asus_wmi_softc *)oidp->oid_arg1; + function = oidp->oid_arg2; + dev_id = acpi_asus_wmi_sysctls[function].dev_id; + + ACPI_SERIAL_BEGIN(asus_wmi); + arg = acpi_asus_wmi_sysctl_get(sc, dev_id); + oldarg = arg; + error = sysctl_handle_int(oidp, &arg, 0, req); + if (!error && req->newptr != NULL) + error = acpi_asus_wmi_sysctl_set(sc, dev_id, arg, oldarg); + ACPI_SERIAL_END(asus_wmi); + + return (error); +} + +static int +acpi_asus_wmi_sysctl_get(struct acpi_asus_wmi_softc *sc, int dev_id) +{ + UINT32 val = 0; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(asus_wmi); + + acpi_wpi_asus_get_devstate(sc, dev_id, &val); + + switch(dev_id) { + case ASUS_WMI_DEVID_THERMAL_CTRL: + val = (val - 2732 + 5) / 10; + break; + case ASUS_WMI_DEVID_PROCESSOR_STATE: + case ASUS_WMI_DEVID_FAN_CTRL: + break; + case ASUS_WMI_DEVID_BRIGHTNESS: + val &= ASUS_WMI_DSTS_BRIGHTNESS_MASK; + break; + case ASUS_WMI_DEVID_KBD_BACKLIGHT: + val &= 0x7; + break; + default: + if (val & ASUS_WMI_DSTS_UNKNOWN_BIT) + val = -1; + else + val = !!(val & ASUS_WMI_DSTS_STATUS_BIT); + break; + } + + return (val); +} + +static int +acpi_asus_wmi_sysctl_set(struct acpi_asus_wmi_softc *sc, int dev_id, int arg, int oldarg) +{ + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + ACPI_SERIAL_ASSERT(asus_wmi); + + switch(dev_id) { + case ASUS_WMI_DEVID_KBD_BACKLIGHT: + arg = min(0x7, arg); + if (arg != 0) + arg |= 0x80; + break; + } + + acpi_wpi_asus_set_devstate(sc, dev_id, arg, NULL); + + return (0); +} + +static __inline void +acpi_asus_wmi_free_buffer(ACPI_BUFFER* buf) { + if (buf && buf->Pointer) { + AcpiOsFree(buf->Pointer); + } +} + +static void +acpi_asus_wmi_notify(ACPI_HANDLE h, UINT32 notify, void *context) +{ + device_t dev = context; + ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); + UINT32 val; + int code = 0; + + struct acpi_asus_wmi_softc *sc = device_get_softc(dev); + ACPI_BUFFER response = { ACPI_ALLOCATE_BUFFER, NULL }; + ACPI_OBJECT *obj; + ACPI_WMI_GET_EVENT_DATA(sc->wmi_dev, notify, &response); + obj = (ACPI_OBJECT*) response.Pointer; + if (obj && obj->Type == ACPI_TYPE_INTEGER) { + code = obj->Integer.Value; + acpi_UserNotify("ASUS", ACPI_ROOT_OBJECT, + code); + } + if (code && sc->handle_keys) { + /* Keyboard backlight control. */ + if (code == 0xc4 || code == 0xc5) { + acpi_wpi_asus_get_devstate(sc, + ASUS_WMI_DEVID_KBD_BACKLIGHT, &val); + val &= 0x7; + if (code == 0xc4) { + if (val < 0x7) + val++; + } else if (val > 0) + val--; + if (val != 0) + val |= 0x80; + acpi_wpi_asus_set_devstate(sc, + ASUS_WMI_DEVID_KBD_BACKLIGHT, val, NULL); + } + /* Touchpad control. */ + if (code == 0x6b) { + acpi_wpi_asus_get_devstate(sc, + ASUS_WMI_DEVID_TOUCHPAD, &val); + val = !(val & 1); + acpi_wpi_asus_set_devstate(sc, + ASUS_WMI_DEVID_TOUCHPAD, val, NULL); + } + } + acpi_asus_wmi_free_buffer(&response); +} + +static int +acpi_asus_wmi_evaluate_method(device_t wmi_dev, int method, + UINT32 arg0, UINT32 arg1, UINT32 *retval) +{ + UINT32 params[2] = { arg0, arg1 }; + UINT32 result; + ACPI_OBJECT *obj; + ACPI_BUFFER in = { sizeof(params), ¶ms }; + ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; + + if (ACPI_FAILURE(ACPI_WMI_EVALUATE_CALL(wmi_dev, + ACPI_ASUS_WMI_MGMT_GUID, 1, method, &in, &out))) { + acpi_asus_wmi_free_buffer(&out); + return (-EINVAL); + } + obj = out.Pointer; + if (obj && obj->Type == ACPI_TYPE_INTEGER) + result = (UINT32) obj->Integer.Value; + else + result = 0; + acpi_asus_wmi_free_buffer(&out); + if (retval) + *retval = result; + return (result == ASUS_WMI_UNSUPPORTED_METHOD ? -ENODEV : 0); +} + +static int +acpi_wpi_asus_get_devstate(struct acpi_asus_wmi_softc *sc, + UINT32 dev_id, UINT32 *retval) +{ + + return (acpi_asus_wmi_evaluate_method(sc->wmi_dev, + sc->dsts_id, dev_id, 0, retval)); +} + +static int +acpi_wpi_asus_set_devstate(struct acpi_asus_wmi_softc *sc, + UINT32 dev_id, UINT32 ctrl_param, UINT32 *retval) +{ + + return (acpi_asus_wmi_evaluate_method(sc->wmi_dev, + ASUS_WMI_METHODID_DEVS, dev_id, ctrl_param, retval)); +} Modified: head/sys/modules/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/Makefile Mon Jul 2 08:28:16 2012 (r237980) +++ head/sys/modules/acpi/Makefile Mon Jul 2 08:31:29 2012 (r237981) @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= acpi_asus acpi_fujitsu acpi_hp acpi_ibm \ +SUBDIR= acpi_asus acpi_asus_wmi acpi_fujitsu acpi_hp acpi_ibm \ acpi_panasonic acpi_sony acpi_toshiba acpi_video \ acpi_dock acpi_wmi aibs Added: head/sys/modules/acpi/acpi_asus_wmi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/acpi/acpi_asus_wmi/Makefile Mon Jul 2 08:31:29 2012 (r237981) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/acpi_support + +KMOD= acpi_asus_wmi +CFLAGS+=-I${.CURDIR}/../../../dev/acpi_support +SRCS= acpi_asus_wmi.c opt_acpi.h acpi_if.h acpi_wmi_if.h device_if.h bus_if.h + +.include From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 08:41: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 808BE1065677; Mon, 2 Jul 2012 08:41:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5499B8FC16; Mon, 2 Jul 2012 08:41: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 q628fNx9058576; Mon, 2 Jul 2012 08:41:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q628fNYo058574; Mon, 2 Jul 2012 08:41:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207020841.q628fNYo058574@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jul 2012 08:41: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: r237982 - 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: Mon, 02 Jul 2012 08:41:23 -0000 Author: mav Date: Mon Jul 2 08:41:22 2012 New Revision: 237982 URL: http://svn.freebsd.org/changeset/base/237982 Log: Fix typo in r237981. Modified: head/share/man/man4/acpi_asus_wmi.4 Modified: head/share/man/man4/acpi_asus_wmi.4 ============================================================================== --- head/share/man/man4/acpi_asus_wmi.4 Mon Jul 2 08:31:29 2012 (r237981) +++ head/share/man/man4/acpi_asus_wmi.4 Mon Jul 2 08:41:22 2012 (r237982) @@ -87,4 +87,4 @@ The driver first appeared in .Fx 10.0 . .Sh AUTHORS -.An Alexander Motib Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 08:59:46 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 AD167106566C; Mon, 2 Jul 2012 08:59:46 +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 CDA7114D8E4; Mon, 2 Jul 2012 08:59:45 +0000 (UTC) Message-ID: <4FF16301.10606@FreeBSD.org> Date: Mon, 02 Jul 2012 01:59:45 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Andriy Gapon References: <201206290735.q5T7ZbSk026312@svn.freebsd.org> <4FED5C51.9060603@FreeBSD.org> <4FF153DB.7080904@FreeBSD.org> <4FF15506.8080206@FreeBSD.org> In-Reply-To: <4FF15506.8080206@FreeBSD.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 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, 02 Jul 2012 08:59:46 -0000 On 07/02/2012 01:00, Andriy Gapon wrote: > on 02/07/2012 10:55 Doug Barton said the following: >> On 06/29/2012 00:42, Andriy Gapon wrote: >>> I haven't studied at all what the newer code brings in, but it must be some >>> fixes and improvements, I guess :-) >> >> Seriously? >> > > I expected to hear from you :-) So let me get this straight ... you intentionally inserted an inflammatory comment that seems to indicate that you didn't actually review the code you committed in an attempt to bait me into saying something? -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 09:43:22 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 638281065675; Mon, 2 Jul 2012 09:43:22 +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 1BD288FC1B; Mon, 2 Jul 2012 09:43:20 +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 MAA06781; Mon, 02 Jul 2012 12:43:19 +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 1SldA7-000HKa-9w; Mon, 02 Jul 2012 12:43:19 +0300 Message-ID: <4FF16D35.5050104@FreeBSD.org> Date: Mon, 02 Jul 2012 12:43:17 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120620 Thunderbird/13.0.1 MIME-Version: 1.0 To: Doug Barton References: <201206290735.q5T7ZbSk026312@svn.freebsd.org> <4FED5C51.9060603@FreeBSD.org> <4FF153DB.7080904@FreeBSD.org> <4FF15506.8080206@FreeBSD.org> <4FF16301.10606@FreeBSD.org> In-Reply-To: <4FF16301.10606@FreeBSD.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386 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, 02 Jul 2012 09:43:22 -0000 on 02/07/2012 11:59 Doug Barton said the following: > On 07/02/2012 01:00, Andriy Gapon wrote: >> on 02/07/2012 10:55 Doug Barton said the following: >>> On 06/29/2012 00:42, Andriy Gapon wrote: >>>> I haven't studied at all what the newer code brings in, but it must be some >>>> fixes and improvements, I guess :-) >>> >>> Seriously? >>> >> >> I expected to hear from you :-) > > So let me get this straight ... you intentionally inserted an > inflammatory comment that seems to indicate that you didn't actually > review the code you committed in an attempt to bait me into saying > something? No. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 09:53:09 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 3061E1065670; Mon, 2 Jul 2012 09:53:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5D0D8FC08; Mon, 2 Jul 2012 09:53: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 q629r8JG061962; Mon, 2 Jul 2012 09:53:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q629r8kf061960; Mon, 2 Jul 2012 09:53:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207020953.q629r8kf061960@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 2 Jul 2012 09:53: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: r237987 - head/sys/fs/nfsclient 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, 02 Jul 2012 09:53:09 -0000 Author: kib Date: Mon Jul 2 09:53:08 2012 New Revision: 237987 URL: http://svn.freebsd.org/changeset/base/237987 Log: Do not override an error from uiomove() with (non-)error result from bwrite(). VFS needs to know about EFAULT from uiomove() and does not care much that partially filled block writeback after EFAULT was successfull. Early return without error causes short write to be reported to usermode. Reported and tested by: andreast MFC after: 3 weeks Modified: head/sys/fs/nfsclient/nfs_clbio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Mon Jul 2 09:47:38 2012 (r237986) +++ head/sys/fs/nfsclient/nfs_clbio.c Mon Jul 2 09:53:08 2012 (r237987) @@ -897,7 +897,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount; - int bp_cached, n, on, error = 0; + int bp_cached, n, on, error = 0, error1; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -1259,9 +1259,12 @@ again: if ((ioflag & IO_SYNC)) { if (ioflag & IO_INVAL) bp->b_flags |= B_NOCACHE; - error = bwrite(bp); - if (error) + error1 = bwrite(bp); + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } else if ((n + on) == biosize) { bp->b_flags |= B_ASYNC; (void) ncl_writebp(bp, 0, NULL); From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 09:53:58 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 0C8531065670; Mon, 2 Jul 2012 09:53:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECEBA8FC12; Mon, 2 Jul 2012 09:53: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 q629rvU0062032; Mon, 2 Jul 2012 09:53:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q629rvF4062030; Mon, 2 Jul 2012 09:53:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207020953.q629rvF4062030@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 2 Jul 2012 09:53: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: r237988 - head/usr.bin/xinstall 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, 02 Jul 2012 09:53:58 -0000 Author: kib Date: Mon Jul 2 09:53:57 2012 New Revision: 237988 URL: http://svn.freebsd.org/changeset/base/237988 Log: Issue proper diagnostic on the short writes, also consider the case of write reporting 0 bytes as short write. Reported and tested by: adreast MFC after: 1 week Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Mon Jul 2 09:53:08 2012 (r237987) +++ head/usr.bin/xinstall/xinstall.c Mon Jul 2 09:53:57 2012 (r237988) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -671,11 +672,18 @@ copy(int from_fd, const char *from_name, if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != (char *)MAP_FAILED) { - if ((nw = write(to_fd, p, size)) != size) { + nw = write(to_fd, p, size); + if (nw != size) { serrno = errno; (void)unlink(to_name); - errno = nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >= 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, (uintmax_t)size); + } else { + errno = serrno; + err(EX_OSERR, "%s", to_name); + } } done_copy = 1; } @@ -684,8 +692,15 @@ copy(int from_fd, const char *from_name, if ((nw = write(to_fd, buf, nr)) != nr) { serrno = errno; (void)unlink(to_name); - errno = nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >= 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, + (uintmax_t)size); + } else { + errno = serrno; + err(EX_OSERR, "%s", to_name); + } } if (nr != 0) { serrno = errno; From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 14:03: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 9E396106566B; Mon, 2 Jul 2012 14:03:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89DFD8FC14; Mon, 2 Jul 2012 14:03: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 q62E3Kum074544; Mon, 2 Jul 2012 14:03:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62E3KkH074542; Mon, 2 Jul 2012 14:03:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207021403.q62E3KkH074542@svn.freebsd.org> From: Christian Brueffer Date: Mon, 2 Jul 2012 14:03: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: r237996 - head/sys/i386/i386 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, 02 Jul 2012 14:03:20 -0000 Author: brueffer Date: Mon Jul 2 14:03:19 2012 New Revision: 237996 URL: http://svn.freebsd.org/changeset/base/237996 Log: Fix XEN build, broken in r237924. Reported by: gcooper Pointy hat: brueffer Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Jul 2 11:46:47 2012 (r237995) +++ head/sys/i386/i386/machdep.c Mon Jul 2 14:03:19 2012 (r237996) @@ -2176,13 +2176,13 @@ basemem_setup(void) static void getmemsize(int first) { - int has_smap, off, physmap_idx, pa_indx, da_indx, res; + int has_smap, off, physmap_idx, pa_indx, da_indx; u_long physmem_tunable, memtest; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; #ifndef XEN - int hasbrokenint12, i; + int hasbrokenint12, i, res; u_int extmem; struct vm86frame vmf; struct vm86context vmc; From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 15:28: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 E1E51106566B; Mon, 2 Jul 2012 15:28:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B416F8FC08; Mon, 2 Jul 2012 15:28: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 q62FSobQ078097; Mon, 2 Jul 2012 15:28:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62FSoot078093; Mon, 2 Jul 2012 15:28:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201207021528.q62FSoot078093@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 2 Jul 2012 15:28: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: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 15:28:51 -0000 Author: bapt Date: Mon Jul 2 15:28:50 2012 New Revision: 237997 URL: http://svn.freebsd.org/changeset/base/237997 Log: New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of usr.sbin/pkg Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, so that users can remove the old pkg_* tools without removing the pkgng boostrap Approved by: des (mentor) MFC after: 1 month Added: head/tools/build/options/WITHOUT_PKGBOOSTRAP (contents, props changed) Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jul 2 14:03:19 2012 (r237996) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jul 2 15:28:50 2012 (r237997) @@ -3482,6 +3482,10 @@ OLD_FILES+=usr/share/man/man8/pflogd.8.g OLD_FILES+=usr/share/man/man8/tftp-proxy.8.gz .endif +.if ${MK_PKGBOOTSTRAP} == no +OLD_FILES+=usr/sbin/pkg +.endif + .if ${MK_PKGTOOLS} == no OLD_FILES+=etc/periodic/daily/490.status-pkg-changes OLD_FILES+=etc/periodic/security/460.chkportsum Added: head/tools/build/options/WITHOUT_PKGBOOSTRAP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_PKGBOOSTRAP Mon Jul 2 15:28:50 2012 (r237997) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pkg +bootstrap tool Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Jul 2 14:03:19 2012 (r237996) +++ head/usr.sbin/Makefile Mon Jul 2 15:28:50 2012 (r237997) @@ -259,9 +259,12 @@ SUBDIR+= keyserv SUBDIR+= ftp-proxy .endif +.if ${PK_PKGBOOTSTRAP} != "no" +SUBDIR+= pkg +.endif + .if ${MK_PKGTOOLS} != "no" SUBDIR+= pkg_install -SUBDIR+= pkg .endif # XXX MK_TOOLCHAIN? From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:14: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 CC2091065687; Mon, 2 Jul 2012 16:14:52 +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 B87A38FC20; Mon, 2 Jul 2012 16:14:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62GEq4h080548; Mon, 2 Jul 2012 16:14:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62GEqdj080544; Mon, 2 Jul 2012 16:14:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207021614.q62GEqdj080544@svn.freebsd.org> From: John Baldwin Date: Mon, 2 Jul 2012 16:14: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: r238000 - in head/sys: kern 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, 02 Jul 2012 16:14:52 -0000 Author: jhb Date: Mon Jul 2 16:14:52 2012 New Revision: 238000 URL: http://svn.freebsd.org/changeset/base/238000 Log: Honor db_pager_quit in 'show uma' and 'show malloc'. MFC after: 1 month Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma_core.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Jul 2 16:14:35 2012 (r237999) +++ head/sys/kern/kern_malloc.c Mon Jul 2 16:14:52 2012 (r238000) @@ -1000,6 +1000,8 @@ DB_SHOW_COMMAND(malloc, db_show_malloc) db_printf("%18s %12ju %12juK %12ju\n", mtp->ks_shortdesc, allocs - frees, (alloced - freed + 1023) / 1024, allocs); + if (db_pager_quit) + break; } } @@ -1029,6 +1031,8 @@ DB_SHOW_COMMAND(multizone_matches, db_sh if (mtip->mti_zone != subzone) continue; db_printf("%s\n", mtp->ks_shortdesc); + if (db_pager_quit) + break; } } #endif /* MALLOC_DEBUG_MAXZONES > 1 */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Jul 2 16:14:35 2012 (r237999) +++ head/sys/vm/uma_core.c Mon Jul 2 16:14:52 2012 (r238000) @@ -3381,6 +3381,8 @@ DB_SHOW_COMMAND(uma, db_show_uma) (uintmax_t)kz->uk_size, (intmax_t)(allocs - frees), cachefree, (uintmax_t)allocs, sleeps); + if (db_pager_quit) + return; } } } From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:25: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 C90E8106567E; Mon, 2 Jul 2012 16:25:02 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id A382F8FC1F; Mon, 2 Jul 2012 16:25:02 +0000 (UTC) Received: from sa-nc-common-101.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q62GOqCB005002 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jul 2012 09:24:59 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201207021528.q62FSoot078093@svn.freebsd.org> Date: Mon, 2 Jul 2012 09:24:56 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <20CFC0F6-1EF9-4F01-881D-78B8E2811AD0@xcllnt.net> References: <201207021528.q62FSoot078093@svn.freebsd.org> To: Baptiste Daroussin , Dag-Erling Sm?rgrav 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: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 16:25:03 -0000 On Jul 2, 2012, at 8:28 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Jul 2 15:28:50 2012 > New Revision: 237997 > URL: http://svn.freebsd.org/changeset/base/237997 >=20 > Log: > New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of = usr.sbin/pkg > Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, = so that users can > remove the old pkg_* tools without removing the pkgng boostrap This broke the build for 2 reasons: 1. You misspelled the option in usr.sbin/Makefile 2. You don't have the option in share/mk/bsd.own.mk Can you fix is soon or do you want me to fix it? --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:32: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 A280C1065799; Mon, 2 Jul 2012 16:32:47 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5108FC18; Mon, 2 Jul 2012 16:32:47 +0000 (UTC) Received: from sa-nc-common-101.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q62GWc3Y005021 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jul 2012 09:32:45 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201207021528.q62FSoot078093@svn.freebsd.org> Date: Mon, 2 Jul 2012 09:32:43 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <2B78C1CB-FC64-4C78-94D1-B01F02C02D2D@xcllnt.net> References: <201207021528.q62FSoot078093@svn.freebsd.org> To: Baptiste Daroussin , Dag-Erling Sm?rgrav 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: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 16:32:47 -0000 On Jul 2, 2012, at 8:28 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Jul 2 15:28:50 2012 > New Revision: 237997 > URL: http://svn.freebsd.org/changeset/base/237997 >=20 > Log: > New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of = usr.sbin/pkg > Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, = so that users can > remove the old pkg_* tools without removing the pkgng boostrap Oh, and: > Added: head/tools/build/options/WITHOUT_PKGBOOSTRAP You have a typo in the options filename as well. With all those mistakes and typos, I cannot escape the notion that this = is a rushed commit or at least that it didn't get the attention it should = have gotten. Worse, it wasn't caught by your mentor. des: please give reviews more attention bapt: it sometimes helps to review your own patches as if they weren't = yours. you won't catch as much as a real 3rd party would, because they = are still your patches and you're bound to overlook stuff, but at = least you may catch some of the boneheaded stuff. HTH, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:33: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 AC48D1065675; Mon, 2 Jul 2012 16:33:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF1C8FC12; Mon, 2 Jul 2012 16:33:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q62GXtlo065050; Mon, 2 Jul 2012 16:33:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q62GXtID065049; Mon, 2 Jul 2012 16:33:55 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Mon, 2 Jul 2012 16:33:52 +0000 From: Baptiste Daroussin To: Marcel Moolenaar Message-ID: <20120702163351.GC37018@ithaqua.etoilebsd.net> References: <201207021528.q62FSoot078093@svn.freebsd.org> <20CFC0F6-1EF9-4F01-881D-78B8E2811AD0@xcllnt.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/e2eDi0V/xtL+Mc8" Content-Disposition: inline In-Reply-To: <20CFC0F6-1EF9-4F01-881D-78B8E2811AD0@xcllnt.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Dag-Erling Sm?rgrav , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 16:33:55 -0000 --/e2eDi0V/xtL+Mc8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 02, 2012 at 09:24:56AM -0700, Marcel Moolenaar wrote: >=20 > On Jul 2, 2012, at 8:28 AM, Baptiste Daroussin wrote: >=20 > > Author: bapt > > Date: Mon Jul 2 15:28:50 2012 > > New Revision: 237997 > > URL: http://svn.freebsd.org/changeset/base/237997 > >=20 > > Log: > > New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of usr.sbin= /pkg > > Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, so= that users can > > remove the old pkg_* tools without removing the pkgng boostrap >=20 > This broke the build for 2 reasons: > 1. You misspelled the option in usr.sbin/Makefile > 2. You don't have the option in share/mk/bsd.own.mk >=20 > Can you fix is soon or do you want me to fix it? >=20 > --=20 > Marcel Moolenaar > marcel@xcllnt.net >=20 >=20 Arg sorry, can you fix it please, I'm about to be afk. regards, Bapt --/e2eDi0V/xtL+Mc8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/xzW8ACgkQ8kTtMUmk6EzWUwCaAuT21Bo6NtgopqN3IE5/MrxB pWwAn3+9JsBli+b1REW2orAz8RU7Luyy =Xc7U -----END PGP SIGNATURE----- --/e2eDi0V/xtL+Mc8-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:40: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 A3F7B106564A; Mon, 2 Jul 2012 16:40:11 +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 90D608FC16; Mon, 2 Jul 2012 16:40:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62GeB0r081948; Mon, 2 Jul 2012 16:40:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62GeB49081946; Mon, 2 Jul 2012 16:40:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207021640.q62GeB49081946@svn.freebsd.org> From: Michael Tuexen Date: Mon, 2 Jul 2012 16:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238002 - 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: Mon, 02 Jul 2012 16:40:11 -0000 Author: tuexen Date: Mon Jul 2 16:40:11 2012 New Revision: 238002 URL: http://svn.freebsd.org/changeset/base/238002 Log: Remove dead code (on FreeBSD) as suggested by glebius@. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Jul 2 16:24:43 2012 (r238001) +++ head/sys/netinet/sctp_output.c Mon Jul 2 16:40:11 2012 (r238002) @@ -10811,7 +10811,6 @@ sctp_send_resp_msg(struct sockaddr *src, int len, cause_len, padding_len, ret; #ifdef INET - sctp_route_t ro; struct sockaddr_in *src_sin, *dst_sin; struct ip *ip; @@ -10979,8 +10978,6 @@ sctp_send_resp_msg(struct sockaddr *src, SCTP_ATTACH_CHAIN(o_pak, mout, len); #ifdef INET if (ip != NULL) { - /* zap the stack pointer to the route */ - bzero(&ro, sizeof(sctp_route_t)); if (port) { if (V_udp_cksum) { udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); @@ -11013,11 +11010,7 @@ sctp_send_resp_msg(struct sockaddr *src, sctp_packet_log(o_pak); } #endif - SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - /* Free the route if we got one back */ - if (ro.ro_rt) { - RTFREE(ro.ro_rt); - } + SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); } #endif #ifdef INET6 From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:42: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 8F19A1065670; Mon, 2 Jul 2012 16:42:34 +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 497C08FC18; Mon, 2 Jul 2012 16:42:34 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so8460585pbb.13 for ; Mon, 02 Jul 2012 09:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=ycvlWI19ysmYFiZHIoSDM5TKWqsr8sJV/nHTyPCJzFU=; b=nTAVUwO+f98M5jh4C3rQIbTKw4SarLoW5M1vHPjsJC9QWRA43hhNbnz3p+JxOVTKBD TZg+jkOnz5SFI1aVOck3R80skJMB92hpYmcG62Cum5npPyKJFfu2CXqf/d9KmLiVG0Lc xD+GP6z73s4qbR4Z9FO22Q8wE4F9cAmg//Mwz2Qs3qpJ4pghI6nkD2zWh3GUGk1IEW6q TTAAc+pf0XvccskwrwS4v596Z3KkK6w8a/o2eY6c6uw0hTpsbZZ2USXrRcYAGLbmRiBz WC+HDcmKGe0Hdf9nKnrlEPOXZ4AoKxkrzDQOxoH9yWSYIUi1lK3NdWJ/yJ5Aau/yheYK QujQ== Received: by 10.68.213.7 with SMTP id no7mr30592079pbc.3.1341247354074; Mon, 02 Jul 2012 09:42:34 -0700 (PDT) Received: from [10.71.80.97] (mobile-166-147-095-114.mycingular.net. [166.147.95.114]) by mx.google.com with ESMTPS id ot4sm13339516pbb.65.2012.07.02.09.42.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Jul 2012 09:42:33 -0700 (PDT) References: <201207021528.q62FSoot078093@svn.freebsd.org> <2B78C1CB-FC64-4C78-94D1-B01F02C02D2D@xcllnt.net> In-Reply-To: <2B78C1CB-FC64-4C78-94D1-B01F02C02D2D@xcllnt.net> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <5D283E88-BB45-4188-9EC4-7301A6232D01@gmail.com> X-Mailer: iPhone Mail (9B206) From: Garrett Cooper Date: Mon, 2 Jul 2012 09:42:24 -0700 To: Marcel Moolenaar Cc: "svn-src-head@FreeBSD.org" , Dag-Erling Sm?rgrav , Baptiste Daroussin , "src-committers@FreeBSD.org" , "svn-src-all@FreeBSD.org" Subject: Re: svn commit: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 16:42:34 -0000 On Jul 2, 2012, at 9:32 AM, Marcel Moolenaar wrote: >=20 > On Jul 2, 2012, at 8:28 AM, Baptiste Daroussin wrote: >=20 >> Author: bapt >> Date: Mon Jul 2 15:28:50 2012 >> New Revision: 237997 >> URL: http://svn.freebsd.org/changeset/base/237997 >>=20 >> Log: >> New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of usr.sbin/pk= g >> Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, so th= at users can >> remove the old pkg_* tools without removing the pkgng boostrap >=20 > Oh, and: >=20 >> Added: head/tools/build/options/WITHOUT_PKGBOOSTRAP >=20 > You have a typo in the options filename as well. >=20 > With all those mistakes and typos, I cannot escape the notion that this is= a > rushed commit or at least that it didn't get the attention it should have > gotten. Worse, it wasn't caught by your mentor. >=20 > des: please give reviews more attention > bapt: it sometimes helps to review your own patches as if they weren't you= rs. > you won't catch as much as a real 3rd party would, because they are > still your patches and you're bound to overlook stuff, but at least > you may catch some of the boneheaded stuff. The other thing is that src.conf(5) wasn't regenerated after the commit (the= knob and the src.conf commit should be done separately to as src.conf gener= ation is driven by $Revision$ in the knob file. Thanks, -Garrett= From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:44: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 58BEC106566C; Mon, 2 Jul 2012 16:44:10 +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 3B5C38FC1E; Mon, 2 Jul 2012 16:44: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 q62GiAXF082147; Mon, 2 Jul 2012 16:44:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62GiAtH082142; Mon, 2 Jul 2012 16:44:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207021644.q62GiAtH082142@svn.freebsd.org> From: Michael Tuexen Date: Mon, 2 Jul 2012 16:44: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: r238003 - in head/sys: netinet netinet6 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, 02 Jul 2012 16:44:10 -0000 Author: tuexen Date: Mon Jul 2 16:44:09 2012 New Revision: 238003 URL: http://svn.freebsd.org/changeset/base/238003 Log: Move common code parts to sctp_common_input_processing(). MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Jul 2 16:40:11 2012 (r238002) +++ head/sys/netinet/sctp_input.c Mon Jul 2 16:44:09 2012 (r238003) @@ -5590,26 +5590,141 @@ void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, - struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, uint8_t ecn_bits, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t compute_crc, +#endif + uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { - /* - * Control chunk processing - */ uint32_t high_tsn; int fwd_tsn_seen = 0, data_processed = 0; struct mbuf *m = *mm; int un_sent; int cnt_ctrl_ready = 0; + struct sctp_inpcb *inp, *inp_decr = NULL; + struct sctp_tcb *stcb = NULL; + struct sctp_nets *net; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xE0, 1); sctp_auditing(0, inp, stcb, net); #endif +#if !defined(SCTP_WITH_NO_CSUM) + if (compute_crc != 0) { + uint32_t check, calc_check; + check = sh->checksum; + sh->checksum = 0; + calc_check = sctp_calculate_cksum(m, iphlen); + 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); + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if ((inp != NULL) && (stcb != NULL)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { + inp_decr = inp; + } + SCTP_STAT_INCR(sctps_badsum); + SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); + goto out; + } + } +#endif + /* Destination port of 0 is illegal, based on RFC4960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if (inp == NULL) { + SCTP_STAT_INCR(sctps_noport); + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) { + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { + sctp_send_shutdown_complete2(src, dst, sh, + use_mflowid, mflowid, + vrf_id, port); + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { + goto out; + } + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, src, dst, + sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); + } + } + goto out; + } else if (stcb == NULL) { + inp_decr = inp; + } +#ifdef IPSEC + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. + */ + if (inp != NULL) { + switch (dst->sa_family) { +#ifdef INET + case AF_INET: + if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec4stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif + default: + break; + } + } +#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); if (stcb) { @@ -5628,10 +5743,11 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); + stcb = NULL; sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } } if (IS_SCTP_CONTROL(ch)) { @@ -5671,21 +5787,19 @@ sctp_common_input_processing(struct mbuf sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { /* v_tag mismatch! */ SCTP_STAT_INCR(sctps_badvtag); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } } @@ -5695,7 +5809,7 @@ sctp_common_input_processing(struct mbuf * packet while processing control, or we're done with this * packet (done or skip rest of data), so we drop it... */ - goto out_now; + goto out; } /* * DATA chunk processing @@ -5749,8 +5863,7 @@ sctp_common_input_processing(struct mbuf sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_EMPTY: /* should not happen */ @@ -5758,8 +5871,7 @@ sctp_common_input_processing(struct mbuf case SCTP_STATE_SHUTDOWN_RECEIVED: /* This is a peer error */ case SCTP_STATE_SHUTDOWN_ACK_SENT: default: - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_OPEN: @@ -5777,7 +5889,8 @@ sctp_common_input_processing(struct mbuf * The association aborted, NO UNLOCK needed since * the association is destroyed. */ - goto out_now; + stcb = NULL; + goto out; } data_processed = 1; /* @@ -5834,10 +5947,20 @@ trigger_send: sctp_audit_log(0xE0, 3); sctp_auditing(2, inp, stcb, net); #endif - SCTP_TCB_UNLOCK(stcb); -out_now: +out: + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (inp_decr != NULL) { + /* reduce ref-count */ + SCTP_INP_WLOCK(inp_decr); + SCTP_INP_DECR_REF(inp_decr); + SCTP_INP_WUNLOCK(inp_decr); + } #ifdef INVARIANTS - sctp_validate_no_locks(inp); + if (inp != NULL) { + sctp_validate_no_locks(inp); + } #endif return; } @@ -5867,18 +5990,14 @@ sctp_input_with_port(struct mbuf *i_pak, struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { @@ -5903,6 +6022,11 @@ sctp_input_with_port(struct mbuf *i_pak, sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -5936,161 +6060,42 @@ sctp_input_with_port(struct mbuf *i_pak, dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { - goto bad; + goto out; } if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ip->ip_tos; #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - 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); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec4_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec4stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return; -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } Modified: head/sys/netinet/sctp_input.h ============================================================================== --- head/sys/netinet/sctp_input.h Mon Jul 2 16:40:11 2012 (r238002) +++ head/sys/netinet/sctp_input.h Mon Jul 2 16:44:09 2012 (r238003) @@ -41,8 +41,10 @@ void sctp_common_input_processing(struct mbuf **, int, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, - struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint8_t, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t, +#endif + uint8_t, uint8_t, uint32_t, uint32_t, uint16_t); Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Mon Jul 2 16:40:11 2012 (r238002) +++ head/sys/netinet6/sctp6_usrreq.c Mon Jul 2 16:44:09 2012 (r238003) @@ -69,24 +69,20 @@ sctp6_input(struct mbuf **i_pak, int *of { struct mbuf *m; int iphlen; - uint32_t vrf_id = 0; + uint32_t vrf_id; uint8_t ecn_bits; struct sockaddr_in6 src, dst; struct ip6_hdr *ip6; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; uint16_t port = 0; iphlen = *offp; @@ -112,6 +108,11 @@ sctp6_input(struct mbuf **i_pak, int *of sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -122,8 +123,8 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip6 = mtod(m, struct ip6_hdr *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { @@ -138,7 +139,7 @@ sctp6_input(struct mbuf **i_pak, int *of src.sin6_port = sh->src_port; src.sin6_addr = ip6->ip6_src; if (in6_setscope(&src.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } memset(&dst, 0, sizeof(struct sockaddr_in6)); dst.sin6_family = AF_INET6; @@ -146,165 +147,46 @@ sctp6_input(struct mbuf **i_pak, int *of dst.sin6_port = sh->dest_port; dst.sin6_addr = ip6->ip6_dst; if (in6_setscope(&dst.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } if (faithprefix_p != NULL && (*faithprefix_p) (&dst.sin6_addr)) { /* XXX send icmp6 host/port unreach? */ - goto bad; + goto out; } length = ntohs(ip6->ip6_plen) + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(*i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - 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); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec6stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return (IPPROTO_DONE); -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:49:24 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 AA478106566C; Mon, 2 Jul 2012 16:49:24 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 85FCB8FC0C; Mon, 2 Jul 2012 16:49:24 +0000 (UTC) Received: from sa-nc-common-101.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q62GnIkD005112 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jul 2012 09:49:22 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120702163351.GC37018@ithaqua.etoilebsd.net> Date: Mon, 2 Jul 2012 09:49:22 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201207021528.q62FSoot078093@svn.freebsd.org> <20CFC0F6-1EF9-4F01-881D-78B8E2811AD0@xcllnt.net> <20120702163351.GC37018@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, Dag-Erling Sm?rgrav , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 16:49:24 -0000 On Jul 2, 2012, at 9:33 AM, Baptiste Daroussin wrote: > On Mon, Jul 02, 2012 at 09:24:56AM -0700, Marcel Moolenaar wrote: >>=20 >> On Jul 2, 2012, at 8:28 AM, Baptiste Daroussin wrote: >>=20 >>> Author: bapt >>> Date: Mon Jul 2 15:28:50 2012 >>> New Revision: 237997 >>> URL: http://svn.freebsd.org/changeset/base/237997 >>>=20 >>> Log: >>> New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of = usr.sbin/pkg >>> Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, = so that users can >>> remove the old pkg_* tools without removing the pkgng boostrap >>=20 >> This broke the build for 2 reasons: >> 1. You misspelled the option in usr.sbin/Makefile >> 2. You don't have the option in share/mk/bsd.own.mk >>=20 >> Can you fix is soon or do you want me to fix it? >>=20 >> --=20 >> Marcel Moolenaar >> marcel@xcllnt.net >>=20 >>=20 >=20 > Arg sorry, can you fix it please, I'm about to be afk. Will do. Next time, please don't commit stuff right before going away. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:57: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 36B20106564A; Mon, 2 Jul 2012 16:57:14 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22E638FC14; Mon, 2 Jul 2012 16:57: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 q62GvDxn082720; Mon, 2 Jul 2012 16:57:13 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62GvD7j082717; Mon, 2 Jul 2012 16:57:13 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201207021657.q62GvD7j082717@svn.freebsd.org> From: Sean Bruno Date: Mon, 2 Jul 2012 16:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238004 - in head: etc/rc.d sys/dev/acpica 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, 02 Jul 2012 16:57:14 -0000 Author: sbruno Date: Mon Jul 2 16:57:13 2012 New Revision: 238004 URL: http://svn.freebsd.org/changeset/base/238004 Log: Cosmetic display change of Cx states via cx_supported sysctl entries. Adjust power_profile script to handle the new world order as well. Some vendors are opting out of a C2 state and only defining C1 & C3. This leads the acpi_cpu display to indicate that the machine supports C1 & C2 which is caused by the (mis)use of the index of the cx_state array as the ACPI_STATE_CX value. e.g. the code was pretending that cx_state[i] would always convert to i by subtracting 1. cx_state[2] == ACPI_STATE_C3 cx_state[1] == ACPI_STATE_C2 cx_state[0] == ACPI_STATE_C1 however, on certain machines this would lead to cx_state[1] == ACPI_STATE_C3 cx_state[0] == ACPI_STATE_C1 This didn't break anything but led to a display of: * dev.cpu.0.cx_supported: C1/1 C2/96 Instead of * dev.cpu.0.cx_supported: C1/1 C3/96 MFC after: 2 weeks Modified: head/etc/rc.d/power_profile head/sys/dev/acpica/acpi_cpu.c Modified: head/etc/rc.d/power_profile ============================================================================== --- head/etc/rc.d/power_profile Mon Jul 2 16:44:09 2012 (r238003) +++ head/etc/rc.d/power_profile Mon Jul 2 16:57:13 2012 (r238004) @@ -90,7 +90,7 @@ node="dev.cpu.0.freq" highest_value="`(sysctl -n dev.cpu.0.freq_levels | \ awk '{ split($0, a, "[/ ]"); print a[1] }' -) 2> /dev/null`" lowest_value="`(sysctl -n dev.cpu.0.freq_levels | \ - awk '{ split($0, a, "[/ ]"); print a[length(a) - 1] }' -) 2> /dev/null`" + awk '{ split($0, a, "[ /]"); print a[length(a) - 1] }' -) 2> /dev/null`" eval value=\$${profile}_cpu_freq sysctl_set Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Mon Jul 2 16:44:09 2012 (r238003) +++ head/sys/dev/acpica/acpi_cpu.c Mon Jul 2 16:57:13 2012 (r238004) @@ -88,7 +88,7 @@ struct acpi_cpu_softc { /* Values for sysctl. */ struct sysctl_ctx_list cpu_sysctl_ctx; struct sysctl_oid *cpu_sysctl_tree; - int cpu_cx_lowest; + int cpu_cx_lowest; /* Index of lowest Cx state in cpu_cx_states[] */ char cpu_cx_supported[64]; int cpu_rid; }; @@ -144,7 +144,8 @@ static int cpu_cx_count; /* Number of static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; static int cpu_cx_generic; -static int cpu_cx_lowest; +/* Lowest valid Cstate for all cpus -- Cx */ +static int global_lowest_cstate; static device_t *cpu_devices; static int cpu_ndevices; @@ -871,7 +872,7 @@ acpi_cpu_startup(void *arg) "Global lowest Cx sleep state to use"); /* Take over idling from cpu_idle_default(). */ - cpu_cx_lowest = 0; + global_lowest_cstate = 0; cpu_disable_idle = FALSE; cpu_idle_hook = acpi_cpu_idle; } @@ -889,7 +890,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); for (i = 0; i < sc->cpu_cx_count; i++) { - sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); + sbuf_printf(&sb, "C%d/%d ", sc->cpu_cx_states[i].type, + sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; else @@ -963,9 +965,10 @@ acpi_cpu_idle() /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; - if (cpu_disable_deep_sleep) + if (cpu_disable_deep_sleep) { + /* Chose the lowest valid index in the cpu_cx_states array */ i = min(sc->cpu_cx_lowest, sc->cpu_non_c3); - else + } else i = sc->cpu_cx_lowest; for (; i >= 0; i--) { if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) { @@ -1080,8 +1083,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no if (isc->cpu_cx_count > cpu_cx_count) cpu_cx_count = isc->cpu_cx_count; } - if (sc->cpu_cx_lowest < cpu_cx_lowest) - acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); + if (sc->cpu_cx_lowest < global_lowest_cstate) + acpi_cpu_set_cx_lowest(sc, sc->cpu_cx_states[sc->cpu_cx_lowest].type); ACPI_SERIAL_END(cpu); } @@ -1208,13 +1211,31 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG return (0); } +/* + * val is the ACPI_STATE_CX enum request by the caller + */ static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val) { int i; ACPI_SERIAL_ASSERT(cpu); - sc->cpu_cx_lowest = val; + /* + * scan list of valid cstates. if we do no + * find a match to the requested val, return + * EINVAL + * once we match, set cpu_cx_lowest to the found + * index i + */ + for (i = 0; i < sc->cpu_cx_count; i++) { + if (sc->cpu_cx_states[i].type == val) { + sc->cpu_cx_lowest = i; + break; + } + } + if (i == sc->cpu_cx_count) + return (EINVAL); + /* If not disabling, cache the new lowest non-C3 state. */ sc->cpu_non_c3 = 0; @@ -1238,21 +1259,22 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER int val, error; sc = (struct acpi_cpu_softc *) arg1; - snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", + sc->cpu_cx_states[sc->cpu_cx_lowest].type); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > sc->cpu_cx_count - 1) + val = (int) strtol(state + 1, NULL, 10); + if (val < 0 || val > MAX_CX_STATES) return (EINVAL); ACPI_SERIAL_BEGIN(cpu); - acpi_cpu_set_cx_lowest(sc, val); + error = acpi_cpu_set_cx_lowest(sc, val); ACPI_SERIAL_END(cpu); - return (0); + return (error); } static int @@ -1262,24 +1284,28 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ char state[8]; int val, error, i; - snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", global_lowest_cstate); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > cpu_cx_count - 1) + val = (int) strtol(state + 1, NULL, 10); + if (val < 0 || val > MAX_CX_STATES) return (EINVAL); - cpu_cx_lowest = val; /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); + error = acpi_cpu_set_cx_lowest(sc, val); + if (error) { + ACPI_SERIAL_END(cpu); + return(error); + } } ACPI_SERIAL_END(cpu); + global_lowest_cstate = val; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 16:47: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 C7C85106564A; Mon, 2 Jul 2012 16:47:31 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0778FC14; Mon, 2 Jul 2012 16:47:31 +0000 (UTC) Received: from sa-nc-common-101.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q62GlMaj005108 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jul 2012 09:47:30 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: multipart/mixed; boundary="Apple-Mail=_074765FA-A8EC-435F-BBA2-37458D24AF08" From: Marcel Moolenaar In-Reply-To: <370956AA-D028-4C44-B808-3160F0193069@bsdimp.com> Date: Mon, 2 Jul 2012 09:47:26 -0700 Message-Id: References: <201207010656.q616ufcY071880@svn.freebsd.org> <370956AA-D028-4C44-B808-3160F0193069@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1278) X-Mailman-Approved-At: Mon, 02 Jul 2012 17:01:46 +0000 Cc: arm@freebsd.org, Warner Losh Subject: Re: svn commit: r237883 - in head/sys/arm: at91 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: Mon, 02 Jul 2012 16:47:31 -0000 --Apple-Mail=_074765FA-A8EC-435F-BBA2-37458D24AF08 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jul 1, 2012, at 2:41 PM, Warner Losh wrote: >=20 >> I can port that to FreeBSD. Shall I make some patches for people >> to look at? >=20 > Sure. I'd love to see it. I'd be happy to preview any partial work = if you want early feedbac. See attached. It's fully functional and in production @Juniper. I hope = the last sync with FreeBSD didn't break anything. The change to sys/arm/include/cpufunc.h is needed to avoid a name class in cxgdb(4). That driver defines a structure field called intr_disable, which under ARM is renamed due to intr_disable being a macro. Turning it into an inline-function resulted in undefined symbols for I32_bit and F32_bit. Since those names are pretty bad to begin with, I added ARM_CPSR_I32 and ARM_CPSR_F32. BTW: we may be able to fix the duplicate symbol problem by using weak = symbols. For example, we have 10 definitions of "initarm". We can make them = unique, by renaming the functions and add a weak alias called "initarm". E.g, in sys/arm/mv/mv_machdep.c, rename initarm to mv_initarm() and add a weak alias for mv_initarm called initarm. When building for Marvell SoCs, initarm will resolve to mv_initarm. When building LINT, we only have to provide a non-weak dummy definition for initarm (and all the others that follow the same model) and we're good = to go. Maybe the dummy function could be used as a trampoline even that = resolves at runtime which of the SoC-specific initarm functions is to be called based on the SoC Id? --=20 Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_074765FA-A8EC-435F-BBA2-37458D24AF08 Content-Disposition: attachment; filename=arm.diff Content-Type: application/octet-stream; name="arm.diff" Content-Transfer-Encoding: 7bit Index: sys/arm/arm/cpufunc.c =================================================================== --- sys/arm/arm/cpufunc.c (revision 238362) +++ sys/arm/arm/cpufunc.c (working copy) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(CPU_XSCALE_81342) +#if defined(CPU_XSCALE_81342) && !defined(CPU_XSCALE_80321) #include #endif Index: sys/arm/conf/Makefile =================================================================== --- sys/arm/conf/Makefile (revision 0) +++ sys/arm/conf/Makefile (revision 0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +TARGET=arm + +.include "${.CURDIR}/../../conf/makeLINT.mk" Index: sys/arm/conf/NOTES =================================================================== --- sys/arm/conf/NOTES (revision 0) +++ sys/arm/conf/NOTES (revision 0) @@ -0,0 +1,85 @@ +# $FreeBSD$ + +cpu CPU_ARM9 +cpu CPU_ARM9E +cpu CPU_FA526 +cpu CPU_SA1100 +cpu CPU_SA1110 +cpu CPU_XSCALE_80219 +cpu CPU_XSCALE_80321 +cpu CPU_XSCALE_81342 +cpu CPU_XSCALE_IXP425 +cpu CPU_XSCALE_IXP435 +cpu CPU_XSCALE_PXA2X0 + +files "../at91/files.at91" +files "../at91/files.at91sam9" +files "../econa/files.econa" +files "../mv/files.mv" +files "../mv/discovery/files.db78xxx" +files "../mv/kirkwood/files.kirkwood" +files "../mv/kirkwood/files.sheevaplug" +files "../mv/orion/files.db88f5xxx" +files "../mv/orion/files.ts7800" +files "../s3c2xx0/files.s3c2xx0" +files "../sa11x0/files.sa11x0" +files "../xscale/i80321/files.ep80219" +files "../xscale/i80321/files.i80219" +files "../xscale/i80321/files.i80321" +files "../xscale/i80321/files.iq31244" +files "../xscale/i8134x/files.crb" +files "../xscale/i8134x/files.i81342" +files "../xscale/ixp425/files.avila" +files "../xscale/ixp425/files.ixp425" +files "../xscale/pxa/files.pxa" + +options PHYSADDR=0x00000000 +options KERNPHYSADDR=0x00000000 +options KERNVIRTADDR=0xc0000000 + +makeoptions LDFLAGS="-zmuldefs" +makeoptions KERNPHYSADDR=0x00000000 +makeoptions KERNVIRTADDR=0xc0000000 + +options FDT + +options SOC_MV_DISCOVERY +options SOC_MV_KIRKWOOD +options SOC_MV_ORION + +device pci + +device at91_board_bwct +device at91_board_hl200 +device at91_board_hl201 +device at91_board_kb920x +device at91_board_qila9g20 +device at91_board_sam9g20ek +device at91_board_tsc4370 +device board_ln2410sbc + +nooptions SMP +nooptions MAXCPU + +nooptions COMPAT_FREEBSD4 + +nodevice fdc +nodevice sym +nodevice ukbd + +nodevice sc +nodevice blank_saver +nodevice daemon_saver +nodevice dragon_saver +nodevice fade_saver +nodevice fire_saver +nodevice green_saver +nodevice logo_saver +nodevice rain_saver +nodevice snake_saver +nodevice star_saver +nodevice warp_saver + +nodevice pcii +nodevice snd_cmi +nodevice tnt4882 Index: sys/arm/include/cpufunc.h =================================================================== --- sys/arm/include/cpufunc.h (revision 238362) +++ sys/arm/include/cpufunc.h (working copy) @@ -579,20 +579,36 @@ __set_cpsr_c(u_int bic, u_int eor) return ret; } +#define ARM_CPSR_F32 (1 << 6) /* FIQ disable */ +#define ARM_CPSR_I32 (1 << 7) /* IRQ disable */ + #define disable_interrupts(mask) \ - (__set_cpsr_c((mask) & (I32_bit | F32_bit), \ - (mask) & (I32_bit | F32_bit))) + (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), \ + (mask) & (ARM_CPSR_I32 | ARM_CPSR_F32))) #define enable_interrupts(mask) \ - (__set_cpsr_c((mask) & (I32_bit | F32_bit), 0)) + (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), 0)) #define restore_interrupts(old_cpsr) \ - (__set_cpsr_c((I32_bit | F32_bit), (old_cpsr) & (I32_bit | F32_bit))) + (__set_cpsr_c((ARM_CPSR_I32 | ARM_CPSR_F32), \ + (old_cpsr) & (ARM_CPSR_I32 | ARM_CPSR_F32))) -#define intr_disable() \ - disable_interrupts(I32_bit | F32_bit) -#define intr_restore(s) \ - restore_interrupts(s) +static __inline register_t +intr_disable(void) +{ + register_t s; + + s = disable_interrupts(ARM_CPSR_I32 | ARM_CPSR_F32); + return (s); +} + +static __inline void +intr_restore(register_t s) +{ + + restore_interrupts(s); +} + /* Functions to manipulate the CPSR. */ u_int SetCPSR(u_int bic, u_int eor); u_int GetCPSR(void); Index: sys/arm/mv/mvreg.h =================================================================== --- sys/arm/mv/mvreg.h (revision 238362) +++ sys/arm/mv/mvreg.h (working copy) @@ -294,11 +294,10 @@ #define SAMPLE_AT_RESET 0x10 #elif defined(SOC_MV_KIRKWOOD) #define SAMPLE_AT_RESET 0x30 -#elif defined(SOC_MV_DISCOVERY) +#endif +#if defined(SOC_MV_DISCOVERY) #define SAMPLE_AT_RESET_LO 0x30 #define SAMPLE_AT_RESET_HI 0x34 -#else -#error SOC_MV_XX not defined #endif /* Index: sys/arm/mv/mvwin.h =================================================================== --- sys/arm/mv/mvwin.h (revision 238362) +++ sys/arm/mv/mvwin.h (working copy) @@ -173,6 +173,8 @@ #define MV_WIN_PCIE_MEM_ATTR 0x59 #define MV_WIN_PCIE_IO_TARGET 4 #define MV_WIN_PCIE_IO_ATTR 0x51 +#endif +#if defined(SOC_MV_ORION) #define MV_WIN_PCI_MEM_TARGET 3 #define MV_WIN_PCI_MEM_ATTR 0x59 #define MV_WIN_PCI_IO_TARGET 3 --Apple-Mail=_074765FA-A8EC-435F-BBA2-37458D24AF08-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 17:11: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 AF3F21065674; Mon, 2 Jul 2012 17:11:14 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A3A178FC08; Mon, 2 Jul 2012 17:11:13 +0000 (UTC) Received: by bkcje9 with SMTP id je9so406135bkc.13 for ; Mon, 02 Jul 2012 10:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Y7X8KJF+fT+LtsiPPXjoeoQ+G78gcdeKBMLxvBTGJKM=; b=TJE+bVXdIetGedVs0hUlC3rY6l3rPKENdnL5pnB4TD6wuRSzR/IC6YEd0tthS+ThYp CtCrVfjehP+LkvuqJWCFRm8WUDa0zzBhnXf36VDpT1SztO1ioJ0O5qLO8EGj129pniXp y/VOXR5KVtAfqia/vPu2U2TKRL4zETKsPjW85Wev9VEWJx7k9VJoBZj0MShlwVR0BcPQ Q8HaJdgiTeAP2PrCPvhOPu2t0Y5Xq61cQNznYke0maPcZhoeJMpZM2WgD+zo82AhzaJ0 +73EJLWpoSFLQz3J0D3tvKwgA+ulHS7HTebHNXjf3yRQ5N9BsHk5N0Aw6ifHqL+Wf6A/ QAhQ== Received: by 10.204.152.13 with SMTP id e13mr8118889bkw.46.1341249072425; Mon, 02 Jul 2012 10:11:12 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id e20sm14357984bkv.10.2012.07.02.10.11.10 (version=SSLv3 cipher=OTHER); Mon, 02 Jul 2012 10:11:11 -0700 (PDT) Sender: Alexander Motin Message-ID: <4FF1D62C.2090705@FreeBSD.org> Date: Mon, 02 Jul 2012 20:11:08 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Sean Bruno References: <201207021657.q62GvD7j082717@svn.freebsd.org> In-Reply-To: <201207021657.q62GvD7j082717@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: r238004 - in head: etc/rc.d sys/dev/acpica 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, 02 Jul 2012 17:11:14 -0000 On 07/02/12 19:57, Sean Bruno wrote: > Author: sbruno > Date: Mon Jul 2 16:57:13 2012 > New Revision: 238004 > URL: http://svn.freebsd.org/changeset/base/238004 > > Log: > Cosmetic display change of Cx states via cx_supported sysctl entries. > > Adjust power_profile script to handle the new world order as well. > > Some vendors are opting out of a C2 state and only defining C1 & C3. This > leads the acpi_cpu display to indicate that the machine supports C1 & C2 > which is caused by the (mis)use of the index of the cx_state array as the > ACPI_STATE_CX value. > > e.g. the code was pretending that cx_state[i] would > always convert to i by subtracting 1. > > cx_state[2] == ACPI_STATE_C3 > cx_state[1] == ACPI_STATE_C2 > cx_state[0] == ACPI_STATE_C1 > > however, on certain machines this would lead to > cx_state[1] == ACPI_STATE_C3 > cx_state[0] == ACPI_STATE_C1 > > This didn't break anything but led to a display of: > * dev.cpu.0.cx_supported: C1/1 C2/96 > > Instead of > * dev.cpu.0.cx_supported: C1/1 C3/96 > > MFC after: 2 weeks If I remember correctly, ACPI spec directly specifies that there can be several C-states with the same type but with different enter method and exit latency. I have never seen any system with more then 3 C-states yet, but technically I think that is possible. Type field defines enter/exit semantics, respecting cache coherency and other things, so I think there can be more then one state with, for example, C3 semantics. Latest CPUs support states C1, C3 and C5, while ACPI AFAIK defines only three types and it may happen that both C3 and C5 have type-3 semantics. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 17:30: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 7E629106566B; Mon, 2 Jul 2012 17:30:49 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout1-b.corp.bf1.yahoo.com (mrout1-b.corp.bf1.yahoo.com [98.139.253.104]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8198FC0C; Mon, 2 Jul 2012 17:30:49 +0000 (UTC) Received: from [IPv6:::1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout1-b.corp.bf1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id q62HUR2I065092; Mon, 2 Jul 2012 10:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1341250228; bh=tZqyBLP6aSNfwzwYJi6cDTc6dUZPtWPkMIT4nYDQ/+Y=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=UJXIXur2F7mGnCx+LJlnaEjritJOtql2BJULb/KJrnjB87GSdmPvU3TVPtj33LatB RbHCkNado4sRT2ZkbfCnkUtduca2Q+7i3MYXyLwyTUIMgnn0eNwSooX5I8FdYWSL2I 9iFqLNIv35kJO72MrV98f/irBLWnMj3Ltg3C5yto= From: Sean Bruno To: Alexander Motin In-Reply-To: <4FF1D62C.2090705@FreeBSD.org> References: <201207021657.q62GvD7j082717@svn.freebsd.org> <4FF1D62C.2090705@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 02 Jul 2012 10:30:26 -0700 Message-ID: <1341250226.3342.6.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Milter-Version: master.31+4-gbc07cd5+ X-CLX-ID: 250227009 Cc: "svn-src-head@FreeBSD.org" , Sean Bruno , "src-committers@FreeBSD.org" , "svn-src-all@FreeBSD.org" Subject: Re: svn commit: r238004 - in head: etc/rc.d sys/dev/acpica 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, 02 Jul 2012 17:30:49 -0000 On Mon, 2012-07-02 at 10:11 -0700, Alexander Motin wrote: > > This didn't break anything but led to a display of: > > * dev.cpu.0.cx_supported: C1/1 C2/96 > > > > Instead of > > * dev.cpu.0.cx_supported: C1/1 C3/96 > > > > MFC after: 2 weeks > > If I remember correctly, ACPI spec directly specifies that there can > be > several C-states with the same type but with different enter method > and > exit latency. I have never seen any system with more then 3 C-states > yet, but technically I think that is possible. Type field defines > enter/exit semantics, respecting cache coherency and other things, so > I > think there can be more then one state with, for example, C3 > semantics. > Latest CPUs support states C1, C3 and C5, while ACPI AFAIK defines > only > three types and it may happen that both C3 and C5 have type-3 > semantics. > > >From my read of the current ACPI specs, there isn't anything past C3. However, Intel has definied Mwate Cstates that use the same nomenclature and confuse what people think Cstates are. Is this what you mean by "C5" sean From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 17:32:28 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 0BB09106566C; Mon, 2 Jul 2012 17:32:28 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout2-b.corp.bf1.yahoo.com (mrout2-b.corp.bf1.yahoo.com [98.139.253.105]) by mx1.freebsd.org (Postfix) with ESMTP id B7E8C8FC16; Mon, 2 Jul 2012 17:32:27 +0000 (UTC) Received: from [IPv6:::1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout2-b.corp.bf1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id q62HWDfh008325; Mon, 2 Jul 2012 10:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1341250335; bh=bP4WFVeL5hHxaq5HVFy94g+q2SrYD7hKO5pejsfpG64=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=T2HITV1JpgaTOrdQIVYZW8aR3lq3sXNGpAuZSc50IVOg6ZRMrXlIxFMB4ETPLybis lbEz+1UnmxZJmCAR058akTtbPs7Qz+QM8CILq6ZjYOfJWND6OFNdk40HJYW6f9ExiM bP2nh2l/o9GxReuCFjg1qS00NzzvAsAp9AMnJjQQ= From: Sean Bruno To: Sean Bruno In-Reply-To: <201207021657.q62GvD7j082717@svn.freebsd.org> References: <201207021657.q62GvD7j082717@svn.freebsd.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 02 Jul 2012 10:32:13 -0700 Message-ID: <1341250333.3342.7.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Milter-Version: master.31+4-gbc07cd5+ X-CLX-ID: 250334001 Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" Subject: Re: svn commit: r238004 - in head: etc/rc.d sys/dev/acpica 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, 02 Jul 2012 17:32:28 -0000 On Mon, 2012-07-02 at 09:57 -0700, Sean Bruno wrote: > Author: sbruno > Date: Mon Jul 2 16:57:13 2012 > New Revision: 238004 > URL: http://svn.freebsd.org/changeset/base/238004 revert in progress. There's more discussion to be had about this changeset. sean From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 17:41: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 151791065675; Mon, 2 Jul 2012 17:41:03 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 105F28FC26; Mon, 2 Jul 2012 17:41:01 +0000 (UTC) Received: by bkcje9 with SMTP id je9so435317bkc.13 for ; Mon, 02 Jul 2012 10:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Lx8nwU3DHuvDd+xiOmJ9pHtxhCuD+P14fuCydJr9afk=; b=wjxwQR94TqYlrtlsfoZDYtY3Cf80L9jvx6vx64R/hjpj/YbVN2s1kHzBycL8fAbE+G muCIkLL0FwXF9yc2VQwS/zBl0roqwyIm/QP9jONicHJz1Xah+rnu5sAuDXK2eCYTj8JE u/GMLDQsbS8AFk5pQx0JelTCRgo1jy4A/YSdgrD8jMSIRaEt8DA3LOf6EBKHLMMSDu6a eK6bnE7i8SnzXcWA1aD2KXC9v9X3uoGeCEjkaGN6PO4iL3EBKOwz4cgmUwP/IhV8dGbS 3mGA7E5WInKGoHOuz3c3tA/1sywr0wy6b92O01GOkAhzaQlUtxH72I5p3nEg545j5Ipy cv0g== Received: by 10.205.136.3 with SMTP id ii3mr7964686bkc.101.1341250861073; Mon, 02 Jul 2012 10:41:01 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id h18sm14439941bkh.8.2012.07.02.10.40.58 (version=SSLv3 cipher=OTHER); Mon, 02 Jul 2012 10:40:59 -0700 (PDT) Sender: Alexander Motin Message-ID: <4FF1DD29.1040003@FreeBSD.org> Date: Mon, 02 Jul 2012 20:40:57 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120621 Thunderbird/13.0.1 MIME-Version: 1.0 To: Sean Bruno References: <201207021657.q62GvD7j082717@svn.freebsd.org> <4FF1D62C.2090705@FreeBSD.org> <1341250226.3342.6.camel@powernoodle.corp.yahoo.com> In-Reply-To: <1341250226.3342.6.camel@powernoodle.corp.yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@FreeBSD.org" , Sean Bruno , "src-committers@FreeBSD.org" , "svn-src-all@FreeBSD.org" Subject: Re: svn commit: r238004 - in head: etc/rc.d sys/dev/acpica 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, 02 Jul 2012 17:41:03 -0000 On 07/02/12 20:30, Sean Bruno wrote: > On Mon, 2012-07-02 at 10:11 -0700, Alexander Motin wrote: >>> This didn't break anything but led to a display of: >>> * dev.cpu.0.cx_supported: C1/1 C2/96 >>> >>> Instead of >>> * dev.cpu.0.cx_supported: C1/1 C3/96 >>> >>> MFC after: 2 weeks >> >> If I remember correctly, ACPI spec directly specifies that there can >> be >> several C-states with the same type but with different enter method >> and >> exit latency. I have never seen any system with more then 3 C-states >> yet, but technically I think that is possible. Type field defines >> enter/exit semantics, respecting cache coherency and other things, so >> I >> think there can be more then one state with, for example, C3 >> semantics. >> Latest CPUs support states C1, C3 and C5, while ACPI AFAIK defines >> only >> three types and it may happen that both C3 and C5 have type-3 >> semantics. > > From my read of the current ACPI specs, there isn't anything past C3. Right. Because that type semantics is already quite strict to not need deeper. ACPI doesn't bother how CPU implements C3 and C5 and where it saves context. > However, Intel has definied Mwate Cstates that use the same nomenclature > and confuse what people think Cstates are. Is this what you mean by > "C5" Yes. ACPI C-states are not equal to CPU C-states and none of them are equal to ACPI types. I am not sure there is enough information to be more precise then we are now, unless we will hardcode it based on CPU IDs. ACPI spec allows BIOS to report how to enter state using MWAIT. In that case it would be possible to report it. But I haven't seen that used. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 17:52:43 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 F139B1065672; Mon, 2 Jul 2012 17:52:43 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF0468FC14; Mon, 2 Jul 2012 17:52: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 q62HqhTl085236; Mon, 2 Jul 2012 17:52:43 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62Hqhgc085234; Mon, 2 Jul 2012 17:52:43 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201207021752.q62Hqhgc085234@svn.freebsd.org> From: Warren Block Date: Mon, 2 Jul 2012 17:52: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: r238008 - head/share/man/man7 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, 02 Jul 2012 17:52:44 -0000 Author: wblock (doc committer) Date: Mon Jul 2 17:52:43 2012 New Revision: 238008 URL: http://svn.freebsd.org/changeset/base/238008 Log: Add reference to portsnap(8). Submitted by: Tim Kientzle MFC after: 1 day Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Mon Jul 2 17:48:19 2012 (r238007) +++ head/share/man/man7/build.7 Mon Jul 2 17:52:43 2012 (r238008) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2012 +.Dd July 2, 2012 .Dt BUILD 7 .Os .Sh NAME @@ -40,9 +40,10 @@ normally and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with -.Xr csup 1 +.Xr csup 1 , +.Xr svn 1 , or -.Xr svn 1 . +.Xr portsnap 8 . Directory .Pa /usr/src contains the @@ -608,6 +609,7 @@ make TARGET=sparc64 DESTDIR=/clients/spa .Xr release 7 , .Xr config 8 , .Xr mergemaster 8 , +.Xr portsnap 8 , .Xr reboot 8 , .Xr shutdown 8 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 17:55: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 87A58106566C; Mon, 2 Jul 2012 17:55:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 742AE8FC17; Mon, 2 Jul 2012 17:55: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 q62HtUTw085419; Mon, 2 Jul 2012 17:55:30 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62HtUfh085416; Mon, 2 Jul 2012 17:55:30 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201207021755.q62HtUfh085416@svn.freebsd.org> From: Sean Bruno Date: Mon, 2 Jul 2012 17:55: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: r238009 - in head: etc/rc.d sys/dev/acpica 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, 02 Jul 2012 17:55:30 -0000 Author: sbruno Date: Mon Jul 2 17:55:29 2012 New Revision: 238009 URL: http://svn.freebsd.org/changeset/base/238009 Log: Revert r238004 as more review has come in and there is now a discussion on how to best proceed. Modified: head/etc/rc.d/power_profile head/sys/dev/acpica/acpi_cpu.c Modified: head/etc/rc.d/power_profile ============================================================================== --- head/etc/rc.d/power_profile Mon Jul 2 17:52:43 2012 (r238008) +++ head/etc/rc.d/power_profile Mon Jul 2 17:55:29 2012 (r238009) @@ -90,7 +90,7 @@ node="dev.cpu.0.freq" highest_value="`(sysctl -n dev.cpu.0.freq_levels | \ awk '{ split($0, a, "[/ ]"); print a[1] }' -) 2> /dev/null`" lowest_value="`(sysctl -n dev.cpu.0.freq_levels | \ - awk '{ split($0, a, "[ /]"); print a[length(a) - 1] }' -) 2> /dev/null`" + awk '{ split($0, a, "[/ ]"); print a[length(a) - 1] }' -) 2> /dev/null`" eval value=\$${profile}_cpu_freq sysctl_set Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Mon Jul 2 17:52:43 2012 (r238008) +++ head/sys/dev/acpica/acpi_cpu.c Mon Jul 2 17:55:29 2012 (r238009) @@ -88,7 +88,7 @@ struct acpi_cpu_softc { /* Values for sysctl. */ struct sysctl_ctx_list cpu_sysctl_ctx; struct sysctl_oid *cpu_sysctl_tree; - int cpu_cx_lowest; /* Index of lowest Cx state in cpu_cx_states[] */ + int cpu_cx_lowest; char cpu_cx_supported[64]; int cpu_rid; }; @@ -144,8 +144,7 @@ static int cpu_cx_count; /* Number of static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; static int cpu_cx_generic; -/* Lowest valid Cstate for all cpus -- Cx */ -static int global_lowest_cstate; +static int cpu_cx_lowest; static device_t *cpu_devices; static int cpu_ndevices; @@ -872,7 +871,7 @@ acpi_cpu_startup(void *arg) "Global lowest Cx sleep state to use"); /* Take over idling from cpu_idle_default(). */ - global_lowest_cstate = 0; + cpu_cx_lowest = 0; cpu_disable_idle = FALSE; cpu_idle_hook = acpi_cpu_idle; } @@ -890,8 +889,7 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); for (i = 0; i < sc->cpu_cx_count; i++) { - sbuf_printf(&sb, "C%d/%d ", sc->cpu_cx_states[i].type, - sc->cpu_cx_states[i].trans_lat); + sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; else @@ -965,10 +963,9 @@ acpi_cpu_idle() /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; - if (cpu_disable_deep_sleep) { - /* Chose the lowest valid index in the cpu_cx_states array */ + if (cpu_disable_deep_sleep) i = min(sc->cpu_cx_lowest, sc->cpu_non_c3); - } else + else i = sc->cpu_cx_lowest; for (; i >= 0; i--) { if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) { @@ -1083,8 +1080,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no if (isc->cpu_cx_count > cpu_cx_count) cpu_cx_count = isc->cpu_cx_count; } - if (sc->cpu_cx_lowest < global_lowest_cstate) - acpi_cpu_set_cx_lowest(sc, sc->cpu_cx_states[sc->cpu_cx_lowest].type); + if (sc->cpu_cx_lowest < cpu_cx_lowest) + acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); ACPI_SERIAL_END(cpu); } @@ -1211,31 +1208,13 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG return (0); } -/* - * val is the ACPI_STATE_CX enum request by the caller - */ static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val) { int i; ACPI_SERIAL_ASSERT(cpu); - /* - * scan list of valid cstates. if we do no - * find a match to the requested val, return - * EINVAL - * once we match, set cpu_cx_lowest to the found - * index i - */ - for (i = 0; i < sc->cpu_cx_count; i++) { - if (sc->cpu_cx_states[i].type == val) { - sc->cpu_cx_lowest = i; - break; - } - } - if (i == sc->cpu_cx_count) - return (EINVAL); - + sc->cpu_cx_lowest = val; /* If not disabling, cache the new lowest non-C3 state. */ sc->cpu_non_c3 = 0; @@ -1259,22 +1238,21 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER int val, error; sc = (struct acpi_cpu_softc *) arg1; - snprintf(state, sizeof(state), "C%d", - sc->cpu_cx_states[sc->cpu_cx_lowest].type); + snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10); - if (val < 0 || val > MAX_CX_STATES) + val = (int) strtol(state + 1, NULL, 10) - 1; + if (val < 0 || val > sc->cpu_cx_count - 1) return (EINVAL); ACPI_SERIAL_BEGIN(cpu); - error = acpi_cpu_set_cx_lowest(sc, val); + acpi_cpu_set_cx_lowest(sc, val); ACPI_SERIAL_END(cpu); - return (error); + return (0); } static int @@ -1284,28 +1262,24 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ char state[8]; int val, error, i; - snprintf(state, sizeof(state), "C%d", global_lowest_cstate); + snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10); - if (val < 0 || val > MAX_CX_STATES) + val = (int) strtol(state + 1, NULL, 10) - 1; + if (val < 0 || val > cpu_cx_count - 1) return (EINVAL); + cpu_cx_lowest = val; /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - error = acpi_cpu_set_cx_lowest(sc, val); - if (error) { - ACPI_SERIAL_END(cpu); - return(error); - } + acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); } ACPI_SERIAL_END(cpu); - global_lowest_cstate = val; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 18:04: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 99F34106566B; Mon, 2 Jul 2012 18:04:31 +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 8730E8FC17; Mon, 2 Jul 2012 18:04: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 q62I4VJa085864; Mon, 2 Jul 2012 18:04:31 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62I4Vc9085861; Mon, 2 Jul 2012 18:04:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207021804.q62I4Vc9085861@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 2 Jul 2012 18:04: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: r238010 - in head: share/mk usr.sbin 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, 02 Jul 2012 18:04:31 -0000 Author: glebius Date: Mon Jul 2 18:04:31 2012 New Revision: 238010 URL: http://svn.freebsd.org/changeset/base/238010 Log: Fix build after r237997. Modified: head/share/mk/bsd.own.mk head/usr.sbin/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Jul 2 17:55:29 2012 (r238009) +++ head/share/mk/bsd.own.mk Mon Jul 2 18:04:31 2012 (r238010) @@ -385,6 +385,7 @@ __DEFAULT_YES_OPTIONS = \ OPENSSL \ PAM \ PF \ + PKGBOOTSTRAP \ PKGTOOLS \ PMC \ PORTSNAP \ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Jul 2 17:55:29 2012 (r238009) +++ head/usr.sbin/Makefile Mon Jul 2 18:04:31 2012 (r238010) @@ -259,7 +259,7 @@ SUBDIR+= keyserv SUBDIR+= ftp-proxy .endif -.if ${PK_PKGBOOTSTRAP} != "no" +.if ${MK_PKGBOOTSTRAP} != "no" SUBDIR+= pkg .endif From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 18:19: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 55A9D1065670; Mon, 2 Jul 2012 18:19:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id D0EAC8FC18; Mon, 2 Jul 2012 18:19:39 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q62IJcZi028873; Mon, 2 Jul 2012 22:19:38 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q62IJc37028872; Mon, 2 Jul 2012 22:19:38 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 2 Jul 2012 22:19:38 +0400 From: Gleb Smirnoff To: Baptiste Daroussin Message-ID: <20120702181938.GO21957@FreeBSD.org> References: <201207021528.q62FSoot078093@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201207021528.q62FSoot078093@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: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 18:19:40 -0000 On Mon, Jul 02, 2012 at 03:28:50PM +0000, Baptiste Daroussin wrote: B> Author: bapt B> Date: Mon Jul 2 15:28:50 2012 B> New Revision: 237997 B> URL: http://svn.freebsd.org/changeset/base/237997 B> B> Log: B> New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of usr.sbin/pkg B> Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, so that users can B> remove the old pkg_* tools without removing the pkgng boostrap I've fixed the build but head/tools/build/options/WITHOUT_PKGBOOSTRAP still needs to be renamed. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 18:35: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 48CEC106566B; Mon, 2 Jul 2012 18:35:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35E758FC15; Mon, 2 Jul 2012 18:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62IZ963087289; Mon, 2 Jul 2012 18:35:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62IZ8LO087287; Mon, 2 Jul 2012 18:35:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207021835.q62IZ8LO087287@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jul 2012 18:35: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: r238011 - head/sys/dev/sound/pci/hda 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, 02 Jul 2012 18:35:09 -0000 Author: mav Date: Mon Jul 2 18:35:08 2012 New Revision: 238011 URL: http://svn.freebsd.org/changeset/base/238011 Log: Restore GPIO config quirks handling, lost during last big refactoring. Tested by: hselasky MFC after: 3 days Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Jul 2 18:04:31 2012 (r238010) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Jul 2 18:35:08 2012 (r238011) @@ -401,12 +401,9 @@ hdaa_patch(struct hdaa_devinfo *devinfo) if (!(HDA_DEV_MATCH(hdac_quirks[i].model, subid) && HDA_DEV_MATCH(hdac_quirks[i].id, id))) continue; - if (hdac_quirks[i].set != 0) - devinfo->quirks |= - hdac_quirks[i].set; - if (hdac_quirks[i].unset != 0) - devinfo->quirks &= - ~(hdac_quirks[i].unset); + devinfo->quirks |= hdac_quirks[i].set; + devinfo->quirks &= ~(hdac_quirks[i].unset); + devinfo->gpio = hdac_quirks[i].gpio; } /* Apply per-widget patch. */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 19:09: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 600181065672; Mon, 2 Jul 2012 19:09:10 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id D39B38FC1A; Mon, 2 Jul 2012 19:09:09 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q62J92BO021803; Mon, 2 Jul 2012 21:09:02 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q62J92AV021802; Mon, 2 Jul 2012 21:09:02 +0200 (CEST) (envelope-from marius) Date: Mon, 2 Jul 2012 21:09:02 +0200 From: Marius Strobl To: Doug Barton Message-ID: <20120702190902.GF63893@alchemy.franken.de> References: <201206181911.q5IJB7NL095734@svn.freebsd.org> <4FF15496.7070307@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FF15496.7070307@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Marius Strobl , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r237234 - 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: Mon, 02 Jul 2012 19:09:10 -0000 On Mon, Jul 02, 2012 at 12:58:14AM -0700, Doug Barton wrote: > FYI, you didn't change the substance of the text, so there is no reason > to bump .Dd. > Okay, noted. Marius From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 19:35: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 EA7561065673; Mon, 2 Jul 2012 19:35:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D79B58FC16; Mon, 2 Jul 2012 19:35: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 q62JZufD091075; Mon, 2 Jul 2012 19:35:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62JZuZD091070; Mon, 2 Jul 2012 19:35:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207021935.q62JZuZD091070@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jul 2012 19:35: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: r238015 - in 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, 02 Jul 2012 19:35:57 -0000 Author: mav Date: Mon Jul 2 19:35:56 2012 New Revision: 238015 URL: http://svn.freebsd.org/changeset/base/238015 Log: Add IDs for some USB controllers I have around. Just a cosmetics. MFC after: 3 days Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/xhci_pci.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Jul 2 19:19:21 2012 (r238014) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Jul 2 19:35:56 2012 (r238015) @@ -104,9 +104,6 @@ ehci_pci_match(device_t self) uint32_t device_id = pci_get_devid(self); switch (device_id) { - case 0x268c8086: - return ("Intel 63XXESB USB 2.0 controller"); - case 0x523910b9: return "ALi M5239 USB 2.0 controller"; @@ -120,7 +117,13 @@ ehci_pci_match(device_t self) return "ATI SB200 USB 2.0 controller"; case 0x43731002: return "ATI SB400 USB 2.0 controller"; + case 0x43961002: + return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller"); + case 0x1e268086: + return ("Intel Panther Point USB 2.0 controller"); + case 0x1e2d8086: + return ("Intel Panther Point USB 2.0 controller"); case 0x25ad8086: return "Intel 6300ESB USB 2.0 controller"; case 0x24cd8086: @@ -129,9 +132,10 @@ ehci_pci_match(device_t self) return "Intel 82801EB/R (ICH5) USB 2.0 controller"; case 0x265c8086: return "Intel 82801FB (ICH6) USB 2.0 controller"; + case 0x268c8086: + return ("Intel 63XXESB USB 2.0 controller"); case 0x27cc8086: return "Intel 82801GB/R (ICH7) USB 2.0 controller"; - case 0x28368086: return "Intel 82801H (ICH8) USB 2.0 controller USB2-A"; case 0x283a8086: Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Mon Jul 2 19:19:21 2012 (r238014) +++ head/sys/dev/usb/controller/ohci_pci.c Mon Jul 2 19:35:56 2012 (r238015) @@ -132,6 +132,10 @@ ohci_pci_match(device_t self) return "ATI SB400 USB Controller"; case 0x43751002: return "ATI SB400 USB Controller"; + case 0x43971002: + return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); + case 0x43991002: + return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); case 0x06701095: return ("CMD Tech 670 (USB0670) USB controller"); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Mon Jul 2 19:19:21 2012 (r238014) +++ head/sys/dev/usb/controller/xhci_pci.c Mon Jul 2 19:35:56 2012 (r238015) @@ -93,6 +93,19 @@ MODULE_DEPEND(xhci, usb, 1, 1, 1); static const char * xhci_pci_match(device_t self) { + uint32_t device_id = pci_get_devid(self); + + switch (device_id) { + case 0x01941033: + return ("NEC uPD720200 USB 3.0 controller"); + + case 0x1e318086: + return ("Intel Panther Point USB 3.0 controller"); + + default: + break; + } + if ((pci_get_class(self) == PCIC_SERIALBUS) && (pci_get_subclass(self) == PCIS_SERIALBUS_USB) && (pci_get_progif(self) == PCIP_SERIALBUS_USB_XHCI)) { Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jul 2 19:19:21 2012 (r238014) +++ head/sys/dev/usb/usbdevs Mon Jul 2 19:35:56 2012 (r238015) @@ -560,6 +560,7 @@ vendor APACER 0x1005 Apacer vendor MOTOROLA4 0x100d Motorola vendor AIRPLUS 0x1011 Airplus vendor DESKNOTE 0x1019 Desknote +vendor NEC3 0x1033 NEC vendor GIGABYTE 0x1044 GIGABYTE vendor WESTERN 0x1058 Western Digital vendor MOTOROLA 0x1063 Motorola @@ -1924,6 +1925,7 @@ product INSYSTEM STORAGE_V2 0x5701 USB S product INTEL EASYPC_CAMERA 0x0110 Easy PC Camera product INTEL TESTBOARD 0x9890 82930 test board product INTEL2 IRMH 0x0020 Integrated Rate Matching Hub +product INTEL2 IRMH2 0x0024 Integrated Rate Matching Hub /* Intersil products */ product INTERSIL PRISM_GT 0x1000 PrismGT USB 2.0 WLAN From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 19:44:19 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 A5D33106566C; Mon, 2 Jul 2012 19:44:19 +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 886E18FC17; Mon, 2 Jul 2012 19:44: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 q62JiJLp092721; Mon, 2 Jul 2012 19:44:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62JiJju092716; Mon, 2 Jul 2012 19:44:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207021944.q62JiJju092716@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 2 Jul 2012 19:44: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: r238016 - in head/sys: netinet netinet6 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, 02 Jul 2012 19:44:19 -0000 Author: glebius Date: Mon Jul 2 19:44:18 2012 New Revision: 238016 URL: http://svn.freebsd.org/changeset/base/238016 Log: Remove route caching from IP multicast routing code. There is no reason to do that, and also, cached route never got unreferenced, which meant a reference leak. Reviewed by: bms Modified: head/sys/netinet/ip_mroute.c head/sys/netinet/ip_mroute.h head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_mroute.h Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Mon Jul 2 19:35:56 2012 (r238015) +++ head/sys/netinet/ip_mroute.c Mon Jul 2 19:44:18 2012 (r238016) @@ -924,7 +924,6 @@ add_vif(struct vifctl *vifcp) vifp->v_pkt_out = 0; vifp->v_bytes_in = 0; vifp->v_bytes_out = 0; - bzero(&vifp->v_route, sizeof(vifp->v_route)); /* Adjust numvifs up if the vifi is higher than numvifs */ if (V_numvifs <= vifcp->vifc_vifi) @@ -1702,7 +1701,7 @@ send_packet(struct vif *vifp, struct mbu * should get rejected because they appear to come from * the loopback interface, thus preventing looping. */ - error = ip_output(m, NULL, &vifp->v_route, IP_FORWARDING, &imo, NULL); + error = ip_output(m, NULL, NULL, IP_FORWARDING, &imo, NULL); CTR3(KTR_IPMF, "%s: vif %td err %d", __func__, (ptrdiff_t)(vifp - V_viftable), error); } Modified: head/sys/netinet/ip_mroute.h ============================================================================== --- head/sys/netinet/ip_mroute.h Mon Jul 2 19:35:56 2012 (r238015) +++ head/sys/netinet/ip_mroute.h Mon Jul 2 19:44:18 2012 (r238016) @@ -262,7 +262,6 @@ struct vif { u_long v_pkt_out; /* # pkts out on interface */ u_long v_bytes_in; /* # bytes in on interface */ u_long v_bytes_out; /* # bytes out on interface */ - struct route v_route; /* cached route */ }; #ifdef _KERNEL Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Mon Jul 2 19:35:56 2012 (r238015) +++ head/sys/netinet6/ip6_mroute.c Mon Jul 2 19:44:18 2012 (r238016) @@ -717,7 +717,6 @@ add_m6if(struct mif6ctl *mifcp) mifp->m6_pkt_out = 0; mifp->m6_bytes_in = 0; mifp->m6_bytes_out = 0; - bzero(&mifp->m6_route, sizeof(mifp->m6_route)); /* Adjust nummifs up if the mifi is higher than nummifs */ if (nummifs <= mifcp->mif6c_mifi) @@ -1576,11 +1575,8 @@ phyint_send(struct ip6_hdr *ip6, struct struct mbuf *mb_copy; struct ifnet *ifp = mifp->m6_ifp; int error = 0; - struct sockaddr_in6 *dst6; u_long linkmtu; - dst6 = &mifp->m6_route.ro_dst; - /* * Make a new reference to the packet; make sure that * the IPv6 header is actually copied, not just referenced, @@ -1610,8 +1606,8 @@ phyint_send(struct ip6_hdr *ip6, struct /* XXX: ip6_output will override ip6->ip6_hlim */ im6o.im6o_multicast_hlim = ip6->ip6_hlim; im6o.im6o_multicast_loop = 1; - error = ip6_output(mb_copy, NULL, &mifp->m6_route, - IPV6_FORWARDING, &im6o, NULL, NULL); + error = ip6_output(mb_copy, NULL, NULL, IPV6_FORWARDING, &im6o, + NULL, NULL); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_XMIT) @@ -1626,10 +1622,13 @@ phyint_send(struct ip6_hdr *ip6, struct * loop back a copy now. */ if (in6_mcast_loop) { - dst6->sin6_len = sizeof(struct sockaddr_in6); - dst6->sin6_family = AF_INET6; - dst6->sin6_addr = ip6->ip6_dst; - ip6_mloopback(ifp, m, &mifp->m6_route.ro_dst); + struct sockaddr_in6 dst6; + + bzero(&dst6, sizeof(dst6)); + dst6.sin6_len = sizeof(struct sockaddr_in6); + dst6.sin6_family = AF_INET6; + dst6.sin6_addr = ip6->ip6_dst; + ip6_mloopback(ifp, m, &dst6); } /* @@ -1638,15 +1637,18 @@ phyint_send(struct ip6_hdr *ip6, struct */ linkmtu = IN6_LINKMTU(ifp); if (mb_copy->m_pkthdr.len <= linkmtu || linkmtu < IPV6_MMTU) { - dst6->sin6_len = sizeof(struct sockaddr_in6); - dst6->sin6_family = AF_INET6; - dst6->sin6_addr = ip6->ip6_dst; + struct sockaddr_in6 dst6; + + bzero(&dst6, sizeof(dst6)); + dst6.sin6_len = sizeof(struct sockaddr_in6); + dst6.sin6_family = AF_INET6; + dst6.sin6_addr = ip6->ip6_dst; /* * We just call if_output instead of nd6_output here, since * we need no ND for a multicast forwarded packet...right? */ error = (*ifp->if_output)(ifp, mb_copy, - (struct sockaddr *)&mifp->m6_route.ro_dst, NULL); + (struct sockaddr *)&dst6, NULL); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_XMIT) log(LOG_DEBUG, "phyint_send on mif %d err %d\n", Modified: head/sys/netinet6/ip6_mroute.h ============================================================================== --- head/sys/netinet6/ip6_mroute.h Mon Jul 2 19:35:56 2012 (r238015) +++ head/sys/netinet6/ip6_mroute.h Mon Jul 2 19:44:18 2012 (r238016) @@ -212,7 +212,6 @@ struct mif6 { u_quad_t m6_pkt_out; /* # pkts out on interface */ u_quad_t m6_bytes_in; /* # bytes in on interface */ u_quad_t m6_bytes_out; /* # bytes out on interface */ - struct route_in6 m6_route; /* cached route */ #ifdef notyet u_int m6_rsvp_on; /* RSVP listening on this vif */ struct socket *m6_rsvpd; /* RSVP daemon socket */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 19:51: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 8C66D1065673; Mon, 2 Jul 2012 19:51:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 714438FC0A; Mon, 2 Jul 2012 19:51:40 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q62JpeVj091166; Mon, 2 Jul 2012 19:51:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q62JpeWO091164; Mon, 2 Jul 2012 19:51:40 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Mon, 2 Jul 2012 19:51:37 +0000 From: Baptiste Daroussin To: Gleb Smirnoff Message-ID: <20120702195137.GD37018@ithaqua.etoilebsd.net> References: <201207021528.q62FSoot078093@svn.freebsd.org> <20120702181938.GO21957@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+B+y8wtTXqdUj1xM" Content-Disposition: inline In-Reply-To: <20120702181938.GO21957@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: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 19:51:40 -0000 --+B+y8wtTXqdUj1xM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 02, 2012 at 10:19:38PM +0400, Gleb Smirnoff wrote: > On Mon, Jul 02, 2012 at 03:28:50PM +0000, Baptiste Daroussin wrote: > B> Author: bapt > B> Date: Mon Jul 2 15:28:50 2012 > B> New Revision: 237997 > B> URL: http://svn.freebsd.org/changeset/base/237997 > B>=20 > B> Log: > B> New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of usr.sb= in/pkg > B> Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS anymore, = so that users can > B> remove the old pkg_* tools without removing the pkgng boostrap >=20 > I've fixed the build but head/tools/build/options/WITHOUT_PKGBOOSTRAP sti= ll > needs to be renamed. thank you, and sorry. regards, Bapt --+B+y8wtTXqdUj1xM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/x+8kACgkQ8kTtMUmk6EyEqgCgnPMaxSPpKHE8i2nEorb0gj/3 MhoAnRcemOZV94TGqnatXf2icsIRsTdb =VxP2 -----END PGP SIGNATURE----- --+B+y8wtTXqdUj1xM-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 19:56: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 588E91065672; Mon, 2 Jul 2012 19:56:29 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 354878FC0A; Mon, 2 Jul 2012 19:56:29 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q62JuMVX005959 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jul 2012 12:56:28 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=koi8-r From: Marcel Moolenaar In-Reply-To: <20120702181938.GO21957@FreeBSD.org> Date: Mon, 2 Jul 2012 12:56:17 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201207021528.q62FSoot078093@svn.freebsd.org> <20120702181938.GO21957@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r237997 - in head: tools/build/mk tools/build/options usr.sbin 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, 02 Jul 2012 19:56:29 -0000 On Jul 2, 2012, at 11:19 AM, Gleb Smirnoff wrote: > On Mon, Jul 02, 2012 at 03:28:50PM +0000, Baptiste Daroussin wrote: > B> Author: bapt > B> Date: Mon Jul 2 15:28:50 2012 > B> New Revision: 237997 > B> URL: http://svn.freebsd.org/changeset/base/237997 > B>=20 > B> Log: > B> New build KNOB: WITHOUT_PKGBOOTSTRAP to condition building of = usr.sbin/pkg > B> Do not condition usr.sbin/pkg building on WITHOUT_PKGTOOLS = anymore, so that users can > B> remove the old pkg_* tools without removing the pkgng boostrap >=20 > I've fixed the build but head/tools/build/options/WITHOUT_PKGBOOSTRAP = still > needs to be renamed. Thanks Gleb. I'll take care of that one then and re-generate the man = page. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:01:48 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 D3A02106566C; Mon, 2 Jul 2012 20:01:48 +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 C0E858FC0C; Mon, 2 Jul 2012 20:01: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 q62K1mjG094625; Mon, 2 Jul 2012 20:01:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62K1mLw094624; Mon, 2 Jul 2012 20:01:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022001.q62K1mLw094624@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 20:01: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: r238018 - head/tools/build/options 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, 02 Jul 2012 20:01:48 -0000 Author: marcel Date: Mon Jul 2 20:01:48 2012 New Revision: 238018 URL: http://svn.freebsd.org/changeset/base/238018 Log: Fix typo in option description file (using svn move). Added: head/tools/build/options/WITHOUT_PKGBOOTSTRAP - copied unchanged from r238017, head/tools/build/options/WITHOUT_PKGBOOSTRAP Deleted: head/tools/build/options/WITHOUT_PKGBOOSTRAP Copied: head/tools/build/options/WITHOUT_PKGBOOTSTRAP (from r238017, head/tools/build/options/WITHOUT_PKGBOOSTRAP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_PKGBOOTSTRAP Mon Jul 2 20:01:48 2012 (r238018, copy of r238017, head/tools/build/options/WITHOUT_PKGBOOSTRAP) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr pkg +bootstrap tool From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:08: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 42A92106566B; Mon, 2 Jul 2012 20:08:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30A8A8FC08; Mon, 2 Jul 2012 20:08: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 q62K8CC6095287; Mon, 2 Jul 2012 20:08:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62K8Bch095285; Mon, 2 Jul 2012 20:08:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207022008.q62K8Bch095285@svn.freebsd.org> From: John Baldwin Date: Mon, 2 Jul 2012 20:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238020 - head/usr.bin/top 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, 02 Jul 2012 20:08:12 -0000 Author: jhb Date: Mon Jul 2 20:08:11 2012 New Revision: 238020 URL: http://svn.freebsd.org/changeset/base/238020 Log: Fix two layout bugs in the previous change: - Properly increase y_mem when per-CPU stats are enabled. - Update y_arc for per-CPU stats being enabled/disabled. MFC after: 3 days Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jul 2 20:07:09 2012 (r238019) +++ head/usr.bin/top/machine.c Mon Jul 2 20:08:11 2012 (r238020) @@ -263,6 +263,7 @@ update_layout(void) { y_mem = 3; + y_arc = 4; y_swap = 4 + arc_enabled; y_idlecursor = 5 + arc_enabled; y_message = 5 + arc_enabled; @@ -271,7 +272,8 @@ update_layout(void) Header_lines = 7 + arc_enabled; if (pcpu_stats) { - y_mem = ncpus - 1; + y_mem += ncpus - 1; + y_arc += ncpus - 1; y_swap += ncpus - 1; y_idlecursor += ncpus - 1; y_message += ncpus - 1; From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:12: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 692EA106581C; Mon, 2 Jul 2012 20:12:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4DDC48FC0C; Mon, 2 Jul 2012 20:12:30 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q62KCUXT093492; Mon, 2 Jul 2012 20:12:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q62KCUgQ093491; Mon, 2 Jul 2012 20:12:30 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Mon, 2 Jul 2012 20:12:27 +0000 From: Baptiste Daroussin To: Marcel Moolenaar Message-ID: <20120702201227.GE37018@ithaqua.etoilebsd.net> References: <201207022001.q62K1mLw094624@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ns7jmDPpOpCD+GE/" Content-Disposition: inline In-Reply-To: <201207022001.q62K1mLw094624@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: r238018 - head/tools/build/options 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, 02 Jul 2012 20:12:30 -0000 --Ns7jmDPpOpCD+GE/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 02, 2012 at 08:01:48PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Jul 2 20:01:48 2012 > New Revision: 238018 > URL: http://svn.freebsd.org/changeset/base/238018 >=20 > Log: > Fix typo in option description file (using svn move). >=20 > Added: > head/tools/build/options/WITHOUT_PKGBOOTSTRAP > - copied unchanged from r238017, head/tools/build/options/WITHOUT_PK= GBOOSTRAP > Deleted: > head/tools/build/options/WITHOUT_PKGBOOSTRAP >=20 > Copied: head/tools/build/options/WITHOUT_PKGBOOTSTRAP (from r238017, head= /tools/build/options/WITHOUT_PKGBOOSTRAP) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITHOUT_PKGBOOTSTRAP Mon Jul 2 20:01:48 201= 2 (r238018, copy of r238017, head/tools/build/options/WITHOUT_PKGBOOSTRAP) > @@ -0,0 +1,4 @@ > +.\" $FreeBSD$ > +Set to not build > +.Xr pkg > +bootstrap tool THank you very much regards, Bapt --Ns7jmDPpOpCD+GE/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/yAKsACgkQ8kTtMUmk6EwMtgCfW83iYq+z+i8/tkSatU1UZJQV oEQAnRpe/XNHynW/k1jNlm5mRmasM7+j =1uE9 -----END PGP SIGNATURE----- --Ns7jmDPpOpCD+GE/-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:24: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 13B7B106566C; Mon, 2 Jul 2012 20:24:02 +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 011658FC17; Mon, 2 Jul 2012 20:24: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 q62KO1kB096726; Mon, 2 Jul 2012 20:24:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KO1lh096725; Mon, 2 Jul 2012 20:24:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022024.q62KO1lh096725@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 20:24: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: r238021 - head/tools/build/options 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, 02 Jul 2012 20:24:02 -0000 Author: marcel Date: Mon Jul 2 20:24:01 2012 New Revision: 238021 URL: http://svn.freebsd.org/changeset/base/238021 Log: Add description for INSTALL_AS_USER Added: head/tools/build/options/WITH_INSTALL_AS_USER (contents, props changed) Added: head/tools/build/options/WITH_INSTALL_AS_USER ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_INSTALL_AS_USER Mon Jul 2 20:24:01 2012 (r238021) @@ -0,0 +1,9 @@ +.\" $FreeBSD$ +Set to make install targets succeed for non-root users by installing +files with owner and group attributes set to that of the user running +the +.Xr make 1 +command. +The user still has to set the +.Va DESTDIR +variable to point to a directory where the user has write permissions. From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:25:51 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 1BD36106566B; Mon, 2 Jul 2012 20:25:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3BB28FC15; Mon, 2 Jul 2012 20:25: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 q62KPo8v096920; Mon, 2 Jul 2012 20:25:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KPotw096918; Mon, 2 Jul 2012 20:25:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207022025.q62KPotw096918@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jul 2012 20:25: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: r238022 - head/sys/dev/sound/pci/hda 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, 02 Jul 2012 20:25:51 -0000 Author: mav Date: Mon Jul 2 20:25:50 2012 New Revision: 238022 URL: http://svn.freebsd.org/changeset/base/238022 Log: Remove 14 not very useful characters " HDA CODEC PCM" from HDA pcm device names to shorten them. PulseAudio reported to have problems with names longer then 63 chars and at least in XMMS long names are inconvinient. Reported by: hselasky MFC after: 3 days Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Mon Jul 2 20:24:01 2012 (r238021) +++ head/sys/dev/sound/pci/hda/hdaa.c Mon Jul 2 20:25:50 2012 (r238022) @@ -6203,12 +6203,14 @@ hdaa_resume(device_t dev) static int hdaa_probe(device_t dev) { + const char *pdesc; char buf[128]; if (hda_get_node_type(dev) != HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO) return (ENXIO); - snprintf(buf, sizeof(buf), "%s Audio Function Group", - device_get_desc(device_get_parent(dev))); + pdesc = device_get_desc(device_get_parent(dev)); + snprintf(buf, sizeof(buf), "%.*s Audio Function Group", + (int)(strlen(pdesc) - 10), pdesc); device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } @@ -6565,6 +6567,7 @@ hdaa_pcm_probe(device_t dev) struct hdaa_pcm_devinfo *pdevinfo = (struct hdaa_pcm_devinfo *)device_get_ivars(dev); struct hdaa_devinfo *devinfo = pdevinfo->devinfo; + const char *pdesc; char chans1[8], chans2[8]; char buf[128]; int loc1, loc2, t1, t2; @@ -6610,8 +6613,9 @@ hdaa_pcm_probe(device_t dev) t1 = -2; if (pdevinfo->digital) t1 = -2; - snprintf(buf, sizeof(buf), "%s PCM (%s%s%s%s%s%s%s%s%s)", - device_get_desc(device_get_parent(device_get_parent(dev))), + pdesc = device_get_desc(device_get_parent(dev)); + snprintf(buf, sizeof(buf), "%.*s (%s%s%s%s%s%s%s%s%s)", + (int)(strlen(pdesc) - 21), pdesc, loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "", (pdevinfo->digital == 0x7)?"HDMI/DP": ((pdevinfo->digital == 0x5)?"DisplayPort": From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:26: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 D1D371065686; Mon, 2 Jul 2012 20:26:11 +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 BE8AB8FC12; Mon, 2 Jul 2012 20:26:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62KQBgj096993; Mon, 2 Jul 2012 20:26:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KQBVJ096991; Mon, 2 Jul 2012 20:26:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022026.q62KQBVJ096991@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 20:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238023 - head/tools/build/options 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, 02 Jul 2012 20:26:11 -0000 Author: marcel Date: Mon Jul 2 20:26:11 2012 New Revision: 238023 URL: http://svn.freebsd.org/changeset/base/238023 Log: A cross-reference takes a man page section as well. Assume pkg(1), based on pkg_add(1). Modified: head/tools/build/options/WITHOUT_PKGBOOTSTRAP Modified: head/tools/build/options/WITHOUT_PKGBOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_PKGBOOTSTRAP Mon Jul 2 20:25:50 2012 (r238022) +++ head/tools/build/options/WITHOUT_PKGBOOTSTRAP Mon Jul 2 20:26:11 2012 (r238023) @@ -1,4 +1,4 @@ .\" $FreeBSD$ Set to not build -.Xr pkg +.Xr pkg 1 bootstrap tool From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:27: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 91CA51065670; Mon, 2 Jul 2012 20:27: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 8016C8FC1E; Mon, 2 Jul 2012 20:27: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 q62KRcwG097155; Mon, 2 Jul 2012 20:27:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KRc7Z097153; Mon, 2 Jul 2012 20:27:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207022027.q62KRc7Z097153@svn.freebsd.org> From: John Baldwin Date: Mon, 2 Jul 2012 20:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238024 - head/usr.sbin/cron/crontab 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, 02 Jul 2012 20:27:38 -0000 Author: jhb Date: Mon Jul 2 20:27:37 2012 New Revision: 238024 URL: http://svn.freebsd.org/changeset/base/238024 Log: Add a one second sleep before touching the spool directory. If the touch occurs in the same second as the earlier operations to create the temporary file and the cron(8) daemon is rescans the spool directory during that second, then the daemon may miss a cron edit and not properly update its internal database. MFC after: 1 month Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Mon Jul 2 20:26:11 2012 (r238023) +++ head/usr.sbin/cron/crontab/crontab.c Mon Jul 2 20:27:37 2012 (r238024) @@ -608,6 +608,15 @@ replace_cmd() { log_it(RealUser, Pid, "REPLACE", User); + /* + * Creating the 'tn' temp file has already updated the + * modification time of the spool directory. Sleep for a + * second to ensure that poke_daemon() sets a later + * modification time. Otherwise, this can race with the cron + * daemon scanning for updated crontabs. + */ + sleep(1); + poke_daemon(); return (0); From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:28: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 A44A5106566C; Mon, 2 Jul 2012 20:28:12 +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 90C128FC0C; Mon, 2 Jul 2012 20:28: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 q62KSCFW097249; Mon, 2 Jul 2012 20:28:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KSCrO097247; Mon, 2 Jul 2012 20:28:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022028.q62KSCrO097247@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 20:28: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: r238025 - 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: Mon, 02 Jul 2012 20:28:12 -0000 Author: marcel Date: Mon Jul 2 20:28:12 2012 New Revision: 238025 URL: http://svn.freebsd.org/changeset/base/238025 Log: Added options: WITH_INSTALL_AS_USER WITHOUT_PKGBOOTSTRAP Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Jul 2 20:27:37 2012 (r238024) +++ head/share/man/man5/src.conf.5 Mon Jul 2 20:28:12 2012 (r238025) @@ -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 June 27, 2012 +.Dd July 2, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -514,6 +514,16 @@ Set this if you do not want to install o For example when creating a .Xr nanobsd 8 image. +.It Va WITH_INSTALL_AS_USER +.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel +Set to make install targets succeed for non-root users by installing +files with owner and group attributes set to that of the user running +the +.Xr make 1 +command. +The user still has to set the +.Va DESTDIR +variable to point to a directory where the user has write permissions. .It Va WITHOUT_IPFILTER .\" from FreeBSD: head/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru Set to not build IP Filter package. @@ -839,6 +849,11 @@ When set, it also enforces the following .It .Va WITHOUT_AUTHPF .El +.It Va WITHOUT_PKGBOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 238023 2012-07-02 20:26:11Z marcel +Set to not build +.Xr pkg 1 +bootstrap tool .It Va WITHOUT_PKGTOOLS .\" from FreeBSD: head/tools/build/options/WITHOUT_PKGTOOLS 183242 2008-09-21 22:02:26Z sam Set to not build From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:36: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 ACF7E1065670; Mon, 2 Jul 2012 20:36:27 +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 80F488FC08; Mon, 2 Jul 2012 20:36: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 q62KaRdX098122; Mon, 2 Jul 2012 20:36:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KaRa3098119; Mon, 2 Jul 2012 20:36:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022036.q62KaRa3098119@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 20:36: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: r238026 - in head/sys: dev/filemon modules 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, 02 Jul 2012 20:36:27 -0000 Author: marcel Date: Mon Jul 2 20:36:26 2012 New Revision: 238026 URL: http://svn.freebsd.org/changeset/base/238026 Log: There's no need to make filemon specific to i386 and amd64. All LP64 architectures define elf64_freebsd_sysvec and all ILP32 architectures define elf32_freebsd_sysvec. Modified: head/sys/dev/filemon/filemon_wrapper.c head/sys/modules/Makefile Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Jul 2 20:28:12 2012 (r238025) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Jul 2 20:36:26 2012 (r238026) @@ -656,12 +656,10 @@ filemon_wrapper_vfork(struct thread *td, static void filemon_wrapper_install(void) { -#if defined(__i386__) - struct sysent *sv_table = elf32_freebsd_sysvec.sv_table; -#elif defined(__amd64__) +#if defined(__LP64__) struct sysent *sv_table = elf64_freebsd_sysvec.sv_table; #else -#error Machine type not supported + struct sysent *sv_table = elf32_freebsd_sysvec.sv_table; #endif sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; @@ -702,12 +700,10 @@ filemon_wrapper_install(void) static void filemon_wrapper_deinstall(void) { -#if defined(__i386__) - struct sysent *sv_table = elf32_freebsd_sysvec.sv_table; -#elif defined(__amd64__) +#if defined(__LP64__) struct sysent *sv_table = elf64_freebsd_sysvec.sv_table; #else -#error Machine type not supported + struct sysent *sv_table = elf32_freebsd_sysvec.sv_table; #endif sv_table[SYS_chdir].sy_call = (sy_call_t *)sys_chdir; Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jul 2 20:28:12 2012 (r238025) +++ head/sys/modules/Makefile Mon Jul 2 20:36:26 2012 (r238026) @@ -106,7 +106,7 @@ SUBDIR= \ fdc \ fdescfs \ ${_fe} \ - ${_filemon} \ + filemon \ firewire \ firmware \ ${_fxp} \ @@ -360,10 +360,6 @@ SUBDIR= \ ${_zfs} \ zlib \ -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_filemon= filemon -.endif - .if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" && \ ${MACHINE_CPUARCH} != "mips" _syscons= syscons From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 20:42:43 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 E5792106566C; Mon, 2 Jul 2012 20:42:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D35498FC20; Mon, 2 Jul 2012 20:42:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62KghoD098475; Mon, 2 Jul 2012 20:42:43 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62KghKC098473; Mon, 2 Jul 2012 20:42:43 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201207022042.q62KghKC098473@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 2 Jul 2012 20:42: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: r238028 - head/sys/dev/cxgbe 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, 02 Jul 2012 20:42:44 -0000 Author: np Date: Mon Jul 2 20:42:43 2012 New Revision: 238028 URL: http://svn.freebsd.org/changeset/base/238028 Log: Instruct the firmware not to provision resources for TCP offload if the kernel is being built without TCP_OFFLOAD. But never override toecaps_allowed if it has been set manually. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jul 2 20:36:54 2012 (r238027) +++ head/sys/dev/cxgbe/t4_main.c Mon Jul 2 20:42:43 2012 (r238028) @@ -222,7 +222,7 @@ TUNABLE_INT("hw.cxgbe.linkcaps_allowed", static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC; TUNABLE_INT("hw.cxgbe.niccaps_allowed", &t4_niccaps_allowed); -static int t4_toecaps_allowed = FW_CAPS_CONFIG_TOE; +static int t4_toecaps_allowed = -1; TUNABLE_INT("hw.cxgbe.toecaps_allowed", &t4_toecaps_allowed); static int t4_rdmacaps_allowed = 0; @@ -5492,6 +5492,12 @@ tweak_tunables(void) if (t4_nofldrxq1g < 1) t4_nofldrxq1g = min(nc, NOFLDRXQ_1G); + + if (t4_toecaps_allowed == -1) + t4_toecaps_allowed = FW_CAPS_CONFIG_TOE; +#else + if (t4_toecaps_allowed == -1) + t4_toecaps_allowed = 0; #endif if (t4_tmr_idx_10g < 0 || t4_tmr_idx_10g >= SGE_NTIMERS) From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:01: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 ED5481065674; Mon, 2 Jul 2012 21:01:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2A288FC1B; Mon, 2 Jul 2012 21:01: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 q62L131H099294; Mon, 2 Jul 2012 21:01:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62L13Vh099286; Mon, 2 Jul 2012 21:01:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207022101.q62L13Vh099286@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 2 Jul 2012 21:01: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: r238029 - in head/sys: compat/linux fs/devfs kern sys ufs/ffs 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, 02 Jul 2012 21:01:04 -0000 Author: kib Date: Mon Jul 2 21:01:03 2012 New Revision: 238029 URL: http://svn.freebsd.org/changeset/base/238029 Log: Extend the KPI to lock and unlock f_offset member of struct file. It now fully encapsulates all accesses to f_offset, and extends f_offset locking to other consumers that need it, in particular, to lseek() and variants of getdirentries(). Ensure that on 32bit architectures f_offset, which is 64bit quantity, always read and written under the mtxpool protection. This fixes apparently easy to trigger race when parallel lseek()s or lseek() and read/write could destroy file offset. The already broken ABI emulations, including iBCS and SysV, are not converted (yet). Tested by: pho No objections from: jhb MFC after: 3 weeks Modified: head/sys/compat/linux/linux_file.c head/sys/fs/devfs/devfs_vnops.c head/sys/kern/kern_descrip.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/sys/file.h head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/compat/linux/linux_file.c Mon Jul 2 21:01:03 2012 (r238029) @@ -357,15 +357,16 @@ getdents_common(struct thread *td, struc return (EBADF); } + off = foffset_lock(fp, 0); vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, off, 0); fdrop(fp, td); return (EINVAL); } - off = fp->f_offset; buflen = max(LINUX_DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); @@ -514,7 +515,6 @@ getdents_common(struct thread *td, struc goto eof; } - fp->f_offset = off; if (justone) nbytes = resid + linuxreclen; @@ -527,6 +527,7 @@ out: VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, off, 0); fdrop(fp, td); free(buf, M_TEMP); free(lbuf, M_TEMP); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/fs/devfs/devfs_vnops.c Mon Jul 2 21:01:03 2012 (r238029) @@ -1170,18 +1170,14 @@ devfs_read_f(struct file *fp, struct uio if (ioflag & O_DIRECT) ioflag |= IO_DIRECT; - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; - + foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); error = dsw->d_read(dev, uio, ioflag); if (uio->uio_resid != resid || (error == 0 && resid != 0)) vfs_timestamp(&dev->si_atime); td->td_fpop = fpop; dev_relthread(dev, ref); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; - fp->f_nextoff = uio->uio_offset; + foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF); return (error); } @@ -1648,8 +1644,7 @@ devfs_write_f(struct file *fp, struct ui ioflag = fp->f_flag & (O_NONBLOCK | O_DIRECT | O_FSYNC); if (ioflag & O_DIRECT) ioflag |= IO_DIRECT; - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; + foffset_lock_uio(fp, uio, flags | FOF_NOLOCK); resid = uio->uio_resid; @@ -1661,9 +1656,7 @@ devfs_write_f(struct file *fp, struct ui td->td_fpop = fpop; dev_relthread(dev, ref); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; - fp->f_nextoff = uio->uio_offset; + foffset_unlock_uio(fp, uio, flags | FOF_NOLOCK | FOF_NEXTOFF); return (error); } Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/kern/kern_descrip.c Mon Jul 2 21:01:03 2012 (r238029) @@ -465,6 +465,7 @@ kern_fcntl(struct thread *td, int fd, in int vfslocked; u_int old, new; uint64_t bsize; + off_t foffset; vfslocked = 0; error = 0; @@ -606,14 +607,15 @@ kern_fcntl(struct thread *td, int fd, in } flp = (struct flock *)arg; if (flp->l_whence == SEEK_CUR) { - if (fp->f_offset < 0 || + foffset = foffset_get(fp); + if (foffset < 0 || (flp->l_start > 0 && - fp->f_offset > OFF_MAX - flp->l_start)) { + foffset > OFF_MAX - flp->l_start)) { FILEDESC_SUNLOCK(fdp); error = EOVERFLOW; break; } - flp->l_start += fp->f_offset; + flp->l_start += foffset; } /* @@ -727,15 +729,16 @@ kern_fcntl(struct thread *td, int fd, in break; } if (flp->l_whence == SEEK_CUR) { + foffset = foffset_get(fp); if ((flp->l_start > 0 && - fp->f_offset > OFF_MAX - flp->l_start) || + foffset > OFF_MAX - flp->l_start) || (flp->l_start < 0 && - fp->f_offset < OFF_MIN - flp->l_start)) { + foffset < OFF_MIN - flp->l_start)) { FILEDESC_SUNLOCK(fdp); error = EOVERFLOW; break; } - flp->l_start += fp->f_offset; + flp->l_start += foffset; } /* * VOP_ADVLOCK() may block. @@ -2810,7 +2813,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) xf.xf_type = fp->f_type; xf.xf_count = fp->f_count; xf.xf_msgcount = 0; - xf.xf_offset = fp->f_offset; + xf.xf_offset = foffset_get(fp); xf.xf_flag = fp->f_flag; error = SYSCTL_OUT(req, &xf, sizeof(xf)); if (error) @@ -3015,7 +3018,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE kif->kf_flags |= KF_FLAG_DIRECT; if (fp->f_flag & FHASLOCK) kif->kf_flags |= KF_FLAG_HASLOCK; - kif->kf_offset = fp->f_offset; + kif->kf_offset = foffset_get(fp); if (vp != NULL) { vref(vp); switch (vp->v_type) { @@ -3359,7 +3362,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER } refcnt = fp->f_count; fflags = fp->f_flag; - offset = fp->f_offset; + offset = foffset_get(fp); /* * Create sysctl entry. Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/kern/vfs_syscalls.c Mon Jul 2 21:01:03 2012 (r238029) @@ -1981,7 +1981,7 @@ sys_lseek(td, uap) struct file *fp; struct vnode *vp; struct vattr vattr; - off_t offset, size; + off_t foffset, offset, size; int error, noneg; int vfslocked; @@ -1993,18 +1993,19 @@ sys_lseek(td, uap) return (ESPIPE); } vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); vfslocked = VFS_LOCK_GIANT(vp->v_mount); noneg = (vp->v_type != VCHR); offset = uap->offset; switch (uap->whence) { case L_INCR: if (noneg && - (fp->f_offset < 0 || - (offset > 0 && fp->f_offset > OFF_MAX - offset))) { + (foffset < 0 || + (offset > 0 && foffset > OFF_MAX - offset))) { error = EOVERFLOW; break; } - offset += fp->f_offset; + offset += foffset; break; case L_XTND: vn_lock(vp, LK_SHARED | LK_RETRY); @@ -2044,12 +2045,12 @@ sys_lseek(td, uap) error = EINVAL; if (error != 0) goto drop; - fp->f_offset = offset; VFS_KNOTE_UNLOCKED(vp, 0); - *(off_t *)(td->td_retval) = fp->f_offset; + *(off_t *)(td->td_retval) = offset; drop: fdrop(fp, td); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); } @@ -3982,6 +3983,7 @@ kern_ogetdirentries(struct thread *td, s caddr_t dirbuf; int error, eofflag, readcnt, vfslocked; long loff; + off_t foffset; /* XXX arbitrary sanity limit on `count'. */ if (uap->count > 64 * 1024) @@ -3994,10 +3996,12 @@ kern_ogetdirentries(struct thread *td, s return (EBADF); } vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); unionread: vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, 0); fdrop(fp, td); return (EINVAL); } @@ -4010,12 +4014,13 @@ unionread: auio.uio_td = td; auio.uio_resid = uap->count; vn_lock(vp, LK_SHARED | LK_RETRY); - loff = auio.uio_offset = fp->f_offset; + loff = auio.uio_offset = foffset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); if (error) { VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, FOF_NOUPDATE); fdrop(fp, td); return (error); } @@ -4024,7 +4029,7 @@ unionread: if (vp->v_mount->mnt_maxsymlinklen <= 0) { error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL, NULL); - fp->f_offset = auio.uio_offset; + foffset = auio.uio_offset; } else # endif { @@ -4036,7 +4041,7 @@ unionread: kiov.iov_base = dirbuf; error = VOP_READDIR(vp, &kuio, fp->f_cred, &eofflag, NULL, NULL); - fp->f_offset = kuio.uio_offset; + foffset = kuio.uio_offset; if (error == 0) { readcnt = uap->count - kuio.uio_resid; edp = (struct dirent *)&dirbuf[readcnt]; @@ -4074,6 +4079,7 @@ unionread: if (error) { VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, 0); fdrop(fp, td); return (error); } @@ -4085,13 +4091,14 @@ unionread: VREF(vp); fp->f_vnode = vp; fp->f_data = vp; - fp->f_offset = 0; + foffset = 0; vput(tvp); VFS_UNLOCK_GIANT(vfslocked); goto unionread; } VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock(fp, foffset, 0); fdrop(fp, td); td->td_retval[0] = uap->count - auio.uio_resid; if (error == 0) @@ -4144,6 +4151,7 @@ kern_getdirentries(struct thread *td, in int vfslocked; long loff; int error, eofflag; + off_t foffset; AUDIT_ARG_FD(fd); if (count > IOSIZE_MAX) @@ -4157,6 +4165,7 @@ kern_getdirentries(struct thread *td, in return (EBADF); } vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); unionread: vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { @@ -4173,14 +4182,14 @@ unionread: auio.uio_td = td; vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); - loff = auio.uio_offset = fp->f_offset; + loff = auio.uio_offset = foffset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); if (error == 0) #endif error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, NULL, NULL); - fp->f_offset = auio.uio_offset; + foffset = auio.uio_offset; if (error) { VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); @@ -4194,7 +4203,7 @@ unionread: VREF(vp); fp->f_vnode = vp; fp->f_data = vp; - fp->f_offset = 0; + foffset = 0; vput(tvp); VFS_UNLOCK_GIANT(vfslocked); goto unionread; @@ -4206,6 +4215,7 @@ unionread: *residp = auio.uio_resid; td->td_retval[0] = count - auio.uio_resid; fail: + foffset_unlock(fp, foffset, 0); fdrop(fp, td); return (error); } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/kern/vfs_vnops.c Mon Jul 2 21:01:03 2012 (r238029) @@ -527,13 +527,22 @@ vn_rdwr_inchunks(rw, vp, base, len, offs return (error); } -static void -foffset_lock(struct file *fp, struct uio *uio, int flags) +off_t +foffset_lock(struct file *fp, int flags) { struct mtx *mtxp; + off_t res; - if ((flags & FOF_OFFSET) != 0) - return; + KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); + +#if OFF_MAX <= LONG_MAX + /* + * Caller only wants the current f_offset value. Assume that + * the long and shorter integer types reads are atomic. + */ + if ((flags & FOF_NOLOCK) != 0) + return (fp->f_offset); +#endif /* * According to McKusick the vn lock was protecting f_offset here. @@ -541,16 +550,68 @@ foffset_lock(struct file *fp, struct uio */ mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); - while (fp->f_vnread_flags & FOFFSET_LOCKED) { - fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PUSER -1, - "vnread offlock", 0); + if ((flags & FOF_NOLOCK) == 0) { + while (fp->f_vnread_flags & FOFFSET_LOCKED) { + fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; + msleep(&fp->f_vnread_flags, mtxp, PUSER -1, + "vofflock", 0); + } + fp->f_vnread_flags |= FOFFSET_LOCKED; + } + res = fp->f_offset; + mtx_unlock(mtxp); + return (res); +} + +void +foffset_unlock(struct file *fp, off_t val, int flags) +{ + struct mtx *mtxp; + + KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); + +#if OFF_MAX <= LONG_MAX + if ((flags & FOF_NOLOCK) != 0) { + if ((flags & FOF_NOUPDATE) == 0) + fp->f_offset = val; + if ((flags & FOF_NEXTOFF) != 0) + fp->f_nextoff = val; + return; + } +#endif + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + if ((flags & FOF_NOUPDATE) == 0) + fp->f_offset = val; + if ((flags & FOF_NEXTOFF) != 0) + fp->f_nextoff = val; + if ((flags & FOF_NOLOCK) == 0) { + KASSERT((fp->f_vnread_flags & FOFFSET_LOCKED) != 0, + ("Lost FOFFSET_LOCKED")); + if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) + wakeup(&fp->f_vnread_flags); + fp->f_vnread_flags = 0; } - fp->f_vnread_flags |= FOFFSET_LOCKED; - uio->uio_offset = fp->f_offset; mtx_unlock(mtxp); } +void +foffset_lock_uio(struct file *fp, struct uio *uio, int flags) +{ + + if ((flags & FOF_OFFSET) == 0) + uio->uio_offset = foffset_lock(fp, flags); +} + +void +foffset_unlock_uio(struct file *fp, struct uio *uio, int flags) +{ + + if ((flags & FOF_OFFSET) == 0) + foffset_unlock(fp, uio->uio_offset, flags); +} + static int get_advice(struct file *fp, struct uio *uio) { @@ -570,23 +631,6 @@ get_advice(struct file *fp, struct uio * return (ret); } -static void -foffset_unlock(struct file *fp, struct uio *uio, int flags) -{ - struct mtx *mtxp; - - if ((flags & FOF_OFFSET) != 0) - return; - - fp->f_offset = uio->uio_offset; - mtxp = mtx_pool_find(mtxpool_sleep, fp); - mtx_lock(mtxp); - if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) - wakeup(&fp->f_vnread_flags); - fp->f_vnread_flags = 0; - mtx_unlock(mtxp); -} - /* * File table vnode read routine. */ @@ -865,7 +909,7 @@ vn_io_fault(struct file *fp, struct uio else doio = vn_write; vp = fp->f_vnode; - foffset_lock(fp, uio, flags); + foffset_lock_uio(fp, uio, flags); if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG || ((mp = vp->v_mount) != NULL && @@ -982,7 +1026,7 @@ out: vn_rangelock_unlock(vp, rl_cookie); free(uio_clone, M_IOV); out_last: - foffset_unlock(fp, uio, flags); + foffset_unlock_uio(fp, uio, flags); return (error); } Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/sys/file.h Mon Jul 2 21:01:03 2012 (r238029) @@ -72,10 +72,25 @@ struct socket; struct file; struct ucred; +#define FOF_OFFSET 0x01 /* Use the offset in uio argument */ +#define FOF_NOLOCK 0x02 /* Do not take FOFFSET_LOCK */ +#define FOF_NEXTOFF 0x04 /* Also update f_nextoff */ +#define FOF_NOUPDATE 0x10 /* Do not update f_offset */ +off_t foffset_lock(struct file *fp, int flags); +void foffset_lock_uio(struct file *fp, struct uio *uio, int flags); +void foffset_unlock(struct file *fp, off_t val, int flags); +void foffset_unlock_uio(struct file *fp, struct uio *uio, int flags); + +static inline off_t +foffset_get(struct file *fp) +{ + + return (foffset_lock(fp, FOF_NOLOCK)); +} + typedef int fo_rdwr_t(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td); -#define FOF_OFFSET 1 /* Use the offset in uio argument */ typedef int fo_truncate_t(struct file *fp, off_t length, struct ucred *active_cred, struct thread *td); typedef int fo_ioctl_t(struct file *fp, u_long com, void *data, Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Jul 2 20:42:43 2012 (r238028) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Jul 2 21:01:03 2012 (r238029) @@ -2865,10 +2865,9 @@ buffered_write(fp, uio, active_cred, fla if (ip->i_devvp != devvp) return (EINVAL); fs = ip->i_fs; + foffset_lock_uio(fp, uio, flags); vfslocked = VFS_LOCK_GIANT(ip->i_vnode->v_mount); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); - if ((flags & FOF_OFFSET) == 0) - uio->uio_offset = fp->f_offset; #ifdef DEBUG if (fsckcmds) { printf("%s: buffered write for block %jd\n", @@ -2893,11 +2892,9 @@ buffered_write(fp, uio, active_cred, fla goto out; } error = bwrite(bp); - if ((flags & FOF_OFFSET) == 0) - fp->f_offset = uio->uio_offset; - fp->f_nextoff = uio->uio_offset; out: VOP_UNLOCK(devvp, 0); VFS_UNLOCK_GIANT(vfslocked); + foffset_unlock_uio(fp, uio, flags | FOF_NEXTOFF); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:02: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 35BFA1065674; Mon, 2 Jul 2012 21:02:40 +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 830DB8FC0C; Mon, 2 Jul 2012 21:02:39 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id q62L1NRB077262; Mon, 2 Jul 2012 16:01:23 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id q62L1NLr077261; Mon, 2 Jul 2012 16:01:23 -0500 (CDT) (envelope-from brooks) Date: Mon, 2 Jul 2012 16:01:23 -0500 From: Brooks Davis To: Warner Losh Message-ID: <20120702210123.GB74604@lor.one-eyed-alien.net> References: <201207010522.q615MDEX067605@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f2QGlHpHGjS2mn6Y" Content-Disposition: inline In-Reply-To: <201207010522.q615MDEX067605@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: r237875 - head/sys/geom 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, 02 Jul 2012 21:02:40 -0000 --f2QGlHpHGjS2mn6Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2012 at 05:22:13AM +0000, Warner Losh wrote: > Author: imp > Date: Sun Jul 1 05:22:13 2012 > New Revision: 237875 > URL: http://svn.freebsd.org/changeset/base/237875 >=20 > Log: > Use %j to match intmax_t. Thanks for fixing this, sorry for the breakage. -- Brooks --f2QGlHpHGjS2mn6Y Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFP8gwjXY6L6fI4GtQRAo3CAKDRTdwZGloj1tdMTQOhqJobqBQxxwCdFsac einALPNBh3uVbH3wW1+oy8Q= =4CfF -----END PGP SIGNATURE----- --f2QGlHpHGjS2mn6Y-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:04: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 5A0EF106566B; Mon, 2 Jul 2012 21:04:39 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 377B18FC14; Mon, 2 Jul 2012 21:04:39 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q62L4cfA085933; Mon, 2 Jul 2012 14:04:38 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q62L4cN1085932; Mon, 2 Jul 2012 14:04:38 -0700 (PDT) (envelope-from obrien) Date: Mon, 2 Jul 2012 14:04:38 -0700 From: "David O'Brien" To: Pedro Giffuni Message-ID: <20120702210438.GA85618@dragon.NUXI.org> References: <20120629152109.GA70522@dragon.NUXI.org> <1340989748.73663.YahooMailClassic@web113504.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1340989748.73663.YahooMailClassic@web113504.mail.gq1.yahoo.com> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? Precedence: bulk User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Reply-To: obrien@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, 02 Jul 2012 21:04:40 -0000 On Fri, Jun 29, 2012 at 10:09:08AM -0700, Pedro Giffuni wrote: > You are absolutely right. However I am not sure we should > bring Illumos enhancements under the opensolaris vendor > branch. The reason is that this files are CDDL'd but are > there was no property assignment done to the OpenSolaris > copyright owner. [1] I've closely followed the Illumos project (if you're every visiting the Silicon Valley at the right time they have some good usergroup talks). At this point Illumos is the continuation of OpenSolaris. When Solaris 11 came out there was a discussion about if Oracle will fulfill the statement in their leaked email about publishing sources again. There is little to no hope in the Illumos community this will ever happen. [http://www.listbox.com/member/archive/182180/2011/11/sort/thread/page/1/ "Solaris 11 released -- chances of source code to follow?"] [https://blogs.oracle.com/orasysat/entry/summary_of_the_solaris_11 "Any plans to release Solaris 11 source code? i.e. opensolaris?" So I am comfortable with using the Illumos repository as the master source for '^/vendor{,-sys}/opensolaris'. But I recognize not everyone may feel this way. So we should discuss how to handle OpenSolaris-derived Intellectual Property. It may be conceptually cleaner to import into '^/vendor{,-sys}/illumos', but I believe that will cause issues with importing updates to existing files (e.g., r237458) as the 'svn merge' from '^/vendor{,-sys}' will get messy. I believe we may have to resort to a three-way merge using "--ignore-ancestry" -- something I don't believe we want to do. Thus I think this needs to be discussed with the repo Meisters. > If somehow Oracle decides to relicense Dtrace or ZFS we > still must keep these changes isolated from the code > provided in the vendor branch. I don't quite follow. Lets suppose we don't import anything from Illumos, but wait for the Solaris 11 code drop. Should DTrace or ZFS be relicensed, IMHO it should still get imported into '^/vendor{,-sys}/opensolaris' as that is the progression of that Intellectual Property. '^/vendor{,-sys}/opensolaris' states no license. What we would have to do is 'svn move' the resulting merge outside of 'head/{,sys}/cddl/'. > I think we have to decide if we are going to consider > Illumos a vendor on it's own. For ZFS it would seem > the right thing to do, for Dtrace I am not sure: at > least I am not considering bringing any other feature > at this time. Given the number of primary authors & architects of both ZFS and DTrace that have left Oracle/Sun, the works of those folks are the things I believe FreeBSD is interested in. In fact the ZFS Working Group is external to Oracle and Solaris. Doesn't this commit of yours which brought in new DTrace work by Joyent (likely Brendan Gregg or Bryan Cantrill) show this point? Perhaps we should do an 'svn move' of '^/vendor{,-sys}/opensolaris' to '^/vendor{,-sys}/illumos'? What are your thoughts? -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:09:32 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 8FAAA106566B; Mon, 2 Jul 2012 21:09:32 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 68A9A8FC08; Mon, 2 Jul 2012 21:09:32 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q62L9V4j087490; Mon, 2 Jul 2012 14:09:31 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q62L9V6o087488; Mon, 2 Jul 2012 14:09:31 -0700 (PDT) (envelope-from obrien) Date: Mon, 2 Jul 2012 14:09:31 -0700 From: "David O'Brien" To: Doug Barton Message-ID: <20120702210931.GB85618@dragon.NUXI.org> References: <1340992732.19144.YahooMailClassic@web113501.mail.gq1.yahoo.com> <4FF11659.8060405@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FF11659.8060405@FreeBSD.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, George Neville-Neil , pfg@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@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, 02 Jul 2012 21:09:32 -0000 On Sun, Jul 01, 2012 at 08:32:41PM -0700, Doug Barton wrote: > On 06/29/2012 10:58, Pedro Giffuni wrote: > > Now .. David pointed out I am not respecting the code > > provenance since I didn't add them to the opensolaris > > vendor area, but these files are copyrighted Joyent > > Inc (not even Illumos) so I cannot put them there > > unless we create a new vendor for Joyent > > Creating a new vendor area would be the right solution, yes. I totally disagree -- it will cause a real pain merging. Think about it -- if we import a new code drop of uts/common/fs/zfs/*.c into '^/vendor-sys/illumos', how do we merge that to HEAD? I don't believe 'svn merge -c ' will work because we already have a different uts/common/fs/zfs/*.c from ^/vendor-sys/opensolaris. I think we either need to just call Illumos OpenSolaris for these purposes, or 'svn move opensolaris illumos'. I think this needs to be discussed with the Repo Meisters. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:11: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 01557106566B; Mon, 2 Jul 2012 21:11:02 +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 E1FA78FC12; Mon, 2 Jul 2012 21:11: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 q62LB1QH099755; Mon, 2 Jul 2012 21:11:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62LB1HK099753; Mon, 2 Jul 2012 21:11:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022111.q62LB1HK099753@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 21:11: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: r238030 - head/sys/powerpc/booke 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, 02 Jul 2012 21:11:02 -0000 Author: marcel Date: Mon Jul 2 21:11:01 2012 New Revision: 238030 URL: http://svn.freebsd.org/changeset/base/238030 Log: Implement cpu_flush_dcache(). This allows us to optimize __syncicache() for the common case in chich D-caches are coherent by virtue of busdma. Modified: head/sys/powerpc/booke/machdep.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Mon Jul 2 21:01:03 2012 (r238029) +++ head/sys/powerpc/booke/machdep.c Mon Jul 2 21:11:01 2012 (r238030) @@ -473,7 +473,24 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu void cpu_flush_dcache(void *ptr, size_t len) { - /* TBD */ + register_t addr, off; + + /* + * Align the address to a cacheline and adjust the length + * accordingly. Then round the length to a multiple of the + * cacheline for easy looping. + */ + addr = (uintptr_t)ptr; + off = addr & (cacheline_size - 1); + addr -= off; + len = (len + off + cacheline_size - 1) & ~(cacheline_size - 1); + + while (len > 0) { + __asm __volatile ("dcbf 0,%0" :: "r"(addr)); + __asm __volatile ("sync"); + addr += cacheline_size; + len -= cacheline_size; + } } void From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:15: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 91E6B106566B; Mon, 2 Jul 2012 21:15:57 +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 7EAC78FC08; Mon, 2 Jul 2012 21:15: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 q62LFvtP000118; Mon, 2 Jul 2012 21:15:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62LFvqW000116; Mon, 2 Jul 2012 21:15:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022115.q62LFvqW000116@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 21:15: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: r238031 - head/sys/powerpc/booke 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, 02 Jul 2012 21:15:57 -0000 Author: marcel Date: Mon Jul 2 21:15:56 2012 New Revision: 238031 URL: http://svn.freebsd.org/changeset/base/238031 Log: Invalidate any TLB1 entries we don't need. The firmware (e.g. U-Boot) may have added entries that conflict with TLB0 entries. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Jul 2 21:11:01 2012 (r238030) +++ head/sys/powerpc/booke/pmap.c Mon Jul 2 21:15:56 2012 (r238031) @@ -3042,6 +3042,10 @@ tlb1_init(vm_offset_t ccsrbar) /* Map in CCSRBAR. */ tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO); + /* Purge the remaining entries */ + for (i = tlb1_idx; i < TLB1_ENTRIES; i++) + tlb1_write_entry(i); + /* Setup TLB miss defaults */ set_mas4_defaults(); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:18: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 3662E10656AE; Mon, 2 Jul 2012 21:18:10 +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 233908FC0C; Mon, 2 Jul 2012 21:18: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 q62LI9m2000246; Mon, 2 Jul 2012 21:18:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62LI9q2000244; Mon, 2 Jul 2012 21:18:09 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022118.q62LI9q2000244@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 21:18: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: r238032 - head/sys/powerpc/booke 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, 02 Jul 2012 21:18:10 -0000 Author: marcel Date: Mon Jul 2 21:18:09 2012 New Revision: 238032 URL: http://svn.freebsd.org/changeset/base/238032 Log: Handle traps from the debugger. We need to catch them and re-enter the debugger where they're being taken care of. Modified: head/sys/powerpc/booke/trap.c Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Mon Jul 2 21:15:56 2012 (r238031) +++ head/sys/powerpc/booke/trap.c Mon Jul 2 21:18:09 2012 (r238032) @@ -143,6 +143,13 @@ trap(struct trapframe *frame) int sig, type, user; ksiginfo_t ksi; +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return; + } +#endif + PCPU_INC(cnt.v_trap); td = curthread; From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:21:13 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 3CE9B106566B; Mon, 2 Jul 2012 21:21:13 +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 2A62D8FC17; Mon, 2 Jul 2012 21:21:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62LLDxX000403; Mon, 2 Jul 2012 21:21:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62LLCPq000401; Mon, 2 Jul 2012 21:21:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022121.q62LLCPq000401@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 21:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238033 - head/sys/powerpc/booke 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, 02 Jul 2012 21:21:13 -0000 Author: marcel Date: Mon Jul 2 21:21:12 2012 New Revision: 238033 URL: http://svn.freebsd.org/changeset/base/238033 Log: Fix a typo that resulted in or-ing PTE_UW twice whrn PTE_SW was needed. Note that setting the PTE_MODIFIED bit based on whether write is possible is incorrect. We should set PTE_MODIFIED based on whether the access is a write operation. Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Mon Jul 2 21:18:09 2012 (r238032) +++ head/sys/powerpc/booke/trap_subr.S Mon Jul 2 21:21:12 2012 (r238033) @@ -668,7 +668,7 @@ tlb_fill_entry: lwarx %r21, %r23, %r25 /* get pte->flags */ oris %r21, %r21, PTE_REFERENCED@h /* set referenced bit */ - andi. %r22, %r21, (PTE_UW | PTE_UW)@l /* check if writable */ + andi. %r22, %r21, (PTE_SW | PTE_UW)@l /* check if writable */ beq 2f oris %r21, %r21, PTE_MODIFIED@h /* set modified bit */ 2: From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:25: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 8F81C106566C; Mon, 2 Jul 2012 21:25:25 +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 637A18FC0A; Mon, 2 Jul 2012 21:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q62LPPtF000618; Mon, 2 Jul 2012 21:25:25 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62LPPpH000614; Mon, 2 Jul 2012 21:25:25 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022125.q62LPPpH000614@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 21:25: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: r238034 - head/sys/powerpc/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: Mon, 02 Jul 2012 21:25:25 -0000 Author: marcel Date: Mon Jul 2 21:25:24 2012 New Revision: 238034 URL: http://svn.freebsd.org/changeset/base/238034 Log: Remove device uart_z8530 and options GEOM_PART_APM from DEFAULTS and instead add them to GENERIC and GENERIC64. They are applicable to Apple H/W and not at all for Book-E platforms. Modified: head/sys/powerpc/conf/DEFAULTS head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/DEFAULTS ============================================================================== --- head/sys/powerpc/conf/DEFAULTS Mon Jul 2 21:21:12 2012 (r238033) +++ head/sys/powerpc/conf/DEFAULTS Mon Jul 2 21:25:24 2012 (r238034) @@ -8,9 +8,7 @@ device mem # Memory and kernel memory # UART chips on this platform device uart_ns8250 -device uart_z8530 -options GEOM_PART_APM options GEOM_PART_MBR options NEW_PCIB Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Mon Jul 2 21:21:12 2012 (r238033) +++ head/sys/powerpc/conf/GENERIC Mon Jul 2 21:25:24 2012 (r238034) @@ -49,6 +49,7 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework +options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization options COMPAT_FREEBSD4 #Keep this for a while @@ -127,6 +128,7 @@ makeoptions SC_DFLT_FONT=cp437 # Serial (COM) ports device scc device uart +device uart_z8530 # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Mon Jul 2 21:21:12 2012 (r238033) +++ head/sys/powerpc/conf/GENERIC64 Mon Jul 2 21:25:24 2012 (r238034) @@ -49,6 +49,7 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework +options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpc binaries @@ -125,6 +126,7 @@ makeoptions SC_DFLT_FONT=cp437 # Serial (COM) ports device scc device uart +device uart_z8530 # Ethernet hardware device glc # Sony Playstation 3 Ethernet From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 21:58: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 B02B510657E8; Mon, 2 Jul 2012 21:58:48 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from emx.nitro.dk (emx.nitro.dk [IPv6:2a01:4f8:120:7384::102]) by mx1.freebsd.org (Postfix) with ESMTP id 675468FC0A; Mon, 2 Jul 2012 21:58:48 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id BE3EE20E1EA; Mon, 2 Jul 2012 21:58:47 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id zo01hcShrLbT; Mon, 2 Jul 2012 21:58:45 +0000 (UTC) Received: from [192.168.4.24] (unknown [89.100.2.68]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id 4A89420E1E3; Mon, 2 Jul 2012 21:58:45 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: "Simon L. B. Nielsen" In-Reply-To: <1341143053.16744.YahooMailClassic@web113519.mail.gq1.yahoo.com> Date: Mon, 2 Jul 2012 22:58:43 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1341143053.16744.YahooMailClassic@web113519.mail.gq1.yahoo.com> To: pfg@freebsd.org 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: r237860 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 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, 02 Jul 2012 21:58:48 -0000 On 1 Jul 2012, at 12:44, Pedro Giffuni wrote: >=20 >=20 > --- Dom 1/7/12, Simon L. B. Nielsen ha scritto: > ... >> Data: Domenica 1 luglio 2012, 05:05 >>=20 >> On 1 Jul 2012, at 01:36, Pedro F. Giffuni wrote: >>=20 >>> Author: pfg >>> Date: Sun Jul 1 00:36:07 2012 >>> New Revision: 237860 >>> URL: http://svn.freebsd.org/changeset/base/237860 >>>=20 >>> Log: >>> Import the dtrace llquantize test files from the vendor area. >>>=20 >>> Now that we have an illumos vendor area, import the llquantize >>> test files directly from there to make it easier to track the >>> code provenance. >>>=20 >>> Special thanks to Martin Matuska for populating the illumos >>> vendor area. >>>=20 >>> Requested by: obrien >>>=20 >>> Replaced: >>> =20 >> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/ >>> - copied from r237859, >> vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/ >>=20 >>=20 >> Don't replace files, and even worse directories, and it >> breaks svn2cvs. >>=20 >> --=20 >=20 > Sorry, > I though SVN would do the same I did: first remove, > then copy. I guess I should do it in two commits next > time. For the time being, yes please. svn2cvs should handle replaced files, = but it doesn't and so far nobody has had the time to fix it. > Ps. I didnt see this mentioned in our svn primer We probably forgot documenting this as we sort of hoped it would be = fixed, and there have been a couple of reminder to developers@ over the = years, which of course doesn't help "newer" people. --=20 Simon L. B. Nielsen From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 22:14: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 7C5A01065673; Mon, 2 Jul 2012 22:14:59 +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 697398FC19; Mon, 2 Jul 2012 22:14: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 q62MExBH002968; Mon, 2 Jul 2012 22:14:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62MExbh002966; Mon, 2 Jul 2012 22:14:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207022214.q62MExbh002966@svn.freebsd.org> From: Doug Barton Date: Mon, 2 Jul 2012 22:14: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: r238038 - 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: Mon, 02 Jul 2012 22:14:59 -0000 Author: dougb Date: Mon Jul 2 22:14:58 2012 New Revision: 238038 URL: http://svn.freebsd.org/changeset/base/238038 Log: Unfortunately the change in r237958 resulted in s/install/instclean/ due to the aggressive pattern matching of the :C modifier. I tested build and install in 2 phases, however with different solutions, resulting in the breakage. Mea culpa. The solution is to break out the all: target. This causes a few lines of code duplication, but now the all: target works as it should, and the other targets continue to work as they did before. While I'm here, add a ===> header line to the start of each port build to make it easier to find/more clear in the logs. Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Mon Jul 2 22:04:09 2012 (r238037) +++ head/sys/conf/kern.post.mk Mon Jul 2 22:14:58 2012 (r238038) @@ -60,11 +60,21 @@ PORTSMODULESENV=\ SRC_BASE=${SRC_BASE} \ OSVERSION=${OSRELDATE} \ WRKDIRPREFIX=${WRKDIRPREFIX} -.for __target in all install reinstall clean + +# The WRKDIR needs to be cleaned before building, and trying to change the target +# with a :C pattern below results in install -> instclean +all: +.for __i in ${PORTS_MODULES} + @${ECHO} "===> Ports module ${__i} (all)" + cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean all +.endfor + +.for __target in install reinstall clean ${__target}: ports-${__target} ports-${__target}: .for __i in ${PORTS_MODULES} - cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/all/clean all/:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/} + @${ECHO} "===> Ports module ${__i} (${__target})" + cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/} .endfor .endfor .endif From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 23:12:27 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 E4E77106564A for ; Mon, 2 Jul 2012 23:12:27 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm8.bullet.mail.sp2.yahoo.com (nm8.bullet.mail.sp2.yahoo.com [98.139.91.78]) by mx1.freebsd.org (Postfix) with SMTP id B8F418FC0C for ; Mon, 2 Jul 2012 23:12:27 +0000 (UTC) Received: from [98.139.91.61] by nm8.bullet.mail.sp2.yahoo.com with NNFMP; 02 Jul 2012 23:12:27 -0000 Received: from [98.139.91.3] by tm1.bullet.mail.sp2.yahoo.com with NNFMP; 02 Jul 2012 23:10:27 -0000 Received: from [127.0.0.1] by omp1003.mail.sp2.yahoo.com with NNFMP; 02 Jul 2012 23:10:27 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 250109.20620.bm@omp1003.mail.sp2.yahoo.com Received: (qmail 15843 invoked by uid 60001); 2 Jul 2012 23:10:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1341270626; bh=+ogp/ASQWkOEFDYYRzWgZ57UzG6yZuboaqlkTwPHOQY=; 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=q3SbWD2bDP4Jebl62lVVB2e/OI20KlgcY1zw4OybRjhIOaQcnmN4AAxOocienUYwcouR5n+rf4jh61eeA/GeFA7gufBmh5yhV33q/VadHcf4U+iN/slC1Ot/AvBgzeAZ+uCkUpHd5xD16xtCsZ8vsEro7ra8KIfXb5yykN4ZKTw= X-YMail-OSG: RAqCuCYVM1loEpSmPEMTJo_lfNi5ScI1He6ZRsuMOOHfMjK PKjjveF2g2W1HAQCR3pVUJMbrldLPxa57ZOLgNw0ElcV_7sF0WMRRe67hA5x C6C_YaNuYkFor83vlFaklHeRSgrTPRQb6YJ1hQXeyA2u7npXRtgf1GtjX.iW KquTdvNqYQcdJm8DNE3tKNZ1NW6.SKOYqE8Z27toGrDEDNaJ.kvhKQGV8q9j FrBqkVdTMfndDhsmvjhFv0K2k6SsrtXNlD.jXZ9bimJuSONzmY9U.WwSmKOc 7lKsvjtYyU0nHZnBmVJuHSXO3FlSZINkmZJD9rSykP2tCNUc83XTeX5WcJSe bluUymq83PivQ3VSWA5zodEhuVBwlvgpBtoH0oHl3oBUt6TNdu.ZxjlGeXFM ozX8eX3RSkAE23HehdqGL.sdmG_OSpgDi_2Sgm.iNmFqaz3VJXZ9gd54g3s2 JWgch Received: from [200.118.157.7] by web113509.mail.gq1.yahoo.com via HTTP; Mon, 02 Jul 2012 16:10:26 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.8 YahooMailWebService/0.8.118.349524 Message-ID: <1341270626.1322.YahooMailClassic@web113509.mail.gq1.yahoo.com> Date: Mon, 2 Jul 2012 16:10:26 -0700 (PDT) From: Pedro Giffuni To: obrien@freebsd.org In-Reply-To: <20120702210438.GA85618@dragon.NUXI.org> 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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... 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, 02 Jul 2012 23:12:28 -0000 =0A=0A--- Lun 2/7/12, David O'Brien ha scritto:=0A...= =0A> =0A> At this point Illumos is the continuation of OpenSolaris.=0A> Whe= n Solaris 11 came out there was a discussion about if=0A> Oracle will fulfi= ll the statement in their leaked email=0A> about publishing sources again.= =A0 There is little to no=0A> hope in the Illumos community this will ever = happen.=0A=0AI tend to agree with the Illumos community on that however=0Aw= e may still be seeing some movement in that area. Oracle=0Ahas a linux dist= ribution and commercial interests are=0Aalways strong in unpredicable ways.= =0A=0AOracle has been porting Dtrace to Linux. Apparently they=0Awill be ad= opting dual GPLv2/CDDL for some few kernel=0Astuff and CDDL only for the ma= in code, but just the same=0Athere may be some stuff we want to take from t= hem.=0A=0A> =0A> It may be conceptually cleaner to import into=0A> '^/vendo= r{,-sys}/illumos', but I believe that will cause=0A> issues with importing = updates to existing files=0A> (e.g., r237458) as the 'svn merge'=0A> from '= ^/vendor{,-sys}' will get messy.=A0 I believe we=0A> may have to resort=0A>= to a three-way merge using "--ignore-ancestry" -- something=0A> I don't be= lieve we want to do.=0A> =0A=0AI think Martin Matuska did exactly the right= thing:=0Ahe created the illumos vendor branch starting from=0Athe opensola= ris branch.=0A=0A> Thus I think this needs to be discussed with the repo=0A= > Meisters.=0A> =0A> =0A> > If somehow Oracle decides to relicense Dtrace o= r ZFS=0A> we=0A> > still must keep these changes isolated from the code=0A>= > provided in the vendor branch.=0A> =0A> I don't quite follow.=0A> =0A> L= ets suppose we don't import anything from Illumos, but wait=0A> for the=0A>= Solaris 11 code drop.=A0 Should DTrace or ZFS be=0A> relicensed, IMHO it= =0A> should still get imported into '^/vendor{,-sys}/opensolaris'=0A> as th= at=0A> is the progression of that Intellectual Property.=0A> '^/vendor{,-sy= s}/opensolaris' states no license.=A0 What=0A> we would have to=0A> do is '= svn move' the resulting merge outside of=0A> 'head/{,sys}/cddl/'.=0A> =0A> = =0A> =0A> > I think we have to decide if we are going to consider=0A> > Ill= umos a vendor on it's own. For ZFS it would seem=0A> > the right thing to d= o, for Dtrace I am not sure: at=0A> > least I am not considering bringing a= ny other feature=0A> > at this time.=0A> =0A> Given the number of primary a= uthors & architects of both=0A> ZFS and=0A> DTrace that have left Oracle/Su= n, the works of those folks=0A> are the=0A> things I believe FreeBSD is int= erested in.=A0 In fact the=0A> ZFS Working=0A> Group is external to Oracle = and Solaris.=0A> =0A=0AI am somewhat biased here because I am a committer i= n=0AApache OpenOffice and I have find it very valuable that=0ASUN/Oracle ke= pt the Contributor License Agreements in=0Aplace to effectively permit reli= censing.=0A=0AConcerning ZFS: the main developer of the encryption stuff=0A= did stay at Oracle. At this time that code will not be seen=0Ain the open (= apparently there was a Solaris 11 source leak=0Abut that's not something we= can touch), but we just never=0Aknow.=0A=0A> Doesn't this commit of yours = which brought in new DTrace=0A> work by Joyent=0A> (likely Brendan Gregg or= Bryan Cantrill) show this point?=0A> =0A> Perhaps we should do an 'svn mov= e' of=0A> '^/vendor{,-sys}/opensolaris'=0A> to '^/vendor{,-sys}/illumos'?= =0A> =0A=0AIllumos is a fork so svn copy works just fine for this, plus=0Ac= opying is a very cheap operation in SVN.=0A=0ACheers,=0A=0APedro. From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 23:41:57 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 1C1CF1065673; Mon, 2 Jul 2012 23:41:57 +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 F1B228FC08; Mon, 2 Jul 2012 23:41: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 q62Nfus4006744; Mon, 2 Jul 2012 23:41:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62NfuPe006742; Mon, 2 Jul 2012 23:41:56 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022341.q62NfuPe006742@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 23:41: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: r238042 - head/sys/powerpc/mpc85xx 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, 02 Jul 2012 23:41:57 -0000 Author: marcel Date: Mon Jul 2 23:41:56 2012 New Revision: 238042 URL: http://svn.freebsd.org/changeset/base/238042 Log: Properly implement the bus_config_intr, bus_setup_intr and bus_teardown_intr methods so that MI drvers can depend on us doing the right thing instead of having to go around us and call MD code directly. See the FDT code for example (not for long though). Modified: head/sys/powerpc/mpc85xx/nexus.c Modified: head/sys/powerpc/mpc85xx/nexus.c ============================================================================== --- head/sys/powerpc/mpc85xx/nexus.c Mon Jul 2 22:19:02 2012 (r238041) +++ head/sys/powerpc/mpc85xx/nexus.c Mon Jul 2 23:41:56 2012 (r238042) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* * Device interface */ @@ -75,6 +77,13 @@ static int nexus_activate_resource(devic static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_config_intr(device_t, int, enum intr_trigger, + enum intr_polarity); +static int nexus_setup_intr(device_t, device_t, struct resource *, int, + driver_filter_t *, driver_intr_t *, void *, void **); +static int nexus_teardown_intr(device_t, device_t, struct resource *, + void *); + static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_probe), @@ -89,8 +98,9 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_probe_nomatch, NULL), DEVMETHOD(bus_read_ivar, NULL), DEVMETHOD(bus_write_ivar, NULL), - DEVMETHOD(bus_setup_intr, NULL), - DEVMETHOD(bus_teardown_intr, NULL), + DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_setup_intr, nexus_setup_intr), + DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_alloc_resource, NULL), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -143,3 +153,49 @@ nexus_deactivate_resource(device_t bus, /* Not much to be done yet... */ return (rman_deactivate_resource(res)); } + +static int +nexus_config_intr(device_t bus, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (powerpc_config_intr(irq, trig, pol)); +} + +static int +nexus_setup_intr(device_t bus, device_t child, struct resource *res, int flags, + driver_filter_t *ifilt, driver_intr_t *ihand, void *arg, void **cookiep) +{ + int error; + + *cookiep = NULL; + + /* somebody tried to setup an irq that failed to allocate! */ + if (res == NULL) + return (EINVAL); + + if ((rman_get_flags(res) & RF_SHAREABLE) == 0) + flags |= INTR_EXCL; + + /* We depend on rman_activate_resource() being idempotent. */ + error = rman_activate_resource(res); + if (error) + return (error); + + error = powerpc_setup_intr(device_get_nameunit(child), + rman_get_start(res), ifilt, ihand, arg, flags, cookiep); + return (error); +} + +static int +nexus_teardown_intr(device_t bus, device_t child, struct resource *res, + void *cookie) +{ + int error; + + if (res == NULL) + return (EINVAL); + + error = powerpc_teardown_intr(cookie); + return (error); +} From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 23:49: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 96848106566B; Mon, 2 Jul 2012 23:49:29 +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 82FB58FC14; Mon, 2 Jul 2012 23:49: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 q62NnTTO007082; Mon, 2 Jul 2012 23:49:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62NnTAH007080; Mon, 2 Jul 2012 23:49:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022349.q62NnTAH007080@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 23:49: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: r238043 - head/sys/dev/fdt 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, 02 Jul 2012 23:49:29 -0000 Author: marcel Date: Mon Jul 2 23:49:29 2012 New Revision: 238043 URL: http://svn.freebsd.org/changeset/base/238043 Log: Properly implement bus_setup_intr so that it handles the configuration of interrupts of direct children. Have the bus_config_intr and bus_teardown_intr methods implemented by bus_generic_config_intr and bus_generic_teardown_intr (resp) as we don't need to do anything special outselves. This removes all the ``#ifdef $arch'' code that was there because powerpc didn't have a proper nexus and people tend to copy and paste stuff. Modified: head/sys/dev/fdt/fdtbus.c Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Mon Jul 2 23:41:56 2012 (r238042) +++ head/sys/dev/fdt/fdtbus.c Mon Jul 2 23:49:29 2012 (r238043) @@ -89,8 +89,6 @@ static int fdtbus_deactivate_resource(de struct resource *); static int fdtbus_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); -static int fdtbus_teardown_intr(device_t, device_t, struct resource *, - void *); static const char *fdtbus_ofw_get_name(device_t, device_t); static phandle_t fdtbus_ofw_get_node(device_t, device_t); @@ -121,8 +119,9 @@ static device_method_t fdtbus_methods[] DEVMETHOD(bus_release_resource, fdtbus_release_resource), DEVMETHOD(bus_activate_resource, fdtbus_activate_resource), DEVMETHOD(bus_deactivate_resource, fdtbus_deactivate_resource), + DEVMETHOD(bus_config_intr, bus_generic_config_intr), DEVMETHOD(bus_setup_intr, fdtbus_setup_intr), - DEVMETHOD(bus_teardown_intr, fdtbus_teardown_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* OFW bus interface */ DEVMETHOD(ofw_bus_get_node, fdtbus_ofw_get_node), @@ -575,30 +574,41 @@ fdtbus_setup_intr(device_t bus, device_t int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) { - int err; + struct fdtbus_devinfo *di; + enum intr_trigger trig; + enum intr_polarity pol; + int error, rid; + + if (res == NULL) + return (EINVAL); - *cookiep = 0; - if ((rman_get_flags(res) & RF_SHAREABLE) == 0) - flags |= INTR_EXCL; - - err = rman_activate_resource(res); - if (err) - return (err); - -#if defined(__powerpc__) - err = powerpc_setup_intr(device_get_nameunit(child), - rman_get_start(res), filter, ihand, arg, flags, cookiep); -#elif defined(__mips__) - cpu_establish_hardintr(device_get_nameunit(child), - filter, ihand, arg, rman_get_start(res), flags, cookiep); -#elif defined(__arm__) - arm_setup_irqhandler(device_get_nameunit(child), - filter, ihand, arg, rman_get_start(res), flags, cookiep); - arm_unmask_irq(rman_get_start(res)); - err = 0; -#endif + /* + * We are responsible for configuring the interrupts of our direct + * children. + */ + if (device_get_parent(child) == bus) { + di = device_get_ivars(child); + if (di == NULL) + return (ENXIO); + + rid = rman_get_rid(res); + if (rid >= DI_MAX_INTR_NUM) + return (ENOENT); + + trig = di->di_intr_sl[rid].trig; + pol = di->di_intr_sl[rid].pol; + if (trig != INTR_TRIGGER_CONFORM || + pol != INTR_POLARITY_CONFORM) { + error = bus_generic_config_intr(bus, + rman_get_start(res), trig, pol); + if (error) + return (error); + } + } - return (err); + error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand, + arg, cookiep); + return (error); } static int @@ -617,21 +627,6 @@ fdtbus_deactivate_resource(device_t bus, return (rman_deactivate_resource(res)); } -static int -fdtbus_teardown_intr(device_t bus, device_t child, struct resource *res, - void *cookie) -{ - -#if defined(__powerpc__) - return (powerpc_teardown_intr(cookie)); -#elif defined(__mips__) - /* mips does not have a teardown yet */ - return (0); -#elif defined(__arm__) - return (arm_remove_irqhandler(rman_get_start(res), cookie)); -#endif -} - static const char * fdtbus_ofw_get_name(device_t bus, device_t dev) { From owner-svn-src-head@FreeBSD.ORG Mon Jul 2 23:53: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 1CE791065673; Mon, 2 Jul 2012 23:53:09 +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 E570C8FC1A; Mon, 2 Jul 2012 23:53: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 q62Nr8Jt007264; Mon, 2 Jul 2012 23:53:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q62Nr8a2007262; Mon, 2 Jul 2012 23:53:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207022353.q62Nr8a2007262@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jul 2012 23:53: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: r238044 - head/sys/dev/fdt 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, 02 Jul 2012 23:53:09 -0000 Author: marcel Date: Mon Jul 2 23:53:08 2012 New Revision: 238044 URL: http://svn.freebsd.org/changeset/base/238044 Log: Simplify simplebus_setup_intr and don't call MD code directly. We can (and have to) trust our parent to handle interrupt configuration. Modified: head/sys/dev/fdt/simplebus.c Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Mon Jul 2 23:49:29 2012 (r238043) +++ head/sys/dev/fdt/simplebus.c Mon Jul 2 23:53:08 2012 (r238044) @@ -288,39 +288,34 @@ simplebus_setup_intr(device_t bus, devic struct simplebus_devinfo *di; enum intr_trigger trig; enum intr_polarity pol; - int irq, rid; + int error, rid; - if (res == NULL) - panic("simplebus_setup_intr: NULL irq resource!"); + if (device_get_parent(child) != bus) + return (ECHILD); - rid = rman_get_rid(res); - if (rid > DI_MAX_INTR_NUM) { - device_printf(child, "rid out of range rid = %d\n", rid); - return (ERANGE); - } + di = device_get_ivars(child); + if (di == NULL) + return (ENXIO); - irq = rman_get_start(res); + if (res == NULL) + return (EINVAL); - if ((di = device_get_ivars(child)) == NULL) { - device_printf(child, "could not retrieve devinfo\n"); - return (ENXIO); - } + rid = rman_get_rid(res); + if (rid >= DI_MAX_INTR_NUM) + return (ENOENT); trig = di->di_intr_sl[rid].trig; pol = di->di_intr_sl[rid].pol; + if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) { + error = bus_generic_config_intr(bus, rman_get_start(res), + trig, pol); + if (error) + return (error); + } - debugf("intr config: irq = %d, trig = %d, pol = %d\n", irq, trig, pol); - -#if defined(__powerpc__) - int err; - - err = powerpc_config_intr(irq, trig, pol); - if (err) - return (err); -#endif - - return (bus_generic_setup_intr(bus, child, res, flags, filter, ihand, - arg, cookiep)); + error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand, + arg, cookiep); + return (error); } static const struct ofw_bus_devinfo * From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 00:06:15 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 3ABAB1065670; Tue, 3 Jul 2012 00:06:15 +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 263308FC14; Tue, 3 Jul 2012 00:06: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 q6306E0J007850; Tue, 3 Jul 2012 00:06:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6306EDD007847; Tue, 3 Jul 2012 00:06:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207030006.q6306EDD007847@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 3 Jul 2012 00:06: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: r238045 - head/sys/powerpc/mpc85xx 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, 03 Jul 2012 00:06:15 -0000 Author: marcel Date: Tue Jul 3 00:06:14 2012 New Revision: 238045 URL: http://svn.freebsd.org/changeset/base/238045 Log: Support lbc interrupts: o Save and clear the LTESR register in the interrupt handler. o In lbc_read_reg(), return the saved LTESR register value if applicable (i.e. when the saved value is not invalid (read: ~0U)). o In lbc_write_reg(), clear the bits in the saved register when when it's written to and when the asved value is not invalid. o Also in lbc_write_reg(), the LTESR register is unlocked (in H/W) when bit 1 of LTEATR is cleared. We use this to invalidate our saved LTESR register value. Subsequent reads and write go to H/W directly. While here: o In lbc_read_reg() & lbc_write_reg(), add some belts and suspenders to catch when register offsets are out of range. o In lbc_attach(), initialize completely and don't leave something left for lbc_banks_enable(). Modified: head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/mpc85xx/lbc.h Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Mon Jul 2 23:53:08 2012 (r238044) +++ head/sys/powerpc/mpc85xx/lbc.c Tue Jul 3 00:06:14 2012 (r238045) @@ -273,13 +273,8 @@ lbc_banks_enable(struct lbc_softc *sc) for (i = 0; i < LBC_DEV_MAX; i++) { size = sc->sc_banks[i].size; - if (size == 0) { - bus_space_write_4(sc->sc_bst, sc->sc_bsh, - LBC85XX_BR(i), 0); - bus_space_write_4(sc->sc_bst, sc->sc_bsh, - LBC85XX_OR(i), 0); + if (size == 0) continue; - } /* * Compute and program BR value. @@ -331,23 +326,6 @@ lbc_banks_enable(struct lbc_softc *sc) LBC85XX_OR(i), regval); } - /* - * Initialize configuration register: - * - enable Local Bus - * - set data buffer control signal function - * - disable parity byte select - * - set ECC parity type - * - set bus monitor timing and timer prescale - */ - bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LBCR, 0); - - /* - * Initialize clock ratio register: - * - disable PLL bypass mode - * - configure LCLK delay cycles for the assertion of LALE - * - set system clock divider - */ - bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LCRR, 0x00030008); return (0); fail: @@ -426,6 +404,18 @@ out: return (rv); } +static void +lbc_intr(void *arg) +{ + struct lbc_softc *sc = arg; + uint32_t ltesr; + + ltesr = bus_space_read_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LTESR); + sc->sc_ltesr = ltesr; + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LTESR, ltesr); + wakeup(sc->sc_dev); +} + static int lbc_probe(device_t dev) { @@ -455,14 +445,59 @@ lbc_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_rid = 0; - sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, + sc->sc_mrid = 0; + sc->sc_mres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_mrid, RF_ACTIVE); - if (sc->sc_res == NULL) + if (sc->sc_mres == NULL) return (ENXIO); - sc->sc_bst = rman_get_bustag(sc->sc_res); - sc->sc_bsh = rman_get_bushandle(sc->sc_res); + sc->sc_bst = rman_get_bustag(sc->sc_mres); + sc->sc_bsh = rman_get_bushandle(sc->sc_mres); + + for (bank = 0; bank < LBC_DEV_MAX; bank++) { + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_BR(bank), 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_OR(bank), 0); + } + + /* + * Initialize configuration register: + * - enable Local Bus + * - set data buffer control signal function + * - disable parity byte select + * - set ECC parity type + * - set bus monitor timing and timer prescale + */ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LBCR, 0); + + /* + * Initialize clock ratio register: + * - disable PLL bypass mode + * - configure LCLK delay cycles for the assertion of LALE + * - set system clock divider + */ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LCRR, 0x00030008); + + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LTEDR, 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LTESR, ~0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LTEIR, 0x64080001); + + sc->sc_irid = 0; + sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->sc_ires != NULL) { + error = bus_setup_intr(dev, sc->sc_ires, + INTR_TYPE_MISC | INTR_MPSAFE, NULL, lbc_intr, sc, + &sc->sc_icookie); + if (error) { + device_printf(dev, "could not activate interrupt\n"); + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irid, + sc->sc_ires); + sc->sc_ires = NULL; + } + } + + sc->sc_ltesr = ~0; + rangesptr = NULL; rm = &sc->sc_rman; @@ -614,7 +649,7 @@ lbc_attach(device_t dev) fail: free(rangesptr, M_OFWPROP); - bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mrid, sc->sc_mres); return (error); } @@ -742,17 +777,49 @@ lbc_get_devinfo(device_t bus, device_t c void lbc_write_reg(device_t child, u_int off, uint32_t val) { + device_t dev; struct lbc_softc *sc; - sc = device_get_softc(device_get_parent(child)); + dev = device_get_parent(child); + + if (off >= 0x1000) { + device_printf(dev, "%s(%s): invalid offset %#x\n", + __func__, device_get_nameunit(child), off); + return; + } + + sc = device_get_softc(dev); + + if (off == LBC85XX_LTESR && sc->sc_ltesr != ~0u) { + sc->sc_ltesr ^= (val & sc->sc_ltesr); + return; + } + + if (off == LBC85XX_LTEATR && (val & 1) == 0) + sc->sc_ltesr = ~0u; bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); } uint32_t lbc_read_reg(device_t child, u_int off) { + device_t dev; struct lbc_softc *sc; + uint32_t val; + + dev = device_get_parent(child); + + if (off >= 0x1000) { + device_printf(dev, "%s(%s): invalid offset %#x\n", + __func__, device_get_nameunit(child), off); + return (~0U); + } + + sc = device_get_softc(dev); - sc = device_get_softc(device_get_parent(child)); - return (bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); + if (off == LBC85XX_LTESR && sc->sc_ltesr != ~0U) + val = sc->sc_ltesr; + else + val = bus_space_read_4(sc->sc_bst, sc->sc_bsh, off); + return (val); } Modified: head/sys/powerpc/mpc85xx/lbc.h ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.h Mon Jul 2 23:53:08 2012 (r238044) +++ head/sys/powerpc/mpc85xx/lbc.h Tue Jul 3 00:06:14 2012 (r238045) @@ -105,10 +105,15 @@ struct lbc_bank { struct lbc_softc { device_t sc_dev; - struct resource *sc_res; + + struct resource *sc_mres; bus_space_handle_t sc_bsh; bus_space_tag_t sc_bst; - int sc_rid; + int sc_mrid; + + int sc_irid; + struct resource *sc_ires; + void *sc_icookie; struct rman sc_rman; @@ -117,6 +122,8 @@ struct lbc_softc { struct lbc_memrange sc_range[LBC_DEV_MAX]; struct lbc_bank sc_banks[LBC_DEV_MAX]; + + uint32_t sc_ltesr; }; struct lbc_devinfo { From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 01:00: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 D1EF5106566B; Tue, 3 Jul 2012 01:00:29 +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 BE73F8FC17; Tue, 3 Jul 2012 01:00: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 q6310TuT010152; Tue, 3 Jul 2012 01:00:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6310TIG010148; Tue, 3 Jul 2012 01:00:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207030100.q6310TIG010148@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 3 Jul 2012 01:00: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: r238046 - in head/sys: conf dev/nand 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, 03 Jul 2012 01:00:29 -0000 Author: marcel Date: Tue Jul 3 01:00:29 2012 New Revision: 238046 URL: http://svn.freebsd.org/changeset/base/238046 Log: Add a driver for the Freescale FCM module in the localbus controller. This driver does not yet handle multiple chip selects properly. Note that the NAND infrastructure does not perform full page reads or writes, which means that this driver cannot make use of the hardware ECC that is otherwise present. Added: head/sys/dev/nand/nfc_fsl.c (contents, props changed) head/sys/dev/nand/nfc_fsl.h (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Jul 3 00:06:14 2012 (r238045) +++ head/sys/conf/files.powerpc Tue Jul 3 01:00:29 2012 (r238046) @@ -35,6 +35,7 @@ dev/iicbus/ad7417.c optional ad7417 pow dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc +dev/nand/nfc_fsl.c optional nand mpc85xx dev/ofw/openfirm.c optional aim | fdt dev/ofw/openfirmio.c optional aim | fdt dev/ofw/ofw_bus_if.m optional aim | fdt Added: head/sys/dev/nand/nfc_fsl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nand/nfc_fsl.c Tue Jul 3 01:00:29 2012 (r238046) @@ -0,0 +1,716 @@ +/*- + * Copyright (C) 2012 Juniper Networks, Inc. + * Copyright (C) 2009-2012 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * TODO : + * + * -- test support for small pages + * -- support for reading ONFI parameters + * -- support for cached and interleaving commands + * -- proper setting of AL bits in FMR + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +#include "nfc_fsl.h" + +#include "nfc_if.h" + +#define LBC_READ(regname) lbc_read_reg(dev, (LBC85XX_ ## regname)) +#define LBC_WRITE(regname, val) lbc_write_reg(dev, (LBC85XX_ ## regname), val) + +enum addr_type { + ADDR_NONE, + ADDR_ID, + ADDR_ROW, + ADDR_ROWCOL +}; + +struct fsl_nfc_fcm { + /* Read-only after initialization */ + uint32_t reg_fmr; + + /* To be preserved across "start_command" */ + u_int buf_ofs; + u_int read_ptr; + u_int status:1; + + /* Command state -- cleared by "start_command" */ + uint32_t fcm_startzero; + uint32_t reg_fcr; + uint32_t reg_fir; + uint32_t reg_mdr; + uint32_t reg_fbcr; + uint32_t reg_fbar; + uint32_t reg_fpar; + u_int cmdnr; + u_int opnr; + u_int pg_ofs; + enum addr_type addr_type; + u_int addr_bytes; + u_int row_addr; + u_int column_addr; + u_int data_fir:8; + uint32_t fcm_endzero; +}; + +struct fsl_nand_softc { + struct nand_softc nand_dev; + device_t dev; + struct resource *res; + int rid; /* Resourceid */ + struct lbc_devinfo *dinfo; + struct fsl_nfc_fcm fcm; + uint8_t col_cycles; + uint8_t row_cycles; + uint16_t pgsz; /* Page size */ +}; + +static int fsl_nand_attach(device_t dev); +static int fsl_nand_probe(device_t dev); +static int fsl_nand_detach(device_t dev); + +static int fsl_nfc_select_cs(device_t dev, uint8_t cs); +static int fsl_nfc_read_rnb(device_t dev); +static int fsl_nfc_send_command(device_t dev, uint8_t command); +static int fsl_nfc_send_address(device_t dev, uint8_t address); +static uint8_t fsl_nfc_read_byte(device_t dev); +static int fsl_nfc_start_command(device_t dev); +static void fsl_nfc_read_buf(device_t dev, void *buf, uint32_t len); +static void fsl_nfc_write_buf(device_t dev, void *buf, uint32_t len); + +static device_method_t fsl_nand_methods[] = { + DEVMETHOD(device_probe, fsl_nand_probe), + DEVMETHOD(device_attach, fsl_nand_attach), + DEVMETHOD(device_detach, fsl_nand_detach), + + DEVMETHOD(nfc_select_cs, fsl_nfc_select_cs), + DEVMETHOD(nfc_read_rnb, fsl_nfc_read_rnb), + DEVMETHOD(nfc_start_command, fsl_nfc_start_command), + DEVMETHOD(nfc_send_command, fsl_nfc_send_command), + DEVMETHOD(nfc_send_address, fsl_nfc_send_address), + DEVMETHOD(nfc_read_byte, fsl_nfc_read_byte), + DEVMETHOD(nfc_read_buf, fsl_nfc_read_buf), + DEVMETHOD(nfc_write_buf, fsl_nfc_write_buf), + { 0, 0 }, +}; + +static driver_t fsl_nand_driver = { + "nand", + fsl_nand_methods, + sizeof(struct fsl_nand_softc), +}; + +static devclass_t fsl_nand_devclass; + +DRIVER_MODULE(fsl_nand, lbc, fsl_nand_driver, fsl_nand_devclass, + 0, 0); + +static int fsl_nand_build_address(device_t dev, uint32_t page, uint32_t column); +static int fsl_nand_chip_preprobe(device_t dev, struct nand_id *id); + +#ifdef NAND_DEBUG_TIMING +static device_t fcm_devs[8]; +#endif + +#define CMD_SHIFT(cmd_num) (24 - ((cmd_num) * 8)) +#define OP_SHIFT(op_num) (28 - ((op_num) * 4)) + +#define FSL_LARGE_PAGE_SIZE (2112) +#define FSL_SMALL_PAGE_SIZE (528) + +static void +fsl_nand_init_regs(struct fsl_nand_softc *sc) +{ + uint32_t or_v, br_v; + device_t dev; + + dev = sc->dev; + + sc->fcm.reg_fmr = (15 << FMR_CWTO_SHIFT); + + /* + * Setup 4 row cycles and hope that chip ignores superfluous address + * bytes. + */ + sc->fcm.reg_fmr |= (2 << FMR_AL_SHIFT); + + /* Reprogram BR(x) */ + br_v = lbc_read_reg(dev, LBC85XX_BR(sc->dinfo->di_bank)); + br_v &= 0xffff8000; + br_v |= 1 << 11; /* 8-bit port size */ + br_v |= 0 << 9; /* No ECC checking and generation */ + br_v |= 1 << 5; /* FCM machine */ + br_v |= 1; /* Valid */ + lbc_write_reg(dev, LBC85XX_BR(sc->dinfo->di_bank), br_v); + + /* Reprogram OR(x) */ + or_v = lbc_read_reg(dev, LBC85XX_OR(sc->dinfo->di_bank)); + or_v &= 0xfffffc00; + or_v |= 0x03AE; /* Default POR timing */ + lbc_write_reg(dev, LBC85XX_OR(sc->dinfo->di_bank), or_v); + + if (or_v & OR_FCM_PAGESIZE) { + sc->pgsz = FSL_LARGE_PAGE_SIZE; + sc->col_cycles = 2; + nand_debug(NDBG_DRV, "%s: large page NAND device at #%d", + device_get_nameunit(dev), sc->dinfo->di_bank); + } else { + sc->pgsz = FSL_SMALL_PAGE_SIZE; + sc->col_cycles = 1; + nand_debug(NDBG_DRV, "%s: small page NAND device at #%d", + device_get_nameunit(dev), sc->dinfo->di_bank); + } +} + +static int +fsl_nand_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "fsl,elbc-fcm-nand")) + return (ENXIO); + + device_set_desc(dev, "Freescale localbus FCM Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +fsl_nand_attach(device_t dev) +{ + struct fsl_nand_softc *sc; + struct nand_id id; + struct nand_params *param; + uint32_t num_pages; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->dinfo = device_get_ivars(dev); + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resources!\n"); + return (ENXIO); + } + + bzero(&sc->fcm, sizeof(sc->fcm)); + + /* Init register and check if HW ECC turned on */ + fsl_nand_init_regs(sc); + + /* Chip is probed, so determine number of row address cycles */ + fsl_nand_chip_preprobe(dev, &id); + param = nand_get_params(&id); + if (param != NULL) { + num_pages = (param->chip_size << 20) / param->page_size; + while(num_pages) { + sc->row_cycles++; + num_pages >>= 8; + } + + sc->fcm.reg_fmr &= ~(FMR_AL); + sc->fcm.reg_fmr |= (sc->row_cycles - 2) << FMR_AL_SHIFT; + } + + nand_init(&sc->nand_dev, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL); + +#ifdef NAND_DEBUG_TIMING + fcm_devs[sc->dinfo->di_bank] = dev; +#endif + + return (nandbus_create(dev)); +} + +static int +fsl_nand_detach(device_t dev) +{ + struct fsl_nand_softc *sc; + + sc = device_get_softc(dev); + + if (sc->res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + + return (0); +} + +static int +fsl_nfc_select_cs(device_t dev, uint8_t cs) +{ + + // device_printf(dev, "%s(cs=%u)\n", __func__, cs); + return ((cs > 0) ? EINVAL : 0); +} + +static int +fsl_nfc_read_rnb(device_t dev) +{ + + // device_printf(dev, "%s()\n", __func__); + return (0); +} + +static int +fsl_nfc_send_command(device_t dev, uint8_t command) +{ + struct fsl_nand_softc *sc; + struct fsl_nfc_fcm *fcm; + uint8_t fir_op; + + // device_printf(dev, "%s(command=%u)\n", __func__, command); + + sc = device_get_softc(dev); + fcm = &sc->fcm; + + if (command == NAND_CMD_PROG_END) { + fcm->reg_fir |= (FIR_OP_WB << OP_SHIFT(fcm->opnr)); + fcm->opnr++; + } + fcm->reg_fcr |= command << CMD_SHIFT(fcm->cmdnr); + fir_op = (fcm->cmdnr == 0) ? FIR_OP_CW0 : FIR_OP_CM(fcm->cmdnr); + fcm->cmdnr++; + + fcm->reg_fir |= (fir_op << OP_SHIFT(fcm->opnr)); + fcm->opnr++; + + switch (command) { + case NAND_CMD_READ_ID: + fcm->data_fir = FIR_OP_RBW; + fcm->addr_type = ADDR_ID; + break; + case NAND_CMD_SMALLOOB: + fcm->pg_ofs += 256; + /*FALLTHROUGH*/ + case NAND_CMD_SMALLB: + fcm->pg_ofs += 256; + /*FALLTHROUGH*/ + case NAND_CMD_READ: /* NAND_CMD_SMALLA */ + fcm->data_fir = FIR_OP_RBW; + fcm->addr_type = ADDR_ROWCOL; + break; + case NAND_CMD_STATUS: + fcm->data_fir = FIR_OP_RS; + fcm->status = 1; + break; + case NAND_CMD_ERASE: + fcm->addr_type = ADDR_ROW; + break; + case NAND_CMD_PROG: + fcm->addr_type = ADDR_ROWCOL; + break; + } + return (0); +} + +static int +fsl_nfc_send_address(device_t dev, uint8_t addr) +{ + struct fsl_nand_softc *sc; + struct fsl_nfc_fcm *fcm; + uint32_t addr_bits; + + // device_printf(dev, "%s(address=%u)\n", __func__, addr); + + sc = device_get_softc(dev); + fcm = &sc->fcm; + + KASSERT(fcm->addr_type != ADDR_NONE, + ("controller doesn't expect address cycle")); + + addr_bits = addr; + + if (fcm->addr_type == ADDR_ID) { + fcm->reg_fir |= (FIR_OP_UA << OP_SHIFT(fcm->opnr)); + fcm->opnr++; + + fcm->reg_fbcr = 5; + fcm->reg_fbar = 0; + fcm->reg_fpar = 0; + fcm->reg_mdr = addr_bits; + fcm->buf_ofs = 0; + fcm->read_ptr = 0; + return (0); + } + + if (fcm->addr_type == ADDR_ROW) { + addr_bits <<= fcm->addr_bytes * 8; + fcm->row_addr |= addr_bits; + fcm->addr_bytes++; + if (fcm->addr_bytes < sc->row_cycles) + return (0); + } else { + if (fcm->addr_bytes < sc->col_cycles) { + addr_bits <<= fcm->addr_bytes * 8; + fcm->column_addr |= addr_bits; + } else { + addr_bits <<= (fcm->addr_bytes - sc->col_cycles) * 8; + fcm->row_addr |= addr_bits; + } + fcm->addr_bytes++; + if (fcm->addr_bytes < (sc->row_cycles + sc->col_cycles)) + return (0); + } + + return (fsl_nand_build_address(dev, fcm->row_addr, fcm->column_addr)); +} + +static int +fsl_nand_build_address(device_t dev, uint32_t row, uint32_t column) +{ + struct fsl_nand_softc *sc; + struct fsl_nfc_fcm *fcm; + uint32_t byte_count = 0; + uint32_t block_address = 0; + uint32_t page_address = 0; + + sc = device_get_softc(dev); + fcm = &sc->fcm; + + fcm->read_ptr = 0; + fcm->buf_ofs = 0; + + if (fcm->addr_type == ADDR_ROWCOL) { + fcm->reg_fir |= (FIR_OP_CA << OP_SHIFT(fcm->opnr)); + fcm->opnr++; + + column += fcm->pg_ofs; + fcm->pg_ofs = 0; + + page_address |= column; + + if (column != 0) { + byte_count = sc->pgsz - column; + fcm->read_ptr = column; + } + } + + fcm->reg_fir |= (FIR_OP_PA << OP_SHIFT(fcm->opnr)); + fcm->opnr++; + + if (sc->pgsz == FSL_LARGE_PAGE_SIZE) { + block_address = row >> 6; + page_address |= ((row << FPAR_LP_PI_SHIFT) & FPAR_LP_PI); + fcm->buf_ofs = (row & 1) * 4096; + } else { + block_address = row >> 5; + page_address |= ((row << FPAR_SP_PI_SHIFT) & FPAR_SP_PI); + fcm->buf_ofs = (row & 7) * 1024; + } + + fcm->reg_fbcr = byte_count; + fcm->reg_fbar = block_address; + fcm->reg_fpar = page_address; + return (0); +} + +static int +fsl_nfc_start_command(device_t dev) +{ + struct fsl_nand_softc *sc; + struct fsl_nfc_fcm *fcm; + uint32_t fmr, ltesr_v; + int error, timeout; + + // device_printf(dev, "%s()\n", __func__); + + sc = device_get_softc(dev); + fcm = &sc->fcm; + + fmr = fcm->reg_fmr | FMR_OP; + + if (fcm->data_fir) + fcm->reg_fir |= (fcm->data_fir << OP_SHIFT(fcm->opnr)); + + LBC_WRITE(FIR, fcm->reg_fir); + LBC_WRITE(FCR, fcm->reg_fcr); + + LBC_WRITE(FMR, fmr); + + LBC_WRITE(FBCR, fcm->reg_fbcr); + LBC_WRITE(FBAR, fcm->reg_fbar); + LBC_WRITE(FPAR, fcm->reg_fpar); + + if (fcm->addr_type == ADDR_ID) + LBC_WRITE(MDR, fcm->reg_mdr); + + nand_debug(NDBG_DRV, "BEFORE:\nFMR=%#x, FIR=%#x, FCR=%#x", fmr, + fcm->reg_fir, fcm->reg_fcr); + nand_debug(NDBG_DRV, "MDR=%#x, FBAR=%#x, FPAR=%#x, FBCR=%#x", + LBC_READ(MDR), fcm->reg_fbar, fcm->reg_fpar, fcm->reg_fbcr); + + LBC_WRITE(LSOR, sc->dinfo->di_bank); + + timeout = (cold) ? FSL_FCM_WAIT_TIMEOUT : ~0; + error = 0; + ltesr_v = LBC_READ(LTESR); + while (!error && (ltesr_v & LTESR_CC) == 0) { + if (cold) { + DELAY(1000); + timeout--; + if (timeout < 0) + error = EWOULDBLOCK; + } else + error = tsleep(device_get_parent(sc->dev), PRIBIO, + "nfcfsl", hz); + ltesr_v = LBC_READ(LTESR); + } + if (error) + nand_debug(NDBG_DRV, "Command complete wait timeout\n"); + + nand_debug(NDBG_DRV, "AFTER:\nLTESR=%#x, LTEDR=%#x, LTEIR=%#x," + " LTEATR=%#x, LTEAR=%#x, LTECCR=%#x", ltesr_v, + LBC_READ(LTEDR), LBC_READ(LTEIR), LBC_READ(LTEATR), + LBC_READ(LTEAR), LBC_READ(LTECCR)); + + bzero(&fcm->fcm_startzero, + __rangeof(struct fsl_nfc_fcm, fcm_startzero, fcm_endzero)); + + if (fcm->status) + sc->fcm.reg_mdr = LBC_READ(MDR); + + /* Even if timeout occured, we should perform steps below */ + LBC_WRITE(LTESR, ltesr_v); + LBC_WRITE(LTEATR, 0); + + return (error); +} + +static uint8_t +fsl_nfc_read_byte(device_t dev) +{ + struct fsl_nand_softc *sc = device_get_softc(dev); + uint32_t offset; + + // device_printf(dev, "%s()\n", __func__); + + /* + * LBC controller allows us to read status into a MDR instead of FCM + * buffer. If last operation requested before read_byte() was STATUS, + * then return MDR instead of reading a single byte from a buffer. + */ + if (sc->fcm.status) { + sc->fcm.status = 0; + return (sc->fcm.reg_mdr); + } + + KASSERT(sc->fcm.read_ptr < sc->pgsz, + ("Attempt to read beyond buffer %x %x", sc->fcm.read_ptr, + sc->pgsz)); + + offset = sc->fcm.buf_ofs + sc->fcm.read_ptr; + sc->fcm.read_ptr++; + return (bus_read_1(sc->res, offset)); +} + +static void +fsl_nfc_read_buf(device_t dev, void *buf, uint32_t len) +{ + struct fsl_nand_softc *sc = device_get_softc(dev); + uint32_t offset; + int bytesleft = 0; + + // device_printf(dev, "%s(buf=%p, len=%u)\n", __func__, buf, len); + + nand_debug(NDBG_DRV, "REQUEST OF 0x%0x B (BIB=0x%0x, NTR=0x%0x)", + len, sc->pgsz, sc->fcm.read_ptr); + + bytesleft = MIN((unsigned int)len, sc->pgsz - sc->fcm.read_ptr); + + offset = sc->fcm.buf_ofs + sc->fcm.read_ptr; + bus_read_region_1(sc->res, offset, buf, bytesleft); + sc->fcm.read_ptr += bytesleft; +} + +static void +fsl_nfc_write_buf(device_t dev, void *buf, uint32_t len) +{ + struct fsl_nand_softc *sc = device_get_softc(dev); + uint32_t offset; + int bytesleft = 0; + + // device_printf(dev, "%s(buf=%p, len=%u)\n", __func__, buf, len); + + KASSERT(len <= sc->pgsz - sc->fcm.read_ptr, + ("Attempt to write beyond buffer")); + + bytesleft = MIN((unsigned int)len, sc->pgsz - sc->fcm.read_ptr); + + nand_debug(NDBG_DRV, "REQUEST TO WRITE 0x%0x (BIB=0x%0x, NTR=0x%0x)", + bytesleft, sc->pgsz, sc->fcm.read_ptr); + + offset = sc->fcm.buf_ofs + sc->fcm.read_ptr; + bus_write_region_1(sc->res, offset, buf, bytesleft); + sc->fcm.read_ptr += bytesleft; +} + +static int +fsl_nand_chip_preprobe(device_t dev, struct nand_id *id) +{ + + if (fsl_nfc_send_command(dev, NAND_CMD_RESET) != 0) + return (ENXIO); + + if (fsl_nfc_start_command(dev) != 0) + return (ENXIO); + + DELAY(1000); + + if (fsl_nfc_send_command(dev, NAND_CMD_READ_ID)) + return (ENXIO); + + if (fsl_nfc_send_address(dev, 0)) + return (ENXIO); + + if (fsl_nfc_start_command(dev) != 0) + return (ENXIO); + + DELAY(25); + + id->man_id = fsl_nfc_read_byte(dev); + id->dev_id = fsl_nfc_read_byte(dev); + + nand_debug(NDBG_DRV, "manufacturer id: %x chip id: %x", + id->man_id, id->dev_id); + + return (0); +} + +#ifdef NAND_DEBUG_TIMING + +static SYSCTL_NODE(_debug, OID_AUTO, fcm, CTLFLAG_RD, 0, "FCM timing"); + +static u_int csct = 1; /* 22: Chip select to command time (trlx). */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, csct, CTLFLAG_RW, &csct, 1, + "Chip select to command time: determines how far in advance -LCSn is " + "asserted prior to any bus activity during a NAND Flash access handled " + "by the FCM. This helps meet chip-select setup times for slow memories."); + +static u_int cst = 1; /* 23: Command setup time (trlx). */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, cst, CTLFLAG_RW, &cst, 1, + "Command setup time: determines the delay of -LFWE assertion relative to " + "the command, address, or data change when the external memory access " + "is handled by the FCM."); + +static u_int cht = 1; /* 24: Command hold time (trlx). */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, cht, CTLFLAG_RW, &cht, 1, + "Command hold time: determines the -LFWE negation prior to the command, " + "address, or data change when the external memory access is handled by " + "the FCM."); + +static u_int scy = 2; /* 25-27: Cycle length in bus clocks */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, scy, CTLFLAG_RW, &scy, 2, + "Cycle length in bus clocks: see RM"); + +static u_int rst = 1; /* 28: Read setup time (trlx). */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, rst, CTLFLAG_RW, &rst, 1, + "Read setup time: determines the delay of -LFRE assertion relative to " + "sampling of read data when the external memory access is handled by " + "the FCM."); + +static u_int trlx = 1; /* 29: Timing relaxed. */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, trlx, CTLFLAG_RW, &trlx, 1, + "Timing relaxed: modifies the settings of timing parameters for slow " + "memories. See RM"); + +static u_int ehtr = 1; /* 30: Extended hold time on read accesses. */ +SYSCTL_UINT(_debug_fcm, OID_AUTO, ehtr, CTLFLAG_RW, &ehtr, 1, + "Extended hold time on read accesses: indicates with TRLX how many " + "cycles are inserted between a read access from the current bank and " + "the next access."); + +static u_int +fsl_nand_get_timing(void) +{ + u_int timing; + + timing = ((csct & 1) << 9) | ((cst & 1) << 8) | ((cht & 1) << 7) | + ((scy & 7) << 4) | ((rst & 1) << 3) | ((trlx & 1) << 2) | + ((ehtr & 1) << 1); + + printf("nfc_fsl: timing = %u\n", timing); + return (timing); +} + +static int +fsl_sysctl_program(SYSCTL_HANDLER_ARGS) +{ + struct fsl_nand_softc *sc; + int error, i; + device_t dev; + uint32_t or_v; + + error = sysctl_wire_old_buffer(req, sizeof(int)); + if (error == 0) { + i = 0; + error = sysctl_handle_int(oidp, &i, 0, req); + } + if (error != 0 || req->newptr == NULL) + return (error); + + for (i = 0; i < 8; i++) { + dev = fcm_devs[i]; + if (dev == NULL) + continue; + sc = device_get_softc(dev); + + /* Reprogram OR(x) */ + or_v = lbc_read_reg(dev, LBC85XX_OR(sc->dinfo->di_bank)); + or_v &= 0xfffffc00; + or_v |= fsl_nand_get_timing(); + lbc_write_reg(dev, LBC85XX_OR(sc->dinfo->di_bank), or_v); + } + return (0); +} + +SYSCTL_PROC(_debug_fcm, OID_AUTO, program, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, + fsl_sysctl_program, "I", "write to program FCM with current values"); + +#endif /* NAND_DEBUG_TIMING */ Added: head/sys/dev/nand/nfc_fsl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nand/nfc_fsl.h Tue Jul 3 01:00:29 2012 (r238046) @@ -0,0 +1,97 @@ +/*- + * Copyright (C) 2012 Juniper Networks, Inc. + * Copyright (C) 2009-2012 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NAND_NFC_FSL_H_ +#define _NAND_NFC_FSL_H_ + +/* LBC BR/OR Registers layout definitions */ +#define BR_V 0x00000001 +#define BR_V_SHIFT 0 +#define BR_MSEL 0x000000E0 +#define BR_MSEL_SHIFT 5 +#define BR_DECC_CHECK_MODE 0x00000600 +#define BR_DECC_CHECK_GEN 0x00000400 + +#define OR_FCM_PAGESIZE 0x00000400 + +/* Options definitions */ +#define NAND_OPT_ECC_MODE_HW 1 +#define NAND_OPT_ECC_MODE_SOFT (1 << 1) + +/* FMR - Flash Mode Register */ +#define FMR_CWTO 0xF000 +#define FMR_CWTO_SHIFT 12 +#define FMR_BOOT 0x0800 +#define FMR_ECCM 0x0100 +#define FMR_AL 0x0030 +#define FMR_AL_SHIFT 4 +#define FMR_OP 0x0003 +#define FMR_OP_SHIFT 0 + +#define FIR_OP_NOP 0x0 /* No operation and end of sequence */ +#define FIR_OP_CA 0x1 /* Issue current column address */ +#define FIR_OP_PA 0x2 /* Issue current block+page address */ +#define FIR_OP_UA 0x3 /* Issue user defined address */ +#define FIR_OP_CM(x) (4 + (x)) /* Issue command from FCR[CMD(x)] */ +#define FIR_OP_WB 0x8 /* Write FBCR bytes from FCM buffer */ +#define FIR_OP_WS 0x9 /* Write 1 or 2 bytes from MDR[AS] */ +#define FIR_OP_RB 0xA /* Read FBCR bytes to FCM buffer */ +#define FIR_OP_RS 0xB /* Read 1 or 2 bytes to MDR[AS] */ +#define FIR_OP_CW0 0xC /* Wait then issue FCR[CMD0] */ +#define FIR_OP_CW1 0xD /* Wait then issue FCR[CMD1] */ +#define FIR_OP_RBW 0xE /* Wait then read FBCR bytes */ +#define FIR_OP_RSW 0xF /* Wait then read 1 or 2 bytes */ + +/* LTESR - Transfer Error Status Register */ +#define LTESR_BM 0x80000000 +#define LTESR_FCT 0x40000000 +#define LTESR_PAR 0x20000000 +#define LTESR_WP 0x04000000 +#define LTESR_ATMW 0x00800000 +#define LTESR_ATMR 0x00400000 +#define LTESR_CS 0x00080000 +#define LTESR_CC 0x00000001 + +#define LTESR_NAND_MASK (LTESR_FCT | LTESR_CC | LTESR_CS) + +/* FPAR - Flash Page Address Register */ +#define FPAR_SP_PI 0x00007C00 +#define FPAR_SP_PI_SHIFT 10 +#define FPAR_SP_MS 0x00000200 +#define FPAR_SP_CI 0x000001FF +#define FPAR_SP_CI_SHIFT 0 +#define FPAR_LP_PI 0x0003F000 +#define FPAR_LP_PI_SHIFT 12 +#define FPAR_LP_MS 0x00000800 +#define FPAR_LP_CI 0x000007FF +#define FPAR_LP_CI_SHIFT 0 + +#define FSL_FCM_WAIT_TIMEOUT 10 + +#endif /* _NAND_NFC_FSL_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 05:01: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 3DB94106566B; Tue, 3 Jul 2012 05:01:01 +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 0C50B8FC0A; Tue, 3 Jul 2012 05:01: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 q63510PM022162; Tue, 3 Jul 2012 05:01:00 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63510IN022159; Tue, 3 Jul 2012 05:01:00 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207030501.q63510IN022159@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 3 Jul 2012 05:01: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: r238050 - 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: Tue, 03 Jul 2012 05:01:01 -0000 Author: obrien Date: Tue Jul 3 05:01:00 2012 New Revision: 238050 URL: http://svn.freebsd.org/changeset/base/238050 Log: Revert r222186 per instructions for FreeBSD 10. (a 10-CURRENT share/mk is already required to build a 10-CURRENT kernel on 9-STABLE) Modified: head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jul 3 02:55:27 2012 (r238049) +++ head/sys/conf/kern.post.mk Tue Jul 3 05:01:00 2012 (r238050) @@ -270,8 +270,7 @@ kernel-install: .endif mkdir -p ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} -.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ - (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") +.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif .if defined(KERNEL_EXTRA_INSTALL) @@ -283,8 +282,7 @@ kernel-install: kernel-reinstall: @-chflags -R noschg ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} -.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ - (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") +.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Jul 3 02:55:27 2012 (r238049) +++ head/sys/conf/kmod.mk Tue Jul 3 05:01:00 2012 (r238050) @@ -283,8 +283,7 @@ realinstall: _kmodinstall _kmodinstall: ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR} -.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && \ - (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") +.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG}.symbols ${DESTDIR}${KMODDIR} .endif From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 05:11:35 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 DDE4C106566C; Tue, 3 Jul 2012 05:11:35 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id B119E8FC14; Tue, 3 Jul 2012 05:11:35 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q635BZBX069098; Mon, 2 Jul 2012 22:11:35 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q635BZkI069097; Mon, 2 Jul 2012 22:11:35 -0700 (PDT) (envelope-from obrien) Date: Mon, 2 Jul 2012 22:11:35 -0700 From: "David O'Brien" To: Pedro Giffuni Message-ID: <20120703051135.GA69017@dragon.NUXI.org> References: <20120702210438.GA85618@dragon.NUXI.org> <1341270626.1322.YahooMailClassic@web113509.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1341270626.1322.YahooMailClassic@web113509.mail.gq1.yahoo.com> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@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: Tue, 03 Jul 2012 05:11:36 -0000 On Mon, Jul 02, 2012 at 04:10:26PM -0700, Pedro Giffuni wrote: > --- Lun 2/7/12, David O'Brien ha scritto: > I tend to agree with the Illumos community on that however > we may still be seeing some movement in that area. Oracle > has a linux distribution and commercial interests are > always strong in unpredicable ways. > > Oracle has been porting Dtrace to Linux. Apparently they > will be adopting dual GPLv2/CDDL for some few kernel > stuff and CDDL only for the main code, but just the same > there may be some stuff we want to take from them. That may be the case -- but what is the likelihood there would be code from that effort we would want? Vs. the real brain-share of DTrace which commits into Illumos? Isn't it much more likely we would want their innovations? > > It may be conceptually cleaner to import into > > '^/vendor{,-sys}/illumos', but I believe that will cause > > issues with importing updates to existing files > > (e.g., r237458) as the 'svn merge' > > from '^/vendor{,-sys}' will get messy.  I believe we > > may have to resort > > to a three-way merge using "--ignore-ancestry" -- something > > I don't believe we want to do. > > I think Martin Matuska did exactly the right thing: > he created the illumos vendor branch starting from > the opensolaris branch. I don't disagree in principle, but I feel it should have been an 'svn rename' not 'svn copy'. You didn't suggest or comment on the SCM operations having two "vendors" puts us in. I don't think you can make precise statements about an illumos vendor branch without considering those. > Concerning ZFS: the main developer of the encryption stuff > did stay at Oracle. At this time that code will not be seen > in the open (apparently there was a Solaris 11 source leak > but that's not something we can touch), but we just never > know. We can always figure out something *if* it comes to pass that there is a code drop from Oracle that we want to consume. I believe the question which code base are we *most likely* to pull technology from. The proof to date in an 'svn log' of our repo is Illumos. > > Doesn't this commit of yours which brought in new DTrace > > work by Joyent > > (likely Brendan Gregg or Bryan Cantrill) show this point? > > > > Perhaps we should do an 'svn move' of > > '^/vendor{,-sys}/opensolaris' > > to '^/vendor{,-sys}/illumos'? > > Illumos is a fork so svn copy works just fine for this, plus > copying is a very cheap operation in SVN. That misses my point. Yes, copying is a very cheap operation in SVN. (so is 'svn rename') The issue is should we have _two_ vendors that we are attempting to merge into the same files within HEAD? -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 06:41:01 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 15711106581B; Tue, 3 Jul 2012 06:41:01 +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 F248E8FC0A; Tue, 3 Jul 2012 06:41: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 q636f0HJ026211; Tue, 3 Jul 2012 06:41:00 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q636f0hd026208; Tue, 3 Jul 2012 06:41:00 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207030641.q636f0hd026208@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 3 Jul 2012 06:41: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: r238051 - 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: Tue, 03 Jul 2012 06:41:01 -0000 Author: obrien Date: Tue Jul 3 06:41:00 2012 New Revision: 238051 URL: http://svn.freebsd.org/changeset/base/238051 Log: Add "hier" as an alternate spelling of "hierarchy" to match hier(9). Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jul 3 05:01:00 2012 (r238050) +++ head/Makefile Tue Jul 3 06:41:00 2012 (r238051) @@ -92,7 +92,7 @@ TGTS= all all-man buildenv buildenvvars delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ - everything hierarchy install installcheck installkernel \ + everything hier hierarchy install installcheck installkernel \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jul 3 05:01:00 2012 (r238050) +++ head/Makefile.inc1 Tue Jul 3 06:41:00 2012 (r238051) @@ -1197,7 +1197,7 @@ cross-tools: # # hierarchy - ensure that all the needed directories are present # -hierarchy: +hierarchy hier: cd ${.CURDIR}/etc; ${MAKE} distrib-dirs # From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 06:56: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 29F6B10657F6; Tue, 3 Jul 2012 06:56:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 138928FC14; Tue, 3 Jul 2012 06:56: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 q636uBgi027017; Tue, 3 Jul 2012 06:56:11 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q636uBMV027015; Tue, 3 Jul 2012 06:56:11 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201207030656.q636uBMV027015@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 3 Jul 2012 06:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238054 - head/sys/dev/cxgbe 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, 03 Jul 2012 06:56:12 -0000 Author: np Date: Tue Jul 3 06:56:11 2012 New Revision: 238054 URL: http://svn.freebsd.org/changeset/base/238054 Log: Fix inverted test that resulted in incorrect multicast hw programming. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Jul 3 06:55:49 2012 (r238053) +++ head/sys/dev/cxgbe/t4_main.c Tue Jul 3 06:56:11 2012 (r238054) @@ -2143,7 +2143,7 @@ update_mac_settings(struct port_info *pi if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family == AF_LINK) + if (ifma->ifma_addr->sa_family != AF_LINK) continue; mcaddr[i++] = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 06:59:13 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 893A0106566B; Tue, 3 Jul 2012 06:59:13 +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 631AF8FC12; Tue, 3 Jul 2012 06:59:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q636xDXd027192; Tue, 3 Jul 2012 06:59:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q636xDL5027184; Tue, 3 Jul 2012 06:59:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207030659.q636xDL5027184@svn.freebsd.org> From: Adrian Chadd Date: Tue, 3 Jul 2012 06:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238055 - 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: Tue, 03 Jul 2012 06:59:13 -0000 Author: adrian Date: Tue Jul 3 06:59:12 2012 New Revision: 238055 URL: http://svn.freebsd.org/changeset/base/238055 Log: Begin abstracting out the RX path in preparation for RX EDMA support. The RX EDMA support requires a modified approach to the RX descriptor handling. Specifically: * There's now two RX queues - high and low priority; * The RX queues are implemented as FIFOs; they're now an array of pointers to buffers; * .. and the RX buffer and descriptor are in the same "buffer", rather than being separate. So to that end, this commit abstracts out most of the RX related functions from the bulk of the driver. Notably, the RX DMA/buffer allocation isn't updated, primarily because I haven't yet fleshed out what it should look like. Whilst I'm here, create a set of matching but mostly unimplemented EDMA stubs. Tested: * AR9280, station mode TODO: * Thorough AP and other mode testing for non-EDMA chips; * Figure out how to allocate RX buffers suitable for RX EDMA, including correctly setting the mbuf length to compensate for the RX descriptor and completion status area. Added: head/sys/dev/ath/if_ath_rx_edma.c (contents, props changed) head/sys/dev/ath/if_ath_rx_edma.h (contents, props changed) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jul 3 06:56:11 2012 (r238054) +++ head/sys/dev/ath/if_ath.c Tue Jul 3 06:59:12 2012 (r238055) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -302,6 +303,17 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* + * Setup the DMA/EDMA functions based on the current + * hardware support. + * + * This is required before the descriptors are allocated. + */ + if (ath_hal_hasedma(sc->sc_ah)) + ath_recv_setup_edma(sc); + else + ath_recv_setup_legacy(sc); + + /* * Check if the MAC has multi-rate retry support. * We do this by trying to setup a fake extended * descriptor. MAC's that don't have support will @@ -376,7 +388,7 @@ ath_attach(u_int16_t devid, struct ath_s taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", ifp->if_xname); - TASK_INIT(&sc->sc_rxtask, 0, ath_rx_tasklet, sc); + TASK_INIT(&sc->sc_rxtask, 0, sc->sc_rx.recv_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc); TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); @@ -2100,7 +2112,7 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * That way frames aren't dropped which shouldn't be. */ ath_stoprecv(sc, (reset_type != ATH_RESET_NOLOSS)); - ath_rx_proc(sc, 0); + ath_rx_flush(sc); ath_settkipmic(sc); /* configure TKIP MIC handling */ /* NB: indicate channel change so we do a full reset */ @@ -4018,7 +4030,7 @@ ath_chan_set(struct ath_softc *sc, struc /* * First, handle completed TX/RX frames. */ - ath_rx_proc(sc, 0); + ath_rx_flush(sc); ath_draintxq(sc, ATH_RESET_NOLOSS); /* * Next, flush the non-scheduled frames. Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Jul 3 06:56:11 2012 (r238054) +++ head/sys/dev/ath/if_ath_rx.c Tue Jul 3 06:59:12 2012 (r238055) @@ -214,8 +214,8 @@ ath_calcrxfilter(struct ath_softc *sc) return rfilt; } -int -ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) +static int +ath_legacy_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) { struct ath_hal *ah = sc->sc_ah; int error; @@ -463,29 +463,6 @@ ath_handle_micerror(struct ieee80211com } } -/* - * Only run the RX proc if it's not already running. - * Since this may get run as part of the reset/flush path, - * the task can't clash with an existing, running tasklet. - */ -void -ath_rx_tasklet(void *arg, int npending) -{ - struct ath_softc *sc = arg; - - CTR1(ATH_KTR_INTR, "ath_rx_proc: pending=%d", npending); - DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); - ATH_PCU_LOCK(sc); - if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, - "%s: sc_inreset_cnt > 0; skipping\n", __func__); - ATH_PCU_UNLOCK(sc); - return; - } - ATH_PCU_UNLOCK(sc); - ath_rx_proc(sc, 1); -} - static int ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status, uint64_t tsf, int nf, struct ath_buf *bf) @@ -814,7 +791,7 @@ rx_next: return (is_good); } -void +static void ath_rx_proc(struct ath_softc *sc, int resched) { #define PA2DESC(_sc, _pa) \ @@ -965,10 +942,41 @@ rx_proc_next: } /* + * Only run the RX proc if it's not already running. + * Since this may get run as part of the reset/flush path, + * the task can't clash with an existing, running tasklet. + */ +static void +ath_legacy_rx_tasklet(void *arg, int npending) +{ + struct ath_softc *sc = arg; + + CTR1(ATH_KTR_INTR, "ath_rx_proc: pending=%d", npending); + DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt > 0) { + device_printf(sc->sc_dev, + "%s: sc_inreset_cnt > 0; skipping\n", __func__); + ATH_PCU_UNLOCK(sc); + return; + } + ATH_PCU_UNLOCK(sc); + + ath_rx_proc(sc, 1); +} + +static void +ath_legacy_flushrecv(struct ath_softc *sc) +{ + + ath_rx_proc(sc, 0); +} + +/* * Disable the receive h/w in preparation for a reset. */ -void -ath_stoprecv(struct ath_softc *sc, int dodelay) +static void +ath_legacy_stoprecv(struct ath_softc *sc, int dodelay) { #define PA2DESC(_sc, _pa) \ ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ @@ -1019,8 +1027,8 @@ ath_stoprecv(struct ath_softc *sc, int d /* * Enable the receive h/w following a reset. */ -int -ath_startrecv(struct ath_softc *sc) +static int +ath_legacy_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; struct ath_buf *bf; @@ -1044,3 +1052,17 @@ ath_startrecv(struct ath_softc *sc) ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ return 0; } + + +void +ath_recv_setup_legacy(struct ath_softc *sc) +{ + + device_printf(sc->sc_dev, "DMA setup: legacy\n"); + + sc->sc_rx.recv_start = ath_legacy_startrecv; + sc->sc_rx.recv_stop = ath_legacy_stoprecv; + sc->sc_rx.recv_flush = ath_legacy_flushrecv; + sc->sc_rx.recv_tasklet = ath_legacy_rx_tasklet; + sc->sc_rx.recv_rxbuf_init = ath_legacy_rxbuf_init; +} Modified: head/sys/dev/ath/if_ath_rx.h ============================================================================== --- head/sys/dev/ath/if_ath_rx.h Tue Jul 3 06:56:11 2012 (r238054) +++ head/sys/dev/ath/if_ath_rx.h Tue Jul 3 06:59:12 2012 (r238055) @@ -32,12 +32,26 @@ #define __IF_ATH_RX_H__ extern u_int32_t ath_calcrxfilter(struct ath_softc *sc); -extern int ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf); extern void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi, int nf); + +#define ath_stoprecv(_sc, _dodelay) \ + (_sc)->sc_rx.recv_stop((_sc), (_dodelay)) +#define ath_startrecv(_sc) \ + (_sc)->sc_rx.recv_start((_sc)) +#define ath_rx_flush(_sc) \ + (_sc)->sc_rx.recv_flush((_sc)) +#define ath_rxbuf_init(_sc, _bf) \ + (_sc)->sc_rx.recv_rxbuf_init((_sc), (_bf)) + +#if 0 +extern int ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf); extern void ath_rx_tasklet(void *arg, int npending); extern void ath_rx_proc(struct ath_softc *sc, int resched); extern void ath_stoprecv(struct ath_softc *sc, int dodelay); extern int ath_startrecv(struct ath_softc *sc); +#endif + +extern void ath_recv_setup_legacy(struct ath_softc *sc); #endif Added: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 3 06:59:12 2012 (r238055) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2012 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ + +#include "opt_inet.h" +#include "opt_ath.h" +/* + * This is needed for register operations which are performed + * by the driver - eg, calls to ath_hal_gettsf32(). + * + * It's also required for any AH_DEBUG checks in here, eg the + * module dependencies. + */ +#include "opt_ah.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for mp_ncpus */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif +#ifdef IEEE80211_SUPPORT_TDMA +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include /* XXX for softled */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +#include + +static void +ath_edma_stoprecv(struct ath_softc *sc, int dodelay) +{ + struct ath_hal *ah = sc->sc_ah; + + ath_hal_stoppcurecv(ah); + ath_hal_setrxfilter(ah, 0); + ath_hal_stopdmarecv(ah); + + DELAY(3000); + + if (sc->sc_rxpending != NULL) { + m_freem(sc->sc_rxpending); + sc->sc_rxpending = NULL; + } + + sc->sc_rxlink = NULL; +} + +static int +ath_edma_startrecv(struct ath_softc *sc) +{ + struct ath_hal *ah = sc->sc_ah; + + sc->sc_rxlink = NULL; + sc->sc_rxpending = NULL; + + /* XXX setup HP RX queue FIFO pointer */ + /* XXX setup LP RX queue FIFO pointer */ + /* XXX ath_hal_rxena() */ + ath_mode_init(sc); + ath_hal_startpcurecv(ah); + return (0); +} + +static void +ath_edma_recv_flush(struct ath_softc *sc) +{ + + device_printf(sc->sc_dev, "%s: called\n", __func__); +} + +static void +ath_edma_recv_tasklet(void *arg, int npending) +{ + struct ath_softc *sc = (struct ath_softc *) arg; + + device_printf(sc->sc_dev, "%s: called; npending=%d\n", + __func__, + npending); + /* XXX TODO */ +} + +static int +ath_edma_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) +{ + + device_printf(sc->sc_dev, "%s: called; bf=%p\n", __func__, bf); + return (EIO); +} + +void +ath_recv_setup_edma(struct ath_softc *sc) +{ + + device_printf(sc->sc_dev, "DMA setup: EDMA\n"); + + sc->sc_rx.recv_stop = ath_edma_stoprecv; + sc->sc_rx.recv_start = ath_edma_startrecv; + sc->sc_rx.recv_flush = ath_edma_recv_flush; + sc->sc_rx.recv_tasklet = ath_edma_recv_tasklet; + sc->sc_rx.recv_rxbuf_init = ath_edma_rxbuf_init; +} Added: head/sys/dev/ath/if_ath_rx_edma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_rx_edma.h Tue Jul 3 06:59:12 2012 (r238055) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2012 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_RX_EDMA_H__ +#define __IF_ATH_RX_EDMA_H__ + +extern void ath_recv_setup_edma(struct ath_softc *sc); + +#endif Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jul 3 06:56:11 2012 (r238054) +++ head/sys/dev/ath/if_athvar.h Tue Jul 3 06:59:12 2012 (r238055) @@ -372,6 +372,15 @@ typedef enum { ATH_RESET_FULL = 2, } ATH_RESET_TYPE; +struct ath_rx_methods { + void (*recv_stop)(struct ath_softc *sc, int dodelay); + int (*recv_start)(struct ath_softc *sc); + void (*recv_flush)(struct ath_softc *sc); + void (*recv_tasklet)(void *arg, int npending); + int (*recv_rxbuf_init)(struct ath_softc *sc, + struct ath_buf *bf); +}; + struct ath_softc { struct ifnet *sc_ifp; /* interface common */ struct ath_stats sc_stats; /* interface statistics */ @@ -385,6 +394,8 @@ struct ath_softc { u_int8_t sc_nbssid0; /* # vap's using base mac */ uint32_t sc_bssidmask; /* bssid mask */ + struct ath_rx_methods sc_rx; + void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); device_t sc_dev; From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 07:01: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 B1C85106564A; Tue, 3 Jul 2012 07:01:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA9B8FC19; Tue, 3 Jul 2012 07:01: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 q6371CGx027342; Tue, 3 Jul 2012 07:01:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6371Cv4027339; Tue, 3 Jul 2012 07:01:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207030701.q6371Cv4027339@svn.freebsd.org> From: Adrian Chadd Date: Tue, 3 Jul 2012 07:01: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: r238056 - in head/sys: conf modules/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: Tue, 03 Jul 2012 07:01:12 -0000 Author: adrian Date: Tue Jul 3 07:01:12 2012 New Revision: 238056 URL: http://svn.freebsd.org/changeset/base/238056 Log: Link in the new RX EDMA routines. Modified: head/sys/conf/files head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 3 06:59:12 2012 (r238055) +++ head/sys/conf/files Tue Jul 3 07:01:12 2012 (r238056) @@ -735,6 +735,8 @@ dev/ath/if_ath_sysctl.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_rx.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_rx_edma.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ah_osdep.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Tue Jul 3 06:59:12 2012 (r238055) +++ head/sys/modules/ath/Makefile Tue Jul 3 07:01:12 2012 (r238056) @@ -37,7 +37,7 @@ ATH_RATE?= sample # tx rate control alg KMOD= if_ath SRCS= if_ath.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c -SRCS+= if_ath_beacon.c +SRCS+= if_ath_beacon.c if_ath_rx_edma.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 07:28:58 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 1C2D8106566B; Tue, 3 Jul 2012 07:28:58 +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 EF4CD8FC0C; Tue, 3 Jul 2012 07:28: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 q637SvCP028556; Tue, 3 Jul 2012 07:28:57 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q637SvrN028552; Tue, 3 Jul 2012 07:28:57 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201207030728.q637SvrN028552@svn.freebsd.org> From: Niclas Zeising Date: Tue, 3 Jul 2012 07:28: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: r238058 - in head: share/misc usr.bin/calendar/calendars 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, 03 Jul 2012 07:28:58 -0000 Author: zeising (ports committer) Date: Tue Jul 3 07:28:57 2012 New Revision: 238058 URL: http://svn.freebsd.org/changeset/base/238058 Log: Add myself to commiters-[doc,ports].dot and calendar.freebsd Approved by: joel (doc/www mentor) kwm (ports mentor) Modified: head/share/misc/committers-doc.dot head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Tue Jul 3 07:03:14 2012 (r238057) +++ head/share/misc/committers-doc.dot Tue Jul 3 07:28:57 2012 (r238058) @@ -82,6 +82,7 @@ simon [label="Simon L. Nielsen\nsimon@Fr taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/03/25"] wblock [label="Warren Block\nwblock@FreeBSD.org\n2011/09/12"] +zeising [label="Niclas Zeising\nzeising@FreeBSD.org\n2012/07/03"] # Here are the mentor/mentee relationships. # Group together all the mentees for a particular mentor. @@ -123,6 +124,8 @@ jkois -> bcr jkois -> gavin jkois -> gjb +joel -> zeising + keramida -> blackend keramida -> danger keramida -> gabor Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jul 3 07:03:14 2012 (r238057) +++ head/share/misc/committers-ports.dot Tue Jul 3 07:28:57 2012 (r238058) @@ -198,6 +198,7 @@ wen [label="Wen Heping\nwen@FreeBSD.org\ wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] xride [label="Soeren Straarup\nxride@FreeBSD.org\n2006/09/27"] yzlin [label="Yi-Jheng Lin\nyzlin@FreeBSD.org\n2009/07/19"] +zeising [label="Niclas Zeising\nzeising@FreeBSD.org\n2012/07/03"] zi [label="Ryan Steinmetz\nzi@FreeBSD.org\n2011/07/14"] znerd [label="Ernst de Haan\nznerd@FreeBSD.org\n2001/11/15"] @@ -345,6 +346,7 @@ krion -> sem krion -> sergei kwm -> jsa +kwm -> zeising lawrance -> itetcu @@ -393,6 +395,7 @@ miwi -> sylvio miwi -> tabthorpe miwi -> trasz miwi -> wen +miwi -> zeising mnag -> jmelo Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Jul 3 07:03:14 2012 (r238057) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Jul 3 07:28:57 2012 (r238058) @@ -350,6 +350,7 @@ 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 12/23 Alejandro Pulver born in Buenos Aires, Argentina, 1989 12/24 Guido Falsi born in Firenze, Italy, 1978 +12/25 Niclas Zeising born in Stockholm, Sweden, 1986 12/28 Soren Schmidt born in Maribo, Denmark, 1960 12/28 Ade Lovett born in London, England, 1969 12/28 Marius Strobl born in Cham, Bavaria, Germany, 1978 From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 08:03: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 19779106564A; Tue, 3 Jul 2012 08:03:08 +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 03E818FC08; Tue, 3 Jul 2012 08:03:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q63837Ht029981; Tue, 3 Jul 2012 08:03:07 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63837xi029979; Tue, 3 Jul 2012 08:03:07 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201207030803.q63837xi029979@svn.freebsd.org> From: Kevin Lo Date: Tue, 3 Jul 2012 08:03: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: r238059 - head/sys/fs/ext2fs 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, 03 Jul 2012 08:03:08 -0000 Author: kevlo Date: Tue Jul 3 08:03:07 2012 New Revision: 238059 URL: http://svn.freebsd.org/changeset/base/238059 Log: Fix a typo Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Tue Jul 3 07:28:57 2012 (r238058) +++ head/sys/fs/ext2fs/ext2_vfsops.c Tue Jul 3 08:03:07 2012 (r238059) @@ -767,7 +767,7 @@ ext2_statfs(struct mount *mp, struct sta ump = VFSTOEXT2(mp); fs = ump->um_e2fs; if (fs->e2fs->e2fs_magic != E2FS_MAGIC) - panic("ext2fs_statvfs"); + panic("ext2fs_statfs"); /* * Compute the overhead (FS structures) From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 08:42: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 56ABF106566C; Tue, 3 Jul 2012 08:42:49 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 284388FC08; Tue, 3 Jul 2012 08:42: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 q638gneJ031793; Tue, 3 Jul 2012 08:42:49 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q638gm0J031790; Tue, 3 Jul 2012 08:42:48 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207030842.q638gm0J031790@svn.freebsd.org> From: Isabell Long Date: Tue, 3 Jul 2012 08:42: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: r238063 - in head: sbin/ipfw sys/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, 03 Jul 2012 08:42:49 -0000 Author: issyl0 (doc committer) Date: Tue Jul 3 08:42:48 2012 New Revision: 238063 URL: http://svn.freebsd.org/changeset/base/238063 Log: - Make ipfw's sched rules case insensitive, for user-friendliness. - Add a note to the ipfw(8) man page about the rules no longer being case sensitive. - Fix some typos in the man page. PR: docs/164772 Reviewed by: bz Approved by: gabor (doc mentor, src committer) MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw.8 head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Jul 3 08:40:20 2012 (r238062) +++ head/sbin/ipfw/ipfw.8 Tue Jul 3 08:42:48 2012 (r238063) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2012 +.Dd July 3, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -2218,19 +2218,20 @@ Specifies the weight to be used for flow The weight must be in the range 1..100, and defaults to 1. .El .Pp -The following parameters can be configured for a scheduler: +The following case-insensitive parameters can be configured for a +scheduler: .Pp .Bl -tag -width indent -compact -.It Cm type Ar {fifo | wf2qp | rr | qfq} +.It Cm type Ar {fifo | wf2q+ | rr | qfq} specifies the scheduling algorithm to use. .Bl -tag -width indent -compact -.It cm fifo +.It Cm fifo is just a FIFO scheduler (which means that all packets are stored in the same queue as they arrive to the scheduler). FIFO has O(1) per-packet time complexity, with very low constants (estimate 60-80ns on a 2GHz desktop machine) but gives no service guarantees. -.It Cm wf2qp +.It Cm wf2q+ implements the WF2Q+ algorithm, which is a Weighted Fair Queueing algorithm which permits flows to share bandwidth according to their weights. Note that weights are not priorities; even a flow Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Tue Jul 3 08:40:20 2012 (r238062) +++ head/sys/netinet/ipfw/ip_dummynet.c Tue Jul 3 08:42:48 2012 (r238063) @@ -97,7 +97,7 @@ find_sched_type(int type, char *name) struct dn_alg *d; SLIST_FOREACH(d, &dn_cfg.schedlist, next) { - if (d->type == type || (name && !strcmp(d->name, name))) + if (d->type == type || (name && !strcasecmp(d->name, name))) return d; } return NULL; /* not found */ From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 09:09: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 BE89A1065670; Tue, 3 Jul 2012 09:09:50 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 6EBA58FC14; Tue, 3 Jul 2012 09:09:50 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 871035F0; Tue, 3 Jul 2012 11:09:42 +0200 (CEST) Date: Tue, 3 Jul 2012 11:07:36 +0200 From: Pawel Jakub Dawidek To: Konstantin Belousov Message-ID: <20120703090736.GD1350@garage.freebsd.pl> References: <201207022101.q62L13Vh099286@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5Mfx4RzfBqgnTE/w" Content-Disposition: inline In-Reply-To: <201207022101.q62L13Vh099286@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238029 - in head/sys: compat/linux fs/devfs kern sys ufs/ffs 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, 03 Jul 2012 09:09:50 -0000 --5Mfx4RzfBqgnTE/w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 02, 2012 at 09:01:03PM +0000, Konstantin Belousov wrote: > The already broken ABI emulations, including iBCS and SysV, are not > converted (yet). Do people really use that? Why can't we axe those? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --5Mfx4RzfBqgnTE/w Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/ytlgACgkQForvXbEpPzTvLwCaAoZ09XZiJ9qOcrVX3j/YFAju YKEAoKXTFf0A0hCaFdf9kxeG9Pmd0V4q =G6cl -----END PGP SIGNATURE----- --5Mfx4RzfBqgnTE/w-- From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 09:18: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 E80A410656DA; Tue, 3 Jul 2012 09:18:24 +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 60C7F8FC08; Tue, 3 Jul 2012 09:18:24 +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 q639IN5Z032632; Tue, 3 Jul 2012 12:18:23 +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 q639IBim004873; Tue, 3 Jul 2012 12:18:11 +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 q639IAlG004872; Tue, 3 Jul 2012 12:18:10 +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: Tue, 3 Jul 2012 12:18:10 +0300 From: Konstantin Belousov To: Pawel Jakub Dawidek Message-ID: <20120703091810.GX2337@deviant.kiev.zoral.com.ua> References: <201207022101.q62L13Vh099286@svn.freebsd.org> <20120703090736.GD1350@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rV+UTsayrc9+iYKY" Content-Disposition: inline In-Reply-To: <20120703090736.GD1350@garage.freebsd.pl> 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: r238029 - in head/sys: compat/linux fs/devfs kern sys ufs/ffs 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, 03 Jul 2012 09:18:25 -0000 --rV+UTsayrc9+iYKY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 03, 2012 at 11:07:36AM +0200, Pawel Jakub Dawidek wrote: > On Mon, Jul 02, 2012 at 09:01:03PM +0000, Konstantin Belousov wrote: > > The already broken ABI emulations, including iBCS and SysV, are not > > converted (yet). >=20 > Do people really use that? Why can't we axe those? Apparently, they do. See e.g. r224613 which was based on real report from a user. More, I got a request to port iBCS2 support to amd64 kernels, but I have more interesting ways to spend my free time. --rV+UTsayrc9+iYKY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/yuNIACgkQC3+MBN1Mb4g4uQCg2SBJeanlDfG0LtyXLLM3JPnY iDcAoKlpKDOvg3/mGo5Z3oK6wqgJnR1M =k/DH -----END PGP SIGNATURE----- --rV+UTsayrc9+iYKY-- From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 12:08: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 5CCD8106564A; Tue, 3 Jul 2012 12:08:56 +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 4A8F98FC1F; Tue, 3 Jul 2012 12:08:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q63C8uxd042979; Tue, 3 Jul 2012 12:08:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63C8ubu042977; Tue, 3 Jul 2012 12:08:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207031208.q63C8ubu042977@svn.freebsd.org> From: Dimitry Andric Date: Tue, 3 Jul 2012 12:08: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: r238071 - head/cddl/contrib/opensolaris/lib/libdtrace/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: Tue, 03 Jul 2012 12:08:56 -0000 Author: dim Date: Tue Jul 3 12:08:55 2012 New Revision: 238071 URL: http://svn.freebsd.org/changeset/base/238071 Log: Fix clang warning, introduced in the recent dtrace import. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Tue Jul 3 11:53:46 2012 (r238070) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Tue Jul 3 12:08:55 2012 (r238071) @@ -796,7 +796,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, F return (0); assert(last_bin == bin); - (void) snprintf(c, sizeof (c), ">= %lld", value); + (void) snprintf(c, sizeof (c), ">= %lld", (long long)value); if (dt_printf(dtp, fp, "%16s ", c) < 0) return (-1); From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 15:15:42 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 B3324106566C; Tue, 3 Jul 2012 15:15:42 +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 9E32F8FC1D; Tue, 3 Jul 2012 15:15: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 q63FFgPx051443; Tue, 3 Jul 2012 15:15:42 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63FFgBe051436; Tue, 3 Jul 2012 15:15:42 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207031515.q63FFgBe051436@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 3 Jul 2012 15:15: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: r238072 - in head/sys/dev/virtio: . balloon block network 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, 03 Jul 2012 15:15:42 -0000 Author: obrien Date: Tue Jul 3 15:15:41 2012 New Revision: 238072 URL: http://svn.freebsd.org/changeset/base/238072 Log: Do not include in the local headers. The .c files including them have already included before these headers are included. Modified: head/sys/dev/virtio/balloon/virtio_balloon.h head/sys/dev/virtio/block/virtio_blk.h head/sys/dev/virtio/network/virtio_net.h head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtio_ring.h head/sys/dev/virtio/virtqueue.h Modified: head/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.h Tue Jul 3 12:08:55 2012 (r238071) +++ head/sys/dev/virtio/balloon/virtio_balloon.h Tue Jul 3 15:15:41 2012 (r238072) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BALLOON_H #define _VIRTIO_BALLOON_H -#include - /* Feature bits. */ #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0x1 /* Tell before reclaiming pages */ #define VIRTIO_BALLOON_F_STATS_VQ 0x2 /* Memory stats virtqueue */ Modified: head/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.h Tue Jul 3 12:08:55 2012 (r238071) +++ head/sys/dev/virtio/block/virtio_blk.h Tue Jul 3 15:15:41 2012 (r238072) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H -#include - /* Feature bits */ #define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ #define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ Modified: head/sys/dev/virtio/network/virtio_net.h ============================================================================== --- head/sys/dev/virtio/network/virtio_net.h Tue Jul 3 12:08:55 2012 (r238071) +++ head/sys/dev/virtio/network/virtio_net.h Tue Jul 3 15:15:41 2012 (r238072) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_NET_H #define _VIRTIO_NET_H -#include - /* The feature bitmap for virtio net */ #define VIRTIO_NET_F_CSUM 0x00001 /* Host handles pkts w/ partial csum */ #define VIRTIO_NET_F_GUEST_CSUM 0x00002 /* Guest handles pkts w/ partial csum*/ Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Tue Jul 3 12:08:55 2012 (r238071) +++ head/sys/dev/virtio/virtio.h Tue Jul 3 15:15:41 2012 (r238072) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_H_ #define _VIRTIO_H_ -#include - struct vq_alloc_info; /* VirtIO device IDs. */ Modified: head/sys/dev/virtio/virtio_ring.h ============================================================================== --- head/sys/dev/virtio/virtio_ring.h Tue Jul 3 12:08:55 2012 (r238071) +++ head/sys/dev/virtio/virtio_ring.h Tue Jul 3 15:15:41 2012 (r238072) @@ -33,8 +33,6 @@ #ifndef VIRTIO_RING_H #define VIRTIO_RING_H -#include - /* This marks a buffer as continuing via the next field. */ #define VRING_DESC_F_NEXT 1 /* This marks a buffer as write-only (otherwise read-only). */ Modified: head/sys/dev/virtio/virtqueue.h ============================================================================== --- head/sys/dev/virtio/virtqueue.h Tue Jul 3 12:08:55 2012 (r238071) +++ head/sys/dev/virtio/virtqueue.h Tue Jul 3 15:15:41 2012 (r238072) @@ -29,8 +29,6 @@ #ifndef _VIRTIO_VIRTQUEUE_H #define _VIRTIO_VIRTQUEUE_H -#include - struct virtqueue; struct sglist; From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 16:12: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 77D3D1065672; Tue, 3 Jul 2012 16:12:58 +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 4BD358FC17; Tue, 3 Jul 2012 16:12: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 q63GCwgX055474; Tue, 3 Jul 2012 16:12:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63GCwKv055472; Tue, 3 Jul 2012 16:12:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207031612.q63GCwKv055472@svn.freebsd.org> From: John Baldwin Date: Tue, 3 Jul 2012 16:12: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: r238077 - head/sys/dev/mfi 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, 03 Jul 2012 16:12:58 -0000 Author: jhb Date: Tue Jul 3 16:12:57 2012 New Revision: 238077 URL: http://svn.freebsd.org/changeset/base/238077 Log: Fix panics triggered by older mfiutil binaries run on the new mfi(4) driver. The new driver changed the size of the mfi_dcmd_frame structure in such a way that a MFI_IOC_PASSTHRU ioctl from an old amd64 binary is treated as an MFI_IOC_PASSTHRU32 ioctl in the new driver. As a result, the user pointer is treated as the buffer length. mfi_user_command() doesn't have a bounds check on the buffer length, so it passes a really big value to malloc() which panics when it tries to exhaust the kmem_map. Fix this two ways: - Only honor MFI_IOC_PASSTHRU32 if the binary has the SV_ILP32 flag set, otherwise treat it as an unknown ioctl. - Add a bounds check on the buffer length passed by the user. For now it fails any user attempts to use a buffer larger than 1MB. While here, fix a few other nits: - Remove an unnecessary check for a NULL return from malloc(M_WAITOK). - Use the ENOTTY errno for invalid ioctl commands instead of ENOENT. MFC after: 3 days Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Tue Jul 3 15:54:20 2012 (r238076) +++ head/sys/dev/mfi/mfi.c Tue Jul 3 16:12:57 2012 (r238077) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2832,10 +2833,9 @@ mfi_user_command(struct mfi_softc *sc, s if (ioc->buf_size > 0) { - ioc_buf = malloc(ioc->buf_size, M_MFIBUF, M_WAITOK); - if (ioc_buf == NULL) { + if (ioc->buf_size > 1024 * 1024) return (ENOMEM); - } + ioc_buf = malloc(ioc->buf_size, M_MFIBUF, M_WAITOK); error = copyin(ioc->buf, ioc_buf, ioc->buf_size); if (error) { device_printf(sc->mfi_dev, "failed to copyin\n"); @@ -3244,6 +3244,10 @@ out: } #ifdef COMPAT_FREEBSD32 case MFIIO_PASSTHRU32: + if (!SV_CURPROC_FLAG(SV_ILP32)) { + error = ENOTTY; + break; + } iop_swab.ioc_frame = iop32->ioc_frame; iop_swab.buf_size = iop32->buf_size; iop_swab.buf = PTRIN(iop32->buf); @@ -3259,7 +3263,7 @@ out: break; default: device_printf(sc->mfi_dev, "IOCTL 0x%lx not handled\n", cmd); - error = ENOENT; + error = ENOTTY; break; } From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 16:29: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 0EF961065678; Tue, 3 Jul 2012 16:29:42 +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 D752B8FC1C; Tue, 3 Jul 2012 16:29: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 q63GTf7P057349; Tue, 3 Jul 2012 16:29:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63GTfYq057346; Tue, 3 Jul 2012 16:29:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201207031629.q63GTfYq057346@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 3 Jul 2012 16:29: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: r238078 - in head/sys/dev/usb: . quirk 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, 03 Jul 2012 16:29:42 -0000 Author: hselasky Date: Tue Jul 3 16:29:41 2012 New Revision: 238078 URL: http://svn.freebsd.org/changeset/base/238078 Log: Add more quirks for USB mass storage adapters. Submitted by: Erich Dollansky MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Jul 3 16:12:57 2012 (r238077) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Jul 3 16:29:41 2012 (r238078) @@ -437,6 +437,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MEIZU, M6_SL, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(TOSHIBA, TRANSMEMORY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + /* Non-standard USB MIDI devices */ USB_QUIRK(ROLAND, UM1, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(ROLAND, SC8850, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jul 3 16:12:57 2012 (r238077) +++ head/sys/dev/usb/usbdevs Tue Jul 3 16:29:41 2012 (r238078) @@ -691,6 +691,7 @@ vendor TLAYTECH 0x20b9 Tlay Tech vendor ENCORE 0x203d Encore vendor PARA 0x20b8 PARA Industrial vendor SIMTEC 0x20df Simtec Electronics +vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -3345,6 +3346,7 @@ product TOSHIBA POCKETPC_E740 0x0706 Poc product TOSHIBA RT3070 0x0a07 RT3070 product TOSHIBA G450 0x0d45 G450 modem product TOSHIBA HSDPA 0x1302 G450 modem +product TOSHIBA TRANSMEMORY 0x6545 USB ThumbDrive /* Trek Technology products */ product TREK THUMBDRIVE 0x1111 ThumbDrive @@ -3401,6 +3403,9 @@ product USR USR5423 0x0121 USR5423 WLAN /* VIA Technologies products */ product VIA USB2IDEBRIDGE 0x6204 USB 2.0 IDE Bridge +/* VIA Labs */ +product VIALABS USB30SATABRIDGE 0x0700 USB 3.0 SATA Bridge + /* Vaisala products */ product VAISALA CABLE 0x0200 USB Interface cable From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 16:32: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 D1833106566C; Tue, 3 Jul 2012 16:32:47 +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 BE8058FC12; Tue, 3 Jul 2012 16:32: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 q63GWl0r057800; Tue, 3 Jul 2012 16:32:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63GWl8W057797; Tue, 3 Jul 2012 16:32:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201207031632.q63GWl8W057797@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 3 Jul 2012 16:32: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: r238079 - 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, 03 Jul 2012 16:32:47 -0000 Author: hselasky Date: Tue Jul 3 16:32:47 2012 New Revision: 238079 URL: http://svn.freebsd.org/changeset/base/238079 Log: Add new USB device ID. Submitted by: Erich Dollansky MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Jul 3 16:29:41 2012 (r238078) +++ head/sys/dev/usb/serial/u3g.c Tue Jul 3 16:32:47 2012 (r238079) @@ -290,6 +290,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jul 3 16:29:41 2012 (r238078) +++ head/sys/dev/usb/usbdevs Tue Jul 3 16:32:47 2012 (r238079) @@ -1895,6 +1895,7 @@ product HUAWEI E1752 0x1446 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider product HUAWEI K3765_INIT 0x1520 K3765 Initial +product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 17:50:45 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 64112106566B; Tue, 3 Jul 2012 17:50:45 +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 5181C8FC08; Tue, 3 Jul 2012 17:50: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 q63Hoj5M062069; Tue, 3 Jul 2012 17:50:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63HojGK062067; Tue, 3 Jul 2012 17:50:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207031750.q63HojGK062067@svn.freebsd.org> From: Ed Maste Date: Tue, 3 Jul 2012 17:50: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: r238081 - 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, 03 Jul 2012 17:50:45 -0000 Author: emaste Date: Tue Jul 3 17:50:44 2012 New Revision: 238081 URL: http://svn.freebsd.org/changeset/base/238081 Log: Update comment to reflect function's actual operation Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Tue Jul 3 16:49:38 2012 (r238080) +++ head/tools/tools/netmap/pkt-gen.c Tue Jul 3 17:50:44 2012 (r238081) @@ -95,7 +95,7 @@ inline void prefetch (const void *x) __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); } -// XXX only for multiples of 32 bytes, non overlapped. +// XXX only for multiples of 64 bytes, non overlapped. static inline void pkt_copy(void *_src, void *_dst, int l) { From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 18:59: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 92210106564A; Tue, 3 Jul 2012 18:59:14 +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 7F5E38FC08; Tue, 3 Jul 2012 18:59: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 q63IxESS064964; Tue, 3 Jul 2012 18:59:14 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63IxEgb064962; Tue, 3 Jul 2012 18:59:14 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207031859.q63IxEgb064962@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 3 Jul 2012 18:59: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: r238083 - 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, 03 Jul 2012 18:59:14 -0000 Author: trociny Date: Tue Jul 3 18:59:13 2012 New Revision: 238083 URL: http://svn.freebsd.org/changeset/base/238083 Log: Fix RTTVAR scale in net.inet.tcp.hostcache.list sysctl. Reviewed by: andre MFC after: 3 days Modified: head/sys/netinet/tcp_hostcache.c Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Tue Jul 3 18:54:21 2012 (r238082) +++ head/sys/netinet/tcp_hostcache.c Tue Jul 3 18:59:13 2012 (r238083) @@ -624,7 +624,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) msec(hc_entry->rmx_rtt * (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), msec(hc_entry->rmx_rttvar * - (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), + (RTM_RTTUNIT / (hz * TCP_RTTVAR_SCALE))), hc_entry->rmx_bandwidth * 8, hc_entry->rmx_cwnd, hc_entry->rmx_sendpipe, From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 19:04:19 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 84009106564A; Tue, 3 Jul 2012 19:04:19 +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 71B748FC08; Tue, 3 Jul 2012 19:04: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 q63J4Jd1065218; Tue, 3 Jul 2012 19:04:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63J4JnR065216; Tue, 3 Jul 2012 19:04:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207031904.q63J4JnR065216@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 3 Jul 2012 19:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238084 - 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, 03 Jul 2012 19:04:19 -0000 Author: trociny Date: Tue Jul 3 19:04:18 2012 New Revision: 238084 URL: http://svn.freebsd.org/changeset/base/238084 Log: Don't check for ifp != NULL before KASSERT, as ifp may not be NULL here (it is dereferenced below). Discussed with: jhb MFC after: 1 week Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Jul 3 18:59:13 2012 (r238083) +++ head/sys/netinet/igmp.c Tue Jul 3 19:04:18 2012 (r238084) @@ -2285,13 +2285,11 @@ igmp_change_state(struct in_multi *inm) */ KASSERT(inm->inm_ifma != NULL, ("%s: no ifma", __func__)); ifp = inm->inm_ifma->ifma_ifp; - if (ifp != NULL) { - /* - * Sanity check that netinet's notion of ifp is the - * same as net's. - */ - KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); - } + /* + * Sanity check that netinet's notion of ifp is the + * same as net's. + */ + KASSERT(inm->inm_ifp == ifp, ("%s: bad ifp", __func__)); IGMP_LOCK(); From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 19:08: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 7F2D2106564A; Tue, 3 Jul 2012 19:08:03 +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 6BE3A8FC19; Tue, 3 Jul 2012 19:08: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 q63J83id065401; Tue, 3 Jul 2012 19:08:03 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63J83eX065399; Tue, 3 Jul 2012 19:08:03 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207031908.q63J83eX065399@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 3 Jul 2012 19:08: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: r238085 - 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, 03 Jul 2012 19:08:03 -0000 Author: trociny Date: Tue Jul 3 19:08:02 2012 New Revision: 238085 URL: http://svn.freebsd.org/changeset/base/238085 Log: Fix KASSERT message. MFC after: 3 days Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Jul 3 19:04:18 2012 (r238084) +++ head/sys/kern/uipc_socket.c Tue Jul 3 19:08:02 2012 (r238085) @@ -635,7 +635,7 @@ sofree(struct socket *so) so->so_qstate & SQ_COMP, so->so_qstate & SQ_INCOMP)); if (so->so_options & SO_ACCEPTCONN) { KASSERT((TAILQ_EMPTY(&so->so_comp)), ("sofree: so_comp populated")); - KASSERT((TAILQ_EMPTY(&so->so_incomp)), ("sofree: so_comp populated")); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), ("sofree: so_incomp populated")); } SOCK_UNLOCK(so); ACCEPT_UNLOCK(); From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 19:11:39 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 7D1641065670; Tue, 3 Jul 2012 19:11:39 +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 6B11B8FC0A; Tue, 3 Jul 2012 19:11: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 q63JBdwL065587; Tue, 3 Jul 2012 19:11:39 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63JBdeu065585; Tue, 3 Jul 2012 19:11:39 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207031911.q63JBdeu065585@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 3 Jul 2012 19:11: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: r238086 - 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, 03 Jul 2012 19:11:39 -0000 Author: trociny Date: Tue Jul 3 19:11:38 2012 New Revision: 238086 URL: http://svn.freebsd.org/changeset/base/238086 Log: Fix style. MFC after: 3 days Modified: head/usr.bin/procstat/procstat_rlimit.c Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Tue Jul 3 19:08:02 2012 (r238085) +++ head/usr.bin/procstat/procstat_rlimit.c Tue Jul 3 19:11:38 2012 (r238086) @@ -66,8 +66,8 @@ static struct { #error "Resource limits have grown. Add new entries to rlimit_param[]." #endif -static -const char *humanize_rlimit(int indx, rlim_t limit) +static const char * +humanize_rlimit(int indx, rlim_t limit) { static char buf[14]; int scale; From owner-svn-src-head@FreeBSD.ORG Tue Jul 3 21:41:20 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 959211065672; Tue, 3 Jul 2012 21:41:20 +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 7EE948FC17; Tue, 3 Jul 2012 21: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 q63LfKv4071609; Tue, 3 Jul 2012 21:41:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q63LfKna071607; Tue, 3 Jul 2012 21:41:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207032141.q63LfKna071607@svn.freebsd.org> From: Michael Tuexen Date: Tue, 3 Jul 2012 21:41: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: r238087 - 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, 03 Jul 2012 21:41:20 -0000 Author: tuexen Date: Tue Jul 3 21:41:19 2012 New Revision: 238087 URL: http://svn.freebsd.org/changeset/base/238087 Log: Iniitialize a variable. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Jul 3 19:11:38 2012 (r238086) +++ head/sys/netinet/sctp_input.c Tue Jul 3 21:41:19 2012 (r238087) @@ -5604,7 +5604,7 @@ sctp_common_input_processing(struct mbuf int cnt_ctrl_ready = 0; struct sctp_inpcb *inp, *inp_decr = NULL; struct sctp_tcb *stcb = NULL; - struct sctp_nets *net; + struct sctp_nets *net = NULL; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 07:37: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 EDA49106566B; Wed, 4 Jul 2012 07:37:53 +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 D7FAE8FC15; Wed, 4 Jul 2012 07:37: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 q647brTq096043; Wed, 4 Jul 2012 07:37:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q647br5k096035; Wed, 4 Jul 2012 07:37:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207040737.q647br5k096035@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 4 Jul 2012 07:37: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: r238092 - in head/sys: net netinet netinet6 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, 04 Jul 2012 07:37:54 -0000 Author: glebius Date: Wed Jul 4 07:37:53 2012 New Revision: 238092 URL: http://svn.freebsd.org/changeset/base/238092 Log: When ip_output()/ip6_output() is supplied a struct route *ro argument, it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning here: it may be supplied to provide route, and it may be supplied to store and return to caller the route that ip_output()/ip6_output() finds. In the latter case skipping FLOWTABLE lookup is pessimisation. The difference between struct route filled by FLOWTABLE and filled by rtalloc() family is that the former doesn't hold a reference on its rtentry. Reference is hold by flow entry, and it is about to be released in future. Thus, route filled by FLOWTABLE shouldn't be passed to RTFREE() macro. - Introduce new flag for struct route/route_in6, that marks route not holding a reference on rtentry. - Introduce new macro RO_RTFREE() that cleans up a struct route depending on its kind. - All callers to ip_output()/ip6_output() that do supply non-NULL but empty route should use RO_RTFREE() to free results of lookup. - ip_output()/ip6_output() now do FLOWTABLE lookup always when ro->ro_rt == NULL. Tested by: tuexen (SCTP part) Modified: head/sys/net/flowtable.c head/sys/net/route.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/sctp_output.c head/sys/netinet6/ip6_output.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/net/flowtable.c Wed Jul 4 07:37:53 2012 (r238092) @@ -619,6 +619,7 @@ flow_to_route(struct flentry *fle, struc sin->sin_addr.s_addr = hashkey[2]; ro->ro_rt = __DEVOLATILE(struct rtentry *, fle->f_rt); ro->ro_lle = __DEVOLATILE(struct llentry *, fle->f_lle); + ro->ro_flags |= RT_NORTREF; } #endif /* INET */ @@ -826,7 +827,7 @@ flow_to_route_in6(struct flentry *fle, s memcpy(&sin6->sin6_addr, &hashkey[5], sizeof (struct in6_addr)); ro->ro_rt = __DEVOLATILE(struct rtentry *, fle->f_rt); ro->ro_lle = __DEVOLATILE(struct llentry *, fle->f_lle); - + ro->ro_flags |= RT_NORTREF; } #endif /* INET6 */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/net/route.h Wed Jul 4 07:37:53 2012 (r238092) @@ -54,7 +54,8 @@ struct route { struct sockaddr ro_dst; }; -#define RT_CACHING_CONTEXT 0x1 +#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ +#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ /* * These numbers are used by reliable protocols for determining @@ -341,6 +342,18 @@ struct rt_addrinfo { RTFREE_LOCKED(_rt); \ } while (0) +#define RO_RTFREE(_ro) do { \ + if ((_ro)->ro_rt) { \ + if ((_ro)->ro_flags & RT_NORTREF) { \ + (_ro)->ro_flags &= ~RT_NORTREF; \ + (_ro)->ro_rt = NULL; \ + } else { \ + RT_LOCK((_ro)->ro_rt); \ + RTFREE_LOCKED((_ro)->ro_rt); \ + } \ + } \ +} while (0) + struct radix_node_head *rt_tables_get_rnh(int, int); struct ifmultiaddr; Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/netinet/ip_input.c Wed Jul 4 07:37:53 2012 (r238092) @@ -1495,8 +1495,7 @@ ip_forward(struct mbuf *m, int srcrt) if (error == EMSGSIZE && ro.ro_rt) mtu = ro.ro_rt->rt_rmx.rmx_mtu; - if (ro.ro_rt) - RTFREE(ro.ro_rt); + RO_RTFREE(&ro); if (error) IPSTAT_INC(ips_cantforward); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/netinet/ip_output.c Wed Jul 4 07:37:53 2012 (r238092) @@ -105,6 +105,10 @@ extern struct protosw inetsw[]; * ip_len and ip_off are in host format. * The mbuf chain containing the packet will be freed. * The mbuf opt, if present, will not be freed. + * If route ro is present and has ro_rt initialized, route lookup would be + * skipped and ro->ro_rt would be used. If ro is present but ro->ro_rt is NULL, + * then result of route lookup is stored in ro->ro_rt. + * * In the IP forwarding case, the packet will arrive with options already * inserted, so must have a NULL opt pointer. */ @@ -119,7 +123,6 @@ ip_output(struct mbuf *m, struct mbuf *o int mtu; int n; /* scratchpad */ int error = 0; - int nortfree = 0; struct sockaddr_in *dst; struct in_ifaddr *ia = NULL; int isbroadcast, sw_csum; @@ -146,24 +149,23 @@ ip_output(struct mbuf *m, struct mbuf *o if (ro == NULL) { ro = &iproute; bzero(ro, sizeof (*ro)); + } #ifdef FLOWTABLE - { - struct flentry *fle; + if (ro->ro_rt == NULL) { + struct flentry *fle; - /* - * The flow table returns route entries valid for up to 30 - * seconds; we rely on the remainder of ip_output() taking no - * longer than that long for the stability of ro_rt. The - * flow ID assignment must have happened before this point. - */ - if ((fle = flowtable_lookup_mbuf(V_ip_ft, m, AF_INET)) != NULL) { - flow_to_route(fle, ro); - nortfree = 1; - } - } -#endif + /* + * The flow table returns route entries valid for up to 30 + * seconds; we rely on the remainder of ip_output() taking no + * longer than that long for the stability of ro_rt. The + * flow ID assignment must have happened before this point. + */ + fle = flowtable_lookup_mbuf(V_ip_ft, m, AF_INET); + if (fle != NULL) + flow_to_route(fle, ro); } +#endif if (opt) { int len = 0; @@ -209,10 +211,9 @@ again: !RT_LINK_IS_UP(rte->rt_ifp) || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { - if (!nortfree) - RTFREE(rte); - rte = ro->ro_rt = (struct rtentry *)NULL; - ro->ro_lle = (struct llentry *)NULL; + RO_RTFREE(ro); + ro->ro_lle = NULL; + rte = NULL; } #ifdef IPFIREWALL_FORWARD if (rte == NULL && fwd_tag == NULL) { @@ -672,9 +673,8 @@ passout: IPSTAT_INC(ips_fragmented); done: - if (ro == &iproute && ro->ro_rt && !nortfree) { - RTFREE(ro->ro_rt); - } + if (ro == &iproute) + RO_RTFREE(ro); if (ia != NULL) ifa_free(&ia->ia_ifa); return (error); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/netinet/sctp_output.c Wed Jul 4 07:37:53 2012 (r238092) @@ -4156,10 +4156,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTPDBG(SCTP_DEBUG_OUTPUT3, "IP output returns %d\n", ret); if (net == NULL) { /* free tempy routes */ - if (ro->ro_rt) { - RTFREE(ro->ro_rt); - ro->ro_rt = NULL; - } + RO_RTFREE(ro); } else { /* * PMTU check versus smallest asoc MTU goes @@ -4513,9 +4510,7 @@ sctp_lowlevel_chunk_output(struct sctp_i } if (net == NULL) { /* Now if we had a temp route free it */ - if (ro->ro_rt) { - RTFREE(ro->ro_rt); - } + RO_RTFREE(ro); } else { /* * PMTU check versus smallest asoc MTU goes Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/netinet6/ip6_output.c Wed Jul 4 07:37:53 2012 (r238092) @@ -213,6 +213,9 @@ in6_delayed_cksum(struct mbuf *m, uint32 * This function may modify ver and hlim only. * The mbuf chain containing the packet will be freed. * The mbuf opt, if present, will not be freed. + * If route_in6 ro is present and has ro_rt initialized, route lookup would be + * skipped and ro->ro_rt would be used. If ro is present but ro->ro_rt is NULL, + * then result of route lookup is stored in ro->ro_rt. * * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, @@ -243,7 +246,6 @@ ip6_output(struct mbuf *m0, struct ip6_p struct in6_addr finaldst, src0, dst0; u_int32_t zone; struct route_in6 *ro_pmtu = NULL; - int flevalid = 0; int hdrsplit = 0; int needipsec = 0; int sw_csum, tso; @@ -506,7 +508,7 @@ skip_ipsec2:; ro = &opt->ip6po_route; dst = (struct sockaddr_in6 *)&ro->ro_dst; #ifdef FLOWTABLE - if (ro == &ip6route) { + if (ro->ro_rt == NULL) { struct flentry *fle; /* @@ -515,11 +517,9 @@ skip_ipsec2:; * longer than that long for the stability of ro_rt. The * flow ID assignment must have happened before this point. */ - if ((fle = flowtable_lookup_mbuf(V_ip6_ft, m, AF_INET6)) != NULL) { + fle = flowtable_lookup_mbuf(V_ip6_ft, m, AF_INET6); + if (fle != NULL) flow_to_route_in6(fle, ro); - if (ro->ro_rt != NULL && ro->ro_lle != NULL) - flevalid = 1; - } } #endif again: @@ -627,7 +627,7 @@ again: dst_sa.sin6_family = AF_INET6; dst_sa.sin6_len = sizeof(dst_sa); dst_sa.sin6_addr = ip6->ip6_dst; - if (flevalid) { + if (ro->ro_rt) { rt = ro->ro_rt; ifp = ro->ro_rt->rt_ifp; } else if ((error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, @@ -1182,13 +1182,10 @@ sendorfree: V_ip6stat.ip6s_fragmented++; done: - if (ro == &ip6route && ro->ro_rt && flevalid == 0) { - /* brace necessary for RTFREE */ - RTFREE(ro->ro_rt); - } else if (ro_pmtu == &ip6route && ro_pmtu->ro_rt && - ((flevalid == 0) || (ro_pmtu != ro))) { - RTFREE(ro_pmtu->ro_rt); - } + if (ro == &ip6route) + RO_RTFREE(ro); + if (ro_pmtu == &ip6route) + RO_RTFREE(ro_pmtu); #ifdef IPSEC if (sp != NULL) KEY_FREESP(&sp); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Wed Jul 4 06:29:56 2012 (r238091) +++ head/sys/netinet6/nd6_nbr.c Wed Jul 4 07:37:53 2012 (r238092) @@ -595,9 +595,9 @@ nd6_ns_output(struct ifnet *ifp, const s icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_SOLICIT]); - if (ro.ro_rt) { /* we don't cache this route. */ - RTFREE(ro.ro_rt); - } + /* We don't cache this route. */ + RO_RTFREE(&ro); + return; bad: @@ -1124,9 +1124,9 @@ nd6_na_output_fib(struct ifnet *ifp, con icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_ADVERT]); - if (ro.ro_rt) { /* we don't cache this route. */ - RTFREE(ro.ro_rt); - } + /* We don't cache this route. */ + RO_RTFREE(&ro); + return; bad: From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 07:42: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 C2FD7106566C; Wed, 4 Jul 2012 07:42:12 +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 ADF828FC0A; Wed, 4 Jul 2012 07:42: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 q647gCtk096243; Wed, 4 Jul 2012 07:42:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q647gC7k096241; Wed, 4 Jul 2012 07:42:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207040742.q647gC7k096241@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 4 Jul 2012 07:42: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: r238093 - head/share/man/man9 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, 04 Jul 2012 07:42:12 -0000 Author: glebius Date: Wed Jul 4 07:42:12 2012 New Revision: 238093 URL: http://svn.freebsd.org/changeset/base/238093 Log: Document RO_RTFREE() macro. Modified: head/share/man/man9/rtalloc.9 Modified: head/share/man/man9/rtalloc.9 ============================================================================== --- head/share/man/man9/rtalloc.9 Wed Jul 4 07:37:53 2012 (r238092) +++ head/share/man/man9/rtalloc.9 Wed Jul 4 07:42:12 2012 (r238093) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2011 +.Dd July 4, 2012 .Dt RTALLOC 9 .Os .Sh NAME @@ -52,6 +52,7 @@ .Fn RT_UNLOCK "struct rt_entry *rt" .Fn RT_ADDREF "struct rt_entry *rt" .Fn RT_REMREF "struct rt_entry *rt" +.Fn RO_RTFREE "struct route *ro" .Ft void .Fn rtfree "struct rt_entry *rt" .Ft "struct rtentry *" @@ -203,6 +204,14 @@ Its usage is contrary to .Fn RT_ADDREF . .Pp The +.Fn RO_RTFREE +macro is used to free route entry that is referenced by struct route. +At certain circumstances the latter may not hold a reference on rtentry, +and +.Fn RO_RTFREE +treats such routes correctly. +.Pp +The .Fn rtfree function does the actual free of the routing table entry, and shouldn't be called directly by facilities, that just perform routing table lookups. From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 09:02:13 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 668FC1065702; Wed, 4 Jul 2012 09:02:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E86A8FC12; Wed, 4 Jul 2012 09:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6492DkV099533; Wed, 4 Jul 2012 09:02:13 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6492DqL099526; Wed, 4 Jul 2012 09:02:13 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201207040902.q6492DqL099526@svn.freebsd.org> From: Stefan Esser Date: Wed, 4 Jul 2012 09:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238094 - head/usr.sbin/nscd 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, 04 Jul 2012 09:02:13 -0000 Author: se Date: Wed Jul 4 09:02:12 2012 New Revision: 238094 URL: http://svn.freebsd.org/changeset/base/238094 Log: Add the possibility to specify a threshold for the number of negative cache results required to have the cache return lookup failure. A new configuration parameter is introduced, which must be set to a value greater than 1 to activate this feature. The default behavior is unchanged. The purpose of this change is to allow probes for the existence of an entry (which are expected to fail), before that entry is added to one of the queried databases, without the cache returning the stale information from the probe query until that cache entry expires. If, for example, a new user account is created after checking that the new account name is available, the negative cache entry would prevent immediate access to the account. For that example, the new configuration option negative-confidence-threshold passwd 2 will require a second negative query result to consider the negative cache entry for a passwd entry valid, but if the user account has been created between the queries, then the positive query result from the second query will be cached and returned. Modified: head/usr.sbin/nscd/cachelib.c head/usr.sbin/nscd/cachelib.h head/usr.sbin/nscd/config.c head/usr.sbin/nscd/config.h head/usr.sbin/nscd/nscd.conf.5 head/usr.sbin/nscd/parser.c Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Wed Jul 4 07:42:12 2012 (r238093) +++ head/usr.sbin/nscd/cachelib.c Wed Jul 4 09:02:12 2012 (r238094) @@ -726,6 +726,12 @@ cache_read(struct cache_entry_ *entry, c TRACE_OUT(cache_read); return (-1); } + /* pretend that entry was not found if confidence is below threshold*/ + if (find_res->confidence < + common_entry->common_params.confidence_threshold) { + TRACE_OUT(cache_read); + return (-1); + } if ((common_entry->common_params.max_lifetime.tv_sec != 0) || (common_entry->common_params.max_lifetime.tv_usec != 0)) { @@ -826,6 +832,24 @@ cache_write(struct cache_entry_ *entry, item = HASHTABLE_GET_ENTRY(&(common_entry->items), hash); find_res = HASHTABLE_ENTRY_FIND(cache_ht_, item, &item_data); if (find_res != NULL) { + if (find_res->confidence < common_entry->common_params.confidence_threshold) { + /* duplicate entry is no error, if confidence is low */ + if ((find_res->value_size == value_size) && + (memcmp(find_res->value, value, value_size) == 0)) { + /* increase confidence on exact match (key and values) */ + find_res->confidence++; + } else { + /* create new entry with low confidence, if value changed */ + free(item_data.value); + item_data.value = malloc(value_size); + assert(item_data.value != NULL); + memcpy(item_data.value, value, value_size); + item_data.value_size = value_size; + find_res->confidence = 1; + } + TRACE_OUT(cache_write); + return (0); + } TRACE_OUT(cache_write); return (-1); } @@ -839,6 +863,8 @@ cache_write(struct cache_entry_ *entry, memcpy(item_data.value, value, value_size); item_data.value_size = value_size; + item_data.confidence = 1; + policy_item = common_entry->policies[0]->create_item_func(); policy_item->key = item_data.key; policy_item->key_size = item_data.key_size; Modified: head/usr.sbin/nscd/cachelib.h ============================================================================== --- head/usr.sbin/nscd/cachelib.h Wed Jul 4 07:42:12 2012 (r238093) +++ head/usr.sbin/nscd/cachelib.h Wed Jul 4 09:02:12 2012 (r238094) @@ -92,6 +92,7 @@ struct common_cache_entry_params { size_t satisf_elemsize; /* if entry size is exceeded, * this number of elements will be left, * others will be deleted */ + int confidence_threshold; /* number matching replies required */ struct timeval max_lifetime; /* if 0 then no check is made */ enum cache_policy_t policy; /* policy used for transformations */ }; @@ -116,6 +117,7 @@ struct cache_ht_item_data_ { size_t value_size; struct cache_policy_item_ *fifo_policy_item; + int confidence; /* incremented for each verification */ }; struct cache_ht_item_ { Modified: head/usr.sbin/nscd/config.c ============================================================================== --- head/usr.sbin/nscd/config.c Wed Jul 4 07:42:12 2012 (r238093) +++ head/usr.sbin/nscd/config.c Wed Jul 4 09:02:12 2012 (r238094) @@ -209,6 +209,7 @@ create_def_configuration_entry(const cha positive_params.max_elemsize = DEFAULT_POSITIVE_ELEMENTS_SIZE; positive_params.satisf_elemsize = DEFAULT_POSITIVE_ELEMENTS_SIZE / 2; positive_params.max_lifetime.tv_sec = DEFAULT_POSITIVE_LIFETIME; + positive_params.confidence_threshold = DEFAULT_POSITIVE_CONF_THRESH; positive_params.policy = CPT_LRU; memcpy(&negative_params, &positive_params, @@ -216,6 +217,7 @@ create_def_configuration_entry(const cha negative_params.max_elemsize = DEFAULT_NEGATIVE_ELEMENTS_SIZE; negative_params.satisf_elemsize = DEFAULT_NEGATIVE_ELEMENTS_SIZE / 2; negative_params.max_lifetime.tv_sec = DEFAULT_NEGATIVE_LIFETIME; + negative_params.confidence_threshold = DEFAULT_NEGATIVE_CONF_THRESH; negative_params.policy = CPT_FIFO; memset(&default_common_timeout, 0, sizeof(struct timeval)); Modified: head/usr.sbin/nscd/config.h ============================================================================== --- head/usr.sbin/nscd/config.h Wed Jul 4 07:42:12 2012 (r238093) +++ head/usr.sbin/nscd/config.h Wed Jul 4 09:02:12 2012 (r238094) @@ -44,9 +44,11 @@ #define DEFAULT_POSITIVE_ELEMENTS_SIZE (2048) #define DEFAULT_POSITIVE_LIFETIME (3600) +#define DEFAULT_POSITIVE_CONF_THRESH (1) #define DEFAULT_NEGATIVE_ELEMENTS_SIZE (2048) #define DEFAULT_NEGATIVE_LIFETIME (60) +#define DEFAULT_NEGATIVE_CONF_THRESH (1) /* (2) ??? */ #define DEFAULT_MULTIPART_ELEMENTS_SIZE (1024 * 8) #define DEFAULT_MULITPART_SESSIONS_SIZE (1024) Modified: head/usr.sbin/nscd/nscd.conf.5 ============================================================================== --- head/usr.sbin/nscd/nscd.conf.5 Wed Jul 4 07:42:12 2012 (r238093) +++ head/usr.sbin/nscd/nscd.conf.5 Wed Jul 4 09:02:12 2012 (r238094) @@ -102,6 +102,17 @@ The same as the positive-policy, but thi elements of the given .Ar cachename . The default policy is fifo. +.It Va negative-confidence-threshold Oo Ar cachename Oc Op Ar value +The number of times a query must have failed before the cache accepts +that the element can not be found. +At the default value of 1 each negative query result is cached and +immediately returned from the cache on further queries. +Higher numbers cause queries to be retried at the configured data +sources the given number of times, before the negative result is +returned from the cache on further queries. +This allows to probe for the existence of an entry, and then to create +it if it did not exist, without the negative probe result preventing +access to the new entry for the duration of the negative TTL. .It Va suggested-size Oo Ar cachename Oc Op Ar value This is the internal hash table size. The value should be a prime number for optimum performance. Modified: head/usr.sbin/nscd/parser.c ============================================================================== --- head/usr.sbin/nscd/parser.c Wed Jul 4 07:42:12 2012 (r238093) +++ head/usr.sbin/nscd/parser.c Wed Jul 4 09:02:12 2012 (r238094) @@ -167,6 +167,38 @@ set_negative_time_to_live(struct configu TRACE_OUT(set_negative_time_to_live); } +static void +set_positive_confidence_threshold(struct configuration *config, + const char *entry_name, int conf_thresh) +{ + struct configuration_entry *entry; + + TRACE_IN(set_positive_conf_thresh); + assert(conf_thresh > 0); + assert(entry_name != NULL); + + entry = find_create_entry(config, entry_name); + assert(entry != NULL); + entry->positive_cache_params.confidence_threshold = conf_thresh; + + TRACE_OUT(set_positive_conf_thresh); +} + +static void +set_negative_confidence_threshold(struct configuration *config, + const char *entry_name, int conf_thresh) +{ + struct configuration_entry *entry; + + TRACE_IN(set_negative_conf_thresh); + assert(conf_thresh > 0); + assert(entry_name != NULL); + entry = find_create_entry(config, entry_name); + assert(entry != NULL); + entry->negative_cache_params.confidence_threshold = conf_thresh; + TRACE_OUT(set_negative_conf_thresh); +} + /* * Hot count is actually the elements size limit. */ @@ -393,6 +425,12 @@ parse_config_file(struct configuration * fields[1], value); continue; } else if ((field_count == 3) && + (strcmp(fields[0], "positive-confidence-threshold") == 0) && + ((value = get_number(fields[2], 1, -1)) != -1)) { + set_positive_confidence_threshold(config, + fields[1], value); + continue; + } else if ((field_count == 3) && (strcmp(fields[0], "positive-policy") == 0) && (check_cachename(fields[1]) == 0) && ((value = get_policy(fields[2])) != -1)) { @@ -416,6 +454,12 @@ parse_config_file(struct configuration * fields[1], value); continue; } else if ((field_count == 3) && + (strcmp(fields[0], "negative-confidence-threshold") == 0) && + ((value = get_number(fields[2], 1, -1)) != -1)) { + set_negative_confidence_threshold(config, + fields[1], value); + continue; + } else if ((field_count == 3) && (strcmp(fields[0], "negative-policy") == 0) && (check_cachename(fields[1]) == 0) && ((value = get_policy(fields[2])) != -1)) { From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 10:17: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 899FD1065670; Wed, 4 Jul 2012 10:17: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 721B28FC12; Wed, 4 Jul 2012 10:17: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 q64AH31O002742; Wed, 4 Jul 2012 10:17:03 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64AH3lo002740; Wed, 4 Jul 2012 10:17:03 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201207041017.q64AH3lo002740@svn.freebsd.org> From: Joel Dahl Date: Wed, 4 Jul 2012 10:17: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: r238095 - head/usr.sbin/nscd 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, 04 Jul 2012 10:17:03 -0000 Author: joel (doc committer) Date: Wed Jul 4 10:17:02 2012 New Revision: 238095 URL: http://svn.freebsd.org/changeset/base/238095 Log: Remove end of line whitespace. Modified: head/usr.sbin/nscd/nscd.conf.5 Modified: head/usr.sbin/nscd/nscd.conf.5 ============================================================================== --- head/usr.sbin/nscd/nscd.conf.5 Wed Jul 4 09:02:12 2012 (r238094) +++ head/usr.sbin/nscd/nscd.conf.5 Wed Jul 4 10:17:02 2012 (r238095) @@ -105,13 +105,13 @@ The default policy is fifo. .It Va negative-confidence-threshold Oo Ar cachename Oc Op Ar value The number of times a query must have failed before the cache accepts that the element can not be found. -At the default value of 1 each negative query result is cached and +At the default value of 1 each negative query result is cached and immediately returned from the cache on further queries. -Higher numbers cause queries to be retried at the configured data -sources the given number of times, before the negative result is +Higher numbers cause queries to be retried at the configured data +sources the given number of times, before the negative result is returned from the cache on further queries. -This allows to probe for the existence of an entry, and then to create -it if it did not exist, without the negative probe result preventing +This allows to probe for the existence of an entry, and then to create +it if it did not exist, without the negative probe result preventing access to the new entry for the duration of the negative TTL. .It Va suggested-size Oo Ar cachename Oc Op Ar value This is the internal hash table size. From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 13:37: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 D1313106564A; Wed, 4 Jul 2012 13:37:44 +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 BEC1E8FC17; Wed, 4 Jul 2012 13:37: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 q64Dbi1a013383; Wed, 4 Jul 2012 13:37:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64Dbiip013381; Wed, 4 Jul 2012 13:37:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201207041337.q64Dbiip013381@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 4 Jul 2012 13:37: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: r238102 - 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: Wed, 04 Jul 2012 13:37:44 -0000 Author: des Date: Wed Jul 4 13:37:44 2012 New Revision: 238102 URL: http://svn.freebsd.org/changeset/base/238102 Log: Name jails automatically. MFC after: 1 week Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Wed Jul 4 13:00:48 2012 (r238101) +++ head/etc/rc.d/jail Wed Jul 4 13:37:44 2012 (r238102) @@ -641,7 +641,7 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail ${_flags} -n ${_jail} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ 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 59E8A106564A; Wed, 4 Jul 2012 16:25:12 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292478FC14; Wed, 4 Jul 2012 16:25: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 q64GPCU8020464; Wed, 4 Jul 2012 16:25:12 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64GPBf4020457; Wed, 4 Jul 2012 16:25:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201207041625.q64GPBf4020457@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 4 Jul 2012 16:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238108 - head/usr.bin/sort 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, 04 Jul 2012 16:25:12 -0000 Author: gabor Date: Wed Jul 4 16:25:11 2012 New Revision: 238108 URL: http://svn.freebsd.org/changeset/base/238108 Log: - Change --nthreads parameter to --parallel for GNU compatibility - Change default sort method to mergesort, which has a better worst case performance than qsort Submitted by: Oleg Moskalenko Modified: head/usr.bin/sort/file.c head/usr.bin/sort/file.h head/usr.bin/sort/radixsort.c head/usr.bin/sort/sort.1.in head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Wed Jul 4 14:25:14 2012 (r238107) +++ head/usr.bin/sort/file.c Wed Jul 4 16:25:11 2012 (r238108) @@ -1297,7 +1297,7 @@ sort_list_to_file(struct sort_list *list } if (sort_opts_vals.sort_method == SORT_DEFAULT) - sort_opts_vals.sort_method = SORT_QSORT; + sort_opts_vals.sort_method = DEFAULT_SORT_ALGORITHM; if (debug_sort) printf("sort_method=%s\n", @@ -1314,9 +1314,12 @@ sort_list_to_file(struct sort_list *list case SORT_HEAPSORT: mt_sort(list, heapsort, outfile); break; - default: + case SORT_QSORT: mt_sort(list, sort_qsort, outfile); break; + default: + mt_sort(list, DEFAULT_SORT_FUNC, outfile); + break; } } Modified: head/usr.bin/sort/file.h ============================================================================== --- head/usr.bin/sort/file.h Wed Jul 4 14:25:14 2012 (r238107) +++ head/usr.bin/sort/file.h Wed Jul 4 16:25:11 2012 (r238108) @@ -39,6 +39,9 @@ #define SORT_HEAPSORT 3 #define SORT_RADIXSORT 4 +#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT +#define DEFAULT_SORT_FUNC heapsort + /* * List of data to be sorted. */ Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Wed Jul 4 14:25:14 2012 (r238107) +++ head/usr.bin/sort/radixsort.c Wed Jul 4 16:25:11 2012 (r238108) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "coll.h" #include "radixsort.h" +#define DEFAULT_SORT_FUNC_RADIXSORT mergesort + #define TINY_NODE(sl) ((sl)->tosort_num < 65) #define SMALL_NODE(sl) ((sl)->tosort_num < 5) @@ -349,7 +351,7 @@ run_sort_level_next(struct sort_level *s /* NOTREACHED */ err(2, "Radix sort error 3"); } else - qsort(sl->leaves, sl->leaves_num, + DEFAULT_SORT_FUNC_RADIXSORT(sl->leaves, sl->leaves_num, sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) func); @@ -389,12 +391,12 @@ run_sort_level_next(struct sort_level *s sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) list_coll); } else { - qsort(sl->leaves, sl->leaves_num, + DEFAULT_SORT_FUNC_RADIXSORT(sl->leaves, sl->leaves_num, sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) list_coll); } } else if (!sort_opts_vals.sflag && sort_opts_vals.complex_sort) { - qsort(sl->leaves, sl->leaves_num, + DEFAULT_SORT_FUNC_RADIXSORT(sl->leaves, sl->leaves_num, sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) list_coll_by_str_only); } @@ -541,12 +543,12 @@ run_top_sort_level(struct sort_level *sl sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) list_coll); } else { - qsort(sl->leaves, sl->leaves_num, + DEFAULT_SORT_FUNC_RADIXSORT(sl->leaves, sl->leaves_num, sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) list_coll); } } else if (!sort_opts_vals.sflag && sort_opts_vals.complex_sort) { - qsort(sl->leaves, sl->leaves_num, + DEFAULT_SORT_FUNC_RADIXSORT(sl->leaves, sl->leaves_num, sizeof(struct sort_list_item *), (int(*)(const void *, const void *)) list_coll_by_str_only); } Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Wed Jul 4 14:25:14 2012 (r238107) +++ head/usr.bin/sort/sort.1.in Wed Jul 4 16:25:11 2012 (r238108) @@ -33,7 +33,7 @@ .\" .\" @(#)sort.1 8.1 (Berkeley) 6/6/93 .\" -.Dd May 25, 2012 +.Dd July 3, 2012 .Dt SORT 1 .Os .Sh NAME @@ -329,7 +329,7 @@ is used. .It Fl Fl debug Print some extra information about the sorting process to the standard output. -%%THREADS%%.It Fl Fl nthreads +%%THREADS%%.It Fl Fl parallel %%THREADS%%Set the maximum number of execution threads. %%THREADS%%Default number equals to the number of CPUs. .It Fl Fl files0-from Ns = Ns Ar filename Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Wed Jul 4 14:25:14 2012 (r238107) +++ head/usr.bin/sort/sort.c Wed Jul 4 16:25:11 2012 (r238108) @@ -91,7 +91,7 @@ const char *nlsstr[] = { "", "[--heapsort] [--mergesort] [--radixsort] [--qsort] " "[--mmap] " #if defined(SORT_THREADS) - "[--nthreads thread_no] " + "[--parallel thread_no] " #endif "[--human-numeric-sort] " "[--version-sort] [--random-sort [--random-source file]] " @@ -132,7 +132,7 @@ enum VERSION_OPT, DEBUG_OPT, #if defined(SORT_THREADS) - NTHREADS_OPT, + PARALLEL_OPT, #endif RANDOMSOURCE_OPT, COMPRESSPROGRAM_OPT, @@ -171,7 +171,7 @@ struct option long_options[] = { { "numeric-sort", no_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, #if defined(SORT_THREADS) - { "nthreads", required_argument, NULL, NTHREADS_OPT }, + { "parallel", required_argument, NULL, PARALLEL_OPT }, #endif { "qsort", no_argument, NULL, QSORT_OPT }, { "radixsort", no_argument, NULL, RADIXSORT_OPT }, @@ -1119,7 +1119,7 @@ main(int argc, char **argv) } break; #if defined(SORT_THREADS) - case NTHREADS_OPT: + case PARALLEL_OPT: nthreads = (size_t)(atoi(optarg)); if (nthreads < 1) nthreads = 1; From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 16:47:39 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 C4940106566B; Wed, 4 Jul 2012 16:47:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEDBB8FC08; Wed, 4 Jul 2012 16:47: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 q64GldVE021457; Wed, 4 Jul 2012 16:47:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64GldrJ021455; Wed, 4 Jul 2012 16:47:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207041647.q64GldrJ021455@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jul 2012 16:47: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: r238109 - head/sys/amd64/amd64 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, 04 Jul 2012 16:47:39 -0000 Author: jhb Date: Wed Jul 4 16:47:39 2012 New Revision: 238109 URL: http://svn.freebsd.org/changeset/base/238109 Log: Decode the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', 'xsetbv', and 'rdtscp' instructions. MFC after: 1 month Modified: head/sys/amd64/amd64/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c ============================================================================== --- head/sys/amd64/amd64/db_disasm.c Wed Jul 4 16:25:11 2012 (r238108) +++ head/sys/amd64/amd64/db_disasm.c Wed Jul 4 16:47:39 2012 (r238109) @@ -169,9 +169,9 @@ static const char * const db_Grp15[] = { "fxrstor", "ldmxcsr", "stmxcsr", - "", - "", - "", + "xsave", + "xrstor", + "xsaveopt", "clflush" }; @@ -1279,11 +1279,26 @@ db_disasm(loc, altfmt) i_size = NONE; i_mode = 0; break; + case 0xd0: + i_name = "xgetbv"; + i_size = NONE; + i_mode = 0; + break; + case 0xd1: + i_name = "xsetbv"; + i_size = NONE; + i_mode = 0; + break; case 0xf8: i_name = "swapgs"; i_size = NONE; i_mode = 0; break; + case 0xf9: + i_name = "rdtscp"; + i_size = NONE; + i_mode = 0; + break; } } if (ip->i_extra == db_Grp15 && f_mod(rex, regmodrm) == 3) { From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:31: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 BB12E106564A; Wed, 4 Jul 2012 17:31:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44D48FC17; Wed, 4 Jul 2012 17:31: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 q64HVrGl023249; Wed, 4 Jul 2012 17:31:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HVrPH023247; Wed, 4 Jul 2012 17:31:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041731.q64HVrPH023247@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:31: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: r238110 - head/tools/regression/pjdfstest 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, 04 Jul 2012 17:31:53 -0000 Author: pjd Date: Wed Jul 4 17:31:53 2012 New Revision: 238110 URL: http://svn.freebsd.org/changeset/base/238110 Log: Recognize 'none' or '0' as no flags. Modified: head/tools/regression/pjdfstest/pjdfstest.c Modified: head/tools/regression/pjdfstest/pjdfstest.c ============================================================================== --- head/tools/regression/pjdfstest/pjdfstest.c Wed Jul 4 16:47:39 2012 (r238109) +++ head/tools/regression/pjdfstest/pjdfstest.c Wed Jul 4 17:31:53 2012 (r238110) @@ -350,10 +350,10 @@ str2flags(struct flag *tflags, char *sfl unsigned int i; char *f; - for (f = strtok(sflags, ","); f != NULL; f = strtok(NULL, ",")) { - /* Support magic 'none' flag which just reset all flags. */ - if (strcmp(f, "none") == 0) - return (0); + /* 'none' or '0' means no flags */ + if (strcmp(sflags, "none") == 0 || strcmp(sflags, "0") == 0) + return (0); + for (f = strtok(sflags, ",|"); f != NULL; f = strtok(NULL, ",|")) { for (i = 0; tflags[i].f_str != NULL; i++) { if (strcmp(tflags[i].f_str, f) == 0) break; From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:35: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 56FF51065670; Wed, 4 Jul 2012 17:35:08 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F178FC16; Wed, 4 Jul 2012 17:35: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 q64HZ8El023438; Wed, 4 Jul 2012 17:35:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HZ8UF023435; Wed, 4 Jul 2012 17:35:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041735.q64HZ8UF023435@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:35: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: r238111 - in head: include lib/libc/stdio 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, 04 Jul 2012 17:35:08 -0000 Author: pjd Date: Wed Jul 4 17:35:07 2012 New Revision: 238111 URL: http://svn.freebsd.org/changeset/base/238111 Log: The register_printf_render_std() function expects regular string. Change argument type from 'const unsigned char *' to 'const char *'. MFC after: 2 weeks Modified: head/include/printf.h head/lib/libc/stdio/xprintf.c Modified: head/include/printf.h ============================================================================== --- head/include/printf.h Wed Jul 4 17:31:53 2012 (r238110) +++ head/include/printf.h Wed Jul 4 17:35:07 2012 (r238111) @@ -123,7 +123,7 @@ int register_printf_function(int spec, p /* FreeBSD */ int register_printf_render(int spec, printf_render *render, printf_arginfo_function *arginfo); -int register_printf_render_std(const unsigned char *specs); +int register_printf_render_std(const char *specs); /* vprintf_errno.c */ printf_arginfo_function __printf_arginfo_errno; Modified: head/lib/libc/stdio/xprintf.c ============================================================================== --- head/lib/libc/stdio/xprintf.c Wed Jul 4 17:31:53 2012 (r238110) +++ head/lib/libc/stdio/xprintf.c Wed Jul 4 17:35:07 2012 (r238111) @@ -651,7 +651,7 @@ register_printf_render(int spec, printf_ } int -register_printf_render_std(const unsigned char *specs) +register_printf_render_std(const char *specs) { for (; *specs != '\0'; specs++) { From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:36: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 B3038106566C; Wed, 4 Jul 2012 17:36:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CFF88FC1B; Wed, 4 Jul 2012 17:36: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 q64HaQFR023535; Wed, 4 Jul 2012 17:36:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HaQuY023533; Wed, 4 Jul 2012 17:36:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041736.q64HaQuY023533@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:36: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: r238112 - head/cddl/compat/opensolaris/misc 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, 04 Jul 2012 17:36:26 -0000 Author: pjd Date: Wed Jul 4 17:36:26 2012 New Revision: 238112 URL: http://svn.freebsd.org/changeset/base/238112 Log: Fix an obvious typo. MFC after: 3 days Modified: head/cddl/compat/opensolaris/misc/deviceid.c Modified: head/cddl/compat/opensolaris/misc/deviceid.c ============================================================================== --- head/cddl/compat/opensolaris/misc/deviceid.c Wed Jul 4 17:35:07 2012 (r238111) +++ head/cddl/compat/opensolaris/misc/deviceid.c Wed Jul 4 17:36:26 2012 (r238112) @@ -45,7 +45,7 @@ devid_str_decode(char *devidstr, ddi_dev return (EINVAL); } *retminor_name = strdup(""); - if (*retminor_name == NULL); + if (*retminor_name == NULL) return (ENOMEM); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:39: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 91BE4106564A; Wed, 4 Jul 2012 17:39:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADAA8FC14; Wed, 4 Jul 2012 17:39: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 q64HdUfa023701; Wed, 4 Jul 2012 17:39:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HdUZD023699; Wed, 4 Jul 2012 17:39:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041739.q64HdUZD023699@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:39: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: r238113 - head/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, 04 Jul 2012 17:39:30 -0000 Author: pjd Date: Wed Jul 4 17:39:29 2012 New Revision: 238113 URL: http://svn.freebsd.org/changeset/base/238113 Log: vdev_io_done stage is not used for ioctls. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Wed Jul 4 17:36:26 2012 (r238112) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Wed Jul 4 17:39:29 2012 (r238113) @@ -61,7 +61,7 @@ enum zio_stage { ZIO_STAGE_READY = 1 << 15, /* RWFCI */ ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RW--I */ - ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RW--I */ + ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RW--- */ ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RW--I */ ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:43: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 260321065672; Wed, 4 Jul 2012 17:43:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2F58FC1A; Wed, 4 Jul 2012 17: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 q64HhPvh023890; Wed, 4 Jul 2012 17:43:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HhP7P023888; Wed, 4 Jul 2012 17:43:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041743.q64HhP7P023888@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:43: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: r238114 - head/sys/geom/eli 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, 04 Jul 2012 17:43:26 -0000 Author: pjd Date: Wed Jul 4 17:43:25 2012 New Revision: 238114 URL: http://svn.freebsd.org/changeset/base/238114 Log: Correct a comment and correct style of a flag check. MFC after: 3 days Modified: head/sys/geom/eli/g_eli_key.c Modified: head/sys/geom/eli/g_eli_key.c ============================================================================== --- head/sys/geom/eli/g_eli_key.c Wed Jul 4 17:39:29 2012 (r238113) +++ head/sys/geom/eli/g_eli_key.c Wed Jul 4 17:43:25 2012 (r238114) @@ -197,7 +197,7 @@ g_eli_mkey_propagate(struct g_eli_softc mkey += sizeof(sc->sc_ivkey); /* - * The authentication key is: akey = HMAC_SHA512(Master-Key, 0x11) + * The authentication key is: akey = HMAC_SHA512(Data-Key, 0x11) */ if ((sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { g_eli_crypto_hmac(mkey, G_ELI_MAXKEYLEN, "\x11", 1, @@ -209,7 +209,7 @@ g_eli_mkey_propagate(struct g_eli_softc /* Initialize encryption keys. */ g_eli_key_init(sc); - if (sc->sc_flags & G_ELI_FLAG_AUTH) { + if ((sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { /* * Precalculate SHA256 for HMAC key generation. * This is expensive operation and we can do it only once now or From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:44: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 49065106566B; Wed, 4 Jul 2012 17:44:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26CF98FC16; Wed, 4 Jul 2012 17:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q64HieHZ023989; Wed, 4 Jul 2012 17:44:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HidWl023987; Wed, 4 Jul 2012 17:44:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041744.q64HidWl023987@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:44: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: r238115 - head/sys/geom/eli 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, 04 Jul 2012 17:44:40 -0000 Author: pjd Date: Wed Jul 4 17:44:39 2012 New Revision: 238115 URL: http://svn.freebsd.org/changeset/base/238115 Log: Correct comment. MFC after: 3 days Modified: head/sys/geom/eli/g_eli_key_cache.c Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Wed Jul 4 17:43:25 2012 (r238114) +++ head/sys/geom/eli/g_eli_key_cache.c Wed Jul 4 17:44:39 2012 (r238115) @@ -200,7 +200,7 @@ g_eli_key_init(struct g_eli_softc *sc) bcopy(mkey, sc->sc_ekey, G_ELI_DATAKEYLEN); else { /* - * The encryption key is: ekey = HMAC_SHA512(Master-Key, 0x10) + * The encryption key is: ekey = HMAC_SHA512(Data-Key, 0x10) */ g_eli_crypto_hmac(mkey, G_ELI_MAXKEYLEN, "\x10", 1, sc->sc_ekey, 0); From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:54: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 13F3310656FF; Wed, 4 Jul 2012 17:54:18 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E65FB8FC0A; Wed, 4 Jul 2012 17:54: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 q64HsHbd024426; Wed, 4 Jul 2012 17:54:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HsHWn024421; Wed, 4 Jul 2012 17:54:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041754.q64HsHWn024421@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:54: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: r238116 - head/sys/geom/eli 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, 04 Jul 2012 17:54:18 -0000 Author: pjd Date: Wed Jul 4 17:54:17 2012 New Revision: 238116 URL: http://svn.freebsd.org/changeset/base/238116 Log: Use correct part of the Master-Key for generating encryption keys. Before this change the IV-Key was used to generate encryption keys, which was incorrect, but safe - for the XTS mode this key was unused anyway and for CBC mode it was used differently to generate IV vectors, so there is no risk that IV vector collides with encryption key somehow. Bump version number and keep compatibility for older versions. MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_ctl.c head/sys/geom/eli/g_eli_key_cache.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Jul 4 17:44:39 2012 (r238115) +++ head/sys/geom/eli/g_eli.c Wed Jul 4 17:54:17 2012 (r238116) @@ -726,6 +726,8 @@ g_eli_create(struct gctl_req *req, struc (sc->sc_flags & G_ELI_FLAG_AUTH) != 0) { sc->sc_flags |= G_ELI_FLAG_FIRST_KEY; } + if (md->md_version < G_ELI_VERSION_07) + sc->sc_flags |= G_ELI_FLAG_ENC_IVKEY; sc->sc_ealgo = md->md_ealgo; sc->sc_nkey = nkey; Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Wed Jul 4 17:44:39 2012 (r238115) +++ head/sys/geom/eli/g_eli.h Wed Jul 4 17:54:17 2012 (r238116) @@ -68,6 +68,8 @@ * 5 - Added multiple encrypton keys and AES-XTS support. * 6 - Fixed usage of multiple keys for authenticated providers (the * G_ELI_FLAG_FIRST_KEY flag will be set for older versions). + * 7 - Encryption keys are now generated from the Data Key and not from the + * IV Key (the G_ELI_FLAG_ENC_IVKEY flag will be set for older versions). */ #define G_ELI_VERSION_00 0 #define G_ELI_VERSION_01 1 @@ -76,7 +78,8 @@ #define G_ELI_VERSION_04 4 #define G_ELI_VERSION_05 5 #define G_ELI_VERSION_06 6 -#define G_ELI_VERSION G_ELI_VERSION_06 +#define G_ELI_VERSION_07 7 +#define G_ELI_VERSION G_ELI_VERSION_07 /* ON DISK FLAGS. */ /* Use random, onetime keys. */ @@ -104,6 +107,8 @@ #define G_ELI_FLAG_SUSPEND 0x00100000 /* Provider uses first encryption key. */ #define G_ELI_FLAG_FIRST_KEY 0x00200000 +/* Provider uses IV-Key for encryption key generation. */ +#define G_ELI_FLAG_ENC_IVKEY 0x00400000 #define G_ELI_NEW_BIO 255 @@ -237,7 +242,7 @@ eli_metadata_encode_v0(struct g_eli_meta *datap = p; } static __inline void -eli_metadata_encode_v1v2v3v4v5v6(struct g_eli_metadata *md, u_char **datap) +eli_metadata_encode_v1v2v3v4v5v6v7(struct g_eli_metadata *md, u_char **datap) { u_char *p; @@ -275,7 +280,8 @@ eli_metadata_encode(struct g_eli_metadat case G_ELI_VERSION_04: case G_ELI_VERSION_05: case G_ELI_VERSION_06: - eli_metadata_encode_v1v2v3v4v5v6(md, &p); + case G_ELI_VERSION_07: + eli_metadata_encode_v1v2v3v4v5v6v7(md, &p); break; default: #ifdef _KERNEL @@ -315,7 +321,7 @@ eli_metadata_decode_v0(const u_char *dat } static __inline int -eli_metadata_decode_v1v2v3v4v5v6(const u_char *data, struct g_eli_metadata *md) +eli_metadata_decode_v1v2v3v4v5v6v7(const u_char *data, struct g_eli_metadata *md) { MD5_CTX ctx; const u_char *p; @@ -357,7 +363,8 @@ eli_metadata_decode(const u_char *data, case G_ELI_VERSION_04: case G_ELI_VERSION_05: case G_ELI_VERSION_06: - error = eli_metadata_decode_v1v2v3v4v5v6(data, md); + case G_ELI_VERSION_07: + error = eli_metadata_decode_v1v2v3v4v5v6v7(data, md); break; default: error = EOPNOTSUPP; Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Wed Jul 4 17:44:39 2012 (r238115) +++ head/sys/geom/eli/g_eli_ctl.c Wed Jul 4 17:54:17 2012 (r238116) @@ -1020,6 +1020,12 @@ g_eli_config(struct gctl_req *req, struc /* Compatible. */ break; } + if (G_ELI_VERSION == G_ELI_VERSION_07 && + (*version == G_ELI_VERSION_05 || + *version == G_ELI_VERSION_06)) { + /* Compatible. */ + break; + } gctl_error(req, "Userland and kernel parts are out of sync."); return; } Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Wed Jul 4 17:44:39 2012 (r238115) +++ head/sys/geom/eli/g_eli_key_cache.c Wed Jul 4 17:54:17 2012 (r238116) @@ -91,14 +91,20 @@ RB_GENERATE(g_eli_key_tree, g_eli_key, g static void g_eli_key_fill(struct g_eli_softc *sc, struct g_eli_key *key, uint64_t keyno) { + const uint8_t *ekey; struct { char magic[4]; uint8_t keyno[8]; } __packed hmacdata; + if ((sc->sc_flags & G_ELI_FLAG_ENC_IVKEY) != 0) + ekey = sc->sc_mkey; + else + ekey = sc->sc_ekey; + bcopy("ekey", hmacdata.magic, 4); le64enc(hmacdata.keyno, keyno); - g_eli_crypto_hmac(sc->sc_mkey, G_ELI_MAXKEYLEN, (uint8_t *)&hmacdata, + g_eli_crypto_hmac(ekey, G_ELI_MAXKEYLEN, (uint8_t *)&hmacdata, sizeof(hmacdata), key->gek_key, 0); key->gek_keyno = keyno; key->gek_count = 0; From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 17:59: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 E9187106564A; Wed, 4 Jul 2012 17:59:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFEFB8FC0A; Wed, 4 Jul 2012 17:59: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 q64HxQYB024671; Wed, 4 Jul 2012 17:59:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64HxQcR024669; Wed, 4 Jul 2012 17:59:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041759.q64HxQcR024669@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 17:59: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: r238117 - head/sbin/geom/class/eli 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, 04 Jul 2012 17:59:27 -0000 Author: pjd Date: Wed Jul 4 17:59:26 2012 New Revision: 238117 URL: http://svn.freebsd.org/changeset/base/238117 Log: Improve description of various key used by GELI. PR: docs/169089 Submitted by: John W. O'Brien MFC after: 3 days Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Wed Jul 4 17:54:17 2012 (r238116) +++ head/sbin/geom/class/eli/geli.8 Wed Jul 4 17:59:26 2012 (r238117) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2012 +.Dd June 18, 2012 .Dt GELI 8 .Os .Sh NAME @@ -186,14 +186,15 @@ one of the following algorithms: or .Nm HMAC/SHA512 . .It -Can create a key from a couple of components (user entered passphrase, random -bits from a file, etc.). +Can create a User Key from up to two, piecewise components: a passphrase +entered via prompt or read from one or more passfiles; a keyfile read from +one or more files. .It Allows encryption of the root partition. The user will be asked for the passphrase before the root file system is mounted. .It -The passphrase of the user is strengthened with: +Strengthens the passphrase component of the User Key with: .Rs .%A B. Kaliski .%T "PKCS #5: Password-Based Cryptography Specification, Version 2.0." @@ -201,7 +202,7 @@ The passphrase of the user is strengthen .%N 2898 .Re .It -Allows the use of two independent keys (e.g., a +Allows the use of two independent User Keys (e.g., a .Qq "user key" and a .Qq "company key" ) . @@ -210,8 +211,8 @@ It is fast - .Nm performs simple sector-to-sector encryption. .It -Allows Master Keys to be backed up and restored, -so that if a user has to quickly destroy his keys, +Allows the encrypted Master Key to be backed up and restored, +so that if a user has to quickly destroy key material, it is possible to get the data back by restoring keys from backup. .It @@ -219,8 +220,8 @@ Providers can be configured to automatic (so users do not have to remember to detach providers after unmounting the file systems). .It -Allows attaching a provider with a random, one-time key - useful for swap -partitions and temporary file systems. +Allows attaching a provider with a random, one-time Master Key - +useful for swap partitions and temporary file systems. .It Allows verification of data integrity (data authentication). .It @@ -233,7 +234,8 @@ indicates an action to be performed: .Bl -tag -width ".Cm configure" .It Cm init Initialize the provider which needs to be encrypted. -Here you can set up the cryptographic algorithm to use, key length, etc. +Here you can set up the cryptographic algorithm to use, Data Key length, +etc. The last sector of the provider is used to store metadata. The .Cm init @@ -289,37 +291,58 @@ and The default and recommended algorithm is .Nm AES-XTS . .It Fl i Ar iterations -Number of iterations to use with PKCS#5v2. +Number of iterations to use with PKCS#5v2 when processing User Key +passphrase component. If this option is not specified, .Nm will find the number of iterations which is equal to 2 seconds of crypto work. If 0 is given, PKCS#5v2 will not be used. +PKCS#5v2 processing is performed once, after all parts of the passphrase +component have been read. .It Fl J Ar newpassfile -Specifies a file which contains the passphrase or its part. +Specifies a file which contains the passphrase component of the User Key +(or part of it). If .Ar newpassfile is given as -, standard input will be used. Only the first line (excluding new-line character) is taken from the given file. -This argument can be specified multiple times. +This argument can be specified multiple times, which has the effect of +reassembling a single passphrase split across multiple files. +Cannot be combined with the +.Fl P +option. .It Fl K Ar newkeyfile -Specifies a file which contains part of the key. +Specifies a file which contains the keyfile component of the User Key +(or part of it). If .Ar newkeyfile is given as -, standard input will be used. -This argument can be specified multiple times. +This argument can be specified multiple times, which has the effect of +reassembling a single keyfile split across multiple keyfile parts. .It Fl l Ar keylen -Key length to use with the given cryptographic algorithm. -If not given, the default key length for the given algorithm is used, which is: -128 for -.Nm AES-XTS , -.Nm AES-CBC , -.Nm Blowfish-CBC -and -.Nm Camellia-CBC -and 192 for -.Nm 3DES-CBC . +Data Key length to use with the given cryptographic algorithm. +If the length is not specified, the selected algorithm uses its +.Em default +key length. +.Bl -ohang -offset indent +.It Nm AES-XTS +.Em 128 , +256 +.It Nm AES-CBC , Nm Camilla-CBC +.Em 128 , +192, +256 +.It Nm Blowfish-CBC +.Em 128 ++ n * 32, for n=[0..10] +.It Nm 3DES-CBC +.Em 192 +.El .It Fl P -Do not use passphrase as the key component. +Do not use a passphrase as a component of the User Key. +Cannot be combined with the +.Fl J +option. .It Fl s Ar sectorsize Change decrypted provider's sector size. Increasing the sector size allows increased performance, @@ -337,9 +360,9 @@ Note that using older metadata version m .El .It Cm attach Attach the given provider. -The master key will be decrypted using the given -passphrase/keyfile and a new GEOM provider will be created using the given -provider's name with an +The encrypted Master Key will be loaded from the metadata and decrypted +using the given passphrase/keyfile and a new GEOM provider will be created +using the given provider's name with an .Qq .eli suffix. .Pp @@ -357,28 +380,33 @@ option for the .Cm detach subcommand. .It Fl j Ar passfile -Specifies a file which contains the passphrase or its part. +Specifies a file which contains the passphrase component of the User Key +(or part of it). For more information see the description of the .Fl J option for the .Cm init subcommand. .It Fl k Ar keyfile -Specifies a file which contains part of the key. +Specifies a file which contains the keyfile component of the User Key +(or part of it). For more information see the description of the .Fl K option for the .Cm init subcommand. .It Fl p -Do not use passphrase as the key component. +Do not use a passphrase as a component of the User Key. +Cannot be combined with the +.Fl j +option. .It Fl r Attach read-only provider. It will not be opened for writing. .El .It Cm detach Detach the given providers, which means remove the devfs entry -and clear the keys from memory. +and clear the Master Key and Data Keys from memory. .Pp Additional options include: .Bl -tag -width ".Fl f" @@ -391,7 +419,7 @@ while it is open, but will be automatica last time even if it was only opened for reading. .El .It Cm onetime -Attach the given providers with random, one-time keys. +Attach the given providers with a random, one-time (ephemeral) Master Key. The command can be used to encrypt swap partitions or temporary file systems. .Pp Additional options include: @@ -415,7 +443,7 @@ For more information, see the descriptio .Cm attach subcommand. .It Fl l Ar keylen -Key length to use with the given cryptographic algorithm. +Data Key length to use with the given cryptographic algorithm. For more information, see the description of the .Cm init subcommand. @@ -439,15 +467,18 @@ subcommand. Remove the BOOT flag from the given providers. .El .It Cm setkey -Change or setup (if not yet initialized) selected key. -There is one master key, which can be encrypted with two independent user keys. +Install a copy of the Master Key into the selected slot, encrypted with +a new User Key. +If the selected slot is populated, replace the existing copy. +A provider has one Master Key, which can be stored in one or both slots, +each encrypted with an independent User Key. With the .Cm init subcommand, only key number 0 is initialized. -The key can always be changed: for an attached provider, +The User Key can be changed at any time: for an attached provider, for a detached provider, or on the backup file. When a provider is attached, the user does not have to provide -an old passphrase/keyfile. +an existing passphrase/keyfile. .Pp Additional options include: .Bl -tag -width ".Fl J Ar newpassfile" @@ -458,44 +489,54 @@ To be able to use this option with the .Cm setkey subcommand, only one key has to be defined and this key must be changed. .It Fl j Ar passfile -Specifies a file which contains the old passphrase or its part. +Specifies a file which contains the passphrase component of a current User Key +(or part of it). .It Fl J Ar newpassfile -Specifies a file which contains the new passphrase or its part. +Specifies a file which contains the passphrase component of the new User Key +(or part of it). .It Fl k Ar keyfile -Specifies a file which contains part of the old key. +Specifies a file which contains the keyfile component of a current User Key +(or part of it). .It Fl K Ar newkeyfile -Specifies a file which contains part of the new key. +Specifies a file which contains the keyfile component of the new User Key +(or part of it). .It Fl n Ar keyno -Specifies the number of the key to change (could be 0 or 1). +Specifies the index number of the Master Key copy to change (could be 0 or 1). If the provider is attached and no key number is given, the key used for attaching the provider will be changed. If the provider is detached (or we are operating on a backup file) -and no key number is given, the key decrypted with the passphrase/keyfile -will be changed. +and no key number is given, the first Master Key copy to be successfully +decrypted with the provided User Key passphrase/keyfile will be changed. .It Fl p -Do not use passphrase as the old key component. +Do not use a passphrase as a component of the current User Key. +Cannot be combined with the +.Fl j +option. .It Fl P -Do not use passphrase as the new key component. +Do not use a passphrase as a component of the new User Key. +Cannot be combined with the +.Fl J +option. .El .It Cm delkey -Destroy (overwrite with random data) the selected key. +Destroy (overwrite with random data) the selected Master Key copy. If one is destroying keys for an attached provider, the provider -will not be detached even if all keys are destroyed. +will not be detached even if all copies of the Master Key are destroyed. It can even be rescued with the .Cm setkey -subcommand. +subcommand because the Master Key is still in memory. .Pp Additional options include: .Bl -tag -width ".Fl a Ar keyno" .It Fl a -Destroy all keys (does not need +Destroy all copies of the Master Key (does not need .Fl f option). .It Fl f Force key destruction. -This option is needed to destroy the last key. +This option is needed to destroy the last copy of the Master Key. .It Fl n Ar keyno -Specifies the key number. +Specifies the index number of the Master Key copy. If the provider is attached and no key number is given, the key used for attaching the provider will be destroyed. If provider is detached (or we are operating on a backup file) the key number @@ -503,8 +544,8 @@ has to be given. .El .It Cm kill This command should be used only in emergency situations. -It will destroy all the keys on a given provider and will detach it forcibly -(if it is attached). +It will destroy all copies of the Master Key on a given provider and will +detach it forcibly (if it is attached). This is absolutely a one-way command - if you do not have a metadata backup, your data is gone for good. In case the provider was attached with the @@ -542,8 +583,8 @@ and .El .It Cm suspend Suspend device by waiting for all inflight requests to finish, clearing all -sensitive information (like keys) from kernel memory, and blocking all -further I/O requests until the +sensitive information (like the Master Key and Data Keys) from kernel memory, +and blocking all further I/O requests until the .Cm resume subcommand is executed. This functionality is useful for laptops: when one wants to suspend a @@ -553,8 +594,8 @@ on an encrypted device, unmounting the f the .Cm suspend subcommand can be used. -Any access to the encrypted device will be blocked until the keys are -recovered through the +Any access to the encrypted device will be blocked until the Master Key is +reloaded through the .Cm resume subcommand. Thus there is no need to close nor unmount anything. @@ -584,21 +625,26 @@ utility is stored is bad idea. Additional options include: .Bl -tag -width ".Fl j Ar passfile" .It Fl j Ar passfile -Specifies a file which contains the passphrase or its part. +Specifies a file which contains the passphrase component of the User Key +(or part of it). For more information see the description of the .Fl J option for the .Cm init subcommand. .It Fl k Ar keyfile -Specifies a file which contains part of the key. +Specifies a file which contains the keyfile component of the User Key +(or part of it). For more information see the description of the .Fl K option for the .Cm init subcommand. .It Fl p -Do not use passphrase as the key component. +Do not use a passphrase as a component of the User Key. +Cannot be combined with the +.Fl j +option. .El .It Cm resize Inform @@ -626,6 +672,9 @@ If GEOM providers are specified, the subcommand will print metadata version used by each of them. .It Cm clear Clear metadata from the given providers. +.Em WARNING : +This will erase with zeros the encrypted Master Key copies stored in the +metadata. .It Cm dump Dump metadata stored on the given providers. .It Cm list @@ -647,6 +696,36 @@ Additional options include: .It Fl v Be more verbose. .El +.Sh KEY SUMMARY +.Ss Master Key +Upon +.Cm init , +the +.Nm +utility generates a random Master Key for the provider. +The Master Key never changes during the lifetime of the provider. +Each copy of the provider metadata, active or backed up to a file, can store +up to two, independently-encrypted copies of the Master Key. +.Ss User Key +Each stored copy of the Master Key is encrypted with a User Key, which +is generated by the +.Nm +utility from a passphrase and/or a keyfile. +The +.Nm +utility first reads all parts of the keyfile in the order specified on the +command line, then reads all parts of the stored passphrase in the order +specified on the command line. +If no passphrase parts are specified, the system prompts the user to enter +the passphrase. +The passphrase is optionally strengthened by PKCS#5v2. +The User Key is a digest computed over the concatenated keyfile and passphrase. +.Ss Data Key +During operation, one or more Data Keys are deterministically derived by +the kernel from the Master Key and cached in memory. +The number of Data Keys used by a given provider, and the way they are +derived, depend on the GELI version and whether the provider is configured to +use data authentication. .Sh SYSCTL VARIABLES The following .Xr sysctl 8 @@ -677,7 +756,7 @@ If set to 0, attaching providers on boot This variable should be set in .Pa /boot/loader.conf . .It Va kern.geom.eli.overwrites : No 5 -Specifies how many times the Master-Key will be overwritten +Specifies how many times the Master Key will be overwritten with random values when it is destroyed. After this operation it is filled with zeros. .It Va kern.geom.eli.visible_passphrase : No 0 @@ -699,18 +778,19 @@ Batching reduces the number of interrupt crypto requests with one interrupt. The crypto card and the driver has to support this feature. .It Va kern.geom.eli.key_cache_limit : No 8192 -Specifies how many encryption keys to cache. +Specifies how many Data Keys to cache. The default limit (8192 keys) will allow caching of all keys for a 4TB provider with 512 byte sectors and will take around 1MB of memory. .It Va kern.geom.eli.key_cache_hits -Reports how many times we were looking up a key and it was already in cache. -This sysctl is not updated for providers that need less keys than the limit -specified in +Reports how many times we were looking up a Data Key and it was already in +cache. +This sysctl is not updated for providers that need fewer Data Keys than +the limit specified in .Va kern.geom.eli.key_cache_limit . .It Va kern.geom.eli.key_cache_misses -Reports how many times we were looking up a key and it was not in cache. -This sysctl is not updated for providers that need fewer keys than the limit +Reports how many times we were looking up a Data Key and it was not in cache. +This sysctl is not updated for providers that need fewer Data Keys than the limit specified in .Va kern.geom.eli.key_cache_limit . .El @@ -738,7 +818,7 @@ Enter passphrase: # geli detach da2.eli .Ed .Pp -Create an encrypted provider, but use two keys: +Create an encrypted provider, but use two User Keys: one for your employee and one for you as the company's security officer (so it's not a tragedy if the employee .Qq accidentally @@ -760,7 +840,7 @@ forget their passphrases, so backup the # dd if=/dev/random of=/mnt/pendrive/keys/`hostname` bs=64 count=1 # geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ad0s1e # geli backup /dev/ad0s1e /mnt/pendrive/backups/`hostname` -(use key number 0, so the encrypted Master Key will be overwritten by this) +(use key number 0, so the encrypted Master Key will be re-encrypted by this) # geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ad0s1e (allow the user to enter his passphrase) Enter new passphrase: @@ -776,8 +856,8 @@ Encrypted swap partition setup: .Pp The example below shows how to configure two providers which will be attached on boot (before the root file system is mounted). -One of them is using passphrase and three keyfiles and the other is using only a -keyfile: +One of them is using passphrase and three keyfile parts and the other is +using only a keyfile in one part: .Bd -literal -offset indent # dd if=/dev/random of=/dev/da0 bs=1m # dd if=/dev/random of=/boot/keys/da0.key0 bs=32k count=1 From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 19:51: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 18EEC106566C; Wed, 4 Jul 2012 19:51:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5B38FC1B; Wed, 4 Jul 2012 19: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 q64JpPoq029312; Wed, 4 Jul 2012 19:51:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64JpPXu029310; Wed, 4 Jul 2012 19:51:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207041951.q64JpPXu029310@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 19: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: r238118 - 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: Wed, 04 Jul 2012 19:51:26 -0000 Author: pjd Date: Wed Jul 4 19:51:25 2012 New Revision: 238118 URL: http://svn.freebsd.org/changeset/base/238118 Log: Prefer sysctl to open/read/close for obtaining random data. This method is more sandbox-friendly and also should be faster as only one syscall is needed instead of three. In case of an error fall back to the old method. Reviewed by: simon, gleb MFC after: 2 weeks Modified: head/lib/libc/gen/arc4random.c Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Wed Jul 4 17:59:26 2012 (r238117) +++ head/lib/libc/gen/arc4random.c Wed Jul 4 19:51:25 2012 (r238118) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -78,6 +79,9 @@ static struct arc4_stream rs; static pid_t arc4_stir_pid; static int arc4_count; +extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen); + static inline u_int8_t arc4_getbyte(void); static void arc4_stir(void); @@ -109,6 +113,28 @@ arc4_addrandom(u_char *dat, int datlen) rs.j = rs.i; } +static size_t +arc4_sysctl(u_char *buf, size_t size) +{ + int mib[2]; + size_t len, done; + + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + done = 0; + + do { + len = size; + if (__sysctl(mib, 2, buf, &len, NULL, 0) == -1) + return (done); + done += len; + buf += len; + size -= len; + } while (size > 0); + + return (done); +} + static void arc4_stir(void) { @@ -123,12 +149,16 @@ arc4_stir(void) arc4_init(); rs_initialized = 1; } - fd = _open(RANDOMDEV, O_RDONLY, 0); done = 0; - if (fd >= 0) { - if (_read(fd, &rdat, KEYSIZE) == KEYSIZE) - done = 1; - (void)_close(fd); + if (arc4_sysctl((u_char *)&rdat, KEYSIZE) == KEYSIZE) + done = 1; + if (!done) { + fd = _open(RANDOMDEV, O_RDONLY, 0); + if (fd >= 0) { + if (_read(fd, &rdat, KEYSIZE) == KEYSIZE) + done = 1; + (void)_close(fd); + } } if (!done) { (void)gettimeofday(&rdat.tv, NULL); From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:02: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 185CA1065672; Wed, 4 Jul 2012 20:02:25 +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 621428FC17; Wed, 4 Jul 2012 20:02:23 +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 q64K2XWo041214; Wed, 4 Jul 2012 23:02:33 +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 q64K2KAa015796; Wed, 4 Jul 2012 23:02:20 +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 q64K2K2Z015795; Wed, 4 Jul 2012 23:02:20 +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: Wed, 4 Jul 2012 23:02:20 +0300 From: Konstantin Belousov To: Pawel Jakub Dawidek Message-ID: <20120704200220.GM2337@deviant.kiev.zoral.com.ua> References: <201207041951.q64JpPXu029310@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lU8AdyS7O1+iGTdG" Content-Disposition: inline In-Reply-To: <201207041951.q64JpPXu029310@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: r238118 - 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: Wed, 04 Jul 2012 20:02:25 -0000 --lU8AdyS7O1+iGTdG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 04, 2012 at 07:51:25PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Wed Jul 4 19:51:25 2012 > New Revision: 238118 > URL: http://svn.freebsd.org/changeset/base/238118 >=20 > Log: > Prefer sysctl to open/read/close for obtaining random data. > This method is more sandbox-friendly and also should be faster as only > one syscall is needed instead of three. > In case of an error fall back to the old method. > =20 > Reviewed by: simon, gleb > MFC after: 2 weeks IMO it is weird and against a purpose of sysctl that kern.arand sysctl exists at all. I would prefer to not spread its usage more. We have to keep it to preserve ABI compatibility, but I do not think that the location for random data provider is right, not to mention higher overhead of sysctl machinery. I do think that /dev/random is the right approach, or (less preferable) you could consider adding syscall to get randomness. --lU8AdyS7O1+iGTdG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/0oUwACgkQC3+MBN1Mb4gCVACg0/Qcm2I++ZedlrJt4wkCPjEX UoQAoKn67xRQuCeed+XdR7DL1c/tZcEF =sSVJ -----END PGP SIGNATURE----- --lU8AdyS7O1+iGTdG-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:16: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 4C5701065672; Wed, 4 Jul 2012 20:16:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 333BB8FC0A; Wed, 4 Jul 2012 20:16: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 q64KGT6b030464; Wed, 4 Jul 2012 20:16:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64KGTrr030461; Wed, 4 Jul 2012 20:16:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207042016.q64KGTrr030461@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 20:16: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: r238119 - head/sys/geom/gate 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, 04 Jul 2012 20:16:29 -0000 Author: pjd Date: Wed Jul 4 20:16:28 2012 New Revision: 238119 URL: http://svn.freebsd.org/changeset/base/238119 Log: Extend GEOM Gate class to handle read I/O requests directly within the kernel. This will allow HAST to read directly from the local component without even communicating userland daemon. Sponsored by: Panzura, http://www.panzura.com MFC after: 1 month Modified: head/sys/geom/gate/g_gate.c head/sys/geom/gate/g_gate.h Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Wed Jul 4 19:51:25 2012 (r238118) +++ head/sys/geom/gate/g_gate.c Wed Jul 4 20:16:28 2012 (r238119) @@ -60,7 +60,7 @@ static MALLOC_DEFINE(M_GATE, "gg_data", SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW, 0, - "GEOM_GATE stuff"); + "GEOM_GATE configuration"); static int g_gate_debug = 0; TUNABLE_INT("kern.geom.gate.debug", &g_gate_debug); SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RW, &g_gate_debug, 0, @@ -92,6 +92,7 @@ static int g_gate_destroy(struct g_gate_softc *sc, boolean_t force) { struct g_provider *pp; + struct g_consumer *cp; struct g_geom *gp; struct bio *bp; @@ -138,6 +139,12 @@ g_gate_destroy(struct g_gate_softc *sc, mtx_unlock(&g_gate_units_lock); mtx_destroy(&sc->sc_queue_mtx); g_topology_lock(); + if ((cp = sc->sc_readcons) != NULL) { + sc->sc_readcons = NULL; + (void)g_access(cp, -1, 0, 0); + g_detach(cp); + g_destroy_consumer(cp); + } G_GATE_DEBUG(1, "Device %s destroyed.", gp->name); gp->softc = NULL; g_wither_geom(gp, ENXIO); @@ -167,7 +174,7 @@ g_gate_access(struct g_provider *pp, int } static void -g_gate_start(struct bio *bp) +g_gate_queue_io(struct bio *bp) { struct g_gate_softc *sc; @@ -176,27 +183,9 @@ g_gate_start(struct bio *bp) g_io_deliver(bp, ENXIO); return; } - G_GATE_LOGREQ(2, bp, "Request received."); - switch (bp->bio_cmd) { - case BIO_READ: - break; - case BIO_DELETE: - case BIO_WRITE: - case BIO_FLUSH: - /* XXX: Hack to allow read-only mounts. */ - if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { - g_io_deliver(bp, EPERM); - return; - } - break; - case BIO_GETATTR: - default: - G_GATE_LOGREQ(2, bp, "Ignoring request."); - g_io_deliver(bp, EOPNOTSUPP); - return; - } mtx_lock(&sc->sc_queue_mtx); + if (sc->sc_queue_size > 0 && sc->sc_queue_count > sc->sc_queue_size) { mtx_unlock(&sc->sc_queue_mtx); G_GATE_LOGREQ(1, bp, "Queue full, request canceled."); @@ -214,6 +203,74 @@ g_gate_start(struct bio *bp) mtx_unlock(&sc->sc_queue_mtx); } +static void +g_gate_done(struct bio *cbp) +{ + struct bio *pbp; + + pbp = cbp->bio_parent; + if (cbp->bio_error == 0) { + pbp->bio_completed = cbp->bio_completed; + g_destroy_bio(cbp); + pbp->bio_inbed++; + g_io_deliver(pbp, 0); + } else { + /* If direct read failed, pass it through userland daemon. */ + g_destroy_bio(cbp); + pbp->bio_children--; + g_gate_queue_io(pbp); + } +} + +static void +g_gate_start(struct bio *pbp) +{ + struct g_gate_softc *sc; + + sc = pbp->bio_to->geom->softc; + if (sc == NULL || (sc->sc_flags & G_GATE_FLAG_DESTROY) != 0) { + g_io_deliver(pbp, ENXIO); + return; + } + G_GATE_LOGREQ(2, pbp, "Request received."); + switch (pbp->bio_cmd) { + case BIO_READ: + if (sc->sc_readcons != NULL) { + struct bio *cbp; + + cbp = g_clone_bio(pbp); + if (cbp == NULL) { + g_io_deliver(pbp, ENOMEM); + return; + } + cbp->bio_done = g_gate_done; + cbp->bio_offset = pbp->bio_offset + sc->sc_readoffset; + cbp->bio_data = pbp->bio_data; + cbp->bio_length = pbp->bio_length; + cbp->bio_to = sc->sc_readcons->provider; + g_io_request(cbp, sc->sc_readcons); + return; + } + break; + case BIO_DELETE: + case BIO_WRITE: + case BIO_FLUSH: + /* XXX: Hack to allow read-only mounts. */ + if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { + g_io_deliver(pbp, EPERM); + return; + } + break; + case BIO_GETATTR: + default: + G_GATE_LOGREQ(2, pbp, "Ignoring request."); + g_io_deliver(pbp, EOPNOTSUPP); + return; + } + + g_gate_queue_io(pbp); +} + static struct g_gate_softc * g_gate_hold(int unit, const char *name) { @@ -312,6 +369,27 @@ g_gate_guard(void *arg) } static void +g_gate_orphan(struct g_consumer *cp) +{ + struct g_gate_softc *sc; + struct g_geom *gp; + + g_topology_assert(); + gp = cp->geom; + sc = gp->softc; + if (sc == NULL) + return; + KASSERT(cp == sc->sc_readcons, ("cp=%p sc_readcons=%p", cp, + sc->sc_readcons)); + sc->sc_readcons = NULL; + G_GATE_DEBUG(1, "Destroying read consumer on provider %s orphan.", + cp->provider->name); + (void)g_access(cp, -1, 0, 0); + g_detach(cp); + g_destroy_consumer(cp); +} + +static void g_gate_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp) { @@ -330,6 +408,12 @@ g_gate_dumpconf(struct sbuf *sb, const c sbuf_printf(sb, "%s%s\n", indent, "read-write"); } + if (sc->sc_readcons != NULL) { + sbuf_printf(sb, "%s%jd\n", + indent, (intmax_t)sc->sc_readoffset); + sbuf_printf(sb, "%s%s\n", + indent, sc->sc_readcons->provider->name); + } sbuf_printf(sb, "%s%u\n", indent, sc->sc_timeout); sbuf_printf(sb, "%s%s\n", indent, sc->sc_info); sbuf_printf(sb, "%s%u\n", indent, @@ -348,15 +432,20 @@ g_gate_create(struct g_gate_ctl_create * { struct g_gate_softc *sc; struct g_geom *gp; - struct g_provider *pp; + struct g_provider *pp, *ropp; + struct g_consumer *cp; char name[NAME_MAX]; int error = 0, unit; - if (ggio->gctl_mediasize == 0) { + if (ggio->gctl_mediasize <= 0) { G_GATE_DEBUG(1, "Invalid media size."); return (EINVAL); } - if (ggio->gctl_sectorsize > 0 && !powerof2(ggio->gctl_sectorsize)) { + if (ggio->gctl_sectorsize <= 0) { + G_GATE_DEBUG(1, "Invalid sector size."); + return (EINVAL); + } + if (!powerof2(ggio->gctl_sectorsize)) { G_GATE_DEBUG(1, "Invalid sector size."); return (EINVAL); } @@ -381,6 +470,31 @@ g_gate_create(struct g_gate_ctl_create * return (EINVAL); } + g_topology_lock(); + + if (ggio->gctl_readprov[0] == '\0') { + ropp = NULL; + } else { + ropp = g_provider_by_name(ggio->gctl_readprov); + if (ropp == NULL) { + g_topology_unlock(); + G_GATE_DEBUG(1, "Provider %s doesn't exist.", + ggio->gctl_readprov); + return (EINVAL); + } + if ((ggio->gctl_readoffset % ggio->gctl_sectorsize) != 0) { + g_topology_unlock(); + G_GATE_DEBUG(1, "Invalid read offset."); + return (EINVAL); + } + if (ggio->gctl_mediasize + ggio->gctl_readoffset > + ropp->mediasize) { + g_topology_unlock(); + G_GATE_DEBUG(1, "Invalid read offset or media size."); + return (EINVAL); + } + } + sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO); sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS); strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info)); @@ -394,10 +508,50 @@ g_gate_create(struct g_gate_ctl_create * sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE; sc->sc_timeout = ggio->gctl_timeout; callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + + gp = g_new_geomf(&g_gate_class, "%s", name); + gp->start = g_gate_start; + gp->access = g_gate_access; + gp->orphan = g_gate_orphan; + gp->dumpconf = g_gate_dumpconf; + gp->softc = sc; + + if (ropp != NULL) { + cp = g_new_consumer(gp); + error = g_attach(cp, ropp); + if (error != 0) { + G_GATE_DEBUG(1, "Unable to attach to %s.", ropp->name); + } else { + error = g_access(cp, 1, 0, 0); + if (error != 0) { + G_GATE_DEBUG(1, "Unable to access %s.", + ropp->name); + g_detach(cp); + } + } + if (error != 0) { + g_destroy_consumer(cp); + g_destroy_geom(gp); + g_topology_unlock(); + mtx_destroy(&sc->sc_queue_mtx); + free(sc, M_GATE); + return (error); + } + sc->sc_readcons = cp; + sc->sc_readoffset = ggio->gctl_readoffset; + } + mtx_lock(&g_gate_units_lock); sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error); if (sc->sc_unit < 0) { mtx_unlock(&g_gate_units_lock); + if (sc->sc_readcons != NULL) { + (void)g_access(sc->sc_readcons, -1, 0, 0); + g_detach(sc->sc_readcons); + g_destroy_consumer(sc->sc_readcons); + } + g_destroy_geom(gp); + g_topology_unlock(); mtx_destroy(&sc->sc_queue_mtx); free(sc, M_GATE); return (error); @@ -415,6 +569,13 @@ g_gate_create(struct g_gate_ctl_create * if (strcmp(name, g_gate_units[unit]->sc_name) != 0) continue; mtx_unlock(&g_gate_units_lock); + if (sc->sc_readcons != NULL) { + (void)g_access(sc->sc_readcons, -1, 0, 0); + g_detach(sc->sc_readcons); + g_destroy_consumer(sc->sc_readcons); + } + g_destroy_geom(gp); + g_topology_unlock(); mtx_destroy(&sc->sc_queue_mtx); free(sc, M_GATE); return (EEXIST); @@ -426,17 +587,12 @@ g_gate_create(struct g_gate_ctl_create * ggio->gctl_unit = sc->sc_unit; - g_topology_lock(); - gp = g_new_geomf(&g_gate_class, "%s", name); - gp->start = g_gate_start; - gp->access = g_gate_access; - gp->dumpconf = g_gate_dumpconf; - gp->softc = sc; pp = g_new_providerf(gp, "%s", name); pp->mediasize = ggio->gctl_mediasize; pp->sectorsize = ggio->gctl_sectorsize; sc->sc_provider = pp; g_error_provider(pp, 0); + g_topology_unlock(); mtx_lock(&g_gate_units_lock); sc->sc_name = sc->sc_provider->name; @@ -450,6 +606,98 @@ g_gate_create(struct g_gate_ctl_create * return (0); } +static int +g_gate_modify(struct g_gate_softc *sc, struct g_gate_ctl_modify *ggio) +{ + struct g_provider *pp; + struct g_consumer *cp; + int error; + + if ((ggio->gctl_modify & GG_MODIFY_MEDIASIZE) != 0) { + if (ggio->gctl_mediasize <= 0) { + G_GATE_DEBUG(1, "Invalid media size."); + return (EINVAL); + } + pp = sc->sc_provider; + if ((ggio->gctl_mediasize % pp->sectorsize) != 0) { + G_GATE_DEBUG(1, "Invalid media size."); + return (EINVAL); + } + /* TODO */ + return (EOPNOTSUPP); + } + + if ((ggio->gctl_modify & GG_MODIFY_INFO) != 0) + (void)strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info)); + + cp = NULL; + + if ((ggio->gctl_modify & GG_MODIFY_READPROV) != 0) { + g_topology_lock(); + if (sc->sc_readcons != NULL) { + cp = sc->sc_readcons; + sc->sc_readcons = NULL; + (void)g_access(cp, -1, 0, 0); + g_detach(cp); + g_destroy_consumer(cp); + } + if (ggio->gctl_readprov[0] != '\0') { + pp = g_provider_by_name(ggio->gctl_readprov); + if (pp == NULL) { + g_topology_unlock(); + G_GATE_DEBUG(1, "Provider %s doesn't exist.", + ggio->gctl_readprov); + return (EINVAL); + } + cp = g_new_consumer(sc->sc_provider->geom); + error = g_attach(cp, pp); + if (error != 0) { + G_GATE_DEBUG(1, "Unable to attach to %s.", + pp->name); + } else { + error = g_access(cp, 1, 0, 0); + if (error != 0) { + G_GATE_DEBUG(1, "Unable to access %s.", + pp->name); + g_detach(cp); + } + } + if (error != 0) { + g_destroy_consumer(cp); + g_topology_unlock(); + return (error); + } + } + } else { + cp = sc->sc_readcons; + } + + if ((ggio->gctl_modify & GG_MODIFY_READOFFSET) != 0) { + if (cp == NULL) { + G_GATE_DEBUG(1, "No read provider."); + return (EINVAL); + } + pp = sc->sc_provider; + if ((ggio->gctl_readoffset % pp->sectorsize) != 0) { + G_GATE_DEBUG(1, "Invalid read offset."); + return (EINVAL); + } + if (pp->mediasize + ggio->gctl_readoffset > + cp->provider->mediasize) { + G_GATE_DEBUG(1, "Invalid read offset or media size."); + return (EINVAL); + } + sc->sc_readoffset = ggio->gctl_readoffset; + } + + if ((ggio->gctl_modify & GG_MODIFY_READPROV) != 0) { + sc->sc_readcons = cp; + g_topology_unlock(); + } + + return (0); +} + #define G_GATE_CHECK_VERSION(ggio) do { \ if ((ggio)->gctl_version != G_GATE_VERSION) { \ printf("Version mismatch %d != %d.\n", \ @@ -483,6 +731,18 @@ g_gate_ioctl(struct cdev *dev, u_long cm td->td_pflags &= ~TDP_GEOM; return (error); } + case G_GATE_CMD_MODIFY: + { + struct g_gate_ctl_modify *ggio = (void *)addr; + + G_GATE_CHECK_VERSION(ggio); + sc = g_gate_hold(ggio->gctl_unit, NULL); + if (sc == NULL) + return (ENXIO); + error = g_gate_modify(sc, ggio); + g_gate_release(sc); + return (error); + } case G_GATE_CMD_DESTROY: { struct g_gate_ctl_destroy *ggio = (void *)addr; Modified: head/sys/geom/gate/g_gate.h ============================================================================== --- head/sys/geom/gate/g_gate.h Wed Jul 4 19:51:25 2012 (r238118) +++ head/sys/geom/gate/g_gate.h Wed Jul 4 20:16:28 2012 (r238119) @@ -41,7 +41,7 @@ #define G_GATE_MOD_NAME "ggate" #define G_GATE_CTL_NAME "ggctl" -#define G_GATE_VERSION 2 +#define G_GATE_VERSION 3 /* * Maximum number of request that can be stored in @@ -64,10 +64,11 @@ #define G_GATE_NAME_GIVEN (-2) #define G_GATE_CMD_CREATE _IOWR('m', 0, struct g_gate_ctl_create) -#define G_GATE_CMD_DESTROY _IOWR('m', 1, struct g_gate_ctl_destroy) -#define G_GATE_CMD_CANCEL _IOWR('m', 2, struct g_gate_ctl_cancel) -#define G_GATE_CMD_START _IOWR('m', 3, struct g_gate_ctl_io) -#define G_GATE_CMD_DONE _IOWR('m', 4, struct g_gate_ctl_io) +#define G_GATE_CMD_MODIFY _IOWR('m', 1, struct g_gate_ctl_modify) +#define G_GATE_CMD_DESTROY _IOWR('m', 2, struct g_gate_ctl_destroy) +#define G_GATE_CMD_CANCEL _IOWR('m', 3, struct g_gate_ctl_cancel) +#define G_GATE_CMD_START _IOWR('m', 4, struct g_gate_ctl_io) +#define G_GATE_CMD_DONE _IOWR('m', 5, struct g_gate_ctl_io) #define G_GATE_INFOSIZE 2048 @@ -88,6 +89,8 @@ struct g_gate_softc { uint32_t sc_queue_count; /* P: sc_queue_mtx */ uint32_t sc_queue_size; /* P: (read-only) */ u_int sc_timeout; /* P: (read-only) */ + struct g_consumer *sc_readcons; /* P: XXX */ + off_t sc_readoffset; /* P: XXX */ struct callout sc_callout; /* P: (modified only from callout thread) */ @@ -131,9 +134,25 @@ struct g_gate_ctl_create { u_int gctl_timeout; char gctl_name[NAME_MAX]; char gctl_info[G_GATE_INFOSIZE]; + char gctl_readprov[NAME_MAX]; + off_t gctl_readoffset; int gctl_unit; /* in/out */ }; +#define GG_MODIFY_MEDIASIZE 0x01 +#define GG_MODIFY_INFO 0x02 +#define GG_MODIFY_READPROV 0x04 +#define GG_MODIFY_READOFFSET 0x08 +struct g_gate_ctl_modify { + u_int gctl_version; + int gctl_unit; + uint32_t gctl_modify; + off_t gctl_mediasize; + char gctl_info[G_GATE_INFOSIZE]; + char gctl_readprov[NAME_MAX]; + off_t gctl_readoffset; +}; + struct g_gate_ctl_destroy { u_int gctl_version; int gctl_unit; From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:20: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 4530B1065670; Wed, 4 Jul 2012 20:20:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 231E48FC0A; Wed, 4 Jul 2012 20:20: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 q64KKm9m030671; Wed, 4 Jul 2012 20:20:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64KKmiI030669; Wed, 4 Jul 2012 20:20:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201207042020.q64KKmiI030669@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 4 Jul 2012 20:20: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: r238120 - head/sbin/hastd 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, 04 Jul 2012 20:20:49 -0000 Author: pjd Date: Wed Jul 4 20:20:48 2012 New Revision: 238120 URL: http://svn.freebsd.org/changeset/base/238120 Log: Make use of GEOM Gate direct reads feature. This allows HAST to serve reads with native speed of the underlying provider. There are three situations when direct reads are not used: 1. Data is being synchronized and synchronization source is the secondary node, which means secondary node has more recent data and we should read from it. 2. Local read failed and we have to try to read from the secondary node. 3. Local component is unavailable and all I/O requests are served from the secondary node. Sponsored by: Panzura, http://www.panzura.com MFC after: 1 month Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Jul 4 20:16:28 2012 (r238119) +++ head/sbin/hastd/primary.c Wed Jul 4 20:20:48 2012 (r238120) @@ -543,6 +543,27 @@ primary_connect(struct hast_resource *re return (0); } + +/* + * Function instructs GEOM_GATE to handle reads directly from within the kernel. + */ +static void +enable_direct_reads(struct hast_resource *res) +{ + struct g_gate_ctl_modify ggiomodify; + + bzero(&ggiomodify, sizeof(ggiomodify)); + ggiomodify.gctl_version = G_GATE_VERSION; + ggiomodify.gctl_unit = res->hr_ggateunit; + ggiomodify.gctl_modify = GG_MODIFY_READPROV | GG_MODIFY_READOFFSET; + strlcpy(ggiomodify.gctl_readprov, res->hr_localpath, + sizeof(ggiomodify.gctl_readprov)); + ggiomodify.gctl_readoffset = res->hr_localoff; + if (ioctl(res->hr_ggatefd, G_GATE_CMD_MODIFY, &ggiomodify) == 0) + pjdlog_debug(1, "Direct reads enabled."); + else + pjdlog_errno(LOG_WARNING, "Failed to enable direct reads"); +} static int init_remote(struct hast_resource *res, struct proto_conn **inp, @@ -692,6 +713,8 @@ init_remote(struct hast_resource *res, s res->hr_secondary_localcnt = nv_get_uint64(nvin, "localcnt"); res->hr_secondary_remotecnt = nv_get_uint64(nvin, "remotecnt"); res->hr_syncsrc = nv_get_uint8(nvin, "syncsrc"); + if (res->hr_syncsrc == HAST_SYNCSRC_PRIMARY) + enable_direct_reads(res); if (nv_exists(nvin, "virgin")) { /* * Secondary was reinitialized, bump localcnt if it is 0 as @@ -1789,13 +1812,14 @@ sync_thread(void *arg __unused) struct timeval tstart, tend, tdiff; unsigned int ii, ncomp, ncomps; off_t offset, length, synced; - bool dorewind; + bool dorewind, directreads; int syncext; ncomps = HAST_NCOMPONENTS; dorewind = true; synced = 0; offset = -1; + directreads = false; for (;;) { mtx_lock(&sync_lock); @@ -1867,6 +1891,8 @@ sync_thread(void *arg __unused) event_send(res, EVENT_SYNCDONE); } mtx_lock(&metadata_lock); + if (res->hr_syncsrc == HAST_SYNCSRC_SECONDARY) + directreads = true; res->hr_syncsrc = HAST_SYNCSRC_UNDEF; res->hr_primary_localcnt = res->hr_secondary_remotecnt; @@ -1880,6 +1906,10 @@ sync_thread(void *arg __unused) mtx_unlock(&metadata_lock); } rw_unlock(&hio_remote_lock[ncomp]); + if (directreads) { + directreads = false; + enable_direct_reads(res); + } continue; } pjdlog_debug(2, "sync: Taking free request."); From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:29: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 90004106567F; Wed, 4 Jul 2012 20:29:17 +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 7828C8FC0A; Wed, 4 Jul 2012 20:29: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 q64KTHr0031053; Wed, 4 Jul 2012 20:29:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64KTHZt031051; Wed, 4 Jul 2012 20:29:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207042029.q64KTHZt031051@svn.freebsd.org> From: Michael Tuexen Date: Wed, 4 Jul 2012 20:29: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: r238121 - 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, 04 Jul 2012 20:29:17 -0000 Author: tuexen Date: Wed Jul 4 20:29:16 2012 New Revision: 238121 URL: http://svn.freebsd.org/changeset/base/238121 Log: Use CSUM_SCTP_IPV6 for IPv6. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jul 4 20:20:48 2012 (r238120) +++ head/sys/netinet/sctp_output.c Wed Jul 4 20:29:16 2012 (r238121) @@ -4471,7 +4471,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - m->m_pkthdr.csum_flags = CSUM_SCTP; + m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; m->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -11025,7 +11025,7 @@ sctp_send_resp_msg(struct sockaddr *src, #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - mout->m_pkthdr.csum_flags = CSUM_SCTP; + mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:32: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 2AAEC106566B; Wed, 4 Jul 2012 20:32:48 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 646F38FC17; Wed, 4 Jul 2012 20:32:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q64KWeDG042644; Thu, 5 Jul 2012 00:32:40 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q64KWeGj042643; Thu, 5 Jul 2012 00:32:40 +0400 (MSK) (envelope-from ache) Date: Thu, 5 Jul 2012 00:32:40 +0400 From: Andrey Chernov To: Konstantin Belousov Message-ID: <20120704203239.GA42326@vniz.net> Mail-Followup-To: Andrey Chernov , Konstantin Belousov , Pawel Jakub Dawidek , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, markm@freebsd.org References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: <20120704200220.GM2337@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, markm@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Pawel Jakub Dawidek Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:32:48 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 04, 2012 at 11:02:20PM +0300, Konstantin Belousov wrote: > On Wed, Jul 04, 2012 at 07:51:25PM +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Wed Jul 4 19:51:25 2012 > > New Revision: 238118 > > URL: http://svn.freebsd.org/changeset/base/238118 > >=20 > > Log: > > Prefer sysctl to open/read/close for obtaining random data. > > This method is more sandbox-friendly and also should be faster as only > > one syscall is needed instead of three. > > In case of an error fall back to the old method. > > =20 > > Reviewed by: simon, gleb > > MFC after: 2 weeks > IMO it is weird and against a purpose of sysctl that kern.arand sysctl > exists at all. I would prefer to not spread its usage more. We have > to keep it to preserve ABI compatibility, but I do not think that the > location for random data provider is right, not to mention higher > overhead of sysctl machinery. 1) /dev/urandom may not exist in jails/sandboxes while sysctls (or old way= =20 initialization) always exists. 2) Current NetBSD code uses KERN_URND we don't have. 3) Current OpenBSD code uses KERN_ARND as in the change committed. 4) Our KERN_ARND initially is initialized only from from the weak value at= =20 the boot stage. 5) I already provide two working patches (one with atomic and another=20 one without) to bypass issue 4) but they are never committed by person=20 who promise to handle them (markm@ CCed) for the reason unknown and I=20 can't do it by myself due to stupid secteam@ 5 years old ban. 6) So, current KERN_ARND way gives weak randomness for just started after= =20 boot programs and should be fixed by either my patches mentioned in 5) or= =20 by implementing KERN_URND as in NetBSD. Note that the initial ARND seeding problem does not exist in OpenBSD since= =20 they use different KERN_ARND implementation. (besides usage in arc4random code I think KERN_ARND should be fixed in=20 anycase) --=20 http://ache.vniz.net/ --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/0qGcACgkQVg5YK5ZEdN1LPgCeLj0IGDbAOKc01hKYZg2+Vh2q tLIAn3+/VqmCURvuAytCw6qV4otUAtyP =s+Rp -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:40: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 CD5D8106564A; Wed, 4 Jul 2012 20:40:26 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0A28FC08; Wed, 4 Jul 2012 20:40:26 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cmbg15-2-0-cust445.5-4.cable.virginmedia.com [86.26.13.190]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id q64KeM2v023421 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 4 Jul 2012 20:40:25 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120704203239.GA42326@vniz.net> Date: Wed, 4 Jul 2012 21:40:17 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> To: Andrey Chernov X-Mailer: Apple Mail (2.1278) Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Konstantin Belousov , markm@FreeBSD.org Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:40:26 -0000 On 4 Jul 2012, at 21:32, Andrey Chernov wrote: > 1) /dev/urandom may not exist in jails/sandboxes while sysctls (or old = way=20 > initialization) always exists. =46rom the perspective of Capsicum sandboxes, a device node is better = than a sysctl. The kernel must hard-code policy about which sysctls are = permitted, but access to file descriptors is decided on a per-sandbox = basis and is configurable by the user. The same applies to jails, = although it's slightly more effort to make device nodes appear inside a = jail. David= From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:45: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 77000106564A; Wed, 4 Jul 2012 20:45:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4F18FC17; Wed, 4 Jul 2012 20:45:55 +0000 (UTC) Received: by lbon10 with SMTP id n10so13664899lbo.13 for ; Wed, 04 Jul 2012 13:45:54 -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 :content-transfer-encoding; bh=bcWpk3OPPWyl+X5CeLf1AtEXLqbnsU+KwRYRiWzBKV0=; b=o4LaL1499fhoZqLRdv9FwagQmpFuwT4iSb9nmQwQpinH3C86AhjthKmge88ofq/D6v YcUpQZeLEvRv1ALRcy/OWlYD8oL4EXzFGVbXQjV31r53Les+VzVH/XDm+qxxbLTXRibb NeXmOKNlgOcejHiCTsysQ9eys1Boo1/8CRJ9J5hrEAO5MB/76z9xZ3fIJ4EhVvn2XMSS ZFOP6k3DHxtpH5BH+sMKxhO9jJQVsyi8xshRDKYuqFTk5XLEgy9RGzOyDgvtVzRCqGXk W4mnPmIKR6eFRrsccuUUvzVTooDwRL40pt94nmQZQPreB/59hvGAn0Luptqrgsk1trg+ Z6rA== MIME-Version: 1.0 Received: by 10.112.23.196 with SMTP id o4mr10720646lbf.49.1341434754402; Wed, 04 Jul 2012 13:45:54 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Wed, 4 Jul 2012 13:45:54 -0700 (PDT) In-Reply-To: <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> Date: Wed, 4 Jul 2012 21:45:54 +0100 X-Google-Sender-Auth: 1BDlpz4IoF7GvbbAv_uwj-HEotM Message-ID: From: Attilio Rao To: David Chisnall Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Konstantin Belousov , svn-src-head@freebsd.org, Andrey Chernov , markm@freebsd.org Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:45:57 -0000 2012/7/4 David Chisnall : > On 4 Jul 2012, at 21:32, Andrey Chernov wrote: > >> 1) /dev/urandom may not exist in jails/sandboxes while sysctls (or old w= ay >> initialization) always exists. > > From the perspective of Capsicum sandboxes, a device node is better than = a sysctl. The kernel must hard-code policy about which sysctls are permitt= ed, but access to file descriptors is decided on a per-sandbox basis and is= configurable by the user. The same applies to jails, although it's slight= ly more effort to make device nodes appear inside a jail. Also don't understimate the locking factor here. I recall that at some point /dev/random was introducing some scalability penalty on php (maybe related to the suhosin patch) until kib made shared lookups available on devfs. IIRC, sysctls are still Giant locked. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:50:04 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 DD6F6106566C; Wed, 4 Jul 2012 20:50:03 +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 6DB361A48C1; Wed, 4 Jul 2012 20:49:02 +0000 (UTC) Message-ID: <4FF4AC3D.9070109@FreeBSD.org> Date: Wed, 04 Jul 2012 13:49:01 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120624 Thunderbird/13.0.1 MIME-Version: 1.0 To: Andrey Chernov , Konstantin Belousov , Pawel Jakub Dawidek , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, markm@freebsd.org References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> In-Reply-To: <20120704203239.GA42326@vniz.net> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:50:04 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 07/04/2012 13:32, Andrey Chernov wrote: > 1) /dev/urandom may not exist in jails/sandboxes That would be a pretty serious configuration error. - -- This .signature sanitized for your protection -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJP9Kw9AAoJEFzGhvEaGryEATEH/RbxtNiNYy+Ki/DL0JWVTTwq f+kEK8bASCfJGmA+Vb+1cjEGcMT64QOvV3n4ow0xjn9xctmWVtoA8Y4Q4dRomOh6 vOlJfu5aRsZsAxsf9sV3k1psuO5IXuYBfAeGVtGBjgNMnDG46PiNBE+4q5rVntHw sUsuyupxgRbYrCvTVbeET2wAZ+G9j8ceK56nA63KN3azAIpCktCDzSm3FlDrVWYh zk+LpIHdpE4pbpH8znxDQoRqF+V9n6pryGiFNzkzLODvtoiL7qgrJtNEdfu3GCQI J7tolXvMmxljYW+V3PUP5abO6RS1uCMiZi3wvo+HaZqhPVUVTw98tx+qRwBJ7zs= =1MvW -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:50: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 24E3F106566B; Wed, 4 Jul 2012 20:50:44 +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 70D078FC18; Wed, 4 Jul 2012 20:50:43 +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 q64KoqVH043991; Wed, 4 Jul 2012 23:50:52 +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 q64KodfT016125; Wed, 4 Jul 2012 23:50:39 +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 q64Kod1A016124; Wed, 4 Jul 2012 23:50:39 +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: Wed, 4 Jul 2012 23:50:39 +0300 From: Konstantin Belousov To: Attilio Rao Message-ID: <20120704205039.GO2337@deviant.kiev.zoral.com.ua> References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8F/57/tdqD1iFupr" 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: src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, David Chisnall , svn-src-head@freebsd.org, Pawel Jakub Dawidek , markm@freebsd.org Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:50:44 -0000 --8F/57/tdqD1iFupr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 04, 2012 at 09:45:54PM +0100, Attilio Rao wrote: > 2012/7/4 David Chisnall : > > On 4 Jul 2012, at 21:32, Andrey Chernov wrote: > > > >> 1) /dev/urandom may not exist in jails/sandboxes while sysctls (or old= way > >> initialization) always exists. > > > > From the perspective of Capsicum sandboxes, a device node is better tha= n a sysctl. The kernel must hard-code policy about which sysctls are permi= tted, but access to file descriptors is decided on a per-sandbox basis and = is configurable by the user. The same applies to jails, although it's slig= htly more effort to make device nodes appear inside a jail. >=20 > Also don't understimate the locking factor here. > I recall that at some point /dev/random was introducing some > scalability penalty on php (maybe related to the suhosin patch) until > kib made shared lookups available on devfs. IIRC, sysctls are still > Giant locked. /dev/random has further optimizations which eliminate the dev_mtx aquisitions as well. KERN_ARND is mpsafe. --8F/57/tdqD1iFupr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/0rJ8ACgkQC3+MBN1Mb4gZOwCZAeP3uUjdRcIxqyJMvUuTCFeY tlAAoI95/UY73VhFCesTtMcC7pnvAclL =/7S7 -----END PGP SIGNATURE----- --8F/57/tdqD1iFupr-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20: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 438A1106566B; Wed, 4 Jul 2012 20:56:09 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id A82248FC16; Wed, 4 Jul 2012 20:56:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q64Ku7iO042958; Thu, 5 Jul 2012 00:56:07 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q64Ku7MZ042957; Thu, 5 Jul 2012 00:56:07 +0400 (MSK) (envelope-from ache) Date: Thu, 5 Jul 2012 00:56:06 +0400 From: Andrey Chernov To: Doug Barton Message-ID: <20120704205606.GA42877@vniz.net> Mail-Followup-To: Andrey Chernov , Doug Barton , Konstantin Belousov , Pawel Jakub Dawidek , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, markm@FreeBSD.ORG References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> <4FF4AC3D.9070109@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FF4AC3D.9070109@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Konstantin Belousov , markm@FreeBSD.ORG Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:56:09 -0000 On Wed, Jul 04, 2012 at 01:49:01PM -0700, Doug Barton wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 07/04/2012 13:32, Andrey Chernov wrote: > > 1) /dev/urandom may not exist in jails/sandboxes > > That would be a pretty serious configuration error. > It may be true, but old POLA is that *BSD arc4random() should works nice in such situations. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20:58: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 D6DBB106566B for ; Wed, 4 Jul 2012 20:58:54 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.me) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) by mx1.freebsd.org (Postfix) with SMTP id 768EA8FC18 for ; Wed, 4 Jul 2012 20:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=RkSXblc+fAktEAm6qGXlSrZmabY=; b=ldiSAjQcumXzDtdSuGEAhrH0okpr jmpL4twA8NpRLWA/rrtF3od7QsaP5hkFUy5MoMo1OKjJ56JIcost3mH6ObY47BlN fX1VByW7S7VItoADurMRuJZzzc6g6bz3mynsUc28U9K8TBIR8So9exuK8jcioz+A oUqBswp5PD3/ckI= Received: by 10.4.35.224 with SMTP id mf3.15528.4FF4AE8C3 Wed, 04 Jul 2012 15:58:52 -0500 (CDT) Received: from mail.tarsnap.com (unknown [10.9.180.5]) by mi2 (SG) with ESMTP id 4ff4ae8c.33dc.13feb1 for ; Wed, 04 Jul 2012 15:58:52 -0500 (CST) Received: (qmail 79274 invoked from network); 4 Jul 2012 20:57:29 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 4 Jul 2012 20:57:29 -0000 Received: (qmail 5312 invoked from network); 4 Jul 2012 20:58:31 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 4 Jul 2012 20:58:31 -0000 Message-ID: <4FF4AE77.6020809@freebsd.org> Date: Wed, 04 Jul 2012 13:58:31 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120627 Thunderbird/13.0.1 MIME-Version: 1.0 To: Attilio Rao References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNEELRzgGiqFbJ+dYlkgv/AIscwsCrEMXm2LaSbas1VHHKqq9TKaeYPkiki5AfIday74EKzIcGDDV70G2p+tonorDe2KzJuGAhYPSsaRbeo0Y3npha/tOTRXGJlr4Diu5X0= Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238118 - 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: Wed, 04 Jul 2012 20:58:54 -0000 On 07/04/12 13:45, Attilio Rao wrote: > I recall that at some point /dev/random was introducing some > scalability penalty on php [...] ... thus reinforcing the stereotype that PHP Does Stuff Wrong. Userland processes should get entropy from the kernel *once* at launch time and place it into an entropy pool which is *occasionally* reseeded later. If even a very slow /dev/random becomes a scalability problem, an application is doing something very very wrong. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 20: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 6F83A106566B; Wed, 4 Jul 2012 20:59: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 581468FC1A; Wed, 4 Jul 2012 20: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 q64KxVrr032422; Wed, 4 Jul 2012 20:59:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64KxV4j032420; Wed, 4 Jul 2012 20:59:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207042059.q64KxV4j032420@svn.freebsd.org> From: Michael Tuexen Date: Wed, 4 Jul 2012 20:59: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: r238122 - 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, 04 Jul 2012 20:59:31 -0000 Author: tuexen Date: Wed Jul 4 20:59:30 2012 New Revision: 238122 URL: http://svn.freebsd.org/changeset/base/238122 Log: Use consistent method to determine IPV4_OUTPUT/IPV6_OUTPUT. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jul 4 20:29:16 2012 (r238121) +++ head/sys/netinet/sctp_output.c Wed Jul 4 20:59:30 2012 (r238122) @@ -10971,8 +10971,9 @@ sctp_send_resp_msg(struct sockaddr *src, return; } SCTP_ATTACH_CHAIN(o_pak, mout, len); + switch (dst->sa_family) { #ifdef INET - if (ip != NULL) { + case AF_INET: if (port) { if (V_udp_cksum) { udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); @@ -11006,10 +11007,10 @@ sctp_send_resp_msg(struct sockaddr *src, } #endif SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); - } + break; #endif #ifdef INET6 - if (ip6 != NULL) { + case AF_INET6: ip6->ip6_plen = len - sizeof(struct ip6_hdr); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -11036,8 +11037,15 @@ sctp_send_resp_msg(struct sockaddr *src, } #endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } + break; #endif + default: + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Unknown protocol (TSNH) type %d\n", + dst->sa_family); + sctp_m_freem(mout); + SCTP_LTRACE_ERR_RET_PKT(mout, NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); + return; + } SCTP_STAT_INCR(sctps_sendpackets); SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); From owner-svn-src-head@FreeBSD.ORG Wed Jul 4 22:12: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 1F6EF1065670; Wed, 4 Jul 2012 22:12:11 +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 09C358FC15; Wed, 4 Jul 2012 22:12:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q64MCAss035456; Wed, 4 Jul 2012 22:12:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q64MCAvI035450; Wed, 4 Jul 2012 22:12:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207042212.q64MCAvI035450@svn.freebsd.org> From: John Baldwin Date: Wed, 4 Jul 2012 22:12: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: r238123 - in head/contrib/binutils: gas/config opcodes 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, 04 Jul 2012 22:12:11 -0000 Author: jhb Date: Wed Jul 4 22:12:10 2012 New Revision: 238123 URL: http://svn.freebsd.org/changeset/base/238123 Log: Add support for the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', and 'xsetbv' instructions. I reimplemented this from scratch based on the Intel manuals and the existing support for handling the fxsave and fxrstor instructions. This will let us use these instructions natively with GCC rather than hardcoding the opcodes in hex. Reviewed by: kib MFC after: 1 month Modified: head/contrib/binutils/gas/config/tc-i386.c head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/i386-opc.h head/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/gas/config/tc-i386.c ============================================================================== --- head/contrib/binutils/gas/config/tc-i386.c Wed Jul 4 20:59:30 2012 (r238122) +++ head/contrib/binutils/gas/config/tc-i386.c Wed Jul 4 22:12:10 2012 (r238123) @@ -517,7 +517,9 @@ static const arch_entry cpu_arch[] = {".sse4a", PROCESSOR_UNKNOWN, CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a}, {".abm", PROCESSOR_UNKNOWN, - CpuABM} + CpuABM}, + {".xsave", PROCESSOR_UNKNOWN, + CpuXSAVE} }; const pseudo_typeS md_pseudo_table[] = Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Wed Jul 4 20:59:30 2012 (r238122) +++ head/contrib/binutils/opcodes/i386-dis.c Wed Jul 4 22:12:10 2012 (r238123) @@ -93,6 +93,7 @@ static void OP_3DNowSuffix (int, int); static void OP_SIMD_Suffix (int, int); static void SIMD_Fixup (int, int); static void PNI_Fixup (int, int); +static void XCR_Fixup (int, int); static void SVME_Fixup (int, int); static void INVLPG_Fixup (int, int); static void BadOp (void); @@ -1693,7 +1694,7 @@ static const struct dis386 grps[][8] = { { { "sgdt{Q|IQ||}", { { VMX_Fixup, 0 } } }, { "sidt{Q|IQ||}", { { PNI_Fixup, 0 } } }, - { "lgdt{Q|Q||}", { M } }, + { "lgdt{Q|Q||}", { { XCR_Fixup, 0 } } }, { "lidt{Q|Q||}", { { SVME_Fixup, 0 } } }, { "smswD", { Sv } }, { "(bad)", { XX } }, @@ -1783,9 +1784,9 @@ static const struct dis386 grps[][8] = { { "fxrstor", { Ev } }, { "ldmxcsr", { Ev } }, { "stmxcsr", { Ev } }, - { "(bad)", { XX } }, - { "lfence", { { OP_0fae, 0 } } }, - { "mfence", { { OP_0fae, 0 } } }, + { "xsave", { Ev } }, + { "xrstor", { { OP_0fae, v_mode } } }, + { "xsaveopt", { { OP_0fae, v_mode } } }, { "clflush", { { OP_0fae, 0 } } }, }, /* GRP16 */ @@ -5905,17 +5906,17 @@ OP_0fae (int bytemode, int sizeflag) { if (modrm.reg == 7) strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); + else if (modrm.reg == 6) + strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence"); + else if (modrm.reg == 5) + strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence"); if (modrm.reg < 5 || modrm.rm != 0) { BadOp (); /* bad sfence, mfence, or lfence */ return; } - } - else if (modrm.reg != 7) - { - BadOp (); /* bad clflush */ - return; + bytemode = 0; } OP_E (bytemode, sizeflag); @@ -6170,6 +6171,43 @@ PNI_Fixup (int extrachar ATTRIBUTE_UNUSE } static void +XCR_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag) +{ + if (modrm.mod == 3 && modrm.reg == 2 && modrm.rm <= 1) + { + /* Override "lgdt". */ + size_t olen = strlen (obuf); + char *p = obuf + olen - 4; + + /* We might have a suffix when disassembling with -Msuffix. */ + if (*p == 'i') + --p; + + /* Remove "addr16/addr32" if we aren't in Intel mode. */ + if (!intel_syntax + && (prefixes & PREFIX_ADDR) + && olen >= (4 + 7) + && *(p - 1) == ' ' + && CONST_STRNEQ (p - 7, "addr") + && (CONST_STRNEQ (p - 3, "16") + || CONST_STRNEQ (p - 3, "32"))) + p -= 7; + + if (modrm.rm) + { + strcpy (p, "xsetbv"); + } + else + { + strcpy (p, "xgetbv"); + } + + codep++; + } + else + OP_M (0, sizeflag); +} +static void SVME_Fixup (int bytemode, int sizeflag) { const char *alt; Modified: head/contrib/binutils/opcodes/i386-opc.h ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.h Wed Jul 4 20:59:30 2012 (r238122) +++ head/contrib/binutils/opcodes/i386-opc.h Wed Jul 4 22:12:10 2012 (r238123) @@ -71,6 +71,7 @@ typedef struct template #define CpuABM 0x200000 /* ABM New Instructions required */ #define CpuSSE4_1 0x400000 /* SSE4.1 Instructions required */ #define CpuSSE4_2 0x800000 /* SSE4.2 Instructions required */ +#define CpuXSAVE 0x1000000 /* XSAVE Instructions required */ /* SSE4.1/4.2 Instructions required */ #define CpuSSE4 (CpuSSE4_1|CpuSSE4_2) @@ -83,7 +84,7 @@ typedef struct template #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \ |Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \ - |CpuSSE4_2|CpuABM|CpuSSE4a) + |CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of Modified: head/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.tbl Wed Jul 4 20:59:30 2012 (r238122) +++ head/contrib/binutils/opcodes/i386-opc.tbl Wed Jul 4 22:12:10 2012 (r238123) @@ -1487,3 +1487,10 @@ xcryptcfb, 0, 0xf30fa7, 0xe0, Cpu686|Cpu xcryptofb, 0, 0xf30fa7, 0xe8, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 } // Alias for xstore-rng. xstore, 0, 0xfa7, 0xc0, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 } + +// XSAVE/XRSTOR related instructions +xgetbv, 0, 0xf01, 0xd0, CpuXSAVE, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } +xsetbv, 0, 0xf01, 0xd1, CpuXSAVE, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } +xsave, 1, 0xfae, 0x4, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } +xsaveopt, 1, 0xfae, 0x6, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } +xrstor, 1, 0xfae, 0x5, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Wed Jul 4 20:59:30 2012 (r238122) +++ head/contrib/binutils/opcodes/i386-tbl.h Wed Jul 4 22:12:10 2012 (r238123) @@ -4288,6 +4288,21 @@ const template i386_optab[] = { "xstore", 0, 0xfa7, 0xc0, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 } }, + { "xgetbv", 0, 0xf01, 0xd0, CpuXSAVE, + No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, + { 0 } }, + { "xsetbv", 0, 0xf01, 0xd1, CpuXSAVE, + No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, + { 0 } }, + { "xsave", 1, 0xfae, 0x4, CpuXSAVE, + Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, + { "xsaveopt", 1, 0xfae, 0x6, CpuXSAVE, + Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, + { "xrstor", 1, 0xfae, 0x5, CpuXSAVE, + Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S } }, { NULL, 0, 0, 0, 0, 0, { 0 } } }; From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 00:08: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 CB1A8106566C; Thu, 5 Jul 2012 00:08:47 +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 9C8658FC0C; Thu, 5 Jul 2012 00:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6508lki040209; Thu, 5 Jul 2012 00:08:47 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6508lE9040207; Thu, 5 Jul 2012 00:08:47 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207050008.q6508lE9040207@svn.freebsd.org> From: Alan Cox Date: Thu, 5 Jul 2012 00:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238124 - head/sys/amd64/amd64 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, 05 Jul 2012 00:08:47 -0000 Author: alc Date: Thu Jul 5 00:08:47 2012 New Revision: 238124 URL: http://svn.freebsd.org/changeset/base/238124 Log: Correct an error in r237513. The call to reserve_pv_entries() must come before pmap_demote_pde() updates the PDE. Otherwise, pmap_pv_demote_pde() can crash. Crash reported by: kib Patch tested by: kib Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jul 4 22:12:10 2012 (r238123) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 00:08:47 2012 (r238124) @@ -2491,7 +2491,6 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); - reserve_pv_entries(pmap, NPTEPG - 1, lockp); CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); /* @@ -2751,6 +2750,17 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e pmap_fill_ptp(firstpte, newpte); /* + * The spare PV entries must be reserved prior to demoting the + * mapping, that is, prior to changing the PDE. Otherwise, the state + * of the PDE and the PV lists will be inconsistent, which can result + * in reclaim_pv_chunk() attempting to remove a PV entry from the + * wrong PV list and pmap_pv_demote_pde() failing to find the expected + * PV entry for the 2MB page mapping that is being demoted. + */ + if ((oldpde & PG_MANAGED) != 0) + reserve_pv_entries(pmap, NPTEPG - 1, lockp); + + /* * Demote the mapping. This pmap is locked. The old PDE has * PG_A set. If the old PDE has PG_RW set, it also has PG_M * set. Thus, there is no danger of a race with another @@ -2769,13 +2779,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e pmap_invalidate_page(pmap, (vm_offset_t)vtopte(va)); /* - * Demote the pv entry. This depends on the earlier demotion - * of the mapping. Specifically, the (re)creation of a per- - * page pv entry might trigger the execution of reclaim_pv_chunk(), - * which might reclaim a newly (re)created per-page pv entry - * and destroy the associated mapping. In order to destroy - * the mapping, the PDE must have already changed from mapping - * the 2mpage to referencing the page table page. + * Demote the PV entry. */ if ((oldpde & PG_MANAGED) != 0) pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, lockp); From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 00:52:24 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 F328C106566C; Thu, 5 Jul 2012 00:52:23 +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 DF1DE8FC08; Thu, 5 Jul 2012 00:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q650qN39042020; Thu, 5 Jul 2012 00:52:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q650qNaa042018; Thu, 5 Jul 2012 00:52:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207050052.q650qNaa042018@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jul 2012 00:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238125 - head/cddl/contrib/dtracetoolkit 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, 05 Jul 2012 00:52:24 -0000 Author: emaste Date: Thu Jul 5 00:52:23 2012 New Revision: 238125 URL: http://svn.freebsd.org/changeset/base/238125 Log: Restore r211786 by rpaulo: Port dtruss to FreeBSD. Sponsored by: The FreeBSD Foundation It appears the change was reverted by r235380. Modified: head/cddl/contrib/dtracetoolkit/dtruss Modified: head/cddl/contrib/dtracetoolkit/dtruss ============================================================================== --- head/cddl/contrib/dtracetoolkit/dtruss Thu Jul 5 00:08:47 2012 (r238124) +++ head/cddl/contrib/dtracetoolkit/dtruss Thu Jul 5 00:52:23 2012 (r238125) @@ -240,7 +240,7 @@ syscall:::entry */ /* print 3 args, return as hex */ -syscall::lwp_sigmask:return +syscall::sigprocmask:return /self->start/ { /* calculate elapsed time */ @@ -268,10 +268,11 @@ syscall::lwp_sigmask:return } /* print 3 args, arg0 as a string */ +syscall::access*:return, syscall::stat*:return, syscall::lstat*:return, -syscall::open*:return, -syscall::resolvepath:return +syscall::readlink*:return, +syscall::open*:return /self->start/ { /* calculate elapsed time */ @@ -329,7 +330,6 @@ syscall::*read*:return } /* print 0 arg output */ -syscall::gtime:return, syscall::*fork*:return /self->start/ { @@ -357,9 +357,6 @@ syscall::*fork*:return } /* print 1 arg output */ -syscall::brk:return, -syscall::times:return, -syscall::stime:return, syscall::close:return /self->start/ { @@ -387,7 +384,7 @@ syscall::close:return } /* print 2 arg output */ -syscall::utime:return, +syscall::utimes:return, syscall::munmap:return /self->start/ { From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 07:20: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 DCF70106566B; Thu, 5 Jul 2012 07:20:16 +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 C8BE58FC14; Thu, 5 Jul 2012 07:20: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 q657KGbc058513; Thu, 5 Jul 2012 07:20:16 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q657KGrS058511; Thu, 5 Jul 2012 07:20:16 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207050720.q657KGrS058511@svn.freebsd.org> From: Alan Cox Date: Thu, 5 Jul 2012 07:20: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: r238126 - head/sys/amd64/amd64 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, 05 Jul 2012 07:20:17 -0000 Author: alc Date: Thu Jul 5 07:20:16 2012 New Revision: 238126 URL: http://svn.freebsd.org/changeset/base/238126 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/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 5 00:52:23 2012 (r238125) +++ head/sys/amd64/amd64/pmap.c Thu Jul 5 07:20:16 2012 (r238126) @@ -3446,11 +3446,28 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", va)); + 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 || VM_OBJECT_LOCKED(m->object), ("pmap_enter: page %p is not busy", m)); + pa = VM_PAGE_TO_PHYS(m); + newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); + if ((m->oflags & VPO_UNMANAGED) == 0) + newpte |= PG_MANAGED; + if ((prot & VM_PROT_WRITE) != 0) + newpte |= PG_RW; + if ((prot & VM_PROT_EXECUTE) == 0) + newpte |= pg_nx; + if (wired) + newpte |= PG_W; + if (va < VM_MAXUSER_ADDRESS) + newpte |= PG_U; + if (pmap == kernel_pmap) + newpte |= PG_G; - mpte = NULL; + mpte = om = NULL; lock = NULL; rw_rlock(&pvh_global_lock); @@ -3471,8 +3488,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } else panic("pmap_enter: invalid page directory va=%#lx", va); - pa = VM_PAGE_TO_PHYS(m); - om = NULL; origpte = *pte; opa = origpte & PG_FRAME; @@ -3497,10 +3512,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (mpte) mpte->wire_count--; - if (origpte & PG_MANAGED) { + if ((origpte & PG_MANAGED) != 0) om = m; - pa |= PG_MANAGED; - } goto validate; } @@ -3530,15 +3543,12 @@ 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) { - KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, - ("pmap_enter: managed mapping within the clean submap")); + if ((newpte & PG_MANAGED) != 0) { if (pv == NULL) pv = get_pv_entry(pmap, &lock); CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); - pa |= PG_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -3549,40 +3559,25 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.wired_count++; validate: - /* - * Now validate mapping with desired protection/wiring. - */ - newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); - if ((prot & VM_PROT_WRITE) != 0) { - newpte |= PG_RW; - if ((newpte & PG_MANAGED) != 0) - vm_page_aflag_set(m, PGA_WRITEABLE); - } - if ((prot & VM_PROT_EXECUTE) == 0) - newpte |= pg_nx; - if (wired) - newpte |= PG_W; - if (va < VM_MAXUSER_ADDRESS) - newpte |= PG_U; - if (pmap == kernel_pmap) - newpte |= PG_G; /* - * if the mapping or permission bits are different, we need - * to update the pte. + * Update the PTE only if the mapping or protection/wiring bits are + * different. */ - if ((origpte & ~(PG_M|PG_A)) != newpte) { + if ((origpte & ~(PG_M | PG_A)) != newpte) { newpte |= PG_A; if ((access & VM_PROT_WRITE) != 0) newpte |= PG_M; + if ((newpte & (PG_MANAGED | PG_RW)) == (PG_MANAGED | PG_RW)) + vm_page_aflag_set(m, PGA_WRITEABLE); if (origpte & PG_V) { invlva = FALSE; origpte = pte_load_store(pte, newpte); if (origpte & PG_A) { if (origpte & PG_MANAGED) vm_page_aflag_set(om, PGA_REFERENCED); - if (opa != VM_PAGE_TO_PHYS(m) || ((origpte & - PG_NX) == 0 && (newpte & PG_NX))) + if (opa != pa || ((origpte & PG_NX) == 0 && + (newpte & PG_NX) != 0)) invlva = TRUE; } if ((origpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 15:23:45 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 EA4471065673; Thu, 5 Jul 2012 15:23:45 +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 D54DA8FC0C; Thu, 5 Jul 2012 15:23: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 q65FNjeK080658; Thu, 5 Jul 2012 15:23:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65FNj6H080656; Thu, 5 Jul 2012 15:23:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207051523.q65FNj6H080656@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 5 Jul 2012 15:23: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: r238130 - head/sys/arm/mv 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, 05 Jul 2012 15:23:46 -0000 Author: marcel Date: Thu Jul 5 15:23:45 2012 New Revision: 238130 URL: http://svn.freebsd.org/changeset/base/238130 Log: Fix LINT. Obtained from: Juniper Networks, Inc. Modified: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Thu Jul 5 13:45:23 2012 (r238129) +++ head/sys/arm/mv/mv_machdep.c Thu Jul 5 15:23:45 2012 (r238130) @@ -498,7 +498,7 @@ initarm(struct arm_boot_params *abp) physmem = memsize / PAGE_SIZE; debugf("initarm: console initialized\n"); - debugf(" arg1 mdp = 0x%08x\n", (uint32_t)mdp); + debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); debugf(" boothowto = 0x%08x\n", boothowto); printf(" dtbp = 0x%08x\n", (uint32_t)dtbp); print_kernel_section_addr(); From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 17:02: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 4DC2C1065670; Thu, 5 Jul 2012 17:02:21 +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 364CD8FC12; Thu, 5 Jul 2012 17:02: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 q65H2LGH086701; Thu, 5 Jul 2012 17:02:21 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65H2LxM086699; Thu, 5 Jul 2012 17:02:21 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201207051702.q65H2LxM086699@svn.freebsd.org> From: Brooks Davis Date: Thu, 5 Jul 2012 17:02: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: r238141 - 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, 05 Jul 2012 17:02:21 -0000 Author: brooks Date: Thu Jul 5 17:02:20 2012 New Revision: 238141 URL: http://svn.freebsd.org/changeset/base/238141 Log: Document the behavior (from 4.4-lite) that tokens returned by telldir() are single use. Sponsored by: DARPA, AFRL MFC after: 3 days Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Thu Jul 5 16:02:14 2012 (r238140) +++ head/lib/libc/gen/directory.3 Thu Jul 5 17:02:20 2012 (r238141) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 16, 2008 +.Dd July 5, 2012 .Dt DIRECTORY 3 .Os .Sh NAME @@ -153,7 +153,7 @@ returns 0 on success or an error number The .Fn telldir function -returns the current location associated with the named +returns a token representing the current location associated with the named .Em directory stream . Values returned by .Fn telldir @@ -179,6 +179,13 @@ The new position reverts to the one asso when the .Fn telldir operation was performed. +State associated with the token returned by +.Fn telldir is freed when it is passed to +.Fn seekdir . +If you wish return to the same location again, +then you must create a new token with another +.Fn telldir +call. .Pp The .Fn rewinddir @@ -245,3 +252,9 @@ The .Fn fdopendir function appeared in .Fx 8.0 . +.Sh BUGS +The invalidation of +.Fn telldir +tokens when calling +.Fn seekdir +is non-standard. From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 18:19:36 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 213461065672; Thu, 5 Jul 2012 18:19:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E68128FC08; Thu, 5 Jul 2012 18:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q65IJZvn004727; Thu, 5 Jul 2012 18:19:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65IJZF4004724; Thu, 5 Jul 2012 18:19:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207051819.q65IJZF4004724@svn.freebsd.org> From: John Baldwin Date: Thu, 5 Jul 2012 18:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238142 - in head/sys/amd64: amd64 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: Thu, 05 Jul 2012 18:19:36 -0000 Author: jhb Date: Thu Jul 5 18:19:35 2012 New Revision: 238142 URL: http://svn.freebsd.org/changeset/base/238142 Log: Now that our assembler supports the xsave family of instructions, use them natively rather than hand-assembled versions. For xgetbv/xsetbv, add a wrapper API to deal with xcr* registers: rxcr() and load_xcr(). Reviewed by: kib MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu Jul 5 17:02:20 2012 (r238141) +++ head/sys/amd64/amd64/fpu.c Thu Jul 5 18:19:35 2012 (r238142) @@ -85,9 +85,7 @@ xrstor(char *addr, uint64_t mask) low = mask; hi = mask >> 32; - /* xrstor (%rdi) */ - __asm __volatile(".byte 0x0f,0xae,0x2f" : : - "a" (low), "d" (hi), "D" (addr)); + __asm __volatile("xrstor %0" : : "m" (*addr), "a" (low), "d" (hi)); } static __inline void @@ -97,20 +95,8 @@ xsave(char *addr, uint64_t mask) low = mask; hi = mask >> 32; - /* xsave (%rdi) */ - __asm __volatile(".byte 0x0f,0xae,0x27" : : - "a" (low), "d" (hi), "D" (addr) : "memory"); -} - -static __inline void -xsetbv(uint32_t reg, uint64_t val) -{ - uint32_t low, hi; - - low = val; - hi = val >> 32; - __asm __volatile(".byte 0x0f,0x01,0xd1" : : - "c" (reg), "a" (low), "d" (hi)); + __asm __volatile("xsave %0" : "=m" (*addr) : "a" (low), "d" (hi) : + "memory"); } #else /* !(__GNUCLIKE_ASM && !lint) */ @@ -127,7 +113,6 @@ void start_emulating(void); void stop_emulating(void); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); -void xsetbv(uint32_t reg, uint64_t val); #endif /* __GNUCLIKE_ASM && !lint */ @@ -238,7 +223,7 @@ fpuinit(void) if (use_xsave) { load_cr4(rcr4() | CR4_XSAVE); - xsetbv(XCR0, xsave_mask); + load_xcr(XCR0, xsave_mask); } /* Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Thu Jul 5 17:02:20 2012 (r238141) +++ head/sys/amd64/include/cpufunc.h Thu Jul 5 18:19:35 2012 (r238142) @@ -418,6 +418,25 @@ rcr4(void) return (data); } +static __inline u_long +rxcr(u_int reg) +{ + u_int low, high; + + __asm __volatile("xgetbv" : "=a" (low), "=d" (high) : "c" (reg)); + return (low | ((uint64_t)high << 32)); +} + +static __inline void +load_xcr(u_int reg, u_long val) +{ + u_int low, high; + + low = val; + high = val >> 32; + __asm __volatile("xsetbv" : : "c" (reg), "a" (low), "d" (high)); +} + /* * Global TLB flush (except for thise for pages marked PG_G) */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 18:23:37 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 45183106566B; Thu, 5 Jul 2012 18:23:37 +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 2E19F8FC08; Thu, 5 Jul 2012 18:23: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 q65INb2d005738; Thu, 5 Jul 2012 18:23:37 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65INa8m005727; Thu, 5 Jul 2012 18:23:36 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201207051823.q65INa8m005727@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 5 Jul 2012 18:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238143 - in head/tools: build/make_check regression/usr.bin/make/syntax/funny-targets 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, 05 Jul 2012 18:23:37 -0000 Author: obrien Date: Thu Jul 5 18:23:36 2012 New Revision: 238143 URL: http://svn.freebsd.org/changeset/base/238143 Log: Remove the "funny targets" make check. We no longer need embedded :: targets to build FreeBSD (they are used in Perl man pages). We never needed embedded "!" in targets that I can find. We got this from OpenBSD and I cannot find any other make that supports such things -- contrary to their commit message claim: "This behaviour is also consistent with other versions of make.". Added: head/tools/regression/usr.bin/make/syntax/funny-targets/ head/tools/regression/usr.bin/make/syntax/funny-targets/Makefile (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/expected.status.1 (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/expected.status.2 (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stderr.1 (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stderr.2 (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stdout.1 (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stdout.2 (contents, props changed) head/tools/regression/usr.bin/make/syntax/funny-targets/test.t (contents, props changed) Modified: head/tools/build/make_check/Makefile Modified: head/tools/build/make_check/Makefile ============================================================================== --- head/tools/build/make_check/Makefile Thu Jul 5 18:19:35 2012 (r238142) +++ head/tools/build/make_check/Makefile Thu Jul 5 18:23:36 2012 (r238143) @@ -23,7 +23,7 @@ NIL= SMAKE= MAKEFLAGS= ${MAKE} -C ${.CURDIR} all: - @echo '1..17' + @echo '1..16' @${SMAKE} C_check || { cd ${.CURDIR} ; ${MAKE} failure ; } @echo "ok 1 - C_check # Test of -C flag existence detected no regression." @echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \ @@ -40,26 +40,24 @@ all: @echo "ok 6 - notdef # Test notdef detected no regression." @${SMAKE} modifiers || ${SMAKE} failure @echo "ok 7 - modifiers # Test modifiers detected no regression." - @${SMAKE} funny_targets || ${SMAKE} failure - @echo "ok 8 funny_targets # Test funny_targets detected no regression." @${SMAKE} arith_expr || ${SMAKE} failure - @echo "ok 9 arith_expr # Test arith_expr detected no regression." + @echo "ok 8 arith_expr # Test arith_expr detected no regression." @${SMAKE} PATH_exists || ${SMAKE} failure - @echo "ok 10 PATH_exists # Test PATH_exists detected no regression." + @echo "ok 9 PATH_exists # Test PATH_exists detected no regression." @${SMAKE} double_quotes || ${SMAKE} failure - @echo "ok 11 double_quotes # Test double_quotes detected no regression." + @echo "ok 10 double_quotes # Test double_quotes detected no regression." @! ${SMAKE} double_quotes2 >/dev/null 2>&1 && true || ${SMAKE} failure - @echo "ok 12 double_quotes2 # Test double_quotes2 detected no regression." + @echo "ok 11 double_quotes2 # Test double_quotes2 detected no regression." @${SMAKE} pass_cmd_vars || ${SMAKE} failure - @echo "ok 13 pass_cmd_vars # Test pass_cmd_vars detected no regression." + @echo "ok 12 pass_cmd_vars # Test pass_cmd_vars detected no regression." @${SMAKE} plus_flag || ${SMAKE} failure - @echo "ok 14 plus_flag # Test plus_flag detected no regression." + @echo "ok 13 plus_flag # Test plus_flag detected no regression." @! ${SMAKE} shell >/dev/null 2>&1 && true || ${SMAKE} failure - @echo "ok 15 shell # Test shell detected no regression." + @echo "ok 14 shell # Test shell detected no regression." @${SMAKE} shell_1 || ${SMAKE} failure - @echo "ok 16 shell_1 # Test shell_1 detected no regression." + @echo "ok 15 shell_1 # Test shell_1 detected no regression." @${SMAKE} shell_2 || ${SMAKE} failure - @echo "ok 17 shell_2 # Test shell_2 detected no regression." + @echo "ok 16 shell_2 # Test shell_2 detected no regression." .if make(C_check) C_check: @@ -107,12 +105,6 @@ modifiers: fi .endif -.if make(funny_targets) -funny_targets: colons::target exclamation!target -colons::target: -exclamation!target: -.endif - .if make(arith_expr) arith_expr: # See if arithmetic expression parsing is broken. Added: head/tools/regression/usr.bin/make/syntax/funny-targets/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/funny-targets/Makefile Thu Jul 5 18:23:36 2012 (r238143) @@ -0,0 +1,14 @@ +# $FreeBSD$ +# +# PR bin/6612 / GRN r102178 +# + +test1: colons::colons::target + +colons::colons::target: + @echo '${.TARGET}' + +test2: exclamation!target + +exclamation!target: + @echo '${.TARGET} Added: head/tools/regression/usr.bin/make/syntax/funny-targets/expected.status.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/funny-targets/expected.status.1 Thu Jul 5 18:23:36 2012 (r238143) @@ -0,0 +1 @@ +0 Added: head/tools/regression/usr.bin/make/syntax/funny-targets/expected.status.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/funny-targets/expected.status.2 Thu Jul 5 18:23:36 2012 (r238143) @@ -0,0 +1 @@ +0 Added: head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stderr.1 ============================================================================== Added: head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stderr.2 ============================================================================== Added: head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stdout.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stdout.1 Thu Jul 5 18:23:36 2012 (r238143) @@ -0,0 +1 @@ +colons::colons::target Added: head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stdout.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/funny-targets/expected.stdout.2 Thu Jul 5 18:23:36 2012 (r238143) @@ -0,0 +1 @@ +exclamation!target Added: head/tools/regression/usr.bin/make/syntax/funny-targets/test.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/funny-targets/test.t Thu Jul 5 18:23:36 2012 (r238143) @@ -0,0 +1,14 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC='Target names with "funny" embeded characters.' + +# Run +TEST_N=2 + +eval_cmd $* From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 19:34: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 EEF9F106564A; Thu, 5 Jul 2012 19:34:40 +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 4CF828FC08; Thu, 5 Jul 2012 19:34:40 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id q65JXJVu020082; Thu, 5 Jul 2012 14:33:19 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id q65JXJ4J020081; Thu, 5 Jul 2012 14:33:19 -0500 (CDT) (envelope-from brooks) Date: Thu, 5 Jul 2012 14:33:19 -0500 From: Brooks Davis To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20120705193319.GD87114@lor.one-eyed-alien.net> References: <201207051702.q65H2LxM086699@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EP0wieDxd4TSJjHq" Content-Disposition: inline In-Reply-To: <201207051702.q65H2LxM086699@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r238141 - 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, 05 Jul 2012 19:34:41 -0000 --EP0wieDxd4TSJjHq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 05, 2012 at 05:02:20PM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Jul 5 17:02:20 2012 > New Revision: 238141 > URL: http://svn.freebsd.org/changeset/base/238141 >=20 > Log: > Document the behavior (from 4.4-lite) that tokens returned by telldir()= are > single use. The ideal thing to do here is probably to import NetBSD's reimplementation that uses a per-directory cache rather than a global one, but documenting reality seemed like the easiest route to MFC. -- Brooks --EP0wieDxd4TSJjHq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFP9ev+XY6L6fI4GtQRAmTJAKCZfGwiCQXOBSRhcoH21ZWRYIDQ8gCeJxet Q3vPOJNZmP/jSGF5GGF+dq8= =FsOk -----END PGP SIGNATURE----- --EP0wieDxd4TSJjHq-- From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 20:02: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 568591065704; Thu, 5 Jul 2012 20:02:25 +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 248DE8FC17; Thu, 5 Jul 2012 20:02:25 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 59253B99C; Thu, 5 Jul 2012 16:02:24 -0400 (EDT) From: John Baldwin To: Attilio Rao Date: Thu, 5 Jul 2012 07:49:42 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207041951.q64JpPXu029310@svn.freebsd.org> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201207050749.43210.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 05 Jul 2012 16:02:24 -0400 (EDT) Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, David Chisnall , Konstantin Belousov , svn-src-head@freebsd.org, Pawel Jakub Dawidek , markm@freebsd.org Subject: Re: svn commit: r238118 - 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, 05 Jul 2012 20:02:25 -0000 On Wednesday, July 04, 2012 4:45:54 pm Attilio Rao wrote: > 2012/7/4 David Chisnall : > > On 4 Jul 2012, at 21:32, Andrey Chernov wrote: > > > >> 1) /dev/urandom may not exist in jails/sandboxes while sysctls (or old way > >> initialization) always exists. > > > > From the perspective of Capsicum sandboxes, a device node is better than a sysctl. The kernel must hard-code policy about which sysctls are permitted, but access to file descriptors is decided on a per-sandbox basis and is configurable by the user. The same applies to jails, although it's slightly more effort to make device nodes appear inside a jail. > > Also don't understimate the locking factor here. > I recall that at some point /dev/random was introducing some > scalability penalty on php (maybe related to the suhosin patch) until > kib made shared lookups available on devfs. IIRC, sysctls are still > Giant locked. sysctls are not all Giant locked. KERN_ARND is marked MPSAFE, so it does not use Giant: static int sysctl_kern_arnd(SYSCTL_HANDLER_ARGS) { char buf[256]; size_t len; len = req->oldlen; if (len > sizeof(buf)) len = sizeof(buf); arc4rand(buf, len, 0); return (SYSCTL_OUT(req, buf, len)); } SYSCTL_PROC(_kern, KERN_ARND, arandom, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, NULL, 0, sysctl_kern_arnd, "", "arc4rand"); -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 20:26:58 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 BC240106566B; Thu, 5 Jul 2012 20:26:58 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55598FC0A; Thu, 5 Jul 2012 20:26: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 q65KQwjh016782; Thu, 5 Jul 2012 20:26:58 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65KQw9m016770; Thu, 5 Jul 2012 20:26:58 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201207052026.q65KQw9m016770@svn.freebsd.org> From: Jack F Vogel Date: Thu, 5 Jul 2012 20:26: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: r238148 - in head/sys: conf dev/e1000 modules/igb 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, 05 Jul 2012 20:26:58 -0000 Author: jfv Date: Thu Jul 5 20:26:57 2012 New Revision: 238148 URL: http://svn.freebsd.org/changeset/base/238148 Log: Sync with Intel internal source: shared code update and small changes in core required Add support for new i210/i211 devices Improve queue calculation based on mac type MFC after:5 days Added: head/sys/dev/e1000/e1000_i210.c (contents, props changed) head/sys/dev/e1000/e1000_i210.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_manage.c head/sys/dev/e1000/e1000_manage.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/modules/igb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/conf/files Thu Jul 5 20:26:57 2012 (r238148) @@ -1196,6 +1196,8 @@ dev/e1000/e1000_82575.c optional em | i compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_ich8lan.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_i210.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_api.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_mac.c optional em | igb \ Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_82541.c Thu Jul 5 20:26:57 2012 (r238148) @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st * of MAC speed/duplex configuration. So we only need to * configure Collision Distance in the MAC. */ - e1000_config_collision_dist_generic(hw); + mac->ops.config_collision_dist(hw); /* * Configure Flow Control now that Auto-Neg has completed. Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_82543.c Thu Jul 5 20:26:57 2012 (r238148) @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 DEBUGOUT("Valid link established!!!\n"); /* Config the MAC and PHY after link is up */ if (hw->mac.type == e1000_82544) { - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); } else { ret_val = e1000_config_mac_to_phy_82543(hw); if (ret_val) @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( /* Take the link out of reset */ ctrl &= ~E1000_CTRL_LRST; - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); ret_val = e1000_commit_fc_settings_generic(hw); if (ret_val) @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 * settings. */ if (mac->type == e1000_82544) - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); else { ret_val = e1000_config_mac_to_phy_82543(hw); if (ret_val) { @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 if (phy_data & M88E1000_PSSR_DPLX) ctrl |= E1000_CTRL_FD; - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); /* * Set up speed in the Device Control register depending on Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_82571.c Thu Jul 5 20:26:57 2012 (r238148) @@ -1907,7 +1907,7 @@ void e1000_set_laa_state_82571(struct e1 * incoming packets directed to this port are dropped. * Eventually the LAA will be in RAR[0] and RAR[14]. */ - e1000_rar_set_generic(hw, hw->mac.addr, + hw->mac.ops.rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1); return; } Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_82575.c Thu Jul 5 20:26:57 2012 (r238148) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -38,9 +38,12 @@ * 82575GB Gigabit Network Connection * 82576 Gigabit Network Connection * 82576 Quad Port Gigabit Mezzanine Adapter + * 82580 Gigabit Network Connection + * I350 Gigabit Network Connection */ #include "e1000_api.h" +#include "e1000_i210.h" static s32 e1000_init_phy_params_82575(struct e1000_hw *hw); static s32 e1000_init_mac_params_82575(struct e1000_hw *hw); @@ -162,6 +165,9 @@ static s32 e1000_init_phy_params_82575(s DEBUGFUNC("e1000_init_phy_params_82575"); + phy->ops.read_i2c_byte = e1000_read_i2c_byte_generic; + phy->ops.write_i2c_byte = e1000_write_i2c_byte_generic; + if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; goto out; @@ -195,12 +201,22 @@ static s32 e1000_init_phy_params_82575(s if (e1000_sgmii_active_82575(hw) && !e1000_sgmii_uses_mdio_82575(hw)) { phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575; phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575; - } else if (hw->mac.type >= e1000_82580) { - phy->ops.read_reg = e1000_read_phy_reg_82580; - phy->ops.write_reg = e1000_write_phy_reg_82580; } else { - phy->ops.read_reg = e1000_read_phy_reg_igp; - phy->ops.write_reg = e1000_write_phy_reg_igp; + switch (hw->mac.type) { + case e1000_82580: + case e1000_i350: + phy->ops.read_reg = e1000_read_phy_reg_82580; + phy->ops.write_reg = e1000_write_phy_reg_82580; + break; + case e1000_i210: + case e1000_i211: + phy->ops.read_reg = e1000_read_phy_reg_gs40g; + phy->ops.write_reg = e1000_write_phy_reg_gs40g; + break; + default: + phy->ops.read_reg = e1000_read_phy_reg_igp; + phy->ops.write_reg = e1000_write_phy_reg_igp; + } } /* Set phy->phy_addr and phy->id. */ @@ -245,6 +261,15 @@ static s32 e1000_init_phy_params_82575(s phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; break; + case I210_I_PHY_ID: + phy->type = e1000_phy_i210; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88_gen2; + phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; + phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; + break; default: ret_val = -E1000_ERR_PHY; goto out; @@ -281,28 +306,32 @@ s32 e1000_init_nvm_params_82575(struct e size = 15; nvm->word_size = 1 << size; - nvm->opcode_bits = 8; - nvm->delay_usec = 1; - switch (nvm->override) { - case e1000_nvm_override_spi_large: - nvm->page_size = 32; - nvm->address_bits = 16; - break; - case e1000_nvm_override_spi_small: - nvm->page_size = 8; - nvm->address_bits = 8; - break; - default: - nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; - nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8; - break; - } - - nvm->type = e1000_nvm_eeprom_spi; - - if (nvm->word_size == (1 << 15)) - nvm->page_size = 128; + if (hw->mac.type < e1000_i210) { + nvm->opcode_bits = 8; + nvm->delay_usec = 1; + + switch (nvm->override) { + case e1000_nvm_override_spi_large: + nvm->page_size = 32; + nvm->address_bits = 16; + break; + case e1000_nvm_override_spi_small: + nvm->page_size = 8; + nvm->address_bits = 8; + break; + default: + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; + nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? + 16 : 8; + break; + } + if (nvm->word_size == (1 << 15)) + nvm->page_size = 128; + nvm->type = e1000_nvm_eeprom_spi; + } else { + nvm->type = e1000_nvm_flash_hw; + } /* Function Pointers */ nvm->ops.acquire = e1000_acquire_nvm_82575; nvm->ops.release = e1000_release_nvm_82575; @@ -316,7 +345,7 @@ s32 e1000_init_nvm_params_82575(struct e nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_82575; - /* override genric family function pointers for specific descendants */ + /* override generic family function pointers for specific descendants */ switch (hw->mac.type) { case e1000_82580: nvm->ops.validate = e1000_validate_nvm_checksum_82580; @@ -368,8 +397,7 @@ static s32 e1000_init_mac_params_82575(s mac->has_fwsm = TRUE; /* ARC supported; valid only if manageability features are enabled. */ mac->arc_subsystem_valid = - (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) - ? TRUE : FALSE; + !!(E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK); /* Function pointers */ @@ -394,8 +422,6 @@ static s32 e1000_init_mac_params_82575(s mac->ops.power_up_serdes = e1000_power_up_serdes_link_82575; /* check for link */ mac->ops.check_for_link = e1000_check_for_link_82575; - /* receive address register setting */ - mac->ops.rar_set = e1000_rar_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82575; /* configure collision distance */ @@ -428,6 +454,13 @@ static s32 e1000_init_mac_params_82575(s mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82575; /* link info */ mac->ops.get_link_up_info = e1000_get_link_up_info_82575; + /* acquire SW_FW sync */ + mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_82575; + mac->ops.release_swfw_sync = e1000_release_swfw_sync_82575; + if (mac->type >= e1000_i210) { + mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_i210; + mac->ops.release_swfw_sync = e1000_release_swfw_sync_i210; + } /* set lan id for port to determine which phy lock to use */ hw->mac.ops.set_lan_id(hw); @@ -470,7 +503,7 @@ static s32 e1000_acquire_phy_82575(struc else if (hw->bus.func == E1000_FUNC_3) mask = E1000_SWFW_PHY3_SM; - return e1000_acquire_swfw_sync_82575(hw, mask); + return hw->mac.ops.acquire_swfw_sync(hw, mask); } /** @@ -492,7 +525,7 @@ static void e1000_release_phy_82575(stru else if (hw->bus.func == E1000_FUNC_3) mask = E1000_SWFW_PHY3_SM; - e1000_release_swfw_sync_82575(hw, mask); + hw->mac.ops.release_swfw_sync(hw, mask); } /** @@ -796,7 +829,7 @@ static s32 e1000_set_d0_lplu_state_82580 { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; - u16 data; + u32 data; DEBUGFUNC("e1000_set_d0_lplu_state_82580"); @@ -844,7 +877,7 @@ s32 e1000_set_d3_lplu_state_82580(struct { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; - u16 data; + u32 data; DEBUGFUNC("e1000_set_d3_lplu_state_82580"); @@ -918,11 +951,7 @@ static s32 e1000_acquire_nvm_82575(struc } - switch (hw->mac.type) { - default: - ret_val = e1000_acquire_nvm_generic(hw); - } - + ret_val = e1000_acquire_nvm_generic(hw); if (ret_val) e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); @@ -941,10 +970,8 @@ static void e1000_release_nvm_82575(stru { DEBUGFUNC("e1000_release_nvm_82575"); - switch (hw->mac.type) { - default: - e1000_release_nvm_generic(hw); - } + e1000_release_nvm_generic(hw); + e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); } @@ -1058,7 +1085,7 @@ static s32 e1000_get_cfg_done_82575(stru DEBUGOUT("MNG configuration cycle has not completed.\n"); /* If EEPROM is not marked present, init the PHY manually */ - if (((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) && + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) && (hw->phy.type == e1000_phy_igp_3)) e1000_phy_init_script_igp3(hw); @@ -1115,6 +1142,7 @@ static s32 e1000_check_for_link_82575(st * continue to check for link. */ hw->mac.get_link_status = !hw->mac.serdes_has_link; + } else { ret_val = e1000_check_for_copper_link_generic(hw); } @@ -1168,11 +1196,6 @@ static s32 e1000_get_pcs_speed_and_duple DEBUGFUNC("e1000_get_pcs_speed_and_duplex_82575"); - /* Set up defaults for the return values of this function */ - mac->serdes_has_link = FALSE; - *speed = 0; - *duplex = 0; - /* * Read the PCS Status register for link state. For non-copper mode, * the status register is not accurate. The PCS status register is @@ -1181,11 +1204,9 @@ static s32 e1000_get_pcs_speed_and_duple pcs = E1000_READ_REG(hw, E1000_PCS_LSTAT); /* - * The link up bit determines when link is up on autoneg. The sync ok - * gets set once both sides sync up and agree upon link. Stable link - * can be determined by checking for both link up and link sync ok + * The link up bit determines when link is up on autoneg. */ - if ((pcs & E1000_PCS_LSTS_LINK_OK) && (pcs & E1000_PCS_LSTS_SYNK_OK)) { + if (pcs & E1000_PCS_LSTS_LINK_OK) { mac->serdes_has_link = TRUE; /* Detect and store PCS speed */ @@ -1201,6 +1222,10 @@ static s32 e1000_get_pcs_speed_and_duple *duplex = FULL_DUPLEX; else *duplex = HALF_DUPLEX; + } else { + mac->serdes_has_link = FALSE; + *speed = 0; + *duplex = 0; } return E1000_SUCCESS; @@ -1293,7 +1318,7 @@ static s32 e1000_reset_hw_82575(struct e } /* If EEPROM is not present, run manual init scripts */ - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES)) e1000_reset_init_script_82575(hw); /* Clear any pending interrupt events. */ @@ -1396,6 +1421,7 @@ static s32 e1000_setup_copper_link_82575 } } switch (hw->phy.type) { + case e1000_phy_i210: case e1000_phy_m88: if (hw->phy.id == I347AT4_E_PHY_ID || hw->phy.id == M88E1112_E_PHY_ID || @@ -1605,31 +1631,28 @@ static s32 e1000_get_media_type_82575(st } /* Read Init Control Word #3*/ hw->nvm.ops.read(hw, init_ctrl_wd_3_offset, 1, &init_ctrl_wd_3); + + /* + * Align link mode bits to + * their CTRL_EXT location. + */ current_link_mode = init_ctrl_wd_3; + current_link_mode <<= (E1000_CTRL_EXT_LINK_MODE_OFFSET - + init_ctrl_wd_3_bit_offset); + current_link_mode &= E1000_CTRL_EXT_LINK_MODE_MASK; + /* * Switch to CSR for all but internal PHY. */ - if ((init_ctrl_wd_3 << (E1000_CTRL_EXT_LINK_MODE_OFFSET - - init_ctrl_wd_3_bit_offset)) != - E1000_CTRL_EXT_LINK_MODE_GMII) { - current_link_mode = ctrl_ext; - init_ctrl_wd_3_bit_offset = - E1000_CTRL_EXT_LINK_MODE_OFFSET; - } + if (current_link_mode != E1000_CTRL_EXT_LINK_MODE_GMII) + /* Take link mode from CSR */ + current_link_mode = ctrl_ext & + E1000_CTRL_EXT_LINK_MODE_MASK; } else { /* Take link mode from CSR */ - current_link_mode = ctrl_ext; - init_ctrl_wd_3_bit_offset = E1000_CTRL_EXT_LINK_MODE_OFFSET; + current_link_mode = ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK; } - /* - * Align link mode bits to - * their CTRL_EXT location. - */ - current_link_mode <<= (E1000_CTRL_EXT_LINK_MODE_OFFSET - - init_ctrl_wd_3_bit_offset); - current_link_mode &= E1000_CTRL_EXT_LINK_MODE_MASK; - switch (current_link_mode) { case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: @@ -2331,7 +2354,7 @@ static s32 e1000_reset_hw_82580(struct e msec_delay(10); /* Determine whether or not a global dev reset is requested */ - if (global_device_reset && e1000_acquire_swfw_sync_82575(hw, + if (global_device_reset && hw->mac.ops.acquire_swfw_sync(hw, swmbsw_mask)) global_device_reset = FALSE; @@ -2359,7 +2382,7 @@ static s32 e1000_reset_hw_82580(struct e } /* If EEPROM is not present, run manual init scripts */ - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES)) e1000_reset_init_script_82575(hw); /* clear global device reset status bit */ @@ -2378,7 +2401,7 @@ static s32 e1000_reset_hw_82580(struct e /* Release semaphore */ if (global_device_reset) - e1000_release_swfw_sync_82575(hw, swmbsw_mask); + hw->mac.ops.release_swfw_sync(hw, swmbsw_mask); return ret_val; } @@ -2538,7 +2561,7 @@ static s32 e1000_update_nvm_checksum_825 goto out; } - if ((nvm_data & NVM_COMPATIBILITY_BIT_MASK) == 0) { + if (!(nvm_data & NVM_COMPATIBILITY_BIT_MASK)) { /* set compatibility bit to validate checksums appropriately */ nvm_data = nvm_data | NVM_COMPATIBILITY_BIT_MASK; ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1, @@ -2737,6 +2760,7 @@ s32 e1000_set_i2c_bb(struct e1000_hw *hw * e1000_read_i2c_byte_generic - Reads 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to read + * @dev_addr: device address * @data: value read * * Performs byte read operation over I2C interface at @@ -2750,14 +2774,14 @@ s32 e1000_read_i2c_byte_generic(struct e u32 retry = 1; u16 swfw_mask = 0; - bool nack = 1; + bool nack = TRUE; DEBUGFUNC("e1000_read_i2c_byte_generic"); swfw_mask = E1000_SWFW_PHY0_SM; do { - if (e1000_acquire_swfw_sync_82575(hw, swfw_mask) + if (hw->mac.ops.acquire_swfw_sync(hw, swfw_mask) != E1000_SUCCESS) { status = E1000_ERR_SWFW_SYNC; goto read_byte_out; @@ -2805,7 +2829,7 @@ s32 e1000_read_i2c_byte_generic(struct e break; fail: - e1000_release_swfw_sync_82575(hw, swfw_mask); + hw->mac.ops.release_swfw_sync(hw, swfw_mask); msec_delay(100); e1000_i2c_bus_clear(hw); retry++; @@ -2816,7 +2840,7 @@ fail: } while (retry < max_retry); - e1000_release_swfw_sync_82575(hw, swfw_mask); + hw->mac.ops.release_swfw_sync(hw, swfw_mask); read_byte_out: @@ -2827,6 +2851,7 @@ read_byte_out: * e1000_write_i2c_byte_generic - Writes 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to write + * @dev_addr: device address * @data: value to write * * Performs byte write operation over I2C interface at @@ -2844,7 +2869,7 @@ s32 e1000_write_i2c_byte_generic(struct swfw_mask = E1000_SWFW_PHY0_SM; - if (e1000_acquire_swfw_sync_82575(hw, swfw_mask) != E1000_SUCCESS) { + if (hw->mac.ops.acquire_swfw_sync(hw, swfw_mask) != E1000_SUCCESS) { status = E1000_ERR_SWFW_SYNC; goto write_byte_out; } @@ -2888,7 +2913,7 @@ fail: DEBUGOUT("I2C byte write error.\n"); } while (retry < max_retry); - e1000_release_swfw_sync_82575(hw, swfw_mask); + hw->mac.ops.release_swfw_sync(hw, swfw_mask); write_byte_out: @@ -3020,7 +3045,7 @@ static s32 e1000_get_i2c_ack(struct e100 u32 i = 0; u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); u32 timeout = 10; - bool ack = 1; + bool ack = TRUE; DEBUGFUNC("e1000_get_i2c_ack"); @@ -3040,7 +3065,7 @@ static s32 e1000_get_i2c_ack(struct e100 return E1000_ERR_I2C; ack = e1000_get_i2c_data(&i2cctl); - if (ack == 1) { + if (ack) { DEBUGOUT("I2C ack was not received.\n"); status = E1000_ERR_I2C; } Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_api.c Thu Jul 5 20:26:57 2012 (r238148) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -323,6 +323,17 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_I350_DA4: mac->type = e1000_i350; break; + case E1000_DEV_ID_I210_COPPER: + case E1000_DEV_ID_I210_COPPER_OEM1: + case E1000_DEV_ID_I210_COPPER_IT: + case E1000_DEV_ID_I210_FIBER: + case E1000_DEV_ID_I210_SERDES: + case E1000_DEV_ID_I210_SGMII: + mac->type = e1000_i210; + break; + case E1000_DEV_ID_I211_COPPER: + mac->type = e1000_i211; + break; case E1000_DEV_ID_82576_VF: mac->type = e1000_vfadapt; break; @@ -425,6 +436,10 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_i350: e1000_init_function_pointers_82575(hw); break; + case e1000_i210: + case e1000_i211: + e1000_init_function_pointers_i210(hw); + break; case e1000_vfadapt: e1000_init_function_pointers_vf(hw); break; Modified: head/sys/dev/e1000/e1000_api.h ============================================================================== --- head/sys/dev/e1000/e1000_api.h Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_api.h Thu Jul 5 20:26:57 2012 (r238148) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,6 +49,7 @@ extern void e1000_rx_fifo_flush_82575(st extern void e1000_init_function_pointers_vf(struct e1000_hw *hw); extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw); extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw); +extern void e1000_init_function_pointers_i210(struct e1000_hw *hw); s32 e1000_set_mac_type(struct e1000_hw *hw); s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device); @@ -118,6 +119,7 @@ s32 e1000_mng_write_dhcp_info(struct e10 u32 e1000_translate_register_82542(u32 reg); + /* * TBI_ACCEPT macro definition: * Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_defines.h Thu Jul 5 20:26:57 2012 (r238148) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1344,6 +1344,16 @@ #define E1000_EECD_SEC1VAL 0x00400000 /* Sector One Valid */ #define E1000_EECD_SECVAL_SHIFT 22 #define E1000_EECD_SEC1VAL_VALID_MASK (E1000_EECD_AUTO_RD | E1000_EECD_PRES) +#define E1000_EECD_FLUPD_I210 0x00800000 /* Update FLASH */ +#define E1000_EECD_FLUDONE_I210 0x04000000 /* Update FLASH done */ +#define E1000_EECD_FLASH_DETECTED_I210 0x00080000 /* FLASH detected */ +#define E1000_FLUDONE_ATTEMPTS 20000 +#define E1000_EERD_EEWR_MAX_COUNT 512 /* buffered EEPROM words rw */ +#define E1000_I210_FIFO_SEL_RX 0x00 +#define E1000_I210_FIFO_SEL_TX_QAV(_i) (0x02 + (_i)) +#define E1000_I210_FIFO_SEL_TX_LEGACY E1000_I210_FIFO_SEL_TX_QAV(0) +#define E1000_I210_FIFO_SEL_BMC2OS_TX 0x06 +#define E1000_I210_FIFO_SEL_BMC2OS_RX 0x01 #define E1000_NVM_SWDPIN0 0x0001 /* SWDPIN 0 NVM Value */ #define E1000_NVM_LED_LOGIC 0x0020 /* Led Logic Word */ @@ -1361,6 +1371,20 @@ #define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +#define NVM_MAC_ADDR 0x0000 +#define NVM_SUB_DEV_ID 0x000B +#define NVM_SUB_VEN_ID 0x000C +#define NVM_DEV_ID 0x000D +#define NVM_VEN_ID 0x000E +#define NVM_INIT_CTRL_2 0x000F +#define NVM_INIT_CTRL_4 0x0013 +#define NVM_LED_1_CFG 0x001C +#define NVM_LED_0_2_CFG 0x001F + #define NVM_INIT_CONTROL1_REG 0x000A #define NVM_INIT_CONTROL2_REG 0x000F #define NVM_SWDEF_PINS_CTRL_PORT_1 0x0010 @@ -1380,12 +1404,12 @@ #define E1000_NVM_CFG_DONE_PORT_2 0x100000 /* ...for third port */ #define E1000_NVM_CFG_DONE_PORT_3 0x200000 /* ...for fourth port */ -#define NVM_82580_LAN_FUNC_OFFSET(a) (a ? (0x40 + (0x40 * a)) : 0) +#define NVM_82580_LAN_FUNC_OFFSET(a) ((a) ? (0x40 + (0x40 * (a))) : 0) /* Mask bits for fields in Word 0x24 of the NVM */ #define NVM_WORD24_COM_MDIO 0x0008 /* MDIO interface shared */ #define NVM_WORD24_EXT_MDIO 0x0004 /* MDIO accesses routed extrnl */ -/* Offset of Link Mode bits for 82575 up to Kawela */ +/* Offset of Link Mode bits for 82575/82576 */ #define NVM_WORD24_LNK_MODE_OFFSET 8 /* Offset of Link Mode bits for 82580 up */ #define NVM_WORD24_82580_LNK_MODE_OFFSET 4 @@ -1525,6 +1549,7 @@ #define I82579_E_PHY_ID 0x01540090 #define I82580_I_PHY_ID 0x015403A0 #define I350_I_PHY_ID 0x015403B0 +#define I210_I_PHY_ID 0x01410C00 #define IGP04E1000_E_PHY_ID 0x02A80391 #define M88_VENDOR 0x0141 @@ -1787,6 +1812,8 @@ #define E1000_DMACR_DMAC_LX_MASK 0x30000000 #define E1000_DMACR_DMAC_LX_SHIFT 28 #define E1000_DMACR_DMAC_EN 0x80000000 /* Enable DMA Coalescing */ +/* DMA Coalescing BMC-to-OS Watchdog Enable */ +#define E1000_DMACR_DC_BMC2OSW_EN 0x00008000 /* DMA Coalescing Transmit Threshold */ #define E1000_DMCTXTH_DMCTTHR_MASK 0x00000FFF @@ -1807,8 +1834,9 @@ /* Lx power decision based on DMA coal */ #define E1000_PCIEMISC_LX_DECISION 0x00000080 -#define E1000_LTRC_EEEMS_EN 0x00000005 /* Enable EEE LTR max send */ #define E1000_RXPBS_SIZE_I210_MASK 0x0000003F /* Rx packet buffer size */ +#define E1000_TXPB0S_SIZE_I210_MASK 0x0000003F /* Tx packet buffer 0 size */ +#define E1000_LTRC_EEEMS_EN 0x00000020 /* Enable EEE LTR max send */ /* Minimum time for 1000BASE-T where no data will be transmit following move out * of EEE LPI Tx state */ @@ -1826,12 +1854,14 @@ #define E1000_LTRMINV_SCALE_1024 2 /* Reg val to set scale to 32768 nsec */ #define E1000_LTRMINV_SCALE_32768 3 +#define E1000_LTRMINV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ #define E1000_LTRMAXV_SCALE_MASK 0x00001C00 /* LTR maximum scale */ #define E1000_LTRMAXV_SCALE_SHIFT 10 /* Reg val to set scale to 1024 nsec */ #define E1000_LTRMAXV_SCALE_1024 2 /* Reg val to set scale to 32768 nsec */ #define E1000_LTRMAXV_SCALE_32768 3 +#define E1000_LTRMAXV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ #define E1000_DOBFFCTL_OBFFTHR_MASK 0x000000FF /* OBFF threshold */ #define E1000_DOBFFCTL_EXIT_ACT_MASK 0x01000000 /* Exit active CB */ Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Thu Jul 5 20:21:13 2012 (r238147) +++ head/sys/dev/e1000/e1000_hw.h Thu Jul 5 20:26:57 2012 (r238148) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -154,6 +154,13 @@ struct e1000_hw; #define E1000_DEV_ID_I350_SERDES 0x1523 #define E1000_DEV_ID_I350_SGMII 0x1524 #define E1000_DEV_ID_I350_DA4 0x1546 +#define E1000_DEV_ID_I210_COPPER 0x1533 +#define E1000_DEV_ID_I210_COPPER_OEM1 0x1534 +#define E1000_DEV_ID_I210_COPPER_IT 0x1535 +#define E1000_DEV_ID_I210_FIBER 0x1536 +#define E1000_DEV_ID_I210_SERDES 0x1537 +#define E1000_DEV_ID_I210_SGMII 0x1538 +#define E1000_DEV_ID_I211_COPPER 0x1539 #define E1000_DEV_ID_DH89XXCC_SGMII 0x0438 #define E1000_DEV_ID_DH89XXCC_SERDES 0x043A #define E1000_DEV_ID_DH89XXCC_BACKPLANE 0x043C @@ -203,6 +210,8 @@ enum e1000_mac_type { e1000_82576, e1000_82580, e1000_i350, + e1000_i210, + e1000_i211, e1000_vfadapt, e1000_vfadapt_i350, e1000_num_macs /* List is 1-based, so subtract 1 for TRUE count. */ @@ -248,6 +257,7 @@ enum e1000_phy_type { e1000_phy_82579, e1000_phy_82580, e1000_phy_vf, + e1000_phy_i210, }; enum e1000_bus_type { @@ -674,6 +684,8 @@ struct e1000_mac_operations { struct e1000_host_mng_command_header*); s32 (*mng_enable_host_if)(struct e1000_hw *); s32 (*wait_autoneg)(struct e1000_hw *); + s32 (*acquire_swfw_sync)(struct e1000_hw *, u16); + void (*release_swfw_sync)(struct e1000_hw *, u16); }; /* @@ -911,13 +923,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; - int eee_disable; + bool eee_disable; }; struct e1000_dev_spec_82575 { bool sgmii_active; bool global_device_reset; - int eee_disable; + bool eee_disable; bool module_plugged; u32 mtu; }; @@ -967,6 +979,7 @@ struct e1000_hw { #include "e1000_80003es2lan.h" #include "e1000_ich8lan.h" #include "e1000_82575.h" +#include "e1000_i210.h" /* These functions must be implemented by drivers */ void e1000_pci_clear_mwi(struct e1000_hw *hw); Added: head/sys/dev/e1000/e1000_i210.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/e1000/e1000_i210.c Thu Jul 5 20:26:57 2012 (r238148) @@ -0,0 +1,740 @@ +/****************************************************************************** + + Copyright (c) 2001-2012, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "e1000_api.h" + + +static s32 e1000_acquire_nvm_i210(struct e1000_hw *hw); +static void e1000_release_nvm_i210(struct e1000_hw *hw); +static s32 e1000_get_hw_semaphore_i210(struct e1000_hw *hw); +static void e1000_put_hw_semaphore_i210(struct e1000_hw *hw); +static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, + u16 *data); +static s32 e1000_pool_flash_update_done_i210(struct e1000_hw *hw); +static s32 e1000_valid_led_default_i210(struct e1000_hw *hw, u16 *data); +static s32 e1000_read_nvm_i211(struct e1000_hw *hw, u16 offset, u16 words, + u16 *data); + +/** + * e1000_acquire_nvm_i210 - Request for access to EEPROM + * @hw: pointer to the HW structure + * + * Acquire the necessary semaphores for exclusive access to the EEPROM. + * Set the EEPROM access request bit and wait for EEPROM access grant bit. + * Return successful if access grant bit set, else clear the request for + * EEPROM access and return -E1000_ERR_NVM (-1). + **/ +static s32 e1000_acquire_nvm_i210(struct e1000_hw *hw) +{ + s32 ret_val; + + DEBUGFUNC("e1000_acquire_nvm_i210"); + + ret_val = e1000_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); + + return ret_val; +} + +/** + * e1000_release_nvm_i210 - Release exclusive access to EEPROM + * @hw: pointer to the HW structure + * + * Stop any current commands to the EEPROM and clear the EEPROM request bit, + * then release the semaphores acquired. + **/ +static void e1000_release_nvm_i210(struct e1000_hw *hw) +{ + DEBUGFUNC("e1000_release_nvm_i210"); + + e1000_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); +} + +/** + * e1000_acquire_swfw_sync_i210 - Acquire SW/FW semaphore + * @hw: pointer to the HW structure + * @mask: specifies which semaphore to acquire + * + * Acquire the SW/FW semaphore to access the PHY or NVM. The mask + * will also specify which port we're acquiring the lock for. + **/ +s32 e1000_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask) +{ + u32 swfw_sync; + u32 swmask = mask; + u32 fwmask = mask << 16; + s32 ret_val = E1000_SUCCESS; + s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ + + DEBUGFUNC("e1000_acquire_swfw_sync_i210"); + + while (i < timeout) { + if (e1000_get_hw_semaphore_i210(hw)) { + ret_val = -E1000_ERR_SWFW_SYNC; + goto out; + } + + swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); + if (!(swfw_sync & fwmask)) + break; + + /* + * Firmware currently using resource (fwmask) + */ + e1000_put_hw_semaphore_i210(hw); + msec_delay_irq(5); + i++; + } + + if (i == timeout) { + DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n"); + ret_val = -E1000_ERR_SWFW_SYNC; + goto out; + } + + swfw_sync |= swmask; + E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); + + e1000_put_hw_semaphore_i210(hw); + +out: + return ret_val; +} + +/** + * e1000_release_swfw_sync_i210 - Release SW/FW semaphore + * @hw: pointer to the HW structure + * @mask: specifies which semaphore to acquire + * + * Release the SW/FW semaphore used to access the PHY or NVM. The mask + * will also specify which port we're releasing the lock for. + **/ +void e1000_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask) +{ + u32 swfw_sync; + + DEBUGFUNC("e1000_release_swfw_sync_i210"); + + while (e1000_get_hw_semaphore_i210(hw) != E1000_SUCCESS) + ; /* Empty */ + + swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); + swfw_sync &= ~mask; + E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); + + e1000_put_hw_semaphore_i210(hw); +} + +/** + * e1000_get_hw_semaphore_i210 - Acquire hardware semaphore + * @hw: pointer to the HW structure + * + * Acquire the HW semaphore to access the PHY or NVM + **/ +static s32 e1000_get_hw_semaphore_i210(struct e1000_hw *hw) +{ + u32 swsm; + s32 ret_val = E1000_SUCCESS; + s32 timeout = hw->nvm.word_size + 1; + s32 i = 0; + + DEBUGFUNC("e1000_get_hw_semaphore_i210"); + + /* Get the FW semaphore. */ + for (i = 0; i < timeout; i++) { + swsm = E1000_READ_REG(hw, E1000_SWSM); + E1000_WRITE_REG(hw, E1000_SWSM, swsm | E1000_SWSM_SWESMBI); + + /* Semaphore acquired if bit latched */ + if (E1000_READ_REG(hw, E1000_SWSM) & E1000_SWSM_SWESMBI) + break; + + usec_delay(50); + } + + if (i == timeout) { + /* Release semaphores */ + e1000_put_hw_semaphore_generic(hw); + DEBUGOUT("Driver can't access the NVM\n"); + ret_val = -E1000_ERR_NVM; + goto out; + } + +out: + return ret_val; +} + +/** + * e1000_put_hw_semaphore_i210 - Release hardware semaphore + * @hw: pointer to the HW structure + * + * Release hardware semaphore used to access the PHY or NVM + **/ +static void e1000_put_hw_semaphore_i210(struct e1000_hw *hw) +{ + u32 swsm; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 20:51:45 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 76A581065680; Thu, 5 Jul 2012 20:51:45 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F91B8FC1D; Thu, 5 Jul 2012 20:51: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 q65KpjhG017868; Thu, 5 Jul 2012 20:51:45 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65KpjCD017859; Thu, 5 Jul 2012 20:51:45 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201207052051.q65KpjCD017859@svn.freebsd.org> From: Jack F Vogel Date: Thu, 5 Jul 2012 20:51: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: r238149 - 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, 05 Jul 2012 20:51:45 -0000 Author: jfv Date: Thu Jul 5 20:51:44 2012 New Revision: 238149 URL: http://svn.freebsd.org/changeset/base/238149 Log: Update to the ixgbe driver: - Add a couple of new devices - Flow control changes in shared and core code - Bug fix to Flow Director for 82598 - Shared code sync to internal with required core change Thanks to those helping in the testing and improvements to this driver! MFC after:5 days Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_82598.h head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_type.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/dev/ixgbe/ixgbe_x540.c head/sys/dev/ixgbe/ixv.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jul 5 20:51:44 2012 (r238149) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.4.5"; +char ixgbe_driver_version[] = "2.4.8"; /********************************************************************* * PCI Device ID Table @@ -80,8 +80,10 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} @@ -242,10 +244,6 @@ TUNABLE_INT("hw.ixgbe.max_interrupt_rate static int ixgbe_rx_process_limit = 128; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); -/* Flow control setting, default to full */ -static int ixgbe_flow_control = ixgbe_fc_full; -TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control); - /* ** Smart speed setting, default to on ** this only works as a compile option @@ -526,28 +524,25 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Get Hardware Flow Control setting */ - hw->fc.requested_mode = ixgbe_fc_full; - adapter->fc = hw->fc.requested_mode; - hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.low_water = IXGBE_FC_LO; - hw->fc.high_water[0] = IXGBE_FC_HI; - hw->fc.send_xon = TRUE; - error = ixgbe_init_hw(hw); - if (error == IXGBE_ERR_EEPROM_VERSION) { + switch (error) { + case IXGBE_ERR_EEPROM_VERSION: device_printf(dev, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " "with your hardware.\n If you are experiencing problems " "please contact your Intel or hardware representative " "who provided you with this hardware.\n"); - } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) + break; + case IXGBE_ERR_SFP_NOT_SUPPORTED: device_printf(dev,"Unsupported SFP+ Module\n"); - - if (error) { error = EIO; device_printf(dev,"Hardware Initialization Failure\n"); goto err_late; + case IXGBE_ERR_SFP_NOT_PRESENT: + device_printf(dev,"No SFP+ Module found\n"); + /* falls thru */ + default: + break; } /* Detect and set physical type */ @@ -1236,7 +1231,7 @@ ixgbe_init_locked(struct adapter *adapte #ifdef IXGBE_FDIR /* Init Flow director */ if (hw->mac.type != ixgbe_mac_82598EB) { - u32 hdrm = 64 << fdir_pballoc; + u32 hdrm = 32 << fdir_pballoc; hw->mac.ops.setup_rxpba(hw, 0, hdrm, PBA_STRATEGY_EQUAL); ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); @@ -1262,6 +1257,35 @@ ixgbe_init_locked(struct adapter *adapte /* Config/Enable Link */ ixgbe_config_link(adapter); + /* Hardware Packet Buffer & Flow Control setup */ + { + u32 rxpb, frame, size, tmp; + + frame = adapter->max_frame_size; + + /* Calculate High Water */ + if (hw->mac.type == ixgbe_mac_X540) + tmp = IXGBE_DV_X540(frame, frame); + else + tmp = IXGBE_DV(frame, frame); + size = IXGBE_BT2KB(tmp); + rxpb = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) >> 10; + hw->fc.high_water[0] = rxpb - size; + + /* Now calculate Low Water */ + if (hw->mac.type == ixgbe_mac_X540) + tmp = IXGBE_LOW_DV_X540(frame); + else + tmp = IXGBE_LOW_DV(frame); + hw->fc.low_water[0] = IXGBE_BT2KB(tmp); + + adapter->fc = hw->fc.requested_mode = ixgbe_fc_full; + hw->fc.pause_time = IXGBE_FC_PAUSE; + hw->fc.send_xon = TRUE; + } + /* Initialize the FC settings */ + ixgbe_start_hw(hw); + /* And now turn on interrupts */ ixgbe_enable_intr(adapter); @@ -1551,10 +1575,8 @@ ixgbe_msix_link(void *arg) /* This is probably overkill :) */ if (!atomic_cmpset_int(&adapter->fdir_reinit, 0, 1)) return; - /* Clear the interrupt */ - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_FLOW_DIR); - /* Turn off the interface */ - adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + /* Disable the interrupt */ + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_FLOW_DIR); taskqueue_enqueue(adapter->tq, &adapter->fdir_task); } else #endif @@ -2056,6 +2078,8 @@ ixgbe_update_link_status(struct adapter ((adapter->link_speed == 128)? 10:1), "Full Duplex"); adapter->link_active = TRUE; + /* Update any Flow Control changes */ + ixgbe_fc_enable(&adapter->hw); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -3063,7 +3087,7 @@ ixgbe_initialize_transmit_units(struct a txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); break; } - txctrl &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; switch (hw->mac.type) { case ixgbe_mac_82598EB: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); @@ -5095,6 +5119,8 @@ ixgbe_reinit_fdir(void *context, int pen return; ixgbe_reinit_fdir_tables_82599(&adapter->hw); adapter->fdir_reinit = 0; + /* re-enable flow director interrupts */ + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR); /* Restart the interface */ ifp->if_drv_flags |= IFF_DRV_RUNNING; return; @@ -5652,8 +5678,9 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) default: adapter->hw.fc.requested_mode = ixgbe_fc_none; } - - ixgbe_fc_enable(&adapter->hw, 0); + /* Don't autoneg if forcing a value */ + adapter->hw.fc.disable_fc_autoneg = TRUE; + ixgbe_fc_enable(&adapter->hw); return error; } @@ -5669,9 +5696,9 @@ ixgbe_add_rx_process_limit(struct adapte /* ** Control link advertise speed: -** 0 - normal ** 1 - advertise only 1G ** 2 - advertise 100Mb +** 3 - advertise normal */ static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) @@ -5685,13 +5712,15 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) adapter = (struct adapter *) arg1; dev = adapter->dev; hw = &adapter->hw; - last = hw->phy.autoneg_advertised; + last = adapter->advertise; error = sysctl_handle_int(oidp, &adapter->advertise, 0, req); - if ((error) || (adapter->advertise == -1)) return (error); + if (adapter->advertise == last) /* no change */ + return (0); + if (!((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber))) return (error); @@ -5705,11 +5734,10 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) speed = IXGBE_LINK_SPEED_1GB_FULL; else if (adapter->advertise == 2) speed = IXGBE_LINK_SPEED_100_FULL; - else + else if (adapter->advertise == 3) speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; - - if (speed == last) /* no change */ + else /* bogus value */ return (error); hw->mac.autotry_restart = TRUE; Modified: head/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82598.c Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe_82598.c Thu Jul 5 20:51:44 2012 (r238149) @@ -104,31 +104,6 @@ out: } /** - * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count - * @hw: pointer to hardware structure - * - * Read PCIe configuration space, and get the MSI-X vector count from - * the capabilities table. - **/ -u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw) -{ - u32 msix_count = 18; - - DEBUGFUNC("ixgbe_get_pcie_msix_count_82598"); - - if (hw->mac.msix_vectors_from_pcie) { - msix_count = IXGBE_READ_PCIE_WORD(hw, - IXGBE_PCIE_MSIX_82598_CAPS); - msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK; - - /* MSI-X count is zero-based in HW, so increment to give - * proper value */ - msix_count++; - } - return msix_count; -} - -/** * ixgbe_init_ops_82598 - Inits func ptrs and MAC type * @hw: pointer to hardware structure * @@ -176,7 +151,7 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw mac->rx_pb_size = 512; mac->max_tx_queues = 32; mac->max_rx_queues = 64; - mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82598(hw); + mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); /* SFP+ Module */ phy->ops.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598; @@ -280,15 +255,15 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw for (i = 0; ((i < hw->mac.max_tx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); - regval &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), regval); } for (i = 0; ((i < hw->mac.max_rx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); - regval &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + regval &= ~(IXGBE_DCA_RXCTRL_DATA_WRO_EN | + IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } @@ -416,21 +391,41 @@ out: /** * ixgbe_fc_enable_82598 - Enable flow control * @hw: pointer to hardware structure - * @packetbuf_num: packet buffer number (0-7) * * Enable flow control according to the current settings. **/ -s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) +s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) { s32 ret_val = IXGBE_SUCCESS; u32 fctrl_reg; u32 rmcs_reg; u32 reg; + u32 fcrtl, fcrth; u32 link_speed = 0; + int i; bool link_up; DEBUGFUNC("ixgbe_fc_enable_82598"); + /* Validate the water mark configuration */ + if (!hw->fc.pause_time) { + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + + /* Low water mark of zero causes XOFF floods */ + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + if (!hw->fc.low_water[i] || + hw->fc.low_water[i] >= hw->fc.high_water[i]) { + DEBUGOUT("Invalid water mark configuration\n"); + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + } + } + /* * On 82598 having Rx FC on causes resets while doing 1G * so if it's on turn it off once we know link_speed. For @@ -452,9 +447,7 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_h } /* Negotiate the fc mode to use */ - ret_val = ixgbe_fc_autoneg(hw); - if (ret_val == IXGBE_ERR_FLOW_CONTROL) - goto out; + ixgbe_fc_autoneg(hw); /* Disable any previous flow control settings */ fctrl_reg = IXGBE_READ_REG(hw, IXGBE_FCTRL); @@ -516,28 +509,27 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_h IXGBE_WRITE_REG(hw, IXGBE_RMCS, rmcs_reg); /* Set up and enable Rx high/low water mark thresholds, enable XON. */ - if (hw->fc.current_mode & ixgbe_fc_tx_pause) { - reg = hw->fc.low_water << 6; - if (hw->fc.send_xon) - reg |= IXGBE_FCRTL_XONE; - - IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), reg); - - reg = hw->fc.high_water[packetbuf_num] << 6; - reg |= IXGBE_FCRTH_FCEN; + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; + fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; + IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl); + IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), fcrth); + } else { + IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), 0); + } - IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), reg); } /* Configure pause time (2 TCs per register) */ - reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num / 2)); - if ((packetbuf_num & 1) == 0) - reg = (reg & 0xFFFF0000) | hw->fc.pause_time; - else - reg = (reg & 0x0000FFFF) | (hw->fc.pause_time << 16); - IXGBE_WRITE_REG(hw, IXGBE_FCTTV(packetbuf_num / 2), reg); + reg = hw->fc.pause_time * 0x00010001; + for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++) + IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); - IXGBE_WRITE_REG(hw, IXGBE_FCRTV, (hw->fc.pause_time >> 1)); + /* Configure flow control refresh threshold value */ + IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); out: return ret_val; @@ -1325,15 +1317,15 @@ void ixgbe_enable_relaxed_ordering_82598 for (i = 0; ((i < hw->mac.max_tx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); - regval |= IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + regval |= IXGBE_DCA_TXCTRL_DESC_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), regval); } for (i = 0; ((i < hw->mac.max_rx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); - regval |= (IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + regval |= IXGBE_DCA_RXCTRL_DATA_WRO_EN | + IXGBE_DCA_RXCTRL_HEAD_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } Modified: head/sys/dev/ixgbe/ixgbe_82598.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82598.h Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe_82598.h Thu Jul 5 20:51:44 2012 (r238149) @@ -36,7 +36,7 @@ #define _IXGBE_82598_H_ u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw); -s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num); +s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw); s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw); void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw); s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq); Modified: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.c Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe_82599.c Thu Jul 5 20:51:44 2012 (r238149) @@ -243,6 +243,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw /* RAR, Multicast, VLAN */ mac->ops.set_vmdq = &ixgbe_set_vmdq_generic; + mac->ops.set_vmdq_san_mac = &ixgbe_set_vmdq_san_mac_generic; mac->ops.clear_vmdq = &ixgbe_clear_vmdq_generic; mac->ops.insert_mac_addr = &ixgbe_insert_mac_addr_generic; mac->rar_highwater = 1; @@ -304,7 +305,9 @@ s32 ixgbe_get_link_capabilities_82599(st /* Check if 1G SFP module. */ if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || - hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1) { + hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL; *negotiation = TRUE; goto out; @@ -420,6 +423,7 @@ enum ixgbe_media_type ixgbe_get_media_ty case IXGBE_DEV_ID_82599_SFP: case IXGBE_DEV_ID_82599_SFP_FCOE: case IXGBE_DEV_ID_82599_SFP_EM: + case IXGBE_DEV_ID_82599_SFP_SF2: case IXGBE_DEV_ID_82599EN_SFP: media_type = ixgbe_media_type_fiber; break; @@ -1088,6 +1092,9 @@ mac_reset_top: hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1, hw->mac.san_addr, 0, IXGBE_RAH_AV); + /* Save the SAN MAC RAR index */ + hw->mac.san_mac_rar_index = hw->mac.num_rar_entries - 1; + /* Reserve the last RAR for the SAN MAC address */ hw->mac.num_rar_entries--; } @@ -2037,6 +2044,8 @@ sfp_check: physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR; else if (comp_codes_1g & IXGBE_SFF_1GBASET_CAPABLE) physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T; + else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) + physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_SX; break; default: break; @@ -2233,3 +2242,4 @@ static s32 ixgbe_read_eeprom_82599(struc return ret_val; } + Modified: head/sys/dev/ixgbe/ixgbe_api.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_api.c Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe_api.c Thu Jul 5 20:51:44 2012 (r238149) @@ -118,6 +118,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw * case IXGBE_DEV_ID_82599_BACKPLANE_FCOE: case IXGBE_DEV_ID_82599_SFP_FCOE: case IXGBE_DEV_ID_82599_SFP_EM: + case IXGBE_DEV_ID_82599_SFP_SF2: case IXGBE_DEV_ID_82599EN_SFP: case IXGBE_DEV_ID_82599_CX4: case IXGBE_DEV_ID_82599_T3_LOM: @@ -130,6 +131,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw * hw->mac.type = ixgbe_mac_X540_vf; break; case IXGBE_DEV_ID_X540T: + case IXGBE_DEV_ID_X540T1: hw->mac.type = ixgbe_mac_X540; break; default: @@ -811,6 +813,18 @@ s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, { return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq), IXGBE_NOT_IMPLEMENTED); + +} + +/** + * ixgbe_set_vmdq_san_mac - Associate VMDq index 127 with a receive address + * @hw: pointer to hardware structure + * @vmdq: VMDq default pool index + **/ +s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq) +{ + return ixgbe_call_func(hw, hw->mac.ops.set_vmdq_san_mac, + (hw, vmdq), IXGBE_NOT_IMPLEMENTED); } /** @@ -960,13 +974,12 @@ s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, /** * ixgbe_fc_enable - Enable flow control * @hw: pointer to hardware structure - * @packetbuf_num: packet buffer number (0-7) * * Configures the flow control settings based on SW configuration. **/ -s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num) +s32 ixgbe_fc_enable(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw, packetbuf_num), + return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw), IXGBE_NOT_IMPLEMENTED); } @@ -1102,7 +1115,7 @@ u32 ixgbe_get_supported_physical_layer(s } /** - * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependant on device specifics + * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependent on device specifics * @hw: pointer to hardware structure * @regval: bitfield to write to the Rx DMA register * Modified: head/sys/dev/ixgbe/ixgbe_api.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_api.h Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe_api.h Thu Jul 5 20:51:44 2012 (r238149) @@ -104,6 +104,7 @@ s32 ixgbe_set_rar(struct ixgbe_hw *hw, u u32 enable_addr); s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index); s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); +s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq); s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw); u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw); @@ -120,7 +121,7 @@ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vind, bool vlan_on); s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, bool *vfta_changed); -s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num); +s32 ixgbe_fc_enable(struct ixgbe_hw *hw); s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, u8 ver); void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr); Modified: head/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_common.c Thu Jul 5 20:26:57 2012 (r238148) +++ head/sys/dev/ixgbe/ixgbe_common.c Thu Jul 5 20:51:44 2012 (r238149) @@ -51,13 +51,6 @@ static void ixgbe_release_eeprom(struct static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr); static s32 ixgbe_get_san_mac_addr_offset(struct ixgbe_hw *hw, u16 *san_mac_offset); -static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw); -static s32 ixgbe_fc_autoneg_backplane(struct ixgbe_hw *hw); -static s32 ixgbe_fc_autoneg_copper(struct ixgbe_hw *hw); -static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw); -static s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, - u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); -static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num); static s32 ixgbe_read_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset, u16 words, u16 *data); static s32 ixgbe_write_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset, @@ -146,6 +139,177 @@ s32 ixgbe_init_ops_generic(struct ixgbe_ } /** + * ixgbe_device_supports_autoneg_fc - Check if phy supports autoneg flow + * control + * @hw: pointer to hardware structure + * + * There are several phys that do not support autoneg flow control. This + * function check the device id to see if the associated phy supports + * autoneg flow control. + **/ +static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw) +{ + + DEBUGFUNC("ixgbe_device_supports_autoneg_fc"); + + switch (hw->device_id) { + case IXGBE_DEV_ID_X540T: + case IXGBE_DEV_ID_X540T1: + return IXGBE_SUCCESS; + case IXGBE_DEV_ID_82599_T3_LOM: + return IXGBE_SUCCESS; + default: + return IXGBE_ERR_FC_NOT_SUPPORTED; + } +} + +/** + * ixgbe_setup_fc - Set up flow control + * @hw: pointer to hardware structure + * + * Called at init time to set up flow control. + **/ +static s32 ixgbe_setup_fc(struct ixgbe_hw *hw) +{ + s32 ret_val = IXGBE_SUCCESS; + u32 reg = 0, reg_bp = 0; + u16 reg_cu = 0; + + DEBUGFUNC("ixgbe_setup_fc"); + + /* + * Validate the requested mode. Strict IEEE mode does not allow + * ixgbe_fc_rx_pause because it will cause us to fail at UNH. + */ + if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { + DEBUGOUT("ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + + /* + * 10gig parts do not have a word in the EEPROM to determine the + * default flow control setting, so we explicitly set it to full. + */ + if (hw->fc.requested_mode == ixgbe_fc_default) + hw->fc.requested_mode = ixgbe_fc_full; + + /* + * Set up the 1G and 10G flow control advertisement registers so the + * HW will be able to do fc autoneg once the cable is plugged in. If + * we link at 10G, the 1G advertisement is harmless and vice versa. + */ + switch (hw->phy.media_type) { + case ixgbe_media_type_fiber: + case ixgbe_media_type_backplane: + reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA); + reg_bp = IXGBE_READ_REG(hw, IXGBE_AUTOC); + break; + case ixgbe_media_type_copper: + hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_ADVT, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, ®_cu); + break; + default: + break; + } + + /* + * The possible values of fc.requested_mode are: + * 0: Flow control is completely disabled + * 1: Rx flow control is enabled (we can receive pause frames, + * but not send pause frames). + * 2: Tx flow control is enabled (we can send pause frames but + * we do not support receiving pause frames). + * 3: Both Rx and Tx flow control (symmetric) are enabled. + * other: Invalid. + */ + switch (hw->fc.requested_mode) { + case ixgbe_fc_none: + /* Flow control completely disabled by software override. */ + reg &= ~(IXGBE_PCS1GANA_SYM_PAUSE | IXGBE_PCS1GANA_ASM_PAUSE); + if (hw->phy.media_type == ixgbe_media_type_backplane) + reg_bp &= ~(IXGBE_AUTOC_SYM_PAUSE | + IXGBE_AUTOC_ASM_PAUSE); + else if (hw->phy.media_type == ixgbe_media_type_copper) + reg_cu &= ~(IXGBE_TAF_SYM_PAUSE | IXGBE_TAF_ASM_PAUSE); + break; + case ixgbe_fc_tx_pause: + /* + * Tx Flow control is enabled, and Rx Flow control is + * disabled by software override. + */ + reg |= IXGBE_PCS1GANA_ASM_PAUSE; + reg &= ~IXGBE_PCS1GANA_SYM_PAUSE; + if (hw->phy.media_type == ixgbe_media_type_backplane) { + reg_bp |= IXGBE_AUTOC_ASM_PAUSE; + reg_bp &= ~IXGBE_AUTOC_SYM_PAUSE; + } else if (hw->phy.media_type == ixgbe_media_type_copper) { + reg_cu |= IXGBE_TAF_ASM_PAUSE; + reg_cu &= ~IXGBE_TAF_SYM_PAUSE; + } + break; + case ixgbe_fc_rx_pause: + /* + * Rx Flow control is enabled and Tx Flow control is + * disabled by software override. Since there really + * isn't a way to advertise that we are capable of RX + * Pause ONLY, we will advertise that we support both + * symmetric and asymmetric Rx PAUSE, as such we fall + * through to the fc_full statement. Later, we will + * disable the adapter's ability to send PAUSE frames. + */ + case ixgbe_fc_full: + /* Flow control (both Rx and Tx) is enabled by SW override. */ + reg |= IXGBE_PCS1GANA_SYM_PAUSE | IXGBE_PCS1GANA_ASM_PAUSE; + if (hw->phy.media_type == ixgbe_media_type_backplane) + reg_bp |= IXGBE_AUTOC_SYM_PAUSE | + IXGBE_AUTOC_ASM_PAUSE; + else if (hw->phy.media_type == ixgbe_media_type_copper) + reg_cu |= IXGBE_TAF_SYM_PAUSE | IXGBE_TAF_ASM_PAUSE; + break; + default: + DEBUGOUT("Flow control param set incorrectly\n"); + ret_val = IXGBE_ERR_CONFIG; + goto out; + break; + } + + if (hw->mac.type != ixgbe_mac_X540) { + /* + * Enable auto-negotiation between the MAC & PHY; + * the MAC will advertise clause 37 flow control. + */ + IXGBE_WRITE_REG(hw, IXGBE_PCS1GANA, reg); + reg = IXGBE_READ_REG(hw, IXGBE_PCS1GLCTL); + + /* Disable AN timeout */ + if (hw->fc.strict_ieee) + reg &= ~IXGBE_PCS1GLCTL_AN_1G_TIMEOUT_EN; + + IXGBE_WRITE_REG(hw, IXGBE_PCS1GLCTL, reg); + DEBUGOUT1("Set up FC; PCS1GLCTL = 0x%08X\n", reg); + } + + /* + * AUTOC restart handles negotiation of 1G and 10G on backplane + * and copper. There is no need to set the PCS1GCTL register. + * + */ + if (hw->phy.media_type == ixgbe_media_type_backplane) { + reg_bp |= IXGBE_AUTOC_AN_RESTART; + IXGBE_WRITE_REG(hw, IXGBE_AUTOC, reg_bp); + } else if ((hw->phy.media_type == ixgbe_media_type_copper) && + (ixgbe_device_supports_autoneg_fc(hw) == IXGBE_SUCCESS)) { + hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_ADVT, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg_cu); + } + + DEBUGOUT1("Set up FC; IXGBE_AUTOC = 0x%08X\n", reg); +out: + return ret_val; +} + +/** * ixgbe_start_hw_generic - Prepare hardware for Tx/Rx * @hw: pointer to hardware structure * @@ -156,6 +320,7 @@ s32 ixgbe_init_ops_generic(struct ixgbe_ **/ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) { + s32 ret_val; u32 ctrl_ext; DEBUGFUNC("ixgbe_start_hw_generic"); @@ -178,12 +343,15 @@ s32 ixgbe_start_hw_generic(struct ixgbe_ IXGBE_WRITE_FLUSH(hw); /* Setup flow control */ - ixgbe_setup_fc(hw, 0); + ret_val = ixgbe_setup_fc(hw); + if (ret_val != IXGBE_SUCCESS) + goto out; /* Clear adapter stopped flag */ hw->adapter_stopped = FALSE; - return IXGBE_SUCCESS; +out: + return ret_val; } /** @@ -211,14 +379,14 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw /* Disable relaxed ordering */ for (i = 0; i < hw->mac.max_tx_queues; i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); - regval &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), regval); } for (i = 0; i < hw->mac.max_rx_queues; i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); - regval &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + regval &= ~(IXGBE_DCA_RXCTRL_DATA_WRO_EN | + IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } @@ -583,6 +751,9 @@ s32 ixgbe_get_bus_info_generic(struct ix case IXGBE_PCI_LINK_SPEED_5000: hw->bus.speed = ixgbe_bus_speed_5000; break; + case IXGBE_PCI_LINK_SPEED_8000: + hw->bus.speed = ixgbe_bus_speed_8000; + break; default: hw->bus.speed = ixgbe_bus_speed_unknown; break; @@ -2242,27 +2413,44 @@ s32 ixgbe_disable_mc_generic(struct ixgb /** * ixgbe_fc_enable_generic - Enable flow control * @hw: pointer to hardware structure - * @packetbuf_num: packet buffer number (0-7) * * Enable flow control according to the current settings. **/ -s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packetbuf_num) +s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) { s32 ret_val = IXGBE_SUCCESS; u32 mflcn_reg, fccfg_reg; u32 reg; u32 fcrtl, fcrth; + int i; DEBUGFUNC("ixgbe_fc_enable_generic"); - /* Negotiate the fc mode to use */ - ret_val = ixgbe_fc_autoneg(hw); - if (ret_val == IXGBE_ERR_FLOW_CONTROL) + /* Validate the water mark configuration */ + if (!hw->fc.pause_time) { + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; goto out; + } + + /* Low water mark of zero causes XOFF floods */ + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + if (!hw->fc.low_water[i] || + hw->fc.low_water[i] >= hw->fc.high_water[i]) { + DEBUGOUT("Invalid water mark configuration\n"); + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + } + } + + /* Negotiate the fc mode to use */ + ixgbe_fc_autoneg(hw); /* Disable any previous flow control settings */ mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN); - mflcn_reg &= ~(IXGBE_MFLCN_RFCE | IXGBE_MFLCN_RPFCE); + mflcn_reg &= ~(IXGBE_MFLCN_RPFCE_MASK | IXGBE_MFLCN_RFCE); fccfg_reg = IXGBE_READ_REG(hw, IXGBE_FCCFG); fccfg_reg &= ~(IXGBE_FCCFG_TFCE_802_3X | IXGBE_FCCFG_TFCE_PRIORITY); @@ -2319,120 +2507,110 @@ s32 ixgbe_fc_enable_generic(struct ixgbe IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); - fcrth = hw->fc.high_water[packetbuf_num] << 10; - fcrtl = hw->fc.low_water << 10; - if (hw->fc.current_mode & ixgbe_fc_tx_pause) { - fcrth |= IXGBE_FCRTH_FCEN; - if (hw->fc.send_xon) - fcrtl |= IXGBE_FCRTL_XONE; - } + /* Set up and enable Rx high/low water mark thresholds, enable XON. */ + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; + IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), fcrtl); + fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; + } else { + IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), 0); + /* + * In order to prevent Tx hangs when the internal Tx + * switch is enabled we must set the high water mark + * to the maximum FCRTH value. This allows the Tx + * switch to function even under heavy Rx workloads. + */ + fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 32; + } - IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), fcrth); - IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(packetbuf_num), fcrtl); + IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), fcrth); + } /* Configure pause time (2 TCs per register) */ - reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num / 2)); - if ((packetbuf_num & 1) == 0) - reg = (reg & 0xFFFF0000) | hw->fc.pause_time; - else - reg = (reg & 0x0000FFFF) | (hw->fc.pause_time << 16); - IXGBE_WRITE_REG(hw, IXGBE_FCTTV(packetbuf_num / 2), reg); + reg = hw->fc.pause_time * 0x00010001; + for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++) + IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); - IXGBE_WRITE_REG(hw, IXGBE_FCRTV, (hw->fc.pause_time >> 1)); + /* Configure flow control refresh threshold value */ + IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); out: return ret_val; } /** - * ixgbe_fc_autoneg - Configure flow control + * ixgbe_negotiate_fc - Negotiate flow control * @hw: pointer to hardware structure + * @adv_reg: flow control advertised settings + * @lp_reg: link partner's flow control settings + * @adv_sym: symmetric pause bit in advertisement + * @adv_asm: asymmetric pause bit in advertisement + * @lp_sym: symmetric pause bit in link partner advertisement + * @lp_asm: asymmetric pause bit in link partner advertisement * - * Compares our advertised flow control capabilities to those advertised by - * our link partner, and determines the proper flow control mode to use. + * Find the intersection between advertised settings and link partner's + * advertised settings **/ -s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw) +static s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, + u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm) { - s32 ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED; - ixgbe_link_speed speed; - bool link_up; + if ((!(adv_reg)) || (!(lp_reg))) + return IXGBE_ERR_FC_NOT_NEGOTIATED; - DEBUGFUNC("ixgbe_fc_autoneg"); + if ((adv_reg & adv_sym) && (lp_reg & lp_sym)) { + /* + * Now we need to check if the user selected Rx ONLY + * of pause frames. In this case, we had to advertise + * FULL flow control because we could not advertise RX + * ONLY. Hence, we must now check to see if we need to + * turn OFF the TRANSMISSION of PAUSE frames. + */ + if (hw->fc.requested_mode == ixgbe_fc_full) { + hw->fc.current_mode = ixgbe_fc_full; + DEBUGOUT("Flow Control = FULL.\n"); + } else { + hw->fc.current_mode = ixgbe_fc_rx_pause; + DEBUGOUT("Flow Control=RX PAUSE frames only\n"); + } + } else if (!(adv_reg & adv_sym) && (adv_reg & adv_asm) && + (lp_reg & lp_sym) && (lp_reg & lp_asm)) { + hw->fc.current_mode = ixgbe_fc_tx_pause; + DEBUGOUT("Flow Control = TX PAUSE frames only.\n"); + } else if ((adv_reg & adv_sym) && (adv_reg & adv_asm) && + !(lp_reg & lp_sym) && (lp_reg & lp_asm)) { + hw->fc.current_mode = ixgbe_fc_rx_pause; + DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); + } else { + hw->fc.current_mode = ixgbe_fc_none; + DEBUGOUT("Flow Control = NONE.\n"); + } + return IXGBE_SUCCESS; +} - if (hw->fc.disable_fc_autoneg) - goto out; +/** + * ixgbe_fc_autoneg_fiber - Enable flow control on 1 gig fiber + * @hw: pointer to hardware structure + * + * Enable flow control according on 1 gig fiber. + **/ +static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) +{ + u32 pcs_anadv_reg, pcs_lpab_reg, linkstat; + s32 ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED; /* - * AN should have completed when the cable was plugged in. - * Look for reasons to bail out. Bail out if: - * - FC autoneg is disabled, or if - * - link is not up. - * - * Since we're being called from an LSC, link is already known to be up. - * So use link_up_wait_to_complete=FALSE. - */ - hw->mac.ops.check_link(hw, &speed, &link_up, FALSE); - if (!link_up) { - ret_val = IXGBE_ERR_FLOW_CONTROL; - goto out; - } - - switch (hw->phy.media_type) { - /* Autoneg flow control on fiber adapters */ - case ixgbe_media_type_fiber: - if (speed == IXGBE_LINK_SPEED_1GB_FULL) - ret_val = ixgbe_fc_autoneg_fiber(hw); - break; - - /* Autoneg flow control on backplane adapters */ - case ixgbe_media_type_backplane: - ret_val = ixgbe_fc_autoneg_backplane(hw); - break; - - /* Autoneg flow control on copper adapters */ - case ixgbe_media_type_copper: - if (ixgbe_device_supports_autoneg_fc(hw) == IXGBE_SUCCESS) - ret_val = ixgbe_fc_autoneg_copper(hw); - break; - - default: - break; - } - -out: - if (ret_val == IXGBE_SUCCESS) { - hw->fc.fc_was_autonegged = TRUE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 21:32: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 C4EA6106566B; Thu, 5 Jul 2012 21:32:26 +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 99C808FC15; Thu, 5 Jul 2012 21:32:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F1279B95A; Thu, 5 Jul 2012 17:32:25 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Thu, 5 Jul 2012 17:25:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207052026.q65KQw9m016770@svn.freebsd.org> In-Reply-To: <201207052026.q65KQw9m016770@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201207051725.48614.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 05 Jul 2012 17:32:26 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238148 - in head/sys: conf dev/e1000 modules/igb 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, 05 Jul 2012 21:32:26 -0000 On Thursday, July 05, 2012 4:26:58 pm Jack F Vogel wrote: > Author: jfv > Date: Thu Jul 5 20:26:57 2012 > New Revision: 238148 > URL: http://svn.freebsd.org/changeset/base/238148 > > Log: > Sync with Intel internal source: > shared code update and small changes in core required > Add support for new i210/i211 devices > Improve queue calculation based on mac type > > MFC after:5 days I only spot two small regressions in this merge: Index: if_igb.c =================================================================== --- if_igb.c (revision 238148) +++ if_igb.c (working copy) @@ -767,8 +767,6 @@ igb_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); - callout_drain(&adapter->timer); #ifdef DEV_NETMAP @@ -965,7 +963,7 @@ igb_mq_start(struct ifnet *ifp, struct mbuf *m) IGB_TX_UNLOCK(txr); } else { err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } return (err); (The current driver calls ether_ifdetach() twice, and the second change refixes the issue with packets being delivered out-of-order.) However, the changes to add a (int *)cast to eee_disable are not safe. You will need to add some sort of SYSCTL_PROC wrapper that sets the boolean directly instead. I don't think it is safe to rely on bool being an int. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 21: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 20BAD106564A; Thu, 5 Jul 2012 21:41:20 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 667278FC08; Thu, 5 Jul 2012 21:41:19 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id BC327FB8; Thu, 5 Jul 2012 23:41:14 +0200 (CEST) Date: Thu, 5 Jul 2012 23:39:02 +0200 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20120705213901.GA1442@garage.freebsd.pl> References: <201207041951.q64JpPXu029310@svn.freebsd.org> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> <201207050749.43210.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <201207050749.43210.jhb@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, David Chisnall , Attilio Rao , Konstantin Belousov , svn-src-head@freebsd.org, markm@freebsd.org Subject: Re: svn commit: r238118 - 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, 05 Jul 2012 21:41:20 -0000 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 05, 2012 at 07:49:42AM -0400, John Baldwin wrote: > On Wednesday, July 04, 2012 4:45:54 pm Attilio Rao wrote: > > 2012/7/4 David Chisnall : > > > On 4 Jul 2012, at 21:32, Andrey Chernov wrote: > > > > > >> 1) /dev/urandom may not exist in jails/sandboxes while sysctls (or o= ld=20 > way > > >> initialization) always exists. > > > > > > From the perspective of Capsicum sandboxes, a device node is better t= han a=20 > sysctl. The kernel must hard-code policy about which sysctls are permitt= ed,=20 > but access to file descriptors is decided on a per-sandbox basis and is= =20 > configurable by the user. The same applies to jails, although it's sligh= tly=20 > more effort to make device nodes appear inside a jail. > >=20 > > Also don't understimate the locking factor here. > > I recall that at some point /dev/random was introducing some > > scalability penalty on php (maybe related to the suhosin patch) until > > kib made shared lookups available on devfs. IIRC, sysctls are still > > Giant locked. >=20 > sysctls are not all Giant locked. KERN_ARND is marked MPSAFE, so it doe= s not=20 > use Giant: It doesn't really matter. Our in-kernel random generator has its own giant lock, so is basically single threaded. Compare results of those two on some SMP machine: # dd if=3D/dev/random of=3D/dev/null bs=3D1m count=3D1024 # sh -c 'for i in `jot $(sysctl -n hw.ncpu)`; do dd if=3D/dev/random of=3D= /dev/null bs=3D1m count=3D128 & done' --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/2CXUACgkQForvXbEpPzS8/QCgr19zdVzPwBJXfplzypty7+zY FMUAniLFmLcedbL7iJo8BusoT/boo3Jh =YNK1 -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE-- From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 23:19: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 3EA611065670; Thu, 5 Jul 2012 23:19:17 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7008FC08; Thu, 5 Jul 2012 23:19:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q65NJ5Qr076733; Fri, 6 Jul 2012 03:19:05 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q65NJ4wG076732; Fri, 6 Jul 2012 03:19:05 +0400 (MSK) (envelope-from ache) Date: Fri, 6 Jul 2012 03:19:04 +0400 From: Andrey Chernov To: Pawel Jakub Dawidek Message-ID: <20120705231903.GA76664@vniz.net> Mail-Followup-To: Andrey Chernov , Pawel Jakub Dawidek , John Baldwin , Attilio Rao , David Chisnall , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Konstantin Belousov , markm@FreeBSD.ORG References: <201207041951.q64JpPXu029310@svn.freebsd.org> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> <201207050749.43210.jhb@freebsd.org> <20120705213901.GA1442@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20120705213901.GA1442@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, John Baldwin , svn-src-all@FreeBSD.ORG, David Chisnall , Attilio Rao , Konstantin Belousov , svn-src-head@FreeBSD.ORG, markm@FreeBSD.ORG Subject: Re: svn commit: r238118 - 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, 05 Jul 2012 23:19:17 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 05, 2012 at 11:39:02PM +0200, Pawel Jakub Dawidek wrote: > > sysctls are not all Giant locked. KERN_ARND is marked MPSAFE, so it d= oes not=20 > > use Giant: >=20 > It doesn't really matter. Our in-kernel random generator has its own > giant lock, so is basically single threaded. Compare results of those > two on some SMP machine: >=20 > # dd if=3D/dev/random of=3D/dev/null bs=3D1m count=3D1024 >=20 > # sh -c 'for i in `jot $(sysctl -n hw.ncpu)`; do dd if=3D/dev/random of= =3D/dev/null bs=3D1m count=3D128 & done' It doesn't really matter for KERN_ARND because it is rarely reseeded and=20 consume most of its time on internal arc4 permutations. That is why strong= =20 KERN_ARND seeding after boot is required (currently it is very weak and=20 easily guessed as I already mention) - started right after boot=20 applications all suffers from weak seeding up to the next rare KERN_ARND=20 and arc4random() both reseeds.. --=20 http://ache.vniz.net/ --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/2IOcACgkQVg5YK5ZEdN2XRgCgtyIYXuY50eyxAojhXAhdPI7x te4AnA7zICkZ6S95V3wRl0nM9BubhrSO =fHc7 -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM-- From owner-svn-src-head@FreeBSD.ORG Thu Jul 5 23:36: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 521C3106564A; Thu, 5 Jul 2012 23:36:18 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D52B8FC17; Thu, 5 Jul 2012 23:36:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q65NaIfv026091; Thu, 5 Jul 2012 23:36:18 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65NaIrb026089; Thu, 5 Jul 2012 23:36:18 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201207052336.q65NaIrb026089@svn.freebsd.org> From: Jack F Vogel Date: Thu, 5 Jul 2012 23:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238151 - head/sys/dev/e1000 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, 05 Jul 2012 23:36:18 -0000 Author: jfv Date: Thu Jul 5 23:36:17 2012 New Revision: 238151 URL: http://svn.freebsd.org/changeset/base/238151 Log: Correct small regressions pointed out by jhb, thanks John. MFC after:5 days Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Jul 5 21:11:03 2012 (r238150) +++ head/sys/dev/e1000/if_igb.c Thu Jul 5 23:36:17 2012 (r238151) @@ -767,8 +767,6 @@ igb_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); - callout_drain(&adapter->timer); #ifdef DEV_NETMAP @@ -965,7 +963,7 @@ igb_mq_start(struct ifnet *ifp, struct m IGB_TX_UNLOCK(txr); } else { err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } return (err); From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 02:18: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 2070F1065672; Fri, 6 Jul 2012 02:18:50 +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 09E5C8FC08; Fri, 6 Jul 2012 02:18:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q662Inul033216; Fri, 6 Jul 2012 02:18:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q662InHT033214; Fri, 6 Jul 2012 02:18:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207060218.q662InHT033214@svn.freebsd.org> From: Alan Cox Date: Fri, 6 Jul 2012 02:18: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: r238159 - head/sys/powerpc/aim 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, 06 Jul 2012 02:18:50 -0000 Author: alc Date: Fri Jul 6 02:18:49 2012 New Revision: 238159 URL: http://svn.freebsd.org/changeset/base/238159 Log: Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap. Tested by: andreast, jhibbits Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Jul 6 01:32:53 2012 (r238158) +++ head/sys/powerpc/aim/mmu_oea.c Fri Jul 6 02:18:49 2012 (r238159) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -204,6 +205,17 @@ struct pvo_head *moea_pvo_table; /* pvo struct pvo_head moea_pvo_kunmanaged = LIST_HEAD_INITIALIZER(moea_pvo_kunmanaged); /* list of unmanaged pages */ +/* + * Isolate the global pv list lock from data and other locks to prevent false + * sharing within the cache. + */ +static struct { + struct rwlock lock; + char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; +} pvh_global __aligned(CACHE_LINE_SIZE); + +#define pvh_global_lock pvh_global.lock + uma_zone_t moea_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea_mpvo_zone; /* zone for pvo entries for managed pages */ @@ -455,7 +467,7 @@ static __inline void moea_attr_clear(vm_page_t m, int ptebit) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); m->md.mdpg_attrs &= ~ptebit; } @@ -470,7 +482,7 @@ static __inline void moea_attr_save(vm_page_t m, int ptebit) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); m->md.mdpg_attrs |= ptebit; } @@ -859,6 +871,11 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k CPU_FILL(&kernel_pmap->pm_active); RB_INIT(&kernel_pmap->pmap_pvo); + /* + * Initialize the global pv list lock. + */ + rw_init(&pvh_global_lock, "pmap pv global"); + /* * Set up the Open Firmware mappings */ @@ -1066,10 +1083,10 @@ moea_enter(mmu_t mmu, pmap_t pmap, vm_of boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); moea_enter_locked(pmap, va, m, prot, wired); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1102,7 +1119,7 @@ moea_enter_locked(pmap_t pmap, vm_offset pvo_flags = PVO_MANAGED; } if (pmap_bootstrapped) - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || VM_OBJECT_LOCKED(m->object), @@ -1166,14 +1183,14 @@ moea_enter_object(mmu_t mmu, pmap_t pm, psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { moea_enter_locked(pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -1182,11 +1199,11 @@ moea_enter_quick(mmu_t mmu, pmap_t pm, v vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); moea_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -1342,7 +1359,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); lo = moea_attr_fetch(m); powerpc_sync(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { @@ -1368,7 +1385,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m vm_page_dirty(m); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1409,7 +1426,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pvo_head = vm_page_to_pvoh(m); lo = moea_calc_wimg(VM_PAGE_TO_PHYS(m), ma); @@ -1429,7 +1446,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page PMAP_UNLOCK(pmap); } m->md.mdpg_cache_attrs = ma; - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1543,7 +1560,7 @@ moea_page_exists_quick(mmu_t mmu, pmap_t ("moea_page_exists_quick: page %p is not managed", m)); loops = 0; rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { if (pvo->pvo_pmap == pmap) { rv = TRUE; @@ -1552,7 +1569,7 @@ moea_page_exists_quick(mmu_t mmu, pmap_t if (++loops >= 16) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -1569,11 +1586,11 @@ moea_page_wired_mappings(mmu_t mmu, vm_p count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) if ((pvo->pvo_vaddr & PVO_WIRED) != 0) count++; - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -1672,7 +1689,7 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); key.pvo_vaddr = sva; for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); @@ -1700,7 +1717,7 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of mtx_unlock(&moea_table_mutex); } } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -1766,7 +1783,7 @@ moea_remove(mmu_t mmu, pmap_t pm, vm_off { struct pvo_entry *pvo, *tpvo, key; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); key.pvo_vaddr = sva; for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); @@ -1775,7 +1792,7 @@ moea_remove(mmu_t mmu, pmap_t pm, vm_off moea_pvo_remove(pvo, -1); } PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1789,7 +1806,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) struct pvo_entry *pvo, *next_pvo; pmap_t pmap; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pvo_head = vm_page_to_pvoh(m); for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) { next_pvo = LIST_NEXT(pvo, pvo_vlink); @@ -1804,7 +1821,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -2279,7 +2296,7 @@ moea_query_bit(vm_page_t m, int ptebit) if (moea_attr_fetch(m) & ptebit) return (TRUE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { /* @@ -2288,7 +2305,7 @@ moea_query_bit(vm_page_t m, int ptebit) */ if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (TRUE); } } @@ -2312,13 +2329,13 @@ moea_query_bit(vm_page_t m, int ptebit) mtx_unlock(&moea_table_mutex); if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (TRUE); } } } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (FALSE); } @@ -2329,7 +2346,7 @@ moea_clear_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); /* * Clear the cached value. @@ -2363,7 +2380,7 @@ moea_clear_bit(vm_page_t m, int ptebit) pvo->pvo_pte.pte.pte_lo &= ~ptebit; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 06:42: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 C478A106566B; Fri, 6 Jul 2012 06:42:25 +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 9622D8FC08; Fri, 6 Jul 2012 06:42: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 q666gPoD044261; Fri, 6 Jul 2012 06:42:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q666gPBS044259; Fri, 6 Jul 2012 06:42:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207060642.q666gPBS044259@svn.freebsd.org> From: Alan Cox Date: Fri, 6 Jul 2012 06:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238163 - head/sys/amd64/amd64 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, 06 Jul 2012 06:42:25 -0000 Author: alc Date: Fri Jul 6 06:42:25 2012 New Revision: 238163 URL: http://svn.freebsd.org/changeset/base/238163 Log: Make pmap_enter()'s management of PV entries consistent with the other pmap functions that manage PV entries. Specifically, remove the PV entry from the containing PV list only after the corresponding PTE is destroyed. Update the pmap's wired mapping count in pmap_enter() before the PV list lock is acquired. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jul 6 03:56:45 2012 (r238162) +++ head/sys/amd64/amd64/pmap.c Fri Jul 6 06:42:25 2012 (r238163) @@ -3517,8 +3517,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, goto validate; } - pv = NULL; - /* * Mapping has changed, invalidate old range and fall through to * handle validating new mapping. @@ -3526,11 +3524,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (opa) { if (origpte & PG_W) pmap->pm_stats.wired_count--; - if (origpte & PG_MANAGED) { + if ((origpte & PG_MANAGED) != 0) om = PHYS_TO_VM_PAGE(opa); - CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, om); - pv = pmap_pvh_remove(&om->md, pmap, va); - } if (mpte != NULL) { mpte->wire_count--; KASSERT(mpte->wire_count > 0, @@ -3541,22 +3536,20 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap_resident_count_inc(pmap, 1); /* + * Increment the counters. + */ + if (wired) + pmap->pm_stats.wired_count++; + + /* * Enter on the PV list if part of our managed memory. */ if ((newpte & PG_MANAGED) != 0) { - if (pv == NULL) - pv = get_pv_entry(pmap, &lock); - CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m); + pv = get_pv_entry(pmap, &lock); pv->pv_va = va; + CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); - } else if (pv != NULL) - free_pv_entry(pmap, pv); - - /* - * Increment counters - */ - if (wired) - pmap->pm_stats.wired_count++; + } validate: @@ -3586,9 +3579,11 @@ validate: if ((newpte & PG_RW) == 0) invlva = TRUE; } - if ((om->aflags & PGA_WRITEABLE) != 0) { - CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, om); - if (TAILQ_EMPTY(&om->md.pv_list) && + if (opa != pa && (origpte & PG_MANAGED) != 0) { + CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); + pmap_pvh_free(&om->md, pmap, va); + if ((om->aflags & PGA_WRITEABLE) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) vm_page_aflag_clear(om, PGA_WRITEABLE); From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 12:13:28 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 E1718106566B; Fri, 6 Jul 2012 12:13:28 +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 CC6068FC17; Fri, 6 Jul 2012 12:13:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q66CDScK059992; Fri, 6 Jul 2012 12:13:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66CDS33059989; Fri, 6 Jul 2012 12:13:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207061213.q66CDS33059989@svn.freebsd.org> From: John Baldwin Date: Fri, 6 Jul 2012 12:13: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: r238164 - 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, 06 Jul 2012 12:13:29 -0000 Author: jhb Date: Fri Jul 6 12:13:28 2012 New Revision: 238164 URL: http://svn.freebsd.org/changeset/base/238164 Log: Add another PS/2 keyboard PNP ID. This ID is listed as "Reserved by Microsoft" in the standard PNP ID table, but has been seen in the wild on at least one laptop. PR: kern/169571 Submitted by: Matthias Apitz guru unixarea de MFC after: 3 days Modified: head/sys/dev/atkbdc/atkbdc_isa.c Modified: head/sys/dev/atkbdc/atkbdc_isa.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_isa.c Fri Jul 6 06:42:25 2012 (r238163) +++ head/sys/dev/atkbdc/atkbdc_isa.c Fri Jul 6 12:13:28 2012 (r238164) @@ -87,6 +87,7 @@ static driver_t atkbdc_isa_driver = { static struct isa_pnp_id atkbdc_ids[] = { { 0x0303d041, "Keyboard controller (i8042)" }, /* PNP0303 */ + { 0x0b03d041, "Keyboard controller (i8042)" }, /* PNP030B */ { 0x2003d041, "Keyboard controller (i8042)" }, /* PNP0320 */ { 0 } }; From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 13:21:24 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 9708B106566B; Fri, 6 Jul 2012 13:21:24 +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 68EE48FC1B; Fri, 6 Jul 2012 13:21: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 q66DLOjp062772; Fri, 6 Jul 2012 13:21:24 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66DLOQv062770; Fri, 6 Jul 2012 13:21:24 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207061321.q66DLOQv062770@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jul 2012 13:21: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: r238165 - 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: Fri, 06 Jul 2012 13:21:24 -0000 Author: emaste Date: Fri Jul 6 13:21:23 2012 New Revision: 238165 URL: http://svn.freebsd.org/changeset/base/238165 Log: Allow threads to finish up when terminated by user Set a flag and allow worker threads to finish upon ^C, instead of immediately cancelling them, so that final packet count and rate stats can be displayed. Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Fri Jul 6 12:13:28 2012 (r238164) +++ head/tools/tools/netmap/pkt-gen.c Fri Jul 6 13:21:23 2012 (r238165) @@ -191,6 +191,7 @@ struct targ { struct glob_arg *g; int used; int completed; + int cancel; int fd; struct nmreq nmr; struct netmap_if *nifp; @@ -221,15 +222,8 @@ static int global_nthreads; static void sigint_h(__unused int sig) { - for (int i = 0; i < global_nthreads; i++) { - /* cancel active threads. */ - if (targs[i].used == 0) - continue; - - D("Cancelling thread #%d\n", i); - pthread_cancel(targs[i].thread); - targs[i].used = 0; - } + for (int i = 0; i < global_nthreads; i++) + targs[i].cancel = 1; signal(SIGINT, SIG_DFL); } @@ -495,7 +489,7 @@ D("start"); void *pkt = &targ->pkt; pcap_t *p = targ->g->p; - for (i = 0; sent < n; i++) { + for (i = 0; sent < n && !targ->cancel; i++) { if (pcap_inject(p, pkt, size) != -1) sent++; if (i > 10000) { @@ -510,6 +504,8 @@ D("start"); * wait for available room in the send queue(s) */ if (poll(fds, 1, 2000) <= 0) { + if (targ->cancel) + break; D("poll error/timeout on queue %d\n", targ->me); goto quit; } @@ -518,7 +514,7 @@ D("start"); */ if (sent > 100000 && !(targ->g->options & OPT_COPY) ) options &= ~OPT_COPY; - for (i = targ->qfirst; i < targ->qlast; i++) { + for (i = targ->qfirst; i < targ->qlast && !targ->cancel; i++) { int m, limit = MIN(n - sent, targ->g->burst); txring = NETMAP_TXRING(nifp, i); @@ -529,6 +525,8 @@ D("start"); sent += m; targ->count = sent; } + if (targ->cancel) + break; } /* flush any remaining packets */ ioctl(fds[0].fd, NIOCTXSYNC, NULL); @@ -614,11 +612,11 @@ receiver_body(void *data) /* main loop, exit after 1s silence */ gettimeofday(&targ->tic, NULL); if (targ->g->use_pcap) { - for (;;) { + while (!targ->cancel) { pcap_dispatch(targ->g->p, targ->g->burst, receive_pcap, NULL); } } else { - while (1) { + while (!targ->cancel) { /* Once we started to receive packets, wait at most 1 seconds before quitting. */ if (poll(fds, 1, 1 * 1000) <= 0) { From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 14:25: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 EB2F8106566B; Fri, 6 Jul 2012 14:25: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 D490F8FC0C; Fri, 6 Jul 2012 14:25: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 q66EPx7D065411; Fri, 6 Jul 2012 14:25:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66EPxVe065409; Fri, 6 Jul 2012 14:25:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207061425.q66EPxVe065409@svn.freebsd.org> From: John Baldwin Date: Fri, 6 Jul 2012 14:25: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: r238166 - head/sys/amd64/amd64 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, 06 Jul 2012 14:26:00 -0000 Author: jhb Date: Fri Jul 6 14:25:59 2012 New Revision: 238166 URL: http://svn.freebsd.org/changeset/base/238166 Log: Several fixes to the amd64 disassembler: - Add generic support for opcodes that are escape bytes used for multi-byte opcodes (such as the 0x0f prefix). Use this to replace the hard-coded 0x0f special case and add support for three-byte opcodes that use the 0x0f38 prefix. - Decode all Intel VMX instructions. invept and invvpid in particular are three-byte opcodes that use the 0x0f38 escape prefix. - Rework how the special 'SDEP' size flag works such that the default instruction name (i_name) is the instruction when the data size prefix (0x66) is not specified, and the alternate name in i_extra is used when the prefix is included. - Add a new 'ADEP' size flag similar to 'SDEP' except that it chooses between i_name and i_extra based on the address size prefix (0x67). Use this to fix the decoding for jrcxz vs jecxz which is determined by the address size prefix, not the operand size prefix. Also, jcxz is not possible in 64-bit mode, but jrcxz is the default instruction for that opcode. - Add support for handling instructions that have a mandatory 'rep' prefix (this means not outputting the 'repe ' prefix until determining if it is used as part of an opcode). Make 'pause' less of a special case this way. - Decode 'cmpxchg16b' and 'cdqe' which are variants of other instructions but with a REX.W prefix. MFC after: 1 month Modified: head/sys/amd64/amd64/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c ============================================================================== --- head/sys/amd64/amd64/db_disasm.c Fri Jul 6 13:21:23 2012 (r238165) +++ head/sys/amd64/amd64/db_disasm.c Fri Jul 6 14:25:59 2012 (r238166) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); * Instruction disassembler. */ #include +#include #include #include @@ -47,7 +48,9 @@ __FBSDID("$FreeBSD$"); #define DBLR 5 #define EXTR 6 #define SDEP 7 -#define NONE 8 +#define ADEP 8 +#define ESC 9 +#define NONE 10 /* * REX prefix and bits @@ -67,6 +70,7 @@ __FBSDID("$FreeBSD$"); #define Eb 4 /* address, byte size */ #define R 5 /* register, in 'reg' field */ #define Rw 6 /* word register, in 'reg' field */ +#define Rq 39 /* quad register, in 'reg' field */ #define Ri 7 /* register in instruction */ #define S 8 /* segment reg, in 'reg' field */ #define Si 9 /* segment reg, in instruction */ @@ -120,6 +124,45 @@ struct finst { (or pointer to table) */ }; +static const struct inst db_inst_0f388x[] = { +/*80*/ { "", TRUE, SDEP, op2(E, Rq), "invept" }, +/*81*/ { "", TRUE, SDEP, op2(E, Rq), "invvpid" }, +/*82*/ { "", FALSE, NONE, 0, 0 }, +/*83*/ { "", FALSE, NONE, 0, 0 }, +/*84*/ { "", FALSE, NONE, 0, 0 }, +/*85*/ { "", FALSE, NONE, 0, 0 }, +/*86*/ { "", FALSE, NONE, 0, 0 }, +/*87*/ { "", FALSE, NONE, 0, 0 }, + +/*88*/ { "", FALSE, NONE, 0, 0 }, +/*89*/ { "", FALSE, NONE, 0, 0 }, +/*8a*/ { "", FALSE, NONE, 0, 0 }, +/*8b*/ { "", FALSE, NONE, 0, 0 }, +/*8c*/ { "", FALSE, NONE, 0, 0 }, +/*8d*/ { "", FALSE, NONE, 0, 0 }, +/*8e*/ { "", FALSE, NONE, 0, 0 }, +/*8f*/ { "", FALSE, NONE, 0, 0 }, +}; + +static const struct inst * const db_inst_0f38[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + db_inst_0f388x, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + static const char * const db_Grp6[] = { "sldt", "str", @@ -160,8 +203,8 @@ static const char * const db_Grp9[] = { "", "", "", - "", - "" + "vmptrld", + "vmptrst" }; static const char * const db_Grp15[] = { @@ -236,7 +279,7 @@ static const struct inst db_inst_0f3x[] /*36*/ { "", FALSE, NONE, 0, 0 }, /*37*/ { "getsec",FALSE, NONE, 0, 0 }, -/*38*/ { "", FALSE, NONE, 0, 0 }, +/*38*/ { "", FALSE, ESC, 0, db_inst_0f38 }, /*39*/ { "", FALSE, NONE, 0, 0 }, /*3a*/ { "", FALSE, NONE, 0, 0 }, /*3b*/ { "", FALSE, NONE, 0, 0 }, @@ -266,6 +309,26 @@ static const struct inst db_inst_0f4x[] /*4f*/ { "cmovnle",TRUE, NONE, op2(E, R), 0 }, }; +static const struct inst db_inst_0f7x[] = { +/*70*/ { "", FALSE, NONE, 0, 0 }, +/*71*/ { "", FALSE, NONE, 0, 0 }, +/*72*/ { "", FALSE, NONE, 0, 0 }, +/*73*/ { "", FALSE, NONE, 0, 0 }, +/*74*/ { "", FALSE, NONE, 0, 0 }, +/*75*/ { "", FALSE, NONE, 0, 0 }, +/*76*/ { "", FALSE, NONE, 0, 0 }, +/*77*/ { "", FALSE, NONE, 0, 0 }, + +/*78*/ { "vmread", TRUE, NONE, op2(Rq, E), 0 }, +/*79*/ { "vmwrite",TRUE, NONE, op2(E, Rq), 0 }, +/*7a*/ { "", FALSE, NONE, 0, 0 }, +/*7b*/ { "", FALSE, NONE, 0, 0 }, +/*7c*/ { "", FALSE, NONE, 0, 0 }, +/*7d*/ { "", FALSE, NONE, 0, 0 }, +/*7e*/ { "", FALSE, NONE, 0, 0 }, +/*7f*/ { "", FALSE, NONE, 0, 0 }, +}; + static const struct inst db_inst_0f8x[] = { /*80*/ { "jo", FALSE, NONE, op1(Dl), 0 }, /*81*/ { "jno", FALSE, NONE, op1(Dl), 0 }, @@ -373,7 +436,7 @@ static const struct inst * const db_inst db_inst_0f4x, 0, 0, - 0, + db_inst_0f7x, db_inst_0f8x, db_inst_0f9x, db_inst_0fax, @@ -582,7 +645,7 @@ static const struct inst db_inst_table[2 /*0c*/ { "or", FALSE, BYTE, op2(I, A), 0 }, /*0d*/ { "or", FALSE, LONG, op2(I, A), 0 }, /*0e*/ { "push", FALSE, NONE, op1(Si), 0 }, -/*0f*/ { "", FALSE, NONE, 0, 0 }, +/*0f*/ { "", FALSE, ESC, 0, db_inst_0f }, /*10*/ { "adc", TRUE, BYTE, op2(R, E), 0 }, /*11*/ { "adc", TRUE, LONG, op2(R, E), 0 }, @@ -738,8 +801,8 @@ static const struct inst db_inst_table[2 /*96*/ { "xchg", FALSE, LONG, op2(A, Ri), 0 }, /*97*/ { "xchg", FALSE, LONG, op2(A, Ri), 0 }, -/*98*/ { "cbw", FALSE, SDEP, 0, "cwde" }, /* cbw/cwde */ -/*99*/ { "cwd", FALSE, SDEP, 0, "cdq" }, /* cwd/cdq */ +/*98*/ { "cwde", FALSE, SDEP, 0, "cbw" }, +/*99*/ { "cdq", FALSE, SDEP, 0, "cwd" }, /*9a*/ { "lcall", FALSE, NONE, op1(OS), 0 }, /*9b*/ { "wait", FALSE, NONE, 0, 0 }, /*9c*/ { "pushf", FALSE, LONG, 0, 0 }, @@ -822,7 +885,7 @@ static const struct inst db_inst_table[2 /*e0*/ { "loopne",FALSE, NONE, op1(Db), 0 }, /*e1*/ { "loope", FALSE, NONE, op1(Db), 0 }, /*e2*/ { "loop", FALSE, NONE, op1(Db), 0 }, -/*e3*/ { "jcxz", FALSE, SDEP, op1(Db), "jecxz" }, +/*e3*/ { "jrcxz", FALSE, ADEP, op1(Db), "jecxz" }, /*e4*/ { "in", FALSE, BYTE, op2(Ib, A), 0 }, /*e5*/ { "in", FALSE, LONG, op2(Ib, A) , 0 }, /*e6*/ { "out", FALSE, BYTE, op2(A, Ib), 0 }, @@ -1208,14 +1271,6 @@ db_disasm(loc, altfmt) if (prefix) { get_value_inc(inst, loc, 1, FALSE); } - if (rep == TRUE) { - if (inst == 0x90) { - db_printf("pause\n"); - return (loc); - } - db_printf("repe "); /* XXX repe VS rep */ - rep = FALSE; - } } while (prefix); if (inst >= 0xd8 && inst <= 0xdf) { @@ -1224,9 +1279,10 @@ db_disasm(loc, altfmt) return (loc); } - if (inst == 0x0f) { + ip = &db_inst_table[inst]; + while (ip->i_size == ESC) { get_value_inc(inst, loc, 1, FALSE); - ip = db_inst_0f[inst>>4]; + ip = ((const struct inst * const *)ip->i_extra)[inst>>4]; if (ip == 0) { ip = &db_bad_inst; } @@ -1234,8 +1290,6 @@ db_disasm(loc, altfmt) ip = &ip[inst&0xf]; } } - else - ip = &db_inst_table[inst]; if (ip->i_has_modrm) { get_value_inc(regmodrm, loc, 1, FALSE); @@ -1269,6 +1323,26 @@ db_disasm(loc, altfmt) /* Special cases that don't fit well in the tables. */ if (ip->i_extra == db_Grp7 && f_mod(rex, regmodrm) == 3) { switch (regmodrm) { + case 0xc1: + i_name = "vmcall"; + i_size = NONE; + i_mode = 0; + break; + case 0xc2: + i_name = "vmlaunch"; + i_size = NONE; + i_mode = 0; + break; + case 0xc3: + i_name = "vmresume"; + i_size = NONE; + i_mode = 0; + break; + case 0xc4: + i_name = "vmxoff"; + i_size = NONE; + i_mode = 0; + break; case 0xc8: i_name = "monitor"; i_size = NONE; @@ -1307,8 +1381,42 @@ db_disasm(loc, altfmt) i_mode = 0; } + /* Handle instructions identified by mandatory prefixes. */ + if (rep == TRUE) { + if (inst == 0x90) { + i_name = "pause"; + i_size = NONE; + i_mode = 0; + rep = FALSE; + } else if (ip->i_extra == db_Grp9 && f_mod(rex, regmodrm) != 3 && + f_reg(rex, regmodrm) == 0x6) { + i_name = "vmxon"; + rep = FALSE; + } + } + if (size == WORD) { + if (ip->i_extra == db_Grp9 && f_mod(rex, regmodrm) != 3 && + f_reg(rex, regmodrm) == 0x6) { + i_name = "vmclear"; + } + } + if (rex & REX_W) { + if (strcmp(i_name, "cwde") == 0) + i_name = "cdqe"; + else if (strcmp(i_name, "cmpxchg8b") == 0) + i_name = "cmpxchg16b"; + } + + if (rep == TRUE) + db_printf("repe "); /* XXX repe VS rep */ + if (i_size == SDEP) { - if (size == WORD) + if (size == LONG) + db_printf("%s", i_name); + else + db_printf("%s", (const char *)ip->i_extra); + } else if (i_size == ADEP) { + if (short_addr == FALSE) db_printf("%s", i_name); else db_printf("%s", (const char *)ip->i_extra); @@ -1381,6 +1489,10 @@ db_disasm(loc, altfmt) db_printf("%s", db_reg[rex != 0 ? 1 : 0][WORD][f_reg(rex, regmodrm)]); break; + case Rq: + db_printf("%s", db_reg[rex != 0 ? 1 : 0][QUAD][f_reg(rex, regmodrm)]); + break; + case Ri: db_printf("%s", db_reg[0][QUAD][f_rm(rex, inst)]); break; From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 14:28:18 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 C8F1B106566B; Fri, 6 Jul 2012 14:28:18 +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 B29048FC0C; Fri, 6 Jul 2012 14:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q66ESIeT065539; Fri, 6 Jul 2012 14:28:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66ESIcB065534; Fri, 6 Jul 2012 14:28:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207061428.q66ESIcB065534@svn.freebsd.org> From: John Baldwin Date: Fri, 6 Jul 2012 14:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238167 - in head/contrib/binutils: gas/config opcodes 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, 06 Jul 2012 14:28:18 -0000 Author: jhb Date: Fri Jul 6 14:28:18 2012 New Revision: 238167 URL: http://svn.freebsd.org/changeset/base/238167 Log: Add support for the 'invept' and 'invvpid' instructions. Beyond simply adding appropriate table entries, the assembler had to be adjusted as these are the first non-SSE instructions to use a 3-byte opcode (and a mandatory prefix to boot). MFC after: 1 month Modified: head/contrib/binutils/gas/config/tc-i386.c head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/gas/config/tc-i386.c ============================================================================== --- head/contrib/binutils/gas/config/tc-i386.c Fri Jul 6 14:25:59 2012 (r238166) +++ head/contrib/binutils/gas/config/tc-i386.c Fri Jul 6 14:28:18 2012 (r238167) @@ -3990,6 +3990,16 @@ output_insn (void) goto check_prefix; } } + else if (i.tm.base_opcode == 0x660f3880 || i.tm.base_opcode == 0x660f3881) + { + /* invept and invvpid are 3 byte instructions with a + mandatory prefix. */ + if (i.tm.base_opcode & 0xff000000) + { + prefix = (i.tm.base_opcode >> 24) & 0xff; + add_prefix (prefix); + } + } else if ((i.tm.base_opcode & 0xff0000) != 0) { prefix = (i.tm.base_opcode >> 16) & 0xff; @@ -4029,6 +4039,12 @@ output_insn (void) p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; } + else if (i.tm.base_opcode == 0x660f3880 || + i.tm.base_opcode == 0x660f3881) + { + p = frag_more (3); + *p++ = (i.tm.base_opcode >> 16) & 0xff; + } else p = frag_more (2); Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Fri Jul 6 14:25:59 2012 (r238166) +++ head/contrib/binutils/opcodes/i386-dis.c Fri Jul 6 14:28:18 2012 (r238167) @@ -213,6 +213,7 @@ fetch_data (struct disassemble_info *inf #define Ew { OP_E, w_mode } #define M { OP_M, 0 } /* lea, lgdt, etc. */ #define Ma { OP_M, v_mode } +#define Mo { OP_M, o_mode } #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */ #define Mq { OP_M, q_mode } #define Gb { OP_G, b_mode } @@ -540,6 +541,8 @@ fetch_data (struct disassemble_info *inf #define PREGRP95 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 95 } } #define PREGRP96 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 96 } } #define PREGRP97 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 97 } } +#define PREGRP98 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 98 } } +#define PREGRP99 NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 99 } } #define X86_64_0 NULL, { { NULL, X86_64_SPECIAL }, { NULL, 0 } } @@ -2586,6 +2589,22 @@ static const struct dis386 prefix_user_t { "punpckldq",{ MX, EMq } }, { "(bad)", { XX } }, }, + + /* PREGRP98 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "invept", { Gm, Mo } }, + { "(bad)", { XX } }, + }, + + /* PREGRP99 */ + { + { "(bad)", { XX } }, + { "(bad)", { XX } }, + { "invvpid",{ Gm, Mo } }, + { "(bad)", { XX } }, + }, }; static const struct dis386 x86_64_table[][2] = { @@ -2755,8 +2774,8 @@ static const struct dis386 three_byte_ta { "(bad)", { XX } }, { "(bad)", { XX } }, /* 80 */ - { "(bad)", { XX } }, - { "(bad)", { XX } }, + { PREGRP98 }, + { PREGRP99 }, { "(bad)", { XX } }, { "(bad)", { XX } }, { "(bad)", { XX } }, @@ -5884,7 +5903,7 @@ static void OP_M (int bytemode, int sizeflag) { if (modrm.mod == 3) - /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */ + /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst,invept,invvpid modrm */ BadOp (); else OP_E (bytemode, sizeflag); Modified: head/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.tbl Fri Jul 6 14:25:59 2012 (r238166) +++ head/contrib/binutils/opcodes/i386-opc.tbl Fri Jul 6 14:28:18 2012 (r238167) @@ -1289,6 +1289,10 @@ mwait, 2, 0xf01, 0xc9, CpuSSE3|CpuNo64, mwait, 2, 0xf01, 0xc9, CpuSSE3|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt|NoRex64, { Reg64, Reg64 } // VMX instructions. +invept, 2, 0x660f3880, None, CpuVMX|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg32 } +invept, 2, 0x660f3880, None, CpuVMX|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } +invvpid, 2, 0x660f3881, None, CpuVMX|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg32 } +invvpid, 2, 0x660f3881, None, CpuVMX|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg64 } vmcall, 0, 0xf01, 0xc1, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } vmclear, 1, 0x660fc7, 0x6, CpuVMX, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S } vmlaunch, 0, 0xf01, 0xc2, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Fri Jul 6 14:25:59 2012 (r238166) +++ head/contrib/binutils/opcodes/i386-tbl.h Fri Jul 6 14:28:18 2012 (r238167) @@ -3625,6 +3625,22 @@ const template i386_optab[] = No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt|NoRex64, { Reg64, Reg64 } }, + { "invept", 2, 0x660f3880, None, CpuVMX|CpuNo64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg32 } }, + { "invept", 2, 0x660f3880, None, CpuVMX|Cpu64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg64 } }, + { "invvpid", 2, 0x660f3881, None, CpuVMX|CpuNo64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg32 } }, + { "invvpid", 2, 0x660f3881, None, CpuVMX|Cpu64, + Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, + { BaseIndex|Disp8|Disp16|Disp32|Disp32S, + Reg64 } }, { "vmcall", 0, 0xf01, 0xc1, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt, { 0 } }, From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 14:41:02 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 EA8A71065670; Fri, 6 Jul 2012 14:41:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52608FC08; Fri, 6 Jul 2012 14:41: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 q66Ef2hf066149; Fri, 6 Jul 2012 14:41:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66Ef2M4066144; Fri, 6 Jul 2012 14:41:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207061441.q66Ef2M4066144@svn.freebsd.org> From: Andriy Gapon Date: Fri, 6 Jul 2012 14:41: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: r238168 - in head/sys/cddl/dev/dtrace: amd64 i386 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, 06 Jul 2012 14:41:03 -0000 Author: avg Date: Fri Jul 6 14:41:02 2012 New Revision: 238168 URL: http://svn.freebsd.org/changeset/base/238168 Log: r237748 continuation: segment-override prefixes are not invalid in long mode Update DTrace disassembler accordingly. The code to treat the prefixes as null prefixes was already in place. Although in practice compilers seem to generate only cs-prefix for use in long NOPs, the same treatment is applied to all of cs, ds, es, ss for consistency. Reported by: emaste Tested by: emaste Obtained from: Illumos commit 13442:4adbe6de60c8 (+ local changes) MFC after: 5 days Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c head/sys/cddl/dev/dtrace/i386/dis_tables.c Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jul 6 14:28:18 2012 (r238167) +++ head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jul 6 14:41:02 2012 (r238168) @@ -1146,14 +1146,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), -/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNSx("%cs:",OVERRIDE), TNSx("das",NORM), +/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), Modified: head/sys/cddl/dev/dtrace/i386/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dis_tables.c Fri Jul 6 14:28:18 2012 (r238167) +++ head/sys/cddl/dev/dtrace/i386/dis_tables.c Fri Jul 6 14:41:02 2012 (r238168) @@ -1146,14 +1146,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), -/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNSx("%cs:",OVERRIDE), TNSx("das",NORM), +/* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 14:45: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 55A551065672; Fri, 6 Jul 2012 14:45:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264C98FC08; Fri, 6 Jul 2012 14:45: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 q66EjV9q066368; Fri, 6 Jul 2012 14:45:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66EjUAw066365; Fri, 6 Jul 2012 14:45:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207061445.q66EjUAw066365@svn.freebsd.org> From: Andriy Gapon Date: Fri, 6 Jul 2012 14:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238169 - in head/sys/cddl/dev/dtrace: amd64 i386 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, 06 Jul 2012 14:45:31 -0000 Author: avg Date: Fri Jul 6 14:45:30 2012 New Revision: 238169 URL: http://svn.freebsd.org/changeset/base/238169 Log: r237748 continuation: fix nopw (0f 1f) behavior with respect to modifiers To do: proper merge with Illumos vendor area. Reported by: emaste Tested by: emaste Obtained from: Illumos commit 13442:4adbe6de60c8 MFC after: 5 days Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c head/sys/cddl/dev/dtrace/i386/dis_tables.c Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jul 6 14:41:02 2012 (r238168) +++ head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jul 6 14:45:30 2012 (r238169) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), +/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, Modified: head/sys/cddl/dev/dtrace/i386/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dis_tables.c Fri Jul 6 14:41:02 2012 (r238168) +++ head/sys/cddl/dev/dtrace/i386/dis_tables.c Fri Jul 6 14:45:30 2012 (r238169) @@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TNS("nopw", M), +/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 15:07: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 7C74C1065670; Fri, 6 Jul 2012 15: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 4EDB38FC1C; Fri, 6 Jul 2012 15:07:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9F05DB99A; Fri, 6 Jul 2012 11:07:05 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 6 Jul 2012 11:03:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207061428.q66ESIcB065534@svn.freebsd.org> In-Reply-To: <201207061428.q66ESIcB065534@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201207061103.25423.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 06 Jul 2012 11:07:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r238167 - in head/contrib/binutils: gas/config opcodes 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, 06 Jul 2012 15:07:06 -0000 On Friday, July 06, 2012 10:28:18 am John Baldwin wrote: > Author: jhb > Date: Fri Jul 6 14:28:18 2012 > New Revision: 238167 > URL: http://svn.freebsd.org/changeset/base/238167 > > Log: > Add support for the 'invept' and 'invvpid' instructions. Beyond simply > adding appropriate table entries, the assembler had to be adjusted as > these are the first non-SSE instructions to use a 3-byte opcode (and a > mandatory prefix to boot). > > MFC after: 1 month To my knowledge, this allows bhyve to now be built with our in-tree toolchain. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 15:17:46 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 53A1D106566C; Fri, 6 Jul 2012 15:17:46 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 06CB58FC08; Fri, 6 Jul 2012 15:17:46 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 4773712367; Sat, 7 Jul 2012 01:17:45 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro.local (c-75-70-33-234.hsd1.co.comcast.net [75.70.33.234]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BEX53042 (AUTH peterg@ptree32.com.au); Sat, 7 Jul 2012 01:17:42 +1000 Message-ID: <4FF70194.7060105@freebsd.org> Date: Fri, 06 Jul 2012 09:17:40 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: John Baldwin References: <201207061428.q66ESIcB065534@svn.freebsd.org> <201207061103.25423.jhb@freebsd.org> In-Reply-To: <201207061103.25423.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Info: RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,SPF_SOFTFAIL X-Junkmail-Status: score=29/51, host=dommail.onthenet.com.au Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238167 - in head/contrib/binutils: gas/config opcodes 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, 06 Jul 2012 15:17:46 -0000 > To my knowledge, this allows bhyve to now be built with our in-tree toolchain. It does :) Thanks for doing this work. I'll IFC the bhyve branch and remove the Makefile changes that invoked the binutils port. later, Peter. From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 15:36: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 41BB21065678; Fri, 6 Jul 2012 15:36:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD568FC17; Fri, 6 Jul 2012 15:36:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q66FaeqR068542; Fri, 6 Jul 2012 15:36:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66FadUO068540; Fri, 6 Jul 2012 15:36:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207061536.q66FadUO068540@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jul 2012 15:36: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: r238170 - 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: Fri, 06 Jul 2012 15:36:40 -0000 Author: emaste Date: Fri Jul 6 15:36:39 2012 New Revision: 238170 URL: http://svn.freebsd.org/changeset/base/238170 Log: Also report tx bandwidth with Ethernet overhead Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Fri Jul 6 14:45:30 2012 (r238169) +++ head/tools/tools/netmap/pkt-gen.c Fri Jul 6 15:36:39 2012 (r238170) @@ -653,27 +653,41 @@ quit: return (NULL); } +static char * +scaled_val(double val) +{ + static char buf[64]; + const char *units[] = {"", "K", "M", "G"}; + int i = 0; + + while (val >= 1000 && i < 3) { + val /= 1000; + i++; + } + snprintf(buf, sizeof(buf), "%.2f%s", val, units[i]); + return (buf); +} + static void tx_output(uint64_t sent, int size, double delta) { - double amount = 8.0 * (1.0 * size * sent) / delta; + uint64_t bytes_sent = sent * size; + double bw = 8.0 * bytes_sent / delta; double pps = sent / delta; - char units[4] = { '\0', 'K', 'M', 'G' }; - int aunit = 0, punit = 0; - - while (amount >= 1000) { - amount /= 1000; - aunit += 1; - } - while (pps >= 1000) { - pps /= 1000; - punit += 1; - } + /* + * Assume Ethernet overhead of 24 bytes per packet excluding header: + * FCS 4 bytes + * Preamble 8 bytes + * IFG 12 bytes + */ + double bw_with_overhead = 8.0 * (bytes_sent + sent * 24) / delta; printf("Sent %" PRIu64 " packets, %d bytes each, in %.2f seconds.\n", sent, size, delta); - printf("Speed: %.2f%cpps. Bandwidth: %.2f%cbps.\n", - pps, units[punit], amount, units[aunit]); + printf("Speed: %spps. ", scaled_val(pps)); + printf("Bandwidth: %sbps ", scaled_val(bw)); + printf("(%sbps with overhead).\n", scaled_val(bw_with_overhead)); + } From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 15:46:39 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 99CC61065670; Fri, 6 Jul 2012 15:46:39 +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 850988FC1A; Fri, 6 Jul 2012 15:46: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 q66FkdYU068982; Fri, 6 Jul 2012 15:46:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66FkdqP068980; Fri, 6 Jul 2012 15:46:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207061546.q66FkdqP068980@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 6 Jul 2012 15:46: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: r238171 - head/sys/geom 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, 06 Jul 2012 15:46:39 -0000 Author: trasz Date: Fri Jul 6 15:46:38 2012 New Revision: 238171 URL: http://svn.freebsd.org/changeset/base/238171 Log: Fix typo in the comment. Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Jul 6 15:36:39 2012 (r238170) +++ head/sys/geom/geom_dev.c Fri Jul 6 15:46:38 2012 (r238171) @@ -497,7 +497,7 @@ g_dev_strategy(struct bio *bp) * * Called from below when the provider orphaned us. * - Clear any dump settings. - * - Destroy the struct cdev *to prevent any more request from coming in. The + * - Destroy the struct cdev to prevent any more request from coming in. The * provider is already marked with an error, so anything which comes in * in the interrim will be returned immediately. * - Wait for any outstanding I/O to finish. From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 15:57: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 9BCA41065675; Fri, 6 Jul 2012 15:57:04 +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 6EEDF8FC22; Fri, 6 Jul 2012 15:57: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 q66Fv46P069467; Fri, 6 Jul 2012 15:57:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66Fv45N069464; Fri, 6 Jul 2012 15:57:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207061557.q66Fv45N069464@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 6 Jul 2012 15:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238172 - head/sys/dev/agp 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, 06 Jul 2012 15:57:04 -0000 Author: marcel Date: Fri Jul 6 15:57:03 2012 New Revision: 238172 URL: http://svn.freebsd.org/changeset/base/238172 Log: agp.c: Don't use Maxmem when the amount of memory is meant. Use realmem instead. Maxmem is not only a MD variable, it represents the highest physical memory address in use. On systems where memory is sparsely layed-out the highest memory address and the amount of memory are not interchangeable. Scaling the AGP aperture based on the actual amount of memory (= realmem) rather than the available memory (= physmem) makes sure there's consistent behaviour across architectures. agp_i810.c: While arguably the use of Maxmem can be considered correct, replace its use with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, which have a dense physical memory layout. Avoiding Maxmem here is done with an eye on copy-n-paste behaviour in general and to avoid confusion caused by using realmem in agp.c and Maxmem in agp_i810.c. In both cases, remove the inclusion of md_var.h Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Fri Jul 6 15:46:38 2012 (r238171) +++ head/sys/dev/agp/agp.c Fri Jul 6 15:57:03 2012 (r238172) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -234,7 +233,7 @@ agp_generic_attach(device_t dev) * Work out an upper bound for agp memory allocation. This * uses a heurisitc table from the Linux driver. */ - memsize = ptoa(Maxmem) >> 20; + memsize = ptoa(realmem) >> 20; for (i = 0; i < agp_max_size; i++) { if (memsize <= agp_max[i][0]) break; Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Fri Jul 6 15:46:38 2012 (r238171) +++ head/sys/dev/agp/agp_i810.c Fri Jul 6 15:57:03 2012 (r238172) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include MALLOC_DECLARE(M_AGP); @@ -1439,7 +1438,7 @@ agp_i810_attach(device_t dev) if (error) return (error); - if (ptoa((vm_paddr_t)Maxmem) > + if (ptoa((vm_paddr_t)realmem) > (1ULL << sc->match->driver->busdma_addr_mask_sz) - 1) { device_printf(dev, "agp_i810 does not support physical " "memory above %ju.\n", (uintmax_t)(1ULL << From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 16:43:57 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 2B593106566C; Fri, 6 Jul 2012 16:43:57 +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 152578FC16; Fri, 6 Jul 2012 16:43: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 q66Ghuf3071585; Fri, 6 Jul 2012 16:43:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66Ghu9R071579; Fri, 6 Jul 2012 16:43:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207061643.q66Ghu9R071579@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 6 Jul 2012 16:43: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: r238173 - head/lib/libedit 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, 06 Jul 2012 16:43:57 -0000 Author: pfg Date: Fri Jul 6 16:43:56 2012 New Revision: 238173 URL: http://svn.freebsd.org/changeset/base/238173 Log: Fix issue resizing bin/sh This partially reverts some changes from r237448 that are causing breakage when resizing under bin/sh . Reverted changes from NetBSD are: Mar 10 20:46:15 2009 - editline.3 read.c make el_gets set the count to -1 on error to distinguish between EOF and error. Feb 19 15:20:22 2009 - read.c sig.c sig.h reset and redraw on sigcont. From Anon Ymous. Feb 15 21:24:13 2009 don't restart on EINTR, instead return NULL immediately. From Anon Ymous PR: 169603 Reported by: Peter Jeremy, David Shao MFC after: 3 days Modified: head/lib/libedit/editline.3 head/lib/libedit/el.h head/lib/libedit/read.c head/lib/libedit/sig.c head/lib/libedit/sig.h Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Fri Jul 6 15:57:03 2012 (r238172) +++ head/lib/libedit/editline.3 Fri Jul 6 16:43:56 2012 (r238173) @@ -162,11 +162,6 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. -If an error occurred, -.Fa count -is set to \-1 and -.Dv errno -contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: head/lib/libedit/el.h ============================================================================== --- head/lib/libedit/el.h Fri Jul 6 15:57:03 2012 (r238172) +++ head/lib/libedit/el.h Fri Jul 6 16:43:56 2012 (r238173) @@ -115,7 +115,6 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ - int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: head/lib/libedit/read.c ============================================================================== --- head/lib/libedit/read.c Fri Jul 6 15:57:03 2012 (r238172) +++ head/lib/libedit/read.c Fri Jul 6 16:43:56 2012 (r238173) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include "el.h" -#define OKCMD -1 /* must be -1! */ +#define OKCMD -1 private int read__fixio(int, int); private int read_preread(EditLine *); @@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e) return (e ? 0 : -1); case EINTR: - return (-1); + return (0); default: return (-1); @@ -235,12 +235,9 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; - el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ - el->el_errno = num == 0 ? 0 : errno; + if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ return (num); - } #ifdef KANJI if ((*ch & 0200)) { @@ -292,21 +289,14 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - again: - el->el_signal->sig_no = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) { - if (el->el_signal->sig_no == SIGCONT) { - sig_set(el); - el_set(el, EL_REFRESH); - goto again; - } + while ((num_read = read(el->el_infd, cp, 1)) == -1) if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - } + return (int)num_read; } @@ -413,20 +403,17 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; - int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ - if (nread == NULL) - nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { char *cp = el->el_line.buffer; size_t idx; - while ((num = (*el->el_read.read_char)(el, cp)) == 1) { + while ((*el->el_read.read_char)(el, cp) == 1) { /* make sure there is space for next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -440,16 +427,12 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } - if (num == -1) { - if (errno == EINTR) - cp = el->el_line.buffer; - el->el_errno = errno; - } el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - goto done; + if (nread) + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + return (*nread ? el->el_line.buffer : NULL); } @@ -460,8 +443,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - errno = 0; - *nread = 0; + if (nread) + *nread = 0; return (NULL); } } @@ -474,7 +457,6 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; - if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -482,7 +464,7 @@ el_gets(EditLine *el, int *nread) term__flush(el); - while ((num = (*el->el_read.read_char)(el, cp)) == 1) { + while ((*el->el_read.read_char)(el, cp) == 1) { /* make sure there is space next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -498,15 +480,11 @@ el_gets(EditLine *el, int *nread) break; } - if (num == -1) { - if (errno == EINTR) - cp = el->el_line.buffer; - el->el_errno = errno; - } - el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - goto done; + if (nread) + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + return (*nread ? el->el_line.buffer : NULL); } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -522,12 +500,6 @@ el_gets(EditLine *el, int *nread) #endif /* DEBUG_READ */ break; } - if (el->el_errno == EINTR) { - el->el_line.buffer[0] = '\0'; - el->el_line.lastchar = - el->el_line.cursor = el->el_line.buffer; - break; - } if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */ #ifdef DEBUG_EDIT (void) fprintf(el->el_errfile, @@ -645,17 +617,12 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - *nread = num != -1 ? num : 0; + if (nread) + *nread = num; } else { - *nread = (int)(el->el_line.lastchar - el->el_line.buffer); + if (nread) + *nread = + (int)(el->el_line.lastchar - el->el_line.buffer); } -done: - if (*nread == 0) { - if (num == -1) { - *nread = -1; - errno = el->el_errno; - } - return NULL; - } else - return el->el_line.buffer; + return (num ? el->el_line.buffer : NULL); } Modified: head/lib/libedit/sig.c ============================================================================== --- head/lib/libedit/sig.c Fri Jul 6 15:57:03 2012 (r238172) +++ head/lib/libedit/sig.c Fri Jul 6 16:43:56 2012 (r238173) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ + * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,8 +73,6 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); - sel->el_signal->sig_no = signo; - switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -160,12 +158,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; - nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { + nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: head/lib/libedit/sig.h ============================================================================== --- head/lib/libedit/sig.h Fri Jul 6 15:57:03 2012 (r238172) +++ head/lib/libedit/sig.h Fri Jul 6 16:43:56 2012 (r238173) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.5 2003/08/07 16:44:33 agc Exp $ + * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ * $FreeBSD$ */ @@ -61,7 +61,6 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; - volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 17:03: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 AE394106564A; Fri, 6 Jul 2012 17:03:44 +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 7F3D38FC08; Fri, 6 Jul 2012 17:03: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 q66H3inf072492; Fri, 6 Jul 2012 17:03:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66H3ix2072490; Fri, 6 Jul 2012 17:03:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207061703.q66H3ix2072490@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jul 2012 17:03: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: r238175 - 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: Fri, 06 Jul 2012 17:03:44 -0000 Author: emaste Date: Fri Jul 6 17:03:43 2012 New Revision: 238175 URL: http://svn.freebsd.org/changeset/base/238175 Log: Allow continuous packet transmission (via -t 0) Also add a missing check for the cancel flag while waiting for the first packet in receive mode. Modified: head/tools/tools/netmap/pkt-gen.c Modified: head/tools/tools/netmap/pkt-gen.c ============================================================================== --- head/tools/tools/netmap/pkt-gen.c Fri Jul 6 16:54:25 2012 (r238174) +++ head/tools/tools/netmap/pkt-gen.c Fri Jul 6 17:03:43 2012 (r238175) @@ -472,9 +472,14 @@ sender_body(void *data) struct pollfd fds[1]; struct netmap_if *nifp = targ->nifp; struct netmap_ring *txring; - int i, n = targ->g->npackets / targ->g->nthreads, sent = 0; + int i, pkts_per_td = targ->g->npackets / targ->g->nthreads, sent = 0; + int continuous = 0; int options = targ->g->options | OPT_COPY; D("start"); + if (pkts_per_td == 0) { + continuous = 1; + pkts_per_td = 100000; + } if (setaffinity(targ->thread, targ->affinity)) goto quit; /* setup poll(2) mechanism. */ @@ -489,7 +494,7 @@ D("start"); void *pkt = &targ->pkt; pcap_t *p = targ->g->p; - for (i = 0; sent < n && !targ->cancel; i++) { + for (i = 0; (sent < pkts_per_td && !targ->cancel) || continuous; i++) { if (pcap_inject(p, pkt, size) != -1) sent++; if (i > 10000) { @@ -498,7 +503,7 @@ D("start"); } } } else { - while (sent < n) { + while (sent < pkts_per_td || continuous) { /* * wait for available room in the send queue(s) @@ -515,7 +520,9 @@ D("start"); if (sent > 100000 && !(targ->g->options & OPT_COPY) ) options &= ~OPT_COPY; for (i = targ->qfirst; i < targ->qlast && !targ->cancel; i++) { - int m, limit = MIN(n - sent, targ->g->burst); + int m, limit = targ->g->burst; + if (!continuous && pkts_per_td - sent < limit) + limit = pkts_per_td - sent; txring = NETMAP_TXRING(nifp, i); if (txring->avail == 0) @@ -602,7 +609,7 @@ receiver_body(void *data) fds[0].events = (POLLIN); /* unbounded wait for the first packet. */ - for (;;) { + while (!targ->cancel) { i = poll(fds, 1, 1000); if (i > 0 && !(fds[0].revents & POLLERR)) break; @@ -716,7 +723,7 @@ usage(void) "Usage:\n" "%s arguments\n" "\t-i interface interface name\n" - "\t-t pkts_to_send also forces send mode\n" + "\t-t pkts_to_send also forces send mode, 0 = continuous\n" "\t-r pkts_to_receive also forces receive mode\n" "\t-l pkts_size in bytes excluding CRC\n" "\t-d dst-ip end with %%n to sweep n addresses\n" From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 18:12: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 DBEE91065673; Fri, 6 Jul 2012 18:12:18 +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 705E38FC0C; Fri, 6 Jul 2012 18:12:18 +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 q66ICQKm045913; Fri, 6 Jul 2012 21:12:26 +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 q66ICDRH019227; Fri, 6 Jul 2012 21:12:13 +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 q66ICDUQ019226; Fri, 6 Jul 2012 21:12:13 +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: Fri, 6 Jul 2012 21:12:13 +0300 From: Konstantin Belousov To: Marcel Moolenaar Message-ID: <20120706181213.GI2338@deviant.kiev.zoral.com.ua> References: <201207061557.q66Fv45N069464@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2xeD/fx0+7k8I/QN" Content-Disposition: inline In-Reply-To: <201207061557.q66Fv45N069464@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: r238172 - head/sys/dev/agp 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, 06 Jul 2012 18:12:19 -0000 --2xeD/fx0+7k8I/QN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 06, 2012 at 03:57:04PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Fri Jul 6 15:57:03 2012 > New Revision: 238172 > URL: http://svn.freebsd.org/changeset/base/238172 >=20 > Log: > agp.c: > Don't use Maxmem when the amount of memory is meant. Use realmem instea= d. > Maxmem is not only a MD variable, it represents the highest physical me= mory > address in use. On systems where memory is sparsely layed-out the highe= st > memory address and the amount of memory are not interchangeable. Scalin= g the > AGP aperture based on the actual amount of memory (=3D realmem) rather = than > the available memory (=3D physmem) makes sure there's consistent behavi= our > across architectures. > =20 > agp_i810.c: > While arguably the use of Maxmem can be considered correct, replace its= use > with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, which > have a dense physical memory layout. Avoiding Maxmem here is done with = an > eye on copy-n-paste behaviour in general and to avoid confusion caused = by > using realmem in agp.c and Maxmem in agp_i810.c. The agp_i810.c use is to prevent attachment when largest physical address of populated memory exceeds GPU limits established by PTE format and chipset errata. Editing Maxmem to be spelled as realmem seems to change nothing right now, but I do argue that this is wrong, and commit message makes future archeology quite confusing. > =20 > In both cases, remove the inclusion of md_var.h >=20 > Modified: > head/sys/dev/agp/agp.c > head/sys/dev/agp/agp_i810.c >=20 > Modified: head/sys/dev/agp/agp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/agp/agp.c Fri Jul 6 15:46:38 2012 (r238171) > +++ head/sys/dev/agp/agp.c Fri Jul 6 15:57:03 2012 (r238172) > @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > =20 > -#include > #include > #include > #include > @@ -234,7 +233,7 @@ agp_generic_attach(device_t dev) > * Work out an upper bound for agp memory allocation. This > * uses a heurisitc table from the Linux driver. > */ > - memsize =3D ptoa(Maxmem) >> 20; > + memsize =3D ptoa(realmem) >> 20; > for (i =3D 0; i < agp_max_size; i++) { > if (memsize <=3D agp_max[i][0]) > break; >=20 > Modified: head/sys/dev/agp/agp_i810.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/agp/agp_i810.c Fri Jul 6 15:46:38 2012 (r238171) > +++ head/sys/dev/agp/agp_i810.c Fri Jul 6 15:57:03 2012 (r238172) > @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); > =20 > #include > #include > -#include > #include > =20 > MALLOC_DECLARE(M_AGP); > @@ -1439,7 +1438,7 @@ agp_i810_attach(device_t dev) > if (error) > return (error); > =20 > - if (ptoa((vm_paddr_t)Maxmem) > > + if (ptoa((vm_paddr_t)realmem) > > (1ULL << sc->match->driver->busdma_addr_mask_sz) - 1) { > device_printf(dev, "agp_i810 does not support physical " > "memory above %ju.\n", (uintmax_t)(1ULL << --2xeD/fx0+7k8I/QN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/3KnwACgkQC3+MBN1Mb4hiKQCgn1NuIpG7znvtNOjeueP8FG1o YYYAn3SlmhlhtHbxlfti65lktViYUsbu =j6vY -----END PGP SIGNATURE----- --2xeD/fx0+7k8I/QN-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 19:30:51 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 523F91065672; Fri, 6 Jul 2012 19:30:51 +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 335328FC0C; Fri, 6 Jul 2012 19:30: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 q66JUpEM078713; Fri, 6 Jul 2012 19:30:51 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66JUphx078710; Fri, 6 Jul 2012 19:30:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207061930.q66JUphx078710@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 6 Jul 2012 19:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238178 - head/lib/libedit 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, 06 Jul 2012 19:30:51 -0000 Author: pfg Date: Fri Jul 6 19:30:50 2012 New Revision: 238178 URL: http://svn.freebsd.org/changeset/base/238178 Log: Merge a small update from NetBSD. Feb 15 21:55:23 2009 - chared.c chared.h pass lint on _LP64. MFC after: 1 week Modified: head/lib/libedit/chared.c head/lib/libedit/chared.h Modified: head/lib/libedit/chared.c ============================================================================== --- head/lib/libedit/chared.c Fri Jul 6 17:42:34 2012 (r238177) +++ head/lib/libedit/chared.c Fri Jul 6 19:30:50 2012 (r238178) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: chared.c,v 1.25 2005/08/08 01:41:30 christos Exp $ + * $NetBSD: chared.c,v 1.27 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -59,12 +59,12 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; - unsigned int size; + size_t size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; - vu->cursor = el->el_line.cursor - el->el_line.buffer; + vu->cursor = (int)(el->el_line.cursor - el->el_line.buffer); memcpy(vu->buf, el->el_line.buffer, size); /* save command info for redo */ @@ -83,7 +83,7 @@ cv_yank(EditLine *el, const char *ptr, i { c_kill_t *k = &el->el_chared.c_kill; - memcpy(k->buf, ptr, size +0u); + memcpy(k->buf, ptr, (size_t)size); k->last = k->buf + size; } @@ -97,7 +97,7 @@ c_insert(EditLine *el, int num) char *cp; if (el->el_line.lastchar + num >= el->el_line.limit) { - if (!ch_enlargebufs(el, num +0u)) + if (!ch_enlargebufs(el, (size_t)num)) return; /* can't go past end of buffer */ } @@ -118,7 +118,7 @@ c_delafter(EditLine *el, int num) { if (el->el_line.cursor + num > el->el_line.lastchar) - num = el->el_line.lastchar - el->el_line.cursor; + num = (int)(el->el_line.lastchar - el->el_line.cursor); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -159,7 +159,7 @@ c_delbefore(EditLine *el, int num) { if (el->el_line.cursor - num < el->el_line.buffer) - num = el->el_line.cursor - el->el_line.buffer; + num = (int)(el->el_line.cursor - el->el_line.buffer); if (el->el_map.current != el->el_map.emacs) { cv_undo(el); @@ -375,7 +375,7 @@ cv_delfini(EditLine *el) /* sanity */ return; - size = el->el_line.cursor - el->el_chared.c_vcmd.pos; + size = (int)(el->el_line.cursor - el->el_chared.c_vcmd.pos); if (size == 0) size = 1; el->el_line.cursor = el->el_chared.c_vcmd.pos; @@ -529,8 +529,7 @@ ch_reset(EditLine *el, int mclear) } private void -ch__clearmacro(el) - EditLine *el; +ch__clearmacro(EditLine *el) { c_macro_t *ma = &el->el_chared.c_macro; while (ma->level >= 0) @@ -542,9 +541,7 @@ ch__clearmacro(el) * Returns 1 if successful, 0 if not. */ protected int -ch_enlargebufs(el, addlen) - EditLine *el; - size_t addlen; +ch_enlargebufs(EditLine *el, size_t addlen) { size_t sz, newsz; char *newbuffer, *oldbuf, *oldkbuf; @@ -695,12 +692,12 @@ protected int c_gets(EditLine *el, char *buf, const char *prompt) { char ch; - int len; + ssize_t len; char *cp = el->el_line.buffer; if (prompt) { len = strlen(prompt); - memcpy(cp, prompt, len + 0u); + memcpy(cp, prompt, (size_t)len); cp += len; } len = 0; @@ -721,7 +718,7 @@ c_gets(EditLine *el, char *buf, const ch case '\010': /* Delete and backspace */ case '\177': - if (len <= 0) { + if (len == 0) { len = -1; break; } @@ -749,7 +746,7 @@ c_gets(EditLine *el, char *buf, const ch el->el_line.buffer[0] = '\0'; el->el_line.lastchar = el->el_line.buffer; el->el_line.cursor = el->el_line.buffer; - return len; + return (int)len; } @@ -771,6 +768,6 @@ c_hpos(EditLine *el) ptr >= el->el_line.buffer && *ptr != '\n'; ptr--) continue; - return (el->el_line.cursor - ptr - 1); + return (int)(el->el_line.cursor - ptr - 1); } } Modified: head/lib/libedit/chared.h ============================================================================== --- head/lib/libedit/chared.h Fri Jul 6 17:42:34 2012 (r238177) +++ head/lib/libedit/chared.h Fri Jul 6 19:30:50 2012 (r238178) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)chared.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: chared.h,v 1.17 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: chared.h,v 1.18 2009/02/15 21:55:23 christos Exp $ * $FreeBSD$ */ @@ -70,7 +70,7 @@ typedef struct c_macro_t { * Undo information for vi - no undo in emacs (yet) */ typedef struct c_undo_t { - int len; /* length of saved line */ + ssize_t len; /* length of saved line */ int cursor; /* position of saved cursor */ char *buf; /* full saved text */ } c_undo_t; From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 20:11: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 96796106566B; Fri, 6 Jul 2012 20:11:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 810C88FC08; Fri, 6 Jul 2012 20:11: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 q66KBxxj080426; Fri, 6 Jul 2012 20:11:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66KBx6O080424; Fri, 6 Jul 2012 20:11:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207062011.q66KBx6O080424@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 6 Jul 2012 20:11: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: r238179 - head/sys/amd64/amd64 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, 06 Jul 2012 20:11:59 -0000 Author: kib Date: Fri Jul 6 20:11:58 2012 New Revision: 238179 URL: http://svn.freebsd.org/changeset/base/238179 Log: Use assembler mnemonic instead of manually assembling, contination for r238142. Reviewed by: jhb MFC after: 1 month Modified: head/sys/amd64/amd64/cpu_switch.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Fri Jul 6 19:30:50 2012 (r238178) +++ head/sys/amd64/amd64/cpu_switch.S Fri Jul 6 20:11:58 2012 (r238179) @@ -122,8 +122,7 @@ done_store_dr: 1: movq %rdx,%rcx movl xsave_mask,%eax movl xsave_mask+4,%edx -/* xsave (%r8) */ - .byte 0x41,0x0f,0xae,0x20 + xsave (%r8) movq %rcx,%rdx 2: smsw %ax orb $CR0_TS,%al @@ -499,10 +498,8 @@ ENTRY(resumectx) movq %rax,%rdx shrq $32,%rdx movl $XCR0,%ecx -/* xsetbv */ - .byte 0x0f, 0x01, 0xd1 -/* xrstor (%rbx) */ - .byte 0x0f, 0xae, 0x2b + xsetbv + xrstor (%rbx) jmp 2f 1: fxrstor (%rbx) From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 20:13: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 985B4106566C; Fri, 6 Jul 2012 20:13:17 +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 83EDB8FC16; Fri, 6 Jul 2012 20:13: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 q66KDHhq080515; Fri, 6 Jul 2012 20:13:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66KDHUl080513; Fri, 6 Jul 2012 20:13:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207062013.q66KDHUl080513@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 6 Jul 2012 20:13: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: r238180 - 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: Fri, 06 Jul 2012 20:13:17 -0000 Author: kib Date: Fri Jul 6 20:13:16 2012 New Revision: 238180 URL: http://svn.freebsd.org/changeset/base/238180 Log: Style. Reviewed by: alc (previous version) MFC after: 1 week Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Jul 6 20:11:58 2012 (r238179) +++ head/sys/vm/vm_pageout.c Fri Jul 6 20:13:16 2012 (r238180) @@ -836,7 +836,7 @@ rescan0: object = m->object; if (!VM_OBJECT_TRYLOCK(object) && (!vm_pageout_fallback_object_lock(m, &next) || - m->hold_count != 0)) { + m->hold_count != 0)) { VM_OBJECT_UNLOCK(object); vm_page_unlock(m); addl_page_shortage++; @@ -867,8 +867,8 @@ rescan0: * level VM system not knowing anything about existing * references. */ - } else if (((m->aflags & PGA_REFERENCED) == 0) && - (actcount = pmap_ts_referenced(m))) { + } else if ((m->aflags & PGA_REFERENCED) == 0 && + (actcount = pmap_ts_referenced(m)) != 0) { vm_page_activate(m); vm_page_unlock(m); m->act_count += actcount + ACT_ADVANCE; From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 20:14:28 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 0CB7B106564A; Fri, 6 Jul 2012 20:14:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBC9D8FC16; Fri, 6 Jul 2012 20:14: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 q66KERiv080596; Fri, 6 Jul 2012 20:14:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66KERSX080594; Fri, 6 Jul 2012 20:14:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207062014.q66KERSX080594@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 6 Jul 2012 20:14: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: r238181 - head/sys/modules/em 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, 06 Jul 2012 20:14:28 -0000 Author: kib Date: Fri Jul 6 20:14:27 2012 New Revision: 238181 URL: http://svn.freebsd.org/changeset/base/238181 Log: Add a source file needed for module linking. MFC after: 4 days Modified: head/sys/modules/em/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Fri Jul 6 20:13:16 2012 (r238180) +++ head/sys/modules/em/Makefile Fri Jul 6 20:14:27 2012 (r238181) @@ -9,7 +9,7 @@ CORE_SRC = if_em.c e1000_osdep.c # undefined when using modular driver if not needed LEGACY_SRC += if_lem.c COMMON_SHARED = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c \ - e1000_manage.c e1000_vf.c e1000_mbx.c + e1000_manage.c e1000_vf.c e1000_mbx.c e1000_i210.c PCIE_SHARED = e1000_80003es2lan.c e1000_ich8lan.c e1000_82571.c e1000_82575.c LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 20:16: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 40867106564A; Fri, 6 Jul 2012 20:16:23 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 125A68FC0A; Fri, 6 Jul 2012 20:16: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 q66KGMUc080731; Fri, 6 Jul 2012 20:16:22 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66KGM1e080728; Fri, 6 Jul 2012 20:16:22 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201207062016.q66KGM1e080728@svn.freebsd.org> From: David Chisnall Date: Fri, 6 Jul 2012 20:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238182 - head/lib/libc/locale 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, 06 Jul 2012 20:16:23 -0000 Author: theraven Date: Fri Jul 6 20:16:22 2012 New Revision: 238182 URL: http://svn.freebsd.org/changeset/base/238182 Log: Restore the __collate_load_error global that was accidentally removed in the xlocale refactoring. MFC after: 1 week Modified: head/lib/libc/locale/collate.c head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Fri Jul 6 20:14:27 2012 (r238181) +++ head/lib/libc/locale/collate.c Fri Jul 6 20:16:22 2012 (r238182) @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); * We also modify the collation table test functions to search the thread-local * table first and the global table second. */ -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) #define __collate_chain_pri_table (table->__collate_chain_pri_table) +int __collate_load_error; struct xlocale_collate __xlocale_global_collate = { @@ -109,7 +109,9 @@ __collate_load(const char *encoding, loc int __collate_load_tables(const char *encoding) { - return __collate_load_tables_l(encoding, &__xlocale_global_collate); + int ret = __collate_load_tables_l(encoding, &__xlocale_global_collate); + __collate_load_error = __xlocale_global_collate.__collate_load_error; + return ret; } int @@ -123,7 +125,7 @@ __collate_load_tables_l(const char *enco /* 'encoding' must be already checked. */ if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { - __collate_load_error = 1; + table->__collate_load_error = 1; return (_LDP_CACHE); } @@ -240,7 +242,7 @@ __collate_load_tables_l(const char *enco break; } } - __collate_load_error = 0; + table->__collate_load_error = 0; return (_LDP_LOADED); } Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Fri Jul 6 20:14:27 2012 (r238181) +++ head/lib/libc/locale/setrunelocale.c Fri Jul 6 20:16:22 2012 (r238182) @@ -67,7 +67,6 @@ extern _RuneLocale *_Read_RuneMagi(FILE static int __setrunelocale(struct xlocale_ctype *l, const char *); -#define __collate_load_error (table->__collate_load_error) #define __collate_substitute_nontrivial (table->__collate_substitute_nontrivial) #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr) #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr) From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 21:15: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 4A8721065670; Fri, 6 Jul 2012 21:15:52 +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 A30F18FC0C; Fri, 6 Jul 2012 21:15:51 +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 q66LFr8M092016; Sat, 7 Jul 2012 00:15:54 +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 q66LFTCm020614; Sat, 7 Jul 2012 00:15:29 +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 q66LFTFD020613; Sat, 7 Jul 2012 00:15:29 +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: Sat, 7 Jul 2012 00:15:29 +0300 From: Konstantin Belousov To: David Chisnall Message-ID: <20120706211529.GP2338@deviant.kiev.zoral.com.ua> References: <201207062016.q66KGM1e080728@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6sj9mcRtP+pTWLOo" Content-Disposition: inline In-Reply-To: <201207062016.q66KGM1e080728@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: r238182 - head/lib/libc/locale 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, 06 Jul 2012 21:15:52 -0000 --6sj9mcRtP+pTWLOo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 06, 2012 at 08:16:22PM +0000, David Chisnall wrote: > Author: theraven > Date: Fri Jul 6 20:16:22 2012 > New Revision: 238182 > URL: http://svn.freebsd.org/changeset/base/238182 >=20 > Log: > Restore the __collate_load_error global that was accidentally removed i= n the > xlocale refactoring. > =20 I think this commit is wrong, or at least not complete. You failed to restore the actual export of the symbol in locale/Symbol.map. > MFC after: 1 week >=20 > Modified: > head/lib/libc/locale/collate.c > head/lib/libc/locale/setrunelocale.c >=20 > Modified: head/lib/libc/locale/collate.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/libc/locale/collate.c Fri Jul 6 20:14:27 2012 (r238181) > +++ head/lib/libc/locale/collate.c Fri Jul 6 20:16:22 2012 (r238182) > @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); > * We also modify the collation table test functions to search the threa= d-local > * table first and the global table second. =20 > */ > -#define __collate_load_error (table->__collate_load_error) > #define __collate_substitute_nontrivial (table->__collate_substitute_non= trivial) > #define __collate_substitute_table_ptr (table->__collate_substitute_tabl= e_ptr) > #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_pt= r) > #define __collate_chain_pri_table (table->__collate_chain_pri_table) > +int __collate_load_error; > =20 > =20 > struct xlocale_collate __xlocale_global_collate =3D { > @@ -109,7 +109,9 @@ __collate_load(const char *encoding, loc > int > __collate_load_tables(const char *encoding) > { > - return __collate_load_tables_l(encoding, &__xlocale_global_collate); > + int ret =3D __collate_load_tables_l(encoding, &__xlocale_global_collate= ); > + __collate_load_error =3D __xlocale_global_collate.__collate_load_error; > + return ret; > } > =20 > int > @@ -123,7 +125,7 @@ __collate_load_tables_l(const char *enco > =20 > /* 'encoding' must be already checked. */ > if (strcmp(encoding, "C") =3D=3D 0 || strcmp(encoding, "POSIX") =3D=3D = 0) { > - __collate_load_error =3D 1; > + table->__collate_load_error =3D 1; > return (_LDP_CACHE); > } > =20 > @@ -240,7 +242,7 @@ __collate_load_tables_l(const char *enco > break; > } > } > - __collate_load_error =3D 0; > + table->__collate_load_error =3D 0; > =20 > return (_LDP_LOADED); > } >=20 > Modified: head/lib/libc/locale/setrunelocale.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/libc/locale/setrunelocale.c Fri Jul 6 20:14:27 2012 (r23818= 1) > +++ head/lib/libc/locale/setrunelocale.c Fri Jul 6 20:16:22 2012 (r23818= 2) > @@ -67,7 +67,6 @@ extern _RuneLocale *_Read_RuneMagi(FILE=20 > =20 > static int __setrunelocale(struct xlocale_ctype *l, const char *); > =20 > -#define __collate_load_error (table->__collate_load_error) > #define __collate_substitute_nontrivial (table->__collate_substitute_non= trivial) > #define __collate_substitute_table_ptr (table->__collate_substitute_tabl= e_ptr) > #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_pt= r) --6sj9mcRtP+pTWLOo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/3VXEACgkQC3+MBN1Mb4hHSwCgpOdnsvvLxZzBs0v9slSvQS2L fHQAniKUVEcsgXI/zJ3zhMCizl3tYHlt =1uTx -----END PGP SIGNATURE----- --6sj9mcRtP+pTWLOo-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 21:24:01 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 86B7B106564A; Fri, 6 Jul 2012 21:24:01 +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 D88918FC0C; Fri, 6 Jul 2012 21:24:00 +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 q66LNjGg097148; Sat, 7 Jul 2012 00:23: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 q66LNWb0020674; Sat, 7 Jul 2012 00:23:32 +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 q66LNW85020673; Sat, 7 Jul 2012 00:23:32 +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: Sat, 7 Jul 2012 00:23:32 +0300 From: Konstantin Belousov To: David Chisnall Message-ID: <20120706212332.GQ2338@deviant.kiev.zoral.com.ua> References: <201207062016.q66KGM1e080728@svn.freebsd.org> <20120706211529.GP2338@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V2tfspbppmK1TQo2" Content-Disposition: inline In-Reply-To: <20120706211529.GP2338@deviant.kiev.zoral.com.ua> 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: r238182 - head/lib/libc/locale 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, 06 Jul 2012 21:24:01 -0000 --V2tfspbppmK1TQo2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 07, 2012 at 12:15:29AM +0300, Konstantin Belousov wrote: > On Fri, Jul 06, 2012 at 08:16:22PM +0000, David Chisnall wrote: > > Author: theraven > > Date: Fri Jul 6 20:16:22 2012 > > New Revision: 238182 > > URL: http://svn.freebsd.org/changeset/base/238182 > >=20 > > Log: > > Restore the __collate_load_error global that was accidentally removed= in the > > xlocale refactoring. > > =20 > I think this commit is wrong, or at least not complete. > You failed to restore the actual export of the symbol in locale/Symbol.ma= p. I stay corrected: the symbol _is_ present in the Symbol.map, sorry. But it is located in the private version definition, which was the reason that I did not noticed it, and which changes the status of commit from "incomplete" to "unneccessary". We do not guarantee anything about private symbols. Most likely, it is application error to link to this symbol. If application use for it is legitimate, then the symbol shall be moved to FBSD_1.3 version. --V2tfspbppmK1TQo2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/3V1QACgkQC3+MBN1Mb4j1lACghUBU18OTXaSiibHOX00ULEVz pUYAnjGD6XJaCsqsUMy9j31FqDz2Y6Y2 =sSkP -----END PGP SIGNATURE----- --V2tfspbppmK1TQo2-- From owner-svn-src-head@FreeBSD.ORG Fri Jul 6 23:17: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 3D344106564A; Fri, 6 Jul 2012 23:17:31 +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 283F68FC08; Fri, 6 Jul 2012 23:17: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 q66NHVRa089059; Fri, 6 Jul 2012 23:17:31 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q66NHUb4089057; Fri, 6 Jul 2012 23:17:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207062317.q66NHUb4089057@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jul 2012 23:17: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: r238183 - 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: Fri, 06 Jul 2012 23:17:31 -0000 Author: emaste Date: Fri Jul 6 23:17:30 2012 New Revision: 238183 URL: http://svn.freebsd.org/changeset/base/238183 Log: Implement SIOCGIFMEDIA for if_tap(4) Appease certain if_tap(4) consumers by providing simulated Ethernet media status. DragonFly commit 70d9a675bf5441cc854a843ead702d08928c37f3 Obtained from: DragonFly BSD Modified: head/sys/net/if_tap.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Fri Jul 6 20:16:22 2012 (r238182) +++ head/sys/net/if_tap.c Fri Jul 6 23:17:30 2012 (r238183) @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -602,7 +603,8 @@ tapifioctl(struct ifnet *ifp, u_long cmd struct tap_softc *tp = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; - int dummy; + struct ifmediareq *ifmr = NULL; + int dummy, error = 0; switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ @@ -610,6 +612,22 @@ tapifioctl(struct ifnet *ifp, u_long cmd case SIOCDELMULTI: break; + case SIOCGIFMEDIA: + ifmr = (struct ifmediareq *)data; + dummy = ifmr->ifm_count; + ifmr->ifm_count = 1; + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER; + if (tp->tap_flags & TAP_OPEN) + ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_current = ifmr->ifm_active; + if (dummy >= 1) { + int media = IFM_ETHER; + error = copyout(&media, ifmr->ifm_ulist, + sizeof(int)); + } + break; + case SIOCSIFMTU: ifp->if_mtu = ifr->ifr_mtu; break; @@ -626,11 +644,11 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; default: - return (ether_ioctl(ifp, cmd, data)); - /* NOT REACHED */ + error = ether_ioctl(ifp, cmd, data); + break; } - return (0); + return (error); } /* tapifioctl */ From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 00:25:18 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 5DDA0106564A; Sat, 7 Jul 2012 00:25:18 +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 45F428FC08; Sat, 7 Jul 2012 00:25:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q670PIwx093312; Sat, 7 Jul 2012 00:25:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q670PITR093305; Sat, 7 Jul 2012 00:25:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207070025.q670PITR093305@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 7 Jul 2012 00:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238184 - in head/sys: conf ia64/ia64 ia64/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: Sat, 07 Jul 2012 00:25:18 -0000 Author: marcel Date: Sat Jul 7 00:25:17 2012 New Revision: 238184 URL: http://svn.freebsd.org/changeset/base/238184 Log: Hide the creation of phys_avail behind an API to make it easier to do it correctly. We now iterate the EFI memory descriptors once and collect all the information in a single pass. This includes: 1. The I/O port base address, 2. The PAL memory region. Have the physmem API track this. 3. Memory descriptors of memory we can't use, like bad memory, runtime services code & data, etc. Have the physmem API track these. 4. memory descriptors of memory we can use or re-use, such as free memory, boot time services code & data, loader code & data, etc. These are added by the physmem API. Since the PBVM page table and pages are in memory described as loader data, inform the physmem API of chunks that need to be delated from the available physical memory. While here, remove Maxmem and replace it with the better named paddr_max. Maxmem was defined as physmem, which is generally wrong. Now, paddr_max is properly defined as the largesty physical address. The upshot of all this is that: 1. We properly determine realmem. 2. We maximize physmem by re-using memory where possible. 3. We remove complexity from ia64_init() in machdep.c. 4. Remove confusion about realmem, physmem & Maxmem. The new ia64_physmem_alloc() is to replace pmap_steal_memory() in pmap.c, as well as replace the handcrafted allocation of the VHPT for the BSP in pmap_bootstrap() in pmap.c. This is step 2 and addresses the manipulation of phys_avail after it is being created. Added: head/sys/ia64/ia64/physmem.c (contents, props changed) Modified: head/sys/conf/files.ia64 head/sys/ia64/ia64/busdma_machdep.c head/sys/ia64/ia64/machdep.c head/sys/ia64/include/md_var.h head/sys/ia64/include/param.h Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Fri Jul 6 23:17:30 2012 (r238183) +++ head/sys/conf/files.ia64 Sat Jul 7 00:25:17 2012 (r238184) @@ -98,6 +98,7 @@ ia64/ia64/mp_machdep.c optional smp ia64/ia64/nexus.c standard ia64/ia64/pal.S standard ia64/ia64/physical.S standard +ia64/ia64/physmem.c standard ia64/ia64/pmap.c standard ia64/ia64/ptrace_machdep.c standard ia64/ia64/sal.c standard Modified: head/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- head/sys/ia64/ia64/busdma_machdep.c Fri Jul 6 23:17:30 2012 (r238183) +++ head/sys/ia64/ia64/busdma_machdep.c Sat Jul 7 00:25:17 2012 (r238184) @@ -262,7 +262,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, atomic_add_int(&parent->ref_count, 1); } - if (newtag->lowaddr < ptoa(Maxmem) && (flags & BUS_DMA_ALLOCNOW) != 0) { + if (newtag->lowaddr < paddr_max && (flags & BUS_DMA_ALLOCNOW) != 0) { /* Must bounce */ if (ptoa(total_bpages) < maxsize) { @@ -340,7 +340,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->lowaddr < ptoa(Maxmem)) { + if (dmat->lowaddr < paddr_max) { /* Must bounce */ int maxpages; @@ -356,7 +356,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * Attempt to add pages to our pool on a per-instance * basis up to a sane limit. */ - maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->lowaddr)); + maxpages = MIN(MAX_BPAGES, atop(paddr_max - dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || (dmat->map_count > 0 && total_bpages < maxpages)) { int pages; @@ -438,7 +438,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi */ if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa(Maxmem)) { + dmat->lowaddr >= paddr_max) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); } else { /* @@ -473,7 +473,7 @@ bus_dmamem_free(bus_dma_tag_t dmat, void panic("bus_dmamem_free: Invalid map freed\n"); if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa(Maxmem)) + dmat->lowaddr >= paddr_max) free(vaddr, M_DEVBUF); else { contigfree(vaddr, dmat->maxsize, M_DEVBUF); @@ -506,7 +506,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm else pmap = NULL; - if ((dmat->lowaddr < ptoa(Maxmem) || dmat->boundary > 0 || + if ((dmat->lowaddr < paddr_max || dmat->boundary > 0 || dmat->alignment > 1) && map != &nobounce_dmamap && map->pagesneeded == 0) { vm_offset_t vendaddr; Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Fri Jul 6 23:17:30 2012 (r238183) +++ head/sys/ia64/ia64/machdep.c Sat Jul 7 00:25:17 2012 (r238184) @@ -152,22 +152,11 @@ SYSCTL_STRING(_hw, OID_AUTO, family, CTL extern vm_offset_t ksym_start, ksym_end; #endif - struct msgbuf *msgbufp = NULL; /* Other subsystems (e.g., ACPI) can hook this later. */ void (*cpu_idle_hook)(void) = NULL; -long Maxmem = 0; -long realmem = 0; - -#define PHYSMAP_SIZE (2 * VM_PHYSSEG_MAX) - -vm_paddr_t phys_avail[PHYSMAP_SIZE + 2]; - -/* must be 2 less so 0 0 can signal end of chunks */ -#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) - struct kva_md_info kmi; #define Mhz 1000000L @@ -270,25 +259,8 @@ cpu_startup(void *dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ld (%ld MB)\n", ia64_ptob(Maxmem), - ia64_ptob(Maxmem) / 1048576); - realmem = Maxmem; - - /* - * Display any holes after the first chunk of extended memory. - */ - if (bootverbose) { - int indx; - - printf("Physical memory chunk(s):\n"); - for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - long size1 = phys_avail[indx + 1] - phys_avail[indx]; - - printf("0x%08lx - 0x%08lx, %ld bytes (%ld pages)\n", - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 >> PAGE_SHIFT); - } - } + printf("real memory = %ld (%ld MB)\n", ptoa(realmem), + ptoa(realmem) / 1048576); vm_ksubmap_init(&kmi); @@ -700,43 +672,87 @@ struct ia64_init_return ia64_init(void) { struct ia64_init_return ret; - int phys_avail_cnt; - vm_offset_t kernstart, kernend; - vm_offset_t kernstartpfn, kernendpfn, pfn0, pfn1; - char *p; struct efi_md *md; + pt_entry_t *pbvm_pgtbl_ent, *pbvm_pgtbl_lim; + char *p; + vm_offset_t kernend; + vm_size_t mdlen; int metadata_missing; - /* NO OUTPUT ALLOWED UNTIL FURTHER NOTICE */ - /* - * TODO: Disable interrupts, floating point etc. - * Maybe flush cache and tlb + * NO OUTPUT ALLOWED UNTIL FURTHER NOTICE. */ + ia64_set_fpsr(IA64_FPSR_DEFAULT); /* - * TODO: Get critical system information (if possible, from the - * information provided by the boot program). + * Region 6 is direct mapped UC and region 7 is direct mapped + * WC. The details of this is controlled by the Alt {I,D}TLB + * handlers. Here we just make sure that they have the largest + * possible page size to minimise TLB usage. */ + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_srlz_d(); + + /* Initialize/setup physical memory datastructures */ + ia64_physmem_init(); /* - * Look for the I/O ports first - we need them for console - * probing. + * Process the memory map. This gives us the PAL locations, + * the I/O port base address, the available memory regions + * for initializing the physical memory map. */ for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) { + mdlen = md->md_pages * EFI_PAGE_SIZE; switch (md->md_type) { case EFI_MD_TYPE_IOPORT: ia64_port_base = (uintptr_t)pmap_mapdev(md->md_phys, - md->md_pages * EFI_PAGE_SIZE); + mdlen); break; case EFI_MD_TYPE_PALCODE: - ia64_pal_size = md->md_pages * EFI_PAGE_SIZE; ia64_pal_base = md->md_phys; + ia64_pal_size = mdlen; + /*FALLTHROUGH*/ + case EFI_MD_TYPE_BAD: + case EFI_MD_TYPE_FIRMWARE: + case EFI_MD_TYPE_RECLAIM: + case EFI_MD_TYPE_RT_CODE: + case EFI_MD_TYPE_RT_DATA: + /* Don't use these memory regions. */ + ia64_physmem_track(md->md_phys, mdlen); + break; + case EFI_MD_TYPE_BS_CODE: + case EFI_MD_TYPE_BS_DATA: + case EFI_MD_TYPE_CODE: + case EFI_MD_TYPE_DATA: + case EFI_MD_TYPE_FREE: + /* These are ok to use. */ + ia64_physmem_add(md->md_phys, mdlen); break; } } + /* + * Remove the PBVM and its page table from phys_avail. The loader + * passes the physical address of the page table to us. The virtual + * address of the page table is fixed. + * Track and the PBVM limit for later use. + */ + ia64_physmem_delete(bootinfo->bi_pbvm_pgtbl, bootinfo->bi_pbvm_pgtblsz); + pbvm_pgtbl_ent = (void *)IA64_PBVM_PGTBL; + pbvm_pgtbl_lim = (void *)(IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz); + while (pbvm_pgtbl_ent < pbvm_pgtbl_lim) { + if ((*pbvm_pgtbl_ent & PTE_PRESENT) == 0) + break; + ia64_physmem_delete(*pbvm_pgtbl_ent & PTE_PPN_MASK, + IA64_PBVM_PAGE_SIZE); + pbvm_pgtbl_ent++; + } + + /* Finalize physical memory datastructures */ + ia64_physmem_fini(); + metadata_missing = 0; if (bootinfo->bi_modulep) preload_metadata = (caddr_t)bootinfo->bi_modulep; @@ -757,9 +773,8 @@ ia64_init(void) bootverbose = 1; /* - * Find the beginning and end of the kernel. + * Find the end of the kernel. */ - kernstart = trunc_page(kernel_text); #ifdef DDB ksym_start = bootinfo->bi_symtab; ksym_end = bootinfo->bi_esymtab; @@ -772,16 +787,6 @@ ia64_init(void) kernend = round_page(bootinfo->bi_kernend); /* - * Region 6 is direct mapped UC and region 7 is direct mapped - * WC. The details of this is controlled by the Alt {I,D}TLB - * handlers. Here we just make sure that they have the largest - * possible page size to minimise TLB usage. - */ - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); - ia64_srlz_d(); - - /* * Wire things up so we can call the firmware. */ map_pal_code(); @@ -828,92 +833,6 @@ ia64_init(void) freeenv(p); } - kernstartpfn = atop(IA64_RR_MASK(kernstart)); - kernendpfn = atop(IA64_RR_MASK(kernend)); - - /* - * Size the memory regions and load phys_avail[] with the results. - */ - - /* - * Find out how much memory is available, by looking at - * the memory descriptors. - */ - -#ifdef DEBUG_MD - printf("Memory descriptor count: %d\n", mdcount); -#endif - - phys_avail_cnt = 0; - for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) { -#ifdef DEBUG_MD - printf("MD %p: type %d pa 0x%lx cnt 0x%lx\n", md, - md->md_type, md->md_phys, md->md_pages); -#endif - - pfn0 = ia64_btop(round_page(md->md_phys)); - pfn1 = ia64_btop(trunc_page(md->md_phys + md->md_pages * 4096)); - if (pfn1 <= pfn0) - continue; - - if (md->md_type != EFI_MD_TYPE_FREE) - continue; - - /* - * We have a memory descriptor that describes conventional - * memory that is for general use. We must determine if the - * loader has put the kernel in this region. - */ - physmem += (pfn1 - pfn0); - if (pfn0 <= kernendpfn && kernstartpfn <= pfn1) { - /* - * Must compute the location of the kernel - * within the segment. - */ -#ifdef DEBUG_MD - printf("Descriptor %p contains kernel\n", mp); -#endif - if (pfn0 < kernstartpfn) { - /* - * There is a chunk before the kernel. - */ -#ifdef DEBUG_MD - printf("Loading chunk before kernel: " - "0x%lx / 0x%lx\n", pfn0, kernstartpfn); -#endif - phys_avail[phys_avail_cnt] = ia64_ptob(pfn0); - phys_avail[phys_avail_cnt+1] = ia64_ptob(kernstartpfn); - phys_avail_cnt += 2; - } - if (kernendpfn < pfn1) { - /* - * There is a chunk after the kernel. - */ -#ifdef DEBUG_MD - printf("Loading chunk after kernel: " - "0x%lx / 0x%lx\n", kernendpfn, pfn1); -#endif - phys_avail[phys_avail_cnt] = ia64_ptob(kernendpfn); - phys_avail[phys_avail_cnt+1] = ia64_ptob(pfn1); - phys_avail_cnt += 2; - } - } else { - /* - * Just load this cluster as one chunk. - */ -#ifdef DEBUG_MD - printf("Loading descriptor %d: 0x%lx / 0x%lx\n", i, - pfn0, pfn1); -#endif - phys_avail[phys_avail_cnt] = ia64_ptob(pfn0); - phys_avail[phys_avail_cnt+1] = ia64_ptob(pfn1); - phys_avail_cnt += 2; - - } - } - phys_avail[phys_avail_cnt] = 0; - - Maxmem = physmem; init_param2(physmem); /* Added: head/sys/ia64/ia64/physmem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ia64/ia64/physmem.c Sat Jul 7 00:25:17 2012 (r238184) @@ -0,0 +1,195 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +static u_int phys_avail_segs; + +vm_paddr_t phys_avail[2 * VM_PHYSSEG_MAX + 2]; + +vm_paddr_t paddr_max; + +long realmem; + +static u_int +ia64_physmem_find(vm_paddr_t base, vm_paddr_t lim) +{ + u_int idx; + + for (idx = 0; phys_avail[idx + 1] != 0; idx += 2) { + if (phys_avail[idx] >= lim || + phys_avail[idx + 1] > base) + break; + } + return (idx); +} + +static int +ia64_physmem_insert(u_int idx, vm_paddr_t base, vm_paddr_t lim) +{ + u_int ridx; + + if (phys_avail_segs == VM_PHYSSEG_MAX) + return (ENOMEM); + + ridx = phys_avail_segs * 2; + while (idx < ridx) { + phys_avail[ridx + 1] = phys_avail[ridx - 1]; + phys_avail[ridx] = phys_avail[ridx - 2]; + ridx -= 2; + } + phys_avail[idx] = base; + phys_avail[idx + 1] = lim; + phys_avail_segs++; + return (0); +} + +static int +ia64_physmem_remove(u_int idx) +{ + + if (phys_avail_segs == 0) + return (ENOENT); + do { + phys_avail[idx] = phys_avail[idx + 2]; + phys_avail[idx + 1] = phys_avail[idx + 3]; + idx += 2; + } while (phys_avail[idx + 1] != 0); + phys_avail_segs--; + return (0); +} + +int +ia64_physmem_add(vm_paddr_t base, vm_size_t len) +{ + vm_paddr_t lim; + u_int idx; + + realmem += len; + + lim = base + len; + idx = ia64_physmem_find(base, lim); + if (phys_avail[idx] == lim) { + phys_avail[idx] = base; + return (0); + } + if (idx > 0 && phys_avail[idx - 1] == base) { + phys_avail[idx - 1] = lim; + return (0); + } + return (ia64_physmem_insert(idx, base, lim)); +} + +int +ia64_physmem_delete(vm_paddr_t base, vm_size_t len) +{ + vm_paddr_t lim; + u_int idx; + + lim = base + len; + idx = ia64_physmem_find(base, lim); + if (phys_avail[idx] >= lim || phys_avail[idx + 1] == 0) + return (ENOENT); + if (phys_avail[idx] < base && phys_avail[idx + 1] > lim) { + len = phys_avail[idx + 1] - lim; + phys_avail[idx + 1] = base; + base = lim; + lim = base + len; + return (ia64_physmem_insert(idx + 2, base, lim)); + } else { + if (phys_avail[idx] == base) + phys_avail[idx] = lim; + if (phys_avail[idx + 1] == lim) + phys_avail[idx + 1] = base; + if (phys_avail[idx] >= phys_avail[idx + 1]) + return (ia64_physmem_remove(idx)); + } + return (0); +} + +int +ia64_physmem_fini(void) +{ + vm_paddr_t base, lim, size; + u_int idx; + + idx = 0; + while (phys_avail[idx + 1] != 0) { + base = round_page(phys_avail[idx]); + lim = trunc_page(phys_avail[idx + 1]); + if (base < lim) { + phys_avail[idx] = base; + phys_avail[idx + 1] = lim; + size = lim - base; + physmem += atop(size); + paddr_max = lim; + idx += 2; + } else + ia64_physmem_remove(idx); + } + + /* + * Round realmem to a multple of 128MB. Hopefully that compensates + * for any loss of DRAM that isn't accounted for in the memory map. + * I'm thinking legacy BIOS or VGA here. In any case, it's ok if + * we got it wrong, because we don't actually use realmem. It's + * just for show... + */ + size = 1U << 27; + realmem = (realmem + size - 1) & ~(size - 1); + realmem = atop(realmem); + return (0); +} + +int +ia64_physmem_init(void) +{ + + /* Nothing to do just yet. */ + return (0); +} + +int +ia64_physmem_track(vm_paddr_t base, vm_size_t len) +{ + + realmem += len; + return (0); +} + +vm_paddr_t +ia64_physmem_alloc(vm_size_t len, vm_size_t align) +{ + + return (0); +} Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Fri Jul 6 23:17:30 2012 (r238183) +++ head/sys/ia64/include/md_var.h Sat Jul 7 00:25:17 2012 (r238184) @@ -73,8 +73,7 @@ struct ia64_init_return { }; extern uint64_t ia64_lapic_addr; - -extern long Maxmem; +extern vm_paddr_t paddr_max; extern u_int busdma_swi_pending; void *acpi_find_table(const char *sig); @@ -93,6 +92,12 @@ int ia64_highfp_save(struct thread *); int ia64_highfp_save_ipi(void); struct ia64_init_return ia64_init(void); u_int ia64_itc_freq(void); +int ia64_physmem_add(vm_paddr_t, vm_size_t); +vm_paddr_t ia64_physmem_alloc(vm_size_t, vm_size_t); +int ia64_physmem_delete(vm_paddr_t, vm_size_t); +int ia64_physmem_fini(void); +int ia64_physmem_init(void); +int ia64_physmem_track(vm_paddr_t, vm_size_t); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); void interrupt(struct trapframe *); Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Fri Jul 6 23:17:30 2012 (r238183) +++ head/sys/ia64/include/param.h Sat Jul 7 00:25:17 2012 (r238184) @@ -110,9 +110,6 @@ #define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) -#define ia64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ia64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) - #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) #endif /* !_IA64_INCLUDE_PARAM_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 01:12: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 A82E2106566B; Sat, 7 Jul 2012 01:12:10 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7AE8FC0A; Sat, 7 Jul 2012 01:12:10 +0000 (UTC) Received: from dhcp-192-168-2-58.wifi.xcllnt.net (wifi.xcllnt.net [70.36.220.6] (may be forged)) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q671Bt2Y056896 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 6 Jul 2012 18:12:03 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120706181213.GI2338@deviant.kiev.zoral.com.ua> Date: Fri, 6 Jul 2012 18:11:56 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201207061557.q66Fv45N069464@svn.freebsd.org> <20120706181213.GI2338@deviant.kiev.zoral.com.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r238172 - head/sys/dev/agp 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, 07 Jul 2012 01:12:10 -0000 On Jul 6, 2012, at 11:12 AM, Konstantin Belousov wrote: >> agp_i810.c: >> While arguably the use of Maxmem can be considered correct, replace = its use >> with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, = which >> have a dense physical memory layout. Avoiding Maxmem here is done = with an >> eye on copy-n-paste behaviour in general and to avoid confusion = caused by >> using realmem in agp.c and Maxmem in agp_i810.c. > The agp_i810.c use is to prevent attachment when largest physical = address > of populated memory exceeds GPU limits established by PTE format and > chipset errata. Editing Maxmem to be spelled as realmem seems to = change > nothing right now, but I do argue that this is wrong, and commit = message > makes future archeology quite confusing. The commit log states it all, including how one can arguably call the = change wrong. What exactly is confusing? --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 04:14: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 67DBB1065670; Sat, 7 Jul 2012 04:14:29 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 531698FC19; Sat, 7 Jul 2012 04:14: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 q674ETMZ010786; Sat, 7 Jul 2012 04:14:29 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q674ETpZ010784; Sat, 7 Jul 2012 04:14:29 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201207070414.q674ETpZ010784@svn.freebsd.org> From: Tim Kientzle Date: Sat, 7 Jul 2012 04:14: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: r238185 - head/usr.bin/mkesdb 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, 07 Jul 2012 04:14:29 -0000 Author: kientzle Date: Sat Jul 7 04:14:28 2012 New Revision: 238185 URL: http://svn.freebsd.org/changeset/base/238185 Log: Unbreak building WITH_ICONV=yes and new yacc. Modified: head/usr.bin/mkesdb/ldef.h Modified: head/usr.bin/mkesdb/ldef.h ============================================================================== --- head/usr.bin/mkesdb/ldef.h Sat Jul 7 00:25:17 2012 (r238184) +++ head/usr.bin/mkesdb/ldef.h Sat Jul 7 04:14:28 2012 (r238185) @@ -30,7 +30,6 @@ extern int line_number; extern int yyerror(const char *); extern int yylex(void); -extern int yyparse(void); struct named_csid { STAILQ_ENTRY(named_csid) ci_entry; From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 04:49: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 166321065672; Sat, 7 Jul 2012 04:49:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 005358FC0A; Sat, 7 Jul 2012 04:49: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 q674nr6G013612; Sat, 7 Jul 2012 04:49:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q674nrK7013610; Sat, 7 Jul 2012 04:49:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207070449.q674nrK7013610@svn.freebsd.org> From: Warner Losh Date: Sat, 7 Jul 2012 04:49: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: r238186 - head/sys/boot/arm/at91 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, 07 Jul 2012 04:49:54 -0000 Author: imp Date: Sat Jul 7 04:49:53 2012 New Revision: 238186 URL: http://svn.freebsd.org/changeset/base/238186 Log: Strip out the useless junk. All we really care about is the text, data and bss sections. All the rest is needed for normal binaries, but boot loaders aren't normal. Modified: head/sys/boot/arm/at91/linker.cfg Modified: head/sys/boot/arm/at91/linker.cfg ============================================================================== --- head/sys/boot/arm/at91/linker.cfg Sat Jul 7 04:14:28 2012 (r238185) +++ head/sys/boot/arm/at91/linker.cfg Sat Jul 7 04:49:53 2012 (r238186) @@ -31,258 +31,26 @@ SECTIONS .text : { *(.text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t.*) - *(.glue_7t) *(.glue_7) } - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rel.init : { *(.rel.init) } - .rela.init : { *(.rela.init) } - .rel.text : - { - *(.rel.text) - *(.rel.text.*) - *(.rel.gnu.linkonce.t.*) - } - .rela.text : - { - *(.rela.text) - *(.rela.text.*) - *(.rela.gnu.linkonce.t.*) - } - .rel.fini : { *(.rel.fini) } - .rela.fini : { *(.rela.fini) } - .rel.rodata : - { - *(.rel.rodata) - *(.rel.rodata.*) - *(.rel.gnu.linkonce.r.*) - } - .rela.rodata : - { - *(.rela.rodata) - *(.rela.rodata.*) - *(.rela.gnu.linkonce.r.*) - } - .rel.data : - { - *(.rel.data) - *(.rel.data.*) - *(.rel.gnu.linkonce.d.*) - } - .rela.data : - { - *(.rela.data) - *(.rela.data.*) - *(.rela.gnu.linkonce.d.*) - } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.sdata : - { - *(.rel.sdata) - *(.rel.sdata.*) - *(.rel.gnu.linkonce.s.*) - } - .rela.sdata : - { - *(.rela.sdata) - *(.rela.sdata.*) - *(.rela.gnu.linkonce.s.*) - } - .rel.sbss : - { - *(.rel.sbss) - *(.rel.sbss.*) - *(.rel.gnu.linkonce.sb.*) - } - .rela.sbss : - { - *(.rela.sbss) - *(.rela.sbss.*) - *(.rel.gnu.linkonce.sb.*) - } - .rel.sdata2 : - { - *(.rel.sdata2) - *(.rel.sdata2.*) - *(.rel.gnu.linkonce.s2.*) - } - .rela.sdata2 : - { - *(.rela.sdata2) - *(.rela.sdata2.*) - *(.rela.gnu.linkonce.s2.*) - } - .rel.sbss2 : - { - *(.rel.sbss2) - *(.rel.sbss2.*) - *(.rel.gnu.linkonce.sb2.*) - } - .rela.sbss2 : - { - *(.rela.sbss2) - *(.rela.sbss2.*) - *(.rela.gnu.linkonce.sb2.*) - } - .rel.bss : - { - *(.rel.bss) - *(.rel.bss.*) - *(.rel.gnu.linkonce.b.*) - } - .rela.bss : - { - *(.rela.bss) - *(.rela.bss.*) - *(.rela.gnu.linkonce.b.*) - } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : - { - KEEP (*(.init)) - } =0 - .plt : { *(.plt) } - .fini : - { - KEEP (*(.fini)) - } =0 PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); - .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } - .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } - .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } .data : { __data_start = . ; *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - SORT(CONSTRUCTORS) - } - .data1 : { *(.data1) } - . = 0x21200000; - .eh_frame : { KEEP (*(.eh_frame)) } - .gcc_except_table : { *(.gcc_except_table) } - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } - .got : { *(.got.plt) *(.got) } - .dynamic : { *(.dynamic) } - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : - { - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) } _edata = .; PROVIDE (edata = .); __bss_start = .; __bss_start__ = .; - .sbss : - { - PROVIDE (__sbss_start = .); - PROVIDE (___sbss_start = .); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - PROVIDE (__sbss_end = .); - PROVIDE (___sbss_end = .); - } .bss : { - *(.dynbss) *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ . = ALIGN(32 / 8); } . = ALIGN(32 / 8); _end = .; _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* These must appear regardless of . */ } From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 04:52: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 2E158106566B; Sat, 7 Jul 2012 04:52:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17B698FC14; Sat, 7 Jul 2012 04:52: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 q674pxJc013800; Sat, 7 Jul 2012 04:51:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q674pxps013798; Sat, 7 Jul 2012 04:51:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207070451.q674pxps013798@svn.freebsd.org> From: Warner Losh Date: Sat, 7 Jul 2012 04:51: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: r238187 - head/sys/boot/arm/at91/libat91 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, 07 Jul 2012 04:52:00 -0000 Author: imp Date: Sat Jul 7 04:51:59 2012 New Revision: 238187 URL: http://svn.freebsd.org/changeset/base/238187 Log: Allow other SOCs to be compiled in, first step. Modified: head/sys/boot/arm/at91/libat91/Makefile Modified: head/sys/boot/arm/at91/libat91/Makefile ============================================================================== --- head/sys/boot/arm/at91/libat91/Makefile Sat Jul 7 04:49:53 2012 (r238186) +++ head/sys/boot/arm/at91/libat91/Makefile Sat Jul 7 04:51:59 2012 (r238187) @@ -2,9 +2,11 @@ .include "${.CURDIR}/../Makefile.inc" +SOC?=at91rm9200 + LIB= at91 INTERNALLIB= -SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c getc.c \ +SRCS=${SOC}_lowlevel.c delay.c eeprom.c emac.c emac_init.c getc.c \ putchar.c printf.c reset.c spi_flash.c xmodem.c \ sd-card.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \ memset.c memcmp.c From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 04:55: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 2FFAC106566B; Sat, 7 Jul 2012 04:55:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA4E8FC12; Sat, 7 Jul 2012 04:55: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 q674tgLm014124; Sat, 7 Jul 2012 04:55:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q674tgl8014122; Sat, 7 Jul 2012 04:55:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207070455.q674tgl8014122@svn.freebsd.org> From: Warner Losh Date: Sat, 7 Jul 2012 04:55: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: r238188 - head/sys/boot/arm/at91/boot0spi 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, 07 Jul 2012 04:55:43 -0000 Author: imp Date: Sat Jul 7 04:55:42 2012 New Revision: 238188 URL: http://svn.freebsd.org/changeset/base/238188 Log: Generalize this for loading the loader into the SPI. Plus trim about 100 bytes from the binary with silly tricks. Hope to get this small enough to run on the models that have 4k SRAM. We are close compiled for the at91rm9200, but still need to trim for the target. Modified: head/sys/boot/arm/at91/boot0spi/main.c Modified: head/sys/boot/arm/at91/boot0spi/main.c ============================================================================== --- head/sys/boot/arm/at91/boot0spi/main.c Sat Jul 7 04:51:59 2012 (r238187) +++ head/sys/boot/arm/at91/boot0spi/main.c Sat Jul 7 04:55:42 2012 (r238188) @@ -29,31 +29,26 @@ #include "at91rm9200_lowlevel.h" #include "spi_flash.h" -#define LOADER_OFFSET 0 -#define FPGA_OFFSET (15 * FLASH_PAGE_SIZE) -#define OFFSET FPGA_OFFSET +#define OFFSET 0 -int +void main(void) { int len, i, j, off, sec; char *addr = (char *)SDRAM_BASE + (1 << 20); /* download at + 1MB */ char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* readback to + 2MB */ - char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* extra copy at + 3MB */ SPI_InitFlash(); printf("Waiting for data\n"); while ((len = xmodem_rx(addr)) == -1) continue; - // Need extra copy at addr3 - memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); - printf("Writing %u bytes to flash at %u\n", len, OFFSET); + printf("Writing %u bytes at %u\n", len, OFFSET); for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { + off = i + OFFSET; for (j = 0; j < 10; j++) { - off = i + OFFSET; SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); SPI_ReadFlash(off, addr2 + i, FLASH_PAGE_SIZE); - if (p_memcmp(addr3 + i, addr2 + i, FLASH_PAGE_SIZE) == 0) + if (p_memcmp(addr + i, addr2 + i, FLASH_PAGE_SIZE) == 0) break; } if (j >= 10) @@ -64,5 +59,4 @@ main(void) continue; printf("Done\n"); reset(); - return (1); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 05:02:40 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 2E4D3106564A; Sat, 7 Jul 2012 05:02:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17EFA8FC12; Sat, 7 Jul 2012 05:02:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6752dq8014704; Sat, 7 Jul 2012 05:02:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6752d6X014688; Sat, 7 Jul 2012 05:02:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207070502.q6752d6X014688@svn.freebsd.org> From: Warner Losh Date: Sat, 7 Jul 2012 05:02: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: r238189 - in head/sys: arm/at91 arm/conf arm/include 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: Sat, 07 Jul 2012 05:02:40 -0000 Author: imp Date: Sat Jul 7 05:02:39 2012 New Revision: 238189 URL: http://svn.freebsd.org/changeset/base/238189 Log: Create a generic way to support multiple boards within an arm platform. Add all the atmel boards to the ATMEL kernel for testing purposes. Until boot loader arg parsing of baord type is done, this won't actually be able to do the runtime selection. Added: head/sys/arm/include/board.h (contents, props changed) Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91board.h head/sys/arm/at91/board_bwct.c head/sys/arm/at91/board_ethernut5.c head/sys/arm/at91/board_hl200.c head/sys/arm/at91/board_hl201.c head/sys/arm/at91/board_kb920x.c head/sys/arm/at91/board_qila9g20.c head/sys/arm/at91/board_sam9g20ek.c head/sys/arm/at91/board_sam9x25ek.c head/sys/arm/at91/board_tsc4370.c head/sys/arm/conf/ATMEL head/sys/conf/options.arm Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/at91_machdep.c Sat Jul 7 05:02:39 2012 (r238189) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -402,6 +403,18 @@ at91_soc_id(void) at91_try_id(AT91_DBGU1); } +#ifdef ARM_MANY_BOARD +/* likely belongs in arm/arm/machdep.c, but since board_init is still at91 only... */ +SET_DECLARE(arm_board_set, const struct arm_board); + +/* Not yet fully functional, but enough to build ATMEL config */ +static long +board_init(void) +{ + return -1; +} +#endif + void * initarm(struct arm_boot_params *abp) { Modified: head/sys/arm/at91/at91board.h ============================================================================== --- head/sys/arm/at91/at91board.h Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/at91board.h Sat Jul 7 05:02:39 2012 (r238189) @@ -33,9 +33,4 @@ */ long at91_ramsize(void); -/* - * These routines are expected to be provided by the board files. - */ -long board_init(void); - #endif /* _ARM_AT91_AT91BOARD_H_ */ Modified: head/sys/arm/at91/board_bwct.c ============================================================================== --- head/sys/arm/at91/board_bwct.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_bwct.c Sat Jul 7 05:02:39 2012 (r238189) @@ -29,12 +29,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -long +BOARD_INIT long board_init(void) { /* @@ -64,3 +65,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(NONE, "BWCT special"); Modified: head/sys/arm/at91/board_ethernut5.c ============================================================================== --- head/sys/arm/at91/board_ethernut5.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_ethernut5.c Sat Jul 7 05:02:39 2012 (r238189) @@ -33,12 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -long +BOARD_INIT long board_init(void) { @@ -144,3 +145,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(NONE, "Ethernut 5") Modified: head/sys/arm/at91/board_hl200.c ============================================================================== --- head/sys/arm/at91/board_hl200.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_hl200.c Sat Jul 7 05:02:39 2012 (r238189) @@ -29,12 +29,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -long +BOARD_INIT long board_init(void) { /* @@ -61,3 +62,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(NONE, "HOTe 200"); Modified: head/sys/arm/at91/board_hl201.c ============================================================================== --- head/sys/arm/at91/board_hl201.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_hl201.c Sat Jul 7 05:02:39 2012 (r238189) @@ -29,12 +29,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -long +BOARD_INIT long board_init(void) { /* Setup Ethernet Pins */ @@ -65,3 +66,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(NONE, "HOTe 201"); Modified: head/sys/arm/at91/board_kb920x.c ============================================================================== --- head/sys/arm/at91/board_kb920x.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_kb920x.c Sat Jul 7 05:02:39 2012 (r238189) @@ -29,13 +29,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include -long +BOARD_INIT long board_init(void) { /* @@ -70,3 +71,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(KB9200, "Kwikbyte KB920x") Modified: head/sys/arm/at91/board_qila9g20.c ============================================================================== --- head/sys/arm/at91/board_qila9g20.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_qila9g20.c Sat Jul 7 05:02:39 2012 (r238189) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,7 +45,7 @@ __FBSDID("$FreeBSD$"); #define AT91SAM9G20_LED_SIZE AT91SAM9G20_PIO_SIZE #define AT91SAM9G20_IRQ_LED AT91SAM9G20_IRQ_PIOA -long +BOARD_INIT long board_init(void) { @@ -103,3 +104,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(QIL_A9G20, "Calico System QIL-9G20-Cxx"); Modified: head/sys/arm/at91/board_sam9g20ek.c ============================================================================== --- head/sys/arm/at91/board_sam9g20ek.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_sam9g20ek.c Sat Jul 7 05:02:39 2012 (r238189) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -41,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include //#include -long +BOARD_INIT long board_init(void) { /* PIOB's A periph: Turn USART 0's TX/RX pins */ @@ -122,3 +123,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(AT91SAM9G20, "Atmel SAM9G20-EK Development Card"); Modified: head/sys/arm/at91/board_sam9x25ek.c ============================================================================== --- head/sys/arm/at91/board_sam9x25ek.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_sam9x25ek.c Sat Jul 7 05:02:39 2012 (r238189) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -41,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include //#include -long +BOARD_INIT long board_init(void) { #if 0 @@ -123,3 +124,5 @@ board_init(void) #endif return (at91_ramsize()); } + +ARM_BOARD(AT91SAM9X5EK, "Atmel AT91SAM9x-EK Evaluation Board"); Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/at91/board_tsc4370.c Sat Jul 7 05:02:39 2012 (r238189) @@ -29,12 +29,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -long +BOARD_INIT long board_init(void) { /* @@ -73,3 +74,5 @@ board_init(void) return (at91_ramsize()); } + +ARM_BOARD(NONE, "TSC4370 Controller Board"); Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/arm/conf/ATMEL Sat Jul 7 05:02:39 2012 (r238189) @@ -18,15 +18,16 @@ options KERNVIRTADDR=0xc0000000 makeoptions MODULES_OVERRIDE="" # list all boards here, but not just yet (no multiboard in mainline). -#device at91_board_bwct -#device at91_board_ethernut5 -#device at91_board_hl200 -#device at91_board_hl201 -#device at91_board_kb920x -#device at91_board_qila9g20 +options ARM_MANY_BOARD +device at91_board_bwct +device at91_board_ethernut5 +device at91_board_hl200 +device at91_board_hl201 +device at91_board_kb920x +device at91_board_qila9g20 device at91_board_sam9g20ek -#device at91_board_sam9x25ek -#device at91_board_tsc4370 +device at91_board_sam9x25ek +device at91_board_tsc4370 #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Added: head/sys/arm/include/board.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/board.h Sat Jul 7 05:02:39 2012 (r238189) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2012 Warner Losh. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _ARM_INCLUDE_BOARD_H_ +#define _ARM_INCLUDE_BOARD_H_ + +#include + +typedef long (arm_board_init_fn)(void); + +struct arm_board { + int board_id; /* Board ID from the boot loader */ + const char *board_name; /* Human readable name */ + arm_board_init_fn *board_init; /* Board initialize code */ +}; + +#if defined(ARM_MANY_BOARD) + +#include "board_id.h" + +#define ARM_BOARD(id, name) \ + static struct arm_board this_board = { \ + .board_id = ARM_BOARD_ID_ ## id, \ + .board_name = name, \ + .board_init = board_init, \ + }; \ + DATA_SET(arm_boards, this_board); +#define BOARD_INIT static + +#else /* !ARM_MANY_BOARD */ + +#define ARM_BOARD(id, name) +extern arm_board_init_fn board_init; +#define BOARD_INIT + +#endif /* ARM_MANY_BOARD */ + +#endif /* _ARM_INCLUDE_BOARD_H_ */ Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sat Jul 7 04:55:42 2012 (r238188) +++ head/sys/conf/options.arm Sat Jul 7 05:02:39 2012 (r238189) @@ -3,6 +3,7 @@ ARM9_CACHE_WRITE_THROUGH opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h ARMFPE opt_global.h ARM_KERN_DIRECTMAP opt_vm.h +ARM_MANY_BOARD opt_global.h ARM_USE_SMALL_ALLOC opt_global.h COUNTS_PER_SEC opt_timer.h CPU_SA1100 opt_global.h From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 05:17: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 2BB3C106566C; Sat, 7 Jul 2012 05:17:44 +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 15CA98FC08; Sat, 7 Jul 2012 05:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q675HhQp015905; Sat, 7 Jul 2012 05:17:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q675HhIX015900; Sat, 7 Jul 2012 05:17:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207070517.q675HhIX015900@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 7 Jul 2012 05:17: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: r238190 - in head/sys/ia64: ia64 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: Sat, 07 Jul 2012 05:17:44 -0000 Author: marcel Date: Sat Jul 7 05:17:43 2012 New Revision: 238190 URL: http://svn.freebsd.org/changeset/base/238190 Log: Implement ia64_physmem_alloc() and use it consistently to get memory before VM has been initialized. This includes: 1. Replacing pmap_steal_memory(), 2. Replace the handcrafted logic to allocate a naturally aligned VHPT, 3. Properly allocate the DPCPU for the BSP. Ad 3: Appending the DPCPU to kernend worked as long as we wouldn't cross into the next PBVM page. If we were to cross into the next page, then there wouldn't be a PTE entry on the page table for it and we would end up with a MCA following a page fault. As such, this commit fixes MCAs occasionally seen. Modified: head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/physmem.c head/sys/ia64/ia64/pmap.c head/sys/ia64/include/md_var.h Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sat Jul 7 05:02:39 2012 (r238189) +++ head/sys/ia64/ia64/machdep.c Sat Jul 7 05:17:43 2012 (r238190) @@ -675,7 +675,6 @@ ia64_init(void) struct efi_md *md; pt_entry_t *pbvm_pgtbl_ent, *pbvm_pgtbl_lim; char *p; - vm_offset_t kernend; vm_size_t mdlen; int metadata_missing; @@ -773,20 +772,6 @@ ia64_init(void) bootverbose = 1; /* - * Find the end of the kernel. - */ -#ifdef DDB - ksym_start = bootinfo->bi_symtab; - ksym_end = bootinfo->bi_esymtab; - kernend = (vm_offset_t)round_page(ksym_end); -#else - kernend = (vm_offset_t)round_page(_end); -#endif - /* But if the bootstrap tells us otherwise, believe it! */ - if (bootinfo->bi_kernend) - kernend = round_page(bootinfo->bi_kernend); - - /* * Wire things up so we can call the firmware. */ map_pal_code(); @@ -805,9 +790,8 @@ ia64_init(void) pcpup = &pcpu0; ia64_set_k4((u_int64_t)pcpup); pcpu_init(pcpup, 0, sizeof(pcpu0)); - dpcpu_init((void *)kernend, 0); + dpcpu_init(ia64_physmem_alloc(DPCPU_SIZE, PAGE_SIZE), 0); PCPU_SET(md.lid, ia64_get_lid()); - kernend += DPCPU_SIZE; PCPU_SET(curthread, &thread0); /* @@ -838,14 +822,15 @@ ia64_init(void) /* * Initialize error message buffer (at end of core). */ - msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufp = ia64_physmem_alloc(msgbufsize, PAGE_SIZE); msgbufinit(msgbufp, msgbufsize); proc_linkup0(&proc0, &thread0); /* * Init mapping for kernel stack for proc 0 */ - thread0.td_kstack = pmap_steal_memory(KSTACK_PAGES * PAGE_SIZE); + p = ia64_physmem_alloc(KSTACK_PAGES * PAGE_SIZE, PAGE_SIZE); + thread0.td_kstack = (uintptr_t)p; thread0.td_kstack_pages = KSTACK_PAGES; mutex_init(); @@ -871,6 +856,11 @@ ia64_init(void) /* * Initialize debuggers, and break into them if appropriate. */ +#ifdef DDB + ksym_start = bootinfo->bi_symtab; + ksym_end = bootinfo->bi_esymtab; +#endif + kdb_init(); #ifdef KDB Modified: head/sys/ia64/ia64/physmem.c ============================================================================== --- head/sys/ia64/ia64/physmem.c Sat Jul 7 05:02:39 2012 (r238189) +++ head/sys/ia64/ia64/physmem.c Sat Jul 7 05:17:43 2012 (r238190) @@ -187,9 +187,72 @@ ia64_physmem_track(vm_paddr_t base, vm_s return (0); } -vm_paddr_t +void * ia64_physmem_alloc(vm_size_t len, vm_size_t align) { + vm_paddr_t base, lim, pa; + void *ptr; + u_int idx; - return (0); + if (phys_avail_segs == 0) + return (NULL); + + len = round_page(len); + + /* + * Try and allocate with least effort. + */ + idx = phys_avail_segs * 2; + while (idx > 0) { + idx -= 2; + base = phys_avail[idx]; + lim = phys_avail[idx + 1]; + + if (lim - base < len) + continue; + + /* First try from the end. */ + pa = lim - len; + if ((pa & (align - 1)) == 0) { + if (pa == base) + ia64_physmem_remove(idx); + else + phys_avail[idx + 1] = pa; + goto gotit; + } + + /* Try from the start next. */ + pa = base; + if ((pa & (align - 1)) == 0) { + if (pa + len == lim) + ia64_physmem_remove(idx); + else + phys_avail[idx] += len; + goto gotit; + } + } + + /* + * Find a good segment and split it up. + */ + idx = phys_avail_segs * 2; + while (idx > 0) { + idx -= 2; + base = phys_avail[idx]; + lim = phys_avail[idx + 1]; + + pa = (base + align - 1) & ~(align - 1); + if (pa + len <= lim) { + ia64_physmem_delete(pa, len); + goto gotit; + } + } + + /* Out of luck. */ + return (NULL); + + gotit: + ptr = (void *)IA64_PHYS_TO_RR7(pa); + bzero(ptr, len); + return (ptr); } Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sat Jul 7 05:02:39 2012 (r238189) +++ head/sys/ia64/ia64/pmap.c Sat Jul 7 05:17:43 2012 (r238190) @@ -243,36 +243,6 @@ static int pmap_remove_vhpt(vm_offset_t static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); -vm_offset_t -pmap_steal_memory(vm_size_t size) -{ - vm_size_t bank_size; - vm_offset_t pa, va; - - size = round_page(size); - - bank_size = phys_avail[1] - phys_avail[0]; - while (size > bank_size) { - int i; - for (i = 0; phys_avail[i+2]; i+= 2) { - phys_avail[i] = phys_avail[i+2]; - phys_avail[i+1] = phys_avail[i+3]; - } - phys_avail[i] = 0; - phys_avail[i+1] = 0; - if (!phys_avail[0]) - panic("pmap_steal_memory: out of memory"); - bank_size = phys_avail[1] - phys_avail[0]; - } - - pa = phys_avail[0]; - phys_avail[0] += size; - - va = IA64_PHYS_TO_RR7(pa); - bzero((caddr_t) va, size); - return va; -} - static void pmap_initialize_vhpt(vm_offset_t vhpt) { @@ -318,7 +288,7 @@ pmap_bootstrap() struct ia64_pal_result res; vm_offset_t base; size_t size; - int i, j, count, ridbits; + int i, ridbits; /* * Query the PAL Code to find the loop parameters for the @@ -380,7 +350,7 @@ pmap_bootstrap() pmap_ridmax = (1 << ridbits); pmap_ridmapsz = pmap_ridmax / 64; - pmap_ridmap = (uint64_t *)pmap_steal_memory(pmap_ridmax / 8); + pmap_ridmap = ia64_physmem_alloc(pmap_ridmax / 8, PAGE_SIZE); pmap_ridmap[0] |= 0xff; pmap_rididx = 0; pmap_ridcount = 8; @@ -389,14 +359,10 @@ pmap_bootstrap() /* * Allocate some memory for initial kernel 'page tables'. */ - ia64_kptdir = (void *)pmap_steal_memory(PAGE_SIZE); + ia64_kptdir = ia64_physmem_alloc(PAGE_SIZE, PAGE_SIZE); nkpt = 0; kernel_vm_end = VM_MIN_KERNEL_ADDRESS; - for (i = 0; phys_avail[i+2]; i+= 2) - ; - count = i+2; - /* * Determine a valid (mappable) VHPT size. */ @@ -410,35 +376,18 @@ pmap_bootstrap() if (pmap_vhpt_log2size & 1) pmap_vhpt_log2size--; - base = 0; size = 1UL << pmap_vhpt_log2size; - for (i = 0; i < count; i += 2) { - base = (phys_avail[i] + size - 1) & ~(size - 1); - if (base + size <= phys_avail[i+1]) - break; - } - if (!phys_avail[i]) + base = (uintptr_t)ia64_physmem_alloc(size, size); + if (base == 0) panic("Unable to allocate VHPT"); - if (base != phys_avail[i]) { - /* Split this region. */ - for (j = count; j > i; j -= 2) { - phys_avail[j] = phys_avail[j-2]; - phys_avail[j+1] = phys_avail[j-2+1]; - } - phys_avail[i+1] = base; - phys_avail[i+2] = base + size; - } else - phys_avail[i] = base + size; - - base = IA64_PHYS_TO_RR7(base); PCPU_SET(md.vhpt, base); if (bootverbose) printf("VHPT: address=%#lx, size=%#lx\n", base, size); pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte); - pmap_vhpt_bucket = (void *)pmap_steal_memory(pmap_vhpt_nbuckets * - sizeof(struct ia64_bucket)); + pmap_vhpt_bucket = ia64_physmem_alloc(pmap_vhpt_nbuckets * + sizeof(struct ia64_bucket), PAGE_SIZE); for (i = 0; i < pmap_vhpt_nbuckets; i++) { /* Stolen memory is zeroed. */ mtx_init(&pmap_vhpt_bucket[i].mutex, "VHPT bucket lock", NULL, Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Sat Jul 7 05:02:39 2012 (r238189) +++ head/sys/ia64/include/md_var.h Sat Jul 7 05:17:43 2012 (r238190) @@ -93,7 +93,7 @@ int ia64_highfp_save_ipi(void); struct ia64_init_return ia64_init(void); u_int ia64_itc_freq(void); int ia64_physmem_add(vm_paddr_t, vm_size_t); -vm_paddr_t ia64_physmem_alloc(vm_size_t, vm_size_t); +void *ia64_physmem_alloc(vm_size_t, vm_size_t); int ia64_physmem_delete(vm_paddr_t, vm_size_t); int ia64_physmem_fini(void); int ia64_physmem_init(void); From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 07:59: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 0D991106566B; Sat, 7 Jul 2012 07:59:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDD5F8FC0C; Sat, 7 Jul 2012 07:59: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 q677xEZn028172; Sat, 7 Jul 2012 07:59:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q677xE2V028170; Sat, 7 Jul 2012 07:59:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207070759.q677xE2V028170@svn.freebsd.org> From: Andriy Gapon Date: Sat, 7 Jul 2012 07:59: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: r238192 - head/sys/dev/acpica 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, 07 Jul 2012 07:59:15 -0000 Author: avg Date: Sat Jul 7 07:59:14 2012 New Revision: 238192 URL: http://svn.freebsd.org/changeset/base/238192 Log: acpi_cpu_cx_cst: consistently use cpu_cx_count during state enumeration cpu_cx_count is an index into accepted states, while i is an index into original _CST states MFC after: 1 week Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Jul 7 05:25:22 2012 (r238191) +++ head/sys/dev/acpica/acpi_cpu.c Sat Jul 7 07:59:14 2012 (r238192) @@ -746,13 +746,13 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* This is the first C1 state. Use the reserved slot. */ sc->cpu_cx_states[0] = *cx_ptr; } else { - sc->cpu_non_c3 = i; + sc->cpu_non_c3 = sc->cpu_cx_count; cx_ptr++; sc->cpu_cx_count++; } continue; case ACPI_STATE_C2: - sc->cpu_non_c3 = i; + sc->cpu_non_c3 = sc->cpu_cx_count; break; case ACPI_STATE_C3: default: From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 08:12: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 AC072106566C; Sat, 7 Jul 2012 08:12:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971898FC0A; Sat, 7 Jul 2012 08:12: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 q678Cpah029428; Sat, 7 Jul 2012 08:12:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q678CppW029426; Sat, 7 Jul 2012 08:12:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207070812.q678CppW029426@svn.freebsd.org> From: Andriy Gapon Date: Sat, 7 Jul 2012 08:12: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: r238193 - head/sys/dev/acpica 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, 07 Jul 2012 08:12:51 -0000 Author: avg Date: Sat Jul 7 08:12:51 2012 New Revision: 238193 URL: http://svn.freebsd.org/changeset/base/238193 Log: acpi_cpu_cx_list: there is no need to re-evaluate cpu_non_c3 here cpu_non_c3 is already evaluated in acpi_cpu_cx_cst and in acpi_cpu_set_cx_lowest. Besides acpi_cpu_cx_list is not protected by any locking. As a result also move setting of cpu_can_deep_sleep to more appropriate places. MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Jul 7 07:59:14 2012 (r238192) +++ head/sys/dev/acpica/acpi_cpu.c Sat Jul 7 08:12:51 2012 (r238193) @@ -670,6 +670,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->trans_lat = AcpiGbl_FADT.C3Latency; cx_ptr++; sc->cpu_cx_count++; + cpu_can_deep_sleep = 1; } } } @@ -761,7 +762,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s "acpi_cpu%d: C3[%d] not available.\n", device_get_unit(sc->cpu_dev), i)); continue; - } + } else + cpu_can_deep_sleep = 1; break; } @@ -885,16 +887,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * /* * Set up the list of Cx states */ - sc->cpu_non_c3 = 0; sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported), SBUF_FIXEDLEN); - for (i = 0; i < sc->cpu_cx_count; i++) { + for (i = 0; i < sc->cpu_cx_count; i++) sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); - if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) - sc->cpu_non_c3 = i; - else - cpu_can_deep_sleep = 1; - } sbuf_trim(&sb); sbuf_finish(&sb); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 08:19: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 58AE4106566C; Sat, 7 Jul 2012 08:19:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4467C8FC0A; Sat, 7 Jul 2012 08:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q678JZea029955; Sat, 7 Jul 2012 08:19:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q678JZe6029953; Sat, 7 Jul 2012 08:19:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207070819.q678JZe6029953@svn.freebsd.org> From: Andriy Gapon Date: Sat, 7 Jul 2012 08:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238194 - head/sys/dev/acpica 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, 07 Jul 2012 08:19:35 -0000 Author: avg Date: Sat Jul 7 08:19:34 2012 New Revision: 238194 URL: http://svn.freebsd.org/changeset/base/238194 Log: acpi_cpu_generic_cx_probe: for consistency set cpu_non_c3 here too although by default only C1 is enabled (cx_lowest=0) and enabling deeper states goes through acpi_cpu_set_cx_lowest which re-evaluates cpu_non_c3 MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Jul 7 08:12:51 2012 (r238193) +++ head/sys/dev/acpica/acpi_cpu.c Sat Jul 7 08:19:34 2012 (r238194) @@ -629,6 +629,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->type = ACPI_STATE_C1; cx_ptr->trans_lat = 0; cx_ptr++; + sc->cpu_non_c3 = sc->cpu_cx_count; sc->cpu_cx_count++; /* @@ -653,6 +654,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp cx_ptr->type = ACPI_STATE_C2; cx_ptr->trans_lat = AcpiGbl_FADT.C2Latency; cx_ptr++; + sc->cpu_non_c3 = sc->cpu_cx_count; sc->cpu_cx_count++; } } From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 08:35:42 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 1DB451065673; Sat, 7 Jul 2012 08:35:42 +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 5D0188FC1C; Sat, 7 Jul 2012 08:35: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 q678ZmO5025849; Sat, 7 Jul 2012 11:35:48 +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 q678Zam4036512; Sat, 7 Jul 2012 11:35:36 +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 q678ZabZ036511; Sat, 7 Jul 2012 11:35:36 +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: Sat, 7 Jul 2012 11:35:36 +0300 From: Konstantin Belousov To: Marcel Moolenaar Message-ID: <20120707083535.GR2338@deviant.kiev.zoral.com.ua> References: <201207061557.q66Fv45N069464@svn.freebsd.org> <20120706181213.GI2338@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TDVcAd+kFgbLxwBe" 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, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r238172 - head/sys/dev/agp 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, 07 Jul 2012 08:35:42 -0000 --TDVcAd+kFgbLxwBe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 06, 2012 at 06:11:56PM -0700, Marcel Moolenaar wrote: >=20 > On Jul 6, 2012, at 11:12 AM, Konstantin Belousov wrote: >=20 > >> agp_i810.c: > >> While arguably the use of Maxmem can be considered correct, replace i= ts use > >> with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, wh= ich > >> have a dense physical memory layout. Avoiding Maxmem here is done wit= h an > >> eye on copy-n-paste behaviour in general and to avoid confusion cause= d by > >> using realmem in agp.c and Maxmem in agp_i810.c. > > The agp_i810.c use is to prevent attachment when largest physical addre= ss > > of populated memory exceeds GPU limits established by PTE format and > > chipset errata. Editing Maxmem to be spelled as realmem seems to change > > nothing right now, but I do argue that this is wrong, and commit message > > makes future archeology quite confusing. >=20 > The commit log states it all, including how one can arguably call the cha= nge > wrong. What exactly is confusing? The realmem is supposed to report available memory on the system, and not the highest physical memory address. Current calculation of maxmem as realmem is already wrong, often by 1GB on typical desktop machine, and I believe that it will become worse in the future. The platform does has all capacity to report non-dense layouts to OS, and OS is capable of supporting them already. I remember there were already reports of some IBM machines which have sparce address space, making maxmem/(real realmem) be a factor of 2. Confusing is the use of the amount of memory for decision that needs highest address. Commit log just restates the change made without any motivation, I think it is backward. --TDVcAd+kFgbLxwBe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/39NcACgkQC3+MBN1Mb4iHUACgnKT68Xj/HSWKIzAAsChHWMSf I40AnjoEXF2B5ZYOKzudgDhtRzjdBdLl =pHxF -----END PGP SIGNATURE----- --TDVcAd+kFgbLxwBe-- From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 08:41: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 A68FD106564A; Sat, 7 Jul 2012 08:41:38 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 214518FC0C; Sat, 7 Jul 2012 08:41:38 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 65FF440002; Sat, 7 Jul 2012 10:41:36 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 5AE8E40007; Sat, 7 Jul 2012 10:41:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 1D8A540002; Sat, 7 Jul 2012 10:41:36 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3WTmW32ppqz8gtM; Sat, 7 Jul 2012 10:41:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([IPv6:2001:470:dca9:0:1::3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [2001:470:dca9:0:1::6]) (amavisd-new, port 10025) with ESMTPS id q3TI7zfkbcfu; Sat, 7 Jul 2012 10:41:33 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3WTmW10L6Nz8gtL; Sat, 7 Jul 2012 10:41:33 +0200 (CEST) Received: from tifa.daemonic.se (tifa.daemonic.se [10.32.0.6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3WTmW06t9lz9Ctj; Sat, 7 Jul 2012 10:41:32 +0200 (CEST) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id BBE0E228F3; Sat, 7 Jul 2012 10:41:32 +0200 (CEST) Message-ID: <4FF7F63C.40501@daemonic.se> Date: Sat, 07 Jul 2012 10:41:32 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Tim Kientzle References: <201207070414.q674ETpZ010784@svn.freebsd.org> In-Reply-To: <201207070414.q674ETpZ010784@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238185 - head/usr.bin/mkesdb 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, 07 Jul 2012 08:41:38 -0000 On 07/07/12 06:14, Tim Kientzle wrote: > Author: kientzle > Date: Sat Jul 7 04:14:28 2012 > New Revision: 238185 > URL: http://svn.freebsd.org/changeset/base/238185 > > Log: > Unbreak building WITH_ICONV=yes and new yacc. > > Modified: > head/usr.bin/mkesdb/ldef.h > Can you please have a look at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/167481 as well? Regards! -- Niclas Zeising From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 14:44: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 000A5106566B; Sat, 7 Jul 2012 14:44:20 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id C0F4B8FC0A; Sat, 7 Jul 2012 14:44:20 +0000 (UTC) Received: from dhcp-192-168-2-58.wifi.xcllnt.net (wifi.xcllnt.net [70.36.220.6] (may be forged)) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q67EiECC064629 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 7 Jul 2012 07:44:20 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120707083535.GR2338@deviant.kiev.zoral.com.ua> Date: Sat, 7 Jul 2012 07:44:14 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <2B1DDEF4-A048-45BD-9A7A-8CB148282475@xcllnt.net> References: <201207061557.q66Fv45N069464@svn.freebsd.org> <20120706181213.GI2338@deviant.kiev.zoral.com.ua> <20120707083535.GR2338@deviant.kiev.zoral.com.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r238172 - head/sys/dev/agp 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, 07 Jul 2012 14:44:21 -0000 On Jul 7, 2012, at 1:35 AM, Konstantin Belousov wrote: > On Fri, Jul 06, 2012 at 06:11:56PM -0700, Marcel Moolenaar wrote: >>=20 >> On Jul 6, 2012, at 11:12 AM, Konstantin Belousov wrote: >>=20 >>>> agp_i810.c: >>>> While arguably the use of Maxmem can be considered correct, replace = its use >>>> with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, = which >>>> have a dense physical memory layout. Avoiding Maxmem here is done = with an >>>> eye on copy-n-paste behaviour in general and to avoid confusion = caused by >>>> using realmem in agp.c and Maxmem in agp_i810.c. >>> The agp_i810.c use is to prevent attachment when largest physical = address >>> of populated memory exceeds GPU limits established by PTE format and >>> chipset errata. Editing Maxmem to be spelled as realmem seems to = change >>> nothing right now, but I do argue that this is wrong, and commit = message >>> makes future archeology quite confusing. >>=20 >> The commit log states it all, including how one can arguably call the = change >> wrong. What exactly is confusing? >=20 > The realmem is supposed to report available memory on the system, and > not the highest physical memory address. Correct. > Current calculation of maxmem > as realmem is already wrong, often by 1GB on typical desktop machine, > and I believe that it will become worse in the future. Sure. This is also why a variable like Maxmem is confusing. If you try to understand what it means or what it's for, you get mixed signals. On the one hand it's made identical to realmem and on the other hand there's comment that states that it's supposed to be the highest = address. > The platform does > has all capacity to report non-dense layouts to OS, and OS is capable = of > supporting them already. Yes, all platforms do. > I remember there were already reports of some > IBM machines which have sparce address space, making maxmem/(real = realmem) > be a factor of 2. That's nothing. On ia64 this can be a lot worse. > Confusing is the use of the amount of memory for decision that needs = highest > address. Commit log just restates the change made without any = motivation, > I think it is backward. The commit log states the motivation: developers tend to copy-n-paste = without truly understanding the subtle differences and may use the Maxmem use in agp_i810.c as the wrong precedence. Secondly, also mentioned in the = commit log, is the use of realmem in agp.c and then Maxmem in agp_i810.c which = is likely to be confusing. So the change from Maxmem to realmem in = agp_i810.c prioritizes the avoidance of confusion over pedantic correctness, which = we all know isn't achievable anyway. Since agp_i810.c is only for amd64, = i386 and pc98, also stated in the commit log, and all of those have dense = phys. memory, the discrepancy is still within the margin of error. In short: I'm not getting your comments. Do you want me to revert the = change to agp_i810.c so that we can put this to rest? --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:05: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 9A7F7106564A; Sat, 7 Jul 2012 17:05:56 +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 8530C8FC0C; Sat, 7 Jul 2012 17:05: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 q67H5u2H067163; Sat, 7 Jul 2012 17:05:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67H5uXB067160; Sat, 7 Jul 2012 17:05:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071705.q67H5uXB067160@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:05: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: r238197 - in head/usr.bin: mkcsmapper mkesdb 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, 07 Jul 2012 17:05:56 -0000 Author: eadler Date: Sat Jul 7 17:05:55 2012 New Revision: 238197 URL: http://svn.freebsd.org/changeset/base/238197 Log: Fix spelling PR: bin/167480 Submitted by: zeising Approved by: cperciva Modified: head/usr.bin/mkcsmapper/lex.l head/usr.bin/mkesdb/lex.l Modified: head/usr.bin/mkcsmapper/lex.l ============================================================================== --- head/usr.bin/mkcsmapper/lex.l Sat Jul 7 16:09:53 2012 (r238196) +++ head/usr.bin/mkcsmapper/lex.l Sat Jul 7 17:05:55 2012 (r238197) @@ -57,7 +57,7 @@ int line_number = 1; [\n] { line_number++; } . { } <> { - yyerror("unexpected file end (unterminate comment)\n"); + yyerror("unexpected file end (unterminated comment)\n"); exit(1); } Modified: head/usr.bin/mkesdb/lex.l ============================================================================== --- head/usr.bin/mkesdb/lex.l Sat Jul 7 16:09:53 2012 (r238196) +++ head/usr.bin/mkesdb/lex.l Sat Jul 7 17:05:55 2012 (r238197) @@ -59,7 +59,7 @@ int line_number = 1; [\n] { line_number++; } . { } <> { - yyerror("unexpected file end (unterminate comment)\n"); + yyerror("unexpected file end (unterminated comment)\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:09:45 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 69A1F106564A; Sat, 7 Jul 2012 17:09:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 542AA8FC15; Sat, 7 Jul 2012 17:09: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 q67H9jIg067520; Sat, 7 Jul 2012 17:09:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67H9jtn067514; Sat, 7 Jul 2012 17:09:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207071709.q67H9jtn067514@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 17:09: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: r238198 - in head/sys/geom: . bde uncompress uzip 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, 07 Jul 2012 17:09:45 -0000 Author: trasz Date: Sat Jul 7 17:09:44 2012 New Revision: 238198 URL: http://svn.freebsd.org/changeset/base/238198 Log: Fix orphan() methods of several GEOM classes to not assume that there is an error set on the provider. With GEOM resizing, class can become orphaned when it doesn't implement resize() method and the provider size decreases. Reviewed by: mav Sponsored by: FreeBSD Foundation Modified: head/sys/geom/bde/g_bde.c head/sys/geom/geom_aes.c head/sys/geom/geom_slice.c head/sys/geom/uncompress/g_uncompress.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Sat Jul 7 17:05:55 2012 (r238197) +++ head/sys/geom/bde/g_bde.c Sat Jul 7 17:09:44 2012 (r238198) @@ -77,19 +77,15 @@ g_bde_orphan(struct g_consumer *cp) struct g_geom *gp; struct g_provider *pp; struct g_bde_softc *sc; - int error; g_trace(G_T_TOPOLOGY, "g_bde_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_bde_orphan with error == 0")); gp = cp->geom; sc = gp->softc; gp->flags |= G_GEOM_WITHER; - error = cp->provider->error; LIST_FOREACH(pp, &gp->provider, provider) - g_orphan_provider(pp, error); + g_orphan_provider(pp, ENXIO); bzero(sc, sizeof(struct g_bde_softc)); /* destroy evidence */ return; } Modified: head/sys/geom/geom_aes.c ============================================================================== --- head/sys/geom/geom_aes.c Sat Jul 7 17:05:55 2012 (r238197) +++ head/sys/geom/geom_aes.c Sat Jul 7 17:09:44 2012 (r238198) @@ -241,12 +241,10 @@ g_aes_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_aes_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_aes_orphan with error == 0")); gp = cp->geom; sc = gp->softc; - g_wither_geom(gp, cp->provider->error); + g_wither_geom(gp, ENXIO); bzero(sc, sizeof(struct g_aes_softc)); /* destroy evidence */ g_free(sc); return; Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Sat Jul 7 17:05:55 2012 (r238197) +++ head/sys/geom/geom_slice.c Sat Jul 7 17:09:44 2012 (r238198) @@ -522,10 +522,8 @@ g_slice_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_slice_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_slice_orphan with error == 0")); /* XXX: Not good enough we leak the softc and its suballocations */ g_slice_free(cp->geom->softc); - g_wither_geom(cp->geom, cp->provider->error); + g_wither_geom(cp->geom, ENXIO); } Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Sat Jul 7 17:05:55 2012 (r238197) +++ head/sys/geom/uncompress/g_uncompress.c Sat Jul 7 17:09:44 2012 (r238198) @@ -406,13 +406,11 @@ g_uncompress_orphan(struct g_consumer *c g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_uncompress_orphan with error == 0")); gp = cp->geom; g_uncompress_softc_free(gp->softc, gp); gp->softc = NULL; - g_wither_geom(gp, cp->provider->error); + g_wither_geom(gp, ENXIO); } static int Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Jul 7 17:05:55 2012 (r238197) +++ head/sys/geom/uzip/g_uzip.c Sat Jul 7 17:09:44 2012 (r238198) @@ -313,13 +313,11 @@ g_uzip_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_uzip_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_uzip_orphan with error == 0")); gp = cp->geom; g_uzip_softc_free(gp->softc, gp); gp->softc = NULL; - g_wither_geom(gp, cp->provider->error); + g_wither_geom(gp, ENXIO); } static int From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:13:09 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 AE2F41065672; Sat, 7 Jul 2012 17:13:09 +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 99E538FC15; Sat, 7 Jul 2012 17:13: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 q67HD9QD067836; Sat, 7 Jul 2012 17:13:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HD90G067834; Sat, 7 Jul 2012 17:13:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071713.q67HD90G067834@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:13: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: r238199 - head/sys/dev/acpica 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, 07 Jul 2012 17:13:09 -0000 Author: eadler Date: Sat Jul 7 17:13:09 2012 New Revision: 238199 URL: http://svn.freebsd.org/changeset/base/238199 Log: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva MFC after: 1 week Modified: head/sys/dev/acpica/acpi_powerres.c Modified: head/sys/dev/acpica/acpi_powerres.c ============================================================================== --- head/sys/dev/acpica/acpi_powerres.c Sat Jul 7 17:09:44 2012 (r238198) +++ head/sys/dev/acpica/acpi_powerres.c Sat Jul 7 17:13:09 2012 (r238199) @@ -314,7 +314,6 @@ acpi_pwr_switch_consumer(ACPI_HANDLE con ACPI_OBJECT *reslist_object; ACPI_STATUS status; char *method_name, *reslist_name; - int res_changed; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -445,7 +444,7 @@ acpi_pwr_switch_consumer(ACPI_HANDLE con * Now we are ready to switch, so kill off any current power * resource references. */ - res_changed = acpi_pwr_dereference_resource(pc); + acpi_pwr_dereference_resource(pc); /* * Add new power resource references, if we have any. Traverse the @@ -457,7 +456,6 @@ acpi_pwr_switch_consumer(ACPI_HANDLE con reslist_object->Package.Count)); acpi_ForeachPackageObject(reslist_object, acpi_pwr_reference_resource, pc); - res_changed = 1; } /* From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:17: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 441F9106564A; Sat, 7 Jul 2012 17:17:44 +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 2F4D28FC08; Sat, 7 Jul 2012 17:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q67HHiYU068248; Sat, 7 Jul 2012 17:17:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HHh5s068245; Sat, 7 Jul 2012 17:17:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071717.q67HHh5s068245@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:17: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: r238200 - head/sys/cam/scsi 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, 07 Jul 2012 17:17:44 -0000 Author: eadler Date: Sat Jul 7 17:17:43 2012 New Revision: 238200 URL: http://svn.freebsd.org/changeset/base/238200 Log: Remove variables which are initialized but never used thereafter reported by gcc46 warning Reviewed by: scottl Approved by: cperciva MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_ch.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sat Jul 7 17:13:09 2012 (r238199) +++ head/sys/cam/scsi/scsi_all.c Sat Jul 7 17:17:43 2012 (r238200) @@ -4147,9 +4147,9 @@ scsi_sense_desc_sbuf(struct sbuf *sb, st struct scsi_inquiry_data *inq_data, struct scsi_sense_desc_header *header) { - int i, found; + int i; - for (i = 0, found = 0; i < (sizeof(scsi_sense_printers) / + for (i = 0; i < (sizeof(scsi_sense_printers) / sizeof(scsi_sense_printers[0])); i++) { struct scsi_sense_desc_printer *printer; Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Sat Jul 7 17:13:09 2012 (r238199) +++ head/sys/cam/scsi/scsi_ch.c Sat Jul 7 17:17:43 2012 (r238200) @@ -433,17 +433,11 @@ static int chclose(struct cdev *dev, int flag, int fmt, struct thread *td) { struct cam_periph *periph; - struct ch_softc *softc; - int error; - - error = 0; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) return(ENXIO); - softc = (struct ch_softc *)periph->softc; - cam_periph_release(periph); return(0); From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:20:24 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 AAD3B1065670; Sat, 7 Jul 2012 17:20:24 +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 965A48FC0C; Sat, 7 Jul 2012 17:20: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 q67HKOaD068490; Sat, 7 Jul 2012 17:20:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HKOm4068488; Sat, 7 Jul 2012 17:20:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071720.q67HKOm4068488@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:20: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: r238201 - head/sys/dev/aac 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, 07 Jul 2012 17:20:24 -0000 Author: eadler Date: Sat Jul 7 17:20:24 2012 New Revision: 238201 URL: http://svn.freebsd.org/changeset/base/238201 Log: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva MFC after: 1 week Modified: head/sys/dev/aac/aac_disk.c Modified: head/sys/dev/aac/aac_disk.c ============================================================================== --- head/sys/dev/aac/aac_disk.c Sat Jul 7 17:17:43 2012 (r238200) +++ head/sys/dev/aac/aac_disk.c Sat Jul 7 17:20:24 2012 (r238201) @@ -332,9 +332,6 @@ aac_disk_dump(void *arg, void *virtual, void aac_biodone(struct bio *bp) { - struct aac_disk *sc; - - sc = (struct aac_disk *)bp->bio_disk->d_drv1; fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); if (bp->bio_flags & BIO_ERROR) From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:20:28 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 9E528106564A; Sat, 7 Jul 2012 17:20:28 +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 8906D8FC0A; Sat, 7 Jul 2012 17:20: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 q67HKSEH068531; Sat, 7 Jul 2012 17:20:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HKS93068528; Sat, 7 Jul 2012 17:20:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071720.q67HKS93068528@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:20: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: r238202 - in head: . sbin/mdconfig 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, 07 Jul 2012 17:20:28 -0000 Author: eadler Date: Sat Jul 7 17:20:27 2012 New Revision: 238202 URL: http://svn.freebsd.org/changeset/base/238202 Log: Remove ancient vnconfig symlink Submitted by: ak Approved by: cperciva MFC after: 1 week Modified: head/ObsoleteFiles.inc head/sbin/mdconfig/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jul 7 17:20:24 2012 (r238201) +++ head/ObsoleteFiles.inc Sat Jul 7 17:20:27 2012 (r238202) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20120621: remove old man page +OLD_FILES+=usr/share/man/man8/vnconfig.8.gz # 20120613: auth.conf removed OLD_FILES+=etc/auth.conf OLD_FILES+=usr/share/examples/etc/auth.conf Modified: head/sbin/mdconfig/Makefile ============================================================================== --- head/sbin/mdconfig/Makefile Sat Jul 7 17:20:24 2012 (r238201) +++ head/sbin/mdconfig/Makefile Sat Jul 7 17:20:27 2012 (r238202) @@ -2,7 +2,6 @@ PROG= mdconfig MAN= mdconfig.8 -MLINKS= mdconfig.8 vnconfig.8 DPADD= ${LIBUTIL} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lutil -lgeom -lbsdxml -lsbuf From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:20: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 9577C10656F6; Sat, 7 Jul 2012 17:20:53 +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 8027A8FC16; Sat, 7 Jul 2012 17:20: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 q67HKrmq068597; Sat, 7 Jul 2012 17:20:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HKr5N068595; Sat, 7 Jul 2012 17:20:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071720.q67HKr5N068595@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:20: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: r238203 - head/sys/dev/ata/chipsets 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, 07 Jul 2012 17:20:53 -0000 Author: eadler Date: Sat Jul 7 17:20:52 2012 New Revision: 238203 URL: http://svn.freebsd.org/changeset/base/238203 Log: Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Sat Jul 7 17:20:27 2012 (r238202) +++ head/sys/dev/ata/chipsets/ata-via.c Sat Jul 7 17:20:52 2012 (r238203) @@ -472,12 +472,10 @@ ata_via_sata_reset(device_t dev) static int ata_via_sata_scr_read(device_t dev, int port, int reg, u_int32_t *result) { - struct ata_channel *ch; device_t parent; uint32_t val; parent = device_get_parent(dev); - ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -520,12 +518,10 @@ ata_via_sata_scr_read(device_t dev, int static int ata_via_sata_scr_write(device_t dev, int port, int reg, u_int32_t value) { - struct ata_channel *ch; device_t parent; uint32_t val; parent = device_get_parent(dev); - ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SERROR: From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:25:37 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 5F3611065670; Sat, 7 Jul 2012 17:25:37 +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 495918FC0C; Sat, 7 Jul 2012 17:25: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 q67HPbLo069025; Sat, 7 Jul 2012 17:25:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HPbSP069023; Sat, 7 Jul 2012 17:25:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071725.q67HPbSP069023@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:25: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: r238204 - head/sbin/growfs 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, 07 Jul 2012 17:25:37 -0000 Author: eadler Date: Sat Jul 7 17:25:36 2012 New Revision: 238204 URL: http://svn.freebsd.org/changeset/base/238204 Log: Remove unneeded variable reported by gcc46 which stopped being used in r234178. Approved by: cperciva MFC after: 3 days Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sat Jul 7 17:20:52 2012 (r238203) +++ head/sbin/growfs/growfs.c Sat Jul 7 17:25:36 2012 (r238204) @@ -803,7 +803,6 @@ updcsloc(time_t modtime, int fsi, int fs DBG_FUNC("updcsloc") struct csum *cs; int ocscg, ncscg; - int blocks; ufs2_daddr_t d; int lcs = 0; int block; @@ -820,8 +819,6 @@ updcsloc(time_t modtime, int fsi, int fs } ocscg = dtog(&osblock, osblock.fs_csaddr); cs = fscs + ocscg; - blocks = 1 + howmany(sblock.fs_cssize, sblock.fs_bsize) - - howmany(osblock.fs_cssize, osblock.fs_bsize); /* * Read original cylinder group from disk, and make a copy. From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:35:35 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 42E0D106566C; Sat, 7 Jul 2012 17:35:35 +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 2E4858FC08; Sat, 7 Jul 2012 17:35:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q67HZZi1069866; Sat, 7 Jul 2012 17:35:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HZYkw069864; Sat, 7 Jul 2012 17:35:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071735.q67HZYkw069864@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:35: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: r238205 - head/share/syscons/keymaps 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, 07 Jul 2012 17:35:35 -0000 Author: eadler Date: Sat Jul 7 17:35:34 2012 New Revision: 238205 URL: http://svn.freebsd.org/changeset/base/238205 Log: Add a description of the Spanish Dvorak keymap added in r235251 PR: conf/160235 Submitted by: gavin Approved by: cperciva MFC after: 3 days Modified: head/share/syscons/keymaps/INDEX.keymaps Modified: head/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- head/share/syscons/keymaps/INDEX.keymaps Sat Jul 7 17:25:36 2012 (r238204) +++ head/share/syscons/keymaps/INDEX.keymaps Sat Jul 7 17:35:34 2012 (r238205) @@ -378,6 +378,8 @@ ru.koi8-r.win.kbd:pt:Russo koi8-r (winke ru.koi8-r.win.kbd:es:Ruso koi8-r (winkeys) ru.koi8-r.win.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r (winkeys) +spanish.dvorak.kbd:en:Spanish Dvorak + spanish.iso.kbd:en:Spanish ISO-8859-1 spanish.iso.kbd:de:Spanisch ISO-8859-1 spanish.iso.kbd:fr:Espagnol ISO-8859-1 From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 17:46: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 99E1E106566B; Sat, 7 Jul 2012 17:46:12 +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 0FC078FC15; Sat, 7 Jul 2012 17:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q67HkBJf070758; Sat, 7 Jul 2012 17:46:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67HkBbn070756; Sat, 7 Jul 2012 17:46:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207071746.q67HkBbn070756@svn.freebsd.org> From: Eitan Adler Date: Sat, 7 Jul 2012 17:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238206 - 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: Sat, 07 Jul 2012 17:46:12 -0000 Author: eadler Date: Sat Jul 7 17:46:11 2012 New Revision: 238206 URL: http://svn.freebsd.org/changeset/base/238206 Log: Add missing sleep stat increase PR: kern/168211 Submitted by: linimon Reviewed by: alc Approved by: cperciva MFC after: 3 days Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Jul 7 17:35:34 2012 (r238205) +++ head/sys/vm/uma_core.c Sat Jul 7 17:46:11 2012 (r238206) @@ -2193,6 +2193,7 @@ keg_fetch_slab(uma_keg_t keg, uma_zone_t zone->uz_flags |= UMA_ZFLAG_FULL; if (flags & M_NOWAIT) break; + zone->uz_sleeps++; msleep(keg, &keg->uk_lock, PVM, "keglimit", 0); continue; } From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 18:35: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 4CC971065670 for ; Sat, 7 Jul 2012 18:35:44 +0000 (UTC) (envelope-from lists@eitanadler.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 03E288FC12 for ; Sat, 7 Jul 2012 18:35:43 +0000 (UTC) Received: by obbun3 with SMTP id un3so21301246obb.13 for ; Sat, 07 Jul 2012 11:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=bojCk6ZGsLap2GUw7j34urO6HCgZiCacJHsAiw1hEqs=; b=qiXj1Jttd07FVe3I7ynxwUDKPXEKbkKVk1/CXPafcodBkmR2wI3CEa0Dg2cfGUCwB3 HdhlwM8SRLa/XjhL0GB1otchwsrMmxZQpnZ9NY+FIiBoYFzkNgHxrybI0S3tCeMJAYVK Az4LEBDpHJtcqMgQPwfkUamJQDXkyXM+7RnqM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=bojCk6ZGsLap2GUw7j34urO6HCgZiCacJHsAiw1hEqs=; b=iKFSKOs3+UsWvqjfq7hk5nN0WvnXW1hwflYl2DHAnudAcxv4rWdLqtN68Fe+VQC/d5 DCL7gjpaby5uafX16xP954GYawpyeNHW/f69Bru03UtpjY2KG7ETg5QroTI1bnXYNL4J RoWvCN/FgKeENDjgArgkAAbWN4JSY5MnVROM8AiYUtVo7PEL3ZYTomDEczcwHOusLkTg /tzIAaNfA8nejT7MHz9DJODes2ysyoDadoOcO0aIbdRB/fulswxdiMY5FrQLaIOTGMPI 8+N7Nr57lOwdd7vOueognbdDuouSnf/ZGVUiGvx0MquCN/RkNDkSDTxGAj3ZebOpxJ84 o4Nw== Received: by 10.182.216.99 with SMTP id op3mr8881461obc.30.1341686143494; Sat, 07 Jul 2012 11:35:43 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.182.125.70 with HTTP; Sat, 7 Jul 2012 11:35:13 -0700 (PDT) In-Reply-To: <4FF7F63C.40501@daemonic.se> References: <201207070414.q674ETpZ010784@svn.freebsd.org> <4FF7F63C.40501@daemonic.se> From: Eitan Adler Date: Sat, 7 Jul 2012 11:35:13 -0700 X-Google-Sender-Auth: SZEoL4qm2F0R2yAV0z8Guu2ru0A Message-ID: To: Niclas Zeising Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmz16ETY8D0Qr4HBaSj57WDTV7j27wM1VbjtRNOF7sJOikQcDcZkZEgs8Fedi4sNCIrCKXH Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org Subject: Re: svn commit: r238185 - head/usr.bin/mkesdb 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, 07 Jul 2012 18:35:44 -0000 On 7 July 2012 01:41, Niclas Zeising wrote: > On 07/07/12 06:14, Tim Kientzle wrote: >> >> Author: kientzle >> Date: Sat Jul 7 04:14:28 2012 >> New Revision: 238185 >> URL: http://svn.freebsd.org/changeset/base/238185 >> >> Log: >> Unbreak building WITH_ICONV=yes and new yacc. >> >> Modified: >> head/usr.bin/mkesdb/ldef.h >> > > Can you please have a look at > http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/167481 > as well? I am.... -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 19:39:09 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 62967106566C; Sat, 7 Jul 2012 19:39:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42CA38FC0C; Sat, 7 Jul 2012 19:39: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 q67Jd9eV080111; Sat, 7 Jul 2012 19:39:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67Jd9lq080108; Sat, 7 Jul 2012 19:39:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207071939.q67Jd9lq080108@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 7 Jul 2012 19:39: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: r238212 - in head/sys: 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: Sat, 07 Jul 2012 19:39:09 -0000 Author: kib Date: Sat Jul 7 19:39:08 2012 New Revision: 238212 URL: http://svn.freebsd.org/changeset/base/238212 Log: Drop page queues mutex on each iteration of vm_pageout_scan over the inactive queue, unless busy page is found. Dropping the mutex often should allow the other lock acquires to proceed without waiting for whole inactive scan to finish. On machines with lot of physical memory scan often need to iterate a lot before it finishes or finds a page which requires laundring, causing high latency for other lock waiters. Suggested and reviewed by: alc MFC after: 3 weeks Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_pageout.c Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Sat Jul 7 19:12:15 2012 (r238211) +++ head/sys/sys/vmmeter.h Sat Jul 7 19:39:08 2012 (r238212) @@ -79,7 +79,7 @@ struct vmmeter { u_int v_pdpages; /* (q) pages analyzed by daemon */ u_int v_tcached; /* (p) total pages cached */ - u_int v_dfree; /* (q) pages freed by daemon */ + u_int v_dfree; /* (p) pages freed by daemon */ u_int v_pfree; /* (p) pages freed by exiting processes */ u_int v_tfree; /* (p) total pages freed */ /* Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Jul 7 19:12:15 2012 (r238211) +++ head/sys/vm/vm_pageout.c Sat Jul 7 19:39:08 2012 (r238212) @@ -743,6 +743,7 @@ vm_pageout_scan(int pass) int actcount; int vnodes_skipped = 0; int maxlaunder; + boolean_t queues_locked; /* * Decrease registered cache sizes. @@ -784,6 +785,7 @@ vm_pageout_scan(int pass) if (pass) maxlaunder = 10000; vm_page_lock_queues(); + queues_locked = TRUE; rescan0: addl_page_shortage = addl_page_shortage_init; maxscan = cnt.v_inactive_count; @@ -791,6 +793,8 @@ rescan0: for (m = TAILQ_FIRST(&vm_page_queues[PQ_INACTIVE].pl); m != NULL && maxscan-- > 0 && page_shortage > 0; m = next) { + KASSERT(queues_locked, ("unlocked queues")); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); cnt.v_pdpages++; @@ -850,6 +854,16 @@ rescan0: } /* + * We unlock vm_page_queue_mtx, invalidating the + * 'next' pointer. Use our marker to remember our + * place. + */ + TAILQ_INSERT_AFTER(&vm_page_queues[PQ_INACTIVE].pl, + m, &marker, pageq); + vm_page_unlock_queues(); + queues_locked = FALSE; + + /* * If the object is not being used, we ignore previous * references. */ @@ -873,7 +887,7 @@ rescan0: vm_page_unlock(m); m->act_count += actcount + ACT_ADVANCE; VM_OBJECT_UNLOCK(object); - continue; + goto relock_queues; } /* @@ -889,7 +903,7 @@ rescan0: vm_page_unlock(m); m->act_count += actcount + ACT_ADVANCE + 1; VM_OBJECT_UNLOCK(object); - continue; + goto relock_queues; } /* @@ -924,7 +938,7 @@ rescan0: * Invalid pages can be easily freed */ vm_page_free(m); - cnt.v_dfree++; + PCPU_INC(cnt.v_dfree); --page_shortage; } else if (m->dirty == 0) { /* @@ -947,6 +961,8 @@ rescan0: * the thrash point for a heavily loaded machine. */ m->flags |= PG_WINATCFLS; + vm_page_lock_queues(); + queues_locked = TRUE; vm_page_requeue(m); } else if (maxlaunder > 0) { /* @@ -976,21 +992,13 @@ rescan0: if (!swap_pageouts_ok || (object->flags & OBJ_DEAD)) { vm_page_unlock(m); VM_OBJECT_UNLOCK(object); + vm_page_lock_queues(); + queues_locked = TRUE; vm_page_requeue(m); - continue; + goto relock_queues; } /* - * Following operations may unlock - * vm_page_queue_mtx, invalidating the 'next' - * pointer. To prevent an inordinate number - * of restarts we use our marker to remember - * our place. - * - */ - TAILQ_INSERT_AFTER(&vm_page_queues[PQ_INACTIVE].pl, - m, &marker, pageq); - /* * The object is already known NOT to be dead. It * is possible for the vget() to block the whole * pageout daemon, but the new low-memory handling @@ -1014,7 +1022,6 @@ rescan0: * of time. */ if (object->type == OBJT_VNODE) { - vm_page_unlock_queues(); vm_page_unlock(m); vp = object->handle; if (vp->v_type == VREG && @@ -1044,6 +1051,7 @@ rescan0: VM_OBJECT_LOCK(object); vm_page_lock(m); vm_page_lock_queues(); + queues_locked = TRUE; /* * The page might have been moved to another * queue during potential blocking in vget() @@ -1075,6 +1083,8 @@ rescan0: * be undergoing I/O, so skip it */ if (m->hold_count) { + vm_page_lock_queues(); + queues_locked = TRUE; vm_page_unlock(m); vm_page_requeue(m); if (object->flags & OBJ_MIGHTBEDIRTY) @@ -1093,32 +1103,37 @@ rescan0: * the (future) cleaned page. Otherwise we could wind * up laundering or cleaning too many pages. */ - vm_page_unlock_queues(); if (vm_pageout_clean(m) != 0) { --page_shortage; --maxlaunder; } - vm_page_lock_queues(); unlock_and_continue: vm_page_lock_assert(m, MA_NOTOWNED); VM_OBJECT_UNLOCK(object); if (mp != NULL) { - vm_page_unlock_queues(); + if (queues_locked) { + vm_page_unlock_queues(); + queues_locked = FALSE; + } if (vp != NULL) vput(vp); VFS_UNLOCK_GIANT(vfslocked); vm_object_deallocate(object); vn_finished_write(mp); - vm_page_lock_queues(); } - next = TAILQ_NEXT(&marker, pageq); - TAILQ_REMOVE(&vm_page_queues[PQ_INACTIVE].pl, - &marker, pageq); vm_page_lock_assert(m, MA_NOTOWNED); - continue; + goto relock_queues; } vm_page_unlock(m); VM_OBJECT_UNLOCK(object); +relock_queues: + if (!queues_locked) { + vm_page_lock_queues(); + queues_locked = TRUE; + } + next = TAILQ_NEXT(&marker, pageq); + TAILQ_REMOVE(&vm_page_queues[PQ_INACTIVE].pl, + &marker, pageq); } /* From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 20:13: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 818E6106564A; Sat, 7 Jul 2012 20:13:41 +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 6C1938FC0A; Sat, 7 Jul 2012 20:13: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 q67KDfAN082946; Sat, 7 Jul 2012 20:13:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67KDfHN082943; Sat, 7 Jul 2012 20:13:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207072013.q67KDfHN082943@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 20:13: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: r238213 - head/sys/geom 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, 07 Jul 2012 20:13:41 -0000 Author: trasz Date: Sat Jul 7 20:13:40 2012 New Revision: 238213 URL: http://svn.freebsd.org/changeset/base/238213 Log: Add a new GEOM method, resize(), which is called after provider size changes. Add a new routine, g_resize_provider(), to use to notify GEOM about provider change. Reviewed by: mav Sponsored by: FreeBSD Foundation Modified: head/sys/geom/geom.h head/sys/geom/geom_subr.c Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Sat Jul 7 19:39:08 2012 (r238212) +++ head/sys/geom/geom.h Sat Jul 7 20:13:40 2012 (r238213) @@ -79,6 +79,7 @@ typedef void g_attrchanged_t (struct g_c typedef void g_provgone_t (struct g_provider *); typedef void g_dumpconf_t (struct sbuf *, const char *indent, struct g_geom *, struct g_consumer *, struct g_provider *); +typedef void g_resize_t(struct g_consumer *cp); /* * The g_class structure describes a transformation class. In other words @@ -108,7 +109,7 @@ struct g_class { g_orphan_t *orphan; g_ioctl_t *ioctl; g_provgone_t *providergone; - void *spare2; + g_resize_t *resize; /* * The remaining elements are private */ @@ -139,7 +140,7 @@ struct g_geom { g_orphan_t *orphan; g_ioctl_t *ioctl; g_provgone_t *providergone; - void *spare1; + g_resize_t *resize; void *softc; unsigned flags; #define G_GEOM_WITHER 1 @@ -265,6 +266,7 @@ int g_handleattr_str(struct bio *bp, con struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...); struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...); +void g_resize_provider(struct g_provider *pp, off_t size); int g_retaste(struct g_class *mp); void g_spoil(struct g_provider *pp, struct g_consumer *cp); int g_std_access(struct g_provider *pp, int dr, int dw, int de); Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sat Jul 7 19:39:08 2012 (r238212) +++ head/sys/geom/geom_subr.c Sat Jul 7 20:13:40 2012 (r238213) @@ -68,9 +68,11 @@ static struct g_tailq_head geoms = TAILQ char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; struct g_hh00 { - struct g_class *mp; - int error; - int post; + struct g_class *mp; + struct g_provider *pp; + off_t size; + int error; + int post; }; /* @@ -356,6 +358,7 @@ g_new_geomf(struct g_class *mp, const ch gp->access = mp->access; gp->orphan = mp->orphan; gp->ioctl = mp->ioctl; + gp->resize = mp->resize; return (gp); } @@ -601,6 +604,76 @@ g_error_provider(struct g_provider *pp, pp->error = error; } +static void +g_resize_provider_event(void *arg, int flag) +{ + struct g_hh00 *hh; + struct g_class *mp; + struct g_geom *gp; + struct g_provider *pp; + struct g_consumer *cp, *cp2; + off_t size; + + g_topology_assert(); + if (flag == EV_CANCEL) + return; + if (g_shutdown) + return; + + hh = arg; + pp = hh->pp; + size = hh->size; + + G_VALID_PROVIDER(pp); + g_trace(G_T_TOPOLOGY, "g_resize_provider_event(%p)", pp); + + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { + gp = cp->geom; + if (gp->resize == NULL && size < pp->mediasize) + cp->geom->orphan(cp); + } + + pp->mediasize = size; + + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { + gp = cp->geom; + if (gp->resize != NULL) + gp->resize(cp); + } + + /* + * After resizing, the previously invalid GEOM class metadata + * might become valid. This means we should retaste. + */ + LIST_FOREACH(mp, &g_classes, class) { + if (mp->taste == NULL) + continue; + LIST_FOREACH(cp, &pp->consumers, consumers) + if (cp->geom->class == mp) + break; + if (cp != NULL) + continue; + mp->taste(mp, pp, 0); + g_topology_assert(); + } +} + +void +g_resize_provider(struct g_provider *pp, off_t size) +{ + struct g_hh00 *hh; + + G_VALID_PROVIDER(pp); + + if (size == pp->mediasize) + return; + + hh = g_malloc(sizeof *hh, M_WAITOK | M_ZERO); + hh->pp = pp; + hh->size = size; + g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL); +} + struct g_provider * g_provider_by_name(char const *arg) { From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 20:21: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 A0309106564A; Sat, 7 Jul 2012 20:21:06 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 802068FC12; Sat, 7 Jul 2012 20:21:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q67KL6SX083774; Sat, 7 Jul 2012 20:21:06 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67KL6qc083771; Sat, 7 Jul 2012 20:21:06 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201207072021.q67KL6qc083771@svn.freebsd.org> From: Jack F Vogel Date: Sat, 7 Jul 2012 20:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238214 - head/sys/dev/e1000 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, 07 Jul 2012 20:21:06 -0000 Author: jfv Date: Sat Jul 7 20:21:05 2012 New Revision: 238214 URL: http://svn.freebsd.org/changeset/base/238214 Log: Change the interface to the Energy Efficient Ethernet (EEE) setting in the igb and em driver. This was necessitated by a shared code change that I was given late in the game, a data type changed from bool to int, in the last update I dealt with it by a cast, but it was pointed out (thanks jhb) that there was a potential problem with this. John suggested this safer approach, and it is fine with me... MFC after:2 days (to catch the 9.1 update) Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Jul 7 20:13:40 2012 (r238213) +++ head/sys/dev/e1000/if_em.c Sat Jul 7 20:21:05 2012 (r238214) @@ -289,6 +289,7 @@ static void em_handle_link(void *context static void em_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); static int em_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int em_sysctl_eee(SYSCTL_HANDLER_ARGS); static __inline void em_rx_discard(struct rx_ring *, int); @@ -389,7 +390,7 @@ SYSCTL_INT(_hw_em, OID_AUTO, rx_process_ "at a time, -1 means unlimited"); /* Energy efficient ethernet - default to OFF */ -static int eee_setting = 0; +static int eee_setting = 1; TUNABLE_INT("hw.em.eee_setting", &eee_setting); SYSCTL_INT(_hw_em, OID_AUTO, eee_setting, CTLFLAG_RDTUN, &eee_setting, 0, "Enable Energy Efficient Ethernet"); @@ -636,9 +637,12 @@ em_attach(device_t dev) " due to SOL/IDER session.\n"); /* Sysctl for setting Energy Efficient Ethernet */ - em_set_sysctl_value(adapter, "eee_control", - "enable Energy Efficient Ethernet", - (int *)&hw->dev_spec.ich8lan.eee_disable, eee_setting); + hw->dev_spec.ich8lan.eee_disable = eee_setting; + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "eee_control", CTLTYPE_INT|CTLFLAG_RW, + adapter, 0, em_sysctl_eee, "I", + "Disable Energy Efficient Ethernet"); /* ** Start from a known state, this is @@ -5695,6 +5699,27 @@ em_set_flowcntl(SYSCTL_HANDLER_ARGS) return (error); } +/* +** Manage Energy Efficient Ethernet: +** Control values: +** 0/1 - enabled/disabled +*/ +static int +em_sysctl_eee(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + int error, value; + + value = adapter->hw.dev_spec.ich8lan.eee_disable; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + EM_CORE_LOCK(adapter); + adapter->hw.dev_spec.ich8lan.eee_disable = (value != 0); + em_init_locked(adapter); + EM_CORE_UNLOCK(adapter); + return (0); +} static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS) Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Jul 7 20:13:40 2012 (r238213) +++ head/sys/dev/e1000/if_igb.c Sat Jul 7 20:21:05 2012 (r238214) @@ -277,6 +277,7 @@ static void igb_set_sysctl_value(struct const char *, int *, int); static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS); static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS); +static int igb_sysctl_eee(SYSCTL_HANDLER_ARGS); #ifdef DEVICE_POLLING static poll_handler_t igb_poll; @@ -586,10 +587,11 @@ igb_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "dmac", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, igb_sysctl_dmac, "I", "DMA Coalesce"); - igb_set_sysctl_value(adapter, "eee_disabled", - "enable Energy Efficient Ethernet", - (int *)&adapter->hw.dev_spec._82575.eee_disable, - TRUE); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "eee_disabled", CTLTYPE_INT|CTLFLAG_RW, + adapter, 0, igb_sysctl_eee, "I", + "Disable Energy Efficient Ethernet"); if (adapter->hw.phy.media_type == e1000_media_type_copper) e1000_set_eee_i350(&adapter->hw); } @@ -5988,3 +5990,25 @@ igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) igb_init(adapter); return (error); } + +/* +** Manage Energy Efficient Ethernet: +** Control values: +** 0/1 - enabled/disabled +*/ +static int +igb_sysctl_eee(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + int error, value; + + value = adapter->hw.dev_spec._82575.eee_disable; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + IGB_CORE_LOCK(adapter); + adapter->hw.dev_spec._82575.eee_disable = (value != 0); + igb_init_locked(adapter); + IGB_CORE_UNLOCK(adapter); + return (0); +} From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 20:32: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 B4F2E1065675; Sat, 7 Jul 2012 20:32:21 +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 9E9458FC14; Sat, 7 Jul 2012 20:32: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 q67KWL9p084780; Sat, 7 Jul 2012 20:32:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67KWLt8084775; Sat, 7 Jul 2012 20:32:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207072032.q67KWLt8084775@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 20:32: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: r238215 - in head: sbin/mdconfig sys/dev/md 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: Sat, 07 Jul 2012 20:32:21 -0000 Author: trasz Date: Sat Jul 7 20:32:21 2012 New Revision: 238215 URL: http://svn.freebsd.org/changeset/base/238215 Log: Make it possible to resize md(4) devices. Reviewed by: kib Sponsored by: FreeBSD Foundation Modified: head/sbin/mdconfig/mdconfig.8 head/sbin/mdconfig/mdconfig.c head/sys/dev/md/md.c head/sys/sys/mdioctl.h Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Sat Jul 7 20:21:05 2012 (r238214) +++ head/sbin/mdconfig/mdconfig.8 Sat Jul 7 20:32:21 2012 (r238215) @@ -64,6 +64,11 @@ .Fl u Ar unit .Op Fl o Oo Cm no Oc Ns Ar force .Nm +.Fl r +.Fl u Ar unit +.Fl s Ar size +.Op Fl o Oo Cm no Oc Ns Ar force +.Nm .Fl l .Op Fl n .Op Fl v @@ -85,6 +90,8 @@ This will configure and attach a memory parameters specified and attach it to the system. .It Fl d Detach a memory disk from the system and release all resources. +.It Fl r +Resize a memory disk. .It Fl t Ar type Select the type of the memory disk. .Bl -tag -width "malloc" Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Sat Jul 7 20:21:05 2012 (r238214) +++ head/sbin/mdconfig/mdconfig.c Sat Jul 7 20:32:21 2012 (r238215) @@ -54,7 +54,7 @@ #include static struct md_ioctl mdio; -static enum {UNSET, ATTACH, DETACH, LIST} action = UNSET; +static enum {UNSET, ATTACH, DETACH, RESIZE, LIST} action = UNSET; static int nflag; static void usage(void); @@ -81,6 +81,7 @@ usage(void) " [-s size] [-S sectorsize] [-u unit]\n" " [-x sectors/track] [-y heads/cylinder]\n" " mdconfig -d -u unit [-o [no]force]\n" +" mdconfig -r -u unit -s size [-o [no]force]\n" " mdconfig -l [-v] [-n] [-u unit]\n" " mdconfig file\n"); fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n"); @@ -96,7 +97,7 @@ main(int argc, char **argv) { int ch, fd, i, vflag; char *p; - char *fflag = NULL, *tflag = NULL, *uflag = NULL; + char *fflag = NULL, *sflag = NULL, *tflag = NULL, *uflag = NULL; bzero(&mdio, sizeof(mdio)); mdio.md_file = malloc(PATH_MAX); @@ -108,25 +109,32 @@ main(int argc, char **argv) if (argc == 1) usage(); - while ((ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:vx:y:")) != -1) { + while ((ch = getopt(argc, argv, "ab:df:lno:rs:S:t:u:vx:y:")) != -1) { switch (ch) { case 'a': if (action != UNSET && action != ATTACH) - errx(1, - "-a is mutually exclusive with -d and -l"); + errx(1, "-a is mutually exclusive " + "with -d, -r, and -l"); action = ATTACH; break; case 'd': if (action != UNSET && action != DETACH) - errx(1, - "-d is mutually exclusive with -a and -l"); + errx(1, "-d is mutually exclusive " + "with -a, -r, and -l"); action = DETACH; mdio.md_options |= MD_AUTOUNIT; break; + case 'r': + if (action != UNSET && action != RESIZE) + errx(1, "-r is mutually exclusive " + "with -a, -d, and -l"); + action = RESIZE; + mdio.md_options |= MD_AUTOUNIT; + break; case 'l': if (action != UNSET && action != LIST) - errx(1, - "-l is mutually exclusive with -a and -d"); + errx(1, "-l is mutually exclusive " + "with -a, -r, and -d"); action = LIST; mdio.md_options |= MD_AUTOUNIT; break; @@ -188,6 +196,9 @@ main(int argc, char **argv) mdio.md_sectorsize = strtoul(optarg, &p, 0); break; case 's': + if (sflag != NULL) + errx(1, "-s can be passed only once"); + sflag = optarg; mdio.md_mediasize = (off_t)strtoumax(optarg, &p, 0); if (p == NULL || *p == '\0') mdio.md_mediasize *= DEV_BSIZE; @@ -242,7 +253,7 @@ main(int argc, char **argv) mdio.md_type = MD_VNODE; mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; - } else if (mdio.md_mediasize != 0) { + } else if (sflag != NULL) { /* Imply ``-t swap'' */ mdio.md_type = MD_SWAP; mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | @@ -276,15 +287,15 @@ main(int argc, char **argv) } if ((mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP) && - mdio.md_mediasize == 0) + sflag == NULL) errx(1, "must specify -s for -t malloc or -t swap"); if (mdio.md_type == MD_VNODE && mdio.md_file[0] == '\0') errx(1, "must specify -f for -t vnode"); } else { if (mdio.md_sectorsize != 0) errx(1, "-S can only be used with -a"); - if (mdio.md_mediasize != 0) - errx(1, "-s can only be used with -a"); + if (action != RESIZE && sflag != NULL) + errx(1, "-s can only be used with -a and -r"); if (mdio.md_fwsectors != 0) errx(1, "-x can only be used with -a"); if (mdio.md_fwheads != 0) @@ -295,13 +306,20 @@ main(int argc, char **argv) errx(1, "-t can only be used with -a"); if (argc > 0) errx(1, "file can only be used with -a"); - if (action != DETACH && (mdio.md_options & ~MD_AUTOUNIT) != 0) - errx(1, "-o can only be used with -a and -d"); + if ((action != DETACH && action != RESIZE) && + (mdio.md_options & ~MD_AUTOUNIT) != 0) + errx(1, "-o can only be used with -a, -d, and -r"); if (action == DETACH && (mdio.md_options & ~(MD_FORCE | MD_AUTOUNIT)) != 0) errx(1, "only -o [no]force can be used with -d"); + if (action == RESIZE && + (mdio.md_options & ~(MD_FORCE | MD_RESERVE | MD_AUTOUNIT)) != 0) + errx(1, "only -o [no]force and -o [no]reserve can be used with -r"); } + if (action == RESIZE && sflag == NULL) + errx(1, "must specify -s for -r"); + if (action != LIST && vflag == OPT_VERBOSE) errx(1, "-v can only be used with -l"); @@ -333,6 +351,12 @@ main(int argc, char **argv) i = ioctl(fd, MDIOCDETACH, &mdio); if (i < 0) err(1, "ioctl(/dev/%s)", MDCTL_NAME); + } else if (action == RESIZE) { + if (mdio.md_options & MD_AUTOUNIT) + errx(1, "-r requires -u"); + i = ioctl(fd, MDIOCRESIZE, &mdio); + if (i < 0) + err(1, "ioctl(/dev/%s)", MDCTL_NAME); } else if (action == LIST) { if (mdio.md_options & MD_AUTOUNIT) { /* @@ -342,7 +366,6 @@ main(int argc, char **argv) md_list(NULL, OPT_LIST | vflag); } else return (md_query(uflag)); - } else usage(); close(fd); Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sat Jul 7 20:21:05 2012 (r238214) +++ head/sys/dev/md/md.c Sat Jul 7 20:32:21 2012 (r238215) @@ -1081,6 +1081,64 @@ mddestroy(struct md_s *sc, struct thread } static int +mdresize(struct md_s *sc, struct md_ioctl *mdio) +{ + int error, res; + vm_pindex_t oldpages, newpages; + + switch (sc->type) { + case MD_VNODE: + break; + case MD_SWAP: + if (mdio->md_mediasize == 0 || + (mdio->md_mediasize % PAGE_SIZE) != 0) + return (EDOM); + oldpages = OFF_TO_IDX(round_page(sc->mediasize)); + newpages = OFF_TO_IDX(round_page(mdio->md_mediasize)); + if (newpages < oldpages) { + VM_OBJECT_LOCK(sc->object); + vm_object_page_remove(sc->object, newpages, 0, 0); + swap_pager_freespace(sc->object, newpages, + oldpages - newpages); + swap_release_by_cred(IDX_TO_OFF(oldpages - + newpages), sc->cred); + sc->object->charge = IDX_TO_OFF(newpages); + sc->object->size = newpages; + VM_OBJECT_UNLOCK(sc->object); + } else if (newpages > oldpages) { + res = swap_reserve_by_cred(IDX_TO_OFF(newpages - + oldpages), sc->cred); + if (!res) + return (ENOMEM); + if ((mdio->md_options & MD_RESERVE) || + (sc->flags & MD_RESERVE)) { + error = swap_pager_reserve(sc->object, + oldpages, newpages - oldpages); + if (error < 0) { + swap_release_by_cred( + IDX_TO_OFF(newpages - oldpages), + sc->cred); + return (EDOM); + } + } + VM_OBJECT_LOCK(sc->object); + sc->object->charge = IDX_TO_OFF(newpages); + sc->object->size = newpages; + VM_OBJECT_UNLOCK(sc->object); + } + break; + default: + return (EOPNOTSUPP); + } + + sc->mediasize = mdio->md_mediasize; + g_topology_lock(); + g_resize_provider(sc->pp, sc->mediasize); + g_topology_unlock(); + return (0); +} + +static int mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) { vm_ooffset_t npage; @@ -1108,7 +1166,7 @@ mdcreate_swap(struct md_s *sc, struct md VM_PROT_DEFAULT, 0, td->td_ucred); if (sc->object == NULL) return (ENOMEM); - sc->flags = mdio->md_options & MD_FORCE; + sc->flags = mdio->md_options & (MD_FORCE | MD_RESERVE); if (mdio->md_options & MD_RESERVE) { if (swap_pager_reserve(sc->object, 0, npage) < 0) { error = EDOM; @@ -1217,6 +1275,18 @@ xmdctlioctl(struct cdev *dev, u_long cmd !(mdio->md_options & MD_FORCE)) return (EBUSY); return (mddestroy(sc, td)); + case MDIOCRESIZE: + if ((mdio->md_options & ~(MD_FORCE | MD_RESERVE)) != 0) + return (EINVAL); + + sc = mdfind(mdio->md_unit); + if (sc == NULL) + return (ENOENT); + if (mdio->md_mediasize < sc->mediasize && + !(sc->flags & MD_FORCE) && + !(mdio->md_options & MD_FORCE)) + return (EBUSY); + return (mdresize(sc, mdio)); case MDIOCQUERY: sc = mdfind(mdio->md_unit); if (sc == NULL) Modified: head/sys/sys/mdioctl.h ============================================================================== --- head/sys/sys/mdioctl.h Sat Jul 7 20:21:05 2012 (r238214) +++ head/sys/sys/mdioctl.h Sat Jul 7 20:32:21 2012 (r238215) @@ -79,6 +79,7 @@ struct md_ioctl { #define MDIOCDETACH _IOWR('m', 1, struct md_ioctl) /* detach disk */ #define MDIOCQUERY _IOWR('m', 2, struct md_ioctl) /* query status */ #define MDIOCLIST _IOWR('m', 3, struct md_ioctl) /* query status */ +#define MDIOCRESIZE _IOWR('m', 4, struct md_ioctl) /* resize disk */ #define MD_CLUSTER 0x01 /* Don't cluster */ #define MD_RESERVE 0x02 /* Pre-reserve swap */ From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 21:28:32 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 15092106566B; Sat, 7 Jul 2012 21:28:32 +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 DA9AD8FC08; Sat, 7 Jul 2012 21:28: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 q67LSVGe089359; Sat, 7 Jul 2012 21:28:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67LSVGh089356; Sat, 7 Jul 2012 21:28:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207072128.q67LSVGh089356@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 21:28: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: r238216 - head/sys/geom 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, 07 Jul 2012 21:28:32 -0000 Author: trasz Date: Sat Jul 7 21:28:31 2012 New Revision: 238216 URL: http://svn.freebsd.org/changeset/base/238216 Log: Add disk_resize(), to make it possible for the disk drivers such as da(4) to notify GEOM about LUN size change. Reviewed by: mav (earlier version) Sponsored by: FreeBSD Foundation Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat Jul 7 20:32:21 2012 (r238215) +++ head/sys/geom/geom_disk.c Sat Jul 7 21:28:31 2012 (r238216) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -65,6 +66,7 @@ struct g_disk_softc { struct sysctl_oid *sysctl_tree; char led[64]; uint32_t state; + struct task resize_task; }; static struct mtx g_disk_done_mtx; @@ -445,6 +447,27 @@ g_disk_dumpconf(struct sbuf *sb, const c } static void +g_disk_resize_task(void *context, int pending) +{ + struct g_geom *gp; + struct g_provider *pp; + struct disk *dp; + struct g_disk_softc *sc; + + sc = (struct g_disk_softc *)context; + dp = sc->dp; + gp = dp->d_geom; + + LIST_FOREACH(pp, &gp->provider, provider) { + if (pp->sectorsize != 0 && + pp->sectorsize != dp->d_sectorsize) + g_wither_provider(pp, ENXIO); + else + g_resize_provider(pp, dp->d_mediasize); + } +} + +static void g_disk_create(void *arg, int flag) { struct g_geom *gp; @@ -484,6 +507,7 @@ g_disk_create(void *arg, int flag) CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led), "LED name"); } + TASK_INIT(&sc->resize_task, 0, g_disk_resize_task, sc); pp->private = sc; dp->d_geom = gp; g_error_provider(pp, 0); @@ -635,6 +659,24 @@ disk_attr_changed(struct disk *dp, const (void)g_attr_changed(pp, attr, flag); } +void +disk_resize(struct disk *dp) +{ + struct g_geom *gp; + struct g_disk_softc *sc; + int error; + + gp = dp->d_geom; + + if (gp == NULL) + return; + + sc = gp->softc; + + error = taskqueue_enqueue(taskqueue_thread, &sc->resize_task); + KASSERT(error == 0, ("taskqueue_enqueue(9) failed.")); +} + static void g_kern_disks(void *p, int flag __unused) { Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Sat Jul 7 20:32:21 2012 (r238215) +++ head/sys/geom/geom_disk.h Sat Jul 7 21:28:31 2012 (r238216) @@ -109,6 +109,7 @@ void disk_create(struct disk *disk, int void disk_destroy(struct disk *disk); void disk_gone(struct disk *disk); void disk_attr_changed(struct disk *dp, const char *attr, int flag); +void disk_resize(struct disk *dp); #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 21:36: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 51CC3106566B; Sat, 7 Jul 2012 21:36:14 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 107968FC12; Sat, 7 Jul 2012 21:36:14 +0000 (UTC) Received: from dhcp-128-232-132-170.eduroam.csx.cam.ac.uk (dhcp-128-232-132-170.eduroam.csx.cam.ac.uk [128.232.132.170]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPSA id 3385E25D3887; Sat, 7 Jul 2012 21:36:13 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201207040737.q647br5k096035@svn.freebsd.org> Date: Sat, 7 Jul 2012 21:36:11 +0000 Content-Transfer-Encoding: 7bit Message-Id: References: <201207040737.q647br5k096035@svn.freebsd.org> To: Gleb Smirnoff 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: r238092 - in head/sys: net netinet netinet6 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, 07 Jul 2012 21:36:14 -0000 On 4. Jul 2012, at 07:37 , Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jul 4 07:37:53 2012 > New Revision: 238092 > URL: http://svn.freebsd.org/changeset/base/238092 > > Log: > When ip_output()/ip6_output() is supplied a struct route *ro argument, > it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning > here: it may be supplied to provide route, and it may be supplied to > store and return to caller the route that ip_output()/ip6_output() > finds. In the latter case skipping FLOWTABLE lookup is pessimisation. > > The difference between struct route filled by FLOWTABLE and filled > by rtalloc() family is that the former doesn't hold a reference on > its rtentry. Reference is hold by flow entry, and it is about to > be released in future. Thus, route filled by FLOWTABLE shouldn't > be passed to RTFREE() macro. > > - Introduce new flag for struct route/route_in6, that marks route > not holding a reference on rtentry. > - Introduce new macro RO_RTFREE() that cleans up a struct route > depending on its kind. > - All callers to ip_output()/ip6_output() that do supply non-NULL > but empty route should use RO_RTFREE() to free results of > lookup. > - ip_output()/ip6_output() now do FLOWTABLE lookup always when > ro->ro_rt == NULL. Just read the description but you realize that the proper fix is to make flowtable code a bit slower and do proper reference counting? Currently a cache flowtable entry might still be releases while a packet in being processed using it, right? If my memory serves me right the same is true for llentries cached from flowtable. Once that is fixed as well the proper way to free an lltable should be that the table does not go away while it still holds entry but if it's marked for deletion the cleanup of the last llentry should also free the table. This would revert parts of Kip's last commit and restore a proper teardown world order. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 21:56: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 D97CA1065672; Sat, 7 Jul 2012 21:56:42 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 523D18FC0A; Sat, 7 Jul 2012 21:56:42 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 6D43D58E; Sat, 7 Jul 2012 23:56:40 +0200 (CEST) Date: Sat, 7 Jul 2012 23:54:25 +0200 From: Pawel Jakub Dawidek To: Edward Tomasz Napierala Message-ID: <20120707215424.GE1437@garage.freebsd.pl> References: <201207072013.q67KDfHN082943@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qOrJKOH36bD5yhNe" Content-Disposition: inline In-Reply-To: <201207072013.q67KDfHN082943@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238213 - head/sys/geom 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, 07 Jul 2012 21:56:42 -0000 --qOrJKOH36bD5yhNe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 07, 2012 at 08:13:41PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Jul 7 20:13:40 2012 > New Revision: 238213 > URL: http://svn.freebsd.org/changeset/base/238213 >=20 > Log: > Add a new GEOM method, resize(), which is called after provider size ch= anges. > Add a new routine, g_resize_provider(), to use to notify GEOM about pro= vider > change. > =20 > Reviewed by: mav > Sponsored by: FreeBSD Foundation [...] > - void *spare2; > + g_resize_t *resize; [...] > - void *spare1; > + g_resize_t *resize; [...] If you take the time to actually read the commit log from the change that added those spare fields, you will notice they were not added for you to consume them. You will also notice that one of those fields were left for more universal method to handle various provider's property changes (ie. provider's name, apart from its mediasize). The initial patch was even published a year ago: http://people.freebsd.org/~pjd/patches/geom_property_change.patch Even if it was somehow totally not reusable it would at least give you a hint that mediasize is not the only thing that can change and if we are making that change it should be done right. > +static void > +g_resize_provider_event(void *arg, int flag) > +{ [...] > + if (flag =3D=3D EV_CANCEL) > + return; How it can be canceled? Because I'm clearly missing something. You post this event without giving any pointers, so how g_cancel_event() can find this event can cancel it? > + hh =3D arg; > + pp =3D hh->pp; > + size =3D hh->size; Where do you free the memory allocated for 'hh'? > + G_VALID_PROVIDER(pp); Is this your protection from a provider going away? > + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { > + gp =3D cp->geom; > + if (gp->resize =3D=3D NULL && size < pp->mediasize) > + cp->geom->orphan(cp); > + } Why is this safe to call the orphan method directly and not use g_orphan_provider()? I don't know if using g_orphan_provider() is safe to use here either, but I'm under impression that you assume no orphan method will ever drop the topology lock? We have tools to assert that, no need to introduce such weak assumptions. > +void > +g_resize_provider(struct g_provider *pp, off_t size) > +{ > + struct g_hh00 *hh; > + > + G_VALID_PROVIDER(pp); > + > + if (size =3D=3D pp->mediasize) > + return; > + > + hh =3D g_malloc(sizeof *hh, M_WAITOK | M_ZERO); > + hh->pp =3D pp; Care to explain why the provider can't disappear between now and the event thread calling g_resize_provider_event()? > + hh->size =3D size; > + g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL); --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --qOrJKOH36bD5yhNe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/4sBAACgkQForvXbEpPzTuBgCg5ONWpK+E0E3m67EjNXYif4YZ bREAoIeDpaV+3k3CFUYa+0yTeJkuz13D =WhYV -----END PGP SIGNATURE----- --qOrJKOH36bD5yhNe-- From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 22:19: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 E3588106564A; Sat, 7 Jul 2012 22:19:51 +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 CE8918FC08; Sat, 7 Jul 2012 22:19: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 q67MJpmB093573; Sat, 7 Jul 2012 22:19:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67MJpvW093571; Sat, 7 Jul 2012 22:19:51 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207072219.q67MJpvW093571@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 22:19: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: r238217 - head/sys/cam/scsi 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, 07 Jul 2012 22:19:52 -0000 Author: trasz Date: Sat Jul 7 22:19:51 2012 New Revision: 238217 URL: http://svn.freebsd.org/changeset/base/238217 Log: Make the da(4) driver notify GEOM about LUN size change. Reviewed by: mav Sponsored by: FreeBSD Foundation Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Jul 7 21:28:31 2012 (r238216) +++ head/sys/cam/scsi/scsi_da.c Sat Jul 7 22:19:51 2012 (r238217) @@ -2644,6 +2644,8 @@ dasetgeom(struct cam_periph *periph, uin softc->disk->d_flags |= DISKFLAG_CANDELETE; else softc->disk->d_flags &= ~DISKFLAG_CANDELETE; + + disk_resize(softc->disk); } static void From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 22:20: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 5FD561065673; Sat, 7 Jul 2012 22:20:48 +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 4B4488FC15; Sat, 7 Jul 2012 22:20: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 q67MKmHV093675; Sat, 7 Jul 2012 22:20:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67MKmg5093673; Sat, 7 Jul 2012 22:20:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207072220.q67MKmg5093673@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 22:20: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: r238218 - head/sys/geom/mountver 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, 07 Jul 2012 22:20:48 -0000 Author: trasz Date: Sat Jul 7 22:20:47 2012 New Revision: 238218 URL: http://svn.freebsd.org/changeset/base/238218 Log: Add trivial resize handling to gmountver(8). Reviewed by: mav Sponsored by: FreeBSD Foundation Modified: head/sys/geom/mountver/g_mountver.c Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Sat Jul 7 22:19:51 2012 (r238217) +++ head/sys/geom/mountver/g_mountver.c Sat Jul 7 22:20:47 2012 (r238218) @@ -59,6 +59,7 @@ static eventhandler_tag g_mountver_pre_s static void g_mountver_queue(struct bio *bp); static void g_mountver_orphan(struct g_consumer *cp); +static void g_mountver_resize(struct g_consumer *cp); static int g_mountver_destroy(struct g_geom *gp, boolean_t force); static g_taste_t g_mountver_taste; static int g_mountver_destroy_geom(struct gctl_req *req, struct g_class *mp, @@ -257,6 +258,7 @@ g_mountver_create(struct gctl_req *req, gp->softc = sc; gp->start = g_mountver_start; gp->orphan = g_mountver_orphan; + gp->resize = g_mountver_resize; gp->access = g_mountver_access; gp->dumpconf = g_mountver_dumpconf; @@ -457,6 +459,18 @@ g_mountver_orphan(struct g_consumer *cp) G_MOUNTVER_DEBUG(0, "%s is offline. Mount verification in progress.", sc->sc_provider_name); } +static void +g_mountver_resize(struct g_consumer *cp) +{ + struct g_geom *gp; + struct g_provider *pp; + + gp = cp->geom; + + LIST_FOREACH(pp, &gp->provider, provider) + g_resize_provider(pp, cp->provider->mediasize); +} + static int g_mountver_ident_matches(struct g_geom *gp) { From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 22:22: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 9FCAC1065672; Sat, 7 Jul 2012 22:22: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 713158FC1B; Sat, 7 Jul 2012 22:22: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 q67MME8m093833; Sat, 7 Jul 2012 22:22:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67MMEYE093830; Sat, 7 Jul 2012 22:22:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201207072222.q67MMEYE093830@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 7 Jul 2012 22:22: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: r238219 - head/sys/geom/nop 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, 07 Jul 2012 22:22:14 -0000 Author: trasz Date: Sat Jul 7 22:22:13 2012 New Revision: 238219 URL: http://svn.freebsd.org/changeset/base/238219 Log: Add trivial resize handling to gnop(8). Reviewed by: mav Sponsored by: FreeBSD Foundation Modified: head/sys/geom/nop/g_nop.c head/sys/geom/nop/g_nop.h Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Sat Jul 7 22:20:47 2012 (r238218) +++ head/sys/geom/nop/g_nop.c Sat Jul 7 22:22:13 2012 (r238219) @@ -72,6 +72,30 @@ g_nop_orphan(struct g_consumer *cp) } static void +g_nop_resize(struct g_consumer *cp) +{ + struct g_nop_softc *sc; + struct g_geom *gp; + struct g_provider *pp; + off_t size; + + g_topology_assert(); + + gp = cp->geom; + sc = gp->softc; + + if (sc->sc_explicitsize != 0) + return; + if (cp->provider->mediasize < sc->sc_offset) { + g_nop_destroy(gp, 1); + return; + } + size = cp->provider->mediasize - sc->sc_offset; + LIST_FOREACH(pp, &gp->provider, provider) + g_resize_provider(pp, size); +} + +static void g_nop_start(struct bio *bp) { struct g_nop_softc *sc; @@ -146,6 +170,7 @@ g_nop_create(struct gctl_req *req, struc struct g_consumer *cp; char name[64]; int error; + off_t explicitsize; g_topology_assert(); @@ -165,6 +190,7 @@ g_nop_create(struct gctl_req *req, struc gctl_error(req, "Invalid offset for provider %s.", pp->name); return (EINVAL); } + explicitsize = size; if (size == 0) size = pp->mediasize - offset; if (offset + size > pp->mediasize) { @@ -192,6 +218,7 @@ g_nop_create(struct gctl_req *req, struc gp = g_new_geomf(mp, name); sc = g_malloc(sizeof(*sc), M_WAITOK); sc->sc_offset = offset; + sc->sc_explicitsize = explicitsize; sc->sc_error = ioerror; sc->sc_rfailprob = rfailprob; sc->sc_wfailprob = wfailprob; @@ -202,6 +229,7 @@ g_nop_create(struct gctl_req *req, struc gp->softc = sc; gp->start = g_nop_start; gp->orphan = g_nop_orphan; + gp->resize = g_nop_resize; gp->access = g_nop_access; gp->dumpconf = g_nop_dumpconf; Modified: head/sys/geom/nop/g_nop.h ============================================================================== --- head/sys/geom/nop/g_nop.h Sat Jul 7 22:20:47 2012 (r238218) +++ head/sys/geom/nop/g_nop.h Sat Jul 7 22:22:13 2012 (r238219) @@ -57,6 +57,7 @@ struct g_nop_softc { int sc_error; off_t sc_offset; + off_t sc_explicitsize; u_int sc_rfailprob; u_int sc_wfailprob; uintmax_t sc_reads; From owner-svn-src-head@FreeBSD.ORG Sat Jul 7 22:53:43 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 90C30106564A; Sat, 7 Jul 2012 22:53:43 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 90A9E8FC19; Sat, 7 Jul 2012 22:53:42 +0000 (UTC) Received: by werp13 with SMTP id p13so6873866wer.13 for ; Sat, 07 Jul 2012 15:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.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; bh=WnGBx6JrrG5XDkGySBNV7y2mTSj1mRJTUIHGlRV365M=; b=0e+FY/WZQiEDdurkQGeutpbhysKTy7ND/pWOxXH82DkDJT77jTmsw51VQ03gr9THlX ntKeypI7F9EuqsZvbvxqet65LPtIAxNEzN0QO5m01UUf6/Od65jwO/Ss52iJBg2b1CdR 5gWj2jcfP+dsnWw3mBQIO0atVwC4tUg8gnT8s9GmpdYdgZ0B8y4G6PPswHjE42hDLQnH 0hkg/ofOan9VYX43KKC/gilmMpChgFjd5rw0hmSBsqyW8t5FSd+CPGz6DhfvRckV8ZQZ evwUBPA39JXSNz/9X8X2ZNlFAqfilL51NjggHWqdk3kwdrZq/K6iAkzZPAM1xYQdwHg/ /taw== Received: by 10.180.105.163 with SMTP id gn3mr18110951wib.2.1341701621340; Sat, 07 Jul 2012 15:53:41 -0700 (PDT) Received: from [192.168.119.14] (gate19.robnet.pl. [194.105.132.219]) by mx.google.com with ESMTPS id j6sm21308287wiy.4.2012.07.07.15.53.39 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Jul 2012 15:53:40 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <20120707215424.GE1437@garage.freebsd.pl> Date: Sun, 8 Jul 2012 00:53:37 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <280C8AEE-F7E8-4AAE-87BF-E59D0249B74F@FreeBSD.org> References: <201207072013.q67KDfHN082943@svn.freebsd.org> <20120707215424.GE1437@garage.freebsd.pl> To: Pawel Jakub Dawidek 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: r238213 - head/sys/geom 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, 07 Jul 2012 22:53:43 -0000 Wiadomo=B6=E6 napisana przez Pawel Jakub Dawidek w dniu 7 lip 2012, o = godz. 23:54: > On Sat, Jul 07, 2012 at 08:13:41PM +0000, Edward Tomasz Napierala = wrote: >> Author: trasz >> Date: Sat Jul 7 20:13:40 2012 >> New Revision: 238213 >> URL: http://svn.freebsd.org/changeset/base/238213 >>=20 >> Log: >> Add a new GEOM method, resize(), which is called after provider size = changes. >> Add a new routine, g_resize_provider(), to use to notify GEOM about = provider >> change. >>=20 >> Reviewed by: mav >> Sponsored by: FreeBSD Foundation > [...] >> - void *spare2; >> + g_resize_t *resize; > [...] >> - void *spare1; >> + g_resize_t *resize; > [...] >=20 > If you take the time to actually read the commit log from the change > that added those spare fields, you will notice they were not added for > you to consume them. Perhaps it wasn't your original intent, but they are spares. One of = these was already reused for some other task, btw. > You will also notice that one of those fields were left for more > universal method to handle various provider's property changes (ie. > provider's name, apart from its mediasize). The initial patch was even > published a year ago: >=20 > = http://people.freebsd.org/~pjd/patches/geom_property_change.patch >=20 > Even if it was somehow totally not reusable it would at least give you = a > hint that mediasize is not the only thing that can change and if we = are > making that change it should be done right. I was not aware of that patch. What I've considered was to use = attributes instead, but that would complicate notifying consumers about resizing and would require some special-casing in the attribute code. >> +static void >> +g_resize_provider_event(void *arg, int flag) >> +{ > [...] >> + if (flag =3D=3D EV_CANCEL) >> + return; >=20 > How it can be canceled? Because I'm clearly missing something. You = post > this event without giving any pointers, so how g_cancel_event() can = find > this event can cancel it? Copy-pasto, my bad. Thanks for spotting this. >> + hh =3D arg; >> + pp =3D hh->pp; >> + size =3D hh->size; >=20 > Where do you free the memory allocated for 'hh'? It should be here, and it will be added soon. >> + G_VALID_PROVIDER(pp); >=20 > Is this your protection from a provider going away? Can you suggest a way to do it in a safe way that doesn't involve rewriting most of GEOM? >> + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { >> + gp =3D cp->geom; >> + if (gp->resize =3D=3D NULL && size < pp->mediasize) >> + cp->geom->orphan(cp); >> + } >=20 > Why is this safe to call the orphan method directly and not use > g_orphan_provider()? I don't know if using g_orphan_provider() is safe > to use here either, but I'm under impression that you assume no orphan > method will ever drop the topology lock? We have tools to assert that, > no need to introduce such weak assumptions. It's not that using g_orphan_provider() would be safer here - it simply wouldn't work. The way it works is by adding providers to a queue (g_doorstep). _Providers_, and we need to orphan individual consumers. So, this would involve rewriting the orphanisation mechanism. Also, most of the classes were fixed by mav@ to handle this correctly, IIRC. >> +void >> +g_resize_provider(struct g_provider *pp, off_t size) >> +{ >> + struct g_hh00 *hh; >> + >> + G_VALID_PROVIDER(pp); >> + >> + if (size =3D=3D pp->mediasize) >> + return; >> + >> + hh =3D g_malloc(sizeof *hh, M_WAITOK | M_ZERO); >> + hh->pp =3D pp; >=20 > Care to explain why the provider can't disappear between now and the > event thread calling g_resize_provider_event()? See above. --=20 If you cut off my head, what would I say? Me and my head, or me and my = body?