From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 01:29:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 07C19E64; Sun, 18 Aug 2013 01:29:58 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF7A5265D; Sun, 18 Aug 2013 01:29:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7I1TvnN021272; Sun, 18 Aug 2013 01:29:57 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7I1Tvh5021271; Sun, 18 Aug 2013 01:29:57 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201308180129.r7I1Tvh5021271@svn.freebsd.org> From: Peter Wemm Date: Sun, 18 Aug 2013 01:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r254474 - X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 01:29:58 -0000 Author: peter Date: Sun Aug 18 01:29:57 2013 New Revision: 254474 URL: http://svnweb.freebsd.org/changeset/base/254474 Log: Add *.dts, *.dtsi, bsd.*.mk Submitted by: rpaulo Modified: Directory Properties: / (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 06:08:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A861779; Sun, 18 Aug 2013 06:08:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47AAF208D; Sun, 18 Aug 2013 06:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7I68rAe031515; Sun, 18 Aug 2013 06:08:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7I68qKF031513; Sun, 18 Aug 2013 06:08:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201308180608.r7I68qKF031513@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Aug 2013 06:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254476 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 06:08:53 -0000 Author: adrian Date: Sun Aug 18 06:08:52 2013 New Revision: 254476 URL: http://svnweb.freebsd.org/changeset/base/254476 Log: Add in missing events for Sandy Bridge Xeon. * Add in MEM_LOAD_UOPS_LLC_HIT_RETIRED for both sandy bridge and sandy bridge Xeon. Right now it only is enabled for Sandy Bridge. * D2/0F is actually a combination rather than a separate counter, so just flip that on for the CPU types that support it. There's an errata for using this on SB Xeon hardware - I've documented it in kern/181346. Tested: * Sandy Bridge * Sandy Bridge Xeon Sponsored by: Netflix, Inc. Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Sun Aug 18 04:22:13 2013 (r254475) +++ head/sys/dev/hwpmc/hwpmc_core.c Sun Aug 18 06:08:52 2013 (r254476) @@ -1541,15 +1541,21 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(D2H_01H, 0xD2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW), IAPDESCR(D2H_02H, 0xD2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW), IAPDESCR(D2H_04H, 0xD2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW), IAPDESCR(D2H_08H, 0xD2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_IBX | IAP_F_HW), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW), IAPDESCR(D2H_0FH, 0xD2, 0x0F, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM), + IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW), + IAPDESCR(D2H_10H, 0xD2, 0x10, IAP_F_FM | IAP_F_CC2E), IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX | Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Sun Aug 18 04:22:13 2013 (r254475) +++ head/sys/dev/hwpmc/pmc_events.h Sun Aug 18 06:08:52 2013 (r254476) @@ -2656,6 +2656,8 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE IAP_EVENT_D2H_04H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \ IAP_EVENT_D2H_08H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", \ + IAP_EVENT_D2H_0FH) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \ IAP_EVENT_D3H_01H) \ __PMC_EV_ALIAS("BACLEARS.ANY", IAP_EVENT_E6H_1FH) \ @@ -2859,6 +2861,8 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE IAP_EVENT_D2H_04H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \ IAP_EVENT_D2H_08H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", \ + IAP_EVENT_D2H_0FH) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \ IAP_EVENT_D3H_01H) \ __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \ @@ -3524,6 +3528,18 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2 __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_HIT", IAP_EVENT_D1H_04H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_MISS", IAP_EVENT_D1H_20H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.HIT_LFB", IAP_EVENT_D1H_40H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS", \ + IAP_EVENT_D2H_01H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT", \ + IAP_EVENT_D2H_02H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM", \ + IAP_EVENT_D2H_04H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \ + IAP_EVENT_D2H_08H) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", \ + IAP_EVENT_D2H_0FH) \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ + IAP_EVENT_D4H_02H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \ IAP_EVENT_D3H_01H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_DRAM", \ From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 06:25:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EF30999D; Sun, 18 Aug 2013 06:25:48 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-x22e.google.com (mail-ee0-x22e.google.com [IPv6:2a00:1450:4013:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B3FE2126; Sun, 18 Aug 2013 06:25:47 +0000 (UTC) Received: by mail-ee0-f46.google.com with SMTP id c13so1585882eek.33 for ; Sat, 17 Aug 2013 23:25:46 -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:message-id:subject :from:to:cc:content-type; bh=I2T0HS3iwAJQSjc9lfot2F0FOhcs5qwBp5eJ+ejfXks=; b=VmswhELtCivoUmQBwTUwmkO7phM+cZPBkfO2cUvQCpO7NNKxL5tZ76iJIHh8Mj4rFq XdWGEd2bL/lU+BaTfXp4xiLc+Uq7Ce6sHlA3Qs+ViTYNAzEQehCaLc9uzZ1QEWwvkkmq +QLb9fDgZgGWp75M57jBJPT0OUAKQtRZu1rqcVby4J8tClFJcaYrchEkpUMXxKB6PnXC 9Bur4ASsTU0+y0imoacHQNrKkWEbCJMQizDj0DQDh2WwW/3xm/z48P2B22UEpRZppvrB d4dHXSlEwieNkzokQBqUUR3oP13wkrpqmIyuieKvyXtEazGPTfP/1yZQodeo8Q/j9Hlt zlnQ== MIME-Version: 1.0 X-Received: by 10.15.26.66 with SMTP id m42mr132781eeu.73.1376807146140; Sat, 17 Aug 2013 23:25:46 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.105.137 with HTTP; Sat, 17 Aug 2013 23:25:46 -0700 (PDT) In-Reply-To: <201308180608.r7I68qKF031513@svn.freebsd.org> References: <201308180608.r7I68qKF031513@svn.freebsd.org> Date: Sat, 17 Aug 2013 23:25:46 -0700 X-Google-Sender-Auth: kzy0jsGxkKcsiNttTBKY5mKJLO0 Message-ID: Subject: Re: svn commit: r254476 - head/sys/dev/hwpmc From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 06:25:49 -0000 On Sat, Aug 17, 2013 at 11:08 PM, Adrian Chadd wrote: > Author: adrian > Date: Sun Aug 18 06:08:52 2013 > New Revision: 254476 > URL: http://svnweb.freebsd.org/changeset/base/254476 > > Log: > Add in missing events for Sandy Bridge Xeon. > > * Add in MEM_LOAD_UOPS_LLC_HIT_RETIRED for both sandy bridge and sandy > bridge Xeon. Right now it only is enabled for Sandy Bridge. > * D2/0F is actually a combination rather than a separate counter, so > just flip that on for the CPU types that support it. > > There's an errata for using this on SB Xeon hardware - I've documented > it in kern/181346. > > Tested: > > * Sandy Bridge > * Sandy Bridge Xeon > > Sponsored by: Netflix, Inc. > > Modified: > head/sys/dev/hwpmc/hwpmc_core.c > head/sys/dev/hwpmc/pmc_events.h > Please add new counters to sandybridge xeon manpage - man 3 pmc.sandybridgexeon Cheers, Hiren From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 08:18:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C22A159A; Sun, 18 Aug 2013 08:18:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE4F224C8; Sun, 18 Aug 2013 08:18:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7I8IoIZ041990; Sun, 18 Aug 2013 08:18:50 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7I8Iolw041964; Sun, 18 Aug 2013 08:18:50 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308180818.r7I8Iolw041964@svn.freebsd.org> From: Ed Maste Date: Sun, 18 Aug 2013 08:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254477 - stable/9/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 08:18:50 -0000 Author: emaste Date: Sun Aug 18 08:18:49 2013 New Revision: 254477 URL: http://svnweb.freebsd.org/changeset/base/254477 Log: MFC r239960: Properly enable Clang-style atomics when available. In addition to testing against cxx_atomic, we must check c_atomic. The former is only set when building C++ code. Also use __has_extension instead of __has_feature. This allows us to use the atomics outside of C11. PR: threads/170073 Modified: stable/9/include/stdatomic.h Directory Properties: stable/9/include/ (props changed) Modified: stable/9/include/stdatomic.h ============================================================================== --- stable/9/include/stdatomic.h Sun Aug 18 06:08:52 2013 (r254476) +++ stable/9/include/stdatomic.h Sun Aug 18 08:18:49 2013 (r254477) @@ -33,7 +33,7 @@ #include #include -#if __has_feature(cxx_atomic) +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) #define __GNUC_ATOMICS From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 08:24:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E31E1739; Sun, 18 Aug 2013 08:24:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF5382513; Sun, 18 Aug 2013 08:24:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7I8OwAG069139; Sun, 18 Aug 2013 08:24:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7I8OwqI069138; Sun, 18 Aug 2013 08:24:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308180824.r7I8OwqI069138@svn.freebsd.org> From: Ed Maste Date: Sun, 18 Aug 2013 08:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254478 - stable/9/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 08:24:59 -0000 Author: emaste Date: Sun Aug 18 08:24:58 2013 New Revision: 254478 URL: http://svnweb.freebsd.org/changeset/base/254478 Log: MFC r240970: - Make C11 atomic macros usable in expressions: - Replace do-while statements with void expressions. - Wrap __asm statements in statement expressions. - Make the macros function-like: - Evaluate all arguments exactly once. - Make sure there's a sequence point between evaluation of the arguments and the function body. Arguments should be evaluated before any memory barriers. - Fix use of __atomic_is_lock_free built-in. It requires the address of an atomic variable as second argument. Use this built-in on clang as well because clang's __c11_atomic_is_lock_free only takes the size of the variable into account. - In atomic_exchange_explicit put the barrier before instead of after the __sync_lock_test_and_set call. Modified: stable/9/include/stdatomic.h Directory Properties: stable/9/include/ (props changed) Modified: stable/9/include/stdatomic.h ============================================================================== --- stable/9/include/stdatomic.h Sun Aug 18 08:18:49 2013 (r254477) +++ stable/9/include/stdatomic.h Sun Aug 18 08:24:58 2013 (r254478) @@ -54,9 +54,7 @@ #define atomic_init(obj, value) __c11_atomic_init(obj, value) #else #define ATOMIC_VAR_INIT(value) { .__val = (value) } -#define atomic_init(obj, value) do { \ - (obj)->__val = (value); \ -} while (0) +#define atomic_init(obj, value) ((void)((obj)->__val = (value))) #endif /* @@ -111,23 +109,24 @@ enum memory_order { #define atomic_thread_fence(order) __atomic_thread_fence(order) #define atomic_signal_fence(order) __atomic_signal_fence(order) #else -#define atomic_thread_fence(order) __sync_synchronize() -#define atomic_signal_fence(order) __asm volatile ("" : : : "memory") +#define atomic_thread_fence(order) ((void)(order), __sync_synchronize()) +#define atomic_signal_fence(order) __extension__ ({ \ + (void)(order); \ + __asm volatile ("" ::: "memory"); \ + (void)0; \ +}) #endif /* * 7.17.5 Lock-free property. */ -#if defined(__CLANG_ATOMICS) -#define atomic_is_lock_free(obj) \ - __c11_atomic_is_lock_free(sizeof(obj)) -#elif defined(__GNUC_ATOMICS) +#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val)) + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->val) #else #define atomic_is_lock_free(obj) \ - (sizeof((obj)->__val) <= sizeof(void *)) + ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) #endif /* @@ -234,13 +233,17 @@ typedef _Atomic(__uintmax_t) atomic_uin __atomic_store_n(&(object)->__val, desired, order) #else #define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) ({ \ + desired, success, failure) __extension__ ({ \ __typeof__((object)->__val) __v; \ + __typeof__(expected) __e; \ _Bool __r; \ + __e = (expected); \ + (void)(success); \ + (void)(failure); \ __v = __sync_val_compare_and_swap(&(object)->__val, \ - *(expected), desired); \ - __r = *(expected) == __v; \ - *(expected) = __v; \ + *__e, (desired)); \ + __r = (*__e == __v); \ + *__e = __v; \ __r; \ }) @@ -250,19 +253,21 @@ typedef _Atomic(__uintmax_t) atomic_uin desired, success, failure) #if __has_builtin(__sync_swap) /* Clang provides a full-barrier atomic exchange - use it if available. */ -#define atomic_exchange_explicit(object, desired, order) \ - __sync_swap(&(object)->__val, desired) +#define atomic_exchange_explicit(object, desired, order) \ + ((void)(order), __sync_swap(&(object)->__val, desired)) #else /* * __sync_lock_test_and_set() is only an acquire barrier in theory (although in - * practice it is usually a full barrier) so we need an explicit barrier after + * practice it is usually a full barrier) so we need an explicit barrier before * it. */ -#define atomic_exchange_explicit(object, desired, order) ({ \ - __typeof__((object)->__val) __v; \ - __v = __sync_lock_test_and_set(&(object)->__val, desired); \ +#define atomic_exchange_explicit(object, desired, order) \ +__extension__ ({ \ + __typeof__(object) __o = (object); \ + __typeof__(desired) __d = (desired); \ + (void)(order); \ __sync_synchronize(); \ - __v; \ + __sync_lock_test_and_set(&(__o)->__val, __d); \ }) #endif #define atomic_fetch_add_explicit(object, operand, order) \ @@ -277,11 +282,14 @@ typedef _Atomic(__uintmax_t) atomic_uin __sync_fetch_and_xor(&(object)->__val, operand) #define atomic_load_explicit(object, order) \ __sync_fetch_and_add(&(object)->__val, 0) -#define atomic_store_explicit(object, desired, order) do { \ +#define atomic_store_explicit(object, desired, order) __extension__ ({ \ + __typeof__(object) __o = (object); \ + __typeof__(desired) __d = (desired); \ + (void)(order); \ __sync_synchronize(); \ - (object)->__val = (desired); \ + __o->__val = __d; \ __sync_synchronize(); \ -} while (0) +}) #endif /* From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 09:45:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 71A1D70A; Sun, 18 Aug 2013 09:45:17 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 31AA8283E; Sun, 18 Aug 2013 09:45:17 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VAza0-000N1j-5l; Sun, 18 Aug 2013 13:47:24 +0400 Date: Sun, 18 Aug 2013 13:47:24 +0400 From: Slawa Olhovchenkov To: Neel Natu Subject: Re: svn commit: r254466 - in head/sys/amd64: amd64 include Message-ID: <20130818094724.GA88321@zxy.spb.ru> References: <201308171949.r7HJn8sR091046@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201308171949.r7HJn8sR091046@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 09:45:17 -0000 On Sat, Aug 17, 2013 at 07:49:08PM +0000, Neel Natu wrote: > Author: neel > Date: Sat Aug 17 19:49:08 2013 > New Revision: 254466 > URL: http://svnweb.freebsd.org/changeset/base/254466 > > Log: > Bump up the maximum addressable memory on amd64 systems from 1TB to 4TB. > Bump up the KVA size proportionally from 512GB to 2TB. > > The number of page table pages used by the direct map is now calculated at > run time based on 'Maxmem'. This means the small memory systems will not > see any additional tax in terms of page table pages for the direct map. > > However all amd64 systems, regardless of the memory size, will use 3 more > pages to accomodate the bump in the KVA size. > > More details available here: > http://lists.freebsd.org/pipermail/freebsd-hackers/2013-June/043015.html > http://lists.freebsd.org/pipermail/freebsd-current/2013-July/043143.html > > Tested with the following configurations: > - Sandybridge server with 64GB of memory. > - bhyve VM with 64MB of memory. > - bhyve VM with a 8GB of memory with the memory segment above 4GB cuddling > right up against the 4TB maximum memory limit. > > Discussed on: hackers@, current@ > Submitted by: Chris Torek (torek@torek.net) > > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/amd64/include/pmap.h > head/sys/amd64/include/vmparam.h MFC planed? From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 09:45:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4371F84D; Sun, 18 Aug 2013 09:45:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3156F2848; Sun, 18 Aug 2013 09:45:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7I9jrmP016263; Sun, 18 Aug 2013 09:45:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7I9jrbb016259; Sun, 18 Aug 2013 09:45:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308180945.r7I9jrbb016259@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 09:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254479 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 09:45:53 -0000 Author: pjd Date: Sun Aug 18 09:45:52 2013 New Revision: 254479 URL: http://svnweb.freebsd.org/changeset/base/254479 Log: Better organize the filecaps structure, which reduces its size from 32 bytes to 24 bytes on 64bit archs. Modified: head/sys/sys/filedesc.h Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sun Aug 18 08:24:58 2013 (r254478) +++ head/sys/sys/filedesc.h Sun Aug 18 09:45:52 2013 (r254479) @@ -43,9 +43,9 @@ struct filecaps { cap_rights_t fc_rights; /* per-descriptor capability rights */ - uint32_t fc_fcntls; /* per-descriptor allowed fcntls */ u_long *fc_ioctls; /* per-descriptor allowed ioctls */ int16_t fc_nioctls; /* fc_ioctls array size */ + uint32_t fc_fcntls; /* per-descriptor allowed fcntls */ }; struct filedescent { From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 10:21:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF88FCC; Sun, 18 Aug 2013 10:21:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2D229D9; Sun, 18 Aug 2013 10:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IALV1B052059; Sun, 18 Aug 2013 10:21:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IALUgu051994; Sun, 18 Aug 2013 10:21:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181021.r7IALUgu051994@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 10:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254480 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 10:21:31 -0000 Author: pjd Date: Sun Aug 18 10:21:29 2013 New Revision: 254480 URL: http://svnweb.freebsd.org/changeset/base/254480 Log: Add process descriptors support to the GENERIC kernel. It is already being used by the tools in base systems and with sandboxing more and more tools the usage should only increase. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 MFC after: 1 month Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Aug 18 09:45:52 2013 (r254479) +++ head/sys/amd64/conf/GENERIC Sun Aug 18 10:21:29 2013 (r254480) @@ -66,6 +66,7 @@ options HWPMC_HOOKS # Necessary kernel options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities +options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Aug 18 09:45:52 2013 (r254479) +++ head/sys/i386/conf/GENERIC Sun Aug 18 10:21:29 2013 (r254480) @@ -67,6 +67,7 @@ options HWPMC_HOOKS # Necessary kernel options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities +options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sun Aug 18 09:45:52 2013 (r254479) +++ head/sys/ia64/conf/GENERIC Sun Aug 18 10:21:29 2013 (r254480) @@ -26,8 +26,8 @@ ident GENERIC makeoptions DEBUG=-g # Build kernel with debug information. options AUDIT # Security event auditing -options CAPABILITY_MODE # Capsicum capability mode -options CAPABILITIES # Capsicum capabilities +options CAPABILITY_MODE # Capsicum capability mode +options CAPABILITIES # Capsicum capabilities options CD9660 # ISO 9660 Filesystem options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options FFS # Berkeley Fast Filesystem @@ -46,6 +46,7 @@ options NFS_ROOT # NFS usable as root d options P1003_1B_SEMAPHORES # POSIX-style semaphores options PREEMPTION # Enable kernel thread preemption options PRINTF_BUFR_SIZE=128 # Printf buffering to limit interspersion +options PROCDESC # Support for process descriptors options PROCFS # Process filesystem (/proc) options PSEUDOFS # Pseudo-filesystem framework options SCHED_ULE # ULE scheduler Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Aug 18 09:45:52 2013 (r254479) +++ head/sys/pc98/conf/GENERIC Sun Aug 18 10:21:29 2013 (r254480) @@ -65,6 +65,7 @@ options HWPMC_HOOKS # Necessary kernel options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities +options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Aug 18 09:45:52 2013 (r254479) +++ head/sys/powerpc/conf/GENERIC Sun Aug 18 10:21:29 2013 (r254480) @@ -69,6 +69,7 @@ options HWPMC_HOOKS # Necessary kernel options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities +options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Aug 18 09:45:52 2013 (r254479) +++ head/sys/sparc64/conf/GENERIC Sun Aug 18 10:21:29 2013 (r254480) @@ -63,6 +63,7 @@ options HWPMC_HOOKS # Necessary kernel options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode options CAPABILITIES # Capsicum capabilities +options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 10:30:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0302A27A; Sun, 18 Aug 2013 10:30:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E390A2A26; Sun, 18 Aug 2013 10:30:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IAUg8D083240; Sun, 18 Aug 2013 10:30:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IAUfvb083190; Sun, 18 Aug 2013 10:30:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181030.r7IAUfvb083190@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 10:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254481 - in head/sys: compat/freebsd32 conf kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 10:30:43 -0000 Author: pjd Date: Sun Aug 18 10:30:41 2013 New Revision: 254481 URL: http://svnweb.freebsd.org/changeset/base/254481 Log: Implement 32bit versions of the cap_ioctls_limit(2) and cap_ioctls_get(2) system calls as unsigned longs have different size on i386 and amd64. Reported by: jilles Sponsored by: The FreeBSD Foundation Added: head/sys/compat/freebsd32/freebsd32_capability.c (contents, props changed) Modified: head/sys/compat/freebsd32/syscalls.master head/sys/conf/files head/sys/kern/sys_capability.c head/sys/sys/syscallsubr.h Added: head/sys/compat/freebsd32/freebsd32_capability.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/freebsd32/freebsd32_capability.c Sun Aug 18 10:30:41 2013 (r254481) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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 AUTHORS 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 AUTHORS 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_capsicum.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#ifdef CAPABILITIES + +MALLOC_DECLARE(M_FILECAPS); + +int +freebsd32_cap_ioctls_limit(struct thread *td, + struct freebsd32_cap_ioctls_limit_args *uap) +{ + u_long *cmds; + uint32_t *cmds32; + size_t ncmds; + u_int i; + int error; + + ncmds = uap->ncmds; + + if (ncmds > 256) /* XXX: Is 256 sane? */ + return (EINVAL); + + if (ncmds == 0) { + cmds = NULL; + } else { + cmds32 = malloc(sizeof(cmds32[0]) * ncmds, M_FILECAPS, M_WAITOK); + error = copyin(uap->cmds, cmds32, sizeof(cmds32[0]) * ncmds); + if (error != 0) { + free(cmds32, M_FILECAPS); + return (error); + } + cmds = malloc(sizeof(cmds[0]) * ncmds, M_FILECAPS, M_WAITOK); + for (i = 0; i < ncmds; i++) + cmds[i] = cmds32[i]; + free(cmds32, M_FILECAPS); + } + + return (kern_cap_ioctls_limit(td, uap->fd, cmds, ncmds)); +} + +int +freebsd32_cap_ioctls_get(struct thread *td, + struct freebsd32_cap_ioctls_get_args *uap) +{ + struct filedesc *fdp; + struct filedescent *fdep; + uint32_t *cmds32; + u_long *cmds; + size_t maxcmds; + int error, fd; + u_int i; + + fd = uap->fd; + cmds32 = uap->cmds; + maxcmds = uap->maxcmds; + + AUDIT_ARG_FD(fd); + + fdp = td->td_proc->p_fd; + FILEDESC_SLOCK(fdp); + + if (fget_locked(fdp, fd) == NULL) { + error = EBADF; + goto out; + } + + /* + * If all ioctls are allowed (fde_nioctls == -1 && fde_ioctls == NULL) + * the only sane thing we can do is to not populate the given array and + * return CAP_IOCTLS_ALL (actually, INT_MAX). + */ + + fdep = &fdp->fd_ofiles[fd]; + cmds = fdep->fde_ioctls; + if (cmds32 != NULL && cmds != NULL) { + for (i = 0; i < MIN(fdep->fde_nioctls, maxcmds); i++) { + error = suword32(&cmds32[i], cmds[i]); + if (error != 0) + goto out; + } + } + if (fdep->fde_nioctls == -1) + td->td_retval[0] = INT_MAX; + else + td->td_retval[0] = fdep->fde_nioctls; + + error = 0; +out: + FILEDESC_SUNLOCK(fdp); + return (error); +} + +#else /* !CAPABILITIES */ + +int +freebsd32_cap_ioctls_limit(struct thread *td, + struct freebsd32_cap_ioctls_limit_args *uap) +{ + + return (ENOSYS); +} + +int +freebsd32_cap_ioctls_get(struct thread *td, + struct freebsd32_cap_ioctls_get_args *uap) +{ + + return (ENOSYS); +} + +#endif /* CAPABILITIES */ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Aug 18 10:21:29 2013 (r254480) +++ head/sys/compat/freebsd32/syscalls.master Sun Aug 18 10:30:41 2013 (r254481) @@ -1032,10 +1032,12 @@ #endif 533 AUE_CAP_RIGHTS_LIMIT NOPROTO { int cap_rights_limit(int fd, \ uint64_t rights); } -534 AUE_CAP_IOCTLS_LIMIT NOPROTO { int cap_ioctls_limit(int fd, \ - const u_long *cmds, size_t ncmds); } -535 AUE_CAP_IOCTLS_GET NOPROTO { ssize_t cap_ioctls_get(int fd, \ - u_long *cmds, size_t maxcmds); } +534 AUE_CAP_IOCTLS_LIMIT STD { \ + int freebsd32_cap_ioctls_limit(int fd, \ + const uint32_t *cmds, size_t ncmds); } +535 AUE_CAP_IOCTLS_GET STD { \ + ssize_t freebsd32_cap_ioctls_get(int fd, \ + uint32_t *cmds, size_t maxcmds); } 536 AUE_CAP_FCNTLS_LIMIT NOPROTO { int cap_fcntls_limit(int fd, \ uint32_t fcntlrights); } 537 AUE_CAP_FCNTLS_GET NOPROTO { int cap_fcntls_get(int fd, \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Aug 18 10:21:29 2013 (r254480) +++ head/sys/conf/files Sun Aug 18 10:30:41 2013 (r254481) @@ -275,6 +275,7 @@ cddl/contrib/opensolaris/uts/common/zmod cddl/contrib/opensolaris/uts/common/zmod/zmod.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/zmod/zmod_subr.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/zmod/zutil.c optional zfs compile-with "${ZFS_C}" +compat/freebsd32/freebsd32_capability.c optional compat_freebsd32 compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32 compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32 Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sun Aug 18 10:21:29 2013 (r254480) +++ head/sys/kern/sys_capability.c Sun Aug 18 10:30:41 2013 (r254481) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -328,32 +329,14 @@ cap_ioctl_limit_check(struct filedesc *f } int -sys_cap_ioctls_limit(struct thread *td, struct cap_ioctls_limit_args *uap) +kern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds, size_t ncmds) { struct filedesc *fdp; - u_long *cmds, *ocmds; - size_t ncmds; - int error, fd; - - fd = uap->fd; - ncmds = uap->ncmds; + u_long *ocmds; + int error; AUDIT_ARG_FD(fd); - if (ncmds > 256) /* XXX: Is 256 sane? */ - return (EINVAL); - - if (ncmds == 0) { - cmds = NULL; - } else { - cmds = malloc(sizeof(cmds[0]) * ncmds, M_FILECAPS, M_WAITOK); - error = copyin(uap->cmds, cmds, sizeof(cmds[0]) * ncmds); - if (error != 0) { - free(cmds, M_FILECAPS); - return (error); - } - } - fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); @@ -379,6 +362,32 @@ out: } int +sys_cap_ioctls_limit(struct thread *td, struct cap_ioctls_limit_args *uap) +{ + u_long *cmds; + size_t ncmds; + int error; + + ncmds = uap->ncmds; + + if (ncmds > 256) /* XXX: Is 256 sane? */ + return (EINVAL); + + if (ncmds == 0) { + cmds = NULL; + } else { + cmds = malloc(sizeof(cmds[0]) * ncmds, M_FILECAPS, M_WAITOK); + error = copyin(uap->cmds, cmds, sizeof(cmds[0]) * ncmds); + if (error != 0) { + free(cmds, M_FILECAPS); + return (error); + } + } + + return (kern_cap_ioctls_limit(td, uap->fd, cmds, ncmds)); +} + +int sys_cap_ioctls_get(struct thread *td, struct cap_ioctls_get_args *uap) { struct filedesc *fdp; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Sun Aug 18 10:21:29 2013 (r254480) +++ head/sys/sys/syscallsubr.h Sun Aug 18 10:30:41 2013 (r254481) @@ -71,6 +71,8 @@ int kern_adjtime(struct thread *td, stru int kern_alternate_path(struct thread *td, const char *prefix, const char *path, enum uio_seg pathseg, char **pathbuf, int create, int dirfd); int kern_bind(struct thread *td, int fd, struct sockaddr *sa); +int kern_cap_ioctls_limit(struct thread *td, int fd, u_long *cmds, + size_t ncmds); int kern_chdir(struct thread *td, char *path, enum uio_seg pathseg); int kern_chmod(struct thread *td, char *path, enum uio_seg pathseg, int mode); From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 10:31:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9B3E83BA; Sun, 18 Aug 2013 10:31:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87DA22A30; Sun, 18 Aug 2013 10:31:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IAVVg2085800; Sun, 18 Aug 2013 10:31:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IAVUsO085736; Sun, 18 Aug 2013 10:31:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181031.r7IAVUsO085736@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 10:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254482 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 10:31:31 -0000 Author: pjd Date: Sun Aug 18 10:31:30 2013 New Revision: 254482 URL: http://svnweb.freebsd.org/changeset/base/254482 Log: Regenerate after r254481. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 10:30:41 2013 (r254481) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 10:31:30 2013 (r254482) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 2013-08-17 14:17:13Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -653,6 +653,16 @@ struct freebsd32_wait6_args { char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; #endif +struct freebsd32_cap_ioctls_limit_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char cmds_l_[PADL_(const uint32_t *)]; const uint32_t * cmds; char cmds_r_[PADR_(const uint32_t *)]; + char ncmds_l_[PADL_(size_t)]; size_t ncmds; char ncmds_r_[PADR_(size_t)]; +}; +struct freebsd32_cap_ioctls_get_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char cmds_l_[PADL_(uint32_t *)]; uint32_t * cmds; char cmds_r_[PADR_(uint32_t *)]; + char maxcmds_l_[PADL_(size_t)]; size_t maxcmds; char maxcmds_r_[PADR_(size_t)]; +}; struct freebsd32_aio_mlock_args { char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; }; @@ -779,6 +789,8 @@ int freebsd32_posix_fallocate(struct thr int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); #endif +int freebsd32_cap_ioctls_limit(struct thread *, struct freebsd32_cap_ioctls_limit_args *); +int freebsd32_cap_ioctls_get(struct thread *, struct freebsd32_cap_ioctls_get_args *); int freebsd32_aio_mlock(struct thread *, struct freebsd32_aio_mlock_args *); #ifdef COMPAT_43 @@ -1177,6 +1189,8 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 +#define FREEBSD32_SYS_AUE_freebsd32_cap_ioctls_limit AUE_CAP_IOCTLS_LIMIT +#define FREEBSD32_SYS_AUE_freebsd32_cap_ioctls_get AUE_CAP_IOCTLS_GET #define FREEBSD32_SYS_AUE_freebsd32_aio_mlock AUE_NULL #undef PAD_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sun Aug 18 10:30:41 2013 (r254481) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sun Aug 18 10:31:30 2013 (r254482) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 2013-08-17 14:17:13Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd */ #define FREEBSD32_SYS_syscall 0 @@ -442,8 +442,8 @@ #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 #define FREEBSD32_SYS_freebsd32_wait6 532 #define FREEBSD32_SYS_cap_rights_limit 533 -#define FREEBSD32_SYS_cap_ioctls_limit 534 -#define FREEBSD32_SYS_cap_ioctls_get 535 +#define FREEBSD32_SYS_freebsd32_cap_ioctls_limit 534 +#define FREEBSD32_SYS_freebsd32_cap_ioctls_get 535 #define FREEBSD32_SYS_cap_fcntls_limit 536 #define FREEBSD32_SYS_cap_fcntls_get 537 #define FREEBSD32_SYS_bindat 538 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Aug 18 10:30:41 2013 (r254481) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Aug 18 10:31:30 2013 (r254482) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 2013-08-17 14:17:13Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd */ const char *freebsd32_syscallnames[] = { @@ -563,8 +563,8 @@ const char *freebsd32_syscallnames[] = { "freebsd32_wait6", /* 532 = freebsd32_wait6 */ #endif "cap_rights_limit", /* 533 = cap_rights_limit */ - "cap_ioctls_limit", /* 534 = cap_ioctls_limit */ - "cap_ioctls_get", /* 535 = cap_ioctls_get */ + "freebsd32_cap_ioctls_limit", /* 534 = freebsd32_cap_ioctls_limit */ + "freebsd32_cap_ioctls_get", /* 535 = freebsd32_cap_ioctls_get */ "cap_fcntls_limit", /* 536 = cap_fcntls_limit */ "cap_fcntls_get", /* 537 = cap_fcntls_get */ "bindat", /* 538 = bindat */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sun Aug 18 10:30:41 2013 (r254481) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sun Aug 18 10:31:30 2013 (r254482) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254447 2013-08-17 14:17:13Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd */ #include "opt_compat.h" @@ -600,8 +600,8 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #endif { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 533 = cap_rights_limit */ - { AS(cap_ioctls_limit_args), (sy_call_t *)sys_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 534 = cap_ioctls_limit */ - { AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = cap_ioctls_get */ + { AS(freebsd32_cap_ioctls_limit_args), (sy_call_t *)freebsd32_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 534 = freebsd32_cap_ioctls_limit */ + { AS(freebsd32_cap_ioctls_get_args), (sy_call_t *)freebsd32_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = freebsd32_cap_ioctls_get */ { AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 536 = cap_fcntls_limit */ { AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 537 = cap_fcntls_get */ { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 538 = bindat */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Aug 18 10:30:41 2013 (r254481) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Aug 18 10:31:30 2013 (r254482) @@ -3205,20 +3205,20 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } - /* cap_ioctls_limit */ + /* freebsd32_cap_ioctls_limit */ case 534: { - struct cap_ioctls_limit_args *p = params; + struct freebsd32_cap_ioctls_limit_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->cmds; /* const u_long * */ + uarg[1] = (intptr_t) p->cmds; /* const uint32_t * */ uarg[2] = p->ncmds; /* size_t */ *n_args = 3; break; } - /* cap_ioctls_get */ + /* freebsd32_cap_ioctls_get */ case 535: { - struct cap_ioctls_get_args *p = params; + struct freebsd32_cap_ioctls_get_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->cmds; /* u_long * */ + uarg[1] = (intptr_t) p->cmds; /* uint32_t * */ uarg[2] = p->maxcmds; /* size_t */ *n_args = 3; break; @@ -8662,14 +8662,14 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* cap_ioctls_limit */ + /* freebsd32_cap_ioctls_limit */ case 534: switch(ndx) { case 0: p = "int"; break; case 1: - p = "const u_long *"; + p = "const uint32_t *"; break; case 2: p = "size_t"; @@ -8678,14 +8678,14 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* cap_ioctls_get */ + /* freebsd32_cap_ioctls_get */ case 535: switch(ndx) { case 0: p = "int"; break; case 1: - p = "u_long *"; + p = "uint32_t *"; break; case 2: p = "size_t"; @@ -10644,12 +10644,12 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* cap_ioctls_limit */ + /* freebsd32_cap_ioctls_limit */ case 534: if (ndx == 0 || ndx == 1) p = "int"; break; - /* cap_ioctls_get */ + /* freebsd32_cap_ioctls_get */ case 535: if (ndx == 0 || ndx == 1) p = "ssize_t"; From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 10:33:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F431511; Sun, 18 Aug 2013 10:33:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CB172A3E; Sun, 18 Aug 2013 10:33:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IAXkDB092423; Sun, 18 Aug 2013 10:33:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IAXk2p092422; Sun, 18 Aug 2013 10:33:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181033.r7IAXk2p092422@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 10:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254483 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 10:33:47 -0000 Author: pjd Date: Sun Aug 18 10:33:46 2013 New Revision: 254483 URL: http://svnweb.freebsd.org/changeset/base/254483 Log: Make example more correct (errstr is a pointer, not boolean). Modified: head/lib/libc/stdlib/strtonum.3 Modified: head/lib/libc/stdlib/strtonum.3 ============================================================================== --- head/lib/libc/stdlib/strtonum.3 Sun Aug 18 10:31:30 2013 (r254482) +++ head/lib/libc/stdlib/strtonum.3 Sun Aug 18 10:33:46 2013 (r254483) @@ -97,7 +97,7 @@ int iterations; const char *errstr; iterations = strtonum(optarg, 1, 64, &errstr); -if (errstr) +if (errstr != NULL) errx(1, "number of iterations is %s: %s", errstr, optarg); .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 10:38:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B21D56A0; Sun, 18 Aug 2013 10:38:59 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC9B2A60; Sun, 18 Aug 2013 10:38:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IAcxDf008488; Sun, 18 Aug 2013 10:38:59 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IAcxkM008487; Sun, 18 Aug 2013 10:38:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181038.r7IAcxkM008487@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 10:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254484 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 10:38:59 -0000 Author: pjd Date: Sun Aug 18 10:38:59 2013 New Revision: 254484 URL: http://svnweb.freebsd.org/changeset/base/254484 Log: Consistently use 'af' as an argument name for address family. Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument name. The same argument name is also used in implementations of those functions. Modified: head/lib/libc/net/gethostbyname.3 Modified: head/lib/libc/net/gethostbyname.3 ============================================================================== --- head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:33:46 2013 (r254483) +++ head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:38:59 2013 (r254484) @@ -51,7 +51,7 @@ .Ft struct hostent * .Fn gethostbyname2 "const char *name" "int af" .Ft struct hostent * -.Fn gethostbyaddr "const void *addr" "socklen_t len" "int type" +.Fn gethostbyaddr "const void *addr" "socklen_t len" "int af" .Ft struct hostent * .Fn gethostent void .Ft void @@ -107,7 +107,7 @@ in binary form .Tn ASCII form). The -.Fa type +.Fa af argument specifies the address family (e.g.\& .Dv AF_INET , AF_INET6 , From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 10:44:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5AD9F9E8; Sun, 18 Aug 2013 10:44:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 472DC2AC6; Sun, 18 Aug 2013 10:44:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IAicFJ027366; Sun, 18 Aug 2013 10:44:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IAicib027364; Sun, 18 Aug 2013 10:44:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181044.r7IAicib027364@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 10:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254485 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 10:44:38 -0000 Author: pjd Date: Sun Aug 18 10:44:37 2013 New Revision: 254485 URL: http://svnweb.freebsd.org/changeset/base/254485 Log: Make the "FD" column one character wider, so that "trace" can also align properly. Modified: head/usr.bin/procstat/procstat_files.c Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sun Aug 18 10:38:59 2013 (r254484) +++ head/usr.bin/procstat/procstat_files.c Sun Aug 18 10:44:37 2013 (r254485) @@ -332,19 +332,19 @@ procstat_files(struct procstat *procstat printf("%5d ", kipp->ki_pid); printf("%-16s ", kipp->ki_comm); if (fst->fs_uflags & PS_FST_UFLAG_CTTY) - printf("ctty "); + printf(" ctty "); else if (fst->fs_uflags & PS_FST_UFLAG_CDIR) - printf(" cwd "); + printf(" cwd "); else if (fst->fs_uflags & PS_FST_UFLAG_JAIL) - printf("jail "); + printf(" jail "); else if (fst->fs_uflags & PS_FST_UFLAG_RDIR) - printf("root "); + printf(" root "); else if (fst->fs_uflags & PS_FST_UFLAG_TEXT) - printf("text "); + printf(" text "); else if (fst->fs_uflags & PS_FST_UFLAG_TRACE) printf("trace "); else - printf("%4d ", fst->fs_fd); + printf("%5d ", fst->fs_fd); switch (fst->fs_type) { case PS_FST_TYPE_VNODE: From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 11:25:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4CAB317E; Sun, 18 Aug 2013 11:25:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3990E223D; Sun, 18 Aug 2013 11:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IBPh1G048705; Sun, 18 Aug 2013 11:25:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IBPhLV048702; Sun, 18 Aug 2013 11:25:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181125.r7IBPhLV048702@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 11:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254486 - head/usr.sbin/rwhod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 11:25:43 -0000 Author: pjd Date: Sun Aug 18 11:25:42 2013 New Revision: 254486 URL: http://svnweb.freebsd.org/changeset/base/254486 Log: Cast argument of is*() ctype functions to unsigned char. Without the cast there is ambiguity between 0xFF and -1 (EOF). Suggested by: jilles Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Sun Aug 18 10:44:37 2013 (r254485) +++ head/usr.sbin/rwhod/rwhod.c Sun Aug 18 11:25:42 2013 (r254486) @@ -337,8 +337,11 @@ verify(char *name, int maxlen) size = 0; while (*name != '\0' && size < maxlen - 1) { - if (!isascii(*name) || !(isalnum(*name) || ispunct(*name))) + if (!isascii((unsigned char)*name) || + !(isalnum((unsigned char)*name) || + ispunct((unsigned char)*name))) { return (0); + } name++; size++; } From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 11:54:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 47B542A5; Sun, 18 Aug 2013 11:54:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2CCE823C3; Sun, 18 Aug 2013 11:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IBsLod025474; Sun, 18 Aug 2013 11:54:21 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IBsL5n025473; Sun, 18 Aug 2013 11:54:21 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308181154.r7IBsL5n025473@svn.freebsd.org> From: Andrew Turner Date: Sun, 18 Aug 2013 11:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254487 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 11:54:21 -0000 Author: andrew Date: Sun Aug 18 11:54:20 2013 New Revision: 254487 URL: http://svnweb.freebsd.org/changeset/base/254487 Log: Enable VFP support on EFIKA MX. Modified: head/sys/arm/conf/EFIKA_MX Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Sun Aug 18 11:25:42 2013 (r254486) +++ head/sys/arm/conf/EFIKA_MX Sun Aug 18 11:54:20 2013 (r254487) @@ -58,6 +58,7 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options INCLUDE_CONFIG_FILE # Include this file in kernel +options VFP # vfp/neon # required for netbooting #options BOOTP From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 13:25:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DF4DCA40; Sun, 18 Aug 2013 13:25:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B22BF275E; Sun, 18 Aug 2013 13:25:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IDPISY048082; Sun, 18 Aug 2013 13:25:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IDPIOL048080; Sun, 18 Aug 2013 13:25:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308181325.r7IDPIOL048080@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Aug 2013 13:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254488 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 13:25:19 -0000 Author: jilles Date: Sun Aug 18 13:25:18 2013 New Revision: 254488 URL: http://svnweb.freebsd.org/changeset/base/254488 Log: dup3(3): Replace copyright notice. Although I copied dup(2) to create dup3(3), I removed almost all the non-boilerplate, so dup3(3) is copyright me. Reported by: bjk Modified: head/lib/libc/gen/dup3.3 Modified: head/lib/libc/gen/dup3.3 ============================================================================== --- head/lib/libc/gen/dup3.3 Sun Aug 18 11:54:20 2013 (r254487) +++ head/lib/libc/gen/dup3.3 Sun Aug 18 13:25:18 2013 (r254488) @@ -1,5 +1,5 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2013 Jilles Tjoelker +.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -9,14 +9,11 @@ .\" 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. -.\" 4. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" 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 REGENTS OR CONTRIBUTORS BE LIABLE +.\" 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) @@ -25,7 +22,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)dup.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" .Dd August 16, 2013 From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 13:27:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1857CB93; Sun, 18 Aug 2013 13:27:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 051252768; Sun, 18 Aug 2013 13:27:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IDR4qZ051795; Sun, 18 Aug 2013 13:27:04 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IDR4Xg051791; Sun, 18 Aug 2013 13:27:04 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308181327.r7IDR4Xg051791@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Aug 2013 13:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 13:27:05 -0000 Author: jilles Date: Sun Aug 18 13:27:04 2013 New Revision: 254489 URL: http://svnweb.freebsd.org/changeset/base/254489 Log: Disallow opening a POSIX message queue for execute. O_EXEC was formerly ignored, so equivalent to O_RDONLY. Reject O_EXEC with [EINVAL] like the invalid mode 3. Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sun Aug 18 13:25:18 2013 (r254488) +++ head/sys/kern/uipc_mqueue.c Sun Aug 18 13:27:04 2013 (r254489) @@ -2046,7 +2046,7 @@ sys_kmq_open(struct thread *td, struct k struct mq_attr attr; int flags, error; - if ((uap->flags & O_ACCMODE) == O_ACCMODE) + if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC) return (EINVAL); flags = FFLAGS(uap->flags); if ((flags & O_CREAT) != 0 && uap->attr != NULL) { @@ -2682,7 +2682,7 @@ freebsd32_kmq_open(struct thread *td, st struct mq_attr32 attr32; int flags, error; - if ((uap->flags & O_ACCMODE) == O_ACCMODE) + if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC) return (EINVAL); flags = FFLAGS(uap->flags); if ((flags & O_CREAT) != 0 && uap->attr != NULL) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 13:34:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67FB3FE5; Sun, 18 Aug 2013 13:34:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53F3B27C4; Sun, 18 Aug 2013 13:34:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IDYCop068618; Sun, 18 Aug 2013 13:34:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IDYBpt068604; Sun, 18 Aug 2013 13:34:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181334.r7IDYBpt068604@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 13:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254490 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 13:34:12 -0000 Author: pjd Date: Sun Aug 18 13:34:11 2013 New Revision: 254490 URL: http://svnweb.freebsd.org/changeset/base/254490 Log: Move the PAIR32TO64() macro and the RETVAL_HI/RETVAL_LO defines to a header file for use by other .c files. Sponsored by: The FreeBSD Foundation Added: head/sys/compat/freebsd32/freebsd32_misc.h (contents, props changed) Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Aug 18 13:27:04 2013 (r254489) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Aug 18 13:34:11 2013 (r254490) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -128,16 +129,6 @@ CTASSERT(sizeof(struct sigaction32) == 2 static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count); static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count); -#if BYTE_ORDER == BIG_ENDIAN -#define PAIR32TO64(type, name) ((name ## 2) | ((type)(name ## 1) << 32)) -#define RETVAL_HI 0 -#define RETVAL_LO 1 -#else -#define PAIR32TO64(type, name) ((name ## 1) | ((type)(name ## 2) << 32)) -#define RETVAL_HI 1 -#define RETVAL_LO 0 -#endif - void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32) { Added: head/sys/compat/freebsd32/freebsd32_misc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/freebsd32/freebsd32_misc.h Sun Aug 18 13:34:11 2013 (r254490) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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 AUTHORS 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 AUTHORS 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 _COMPAT_FREEBSD32_MISC_H_ +#define _COMPAT_FREEBSD32_MISC_H_ + +#include + +#if BYTE_ORDER == BIG_ENDIAN +#define PAIR32TO64(type, name) ((name ## 2) | ((type)(name ## 1) << 32)) +#define RETVAL_HI 0 +#define RETVAL_LO 1 +#else +#define PAIR32TO64(type, name) ((name ## 1) | ((type)(name ## 2) << 32)) +#define RETVAL_HI 1 +#define RETVAL_LO 0 +#endif + +#endif /* !_COMPAT_FREEBSD32_MISC_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 13:37:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D7C801BC; Sun, 18 Aug 2013 13:37:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B63A427D2; Sun, 18 Aug 2013 13:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IDbtlo076179; Sun, 18 Aug 2013 13:37:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IDbtjm076169; Sun, 18 Aug 2013 13:37:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181337.r7IDbtjm076169@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 13:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254491 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 13:37:56 -0000 Author: pjd Date: Sun Aug 18 13:37:54 2013 New Revision: 254491 URL: http://svnweb.freebsd.org/changeset/base/254491 Log: The cap_rights_limit(2) system calls needs a wrapper for 32bit binaries running under 64bit kernels as the 'rights' argument has to be split into two registers or the half of the rights will disappear. Reported by: jilles Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/freebsd32/freebsd32_capability.c head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/freebsd32_capability.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_capability.c Sun Aug 18 13:34:11 2013 (r254490) +++ head/sys/compat/freebsd32/freebsd32_capability.c Sun Aug 18 13:37:54 2013 (r254491) @@ -38,9 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #ifdef CAPABILITIES @@ -48,6 +50,17 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_FILECAPS); int +freebsd32_cap_rights_limit(struct thread *td, + struct freebsd32_cap_rights_limit_args *uap) +{ + struct cap_rights_limit_args ap; + + ap.fd = uap->fd; + ap.rights = PAIR32TO64(uint64_t, uap->rights); + return (sys_cap_rights_limit(td, &ap)); +} + +int freebsd32_cap_ioctls_limit(struct thread *td, struct freebsd32_cap_ioctls_limit_args *uap) { @@ -135,6 +148,14 @@ out: #else /* !CAPABILITIES */ int +freebsd32_cap_rights_limit(struct thread *td, + struct freebsd32_cap_rights_limit_args *uap) +{ + + return (ENOSYS); +} + +int freebsd32_cap_ioctls_limit(struct thread *td, struct freebsd32_cap_ioctls_limit_args *uap) { Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Aug 18 13:34:11 2013 (r254490) +++ head/sys/compat/freebsd32/syscalls.master Sun Aug 18 13:37:54 2013 (r254491) @@ -1016,6 +1016,10 @@ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } +533 AUE_CAP_RIGHTS_LIMIT STD { \ + int freebsd32_cap_rights_limit(int fd, \ + int pad, \ + uint32_t rights1, uint32_t rights2); } #else 530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ uint32_t offset1, uint32_t offset2,\ @@ -1029,9 +1033,10 @@ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } +533 AUE_CAP_RIGHTS_LIMIT STD { \ + int freebsd32_cap_rights_limit(int fd, \ + uint32_t rights1, uint32_t rights2); } #endif -533 AUE_CAP_RIGHTS_LIMIT NOPROTO { int cap_rights_limit(int fd, \ - uint64_t rights); } 534 AUE_CAP_IOCTLS_LIMIT STD { \ int freebsd32_cap_ioctls_limit(int fd, \ const uint32_t *cmds, size_t ncmds); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 13:38:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CAAB32F3; Sun, 18 Aug 2013 13:38:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B716627D7; Sun, 18 Aug 2013 13:38:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IDceaM077754; Sun, 18 Aug 2013 13:38:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IDcdM0077720; Sun, 18 Aug 2013 13:38:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181338.r7IDcdM0077720@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 13:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254492 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 13:38:41 -0000 Author: pjd Date: Sun Aug 18 13:38:39 2013 New Revision: 254492 URL: http://svnweb.freebsd.org/changeset/base/254492 Log: Regenerate after r254491. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 13:37:54 2013 (r254491) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sun Aug 18 13:38:39 2013 (r254492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254491 2013-08-18 13:37:54Z pjd */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -627,6 +627,12 @@ struct freebsd32_wait6_args { char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +struct freebsd32_cap_rights_limit_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char rights1_l_[PADL_(uint32_t)]; uint32_t rights1; char rights1_r_[PADR_(uint32_t)]; + char rights2_l_[PADL_(uint32_t)]; uint32_t rights2; char rights2_r_[PADR_(uint32_t)]; +}; #else struct freebsd32_posix_fallocate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -652,6 +658,11 @@ struct freebsd32_wait6_args { char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +struct freebsd32_cap_rights_limit_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char rights1_l_[PADL_(uint32_t)]; uint32_t rights1; char rights1_r_[PADR_(uint32_t)]; + char rights2_l_[PADL_(uint32_t)]; uint32_t rights2; char rights2_r_[PADR_(uint32_t)]; +}; #endif struct freebsd32_cap_ioctls_limit_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -784,10 +795,12 @@ int freebsd32_pselect(struct thread *, s int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +int freebsd32_cap_rights_limit(struct thread *, struct freebsd32_cap_rights_limit_args *); #else int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +int freebsd32_cap_rights_limit(struct thread *, struct freebsd32_cap_rights_limit_args *); #endif int freebsd32_cap_ioctls_limit(struct thread *, struct freebsd32_cap_ioctls_limit_args *); int freebsd32_cap_ioctls_get(struct thread *, struct freebsd32_cap_ioctls_get_args *); @@ -1186,9 +1199,11 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 +#define FREEBSD32_SYS_AUE_freebsd32_cap_rights_limit AUE_CAP_RIGHTS_LIMIT #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 +#define FREEBSD32_SYS_AUE_freebsd32_cap_rights_limit AUE_CAP_RIGHTS_LIMIT #define FREEBSD32_SYS_AUE_freebsd32_cap_ioctls_limit AUE_CAP_IOCTLS_LIMIT #define FREEBSD32_SYS_AUE_freebsd32_cap_ioctls_get AUE_CAP_IOCTLS_GET #define FREEBSD32_SYS_AUE_freebsd32_aio_mlock AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sun Aug 18 13:37:54 2013 (r254491) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sun Aug 18 13:38:39 2013 (r254492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254491 2013-08-18 13:37:54Z pjd */ #define FREEBSD32_SYS_syscall 0 @@ -438,10 +438,11 @@ #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 #define FREEBSD32_SYS_freebsd32_wait6 532 +#define FREEBSD32_SYS_freebsd32_cap_rights_limit 533 #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 #define FREEBSD32_SYS_freebsd32_wait6 532 -#define FREEBSD32_SYS_cap_rights_limit 533 +#define FREEBSD32_SYS_freebsd32_cap_rights_limit 533 #define FREEBSD32_SYS_freebsd32_cap_ioctls_limit 534 #define FREEBSD32_SYS_freebsd32_cap_ioctls_get 535 #define FREEBSD32_SYS_cap_fcntls_limit 536 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Aug 18 13:37:54 2013 (r254491) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sun Aug 18 13:38:39 2013 (r254492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254491 2013-08-18 13:37:54Z pjd */ const char *freebsd32_syscallnames[] = { @@ -557,12 +557,13 @@ const char *freebsd32_syscallnames[] = { "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ "freebsd32_wait6", /* 532 = freebsd32_wait6 */ + "freebsd32_cap_rights_limit", /* 533 = freebsd32_cap_rights_limit */ #else "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ "freebsd32_wait6", /* 532 = freebsd32_wait6 */ + "freebsd32_cap_rights_limit", /* 533 = freebsd32_cap_rights_limit */ #endif - "cap_rights_limit", /* 533 = cap_rights_limit */ "freebsd32_cap_ioctls_limit", /* 534 = freebsd32_cap_ioctls_limit */ "freebsd32_cap_ioctls_get", /* 535 = freebsd32_cap_ioctls_get */ "cap_fcntls_limit", /* 536 = cap_fcntls_limit */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sun Aug 18 13:37:54 2013 (r254491) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sun Aug 18 13:38:39 2013 (r254492) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254481 2013-08-18 10:30:41Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 254491 2013-08-18 13:37:54Z pjd */ #include "opt_compat.h" @@ -594,12 +594,13 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ + { AS(freebsd32_cap_rights_limit_args), (sy_call_t *)freebsd32_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 533 = freebsd32_cap_rights_limit */ #else { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ + { AS(freebsd32_cap_rights_limit_args), (sy_call_t *)freebsd32_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 533 = freebsd32_cap_rights_limit */ #endif - { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 533 = cap_rights_limit */ { AS(freebsd32_cap_ioctls_limit_args), (sy_call_t *)freebsd32_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 534 = freebsd32_cap_ioctls_limit */ { AS(freebsd32_cap_ioctls_get_args), (sy_call_t *)freebsd32_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = freebsd32_cap_ioctls_get */ { AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 536 = cap_fcntls_limit */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Aug 18 13:37:54 2013 (r254491) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Aug 18 13:38:39 2013 (r254492) @@ -3159,6 +3159,16 @@ systrace_args(int sysnum, void *params, *n_args = 8; break; } + /* freebsd32_cap_rights_limit */ + case 533: { + struct freebsd32_cap_rights_limit_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->rights1; /* uint32_t */ + uarg[3] = p->rights2; /* uint32_t */ + *n_args = 4; + break; + } #else /* freebsd32_posix_fallocate */ case 530: { @@ -3196,15 +3206,16 @@ systrace_args(int sysnum, void *params, *n_args = 7; break; } -#endif - /* cap_rights_limit */ + /* freebsd32_cap_rights_limit */ case 533: { - struct cap_rights_limit_args *p = params; + struct freebsd32_cap_rights_limit_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->rights; /* uint64_t */ - *n_args = 2; + uarg[1] = p->rights1; /* uint32_t */ + uarg[2] = p->rights2; /* uint32_t */ + *n_args = 3; break; } +#endif /* freebsd32_cap_ioctls_limit */ case 534: { struct freebsd32_cap_ioctls_limit_args *p = params; @@ -8572,6 +8583,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* freebsd32_cap_rights_limit */ + case 533: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + default: + break; + }; + break; #else /* freebsd32_posix_fallocate */ case 530: @@ -8648,20 +8678,23 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; -#endif - /* cap_rights_limit */ + /* freebsd32_cap_rights_limit */ case 533: switch(ndx) { case 0: p = "int"; break; case 1: - p = "uint64_t"; + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; break; default: break; }; break; +#endif /* freebsd32_cap_ioctls_limit */ case 534: switch(ndx) { @@ -10622,6 +10655,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_cap_rights_limit */ + case 533: + if (ndx == 0 || ndx == 1) + p = "int"; + break; #else /* freebsd32_posix_fallocate */ case 530: @@ -10638,12 +10676,12 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; -#endif - /* cap_rights_limit */ + /* freebsd32_cap_rights_limit */ case 533: if (ndx == 0 || ndx == 1) p = "int"; break; +#endif /* freebsd32_cap_ioctls_limit */ case 534: if (ndx == 0 || ndx == 1) From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 16:16:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6C99B45D; Sun, 18 Aug 2013 16:16:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 580752E88; Sun, 18 Aug 2013 16:16:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IGGbUV009007; Sun, 18 Aug 2013 16:16:37 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IGGbDH008999; Sun, 18 Aug 2013 16:16:37 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308181616.r7IGGbDH008999@svn.freebsd.org> From: Andrew Turner Date: Sun, 18 Aug 2013 16:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254493 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 16:16:37 -0000 Author: andrew Date: Sun Aug 18 16:16:36 2013 New Revision: 254493 URL: http://svnweb.freebsd.org/changeset/base/254493 Log: Enable VFP on the CubieBoard and CubieBoard 2. Modified: head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Sun Aug 18 13:38:39 2013 (r254492) +++ head/sys/arm/conf/CUBIEBOARD Sun Aug 18 16:16:36 2013 (r254493) @@ -47,6 +47,7 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PREEMPTION options FREEBSD_BOOT_LOADER +options VFP # vfp/neon # Debugging makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Sun Aug 18 13:38:39 2013 (r254492) +++ head/sys/arm/conf/CUBIEBOARD2 Sun Aug 18 16:16:36 2013 (r254493) @@ -47,6 +47,7 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PREEMPTION options FREEBSD_BOOT_LOADER +options VFP # vfp/neon # Debugging makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 17:18:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA6B43B4; Sun, 18 Aug 2013 17:18:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6F8121A8; Sun, 18 Aug 2013 17:18:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IHIqVp020285; Sun, 18 Aug 2013 17:18:52 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IHIqw5020284; Sun, 18 Aug 2013 17:18:52 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308181718.r7IHIqw5020284@svn.freebsd.org> From: Andrew Turner Date: Sun, 18 Aug 2013 17:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254494 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 17:18:52 -0000 Author: andrew Date: Sun Aug 18 17:18:52 2013 New Revision: 254494 URL: http://svnweb.freebsd.org/changeset/base/254494 Log: Enable VFP in the Versatile PB (QEMU) kernel. Tested on QEMU 1.6.0. Modified: head/sys/arm/conf/VERSATILEPB Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Sun Aug 18 16:16:36 2013 (r254493) +++ head/sys/arm/conf/VERSATILEPB Sun Aug 18 17:18:52 2013 (r254494) @@ -54,6 +54,7 @@ options SYSVSEM #SYSV-style semaphore options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options ROOTDEVNAME=\"ufs:da0s2a\" +options VFP # vfp/neon options PREEMPTION From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 18:08:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CDC26AA9; Sun, 18 Aug 2013 18:08:12 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA7FC23D4; Sun, 18 Aug 2013 18:08:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7II8Cef005736; Sun, 18 Aug 2013 18:08:12 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7II8CoF005734; Sun, 18 Aug 2013 18:08:12 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201308181808.r7II8CoF005734@svn.freebsd.org> From: Olivier Houchard Date: Sun, 18 Aug 2013 18:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254495 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 18:08:12 -0000 Author: cognet Date: Sun Aug 18 18:08:12 2013 New Revision: 254495 URL: http://svnweb.freebsd.org/changeset/base/254495 Log: Increase the max KVA available for general consumption on the Exynos 5. Submitted by: Ruslan Bukin Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Aug 18 17:18:52 2013 (r254494) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Aug 18 18:08:12 2013 (r254495) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include -#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 +#define DEVMAP_BOOTSTRAP_MAP_START 0xF0000000 extern int unmapped_buf_allowed; @@ -83,7 +83,7 @@ platform_devmap_init(void) int i; i = 0; - fdt_devmap[i].pd_va = 0xe2C00000; + fdt_devmap[i].pd_va = 0xf2C00000; fdt_devmap[i].pd_pa = 0x12C00000; fdt_devmap[i].pd_size = 0x100000; fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 19:08:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB4F88EA; Sun, 18 Aug 2013 19:08:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C905A26C7; Sun, 18 Aug 2013 19:08:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IJ8sGS006202; Sun, 18 Aug 2013 19:08:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IJ8sxR006193; Sun, 18 Aug 2013 19:08:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308181908.r7IJ8sxR006193@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 Aug 2013 19:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254496 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 19:08:54 -0000 Author: ian Date: Sun Aug 18 19:08:53 2013 New Revision: 254496 URL: http://svnweb.freebsd.org/changeset/base/254496 Log: Add a new SDHCI_QUIRK_DONT_SHIFT_RESPONSE for hardware that pre-shifts the response bits the way we do in software. While the hardware is just doing the sensible thing rather than leaving it to the software, it's in violation of the spec by doing so. Grrrr. Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Aug 18 18:08:12 2013 (r254495) +++ head/sys/dev/sdhci/sdhci.c Sun Aug 18 19:08:53 2013 (r254496) @@ -835,8 +835,13 @@ sdhci_finish_command(struct sdhci_slot * uint8_t extra = 0; for (i = 0; i < 4; i++) { uint32_t val = RD4(slot, SDHCI_RESPONSE + i * 4); - slot->curcmd->resp[3 - i] = (val << 8) + extra; - extra = val >> 24; + if (slot->quirks & SDHCI_QUIRK_DONT_SHIFT_RESPONSE) + slot->curcmd->resp[3 - i] = val; + else { + slot->curcmd->resp[3 - i] = + (val << 8) | extra; + extra = val >> 24; + } } } else slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sun Aug 18 18:08:12 2013 (r254495) +++ head/sys/dev/sdhci/sdhci.h Sun Aug 18 19:08:53 2013 (r254496) @@ -57,6 +57,8 @@ #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<11) /* SDHCI_CAPABILITIES is invalid */ #define SDHCI_QUIRK_MISSING_CAPS (1<<12) +/* Hardware shifts the 136-bit response, don't do it in software. */ +#define SDHCI_QUIRK_DONT_SHIFT_RESPONSE (1<<13) /* * Controller registers From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 19:37:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BECEC76D; Sun, 18 Aug 2013 19:37:35 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACC8E2889; Sun, 18 Aug 2013 19:37:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IJbZcT051724; Sun, 18 Aug 2013 19:37:35 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IJbZQW051722; Sun, 18 Aug 2013 19:37:35 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201308181937.r7IJbZQW051722@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 18 Aug 2013 19:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254497 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 19:37:35 -0000 Author: tijl Date: Sun Aug 18 19:37:35 2013 New Revision: 254497 URL: http://svnweb.freebsd.org/changeset/base/254497 Log: Change the return type of the fallback implementation of the atomic_compare_exchange_* macros in stdatomic.h to _Bool. Modified: head/sys/sys/stdatomic.h Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Sun Aug 18 19:08:53 2013 (r254496) +++ head/sys/sys/stdatomic.h Sun Aug 18 19:37:35 2013 (r254497) @@ -288,8 +288,8 @@ typedef _Atomic(__uintmax_t) atomic_uin __typeof__(expected) __ep = (expected); \ __typeof__(*__ep) __e = *__ep; \ (void)(success); (void)(failure); \ - (*__ep = __sync_val_compare_and_swap(&(object)->__val, \ - __e, desired)) == __e; \ + (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \ + __e, desired)) == __e); \ }) #define atomic_compare_exchange_weak_explicit(object, expected, \ desired, success, failure) \ From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 19:53:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1FC22D84; Sun, 18 Aug 2013 19:53:17 +0000 (UTC) (envelope-from joel@freebsd.org) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id CE7372978; Sun, 18 Aug 2013 19:53:16 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 04F91E3F07A; Sun, 18 Aug 2013 21:53:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AbGr2TJuvLr6; Sun, 18 Aug 2013 21:53:06 +0200 (CEST) Received: from devbox.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id D7842E3F079; Sun, 18 Aug 2013 21:53:05 +0200 (CEST) Date: Sun, 18 Aug 2013 21:53:04 +0200 From: Joel Dahl To: Dimitry Andric Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk Message-ID: <20130818195304.GA81160@devbox.vnode.local> References: <201308130715.r7D7F1nu076335@svn.freebsd.org> <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3887D7C7-D766-40DF-B154-D05768B86AA6@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, FreeBSD Ports , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 19:53:17 -0000 On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote: > On Aug 13, 2013, at 09:15, Peter Wemm wrote: > > Author: peter > > Date: Tue Aug 13 07:15:01 2013 > > New Revision: 254273 > > URL: http://svnweb.freebsd.org/changeset/base/254273 > > > > Log: > > The iconv in libc did two things - implement the standard APIs, the GNU > > extensions and also tried to be link time compatible with ports libiconv. > > This splits that functionality and enables the parts that shouldn't > > interfere with the port by default. > > > > WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. > > WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker > > symbols and even a stub libiconv.so.3 that are good enough to be able > > to 'pkg delete -f libiconv' on a running system and reasonably expect it > > to work. > > > > I have tortured many machines over the last few days to try and reduce > > the possibilities of foot-shooting as much as I can. I've successfully > > recompiled to enable and disable the libiconv_compat modes, ports that use > > libiconv alongside system iconv etc. If you don't enable the > > WITH_LIBICONV_COMPAT switch, they don't share symbol space. > > > > This is an extension of behavior on other system. iconv(3) is a standard > > libc interface and libiconv port expects to be able to run alongside it on > > systems that have it. > > Unfortunately I expect this will break many ports, when the libiconv > port is installed. A simple example is the following: It also breaks installworld when /usr/src and /usr/obj are NFS exported read-only. -- Joel From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 20:06:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7FDF41DD; Sun, 18 Aug 2013 20:06:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5340B2A12; Sun, 18 Aug 2013 20:06:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IK6aJZ096787; Sun, 18 Aug 2013 20:06:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IK6aCu096786; Sun, 18 Aug 2013 20:06:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308182006.r7IK6aCu096786@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 20:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254498 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 20:06:36 -0000 Author: pjd Date: Sun Aug 18 20:06:35 2013 New Revision: 254498 URL: http://svnweb.freebsd.org/changeset/base/254498 Log: Remove redundant space. Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sun Aug 18 19:37:35 2013 (r254497) +++ head/lib/libc/gen/Symbol.map Sun Aug 18 20:06:35 2013 (r254498) @@ -384,7 +384,7 @@ FBSD_1.3 { clock_getcpuclockid; dirfd; dup3; - fdlopen; + fdlopen; __FreeBSD_libc_enter_restricted_mode; getcontextx; gid_from_group; From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 20:11:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 463BC411; Sun, 18 Aug 2013 20:11:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 237652A6B; Sun, 18 Aug 2013 20:11:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IKBZ6r002429; Sun, 18 Aug 2013 20:11:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IKBZM3002425; Sun, 18 Aug 2013 20:11:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308182011.r7IKBZM3002425@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 20:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254499 - in head: include lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 20:11:36 -0000 Author: pjd Date: Sun Aug 18 20:11:34 2013 New Revision: 254499 URL: http://svnweb.freebsd.org/changeset/base/254499 Log: Implement fdclosedir(3) function, which is equivalent to the closedir(3) function, but returns directory file descriptor instead of closing it. Submitted by: Mariusz Zaborski Sponsored by: Google Summer of Code 2013 Modified: head/include/dirent.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/closedir.c head/lib/libc/gen/directory.3 Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Sun Aug 18 20:06:35 2013 (r254498) +++ head/include/dirent.h Sun Aug 18 20:11:34 2013 (r254499) @@ -79,6 +79,7 @@ int dirfd(DIR *); #endif #if __BSD_VISIBLE DIR *__opendir2(const char *, int); +int fdclosedir(DIR *); int getdents(int, char *, int); int getdirentries(int, char *, int, long *); #endif Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sun Aug 18 20:06:35 2013 (r254498) +++ head/lib/libc/gen/Symbol.map Sun Aug 18 20:11:34 2013 (r254499) @@ -384,6 +384,7 @@ FBSD_1.3 { clock_getcpuclockid; dirfd; dup3; + fdclosedir; fdlopen; __FreeBSD_libc_enter_restricted_mode; getcontextx; Modified: head/lib/libc/gen/closedir.c ============================================================================== --- head/lib/libc/gen/closedir.c Sun Aug 18 20:06:35 2013 (r254498) +++ head/lib/libc/gen/closedir.c Sun Aug 18 20:11:34 2013 (r254499) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); * close a directory. */ int -closedir(DIR *dirp) +fdclosedir(DIR *dirp) { int fd; @@ -65,5 +65,12 @@ closedir(DIR *dirp) _pthread_mutex_destroy(&dirp->dd_lock); } free((void *)dirp); - return(_close(fd)); + return (fd); +} + +int +closedir(DIR *dirp) +{ + + return (_close(fdclosedir(dirp))); } Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Sun Aug 18 20:06:35 2013 (r254498) +++ head/lib/libc/gen/directory.3 Sun Aug 18 20:11:34 2013 (r254499) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 5, 2012 +.Dd August 18, 2013 .Dt DIRECTORY 3 .Os .Sh NAME @@ -40,6 +40,7 @@ .Nm seekdir , .Nm rewinddir , .Nm closedir , +.Nm fdclosedir , .Nm dirfd .Nd directory operations .Sh LIBRARY @@ -64,6 +65,8 @@ .Ft int .Fn closedir "DIR *dirp" .Ft int +.Fn fdclosedir "DIR *dirp" +.Ft int .Fn dirfd "DIR *dirp" .Sh DESCRIPTION The @@ -208,6 +211,13 @@ On failure, \-1 is returned and the glob is set to indicate the error. .Pp The +.Fn fdclosedir +function is equivalent to the +.Fn closedir +function except that this function returns directory file descriptor instead of +closing it. +.Pp +The .Fn dirfd function returns the integer file descriptor associated with the named @@ -252,6 +262,9 @@ The .Fn fdopendir function appeared in .Fx 8.0 . +.Fn fdclosedir +function appeared in +.Fx 10.0 . .Sh BUGS The invalidation of .Fn telldir From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 20:40:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B7107BF5; Sun, 18 Aug 2013 20:40:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4FF12B91; Sun, 18 Aug 2013 20:40:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IKeD2R035059; Sun, 18 Aug 2013 20:40:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IKeDsL035058; Sun, 18 Aug 2013 20:40:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201308182040.r7IKeDsL035058@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Aug 2013 20:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254500 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 20:40:13 -0000 Author: adrian Date: Sun Aug 18 20:40:13 2013 New Revision: 254500 URL: http://svnweb.freebsd.org/changeset/base/254500 Log: Return the correct status if ieee80211_ff_check() consumes the mbuf. I broke this when converting the net80211 TX path to use if_transmit. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Aug 18 20:11:34 2013 (r254499) +++ head/sys/net80211/ieee80211_output.c Sun Aug 18 20:40:13 2013 (r254500) @@ -210,8 +210,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 m = ieee80211_ff_check(ni, m); if (m == NULL) { /* NB: any ni ref held on stageq */ - /* XXX better status? */ - return (ENOBUFS); + return (0); } } #endif /* IEEE80211_SUPPORT_SUPERG */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 21:36:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE0C579F; Sun, 18 Aug 2013 21:36:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99B302E3A; Sun, 18 Aug 2013 21:36:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ILaMxM093196; Sun, 18 Aug 2013 21:36:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ILaMAb093192; Sun, 18 Aug 2013 21:36:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308182136.r7ILaMAb093192@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Aug 2013 21:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254501 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 21:36:22 -0000 Author: kib Date: Sun Aug 18 21:36:22 2013 New Revision: 254501 URL: http://svnweb.freebsd.org/changeset/base/254501 Log: When code from r254064 in pmap_ts_referenced() drops pv lock and blocks on a pmap lock, pmap_release() might proceed in parallel and destroy the pmap mutex, since unlocked pv lock allows to remove pv entry owned by the pmap. For now, gate the pmap_release() on write-locked pvh_global_lock. Since pmap_ts_release() does not unlock the global lock, pmap_release() would not destroy pmap mutex until the pmap_ts_referenced() finished. We cannot enter pmap_ts_referenced() and encounter a pv entry for the destroyed pmap if pmap_release() passed the global lock gate, since pmap_remove_pages() would finish earlier. Reported by: jeff, pho Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Aug 18 20:40:13 2013 (r254500) +++ head/sys/amd64/amd64/pmap.c Sun Aug 18 21:36:22 2013 (r254501) @@ -1959,6 +1959,9 @@ pmap_release(pmap_t pmap) KASSERT(vm_radix_is_empty(&pmap->pm_root), ("pmap_release: pmap has reserved page table page(s)")); + rw_wlock(&pvh_global_lock); + rw_wunlock(&pvh_global_lock); + m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I] & PG_FRAME); for (i = 0; i < NKPML4E; i++) /* KVA */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 22:00:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D6E16D46; Sun, 18 Aug 2013 22:00:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8CF92F4E; Sun, 18 Aug 2013 22:00:40 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id m46so3065281wev.8 for ; Sun, 18 Aug 2013 15:00:39 -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:message-id:subject :from:to:cc:content-type; bh=5SZkx7lO8Z+4FcO3+7SJPwHhn/DdTMHtqJp2wL2ykRo=; b=I6Ki8vwTqIsgjRqznqaLg5zZoX0zSHXmCLCsjBp3lDXc3Z1q4clozCMOj+RKl57N4i LRDI7GI2gfmGyoJNV20gN+hKBXHwmtu3ctzYb0CCgPrXSxTDQVCVsdhITHBrdnaUBa0C d/F5vRI2SJ//b6CAUlvJkXDIqp7yYIradIE4iKNhmaaYsS2DNPArWWFnqq00FQ/z9pfP vCT+6VANUNf9cfiyVCmm8TJGFHswCAx8tuE4lCmkuB5oL8CfQgoCOx+F/Bkgpi55TOg4 FDCBb1iKEwuzMHk1IQ0yaWdDmYmAA7zuaWiaOtNSeEuHXCnq+BpHg5v3N/eRejKqfJgK eRmg== MIME-Version: 1.0 X-Received: by 10.194.20.170 with SMTP id o10mr4050175wje.4.1376863239158; Sun, 18 Aug 2013 15:00:39 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.116.136 with HTTP; Sun, 18 Aug 2013 15:00:39 -0700 (PDT) In-Reply-To: <201308070621.r776LLOs055455@svn.freebsd.org> References: <201308070621.r776LLOs055455@svn.freebsd.org> Date: Sun, 18 Aug 2013 15:00:39 -0700 X-Google-Sender-Auth: pYmo1G2XZ_FmV2xZqSxcKWBK3X0 Message-ID: Subject: Re: svn commit: r254025 - in head/sys: amd64/amd64 arm/arm arm/at91 arm/mv/armadaxp arm/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 cddl/compat/opensolaris/kern cddl/compat/opensolari... From: Adrian Chadd To: Jeff Roberson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Joe Holden X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 22:00:41 -0000 Hi Jeff, This has broken booting on the MIPS Octeon platform. Apparently things just plain hang during boot. Would you please work with Joe to sort out what's going on? I'd like to try and get this fixed up before 10.0-RELEASE is cut as the Octeon SMP platform seems to be somewhat popular. Thanks, -adrian From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 22:43:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 874667E2; Sun, 18 Aug 2013 22:43:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4511C2135; Sun, 18 Aug 2013 22:43:01 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 4EE8D1203C3; Mon, 19 Aug 2013 00:42:45 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 2944328494; Mon, 19 Aug 2013 00:42:45 +0200 (CEST) Date: Mon, 19 Aug 2013 00:42:45 +0200 From: Jilles Tjoelker To: Joel Dahl Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk Message-ID: <20130818224244.GA59141@stack.nl> References: <201308130715.r7D7F1nu076335@svn.freebsd.org> <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> <20130818195304.GA81160@devbox.vnode.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130818195304.GA81160@devbox.vnode.local> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, Dimitry Andric , gabor@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 22:43:01 -0000 On Sun, Aug 18, 2013 at 09:53:04PM +0200, Joel Dahl wrote: > On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote: > > On Aug 13, 2013, at 09:15, Peter Wemm wrote: > > > Author: peter > > > Date: Tue Aug 13 07:15:01 2013 > > > New Revision: 254273 > > > URL: http://svnweb.freebsd.org/changeset/base/254273 > > > Log: > > > The iconv in libc did two things - implement the standard APIs, the GNU > > > extensions and also tried to be link time compatible with ports libiconv. > > > This splits that functionality and enables the parts that shouldn't > > > interfere with the port by default. > > > WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. > > > WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker > > > symbols and even a stub libiconv.so.3 that are good enough to be able > > > to 'pkg delete -f libiconv' on a running system and reasonably expect it > > > to work. > > > I have tortured many machines over the last few days to try and reduce > > > the possibilities of foot-shooting as much as I can. I've successfully > > > recompiled to enable and disable the libiconv_compat modes, ports that use > > > libiconv alongside system iconv etc. If you don't enable the > > > WITH_LIBICONV_COMPAT switch, they don't share symbol space. > > > This is an extension of behavior on other system. iconv(3) is a standard > > > libc interface and libiconv port expects to be able to run alongside it on > > > systems that have it. > > Unfortunately I expect this will break many ports, when the libiconv > > port is installed. A simple example is the following: > > It also breaks installworld when /usr/src and /usr/obj are NFS exported > read-only. I think it has to do with share/i18n/csmapper and share/i18n/esdb using directories as make targets. This apparently causes these files to be rebuilt at 'make installworld' time, which is always bad but is only detected when /usr/obj is read-only. A hack that works is to enclose the four targets depending on ${SUBDIR} in .if !make(install) . Unfortunately, the Makefiles were written to depend on the directories as make targets fairly deeply, so a real fix is harder. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 22:47:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7588D978 for ; Sun, 18 Aug 2013 22:47:17 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41FD3215C for ; Sun, 18 Aug 2013 22:47:17 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id y10so4263846pdj.8 for ; Sun, 18 Aug 2013 15:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type; bh=aW3GUvKjzqzkOth10IAEtqtDS2Y8aukuahZa3dDx6Jw=; b=mmYjFTHpVgboNfsLabVTe9lml3tjfC2FBl2QUHGNDzydNoQqj/JQqDFzkbzZ8qvArc SiPhUvjZ6m95TYbPMrYN31MlUNMhUlG5RTMyOPouEBA3o8lrJ/5YR4rLOGIXspFTHBif tASpiqULBj+jt8GQedsKPSH+daT1O7rINhSno= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type; bh=aW3GUvKjzqzkOth10IAEtqtDS2Y8aukuahZa3dDx6Jw=; b=LajVc9iB5uBLzWif3N6EhVMSqb17XM4KPdDGX9ZSB+YauGMOpTtqFi3dzBZUkaI2Yb ONaz4jqOxWHQl3MGxxBNSh0EeO0zBu2UAcJr6obUMUGaf0sH00JoKBdY8BKAsKKiz6NG bTNYLdd3HvSHXy2THKVjB832c23WsG60yvCka402uzc2fCgQhBUxG/CrBqC1NMDNFF3Z 3Uyk32UXeN0CDGC0DwiNFW7l4+Q/u+Qbl+T0XDUONtiU/iGBuNMuJyKaerqysd0FM4x8 jF+Y79nV0W9AMwUBQecZrul9j7ZZ823hTGkivhulKLBcLTwU/loOGt3AuA/SLyFkCObS bf8Q== X-Gm-Message-State: ALoCoQnBF0Av2kylU0+sxJ4/N+iMc7XUDrnC5AQPOhLdu1x3QTY7M5WxBhgCTcMg6zMpBgWCl/m4 X-Received: by 10.68.134.65 with SMTP id pi1mr10118814pbb.59.1376866036922; Sun, 18 Aug 2013 15:47:16 -0700 (PDT) Received: from hackintosh.wemm.org (c-71-198-8-135.hsd1.ca.comcast.net. [71.198.8.135]) by mx.google.com with ESMTPSA id xs1sm11604324pac.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Aug 2013 15:47:16 -0700 (PDT) Message-ID: <52114EF2.6040901@wemm.org> Date: Sun, 18 Aug 2013 15:47:14 -0700 From: Peter Wemm Organization: World Domination in progress. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk References: <201308130715.r7D7F1nu076335@svn.freebsd.org> <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> In-Reply-To: <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1108D0dque474thv0WB72TSxd6TVLrlWF" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, FreeBSD Ports , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 22:47:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1108D0dque474thv0WB72TSxd6TVLrlWF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 8/17/13 3:34 PM, Dimitry Andric wrote: > On Aug 13, 2013, at 09:15, Peter Wemm wrote: >> Author: peter >> Date: Tue Aug 13 07:15:01 2013 >> New Revision: 254273 >> URL: http://svnweb.freebsd.org/changeset/base/254273 >> >> Log: >> The iconv in libc did two things - implement the standard APIs, the G= NU >> extensions and also tried to be link time compatible with ports libic= onv. >> This splits that functionality and enables the parts that shouldn't >> interfere with the port by default. >> >> WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. >> WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API,= linker >> symbols and even a stub libiconv.so.3 that are good enough to be able= >> to 'pkg delete -f libiconv' on a running system and reasonably expect= it >> to work. >> >> I have tortured many machines over the last few days to try and reduc= e >> the possibilities of foot-shooting as much as I can. I've successful= ly >> recompiled to enable and disable the libiconv_compat modes, ports tha= t use >> libiconv alongside system iconv etc. If you don't enable the >> WITH_LIBICONV_COMPAT switch, they don't share symbol space. >> >> This is an extension of behavior on other system. iconv(3) is a stan= dard >> libc interface and libiconv port expects to be able to run alongside = it on >> systems that have it. >=20 > Unfortunately I expect this will break many ports, when the libiconv > port is installed. A simple example is the following: >=20 > #include >=20 > int main(void) > { > iconv_t ic =3D iconv_open("UTF-8", "ISO-8859-1"); > iconv_close(ic); > return 0; > } >=20 > If you compile this on a system after r254273 with -I/usr/local/include= , > and the libiconv port installed, it will result in: >=20 > $ cc -I/usr/local/include iconv-test.c -o iconv-test > /tmp/iconv-test-I1ltw1.o: In function `main': > iconv-test.c:(.text+0x21): undefined reference to `libiconv_open' > iconv-test.c:(.text+0x2f): undefined reference to `libiconv_close' > cc: error: linker command failed with exit code 1 (use -v to see invo= cation) >=20 > This is because libiconv's iconv.h does: >=20 > #define iconv_open libiconv_open > ... > #define iconv_close libiconv_close >=20 > and so on for most of its functions. Yep, but since is a standard include file, even on Linux system= s. Autoconf/libtool/etc know this, that's why it typically compiles and lin= ks like this: cc -I/usr/local/include -L/usr/local/lib iconv-test.c -liconv I'm sure there are exceptions though. Random linux box (ubuntu fwiw): peter@bit1:~$ readelf -a /lib/x86_64-linux-gnu/libc-2.15.so |grep iconv= 1554: 00220c0 45 FUNC GLOBAL DEFAULT 12 iconv_close@@GLIBC_2.2.= 5 1745: 0021f10 418 FUNC GLOBAL DEFAULT 12 iconv@@GLIBC_2.2.5 1764: 0021d00 523 FUNC GLOBAL DEFAULT 12 iconv_open@@GLIBC_2.2.5= peter@bit1:~$ grep '^extern' /usr/include/iconv.h extern iconv_t iconv_open (__const char *, __const char *); extern size_t iconv (iconv_t, char **__restrict, extern int iconv_close (iconv_t); If you mix includes and libraries like in your example, it would fail on linux too. However, linux tends to not add libiconv to the mix. peter@bit1:~$ find / -mount -name 'libiconv*' peter@bit1:~$ uname -a Linux bit1 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux The WITH_LIBICONV_COMPAT switch can be turned on - that adds the libiconv_open etc aliases. It was intended as a transition aid though - = it was intended to make 'pkg delete -f libiconv' on a running system keep wo= rking. I compile my personal systems like this: Index: Mk/Uses/iconv.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Mk/Uses/iconv.mk (revision 324679) +++ Mk/Uses/iconv.mk (working copy) @@ -16,6 +16,8 @@ IGNORE=3D USES=3Diconv does not require args .endif +.if !exists(/usr/include/iconv.h) LIB_DEPENDS+=3D libiconv.so.3:${PORTSDIR}/converters/libiconv +.endif .endif =2E. and keep libiconv completely off them. There's a couple of other po= rts with it hard coded in, but this covers most of them. eg: glib20, epic5, unzip, php-iconv. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6F= JV UTF-8: for when a ' just won\342\200\231t do. ZFS must be the bacon of file systems. "everything's better with ZFS" --1108D0dque474thv0WB72TSxd6TVLrlWF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlIRTvIACgkQFRKuUnJ3cX+A6wCbBf8CKXehHv+8PLCikmiZwDZT LUkAoJJ448BiqHMW5bxl3GINw3kE5ZZD =T+p9 -----END PGP SIGNATURE----- --1108D0dque474thv0WB72TSxd6TVLrlWF-- From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 22:51:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F158AB92 for ; Sun, 18 Aug 2013 22:51:28 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD51A21A5 for ; Sun, 18 Aug 2013 22:51:28 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id bj1so3914434pad.0 for ; Sun, 18 Aug 2013 15:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type; bh=z7I6FvlyZxgnSSdmnpZisynYeZw0pRS0BKRrxBcbDCY=; b=uHQOOHbs9ReZHyiWPMzFbcs7BEzMn4OpGICB+3lbSeYhTFwXScLgTJglXIR9v3S+f3 QoCErQ/sBFb3E8lRfxgU2ZRuu0lsCGbC+Fiq01gqLedeylq7hod5kxbJoeTOO7U24k45 NFTLO1a+PNg5emFfFXxRIAHsH+gC0Q12VTblw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type; bh=z7I6FvlyZxgnSSdmnpZisynYeZw0pRS0BKRrxBcbDCY=; b=oIajs6rnjxVxN4N4R57gvfh+2y9NOcD0BEWjf4gfs4GhJ6kVOxngk8s8Y5BVBTbAAj JwH2i5mJk6FNkxppV8Q+gZc6LxEc65xbcA0Y2JSwINTcXnZIyEiMud6EHfDJmcITQG0F EYrEXVk1nzTZ8/n7/hfnTayRxCK3JCMrJWzbbYwOGqQ59WJF2z3bryKL0YLar32tFd/b wxCNbO29V1Ccz9+U/zA3ov+CITM12TdceGL/iKGlQV+3foxxn60zo6Ggc1JziLh9G0pI NBktNzUTh+x4kK6Ota1hwv6VUioTr6x1/BZVfNoAAiRQLILequjimGwjvqrkroy8EVr4 wKjA== X-Gm-Message-State: ALoCoQlk9hUn3mYvycG9N3Ac9CS1sWim5Rs3edpA5WoLs8CGs9rar0LhVx+oLXP5OW5tQf99zpNZ X-Received: by 10.67.23.227 with SMTP id id3mr10227285pad.101.1376866288296; Sun, 18 Aug 2013 15:51:28 -0700 (PDT) Received: from hackintosh.wemm.org (c-71-198-8-135.hsd1.ca.comcast.net. [71.198.8.135]) by mx.google.com with ESMTPSA id jf4sm11179695pbb.19.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Aug 2013 15:51:27 -0700 (PDT) Message-ID: <52114FED.3010106@wemm.org> Date: Sun, 18 Aug 2013 15:51:25 -0700 From: Peter Wemm Organization: World Domination in progress. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk References: <201308130715.r7D7F1nu076335@svn.freebsd.org> <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> <20130818195304.GA81160@devbox.vnode.local> <20130818224244.GA59141@stack.nl> In-Reply-To: <20130818224244.GA59141@stack.nl> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CWQUSkf6tljNnRBk6efShnljn6Biwcs9I" Cc: src-committers@freebsd.org, Peter Wemm , svn-src-all@freebsd.org, Dimitry Andric , gabor@freebsd.org, Joel Dahl , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 22:51:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CWQUSkf6tljNnRBk6efShnljn6Biwcs9I Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 8/18/13 3:42 PM, Jilles Tjoelker wrote: > On Sun, Aug 18, 2013 at 09:53:04PM +0200, Joel Dahl wrote: >> On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote: >>> On Aug 13, 2013, at 09:15, Peter Wemm wrote: >>>> Author: peter >>>> Date: Tue Aug 13 07:15:01 2013 >>>> New Revision: 254273 >>>> URL: http://svnweb.freebsd.org/changeset/base/254273 >=20 >>>> Log: >>>> The iconv in libc did two things - implement the standard APIs, the= GNU >>>> extensions and also tried to be link time compatible with ports lib= iconv. >>>> This splits that functionality and enables the parts that shouldn't= >>>> interfere with the port by default. >=20 >>>> WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. >>>> WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc AP= I, linker >>>> symbols and even a stub libiconv.so.3 that are good enough to be ab= le >>>> to 'pkg delete -f libiconv' on a running system and reasonably expe= ct it >>>> to work. >=20 >>>> I have tortured many machines over the last few days to try and red= uce >>>> the possibilities of foot-shooting as much as I can. I've successf= ully >>>> recompiled to enable and disable the libiconv_compat modes, ports t= hat use >>>> libiconv alongside system iconv etc. If you don't enable the >>>> WITH_LIBICONV_COMPAT switch, they don't share symbol space. >=20 >>>> This is an extension of behavior on other system. iconv(3) is a st= andard >>>> libc interface and libiconv port expects to be able to run alongsid= e it on >>>> systems that have it. >=20 >>> Unfortunately I expect this will break many ports, when the libiconv >>> port is installed. A simple example is the following: >> >=20 >> It also breaks installworld when /usr/src and /usr/obj are NFS exporte= d >> read-only. >=20 > I think it has to do with share/i18n/csmapper and share/i18n/esdb using= > directories as make targets. This apparently causes these files to be > rebuilt at 'make installworld' time, which is always bad but is only > detected when /usr/obj is read-only. >=20 > A hack that works is to enclose the four targets depending on ${SUBDIR}= > in .if !make(install) . >=20 > Unfortunately, the Makefiles were written to depend on the directories > as make targets fairly deeply, so a real fix is harder. I was looking at this yesterday, but was tied up with other things. I'll= take a look at it today after getting a few other things done. It should= be easy enough to replicate by changing /usr/obj to readonly on test systems= =2E --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6F= JV UTF-8: for when a ' just won\342\200\231t do. ZFS must be the bacon of file systems. "everything's better with ZFS" --CWQUSkf6tljNnRBk6efShnljn6Biwcs9I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlIRT+0ACgkQFRKuUnJ3cX+eHwCeNmqX55iCjJFkKy/yY1aj4+rI /CYAn3qzTFYfTJFTAfWd3HSQmFFrWjjD =LfC8 -----END PGP SIGNATURE----- --CWQUSkf6tljNnRBk6efShnljn6Biwcs9I-- From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 23:40:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C328B498; Sun, 18 Aug 2013 23:40:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B058D23BC; Sun, 18 Aug 2013 23:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7INeUJu021454; Sun, 18 Aug 2013 23:40:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7INeU4R021451; Sun, 18 Aug 2013 23:40:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201308182340.r7INeU4R021451@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Aug 2013 23:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254506 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 23:40:30 -0000 Author: adrian Date: Sun Aug 18 23:40:30 2013 New Revision: 254506 URL: http://svnweb.freebsd.org/changeset/base/254506 Log: Don't return ENOTSUPP here - the net80211 pluggable ioctl API will treat this as the final item in the linker set and not try others. This stopped the fast frames IOCTLs from being called. Modified: head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Sun Aug 18 23:15:29 2013 (r254505) +++ head/sys/net80211/ieee80211_tdma.c Sun Aug 18 23:40:30 2013 (r254506) @@ -744,7 +744,7 @@ tdma_ioctl_get80211(struct ieee80211vap struct ieee80211_tdma_state *ts = vap->iv_tdma; if ((vap->iv_caps & IEEE80211_C_TDMA) == 0) - return EOPNOTSUPP; + return ENOSYS; switch (ireq->i_type) { case IEEE80211_IOC_TDMA_SLOT: @@ -772,7 +772,7 @@ tdma_ioctl_set80211(struct ieee80211vap struct ieee80211_tdma_state *ts = vap->iv_tdma; if ((vap->iv_caps & IEEE80211_C_TDMA) == 0) - return EOPNOTSUPP; + return ENOSYS; switch (ireq->i_type) { case IEEE80211_IOC_TDMA_SLOT: From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 01:29:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 93FE733D; Mon, 19 Aug 2013 01:29:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72AC727E7; Mon, 19 Aug 2013 01:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J1TEnr084159; Mon, 19 Aug 2013 01:29:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J1TEaT084154; Mon, 19 Aug 2013 01:29:14 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308190129.r7J1TEaT084154@svn.freebsd.org> From: Ian Lepore Date: Mon, 19 Aug 2013 01:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254507 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 01:29:14 -0000 Author: ian Date: Mon Aug 19 01:29:13 2013 New Revision: 254507 URL: http://svnweb.freebsd.org/changeset/base/254507 Log: Allow a hardware driver to pass clock frequencies into the sdhci driver. The sdhci spec says that if the base or timeout clock frequency in the capabilities register is zero, the driver must obtain the frequency "from another source." This change defines that other source to be the low-level hardware driver, which can pre-set the frequencies in slot.max_clk and slot.timeout_clk before calling sdhci_init_slot(). This helps with a growing number of SoCs that have sdhci base clock frequencies that either won't fit into the range allowed by the number of bits available in the capabilities register, or the frequency is runtime- configurable. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Aug 18 23:40:30 2013 (r254506) +++ head/sys/dev/sdhci/sdhci.c Mon Aug 19 01:29:13 2013 (r254507) @@ -477,7 +477,7 @@ sdhci_card_task(void *arg, int pending) int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) { - uint32_t caps; + uint32_t caps, freq; int err; SDHCI_LOCK_INIT(slot); @@ -527,17 +527,23 @@ sdhci_init_slot(device_t dev, struct sdh caps = RD4(slot, SDHCI_CAPABILITIES); /* Calculate base clock frequency. */ if (slot->version >= SDHCI_SPEC_300) - slot->max_clk = (caps & SDHCI_CLOCK_V3_BASE_MASK) - >> SDHCI_CLOCK_BASE_SHIFT; + freq = (caps & SDHCI_CLOCK_V3_BASE_MASK) >> + SDHCI_CLOCK_BASE_SHIFT; else - slot->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) - >> SDHCI_CLOCK_BASE_SHIFT; + freq = (caps & SDHCI_CLOCK_BASE_MASK) >> + SDHCI_CLOCK_BASE_SHIFT; + if (freq != 0) + slot->max_clk = freq * 1000000; + /* + * If the frequency wasn't in the capabilities and the hardware driver + * hasn't already set max_clk we're probably not going to work right + * with an assumption, so complain about it. + */ if (slot->max_clk == 0) { - slot->max_clk = SDHCI_DEFAULT_MAX_FREQ; + slot->max_clk = SDHCI_DEFAULT_MAX_FREQ * 1000000; device_printf(dev, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } - slot->max_clk *= 1000000; /* Calculate timeout clock frequency. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { slot->timeout_clk = slot->max_clk / 1000; @@ -547,7 +553,11 @@ sdhci_init_slot(device_t dev, struct sdh if (caps & SDHCI_TIMEOUT_CLK_UNIT) slot->timeout_clk *= 1000; } - + /* + * If the frequency wasn't in the capabilities and the hardware driver + * hasn't already set timeout_clk we'll probably work okay using the + * max timeout, but still mention it. + */ if (slot->timeout_clk == 0) { device_printf(dev, "Hardware doesn't specify timeout clock " "frequency, setting BROKEN_TIMEOUT quirk.\n"); From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 04:56:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 695367A; Mon, 19 Aug 2013 04:56:04 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 575222175; Mon, 19 Aug 2013 04:56:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J4u4YR097607; Mon, 19 Aug 2013 04:56:04 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J4u4EG097606; Mon, 19 Aug 2013 04:56:04 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201308190456.r7J4u4EG097606@svn.freebsd.org> From: Peter Wemm Date: Mon, 19 Aug 2013 04:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254508 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 04:56:04 -0000 Author: peter Date: Mon Aug 19 04:56:03 2013 New Revision: 254508 URL: http://svnweb.freebsd.org/changeset/base/254508 Log: Add the optional ability to run as a different user. Obtained from: Antique freebsd.org cluster archive images Modified: head/etc/rc.d/bsnmpd Modified: head/etc/rc.d/bsnmpd ============================================================================== --- head/etc/rc.d/bsnmpd Mon Aug 19 01:29:13 2013 (r254507) +++ head/etc/rc.d/bsnmpd Mon Aug 19 04:56:03 2013 (r254508) @@ -12,7 +12,17 @@ name="bsnmpd" rcvar="bsnmpd_enable" command="/usr/sbin/${name}" -pidfile="/var/run/snmpd.pid" +start_cmd="bsnmpd_start" + +bsnmpd_start() +{ + rc_flags="-p ${pidfile} ${bsnmpd_flags}" + echo -n "Starting bsnmpd" + su -m $user -c "$command ${rc_flags}" + echo "." +} load_rc_config $name +user="${bsnmpd_username:-root}" +pidfile="${bsnmpd_pidfile:-/var/run/snmpd.pid}" run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 05:10:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2CD502A1; Mon, 19 Aug 2013 05:10:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 008302218; Mon, 19 Aug 2013 05:10:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J5AkqE014642; Mon, 19 Aug 2013 05:10:46 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J5AkQQ014626; Mon, 19 Aug 2013 05:10:46 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201308190510.r7J5AkQQ014626@svn.freebsd.org> From: Justin Hibbits Date: Mon, 19 Aug 2013 05:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254509 - in head/sys: cddl/dev/dtrace/powerpc modules/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 05:10:47 -0000 Author: jhibbits Date: Mon Aug 19 05:10:46 2013 New Revision: 254509 URL: http://svnweb.freebsd.org/changeset/base/254509 Log: Fix some ppc64 dtrace bugs, and enable systrace_freebsd32 for ppc64. Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c head/sys/modules/dtrace/Makefile Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Mon Aug 19 04:56:03 2013 (r254508) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Mon Aug 19 05:10:46 2013 (r254509) @@ -50,6 +50,7 @@ void dtrace_membar_producer(void) */ ASENTRY_NOPROF(dtrace_membar_producer) + sync blr END(dtrace_membar_producer) @@ -57,6 +58,7 @@ END(dtrace_membar_producer) void dtrace_membar_consumer(void) */ ASENTRY_NOPROF(dtrace_membar_consumer) + isync blr END(dtrace_membar_consumer) @@ -97,12 +99,21 @@ void * dtrace_casptr(void *target, void *cmp, void *new) */ ASENTRY_NOPROF(dtrace_casptr) +#ifdef __powerpc64__ +1: + ldarx %r0,0,%r3 + cmpd %r4,%r0 + bne 2f + stdcx. %r5,0,%r3 + bne 1b +#else 1: lwarx %r0,0,%r3 cmpw %r4,%r0 bne 2f stwcx. %r5,0,%r3 bne 1b +#endif 2: mr %r3,%r0 blr END(dtrace_casptr) Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Mon Aug 19 04:56:03 2013 (r254508) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Mon Aug 19 05:10:46 2013 (r254509) @@ -80,7 +80,11 @@ dtrace_getpcstack(pc_t *pcstack, int pcs if (!INKERNEL((long) sp)) break; +#ifdef __powerpc64__ + callpc = *(uintptr_t *)(sp + RETURN_OFFSET64); +#else callpc = *(uintptr_t *)(sp + RETURN_OFFSET); +#endif if (!INKERNEL(callpc)) break; Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Mon Aug 19 04:56:03 2013 (r254508) +++ head/sys/modules/dtrace/Makefile Mon Aug 19 05:10:46 2013 (r254509) @@ -22,7 +22,7 @@ SUBDIR+= fasttrap fbt systrace_linux32 .if ${MACHINE_CPUARCH} == "powerpc" SUBDIR+= fbt .endif -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" SUBDIR+= systrace_freebsd32 .endif From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 05:12:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 818204C8; Mon, 19 Aug 2013 05:12:39 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F84B222B; Mon, 19 Aug 2013 05:12:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J5Cd2K016617; Mon, 19 Aug 2013 05:12:39 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J5CdAC016616; Mon, 19 Aug 2013 05:12:39 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201308190512.r7J5CdAC016616@svn.freebsd.org> From: Peter Wemm Date: Mon, 19 Aug 2013 05:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254510 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 05:12:39 -0000 Author: peter Date: Mon Aug 19 05:12:38 2013 New Revision: 254510 URL: http://svnweb.freebsd.org/changeset/base/254510 Log: Revert r254508. Modified: head/etc/rc.d/bsnmpd Modified: head/etc/rc.d/bsnmpd ============================================================================== --- head/etc/rc.d/bsnmpd Mon Aug 19 05:10:46 2013 (r254509) +++ head/etc/rc.d/bsnmpd Mon Aug 19 05:12:38 2013 (r254510) @@ -12,17 +12,7 @@ name="bsnmpd" rcvar="bsnmpd_enable" command="/usr/sbin/${name}" -start_cmd="bsnmpd_start" - -bsnmpd_start() -{ - rc_flags="-p ${pidfile} ${bsnmpd_flags}" - echo -n "Starting bsnmpd" - su -m $user -c "$command ${rc_flags}" - echo "." -} +pidfile="/var/run/snmpd.pid" load_rc_config $name -user="${bsnmpd_username:-root}" -pidfile="${bsnmpd_pidfile:-/var/run/snmpd.pid}" run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 05:37:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 929DB779; Mon, 19 Aug 2013 05:37:50 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F38B2322; Mon, 19 Aug 2013 05:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J5bokg041651; Mon, 19 Aug 2013 05:37:50 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J5bor6041650; Mon, 19 Aug 2013 05:37:50 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201308190537.r7J5bor6041650@svn.freebsd.org> From: Peter Wemm Date: Mon, 19 Aug 2013 05:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254511 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 05:37:50 -0000 Author: peter Date: Mon Aug 19 05:37:49 2013 New Revision: 254511 URL: http://svnweb.freebsd.org/changeset/base/254511 Log: Pass pidfile to bsnmpd if it's been changed (parts cut/pasted from rc.d/rarpd and rc.d/wpa_supplicant) Modified: head/etc/rc.d/bsnmpd Modified: head/etc/rc.d/bsnmpd ============================================================================== --- head/etc/rc.d/bsnmpd Mon Aug 19 05:12:38 2013 (r254510) +++ head/etc/rc.d/bsnmpd Mon Aug 19 05:37:49 2013 (r254511) @@ -12,7 +12,8 @@ name="bsnmpd" rcvar="bsnmpd_enable" command="/usr/sbin/${name}" -pidfile="/var/run/snmpd.pid" load_rc_config $name +pidfile="${bsnmpd_pidfile:-/var/run/snmpd.pid}" +command_args="-p ${pidfile}" run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 05:48:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D355C64; Mon, 19 Aug 2013 05:48:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 311DC2393; Mon, 19 Aug 2013 05:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J5mhaT051059; Mon, 19 Aug 2013 05:48:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J5mgFr051058; Mon, 19 Aug 2013 05:48:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201308190548.r7J5mgFr051058@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Aug 2013 05:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254512 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 05:48:43 -0000 Author: rpaulo Date: Mon Aug 19 05:48:42 2013 New Revision: 254512 URL: http://svnweb.freebsd.org/changeset/base/254512 Log: Style changes and typos fixed. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Aug 19 05:37:49 2013 (r254511) +++ head/sys/dev/sdhci/sdhci.c Mon Aug 19 05:48:42 2013 (r254512) @@ -350,7 +350,7 @@ sdhci_read_block_pio(struct sdhci_slot * /* If we are too fast, broken controllers return zeroes. */ if (slot->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) DELAY(10); - /* Handle unalligned and alligned buffer cases. */ + /* Handle unaligned and aligned buffer cases. */ if ((intptr_t)buffer & 3) { while (left > 3) { data = RD4(slot, SDHCI_BUFFER); @@ -390,7 +390,7 @@ sdhci_write_block_pio(struct sdhci_slot left = min(512, slot->curcmd->data->len - slot->offset); slot->offset += left; - /* Handle unalligned and alligned buffer cases. */ + /* Handle unaligned and aligned buffer cases. */ if ((intptr_t)buffer & 3) { while (left > 3) { data = buffer[0] + @@ -911,11 +911,14 @@ sdhci_start_data(struct sdhci_slot *slot /* Load DMA buffer. */ if (slot->flags & SDHCI_USE_DMA) { if (data->flags & MMC_DATA_READ) - bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(slot->dmatag, slot->dmamap, + BUS_DMASYNC_PREREAD); else { memcpy(slot->dmamem, data->data, - (data->len < DMA_BLOCK_SIZE)?data->len:DMA_BLOCK_SIZE); - bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); + (data->len < DMA_BLOCK_SIZE) ? + data->len : DMA_BLOCK_SIZE); + bus_dmamap_sync(slot->dmatag, slot->dmamap, + BUS_DMASYNC_PREWRITE); } WR4(slot, SDHCI_DMA_ADDRESS, slot->paddr); /* Interrupt aggregation: Mask border interrupt @@ -942,7 +945,7 @@ sdhci_finish_data(struct sdhci_slot *slo slot->data_done = 1; /* Interrupt aggregation: Restore command interrupt. - * Auxillary restore point for the case when data interrupt + * Auxiliary restore point for the case when data interrupt * happened first. */ if (!slot->cmd_done) { WR4(slot, SDHCI_SIGNAL_ENABLE, @@ -952,11 +955,13 @@ sdhci_finish_data(struct sdhci_slot *slo if (slot->flags & SDHCI_USE_DMA) { if (data->flags & MMC_DATA_READ) { size_t left = data->len - slot->offset; - bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(slot->dmatag, slot->dmamap, + BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, (left < DMA_BLOCK_SIZE)?left:DMA_BLOCK_SIZE); } else - bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(slot->dmatag, slot->dmamap, + BUS_DMASYNC_POSTWRITE); } /* If there was error - reset the host. */ if (slot->curcmd->error) { From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 07:00:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6226810; Mon, 19 Aug 2013 07:00:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B43E12694; Mon, 19 Aug 2013 07:00:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J70E8T025091; Mon, 19 Aug 2013 07:00:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J70Enm025089; Mon, 19 Aug 2013 07:00:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308190700.r7J70Enm025089@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Aug 2013 07:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254513 - stable/9/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 07:00:14 -0000 Author: emaste Date: Mon Aug 19 07:00:13 2013 New Revision: 254513 URL: http://svnweb.freebsd.org/changeset/base/254513 Log: MFC r251192: Fix misspelling of structure field name. Modified: stable/9/include/stdatomic.h Directory Properties: stable/9/include/ (props changed) Modified: stable/9/include/stdatomic.h ============================================================================== --- stable/9/include/stdatomic.h Mon Aug 19 05:48:42 2013 (r254512) +++ stable/9/include/stdatomic.h Mon Aug 19 07:00:13 2013 (r254513) @@ -123,7 +123,7 @@ enum memory_order { #if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->val) + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) #else #define atomic_is_lock_free(obj) \ ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 08:28:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F020250C; Mon, 19 Aug 2013 08:28:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDA162A94; Mon, 19 Aug 2013 08:28:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J8SZuv013033; Mon, 19 Aug 2013 08:28:35 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J8SZbA013032; Mon, 19 Aug 2013 08:28:35 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308190828.r7J8SZbA013032@svn.freebsd.org> From: Andrew Turner Date: Mon, 19 Aug 2013 08:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254514 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 08:28:36 -0000 Author: andrew Date: Mon Aug 19 08:28:35 2013 New Revision: 254514 URL: http://svnweb.freebsd.org/changeset/base/254514 Log: Enable VFP on the Arndale Board. Modified: head/sys/arm/conf/ARNDALE Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Mon Aug 19 07:00:13 2013 (r254513) +++ head/sys/arm/conf/ARNDALE Mon Aug 19 08:28:35 2013 (r254514) @@ -50,6 +50,7 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po options KBD_INSTALL_CDEV options PREEMPTION options FREEBSD_BOOT_LOADER +options VFP # vfp/neon # Debugging makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 09:49:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 496B08E5; Mon, 19 Aug 2013 09:49:53 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 350B72FFE; Mon, 19 Aug 2013 09:49:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7J9nrZd085689; Mon, 19 Aug 2013 09:49:53 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7J9nqLY085673; Mon, 19 Aug 2013 09:49:52 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308190949.r7J9nqLY085673@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 09:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254515 - in stable/9/sys: i386/include kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 09:49:53 -0000 Author: andre Date: Mon Aug 19 09:49:51 2013 New Revision: 254515 URL: http://svnweb.freebsd.org/changeset/base/254515 Log: MFC a bundle of commits that bring autotuning to mbufs, maxfiles/sockets and maxusers to the 9-stable branch. It is committed as bundle because these patches build on each other and only provide the functionality in their entirety. Some are bug fixes to aspects of earlier commits. MFC r242029 (alfred): Allow autotune maxusers > 384 on 64 bit machines. MFC r242847 (alfred): Allow maxusers to scale on machines with large address space. MFC r243631 (andre): Base the mbuf related limits on the available physical memory or kernel memory, whichever is lower. The overall mbuf related memory limit must be set so that mbufs (and clusters of various sizes) can't exhaust physical RAM or KVM. At the same time divorce maxfiles from maxusers and set maxfiles to physpages / 8 with a floor based on maxusers. This way busy servers can make use of the significantly increased mbuf limits with a much larger number of open sockets. MFC r243639 (andre): Complete r243631 by applying the remainder of kern_mbuf.c that got lost while merging into the commit tree. MFC r243668 (andre): Using a long is the wrong type to represent the realmem and maxmbufmem variable as they may overflow on i386/PAE and i386 with > 2GB RAM. MFC r243995, r243996, r243997 (pjd): Style cleanups, Make use of the fact that uma_zone_set_max(9) already returns actual limit set. MFC r244080 (andre): Prevent long type overflow of realmem calculation on ILP32 by forcing calculation to be in quad_t space. Fix style issue with second parameter to qmin(). MFC r245469 (alfred): Do not autotune ncallout to be greater than 18508. MFC r245575 (andre): Move the mbuf memory limit calculations from init_param2() to tunable_mbinit() where it is next to where it is used later. MFC r246207 (andre): Remove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define. MFC r249843 (andre): Base the calculation of maxmbufmem in part on kmem_map size instead of kernel_map size to prevent kernel memory exhaustion by mbufs and a subsequent panic on physical page allocation failure. MFC r253204 (andre): Fix style issues, a typo in "kern.ipc.nmbufs" and correctly plave and expose the value of the tunable maxmbufmem as "kern.ipc.maxmbufmem" through sysctl. MFC r253207 (andre): Make use of the fact that uma_zone_set_max(9) already returns the rounded limit making a call to uma_zone_get_max(9) unnecessary. Tested by: alfred (iXsystems) Modified: stable/9/sys/i386/include/vmparam.h stable/9/sys/kern/kern_mbuf.c stable/9/sys/kern/subr_param.c stable/9/sys/kern/uipc_socket.c stable/9/sys/sys/eventhandler.h stable/9/sys/sys/mbuf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/i386/include/vmparam.h ============================================================================== --- stable/9/sys/i386/include/vmparam.h Mon Aug 19 08:28:35 2013 (r254514) +++ stable/9/sys/i386/include/vmparam.h Mon Aug 19 09:49:51 2013 (r254515) @@ -202,4 +202,8 @@ #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ +#ifndef VM_MAX_AUTOTUNE_MAXUSERS +#define VM_MAX_AUTOTUNE_MAXUSERS 384 +#endif + #endif /* _MACHINE_VMPARAM_H_ */ Modified: stable/9/sys/kern/kern_mbuf.c ============================================================================== --- stable/9/sys/kern/kern_mbuf.c Mon Aug 19 08:28:35 2013 (r254514) +++ stable/9/sys/kern/kern_mbuf.c Mon Aug 19 09:49:51 2013 (r254515) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2004, 2005, - * Bosko Milekic . All rights reserved. + * Bosko Milekic . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -76,7 +77,7 @@ __FBSDID("$FreeBSD$"); * [ Cluster Zone ] [ Zone ] [ Mbuf Master Zone ] * | \________ | * [ Cluster Keg ] \ / - * | [ Mbuf Keg ] + * | [ Mbuf Keg ] * [ Cluster Slabs ] | * | [ Mbuf Slabs ] * \____________(VM)_________________/ @@ -96,39 +97,64 @@ __FBSDID("$FreeBSD$"); * */ +int nmbufs; /* limits number of mbufs */ int nmbclusters; /* limits number of mbuf clusters */ int nmbjumbop; /* limits number of page size jumbo clusters */ int nmbjumbo9; /* limits number of 9k jumbo clusters */ int nmbjumbo16; /* limits number of 16k jumbo clusters */ struct mbstat mbstat; +static quad_t maxmbufmem; /* overall real memory limit for all mbufs */ + +SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN, &maxmbufmem, 0, + "Maximum real memory allocateable to various mbuf types"); + /* - * tunable_mbinit() has to be run before init_maxsockets() thus - * the SYSINIT order below is SI_ORDER_MIDDLE while init_maxsockets() - * runs at SI_ORDER_ANY. + * tunable_mbinit() has to be run before any mbuf allocations are done. */ static void tunable_mbinit(void *dummy) { + quad_t realmem; + + /* + * The default limit for all mbuf related memory is 1/2 of all + * available kernel memory (physical or kmem). + * At most it can be 3/4 of available kernel memory. + */ + realmem = qmin((quad_t)physmem * PAGE_SIZE, + vm_map_max(kmem_map) - vm_map_min(kmem_map)); + maxmbufmem = realmem / 2; + TUNABLE_QUAD_FETCH("kern.ipc.maxmbufmem", &maxmbufmem); + if (maxmbufmem > realmem / 4 * 3) + maxmbufmem = realmem / 4 * 3; - /* This has to be done before VM init. */ TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) - nmbclusters = 1024 + maxusers * 64; + nmbclusters = maxmbufmem / MCLBYTES / 4; TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); if (nmbjumbop == 0) - nmbjumbop = nmbclusters / 2; + nmbjumbop = maxmbufmem / MJUMPAGESIZE / 4; TUNABLE_INT_FETCH("kern.ipc.nmbjumbo9", &nmbjumbo9); if (nmbjumbo9 == 0) - nmbjumbo9 = nmbclusters / 4; + nmbjumbo9 = maxmbufmem / MJUM9BYTES / 6; TUNABLE_INT_FETCH("kern.ipc.nmbjumbo16", &nmbjumbo16); if (nmbjumbo16 == 0) - nmbjumbo16 = nmbclusters / 8; + nmbjumbo16 = maxmbufmem / MJUM16BYTES / 6; + + /* + * We need at least as many mbufs as we have clusters of + * the various types added together. + */ + TUNABLE_INT_FETCH("kern.ipc.nmbufs", &nmbufs); + if (nmbufs < nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) + nmbufs = lmax(maxmbufmem / MSIZE / 5, + nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16); } -SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); +SYSINIT(tunable_mbinit, SI_SUB_KMEM, SI_ORDER_MIDDLE, tunable_mbinit, NULL); static int sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) @@ -136,11 +162,12 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) int error, newnmbclusters; newnmbclusters = nmbclusters; - error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); + error = sysctl_handle_int(oidp, &newnmbclusters, 0, req); if (error == 0 && req->newptr) { - if (newnmbclusters > nmbclusters) { + if (newnmbclusters > nmbclusters && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbclusters = newnmbclusters; - uma_zone_set_max(zone_clust, nmbclusters); + nmbclusters = uma_zone_set_max(zone_clust, nmbclusters); EVENTHANDLER_INVOKE(nmbclusters_change); } else error = EINVAL; @@ -157,11 +184,12 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) int error, newnmbjumbop; newnmbjumbop = nmbjumbop; - error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); + error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbop> nmbjumbop) { + if (newnmbjumbop > nmbjumbop && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbop = newnmbjumbop; - uma_zone_set_max(zone_jumbop, nmbjumbop); + nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop); } else error = EINVAL; } @@ -169,8 +197,7 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, CTLTYPE_INT|CTLFLAG_RW, &nmbjumbop, 0, sysctl_nmbjumbop, "IU", - "Maximum number of mbuf page size jumbo clusters allowed"); - + "Maximum number of mbuf page size jumbo clusters allowed"); static int sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) @@ -178,11 +205,12 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) int error, newnmbjumbo9; newnmbjumbo9 = nmbjumbo9; - error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); + error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbo9> nmbjumbo9) { + if (newnmbjumbo9 > nmbjumbo9 && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo9 = newnmbjumbo9; - uma_zone_set_max(zone_jumbo9, nmbjumbo9); + nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9); } else error = EINVAL; } @@ -190,7 +218,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, CTLTYPE_INT|CTLFLAG_RW, &nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", - "Maximum number of mbuf 9k jumbo clusters allowed"); + "Maximum number of mbuf 9k jumbo clusters allowed"); static int sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) @@ -198,11 +226,12 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS) int error, newnmbjumbo16; newnmbjumbo16 = nmbjumbo16; - error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); + error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req); if (error == 0 && req->newptr) { - if (newnmbjumbo16> nmbjumbo16) { + if (newnmbjumbo16 > nmbjumbo16 && + nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) { nmbjumbo16 = newnmbjumbo16; - uma_zone_set_max(zone_jumbo16, nmbjumbo16); + nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16); } else error = EINVAL; } @@ -212,7 +241,26 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumb &nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); +static int +sysctl_nmbufs(SYSCTL_HANDLER_ARGS) +{ + int error, newnmbufs; + newnmbufs = nmbufs; + error = sysctl_handle_int(oidp, &newnmbufs, 0, req); + if (error == 0 && req->newptr) { + if (newnmbufs > nmbufs) { + nmbufs = newnmbufs; + nmbufs = uma_zone_set_max(zone_mbuf, nmbufs); + EVENTHANDLER_INVOKE(nmbufs_change); + } else + error = EINVAL; + } + return (error); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, CTLTYPE_INT|CTLFLAG_RW, +&nmbufs, 0, sysctl_nmbufs, "IU", + "Maximum number of mbufs allowed"); SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat, "Mbuf general information and statistics"); @@ -241,7 +289,6 @@ static int mb_zinit_pack(void *, int, in static void mb_zfini_pack(void *, int); static void mb_reclaim(void *); -static void mbuf_init(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); /* Ensure that MSIZE doesn't break dtom() - it must be a power of 2 */ @@ -250,7 +297,6 @@ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> /* * Initialize FreeBSD Network buffer allocation. */ -SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); static void mbuf_init(void *dummy) { @@ -266,6 +312,8 @@ mbuf_init(void *dummy) NULL, NULL, #endif MSIZE - 1, UMA_ZONE_MAXBUCKET); + if (nmbufs > 0) + nmbufs = uma_zone_set_max(zone_mbuf, nmbufs); zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, mb_ctor_clust, mb_dtor_clust, @@ -276,7 +324,7 @@ mbuf_init(void *dummy) #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); if (nmbclusters > 0) - uma_zone_set_max(zone_clust, nmbclusters); + nmbclusters = uma_zone_set_max(zone_clust, nmbclusters); zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf); @@ -291,7 +339,7 @@ mbuf_init(void *dummy) #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); if (nmbjumbop > 0) - uma_zone_set_max(zone_jumbop, nmbjumbop); + nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop); zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, mb_ctor_clust, mb_dtor_clust, @@ -301,9 +349,9 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbjumbo9 > 0) - uma_zone_set_max(zone_jumbo9, nmbjumbo9); uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); + if (nmbjumbo9 > 0) + nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9); zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, mb_ctor_clust, mb_dtor_clust, @@ -313,9 +361,9 @@ mbuf_init(void *dummy) NULL, NULL, #endif UMA_ALIGN_PTR, UMA_ZONE_REFCNT); - if (nmbjumbo16 > 0) - uma_zone_set_max(zone_jumbo16, nmbjumbo16); uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); + if (nmbjumbo16 > 0) + nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16); zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), NULL, NULL, @@ -351,6 +399,7 @@ mbuf_init(void *dummy) mbstat.sf_iocnt = 0; mbstat.sf_allocwait = mbstat.sf_allocfail = 0; } +SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL); /* * UMA backend page allocator for the jumbo frame zones. @@ -435,7 +484,7 @@ static void mb_dtor_mbuf(void *mem, int size, void *arg) { struct mbuf *m; - unsigned long flags; + unsigned long flags; m = (struct mbuf *)mem; flags = (unsigned long)arg; Modified: stable/9/sys/kern/subr_param.c ============================================================================== --- stable/9/sys/kern/subr_param.c Mon Aug 19 08:28:35 2013 (r254514) +++ stable/9/sys/kern/subr_param.c Mon Aug 19 09:49:51 2013 (r254515) @@ -287,26 +287,40 @@ init_param2(long physpages) maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; - if (maxusers > 384) - maxusers = 384; - } +#ifdef VM_MAX_AUTOTUNE_MAXUSERS + if (maxusers > VM_MAX_AUTOTUNE_MAXUSERS) + maxusers = VM_MAX_AUTOTUNE_MAXUSERS; +#endif + /* + * Scales down the function in which maxusers grows once + * we hit 384. + */ + if (maxusers > 384) + maxusers = 384 + ((maxusers - 384) / 8); + } /* * The following can be overridden after boot via sysctl. Note: * unless overriden, these macros are ultimately based on maxusers. - */ - maxproc = NPROC; - TUNABLE_INT_FETCH("kern.maxproc", &maxproc); - /* * Limit maxproc so that kmap entries cannot be exhausted by * processes. */ + maxproc = NPROC; + TUNABLE_INT_FETCH("kern.maxproc", &maxproc); if (maxproc > (physpages / 12)) maxproc = physpages / 12; - maxfiles = MAXFILES; - TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); maxprocperuid = (maxproc * 9) / 10; - maxfilesperproc = (maxfiles * 9) / 10; + + /* + * The default limit for maxfiles is 1/12 of the number of + * physical page but not less than 16 times maxusers. + * At most it can be 1/6 the number of physical pages. + */ + maxfiles = imax(MAXFILES, physpages / 8); + TUNABLE_INT_FETCH("kern.maxfiles", &maxfiles); + if (maxfiles > (physpages / 4)) + maxfiles = physpages / 4; + maxfilesperproc = (maxfiles / 10) * 9; /* * Cannot be changed after boot. @@ -315,7 +329,13 @@ init_param2(long physpages) TUNABLE_INT_FETCH("kern.nbuf", &nbuf); TUNABLE_INT_FETCH("kern.bio_transient_maxcnt", &bio_transient_maxcnt); - ncallout = 16 + maxproc + maxfiles; + /* + * XXX: Does the callout wheel have to be so big? + * + * Clip callout to result of previous function of maxusers maximum + * 384. This is still huge, but acceptable. + */ + ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); /* @@ -323,12 +343,12 @@ init_param2(long physpages) * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ maxpipekva = (physpages / 64) * PAGE_SIZE; + TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); if (maxpipekva < 512 * 1024) maxpipekva = 512 * 1024; if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64; - TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); } /* Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Mon Aug 19 08:28:35 2013 (r254514) +++ stable/9/sys/kern/uipc_socket.c Mon Aug 19 09:49:51 2013 (r254515) @@ -282,7 +282,7 @@ init_maxsockets(void *ignored) { TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets); - maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters)); + maxsockets = imax(maxsockets, maxfiles); } SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL); @@ -298,12 +298,9 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) newmaxsockets = maxsockets; error = sysctl_handle_int(oidp, &newmaxsockets, 0, req); if (error == 0 && req->newptr) { - if (newmaxsockets > maxsockets) { + if (newmaxsockets > maxsockets && + newmaxsockets <= maxfiles) { maxsockets = newmaxsockets; - if (maxsockets > ((maxfiles / 4) * 3)) { - maxfiles = (maxsockets * 5) / 4; - maxfilesperproc = (maxfiles * 9) / 10; - } EVENTHANDLER_INVOKE(maxsockets_change); } else error = EINVAL; Modified: stable/9/sys/sys/eventhandler.h ============================================================================== --- stable/9/sys/sys/eventhandler.h Mon Aug 19 08:28:35 2013 (r254514) +++ stable/9/sys/sys/eventhandler.h Mon Aug 19 09:49:51 2013 (r254515) @@ -253,6 +253,7 @@ EVENTHANDLER_DECLARE(thread_fini, thread typedef void (*uma_zone_chfn)(void *); EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); +EVENTHANDLER_DECLARE(nmbufs_change, uma_zone_chfn); EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); #endif /* SYS_EVENTHANDLER_H */ Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Mon Aug 19 08:28:35 2013 (r254514) +++ stable/9/sys/sys/mbuf.h Mon Aug 19 09:49:51 2013 (r254515) @@ -396,7 +396,6 @@ struct mbstat { * * The rest of it is defined in kern/kern_mbuf.c */ - extern uma_zone_t zone_mbuf; extern uma_zone_t zone_clust; extern uma_zone_t zone_pack; From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 10:20:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B5BBBC; Mon, 19 Aug 2013 10:20:22 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3858821F4; Mon, 19 Aug 2013 10:20:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JAKMY3014355; Mon, 19 Aug 2013 10:20:22 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JAKLoK014340; Mon, 19 Aug 2013 10:20:21 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191020.r7JAKLoK014340@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 10:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254516 - in head/sys/dev: bce bxe mge ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 10:20:22 -0000 Author: andre Date: Mon Aug 19 10:20:20 2013 New Revision: 254516 URL: http://svnweb.freebsd.org/changeset/base/254516 Log: Remove unused and incomplete support for delayed fragment checksums from bce(4), bxe(4), mge(4) and ti(4) drivers. Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bxe/if_bxe.c head/sys/dev/mge/if_mge.c head/sys/dev/ti/if_ti.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Aug 19 09:49:51 2013 (r254515) +++ head/sys/dev/bce/if_bce.c Mon Aug 19 10:20:20 2013 (r254516) @@ -9821,9 +9821,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru if (mp->m_flags & M_PKTHDR) { BCE_PRINTF("- m_pkthdr: len = %d, flags = 0x%b, " "csum_flags = %b\n", mp->m_pkthdr.len, - mp->m_flags, "\20\12M_BCAST\13M_MCAST\14M_FRAG" - "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" - "\22M_PROMISC\23M_NOFREE", + mp->m_flags, M_FLAG_PRINTF, mp->m_pkthdr.csum_flags, "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Mon Aug 19 09:49:51 2013 (r254515) +++ head/sys/dev/bxe/if_bxe.c Mon Aug 19 10:20:20 2013 (r254516) @@ -16265,9 +16265,7 @@ void bxe_dump_mbuf(struct bxe_softc *sc, if (m->m_flags & M_PKTHDR) { BXE_PRINTF("- m_pkthdr: len = %d, flags = 0x%b, " "csum_flags = %b\n", m->m_pkthdr.len, - m->m_flags, "\20\12M_BCAST\13M_MCAST\14M_FRAG" - "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" - "\22M_PROMISC\23M_NOFREE", + m->m_flags, M_FLAG_PRINTF, m->m_pkthdr.csum_flags, "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Mon Aug 19 09:49:51 2013 (r254515) +++ head/sys/dev/mge/if_mge.c Mon Aug 19 10:20:20 2013 (r254516) @@ -1703,9 +1703,7 @@ mge_offload_setup_descriptor(struct mge_ ip = (struct ip *)(m0->m_data + ehlen); cmd_status |= MGE_TX_IP_HDR_SIZE(ip->ip_hl); - - if ((m0->m_flags & M_FRAG) == 0) - cmd_status |= MGE_TX_NOT_FRAGMENT; + cmd_status |= MGE_TX_NOT_FRAGMENT; } if (csum_flags & CSUM_IP) Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Aug 19 09:49:51 2013 (r254515) +++ head/sys/dev/ti/if_ti.c Mon Aug 19 10:20:20 2013 (r254516) @@ -3159,24 +3159,6 @@ ti_start_locked(struct ifnet *ifp) break; /* - * XXX - * safety overkill. If this is a fragmented packet chain - * with delayed TCP/UDP checksums, then only encapsulate - * it if we have enough descriptors to handle the entire - * chain at once. - * (paranoia -- may not actually be needed) - */ - if (m_head->m_flags & M_FIRSTFRAG && - m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { - if ((TI_TX_RING_CNT - sc->ti_txcnt) < - m_head->m_pkthdr.csum_data + 16) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - } - - /* * Pack the data into the transmit ring. If we * don't have room, set the OACTIVE flag and wait * for the NIC to drain the ring. From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 10:30:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB32A2AE; Mon, 19 Aug 2013 10:30:16 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 98C1F2263; Mon, 19 Aug 2013 10:30:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JAUG6O024867; Mon, 19 Aug 2013 10:30:16 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JAUGR6024866; Mon, 19 Aug 2013 10:30:16 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191030.r7JAUGR6024866@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 10:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254517 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 10:30:16 -0000 Author: andre Date: Mon Aug 19 10:30:15 2013 New Revision: 254517 URL: http://svnweb.freebsd.org/changeset/base/254517 Log: Remove unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG tagging from ip_fragment(). There wasn't any real driver (and hardware) support for it. Modern hardware does full fragmentation/segmentation offload instead. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Aug 19 10:20:20 2013 (r254516) +++ head/sys/netinet/ip_output.c Mon Aug 19 10:30:15 2013 (r254517) @@ -784,7 +784,7 @@ smart_frag_failure: IPSTAT_INC(ips_odropped); goto done; } - m->m_flags |= (m0->m_flags & M_MCAST) | M_FRAG; + m->m_flags |= (m0->m_flags & M_MCAST); /* * In the first mbuf, leave room for the link header, then * copy the original IP header including options. The payload @@ -801,10 +801,9 @@ smart_frag_failure: m->m_len = mhlen; /* XXX do we need to add ip_off below ? */ mhip->ip_off = ((off - hlen) >> 3) + ip_off; - if (off + len >= ip_len) { /* last fragment */ + if (off + len >= ip_len) len = ip_len - off; - m->m_flags |= M_LASTFRAG; - } else + else mhip->ip_off |= IP_MF; mhip->ip_len = htons((u_short)(len + mhlen)); m->m_next = m_copym(m0, off, len, M_NOWAIT); @@ -831,10 +830,6 @@ smart_frag_failure: } IPSTAT_ADD(ips_ofragments, nfrags); - /* set first marker for fragment chain */ - m0->m_flags |= M_FIRSTFRAG | M_FRAG; - m0->m_pkthdr.csum_data = nfrags; - /* * Update first fragment by trimming what's been copied out * and updating header. From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 10:34:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8AE62464; Mon, 19 Aug 2013 10:34:11 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7840122DC; Mon, 19 Aug 2013 10:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JAYBcU027838; Mon, 19 Aug 2013 10:34:11 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JAYBxm027833; Mon, 19 Aug 2013 10:34:11 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191034.r7JAYBxm027833@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 10:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254518 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 10:34:11 -0000 Author: andre Date: Mon Aug 19 10:34:10 2013 New Revision: 254518 URL: http://svnweb.freebsd.org/changeset/base/254518 Log: Move ip_reassemble()'s use of the global M_FRAG mbuf flag to a protocol layer specific flag instead. The flag is only relevant while the packet stays in the IP reassembly queue. Discussed with: trociny, glebius Modified: head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Aug 19 10:30:15 2013 (r254517) +++ head/sys/netinet/ip_input.c Mon Aug 19 10:34:10 2013 (r254518) @@ -911,9 +911,9 @@ found: IPSTAT_INC(ips_toosmall); /* XXX */ goto dropfrag; } - m->m_flags |= M_FRAG; + m->m_flags |= M_IP_FRAG; } else - m->m_flags &= ~M_FRAG; + m->m_flags &= ~M_IP_FRAG; ip->ip_off = htons(ntohs(ip->ip_off) << 3); /* @@ -1060,7 +1060,7 @@ found: next += ntohs(GETIP(q)->ip_len); } /* Make sure the last packet didn't have the IP_MF flag */ - if (p->m_flags & M_FRAG) { + if (p->m_flags & M_IP_FRAG) { if (fp->ipq_nfrags > V_maxfragsperpacket) { IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); ip_freef(head, fp); Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Mon Aug 19 10:30:15 2013 (r254517) +++ head/sys/netinet/ip_var.h Mon Aug 19 10:34:10 2013 (r254518) @@ -167,6 +167,7 @@ void kmod_ipstat_dec(int statnum); */ #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ #define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_IP_FRAG M_PROTO4 /* fragment reassembly */ #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 11:08:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D43560D; Mon, 19 Aug 2013 11:08:37 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC532673; Mon, 19 Aug 2013 11:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JB8bdT057786; Mon, 19 Aug 2013 11:08:37 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JB8aQ4057777; Mon, 19 Aug 2013 11:08:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191108.r7JB8aQ4057777@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 11:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254519 - in head/sys: netinet netinet6 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 11:08:37 -0000 Author: andre Date: Mon Aug 19 11:08:36 2013 New Revision: 254519 URL: http://svnweb.freebsd.org/changeset/base/254519 Log: Move the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific flag instead. The flag is only used within the IP and IPv6 layer 3 protocols. Because some firewall packages treat IPv4 and IPv6 packets the same the flag should have the same value for both. Discussed with: trociny, glebius Modified: head/sys/netinet/ip_var.h head/sys/netinet6/ip6_var.h head/sys/sys/mbuf.h Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Mon Aug 19 10:34:10 2013 (r254518) +++ head/sys/netinet/ip_var.h Mon Aug 19 11:08:36 2013 (r254519) @@ -163,10 +163,12 @@ void kmod_ipstat_dec(int statnum); #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ /* - * mbuf flag used by ip_fastfwd + * IPv4 protocol layer specific mbuf flags. */ #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ #define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, + keep in sync with IP6 */ #define M_IP_FRAG M_PROTO4 /* fragment reassembly */ #ifdef __NO_STRICT_ALIGNMENT Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Mon Aug 19 10:34:10 2013 (r254518) +++ head/sys/netinet6/ip6_var.h Mon Aug 19 11:08:36 2013 (r254519) @@ -293,7 +293,12 @@ struct ip6aux { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ -#define M_IP6_NEXTHOP M_PROTO7 /* explicit ip nexthop */ +/* + * IPv6 protocol layer specific mbuf flags. + */ +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, + keep in sync with IPv4 */ #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 10:34:10 2013 (r254518) +++ head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013 (r254519) @@ -196,7 +196,7 @@ struct mbuf { #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ #define M_LASTFRAG 0x00002000 /* packet is last fragment */ -#define M_SKIP_FIREWALL 0x00004000 /* skip firewall processing */ + /* 0x00004000 free */ /* 0x00008000 free */ #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ #define M_PROMISC 0x00020000 /* packet was not for us */ @@ -253,7 +253,7 @@ struct mbuf { * Flags preserved when copying m_pkthdr. */ #define M_COPYFLAGS \ - (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_SKIP_FIREWALL|M_BCAST|M_MCAST|\ + (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\ M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_HASHTYPEBITS) /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 11:16:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDD279E8; Mon, 19 Aug 2013 11:16:54 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B98952728; Mon, 19 Aug 2013 11:16:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JBGsfu065805; Mon, 19 Aug 2013 11:16:54 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JBGsc6065793; Mon, 19 Aug 2013 11:16:54 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191116.r7JBGsc6065793@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 11:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254520 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 11:16:55 -0000 Author: andre Date: Mon Aug 19 11:16:53 2013 New Revision: 254520 URL: http://svnweb.freebsd.org/changeset/base/254520 Log: Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree users for a very long time, if ever. Should such a functionality ever be needed again the appropriate and much better way to do it is through a custom EXT_SOMETHING external mbuf type together with a dedicated *ext_free function. Discussed with: trociny, glebius Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Aug 19 11:08:36 2013 (r254519) +++ head/sys/kern/kern_mbuf.c Mon Aug 19 11:16:53 2013 (r254520) @@ -474,7 +474,6 @@ mb_dtor_mbuf(void *mem, int size, void * if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0) m_tag_delete_chain(m, NULL); KASSERT((m->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__)); - KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); #ifdef INVARIANTS trash_dtor(mem, size, arg); #endif Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Aug 19 11:08:36 2013 (r254519) +++ head/sys/kern/uipc_mbuf.c Mon Aug 19 11:16:53 2013 (r254520) @@ -278,17 +278,10 @@ m_extadd(struct mbuf *mb, caddr_t buf, u void mb_free_ext(struct mbuf *m) { - int skipmbuf; KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__)); KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__)); - - /* - * check if the header is embedded in the cluster - */ - skipmbuf = (m->m_flags & M_NOFREE); - /* Free attached storage if this mbuf is the only reference to it. */ if (*(m->m_ext.ref_cnt) == 1 || atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) { @@ -329,8 +322,6 @@ mb_free_ext(struct mbuf *m) ("%s: unknown ext_type", __func__)); } } - if (skipmbuf) - return; /* * Free this mbuf back to the mbuf zone with all m_ext @@ -395,7 +386,7 @@ m_demote(struct mbuf *m0, int all) m_freem(m->m_nextpkt); m->m_nextpkt = NULL; } - m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE); + m->m_flags = m->m_flags & (M_EXT|M_RDONLY); } } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013 (r254519) +++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013 (r254520) @@ -200,7 +200,7 @@ struct mbuf { /* 0x00008000 free */ #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ #define M_PROMISC 0x00020000 /* packet was not for us */ -#define M_NOFREE 0x00040000 /* do not free mbuf, embedded in cluster */ + /* 0x00040000 free */ #define M_PROTO6 0x00080000 /* protocol-specific */ #define M_PROTO7 0x00100000 /* protocol-specific */ #define M_PROTO8 0x00200000 /* protocol-specific */ @@ -515,7 +515,7 @@ m_free(struct mbuf *m) if (m->m_flags & M_EXT) mb_free_ext(m); - else if ((m->m_flags & M_NOFREE) == 0) + else uma_zfree(zone_mbuf, m); return (n); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 11:23:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75C9AD26; Mon, 19 Aug 2013 11:23:39 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com [IPv6:2607:f8b0:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2C7D2799; Mon, 19 Aug 2013 11:23:38 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id ha12so2890004vcb.37 for ; Mon, 19 Aug 2013 04:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=1I5XMmkdC5W6EQp1dtooni+gFizXIw1sDnzb/+Q8Oxc=; b=j6OZeyKmYAutDLEopLzcm7GqB+usm4PTf0uJ6Dw7MfRYD3ABX6q1SCenEpzWrMLuAD Pnnkb5Z9sVq4GA8QMexjduH9yKwagS8Gmg4VzLeRItvr8WwlUYnmkr6wPHmgZ7aPczBx ewZHoyGsSLxvtNahBdV3d8Kbp/H60SJLkgrguKt6g/aM/4A2pUpuqvThXYk7imhRg/rs ObnjoXxNShQDILvXZ51hZFfxb9DnaqbIE76AZeznSNMAATK1Ch9DHmjC375rutmpTCKn r12d6qkB9TkAI8+xF7kmV3UcOBcm3Nq+uaOIoSMBwyLaNpB8/PeVu9km91G1ccjn+1zM Atfw== MIME-Version: 1.0 X-Received: by 10.52.103.35 with SMTP id ft3mr11128463vdb.5.1376911418024; Mon, 19 Aug 2013 04:23:38 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.21.140 with HTTP; Mon, 19 Aug 2013 04:23:37 -0700 (PDT) In-Reply-To: <201308191116.r7JBGsc6065793@svn.freebsd.org> References: <201308191116.r7JBGsc6065793@svn.freebsd.org> Date: Mon, 19 Aug 2013 13:23:37 +0200 X-Google-Sender-Auth: jAOYSwQBxGZ_iwqjFqX3qcFwND4 Message-ID: Subject: Re: svn commit: r254520 - in head/sys: kern sys From: Davide Italiano To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 11:23:39 -0000 On Mon, Aug 19, 2013 at 1:16 PM, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 19 11:16:53 2013 > New Revision: 254520 > URL: http://svnweb.freebsd.org/changeset/base/254520 > > Log: > Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree users > for a very long time, if ever. > > Should such a functionality ever be needed again the appropriate and > much better way to do it is through a custom EXT_SOMETHING external mbuf > type together with a dedicated *ext_free function. > > Discussed with: trociny, glebius > > Modified: > head/sys/kern/kern_mbuf.c > head/sys/kern/uipc_mbuf.c > head/sys/sys/mbuf.h > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Mon Aug 19 11:08:36 2013 (r254519) > +++ head/sys/kern/kern_mbuf.c Mon Aug 19 11:16:53 2013 (r254520) > @@ -474,7 +474,6 @@ mb_dtor_mbuf(void *mem, int size, void * > if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0) > m_tag_delete_chain(m, NULL); > KASSERT((m->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__)); > - KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); > #ifdef INVARIANTS > trash_dtor(mem, size, arg); > #endif > > Modified: head/sys/kern/uipc_mbuf.c > ============================================================================== > --- head/sys/kern/uipc_mbuf.c Mon Aug 19 11:08:36 2013 (r254519) > +++ head/sys/kern/uipc_mbuf.c Mon Aug 19 11:16:53 2013 (r254520) > @@ -278,17 +278,10 @@ m_extadd(struct mbuf *mb, caddr_t buf, u > void > mb_free_ext(struct mbuf *m) > { > - int skipmbuf; > > KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__)); > KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__)); > > - > - /* > - * check if the header is embedded in the cluster > - */ > - skipmbuf = (m->m_flags & M_NOFREE); > - > /* Free attached storage if this mbuf is the only reference to it. */ > if (*(m->m_ext.ref_cnt) == 1 || > atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) { > @@ -329,8 +322,6 @@ mb_free_ext(struct mbuf *m) > ("%s: unknown ext_type", __func__)); > } > } > - if (skipmbuf) > - return; > > /* > * Free this mbuf back to the mbuf zone with all m_ext > @@ -395,7 +386,7 @@ m_demote(struct mbuf *m0, int all) > m_freem(m->m_nextpkt); > m->m_nextpkt = NULL; > } > - m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE); > + m->m_flags = m->m_flags & (M_EXT|M_RDONLY); > } > } > > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013 (r254519) > +++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013 (r254520) > @@ -200,7 +200,7 @@ struct mbuf { > /* 0x00008000 free */ > #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ > #define M_PROMISC 0x00020000 /* packet was not for us */ > -#define M_NOFREE 0x00040000 /* do not free mbuf, embedded in cluster */ > + /* 0x00040000 free */ I think you should just use M_UNUSED or something similar here for consistency, like it's happening in td_pflags (sys/sys/proc.h), e.g.: #define TDP_UNUSED9 0x00000100 /* --available-- */ > #define M_PROTO6 0x00080000 /* protocol-specific */ > #define M_PROTO7 0x00100000 /* protocol-specific */ > #define M_PROTO8 0x00200000 /* protocol-specific */ > @@ -515,7 +515,7 @@ m_free(struct mbuf *m) > > if (m->m_flags & M_EXT) > mb_free_ext(m); > - else if ((m->m_flags & M_NOFREE) == 0) > + else > uma_zfree(zone_mbuf, m); > return (n); > } -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 11:44:12 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0D737370; Mon, 19 Aug 2013 11:44:12 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02DCE289A; Mon, 19 Aug 2013 11:44:10 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r7JBhpnt099200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Aug 2013 20:44:01 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r7JBhpkN082851; Mon, 19 Aug 2013 20:43:51 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 19 Aug 2013 20:43:30 +0900 (JST) Message-Id: <20130819.204330.2144498109880721402.hrs@allbsd.org> To: pjd@FreeBSD.org Subject: Re: svn commit: r254484 - head/lib/libc/net From: Hiroki Sato In-Reply-To: <201308181038.r7IAcxkM008487@svn.freebsd.org> References: <201308181038.r7IAcxkM008487@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Aug_19_20_43_30_2013_401)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 19 Aug 2013 20:44:02 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 11:44:12 -0000 ----Security_Multipart(Mon_Aug_19_20_43_30_2013_401)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Pawel Jakub Dawidek wrote in <201308181038.r7IAcxkM008487@svn.freebsd.org>: pj> Author: pjd pj> Date: Sun Aug 18 10:38:59 2013 pj> New Revision: 254484 pj> URL: http://svnweb.freebsd.org/changeset/base/254484 pj> pj> Log: pj> Consistently use 'af' as an argument name for address family. pj> Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument name. pj> The same argument name is also used in implementations of those functions. pj> pj> Modified: pj> head/lib/libc/net/gethostbyname.3 pj> pj> Modified: head/lib/libc/net/gethostbyname.3 pj> ============================================================================== pj> --- head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:33:46 2013 (r254483) pj> +++ head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:38:59 2013 (r254484) pj> @@ -51,7 +51,7 @@ pj> .Ft struct hostent * pj> .Fn gethostbyname2 "const char *name" "int af" pj> .Ft struct hostent * pj> -.Fn gethostbyaddr "const void *addr" "socklen_t len" "int type" pj> +.Fn gethostbyaddr "const void *addr" "socklen_t len" "int af" pj> .Ft struct hostent * pj> .Fn gethostent void pj> .Ft void pj> @@ -107,7 +107,7 @@ in binary form pj> .Tn ASCII pj> form). pj> The pj> -.Fa type pj> +.Fa af pj> argument specifies the address family pj> (e.g.\& pj> .Dv AF_INET , AF_INET6 , I do not think we need to change this for consistency between the manual page and its implementation. gethostbyaddr()'s "int type" appears literally in POSIX and almost all systems have used that definition for a long time. -- Hiroki ----Security_Multipart(Mon_Aug_19_20_43_30_2013_401)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlISBOIACgkQTyzT2CeTzy2TzgCggcC9opOtNYppEufIHGVM4UCK tIUAn23y+5/RmqL9A53XWYZeUpiTEKwT =ATQ/ -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Aug_19_20_43_30_2013_401)---- From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 12:13:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ADC38E15 for ; Mon, 19 Aug 2013 12:13:36 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F8472A6F for ; Mon, 19 Aug 2013 12:13:35 +0000 (UTC) Received: (qmail 66615 invoked from network); 19 Aug 2013 12:57:03 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 19 Aug 2013 12:57:03 -0000 Message-ID: <52120BEC.4050604@freebsd.org> Date: Mon, 19 Aug 2013 14:13:32 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Davide Italiano Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 12:13:36 -0000 On 19.08.2013 13:23, Davide Italiano wrote: > On Mon, Aug 19, 2013 at 1:16 PM, Andre Oppermann wrote: >> Modified: head/sys/sys/mbuf.h >> ============================================================================== >> --- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013 (r254519) >> +++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013 (r254520) >> @@ -200,7 +200,7 @@ struct mbuf { >> /* 0x00008000 free */ >> #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ >> #define M_PROMISC 0x00020000 /* packet was not for us */ >> -#define M_NOFREE 0x00040000 /* do not free mbuf, embedded in cluster */ >> + /* 0x00040000 free */ > > I think you should just use M_UNUSED or something similar here for > consistency, like it's happening in td_pflags (sys/sys/proc.h), e.g.: > > #define TDP_UNUSED9 0x00000100 /* --available-- */ There's a couple of more changes upcoming that will take care of it. -- Andre From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 12:30:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55F562E4; Mon, 19 Aug 2013 12:30:19 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 431F62B33; Mon, 19 Aug 2013 12:30:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JCUJjb030500; Mon, 19 Aug 2013 12:30:19 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JCUIJF030496; Mon, 19 Aug 2013 12:30:18 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191230.r7JCUIJF030496@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 12:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254521 - in head/sys: netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 12:30:19 -0000 Author: andre Date: Mon Aug 19 12:30:18 2013 New Revision: 254521 URL: http://svnweb.freebsd.org/changeset/base/254521 Log: Move the SCTP specific definition of M_NOTIFICATION onto a protocol specific mbuf flag from sys/mbuf.h to netinet/sctp_os_bsd.h. It is only relevant within SCTP. Discussed with: tuexen Modified: head/sys/netinet/sctp_os_bsd.h head/sys/sys/mbuf.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon Aug 19 11:16:53 2013 (r254520) +++ head/sys/netinet/sctp_os_bsd.h Mon Aug 19 12:30:18 2013 (r254521) @@ -429,6 +429,11 @@ typedef struct rtentry sctp_rtentry_t; #define SCTP_ZERO_COPY_SENDQ_EVENT(inp, so) /* + * SCTP protocol specific mbuf flags. + */ +#define M_NOTIFICATION M_PROTO5 /* SCTP notification */ + +/* * IP output routines */ #define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id) \ Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013 (r254520) +++ head/sys/sys/mbuf.h Mon Aug 19 12:30:18 2013 (r254521) @@ -207,8 +207,6 @@ struct mbuf { #define M_FLOWID 0x00400000 /* deprecated: flowid is valid */ #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ -#define M_NOTIFICATION M_PROTO5 /* SCTP notification */ - /* * Flags to purge when crossing layers. */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 12:37:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD5208D7; Mon, 19 Aug 2013 12:37:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBB832BBF; Mon, 19 Aug 2013 12:37:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JCbEnv037363; Mon, 19 Aug 2013 12:37:14 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JCbDGH037353; Mon, 19 Aug 2013 12:37:14 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201308191237.r7JCbDGH037353@svn.freebsd.org> From: David Chisnall Date: Mon, 19 Aug 2013 12:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254522 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 12:37:15 -0000 Author: theraven Date: Mon Aug 19 12:37:13 2013 New Revision: 254522 URL: http://svnweb.freebsd.org/changeset/base/254522 Log: Add support for parameterised device tree sources to the device tree compiler. Reviewed by: brooks Sponsored by: DARPA, AFRL Modified: head/usr.bin/dtc/dtc.1 head/usr.bin/dtc/dtc.cc head/usr.bin/dtc/fdt.cc head/usr.bin/dtc/fdt.hh Modified: head/usr.bin/dtc/dtc.1 ============================================================================== --- head/usr.bin/dtc/dtc.1 Mon Aug 19 12:30:18 2013 (r254521) +++ head/usr.bin/dtc/dtc.1 Mon Aug 19 12:37:13 2013 (r254522) @@ -51,6 +51,7 @@ .Op Fl p Ar bytes .Op Fl V Ar blob_version .Op Fl W Ar [no-]checker_name +.Op Fl P Ar predefined_properties .Ar input_file .Sh DESCRIPTION The @@ -132,6 +133,22 @@ The ASCII representation of the FDT. .El .It Fl o Ar output_file The file to which to write the output. +.It Fl P Ar predefined_macro +Defines a macro, in the form +.Ar name=value +or +.Ar name +to be used for device tree source files that contain conditional components. +This tool supports two extensions to the standard to support conditional +compilation of device trees. +The first is an +.Ar /include/if [property]/ "file.dts" +directive that is allowed at the start of a file and which will only include +the specified file if it the specified property is passed with this flag. +The second is the +.Ar $NAME +format for property values. +These allow property value to be specified on the command line. .It Fl R Ar entries The number of empty reservation table entries to pad the table with. This is Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Mon Aug 19 12:30:18 2013 (r254521) +++ head/usr.bin/dtc/dtc.cc Mon Aug 19 12:37:13 2013 (r254522) @@ -100,7 +100,7 @@ main(int argc, char **argv) clock_t c0 = clock(); class device_tree tree; fdt::checking::check_manager checks; - const char *options = "hqI:O:o:V:d:R:S:p:b:fisvH:W:E:D"; + const char *options = "hqI:O:o:V:d:R:S:p:b:fisvH:W:E:DP:"; // Don't forget to update the man page if any more options are added. while ((ch = getopt(argc, argv, options)) != -1) @@ -267,6 +267,13 @@ main(int argc, char **argv) case 'p': tree.set_blob_padding(strtoll(optarg, 0, 10)); break; + case 'P': + if (!tree.parse_define(optarg)) + { + fprintf(stderr, "Invalid predefine value %s\n", + optarg); + } + break; default: fprintf(stderr, "Unknown option %c\n", ch); return EXIT_FAILURE; Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Mon Aug 19 12:30:18 2013 (r254521) +++ head/usr.bin/dtc/fdt.cc Mon Aug 19 12:37:13 2013 (r254522) @@ -382,13 +382,45 @@ property::property(input_buffer &structs values.push_back(v); } -property::property(input_buffer &input, string k, string l) : key(k), label(l), - valid(true) +void property::parse_define(input_buffer &input, define_map *defines) +{ + input.consume('$'); + if (!defines) + { + input.parse_error("No predefined properties to match name\n"); + valid = false; + return; + } + string name = string::parse_property_name(input); + define_map::iterator found; + if ((name == string()) || + ((found = defines->find(name)) == defines->end())) + { + input.parse_error("Undefined property name\n"); + valid = false; + return; + } + values.push_back((*found).second->values[0]); +} + +property::property(input_buffer &input, + string k, + string l, + bool semicolonTerminated, + define_map *defines) : key(k), label(l), valid(true) { do { input.next_token(); switch (input[0]) { + case '$': + { + parse_define(input, defines); + if (valid) + { + break; + } + } default: input.parse_error("Invalid property value."); valid = false; @@ -412,7 +444,7 @@ property::property(input_buffer &input, } input.next_token(); } while (input.consume(',')); - if (!input.consume(';')) + if (semicolonTerminated && !input.consume(';')) { input.parse_error("Expected ; at end of property"); valid = false; @@ -432,9 +464,10 @@ property::parse_dtb(input_buffer &struct } property* -property::parse(input_buffer &input, string key, string label) +property::parse(input_buffer &input, string key, string label, + bool semicolonTerminated, define_map *defines) { - property *p = new property(input, key, label); + property *p = new property(input, key, label, semicolonTerminated, defines); if (!p->valid) { delete p; @@ -591,7 +624,7 @@ node::node(input_buffer &structs, input_ return; } -node::node(input_buffer &input, string n, string l, string a) : +node::node(input_buffer &input, string n, string l, string a, define_map *defines) : label(l), name(n), unit_address(a), valid(true) { if (!input.consume('{')) @@ -628,7 +661,7 @@ node::node(input_buffer &input, string n if (input.consume('=')) { property *p= property::parse(input, child_name, - child_label); + child_label, true, defines); if (p == 0) { valid = false; @@ -641,7 +674,7 @@ node::node(input_buffer &input, string n else if (!is_property && input[0] == ('{')) { node *child = node::parse(input, child_name, - child_label, child_address); + child_label, child_address, defines); if (child) { children.push_back(child); @@ -693,9 +726,13 @@ node::sort() } node* -node::parse(input_buffer &input, string name, string label, string address) +node::parse(input_buffer &input, + string name, + string label, + string address, + define_map *defines) { - node *n = new node(input, name, label, address); + node *n = new node(input, name, label, address, defines); if (!n->valid) { delete n; @@ -1008,7 +1045,7 @@ device_tree::parse_roots(input_buffer &i while (valid && input.consume('/')) { input.next_token(); - node *n = node::parse(input, string("", 1)); + node *n = node::parse(input, string("", 1), string(), string(), &defines); if (n) { roots.push_back(n); @@ -1241,6 +1278,18 @@ device_tree::parse_dts(const char *fn, F input.next_token(); while(input.consume("/include/")) { + bool reallyInclude = true; + if (input.consume("if ")) + { + input.next_token(); + string name = string::parse_property_name(input); + // XXX: Error handling + if (defines.find(name) == defines.end()) + { + reallyInclude = false; + } + input.consume('/'); + } input.next_token(); if (!input.consume('"')) { @@ -1259,6 +1308,14 @@ device_tree::parse_dts(const char *fn, F include_file[dir_length] = '/'; memcpy(include_file+dir_length+1, file, length); include_file[dir_length+length+1] = 0; + + input.consume(include_file+dir_length+1); + input.consume('"'); + if (!reallyInclude) + { + continue; + } + input_buffer *include_buffer = buffer_for_file(include_file); if (include_buffer == 0) @@ -1292,8 +1349,6 @@ device_tree::parse_dts(const char *fn, F return; } input_buffer &include = *include_buffer; - input.consume(include_file+dir_length+1); - input.consume('"'); free((void*)include_file); if (!read_header) @@ -1361,6 +1416,33 @@ device_tree::~device_tree() delete buffers.back(); buffers.pop_back(); } + for (define_map::iterator i=defines.begin(), e=defines.end() ; + i!=e ; ++i) + { + delete i->second; + } +} + +bool device_tree::parse_define(const char *def) +{ + char *val = strchr(def, '='); + if (!val) + { + if (strlen(def) != 0) + { + string name(def); + defines[name]; + return true; + } + return false; + } + string name(def, val-def); + val++; + input_buffer in = input_buffer(val, strlen(val)); + property *p = property::parse(in, name, string(), false); + if (p) + defines[name] = p; + return p; } } // namespace fdt Modified: head/usr.bin/dtc/fdt.hh ============================================================================== --- head/usr.bin/dtc/fdt.hh Mon Aug 19 12:30:18 2013 (r254521) +++ head/usr.bin/dtc/fdt.hh Mon Aug 19 12:37:13 2013 (r254522) @@ -48,6 +48,8 @@ class string_table; namespace fdt { +class property; +typedef std::map define_map; /** * Properties may contain a number of different value, each with a different * label. This class encapsulates a single value. @@ -263,6 +265,10 @@ class property */ void parse_reference(input_buffer &input); /** + * Parse a predefined macro definition for a property. + */ + void parse_define(input_buffer &input, define_map *defines); + /** * Constructs a new property from two input buffers, pointing to the * struct and strings tables in the device tree blob, respectively. * The structs input buffer is assumed to have just consumed the @@ -272,7 +278,11 @@ class property /** * Parses a new property from the input buffer. */ - property(input_buffer &input, string k, string l); + property(input_buffer &input, + string k, + string l, + bool terminated, + define_map *defines); public: /** * Creates an empty property. @@ -298,7 +308,9 @@ class property */ static property* parse(input_buffer &input, string key, - string label=string()); + string label=string(), + bool semicolonTerminated=true, + define_map *defines=0); /** * Iterator type used for accessing the values of a property. */ @@ -398,7 +410,7 @@ class node * node. The name, and optionally label and unit address, should have * already been parsed. */ - node(input_buffer &input, string n, string l, string a); + node(input_buffer &input, string n, string l, string a, define_map*); /** * Comparison function for properties, used when sorting the properties * vector. Orders the properties based on their names. @@ -476,7 +488,8 @@ class node static node* parse(input_buffer &input, string name, string label=string(), - string address=string()); + string address=string(), + define_map *defines=0); /** * Factory method for constructing a new node. Attempts to parse a * node in DTB format from the input, and returns it on success. On @@ -617,6 +630,10 @@ class device_tree */ std::vector include_paths; /** + * Dictionary of predefined macros provided on the command line. + */ + define_map defines; + /** * The default boot CPU, specified in the device tree header. */ uint32_t boot_cpu; @@ -773,6 +790,10 @@ class device_tree { blob_padding = p; } + /** + * Parses a predefined macro value. + */ + bool parse_define(const char *def); }; } // namespace fdt From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 12:41:13 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 01C07DBD; Mon, 19 Aug 2013 12:41:13 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BBB5E2C0C; Mon, 19 Aug 2013 12:41:12 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id E8B63BEF; Mon, 19 Aug 2013 14:35:49 +0200 (CEST) Date: Mon, 19 Aug 2013 14:42:07 +0200 From: Pawel Jakub Dawidek To: Hiroki Sato Subject: Re: svn commit: r254484 - head/lib/libc/net Message-ID: <20130819124206.GB1383@garage.freebsd.pl> References: <201308181038.r7IAcxkM008487@svn.freebsd.org> <20130819.204330.2144498109880721402.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/NkBOFFp2J2Af1nK" Content-Disposition: inline In-Reply-To: <20130819.204330.2144498109880721402.hrs@allbsd.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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 12:41:13 -0000 --/NkBOFFp2J2Af1nK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 19, 2013 at 08:43:30PM +0900, Hiroki Sato wrote: > Pawel Jakub Dawidek wrote > in <201308181038.r7IAcxkM008487@svn.freebsd.org>: >=20 > pj> Author: pjd > pj> Date: Sun Aug 18 10:38:59 2013 > pj> New Revision: 254484 > pj> URL: http://svnweb.freebsd.org/changeset/base/254484 > pj> > pj> Log: > pj> Consistently use 'af' as an argument name for address family. > pj> Now both gethostbyname2(3) and gethostbyaddr(3) use the same argume= nt name. > pj> The same argument name is also used in implementations of those fun= ctions. > pj> > pj> Modified: > pj> head/lib/libc/net/gethostbyname.3 > pj> > pj> Modified: head/lib/libc/net/gethostbyname.3 > pj> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > pj> --- head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:33:46 2013 (r2544= 83) > pj> +++ head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:38:59 2013 (r2544= 84) > pj> @@ -51,7 +51,7 @@ > pj> .Ft struct hostent * > pj> .Fn gethostbyname2 "const char *name" "int af" > pj> .Ft struct hostent * > pj> -.Fn gethostbyaddr "const void *addr" "socklen_t len" "int type" > pj> +.Fn gethostbyaddr "const void *addr" "socklen_t len" "int af" > pj> .Ft struct hostent * > pj> .Fn gethostent void > pj> .Ft void > pj> @@ -107,7 +107,7 @@ in binary form > pj> .Tn ASCII > pj> form). > pj> The > pj> -.Fa type > pj> +.Fa af > pj> argument specifies the address family > pj> (e.g.\& > pj> .Dv AF_INET , AF_INET6 , >=20 > I do not think we need to change this for consistency between the > manual page and its implementation. gethostbyaddr()'s "int type" > appears literally in POSIX and almost all systems have used that > definition for a long time. The reason I noticed was that address family argument was named 'af' in gethostbyname2() above, but 'type' in gethostbyaddr() - the same argument, but two different names. Originally I changed 'af' to 'type' for gethostbyname2(), but then decided that 'type' is just too universal and that implementation is using 'af', so I ended up changing 'type' in gethostbyaddr() to 'af'. Is POSIX consistent with naming address family argument for gethostbyaddr() and gethostbyname2()? I'm happy to change those two to 'type', I just would like the name to be consistent between those two functions. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --/NkBOFFp2J2Af1nK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlISEp4ACgkQForvXbEpPzS2ngCgjvvLZbcfK+GD7mIdSj3v7/ib BdsAoNLSoG8Od04QLEHJ+NBG4AjodoX2 =pfS9 -----END PGP SIGNATURE----- --/NkBOFFp2J2Af1nK-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 13:27:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4DF04F3E; Mon, 19 Aug 2013 13:27:36 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2BA3D2E79; Mon, 19 Aug 2013 13:27:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JDRaFJ063750; Mon, 19 Aug 2013 13:27:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JDRXFD063735; Mon, 19 Aug 2013 13:27:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191327.r7JDRXFD063735@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 13:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254523 - in head/sys: net net80211 netinet netinet6 netpfil/pf ofed/drivers/infiniband/ulp/ipoib sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 13:27:36 -0000 Author: andre Date: Mon Aug 19 13:27:32 2013 New Revision: 254523 URL: http://svnweb.freebsd.org/changeset/base/254523 Log: Add m_clrprotoflags() to clear protocol specific mbuf flags at up and downwards layer crossings. Consistently use it within IP, IPv6 and ethernet protocols. Discussed with: trociny, glebius Modified: head/sys/net/if_ethersubr.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_output.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet6/ip6_mroute.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/send.c head/sys/netpfil/pf/pf.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/sys/mbuf.h Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/net/if_ethersubr.c Mon Aug 19 13:27:32 2013 (r254523) @@ -774,7 +774,7 @@ ether_demux(struct ifnet *ifp, struct mb * Strip off Ethernet header. */ m->m_flags &= ~M_VLANTAG; - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); m_adj(m, ETHER_HDR_LEN); /* Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/net80211/ieee80211_hostap.c Mon Aug 19 13:27:32 2013 (r254523) @@ -355,7 +355,8 @@ hostap_deliver_data(struct ieee80211vap struct ifnet *ifp = vap->iv_ifp; /* clear driver/net80211 flags before passing up */ - m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); + m->m_flags &= ~(M_MCAST | M_BCAST); + m_clrprotoflags(m); KASSERT(vap->iv_opmode == IEEE80211_M_HOSTAP, ("gack, opmode %d", vap->iv_opmode)); Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/net80211/ieee80211_input.c Mon Aug 19 13:27:32 2013 (r254523) @@ -250,7 +250,8 @@ ieee80211_deliver_data(struct ieee80211v struct ifnet *ifp = vap->iv_ifp; /* clear driver/net80211 flags before passing up */ - m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); + m->m_flags &= ~(M_MCAST | M_BCAST); + m_clrprotoflags(m); /* NB: see hostap_deliver_data, this path doesn't handle hostap */ KASSERT(vap->iv_opmode != IEEE80211_M_HOSTAP, ("gack, hostap")); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet/if_ether.c Mon Aug 19 13:27:32 2013 (r254523) @@ -281,6 +281,7 @@ arprequest(struct ifnet *ifp, const stru sa.sa_family = AF_ARP; sa.sa_len = 2; m->m_flags |= M_BCAST; + m_clrprotoflags(m); /* Avoid confusing lower layers. */ (*ifp->if_output)(ifp, m, &sa, NULL); ARPSTAT_INC(txrequests); } @@ -784,6 +785,8 @@ match: for (; m_hold != NULL; m_hold = m_hold_next) { m_hold_next = m_hold->m_nextpkt; m_hold->m_nextpkt = NULL; + /* Avoid confusing lower layers. */ + m_clrprotoflags(m_hold); (*ifp->if_output)(ifp, m_hold, &sa, NULL); } } else @@ -888,6 +891,7 @@ reply: m->m_pkthdr.rcvif = NULL; sa.sa_family = AF_ARP; sa.sa_len = 2; + m_clrprotoflags(m); /* Avoid confusing lower layers. */ (*ifp->if_output)(ifp, m, &sa, NULL); ARPSTAT_INC(txreplies); return; Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet/igmp.c Mon Aug 19 13:27:32 2013 (r254523) @@ -3450,7 +3450,7 @@ igmp_intr(struct mbuf *m) } igmp_scrub_context(m0); - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); m0->m_pkthdr.rcvif = V_loif; #ifdef MAC mac_netinet_igmp_send(ifp, m0); Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet/ip_fastfwd.c Mon Aug 19 13:27:32 2013 (r254523) @@ -525,6 +525,10 @@ passout: if (ip_len <= mtu || (ifp->if_hwassist & CSUM_FRAGMENT && (ip_off & IP_DF) == 0)) { /* + * Avoid confusing lower layers. + */ + m_clrprotoflags(m); + /* * Send off the packet via outgoing interface */ error = (*ifp->if_output)(ifp, m, @@ -553,6 +557,10 @@ passout: do { m0 = m->m_nextpkt; m->m_nextpkt = NULL; + /* + * Avoid confusing lower layers. + */ + m_clrprotoflags(m); error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, &ro); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet/ip_output.c Mon Aug 19 13:27:32 2013 (r254523) @@ -621,7 +621,7 @@ passout: * Reset layer specific mbuf flags * to avoid confusing lower layers. */ - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); goto done; @@ -654,7 +654,7 @@ passout: * Reset layer specific mbuf flags * to avoid confusing upper layers. */ - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet/sctp_os_bsd.h Mon Aug 19 13:27:32 2013 (r254523) @@ -444,12 +444,14 @@ typedef struct rtentry sctp_rtentry_t; local_stcb->sctp_ep && \ local_stcb->sctp_ep->sctp_socket) \ o_flgs |= local_stcb->sctp_ep->sctp_socket->so_options & SO_DONTROUTE; \ + m_clrprotoflags(o_pak); \ result = ip_output(o_pak, NULL, ro, o_flgs, 0, NULL); \ } #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ { \ struct sctp_tcb *local_stcb = stcb; \ + m_clrprotoflags(o_pak); \ if (local_stcb && local_stcb->sctp_ep) \ result = ip6_output(o_pak, \ ((struct in6pcb *)(local_stcb->sctp_ep))->in6p_outputopts, \ Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet6/ip6_mroute.c Mon Aug 19 13:27:32 2013 (r254523) @@ -1648,6 +1648,7 @@ phyint_send(struct ip6_hdr *ip6, struct * We just call if_output instead of nd6_output here, since * we need no ND for a multicast forwarded packet...right? */ + m_clrprotoflags(m); /* Avoid confusing lower layers. */ error = (*ifp->if_output)(ifp, mb_copy, (struct sockaddr *)&dst6, NULL); #ifdef MRT6DEBUG Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet6/mld6.c Mon Aug 19 13:27:32 2013 (r254523) @@ -3098,7 +3098,7 @@ mld_dispatch_packet(struct mbuf *m) } mld_scrub_context(m0); - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); m0->m_pkthdr.rcvif = V_loif; ip6 = mtod(m0, struct ip6_hdr *); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet6/nd6.c Mon Aug 19 13:27:32 2013 (r254523) @@ -2082,8 +2082,7 @@ nd6_output_lle(struct ifnet *ifp, struct } return (error); } - /* Reset layer specific mbuf flags to avoid confusing lower layers. */ - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); /* Avoid confusing lower layers. */ if ((ifp->if_flags & IFF_LOOPBACK) != 0) { return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, NULL)); Modified: head/sys/netinet6/send.c ============================================================================== --- head/sys/netinet6/send.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netinet6/send.c Mon Aug 19 13:27:32 2013 (r254523) @@ -180,6 +180,8 @@ send_output(struct mbuf *m, struct ifnet dst.sin6_len = sizeof(dst); dst.sin6_addr = ip6->ip6_dst; + m_clrprotoflags(m); /* Avoid confusing lower layers. */ + /* * Output the packet as nd6.c:nd6_output_lle() would do. * The mbuf is always consumed, so we do not have to care Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/netpfil/pf/pf.c Mon Aug 19 13:27:32 2013 (r254523) @@ -5310,7 +5310,7 @@ pf_route(struct mbuf **m, struct pf_rule ip->ip_sum = in_cksum(m0, ip->ip_hl << 2); m0->m_pkthdr.csum_flags &= ~CSUM_IP; } - m0->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m0); /* Avoid confusing lower layers. */ error = (*ifp->if_output)(ifp, m0, sintosa(&dst), NULL); goto done; } @@ -5335,7 +5335,7 @@ pf_route(struct mbuf **m, struct pf_rule m1 = m0->m_nextpkt; m0->m_nextpkt = NULL; if (error == 0) { - m0->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m0); error = (*ifp->if_output)(ifp, m0, sintosa(&dst), NULL); } else m_freem(m0); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 19 13:27:32 2013 (r254523) @@ -1442,7 +1442,7 @@ ipoib_input(struct ifnet *ifp, struct mb * Strip off Infiniband header. */ m->m_flags &= ~M_VLANTAG; - m->m_flags &= ~(M_PROTOFLAGS); + m_clrprotoflags(m); m_adj(m, IPOIB_HEADER_LEN); if (IPOIB_IS_MULTICAST(eh->hwaddr)) { Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 12:37:13 2013 (r254522) +++ head/sys/sys/mbuf.h Mon Aug 19 13:27:32 2013 (r254523) @@ -603,6 +603,13 @@ m_chtype(struct mbuf *m, short new_type) m->m_type = new_type; } +static __inline void +m_clrprotoflags(struct mbuf *m) +{ + + m->m_flags &= ~M_PROTOFLAGS; +} + static __inline struct mbuf * m_last(struct mbuf *m) { From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 13:56:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C7F5298F; Mon, 19 Aug 2013 13:56:14 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B52B42013; Mon, 19 Aug 2013 13:56:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JDuEoV075074; Mon, 19 Aug 2013 13:56:14 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JDuELE075073; Mon, 19 Aug 2013 13:56:14 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191356.r7JDuELE075073@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 13:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254524 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 13:56:14 -0000 Author: andre Date: Mon Aug 19 13:56:14 2013 New Revision: 254524 URL: http://svnweb.freebsd.org/changeset/base/254524 Log: Add four additional M_PROTOFLAGS[9-12] for protocol specific use. Discussed with: trociny, glebius, adrian Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 13:27:32 2013 (r254523) +++ head/sys/sys/mbuf.h Mon Aug 19 13:56:14 2013 (r254524) @@ -196,22 +196,24 @@ struct mbuf { #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ #define M_LASTFRAG 0x00002000 /* packet is last fragment */ - /* 0x00004000 free */ - /* 0x00008000 free */ +#define M_PROTO9 0x00004000 /* protocol-specific */ +#define M_PROTO10 0x00008000 /* protocol-specific */ #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ #define M_PROMISC 0x00020000 /* packet was not for us */ - /* 0x00040000 free */ +#define M_PROTO11 0x00040000 /* protocol-specific */ #define M_PROTO6 0x00080000 /* protocol-specific */ #define M_PROTO7 0x00100000 /* protocol-specific */ #define M_PROTO8 0x00200000 /* protocol-specific */ #define M_FLOWID 0x00400000 /* deprecated: flowid is valid */ +#define M_PROTO12 0x00800000 /* protocol-specific */ #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ /* * Flags to purge when crossing layers. */ #define M_PROTOFLAGS \ - (M_PROTO1|M_PROTO2|M_PROTO3|M_PROTO4|M_PROTO5|M_PROTO6|M_PROTO7|M_PROTO8) + (M_PROTO1|M_PROTO2|M_PROTO3|M_PROTO4|M_PROTO5|M_PROTO6|M_PROTO7|M_PROTO8|\ + M_PROTO9|M_PROTO10|M_PROTO11|M_PROTO12) /* * Network interface cards are able to hash protocol fields (such as IPv4 From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:04:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA3A2C8A; Mon, 19 Aug 2013 14:04:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D7B7F20AD; Mon, 19 Aug 2013 14:04:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JE4ZLh078798; Mon, 19 Aug 2013 14:04:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JE4ZhJ078797; Mon, 19 Aug 2013 14:04:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308191404.r7JE4ZhJ078797@svn.freebsd.org> From: Glen Barber Date: Mon, 19 Aug 2013 14:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254525 - head/usr.sbin/pkg_install/add X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:04:36 -0000 Author: gjb Date: Mon Aug 19 14:04:35 2013 New Revision: 254525 URL: http://svnweb.freebsd.org/changeset/base/254525 Log: Add entry for packages-9.2-release directory. Approved by: re (implicit) Modified: head/usr.sbin/pkg_install/add/main.c Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Mon Aug 19 13:56:14 2013 (r254524) +++ head/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:04:35 2013 (r254525) @@ -90,6 +90,7 @@ struct { { 803000, 803499, "/packages-8.3-release" }, { 900000, 900499, "/packages-9.0-release" }, { 901000, 901499, "/packages-9.1-release" }, + { 902000, 902499, "/packages-9.2-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:07:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D2CA6DF3; Mon, 19 Aug 2013 14:07:32 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5A6720C9; Mon, 19 Aug 2013 14:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JE7WD8079488; Mon, 19 Aug 2013 14:07:32 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JE7WI8079484; Mon, 19 Aug 2013 14:07:32 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191407.r7JE7WI8079484@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 14:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254526 - in head/sys: net80211 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:07:32 -0000 Author: andre Date: Mon Aug 19 14:07:31 2013 New Revision: 254526 URL: http://svnweb.freebsd.org/changeset/base/254526 Log: Migrate the net80211 protocol specific use of M_FRAG, M_FIRSTFRAG and M_LASTFRAG flags to protocol specific flags. Remove the now unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG mbuf flags. Discussed with: trociny, glebius, adrian Modified: head/sys/net80211/ieee80211_freebsd.h head/sys/sys/mbuf.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Mon Aug 19 14:04:35 2013 (r254525) +++ head/sys/net80211/ieee80211_freebsd.h Mon Aug 19 14:07:31 2013 (r254526) @@ -234,9 +234,12 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_FF M_PROTO6 /* fast frame */ #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ +#define M_FRAG M_PROTO9 /* frame fragmentation */ +#define M_FIRSTFRAG M_PROTO10 /* first frame fragment */ +#define M_LASTFRAG M_PROTO11 /* last frame fragment */ #define M_80211_TX \ - (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_EAPOL|M_PWR_SAV|\ - M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) + (M_ENCAP|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB| \ + M_AMPDU_MPDU|M_FRAG|M_FIRSTFRAG|M_LASTFRAG) /* rx path usage */ #define M_AMPDU M_PROTO1 /* A-MPDU subframe */ Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 14:04:35 2013 (r254525) +++ head/sys/sys/mbuf.h Mon Aug 19 14:07:31 2013 (r254526) @@ -193,9 +193,9 @@ struct mbuf { #define M_PROTO5 0x00000100 /* protocol-specific */ #define M_BCAST 0x00000200 /* send/received as link-level broadcast */ #define M_MCAST 0x00000400 /* send/received as link-level multicast */ -#define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ -#define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ -#define M_LASTFRAG 0x00002000 /* packet is last fragment */ + /* 0x00000800 free */ + /* 0x00001000 free */ + /* 0x00002000 free */ #define M_PROTO9 0x00004000 /* protocol-specific */ #define M_PROTO10 0x00008000 /* protocol-specific */ #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ @@ -254,7 +254,7 @@ struct mbuf { */ #define M_COPYFLAGS \ (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\ - M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_HASHTYPEBITS) + M_VLANTAG|M_PROMISC|M_HASHTYPEBITS) /* * External buffer types: identify ext_buf type. From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:25:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0AC98429; Mon, 19 Aug 2013 14:25:13 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCE1B21F2; Mon, 19 Aug 2013 14:25:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JEPC3d086848; Mon, 19 Aug 2013 14:25:12 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JEPCsT086845; Mon, 19 Aug 2013 14:25:12 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191425.r7JEPCsT086845@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 14:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254527 - in head/sys: net80211 netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:25:13 -0000 Author: andre Date: Mon Aug 19 14:25:11 2013 New Revision: 254527 URL: http://svnweb.freebsd.org/changeset/base/254527 Log: Reorder the mbuf defines to make more sense and group related flags together. Add M_FLAG_PRINTF for use with printf(9) %b indentifier. Use the generic mbuf flags print names in the net80211 code and adjust the protocol specific bits for their new positions. Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field they use internally to store some additional information. Discussed with: trociny, glebius Modified: head/sys/net80211/ieee80211_freebsd.h head/sys/netinet/sctp_os_bsd.h head/sys/sys/mbuf.h Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Mon Aug 19 14:07:31 2013 (r254526) +++ head/sys/net80211/ieee80211_freebsd.h Mon Aug 19 14:25:11 2013 (r254527) @@ -250,16 +250,13 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_80211_RX (M_AMPDU|M_WEP|M_AMPDU_MPDU) #define IEEE80211_MBUF_TX_FLAG_BITS \ - "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_ENCAP\6M_WEP\7M_EAPOL" \ - "\10M_PWR_SAV\11M_MORE_DATA\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG" \ - "\16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC" \ - "\23M_NOFREE\24M_FF\25M_TXCB\26M_AMPDU_MPDU\27M_FLOWID" + M_FLAG_BITS \ + "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \ + "\24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG" #define IEEE80211_MBUF_RX_FLAG_BITS \ - "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_AMPDU\6M_WEP\7M_PROTO3" \ - "\10M_PROTO4\11M_PROTO5\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG" \ - "\16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC" \ - "\23M_NOFREE\24M_PROTO6\25M_PROTO7\26M_AMPDU_MPDU\27M_FLOWID" + M_FLAG_BITS \ + "\15M_AMPDU\16M_WEP\24M_AMPDU_MPDU" /* * Store WME access control bits in the vlan tag. Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon Aug 19 14:07:31 2013 (r254526) +++ head/sys/netinet/sctp_os_bsd.h Mon Aug 19 14:25:11 2013 (r254527) @@ -431,7 +431,7 @@ typedef struct rtentry sctp_rtentry_t; /* * SCTP protocol specific mbuf flags. */ -#define M_NOTIFICATION M_PROTO5 /* SCTP notification */ +#define M_NOTIFICATION M_PROTO1 /* SCTP notification */ /* * IP output routines Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Aug 19 14:07:31 2013 (r254526) +++ head/sys/sys/mbuf.h Mon Aug 19 14:25:11 2013 (r254527) @@ -186,26 +186,25 @@ struct mbuf { #define M_PKTHDR 0x00000002 /* start of record */ #define M_EOR 0x00000004 /* end of record */ #define M_RDONLY 0x00000008 /* associated data is marked read-only */ -#define M_PROTO1 0x00000010 /* protocol-specific */ -#define M_PROTO2 0x00000020 /* protocol-specific */ -#define M_PROTO3 0x00000040 /* protocol-specific */ -#define M_PROTO4 0x00000080 /* protocol-specific */ -#define M_PROTO5 0x00000100 /* protocol-specific */ -#define M_BCAST 0x00000200 /* send/received as link-level broadcast */ -#define M_MCAST 0x00000400 /* send/received as link-level multicast */ - /* 0x00000800 free */ - /* 0x00001000 free */ - /* 0x00002000 free */ -#define M_PROTO9 0x00004000 /* protocol-specific */ -#define M_PROTO10 0x00008000 /* protocol-specific */ -#define M_VLANTAG 0x00010000 /* ether_vtag is valid */ -#define M_PROMISC 0x00020000 /* packet was not for us */ -#define M_PROTO11 0x00040000 /* protocol-specific */ -#define M_PROTO6 0x00080000 /* protocol-specific */ -#define M_PROTO7 0x00100000 /* protocol-specific */ -#define M_PROTO8 0x00200000 /* protocol-specific */ -#define M_FLOWID 0x00400000 /* deprecated: flowid is valid */ +#define M_BCAST 0x00000010 /* send/received as link-level broadcast */ +#define M_MCAST 0x00000020 /* send/received as link-level multicast */ +#define M_PROMISC 0x00000040 /* packet was not for us */ +#define M_VLANTAG 0x00000080 /* ether_vtag is valid */ +#define M_FLOWID 0x00000100 /* deprecated: flowid is valid */ + +#define M_PROTO1 0x00001000 /* protocol-specific */ +#define M_PROTO2 0x00002000 /* protocol-specific */ +#define M_PROTO3 0x00004000 /* protocol-specific */ +#define M_PROTO4 0x00008000 /* protocol-specific */ +#define M_PROTO5 0x00010000 /* protocol-specific */ +#define M_PROTO6 0x00020000 /* protocol-specific */ +#define M_PROTO7 0x00040000 /* protocol-specific */ +#define M_PROTO8 0x00080000 /* protocol-specific */ +#define M_PROTO9 0x00100000 /* protocol-specific */ +#define M_PROTO10 0x00200000 /* protocol-specific */ +#define M_PROTO11 0x00400000 /* protocol-specific */ #define M_PROTO12 0x00800000 /* protocol-specific */ + #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ /* @@ -216,6 +215,18 @@ struct mbuf { M_PROTO9|M_PROTO10|M_PROTO11|M_PROTO12) /* + * Mbuf flag description for use with printf(9) %b identifier. + */ +#define M_FLAG_BITS \ + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \ + "\7M_PROMISC\10M_VLANTAG\11M_FLOWID" +#define M_FLAG_PROTOBITS \ + "\15M_PROTO1\16M_PROTO2\17M_PROTO3\20M_PROTO4\21M_PROTO5" \ + "\22M_PROTO6\23M_PROTO7\24M_PROTO8\25M_PROTO9\26M_PROTO10" \ + "\27M_PROTO11\30M_PROTO12" +#define M_FLAG_PRINTF (M_FLAG_BITS M_FLAG_PROTOBITS) + +/* * Network interface cards are able to hash protocol fields (such as IPv4 * addresses and TCP port numbers) classify packets into flows. These flows * can then be used to maintain ordering while delivering packets to the OS @@ -253,8 +264,8 @@ struct mbuf { * Flags preserved when copying m_pkthdr. */ #define M_COPYFLAGS \ - (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\ - M_VLANTAG|M_PROMISC|M_HASHTYPEBITS) + (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_VLANTAG|M_PROMISC| \ + M_PROTOFLAGS|M_HASHTYPEBITS) /* * External buffer types: identify ext_buf type. From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:38:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 268D4A07; Mon, 19 Aug 2013 14:38:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 136DB230C; Mon, 19 Aug 2013 14:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JEcS8B091111; Mon, 19 Aug 2013 14:38:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JEcSXk091110; Mon, 19 Aug 2013 14:38:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308191438.r7JEcSXk091110@svn.freebsd.org> From: Glen Barber Date: Mon, 19 Aug 2013 14:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254528 - stable/9/usr.sbin/pkg_install/add X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:38:29 -0000 Author: gjb Date: Mon Aug 19 14:38:28 2013 New Revision: 254528 URL: http://svnweb.freebsd.org/changeset/base/254528 Log: MFC r254525: Add entry for packages-9.2-release directory. Approved by: re (implicit) Modified: stable/9/usr.sbin/pkg_install/add/main.c Directory Properties: stable/9/usr.sbin/pkg_install/add/ (props changed) Modified: stable/9/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:25:11 2013 (r254527) +++ stable/9/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:38:28 2013 (r254528) @@ -90,6 +90,7 @@ struct { { 803000, 803499, "/packages-8.3-release" }, { 900000, 900499, "/packages-9.0-release" }, { 901000, 901499, "/packages-9.1-release" }, + { 902000, 902499, "/packages-9.2-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:38:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B672AAD9; Mon, 19 Aug 2013 14:38:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3CC0230D; Mon, 19 Aug 2013 14:38:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JEcZiA091163; Mon, 19 Aug 2013 14:38:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JEcZuI091162; Mon, 19 Aug 2013 14:38:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308191438.r7JEcZuI091162@svn.freebsd.org> From: Glen Barber Date: Mon, 19 Aug 2013 14:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254529 - stable/8/usr.sbin/pkg_install/add X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:38:35 -0000 Author: gjb Date: Mon Aug 19 14:38:35 2013 New Revision: 254529 URL: http://svnweb.freebsd.org/changeset/base/254529 Log: MFC r254525: Add entry for packages-9.2-release directory. Approved by: re (implicit) Modified: stable/8/usr.sbin/pkg_install/add/main.c Directory Properties: stable/8/usr.sbin/pkg_install/add/ (props changed) Modified: stable/8/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:38:28 2013 (r254528) +++ stable/8/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:38:35 2013 (r254529) @@ -91,6 +91,7 @@ struct { { 804000, 804499, "/packages-8.4-release" }, { 900000, 900499, "/packages-9.0-release" }, { 901000, 901499, "/packages-9.1-release" }, + { 902000, 902499, "/packages-9.2-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:42:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 69E42C84; Mon, 19 Aug 2013 14:42:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 571D82343; Mon, 19 Aug 2013 14:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JEge33094045; Mon, 19 Aug 2013 14:42:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JEge08094044; Mon, 19 Aug 2013 14:42:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308191442.r7JEge08094044@svn.freebsd.org> From: Glen Barber Date: Mon, 19 Aug 2013 14:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254530 - releng/9.2/usr.sbin/pkg_install/add X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:42:40 -0000 Author: gjb Date: Mon Aug 19 14:42:39 2013 New Revision: 254530 URL: http://svnweb.freebsd.org/changeset/base/254530 Log: MFC r254525: Add entry for packages-9.2-release directory. Approved by: re (implicit) Modified: releng/9.2/usr.sbin/pkg_install/add/main.c Directory Properties: releng/9.2/usr.sbin/pkg_install/add/ (props changed) Modified: releng/9.2/usr.sbin/pkg_install/add/main.c ============================================================================== --- releng/9.2/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:38:35 2013 (r254529) +++ releng/9.2/usr.sbin/pkg_install/add/main.c Mon Aug 19 14:42:39 2013 (r254530) @@ -90,6 +90,7 @@ struct { { 803000, 803499, "/packages-8.3-release" }, { 900000, 900499, "/packages-9.0-release" }, { 901000, 901499, "/packages-9.1-release" }, + { 902000, 902499, "/packages-9.2-release" }, { 300000, 399000, "/packages-3-stable" }, { 400000, 499000, "/packages-4-stable" }, { 502100, 502128, "/packages-5-current" }, From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 14:56:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E609DE; Mon, 19 Aug 2013 14:56:18 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4D223DC; Mon, 19 Aug 2013 14:56:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JEuIa6098510; Mon, 19 Aug 2013 14:56:18 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JEuIwK098509; Mon, 19 Aug 2013 14:56:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201308191456.r7JEuIwK098509@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Aug 2013 14:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254531 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 14:56:18 -0000 Author: raj Date: Mon Aug 19 14:56:17 2013 New Revision: 254531 URL: http://svnweb.freebsd.org/changeset/base/254531 Log: Simplify pv_entry removal or ARMv6/v7: - PGA_WRITEABLE indicates that there *might be* a writable mapping for the particular page, so to avoid frequent sweeping of the pv_entries whenever pmap_nuke_pv(), pmap_modify_pv(), etc. is called, it is sufficient to clear that flag if there are no managed mappings for that page anymore (notice that only pmap_enter is authorized to set this flag). - Avoid redundant checking for PVF_WIRED flag when this flag cannot be set anyway. - Clear PGA_WRITEABLE only once for each vm_page instead of multiple, redundant clearing it in loop when there are no writeable mappings to that page anymore. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:42:39 2013 (r254530) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:56:17 2013 (r254531) @@ -1072,39 +1072,22 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_ * => caller should NOT adjust pmap's wire_count * => we return the removed pve */ - -static void -pmap_nuke_pv(struct vm_page *m, pmap_t pmap, struct pv_entry *pve) -{ - - rw_assert(&pvh_global_lock, RA_WLOCKED); - PMAP_ASSERT_LOCKED(pmap); - - TAILQ_REMOVE(&m->md.pv_list, pve, pv_list); - - if (pve->pv_flags & PVF_WIRED) - --pmap->pm_stats.wired_count; - - if (pve->pv_flags & PVF_WRITE) { - TAILQ_FOREACH(pve, &m->md.pv_list, pv_list) - if (pve->pv_flags & PVF_WRITE) - break; - if (!pve) { - vm_page_aflag_clear(m, PGA_WRITEABLE); - } - } -} - static struct pv_entry * pmap_remove_pv(struct vm_page *m, pmap_t pmap, vm_offset_t va) { struct pv_entry *pve; rw_assert(&pvh_global_lock, RA_WLOCKED); + PMAP_ASSERT_LOCKED(pmap); pve = pmap_find_pv(m, pmap, va); /* find corresponding pve */ - if (pve != NULL) - pmap_nuke_pv(m, pmap, pve); + if (pve != NULL) { + TAILQ_REMOVE(&m->md.pv_list, pve, pv_list); + if (pve->pv_flags & PVF_WIRED) + --pmap->pm_stats.wired_count; + } + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); return(pve); /* return removed pve */ } @@ -1143,14 +1126,6 @@ pmap_modify_pv(struct vm_page *m, pmap_t else --pmap->pm_stats.wired_count; } - if ((oflags & PVF_WRITE) && !(flags & PVF_WRITE)) { - TAILQ_FOREACH(npv, &m->md.pv_list, pv_list) { - if (npv->pv_flags & PVF_WRITE) - break; - } - if (!npv) - vm_page_aflag_clear(m, PGA_WRITEABLE); - } return (oflags); } @@ -2062,7 +2037,9 @@ pmap_remove_pages(pmap_t pmap) pv_entry_count--; pmap->pm_stats.resident_count--; pc->pc_map[field] |= bitmask; - pmap_nuke_pv(m, pmap, pv); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); pmap_free_l2_bucket(pmap, l2b, 1); } } @@ -2458,7 +2435,9 @@ pmap_remove_all(vm_page_t m) PTE_SYNC(ptep); pmap_free_l2_bucket(pmap, l2b, 1); pmap->pm_stats.resident_count--; - pmap_nuke_pv(m, pmap, pv); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (pv->pv_flags & PVF_WIRED) + pmap->pm_stats.wired_count--; pmap_free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -2469,6 +2448,7 @@ pmap_remove_all(vm_page_t m) else cpu_tlb_flushD(); } + vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); } @@ -3338,7 +3318,9 @@ pmap_pv_reclaim(pmap_t locked_pmap) "va %x pte %x", va, *ptep)); *ptep = 0; PTE_SYNC(ptep); - pmap_nuke_pv(m, pmap, pv); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); pc->pc_map[field] |= 1UL << bit; freed++; } From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 15:12:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 71716533; Mon, 19 Aug 2013 15:12:37 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5EB5D24C7; Mon, 19 Aug 2013 15:12:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JFCbqK005938; Mon, 19 Aug 2013 15:12:37 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JFCb32005933; Mon, 19 Aug 2013 15:12:37 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201308191512.r7JFCb32005933@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Aug 2013 15:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254532 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 15:12:37 -0000 Author: raj Date: Mon Aug 19 15:12:36 2013 New Revision: 254532 URL: http://svnweb.freebsd.org/changeset/base/254532 Log: Clear all L2 PTE protection bits before their configuration. Revise L2_S_PROT_MASK to include all of the protection bits. Notice that clearing these bits does not always take away the corresponding permissions (for example, permission is granted when the bit is cleared). The bits are cleared but are to be set or left cleared accordingly in pmap_set_prot(), pmap_enter_locked(), etc. Clear L2_XN along with L2_S_PROT_MASK in pmap_set_prot() so that all permissions related bits are cleared before actual configuration. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:56:17 2013 (r254531) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:12:36 2013 (r254532) @@ -1046,7 +1046,7 @@ static void pmap_set_prot(pt_entry_t *ptep, vm_prot_t prot, uint8_t user) { - *ptep &= ~L2_S_PROT_MASK; + *ptep &= ~(L2_S_PROT_MASK | L2_XN); if (!(prot & VM_PROT_EXECUTE)) *ptep |= L2_XN; Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Aug 19 14:56:17 2013 (r254531) +++ head/sys/arm/include/pmap.h Mon Aug 19 15:12:36 2013 (r254532) @@ -390,7 +390,7 @@ extern int pmap_needs_pte_sync; #define L2_S_PROT_U (L2_AP0(2)) /* user read */ #define L2_S_REF (L2_AP0(1)) /* reference flag */ -#define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R) +#define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R|L2_APX) #define L2_S_EXECUTABLE(pte) (!(pte & L2_XN)) #define L2_S_WRITABLE(pte) (!(pte & L2_APX)) #define L2_S_REFERENCED(pte) (!!(pte & L2_S_REF)) From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 15:12:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA8A064D; Mon, 19 Aug 2013 15:12:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7EEA24CC; Mon, 19 Aug 2013 15:12:44 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id j13so3549891wgh.26 for ; Mon, 19 Aug 2013 08:12:43 -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:message-id:subject :from:to:cc:content-type; bh=R/Dbo5dBY+GsgIMtEqjBOUt7KeLU4+TwhNB5Svvmb88=; b=SJP2fd8DFlD58Xm+DxOtxMYlmJEW/sGoILd99sC8pzJq+HuaECgFnMYBteWI37as9M O9qPB5TaNtHyrN/rNniV3yDeINpaO3QCmKoekc2q3hFpxHdnni6C631d6AsAlg1zDIqC iNy/5L/UdN0uEL+l8tykZiePVUINOTyFuOJ/hz4Zfu0zau69OXU8lQBUsc927QDoHlTO GBNmV/CkW+OpQ+KhG7IZAqAVuUV0O98r4z4AAWutDmMTTOUZTHUYJngfqodmQ1GnBG2F aQs4+4LhVde3FwaE2o/iGFvKttpTMtYa3SvDEW50F7NO48631tXOJ02lau4D8PJ1TNRk jvgg== MIME-Version: 1.0 X-Received: by 10.194.94.37 with SMTP id cz5mr1768346wjb.55.1376925162896; Mon, 19 Aug 2013 08:12:42 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.116.136 with HTTP; Mon, 19 Aug 2013 08:12:42 -0700 (PDT) In-Reply-To: <201308191425.r7JEPCsT086845@svn.freebsd.org> References: <201308191425.r7JEPCsT086845@svn.freebsd.org> Date: Mon, 19 Aug 2013 08:12:42 -0700 X-Google-Sender-Auth: scrp7RcDQRJ-FdxWaQR3-h84ROk Message-ID: Subject: Re: svn commit: r254527 - in head/sys: net80211 netinet sys From: Adrian Chadd To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 15:12:45 -0000 Hi, Would you please bump FreeBSD_version ? I'd like to make the net80211 on -HEAD build on -9, and this is one of those changes that will break that. Thanks! -adrian On 19 August 2013 07:25, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 19 14:25:11 2013 > New Revision: 254527 > URL: http://svnweb.freebsd.org/changeset/base/254527 > > Log: > Reorder the mbuf defines to make more sense and group related flags > together. > > Add M_FLAG_PRINTF for use with printf(9) %b indentifier. > > Use the generic mbuf flags print names in the net80211 code and adjust > the protocol specific bits for their new positions. > > Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field > they use internally to store some additional information. > > Discussed with: trociny, glebius > > Modified: > head/sys/net80211/ieee80211_freebsd.h > head/sys/netinet/sctp_os_bsd.h > head/sys/sys/mbuf.h > > Modified: head/sys/net80211/ieee80211_freebsd.h > > ============================================================================== > --- head/sys/net80211/ieee80211_freebsd.h Mon Aug 19 14:07:31 2013 > (r254526) > +++ head/sys/net80211/ieee80211_freebsd.h Mon Aug 19 14:25:11 2013 > (r254527) > @@ -250,16 +250,13 @@ struct mbuf *ieee80211_getmgtframe(uint8 > #define M_80211_RX (M_AMPDU|M_WEP|M_AMPDU_MPDU) > > #define IEEE80211_MBUF_TX_FLAG_BITS \ > - "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_ENCAP\6M_WEP\7M_EAPOL" \ > - > "\10M_PWR_SAV\11M_MORE_DATA\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG" \ > - > "\16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC" \ > - "\23M_NOFREE\24M_FF\25M_TXCB\26M_AMPDU_MPDU\27M_FLOWID" > + M_FLAG_BITS \ > + "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \ > + "\24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG" > > #define IEEE80211_MBUF_RX_FLAG_BITS \ > - "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_AMPDU\6M_WEP\7M_PROTO3" \ > - > "\10M_PROTO4\11M_PROTO5\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG" \ > - > "\16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC" \ > - "\23M_NOFREE\24M_PROTO6\25M_PROTO7\26M_AMPDU_MPDU\27M_FLOWID" > + M_FLAG_BITS \ > + "\15M_AMPDU\16M_WEP\24M_AMPDU_MPDU" > > /* > * Store WME access control bits in the vlan tag. > > Modified: head/sys/netinet/sctp_os_bsd.h > > ============================================================================== > --- head/sys/netinet/sctp_os_bsd.h Mon Aug 19 14:07:31 2013 > (r254526) > +++ head/sys/netinet/sctp_os_bsd.h Mon Aug 19 14:25:11 2013 > (r254527) > @@ -431,7 +431,7 @@ typedef struct rtentry sctp_rtentry_t; > /* > * SCTP protocol specific mbuf flags. > */ > -#define M_NOTIFICATION M_PROTO5 /* SCTP > notification */ > +#define M_NOTIFICATION M_PROTO1 /* SCTP > notification */ > > /* > * IP output routines > > Modified: head/sys/sys/mbuf.h > > ============================================================================== > --- head/sys/sys/mbuf.h Mon Aug 19 14:07:31 2013 (r254526) > +++ head/sys/sys/mbuf.h Mon Aug 19 14:25:11 2013 (r254527) > @@ -186,26 +186,25 @@ struct mbuf { > #define M_PKTHDR 0x00000002 /* start of record */ > #define M_EOR 0x00000004 /* end of record */ > #define M_RDONLY 0x00000008 /* associated data is marked > read-only */ > -#define M_PROTO1 0x00000010 /* protocol-specific */ > -#define M_PROTO2 0x00000020 /* protocol-specific */ > -#define M_PROTO3 0x00000040 /* protocol-specific */ > -#define M_PROTO4 0x00000080 /* protocol-specific */ > -#define M_PROTO5 0x00000100 /* protocol-specific */ > -#define M_BCAST 0x00000200 /* send/received as link-level > broadcast */ > -#define M_MCAST 0x00000400 /* send/received as link-level > multicast */ > - /* 0x00000800 free */ > - /* 0x00001000 free */ > - /* 0x00002000 free */ > -#define M_PROTO9 0x00004000 /* protocol-specific */ > -#define M_PROTO10 0x00008000 /* protocol-specific */ > -#define M_VLANTAG 0x00010000 /* ether_vtag is valid */ > -#define M_PROMISC 0x00020000 /* packet was not for us */ > -#define M_PROTO11 0x00040000 /* protocol-specific */ > -#define M_PROTO6 0x00080000 /* protocol-specific */ > -#define M_PROTO7 0x00100000 /* protocol-specific */ > -#define M_PROTO8 0x00200000 /* protocol-specific */ > -#define M_FLOWID 0x00400000 /* deprecated: flowid is valid > */ > +#define M_BCAST 0x00000010 /* send/received as link-level > broadcast */ > +#define M_MCAST 0x00000020 /* send/received as link-level > multicast */ > +#define M_PROMISC 0x00000040 /* packet was not for us */ > +#define M_VLANTAG 0x00000080 /* ether_vtag is valid */ > +#define M_FLOWID 0x00000100 /* deprecated: flowid is valid > */ > + > +#define M_PROTO1 0x00001000 /* protocol-specific */ > +#define M_PROTO2 0x00002000 /* protocol-specific */ > +#define M_PROTO3 0x00004000 /* protocol-specific */ > +#define M_PROTO4 0x00008000 /* protocol-specific */ > +#define M_PROTO5 0x00010000 /* protocol-specific */ > +#define M_PROTO6 0x00020000 /* protocol-specific */ > +#define M_PROTO7 0x00040000 /* protocol-specific */ > +#define M_PROTO8 0x00080000 /* protocol-specific */ > +#define M_PROTO9 0x00100000 /* protocol-specific */ > +#define M_PROTO10 0x00200000 /* protocol-specific */ > +#define M_PROTO11 0x00400000 /* protocol-specific */ > #define M_PROTO12 0x00800000 /* protocol-specific */ > + > #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid > hash type */ > > /* > @@ -216,6 +215,18 @@ struct mbuf { > M_PROTO9|M_PROTO10|M_PROTO11|M_PROTO12) > > /* > + * Mbuf flag description for use with printf(9) %b identifier. > + */ > +#define M_FLAG_BITS \ > + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \ > + "\7M_PROMISC\10M_VLANTAG\11M_FLOWID" > +#define M_FLAG_PROTOBITS \ > + "\15M_PROTO1\16M_PROTO2\17M_PROTO3\20M_PROTO4\21M_PROTO5" \ > + "\22M_PROTO6\23M_PROTO7\24M_PROTO8\25M_PROTO9\26M_PROTO10" \ > + "\27M_PROTO11\30M_PROTO12" > +#define M_FLAG_PRINTF (M_FLAG_BITS M_FLAG_PROTOBITS) > + > +/* > * Network interface cards are able to hash protocol fields (such as IPv4 > * addresses and TCP port numbers) classify packets into flows. These > flows > * can then be used to maintain ordering while delivering packets to the > OS > @@ -253,8 +264,8 @@ struct mbuf { > * Flags preserved when copying m_pkthdr. > */ > #define M_COPYFLAGS \ > - (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\ > - M_VLANTAG|M_PROMISC|M_HASHTYPEBITS) > + (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_VLANTAG|M_PROMISC| \ > + M_PROTOFLAGS|M_HASHTYPEBITS) > > /* > * External buffer types: identify ext_buf type. > From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 15:36:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3464354D; Mon, 19 Aug 2013 15:36:24 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21421262E; Mon, 19 Aug 2013 15:36:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JFaNBu014366; Mon, 19 Aug 2013 15:36:23 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JFaNek014365; Mon, 19 Aug 2013 15:36:23 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201308191536.r7JFaNek014365@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Aug 2013 15:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254533 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 15:36:24 -0000 Author: raj Date: Mon Aug 19 15:36:23 2013 New Revision: 254533 URL: http://svnweb.freebsd.org/changeset/base/254533 Log: Fix ARMv6/v7 mapping's wired status. Last input argument in pmap_modify_pv() should be a mask of flags to be set. In pmap_change_wiring() however, the straight wired status was used, which does not represent valid flags (and is of type boolean). This commit fixes the issue so that wired flag is passed to pmap_modify_pv() properly. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:12:36 2013 (r254532) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:36:23 2013 (r254533) @@ -2932,7 +2932,8 @@ pmap_change_wiring(pmap_t pmap, vm_offse pte = *ptep; m = PHYS_TO_VM_PAGE(l2pte_pa(pte)); if (m != NULL) - pmap_modify_pv(m, pmap, va, PVF_WIRED, wired); + pmap_modify_pv(m, pmap, va, PVF_WIRED, + wired == TRUE ? PVF_WIRED : 0); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 15:51:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 607C1E65; Mon, 19 Aug 2013 15:51:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3385D2705; Mon, 19 Aug 2013 15:51:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JFpVIQ021010; Mon, 19 Aug 2013 15:51:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JFpUIY021004; Mon, 19 Aug 2013 15:51:30 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308191551.r7JFpUIY021004@svn.freebsd.org> From: Ian Lepore Date: Mon, 19 Aug 2013 15:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254534 - in head/sys: conf dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 15:51:31 -0000 Author: ian Date: Mon Aug 19 15:51:30 2013 New Revision: 254534 URL: http://svnweb.freebsd.org/changeset/base/254534 Log: Allow UART_POLL_FREQ to be set as a kernel option as well as via tunable (the code was already set up for this, just needs to be in conf/options). Also, if reporting that polling is being used, report the frequency too. Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/uart/uart_core.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Aug 19 15:36:23 2013 (r254533) +++ head/sys/conf/NOTES Mon Aug 19 15:51:30 2013 (r254534) @@ -1801,6 +1801,8 @@ device uart # Options for uart(4) options UART_PPS_ON_CTS # Do time pulse capturing using CTS # instead of DCD. +options UART_POLL_FREQ # Set polling rate, used when hw has + # no interrupt support (50 Hz default). # The following hint should only be used for pure ISA devices. It is not # needed otherwise. Use of hints is strongly discouraged. Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Aug 19 15:36:23 2013 (r254533) +++ head/sys/conf/options Mon Aug 19 15:51:30 2013 (r254534) @@ -641,8 +641,9 @@ BKTR_SIS_VIA_MODE opt_bktr.h BKTR_USE_FREEBSD_SMBUS opt_bktr.h BKTR_NEW_MSP34XX_DRIVER opt_bktr.h -# Options to support PPS +# Options for uart(4) UART_PPS_ON_CTS opt_uart.h +UART_POLL_FREQ opt_uart.h # options for bus/device framework BUS_DEBUG opt_bus.h Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Mon Aug 19 15:36:23 2013 (r254533) +++ head/sys/dev/uart/uart_core.c Mon Aug 19 15:51:30 2013 (r254534) @@ -537,7 +537,7 @@ uart_bus_attach(device_t dev) sep = ", "; } if (sc->sc_polled) { - printf("%spolled mode", sep); + printf("%spolled mode (%dHz)", sep, uart_poll_freq); sep = ", "; } printf("\n"); From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 15:58:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48731263; Mon, 19 Aug 2013 15:58:40 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35A6F2745; Mon, 19 Aug 2013 15:58:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JFweBF022366; Mon, 19 Aug 2013 15:58:40 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JFweiw022365; Mon, 19 Aug 2013 15:58:40 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201308191558.r7JFweiw022365@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Aug 2013 15:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254535 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 15:58:40 -0000 Author: raj Date: Mon Aug 19 15:58:39 2013 New Revision: 254535 URL: http://svnweb.freebsd.org/changeset/base/254535 Log: Simplify and clean up pmap_clearbit() There is no need for calling vm_page_dirty() when clearing "modified" flag as it is already set for that page in pmap_fault_fixup() or pmap_enter() thanks to "modified" bit emulation. Also, there is no need for checking PTE "referenced" or "writeable" flags. If there is a request to clear a particular flag we should just do it. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:51:30 2013 (r254534) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:58:39 2013 (r254535) @@ -900,9 +900,6 @@ pmap_clearbit(struct vm_page *m, u_int m rw_wlock(&pvh_global_lock); - if (maskbits & PVF_WRITE) - maskbits |= PVF_MOD; - if (TAILQ_EMPTY(&m->md.pv_list)) { rw_wunlock(&pvh_global_lock); return (0); @@ -924,14 +921,12 @@ pmap_clearbit(struct vm_page *m, u_int m ptep = &l2b->l2b_kva[l2pte_index(va)]; npte = opte = *ptep; - if ((maskbits & (PVF_WRITE|PVF_MOD)) && L2_S_WRITABLE(opte)) { - vm_page_dirty(m); - + if (maskbits & (PVF_WRITE | PVF_MOD)) { /* make the pte read only */ npte |= L2_APX; } - if ((maskbits & PVF_REF) && L2_S_REFERENCED(opte)) { + if (maskbits & PVF_REF) { /* * Clear referenced flag in PTE so that we * will take a flag fault the next time the mapping From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 16:16:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DC4FA884; Mon, 19 Aug 2013 16:16:49 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9324286A; Mon, 19 Aug 2013 16:16:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JGGnbO030226; Mon, 19 Aug 2013 16:16:49 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JGGnDm030224; Mon, 19 Aug 2013 16:16:49 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201308191616.r7JGGnDm030224@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Aug 2013 16:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254536 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 16:16:49 -0000 Author: raj Date: Mon Aug 19 16:16:49 2013 New Revision: 254536 URL: http://svnweb.freebsd.org/changeset/base/254536 Log: Do not use pv_kva on ARMv6/v7 and save some space on each vm_page. It's only relevant for older ARM variants (with virtual cache). Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:58:39 2013 (r254535) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 16:16:49 2013 (r254536) @@ -4365,6 +4365,6 @@ pmap_page_set_memattr(vm_page_t m, vm_me * uncacheable, being careful to sync caches and PTEs (and maybe * invalidate TLB?) for any current mapping it modifies. */ - if (m->md.pv_kva != 0 || TAILQ_FIRST(&m->md.pv_list) != NULL) + if (TAILQ_FIRST(&m->md.pv_list) != NULL) panic("Can't change memattr on page with existing mappings"); } Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Aug 19 15:58:39 2013 (r254535) +++ head/sys/arm/include/pmap.h Mon Aug 19 16:16:49 2013 (r254536) @@ -121,7 +121,9 @@ struct pv_chunk; struct md_page { int pvh_attrs; vm_memattr_t pv_memattr; +#if (ARM_MMU_V6 + ARM_MMU_V7) == 0 vm_offset_t pv_kva; /* first kernel VA mapping */ +#endif TAILQ_HEAD(,pv_entry) pv_list; }; From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 16:47:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 343FF448; Mon, 19 Aug 2013 16:47:07 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 215E72A19; Mon, 19 Aug 2013 16:47:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JGl6ii041772; Mon, 19 Aug 2013 16:47:06 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JGl6N0041771; Mon, 19 Aug 2013 16:47:06 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308191647.r7JGl6N0041771@svn.freebsd.org> From: Andre Oppermann Date: Mon, 19 Aug 2013 16:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254537 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 16:47:07 -0000 Author: andre Date: Mon Aug 19 16:47:06 2013 New Revision: 254537 URL: http://svnweb.freebsd.org/changeset/base/254537 Log: Bump __FreeBSD_version to 1000046 after the addition of M_PROTO[9-12] and removal of M_NOFREE|M_FRAG|M_FIRSTFRAG|M_LASTFRAG mbuf flags. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Aug 19 16:16:49 2013 (r254536) +++ head/sys/sys/param.h Mon Aug 19 16:47:06 2013 (r254537) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000045 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000046 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 17:09:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE8A0C47; Mon, 19 Aug 2013 17:09:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA8BB2B5C; Mon, 19 Aug 2013 17:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JH9ELd049366; Mon, 19 Aug 2013 17:09:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JH9ELD049365; Mon, 19 Aug 2013 17:09:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201308191709.r7JH9ELD049365@svn.freebsd.org> From: John Baldwin Date: Mon, 19 Aug 2013 17:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254538 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 17:09:14 -0000 Author: jhb Date: Mon Aug 19 17:09:14 2013 New Revision: 254538 URL: http://svnweb.freebsd.org/changeset/base/254538 Log: Remove incorrect 'const' qualifier from pointers to dynamic string buffers I added in the previous commit. Pointy hat to: jhb MFC after: 1 month Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Aug 19 16:47:06 2013 (r254537) +++ head/usr.bin/truss/syscalls.c Mon Aug 19 17:09:14 2013 (r254538) @@ -894,7 +894,7 @@ print_arg(struct syscall_args *sc, unsig tmp = strdup(xlookup_bits(mprot_flags, args[sc->offset])); break; case Mmapflags: { - const char *base, *alignstr; + char *base, *alignstr; int align, flags; /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 17:33:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A407E2C8; Mon, 19 Aug 2013 17:33:06 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3ED2CCA; Mon, 19 Aug 2013 17:33:06 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id lf1so4891675pab.10 for ; Mon, 19 Aug 2013 10:33:06 -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=m4jqV48frauhdoi402GQZ01mWn62cuorOFwNNL8c9zM=; b=tO+cF5lWzKlIWQsqm8r2ROJJCkQ8yaQmJcWDRPF0dHpbxDNz0bccC/noxyUkcxTsCt 09ChQA9WDS3Aszr+Rr3R9tjbnpCB39w9mq90qv+5RX5tF/Mszqq0ckHcOql5T5qHSu1L naV7zg45VJOkhtzNGXRUOQe7pHmujbEvu9glv8nyiwiRiC0pIriKTyxF+8oP4Jgq7/Cq A/BInIaW/CA5pruRAA+fh5hhUynaUF/t4vraz9I4wR6wL0lYHHy6cIufRdjj+GCWbO+H rqHqwYvaSrLMVm0Ig1hjP7gLSbNMHs1kpeGuwkGwYjSvhTSzZIZ6tJ1/Uxe1o+20jf/Y K0sg== X-Received: by 10.66.171.13 with SMTP id aq13mr5684391pac.30.1376933586128; Mon, 19 Aug 2013 10:33:06 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id nj9sm16325367pbc.13.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 10:33:04 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <521256CE.6070706@FreeBSD.org> Date: Mon, 19 Aug 2013 10:33:02 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> In-Reply-To: <201308191116.r7JBGsc6065793@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 17:33:06 -0000 On 08/19/13 04:16, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 19 11:16:53 2013 > New Revision: 254520 > URL: http://svnweb.freebsd.org/changeset/base/254520 > > Log: > Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree users > for a very long time, if ever. > > Should such a functionality ever be needed again the appropriate and > much better way to do it is through a custom EXT_SOMETHING external mbuf > type together with a dedicated *ext_free function. > > Discussed with: trociny, glebius > > Modified: > head/sys/kern/kern_mbuf.c > head/sys/kern/uipc_mbuf.c > head/sys/sys/mbuf.h > Hello Andre, Is this just garbage collection or is there some other reason for this? I recently tried some experiments to reduce the number of mbuf and cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved very useful and the code changes to the kernel were minimal. See user/np/cxl_tuning. The experiment was quite successful and I was planning to bring in most of those changes to HEAD. I was hoping to get some runtime mileage on the approach in general before tweaking the ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt within the cluster. But now M_NOFREE has vanished without a warning... Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 17:34:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 37E6E413 for ; Mon, 19 Aug 2013 17:34:45 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C51352CDA for ; Mon, 19 Aug 2013 17:34:44 +0000 (UTC) Received: (qmail 75817 invoked from network); 19 Aug 2013 18:18:09 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 19 Aug 2013 18:18:09 -0000 Message-ID: <52125731.1030401@freebsd.org> Date: Mon, 19 Aug 2013 19:34:41 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r254527 - in head/sys: net80211 netinet sys References: <201308191425.r7JEPCsT086845@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 17:34:45 -0000 On 19.08.2013 17:12, Adrian Chadd wrote: > Hi, > > Would you please bump FreeBSD_version ? Done: New Revision: 254537 URL: http://svnweb.freebsd.org/changeset/base/254537 Log: Bump __FreeBSD_version to 1000046 after the addition of M_PROTO[9-12] and removal of M_NOFREE|M_FRAG|M_FIRSTFRAG|M_LASTFRAG mbuf flags. -- Andre From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 17:37:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF17D7F7; Mon, 19 Aug 2013 17:37:41 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pb0-x230.google.com (mail-pb0-x230.google.com [IPv6:2607:f8b0:400e:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86BB22D01; Mon, 19 Aug 2013 17:37:41 +0000 (UTC) Received: by mail-pb0-f48.google.com with SMTP id ma3so5206793pbc.21 for ; Mon, 19 Aug 2013 10:37:41 -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=EwU1E7rKPB581mQyuiimB4kvArzxRtNXrK72mgnjJDs=; b=JO11yV0ptfFscJLnPCYNgafjljI5p0Q91v/0vSSoh2xzcg8zOVeGW7FL7aXNzHDO6s +YUqUd3ZZHhsi1gj8ofTGNsELiCji6D5FK+irwb9JLmJlVQumQgYq3hwF7lDUcRkSzM9 SAnePzZwbPRl+azKp1whGpjBgwwJZ2zkv/N5cyJKuvEenvKPYRWNLpTNQEAKCRsyKSp4 NOco4osik6kHWlqvmQh1njVh2Y1XCONrFGkr0jbHzui7MjTOwQTr/sj8UGs32W3skVsL eEue/VQYIWSBFnm9KbsvVhe6PlO9hTlNQQX7+/oggjYMbKpIwsSFCQH4jgDWeUm9n8+v M9Qw== X-Received: by 10.68.13.132 with SMTP id h4mr14420201pbc.99.1376933861235; Mon, 19 Aug 2013 10:37:41 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id om2sm16328739pbc.30.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 10:37:40 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <521257E2.4020502@FreeBSD.org> Date: Mon, 19 Aug 2013 10:37:38 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254524 - head/sys/sys References: <201308191356.r7JDuELE075073@svn.freebsd.org> In-Reply-To: <201308191356.r7JDuELE075073@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 17:37:41 -0000 On 08/19/13 06:56, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 19 13:56:14 2013 > New Revision: 254524 > URL: http://svnweb.freebsd.org/changeset/base/254524 > > Log: > Add four additional M_PROTOFLAGS[9-12] for protocol specific use. > > Discussed with: trociny, glebius, adrian > > Modified: > head/sys/sys/mbuf.h > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Mon Aug 19 13:27:32 2013 (r254523) > +++ head/sys/sys/mbuf.h Mon Aug 19 13:56:14 2013 (r254524) > @@ -196,22 +196,24 @@ struct mbuf { > #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ > #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ > #define M_LASTFRAG 0x00002000 /* packet is last fragment */ > - /* 0x00004000 free */ > - /* 0x00008000 free */ > +#define M_PROTO9 0x00004000 /* protocol-specific */ > +#define M_PROTO10 0x00008000 /* protocol-specific */ > #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ > #define M_PROMISC 0x00020000 /* packet was not for us */ > - /* 0x00040000 free */ > +#define M_PROTO11 0x00040000 /* protocol-specific */ > #define M_PROTO6 0x00080000 /* protocol-specific */ > #define M_PROTO7 0x00100000 /* protocol-specific */ > #define M_PROTO8 0x00200000 /* protocol-specific */ > #define M_FLOWID 0x00400000 /* deprecated: flowid is valid */ > +#define M_PROTO12 0x00800000 /* protocol-specific */ > #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ Why reuse the freed up bits so soon (at least one of which I think was prematurely GC'ed -- see my other email on M_NOFREE). There was room beyond M_HASHTYPEBITS, no? Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 17:40:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 097EEAA9; Mon, 19 Aug 2013 17:40:16 +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 BD0972D45; Mon, 19 Aug 2013 17:40:15 +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 E633012373; Tue, 20 Aug 2013 03:40:13 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-69-181-164-196.hsd1.ca.comcast.net [69.181.164.196]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BOB56127 (AUTH peterg@ptree32.com.au); Tue, 20 Aug 2013 03:40:12 +1000 Message-ID: <5212587A.2080202@freebsd.org> Date: Mon, 19 Aug 2013 10:40:10 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> In-Reply-To: <521256CE.6070706@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, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 17:40:16 -0000 > I recently tried some experiments to reduce the number of mbuf and > cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved > very useful and the code changes to the kernel were minimal. See > user/np/cxl_tuning. The experiment was quite successful and I was > planning to bring in most of those changes to HEAD. I was hoping to get > some runtime mileage on the approach in general before tweaking the > ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt > within the cluster. But now M_NOFREE has vanished without a warning... I also had a virtualization work-in-progress where static mbufs were allocated in the kernel and M_NOFREE set. Might be worth sending a prior heads-up for these type of changes. later, Peter. From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 17:44:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E3776D09; Mon, 19 Aug 2013 17:44:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D06B02DB2; Mon, 19 Aug 2013 17:44:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JHiJ3f063825; Mon, 19 Aug 2013 17:44:19 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JHiJ00063824; Mon, 19 Aug 2013 17:44:19 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308191744.r7JHiJ00063824@svn.freebsd.org> From: Andrew Turner Date: Mon, 19 Aug 2013 17:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254539 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 17:44:20 -0000 Author: andrew Date: Mon Aug 19 17:44:19 2013 New Revision: 254539 URL: http://svnweb.freebsd.org/changeset/base/254539 Log: Subversion requires atomic functions we only support on arm with clang. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Aug 19 17:09:14 2013 (r254538) +++ head/usr.bin/Makefile Mon Aug 19 17:44:19 2013 (r254539) @@ -366,7 +366,9 @@ SUBDIR+= users SUBDIR+= who .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "armv6" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || \ + ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "i386" || \ + (${MACHINE_ARCH} == "armv6" && ${COMPILER_TYPE} == "clang") .if ${MK_SVN} == "yes" || ${MK_SVNLITE} == "yes" SUBDIR+= svn .endif From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 18:45:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C97D2BD2; Mon, 19 Aug 2013 18:45:36 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-bk0-x22b.google.com (mail-bk0-x22b.google.com [IPv6:2a00:1450:4008:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCE27215A; Mon, 19 Aug 2013 18:45:35 +0000 (UTC) Received: by mail-bk0-f43.google.com with SMTP id mz13so1523592bkb.2 for ; Mon, 19 Aug 2013 11:45:34 -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; bh=OrhYuwj13dxVpqVdsjDBpCrTRaXXPkXUJDzfr4QhjGI=; b=g775faM1OUG3x6PW/9/1V16N2qfLF/GXkwlYDmmIMiI6Av3z6GHfxbM5w7Q+QwPUDY OcbM32zNSxlX9fivIJYM/kjceOn+mLTZtGcLPOJsjEkhR+rDSgBtrBcdk/SLCyhQZPN8 vyTggHb3CZSY31EL+ZS0P0x9ed8uYrrOyZjk3na2A7Mi4t+nJduIUz8JxW0okKASincO 27GkaAVFrqJCn0rhj2YfX94nZavw4sJITyeP4pV4qnumvuYJIrm+XMU5V/hFdaB6U2nI av732zUwXxjH+srnk8sOgobJ1kJl+4kmd0CzRjB2cc0pbP3l79CaUiF6ulRpbQsH2vIX Vigg== X-Received: by 10.205.7.6 with SMTP id om6mr9056417bkb.18.1376937934002; Mon, 19 Aug 2013 11:45:34 -0700 (PDT) Received: from [192.168.0.10] (89-67-85-20.dynamic.chello.pl. [89.67.85.20]) by mx.google.com with ESMTPSA id d8sm2137563bkj.6.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 11:45:33 -0700 (PDT) Sender: Mario Oshogbo Message-ID: <521267C2.60001@FreeBSD.org> Date: Mon, 19 Aug 2013 20:45:22 +0200 From: Mario Oshogbo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Hiroki Sato Subject: Re: svn commit: r254440 - head/usr.sbin/rwhod References: <201308170712.r7H7CrYi089636@svn.freebsd.org> In-Reply-To: <201308170712.r7H7CrYi089636@svn.freebsd.org> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="64VWb3C3MNmmuEwkUchIEgpeenqcTK6PI" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 18:45:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --64VWb3C3MNmmuEwkUchIEgpeenqcTK6PI Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you for your commit and sorry for not repair this problem earlier. > @@ -274,6 +274,15 @@ main(int argc, char *argv[]) > exit(1); > if (!quiet_mode) { > pid_child_receiver =3D pdfork(&fdp, 0); > + if (pid_child_receiver =3D=3D -1) { > + if (errno !=3D ENOSYS) { > + syslog(LOG_ERR, "pdfork: %m"); > + exit(1); > + } else { > + pid_child_receiver =3D fork(); > + fdp =3D -1; > + } > + } We can't do it this way. pdfork() is used there to prevent killing only one process. If we use fork() and we kill parent process the second process (child process) will become a zombie process. I suggest to revert this change. The changes that Pawel commit (r254486 (thx jilles!!!) and r254480) should resolve all problems. Cheers, oshogbo --64VWb3C3MNmmuEwkUchIEgpeenqcTK6PI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJSEmfKAAoJECRkYejLhN/j110P+wSFH6758IUP7EpStQ3vNAtR k1+bjZo/nLnhP3uu2UlBrYhurNmIh3ch4lkdnn/ah5PlzUUBugdHKuTJP68cWND4 2Ks1H5gK0zucnJDdnvFeBwOdbGFXEdzv2otO7vm6bULe1AgtaHFNGCkmhlMZLaY+ 4K9CmzePOAmwuN2BKkv810F013lcX7jh8910hZrwSlgFkICDwdzX2BVou4mmAhIb 3oHgvNG9bE87377D2UYjn4teN+/Saa0BLqtrujuVF8rF4XHpT469cLTVCHs/7CPz cD5CtWyEHQvGgBvssEB//dZ7+j7Q11u+UJ118ZoCruH3mpTfbHyE6L75evTQzoX2 /reDeIydpWn6xtZz2bd0XOWjDA8PQej6DdmLt1wwiOfrRpiDabSduXE++flcuPwr 5T6eJGu68IedxE+O4mFU131FT1Gq+olT8X0I+C+K9Hc63gVPXZE0vfaR5epAGWlx lvMLTKZ6bJn7p5uy5yetgulcxxrY73u0ha20OVgIZ9jOiW55e6f9CgfAALG0aqiZ 0G7cSwNwkpzQ63tdO705vHfjjxI72Pgr53UyXaou5M9DTBOhTNHzBA4ffkIZhbVy j/3dAsvRCnbFbb+8+4rnxP+YEiHdzsAFPqnNaLePziE8MZBWYCVPtFyRdOU2LzBt gBk+3kglVFTwBLJFk5U+ =R5sD -----END PGP SIGNATURE----- --64VWb3C3MNmmuEwkUchIEgpeenqcTK6PI-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 19:42:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 30C67C23; Mon, 19 Aug 2013 19:42:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B62F32483; Mon, 19 Aug 2013 19:42:42 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6438FB922; Mon, 19 Aug 2013 15:42:40 -0400 (EDT) From: John Baldwin To: Mark Johnston Subject: Re: svn commit: r254309 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/kern sys/sys Date: Mon, 19 Aug 2013 15:42:30 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308140042.r7E0gMtf054550@svn.freebsd.org> <20130816174131.GB1888@charmander.sandvine.com> In-Reply-To: <20130816174131.GB1888@charmander.sandvine.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308191542.30797.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 19 Aug 2013 15:42:40 -0400 (EDT) Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 19:42:43 -0000 On Friday, August 16, 2013 1:41:31 pm Mark Johnston wrote: > On Fri, Aug 16, 2013 at 07:13:16PM +0200, Davide Italiano wrote: > > [trim old mails] > > > > > diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h > > > index e3e18a6..90585de 100644 > > > --- a/sys/sys/pmckern.h > > > +++ b/sys/sys/pmckern.h > > > @@ -51,13 +51,11 @@ > > > #define PMC_FN_CSW_IN 2 > > > #define PMC_FN_CSW_OUT 3 > > > #define PMC_FN_DO_SAMPLES 4 > > > -#define PMC_FN_KLD_LOAD 5 > > > -#define PMC_FN_KLD_UNLOAD 6 > > > -#define PMC_FN_MMAP 7 > > > -#define PMC_FN_MUNMAP 8 > > > -#define PMC_FN_USER_CALLCHAIN 9 > > > -#define PMC_FN_USER_CALLCHAIN_SOFT 10 > > > -#define PMC_FN_SOFT_SAMPLING 11 > > > +#define PMC_FN_MMAP 5 > > > +#define PMC_FN_MUNMAP 6 > > > +#define PMC_FN_USER_CALLCHAIN 7 > > > +#define PMC_FN_USER_CALLCHAIN_SOFT 8 > > > +#define PMC_FN_SOFT_SAMPLING 9 > > > > > > > I've skimmed over your patch quickly so I could miss something, but I > > worry about this change breaking the KBI. > > Does this make sense for you? > > I think you're right. I considered this last night, but it didn't occur > to me that external modules might try to invoke these hooks. I'm not > sure if such modules exist, but it's better to be safe. I updated the > patch here: > > http://people.freebsd.org/~markj/patches/hwpmc-eh/hwpmc-eh-3.diff This generally looks correct. I would probably not call it KLD_LOCK_ASSERT_READ() as it asserts any lock (not specifically a read lock). Normally I would use macros like this: KLD_WLOCK/WUNLOCK KLD_RLOCK/RUNLOCK KLD_ASSERT_LOCKED/KLD_ASSERT_WLOCKED However, the existing macros all were named to not assume read locking and then some read locking was added on the side. I'm not sure exactly what macro name makes the most sense, and would in fact be tempted to just retire all the KLD_* macros for locking and use sx(9) directly, but that is a fairly minor point. (And if done should be a separate commit). Thanks for doing this! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 19:45:05 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A2DB1F0E; Mon, 19 Aug 2013 19:45:05 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78D01249B; Mon, 19 Aug 2013 19:45:04 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r7JJiidV053184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Aug 2013 04:44:54 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r7JJigML088411; Tue, 20 Aug 2013 04:44:44 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 20 Aug 2013 04:36:42 +0900 (JST) Message-Id: <20130820.043642.437041865864892383.hrs@allbsd.org> To: oshogbo@FreeBSD.org Subject: Re: svn commit: r254440 - head/usr.sbin/rwhod From: Hiroki Sato In-Reply-To: <521267C2.60001@FreeBSD.org> References: <201308170712.r7H7CrYi089636@svn.freebsd.org> <521267C2.60001@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Aug_20_04_36_42_2013_561)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 20 Aug 2013 04:44:54 +0900 (JST) X-Spam-Status: No, score=-90.6 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 19:45:05 -0000 ----Security_Multipart(Tue_Aug_20_04_36_42_2013_561)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mario Oshogbo wrote in <521267C2.60001@FreeBSD.org>: os> Thank you for your commit and sorry for not repair this problem earlier. os> os> > @@ -274,6 +274,15 @@ main(int argc, char *argv[]) os> > exit(1); os> > if (!quiet_mode) { os> > pid_child_receiver = pdfork(&fdp, 0); os> > + if (pid_child_receiver == -1) { os> > + if (errno != ENOSYS) { os> > + syslog(LOG_ERR, "pdfork: %m"); os> > + exit(1); os> > + } else { os> > + pid_child_receiver = fork(); os> > + fdp = -1; os> > + } os> > + } os> os> We can't do it this way. pdfork() is used there to prevent killing only os> one process. If we use fork() and we kill parent process the second os> process (child process) will become a zombie process. I suggest to os> revert this change. The changes that Pawel commit (r254486 (thx os> jilles!!!) and r254480) should resolve all problems. When the parent process is killed, the child process will be an child process of init, not a zombie, and init calls waitpid() when it terminates (by SIGTERM, for example). I agree that this should be improved, but I do not think removing fallback to fork(2) is a good idea if PROCDESC is still a kernel option. Reverting will not solve the problem that it does not work with a kernel without PROCDESC. -- Hiroki ----Security_Multipart(Tue_Aug_20_04_36_42_2013_561)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlISc8oACgkQTyzT2CeTzy1DXwCeKf8XqVVIqZWS8YPQf55/x1gS 2SsAoMddmWcqlffhb1IEHatYtH4WBSbh =V7YU -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Aug_20_04_36_42_2013_561)---- From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 19:52:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0D81D171; Mon, 19 Aug 2013 19:52:58 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-bk0-x22a.google.com (mail-bk0-x22a.google.com [IPv6:2a00:1450:4008:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F9C62508; Mon, 19 Aug 2013 19:52:56 +0000 (UTC) Received: by mail-bk0-f42.google.com with SMTP id my10so1599883bkb.15 for ; Mon, 19 Aug 2013 12:52:55 -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; bh=O61FRprS9EwXLYFEujBfLdWHv1d6nmK0h3jFg15g4mw=; b=SP9a0C7fwWrEpFlQRzIfe/mByfbdnR87It9o8MObKgGhJ5lkWC/j+xHBu/cQUlvOhz ROg9fMgb/HGr/8DZtSw7hogDZxygtm9zOuFHDXhnVI+DAMMopanW2Isq/rMuiTBMzGD/ 2TnKuw7MXxXGShcWJ4gkctCTREFw73QkEI0iNVlOOACJUdHmG3ec/bzMi0y1v3on++Tp seBtvKR3MA3UoVUAp2ALql9JnMqsz+nybsGn4R3Sd0wUF0jthHPKM8eq7vJ5Gs9evdWp oQASRxs69Q7RYImrC/fMp9UjFxvpRH4KI/sYjDVCgUXABaYaGyc8U5gLhbRX9Ltu3dJM Pm+g== X-Received: by 10.205.7.6 with SMTP id om6mr9235309bkb.18.1376941975187; Mon, 19 Aug 2013 12:52:55 -0700 (PDT) Received: from [192.168.0.10] (89-67-85-20.dynamic.chello.pl. [89.67.85.20]) by mx.google.com with ESMTPSA id pn6sm2190121bkb.14.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 12:52:54 -0700 (PDT) Sender: Mario Oshogbo Message-ID: <5212778E.6030305@FreeBSD.org> Date: Mon, 19 Aug 2013 21:52:46 +0200 From: Mario Oshogbo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Hiroki Sato Subject: Re: svn commit: r254440 - head/usr.sbin/rwhod References: <201308170712.r7H7CrYi089636@svn.freebsd.org> <521267C2.60001@FreeBSD.org> <20130820.043642.437041865864892383.hrs@allbsd.org> In-Reply-To: <20130820.043642.437041865864892383.hrs@allbsd.org> X-Enigmail-Version: 1.5.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wlw3elAvpMBp8gVornO6mgUH2iDnqsKTj" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 19:52:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Wlw3elAvpMBp8gVornO6mgUH2iDnqsKTj Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > When the parent process is killed, the child process will be an child > process of init, not a zombie, and init calls waitpid() when it > terminates (by SIGTERM, for example). I agree that this should be > improved, but I do not think removing fallback to fork(2) is a good > idea if PROCDESC is still a kernel option. Reverting will not solve > the problem that it does not work with a kernel without PROCDESC. >=20 > -- Hiroki >=20 Yes, but Pawel add PROCDESC to GENERIC in commit r254480. --Wlw3elAvpMBp8gVornO6mgUH2iDnqsKTj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJSEneUAAoJECRkYejLhN/jQz8P+wT7cEbrxvBbQokdL8Hnwpzj 81iS2qq7RqudCV7MgZxQM+YpmRta0TjnRzMmBE1lM6WKvtE6WX9IMiiVojQuqQBd cGzBVTY+ubtittiWsTf93SQ7Ha1H9pKYbDRsmtSRhk4KqaeXOa6dMy7XOuGma5zO 0n46o4IhJImoBwiXy5NqxKMs1qL8pWXv9azbAvcnJUZL34PHOCNDxJ58S3LIfoWH A1A97REwiMEy8tMWYbfy+cOMg1K1JL0sguIzRqBj1ueKXCIzYB2IH7cqnXbsJIc9 BqA1/Df0iJrjH/vbOpv52WKBzwFOLmg2PVG1JZlndqz24n4PucqKYoXxQRpO+kay 35tAzlxsJDrxOHrtTERMH6DA9bWeywZqv/aAMVrMdmnE/Jg80325SXaggyBKBX9c fI/48yYxL4gfbyX+HVuYC39HW5Au4AAznVK60gJIwihE67r7iBk5+vdDJ1iKUfWw 9H6C9Rl298C3QxthVYGE3YTCagpO/4lVLQfbg/2j+bFPh8GQctcl3yfKGOlLNRhd EkOR93NCPISho5Vmy7RIRobYU46l4GQhgQhcBFKoFvP7ozCo+5YcRtBLsKPb1xYc 2WXvqbd91vgmG9s3SIiwQtGJEXR+W8WKsIiTKDgQIf3Qya5HUeoRyAfqEeawqncn lmbq6TaYl9QxvegtmTxu =FLbL -----END PGP SIGNATURE----- --Wlw3elAvpMBp8gVornO6mgUH2iDnqsKTj-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 20:14:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 471B87B0; Mon, 19 Aug 2013 20:14:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4278266A; Mon, 19 Aug 2013 20:14:02 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id bv4so2079271qab.1 for ; Mon, 19 Aug 2013 13:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ny/fjoQV2xtJGYZ59XB6ZrRjPd7Tk74j2v3sf8Cd47E=; b=OZMVF+cgz/Nqk/T8n4Y7hKSoP1pmIrZijyQr4Miai2HOl6rXPHcCeU19g5H740bVov LjQ+BngkxcY5ZZ8wOd8/J42ovo1DCQLfRgIt4gPhUZiouThXkF3+NPHo2uLQ7ziqYdDQ 0x8Xl1Vb8bNyyckAB9L0eHjV5UY9wDaDMqq3ng2SvdKlv5JGYyIWy25evu9KcbUY8ZPo IEbb+/8pJMLrBITZRhBdcF5w/GcrLqrGcDgxcPcM7fUj34eKXm9Akeo9W7R4S/CfqZgH gQQ6hz6hon4BWekKATMeW8YBO0Cmv/DjxB7huZAtrN8x6UJTYsDAx1vWd0bDD5dLQ080 Pl7g== X-Received: by 10.49.73.227 with SMTP id o3mr17741891qev.23.1376943241904; Mon, 19 Aug 2013 13:14:01 -0700 (PDT) Received: from charmander.sandvine.com ([64.7.137.182]) by mx.google.com with ESMTPSA id m5sm19002473qaa.13.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 13:14:01 -0700 (PDT) Sender: Mark Johnston Date: Mon, 19 Aug 2013 16:14:45 -0400 From: Mark Johnston To: John Baldwin Subject: Re: svn commit: r254309 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/kern sys/sys Message-ID: <20130819201445.GB4765@charmander.sandvine.com> References: <201308140042.r7E0gMtf054550@svn.freebsd.org> <20130816174131.GB1888@charmander.sandvine.com> <201308191542.30797.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201308191542.30797.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 20:14:03 -0000 On Mon, Aug 19, 2013 at 03:42:30PM -0400, John Baldwin wrote: > On Friday, August 16, 2013 1:41:31 pm Mark Johnston wrote: > > On Fri, Aug 16, 2013 at 07:13:16PM +0200, Davide Italiano wrote: > > > [trim old mails] > > > > > > > diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h > > > > index e3e18a6..90585de 100644 > > > > --- a/sys/sys/pmckern.h > > > > +++ b/sys/sys/pmckern.h > > > > @@ -51,13 +51,11 @@ > > > > #define PMC_FN_CSW_IN 2 > > > > #define PMC_FN_CSW_OUT 3 > > > > #define PMC_FN_DO_SAMPLES 4 > > > > -#define PMC_FN_KLD_LOAD 5 > > > > -#define PMC_FN_KLD_UNLOAD 6 > > > > -#define PMC_FN_MMAP 7 > > > > -#define PMC_FN_MUNMAP 8 > > > > -#define PMC_FN_USER_CALLCHAIN 9 > > > > -#define PMC_FN_USER_CALLCHAIN_SOFT 10 > > > > -#define PMC_FN_SOFT_SAMPLING 11 > > > > +#define PMC_FN_MMAP 5 > > > > +#define PMC_FN_MUNMAP 6 > > > > +#define PMC_FN_USER_CALLCHAIN 7 > > > > +#define PMC_FN_USER_CALLCHAIN_SOFT 8 > > > > +#define PMC_FN_SOFT_SAMPLING 9 > > > > > > > > > > I've skimmed over your patch quickly so I could miss something, but I > > > worry about this change breaking the KBI. > > > Does this make sense for you? > > > > I think you're right. I considered this last night, but it didn't occur > > to me that external modules might try to invoke these hooks. I'm not > > sure if such modules exist, but it's better to be safe. I updated the > > patch here: > > > > http://people.freebsd.org/~markj/patches/hwpmc-eh/hwpmc-eh-3.diff > > This generally looks correct. I would probably not call it > KLD_LOCK_ASSERT_READ() as it asserts any lock (not specifically a > read lock). Normally I would use macros like this: > > KLD_WLOCK/WUNLOCK > KLD_RLOCK/RUNLOCK > KLD_ASSERT_LOCKED/KLD_ASSERT_WLOCKED > > However, the existing macros all were named to not assume read > locking and then some read locking was added on the side. I'm > not sure exactly what macro name makes the most sense, and would > in fact be tempted to just retire all the KLD_* macros for locking > and use sx(9) directly, but that is a fairly minor point. (And if > done should be a separate commit). Yeah, KLD_LOCK_ASSERT_READ() is awkward, but I couldn't come up with anything better without renaming the existing macros. I'm fine with getting rid of them and using the sx_* calls directly; it'll be the same amount of churn as changing the macro names anyway. So how about this: I'll get rid of the macros in one commit, change the locking rules for linker_file_lookup_set() using my existing patch but without the KLD lock macros, and then convert the hwpmc(4) hooks to use the new event handlers (making sure to avoid breaking the KBI as Davide pointed out). -Mark From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 20:58:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E1C5213B for ; Mon, 19 Aug 2013 20:58:55 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 480B82856 for ; Mon, 19 Aug 2013 20:58:54 +0000 (UTC) Received: (qmail 76532 invoked from network); 19 Aug 2013 21:42:18 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 19 Aug 2013 21:42:18 -0000 Message-ID: <5212870A.50105@freebsd.org> Date: Mon, 19 Aug 2013 22:58:50 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> In-Reply-To: <521256CE.6070706@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 20:58:55 -0000 On 19.08.2013 19:33, Navdeep Parhar wrote: > On 08/19/13 04:16, Andre Oppermann wrote: >> Author: andre >> Date: Mon Aug 19 11:16:53 2013 >> New Revision: 254520 >> URL: http://svnweb.freebsd.org/changeset/base/254520 >> >> Log: >> Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree users >> for a very long time, if ever. >> >> Should such a functionality ever be needed again the appropriate and >> much better way to do it is through a custom EXT_SOMETHING external mbuf >> type together with a dedicated *ext_free function. >> >> Discussed with: trociny, glebius >> >> Modified: >> head/sys/kern/kern_mbuf.c >> head/sys/kern/uipc_mbuf.c >> head/sys/sys/mbuf.h >> > > Hello Andre, > > Is this just garbage collection or is there some other reason for this? This is garbage collection and removal of not quite right, rotten, functionality. > I recently tried some experiments to reduce the number of mbuf and > cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved > very useful and the code changes to the kernel were minimal. See > user/np/cxl_tuning. The experiment was quite successful and I was > planning to bring in most of those changes to HEAD. I was hoping to get > some runtime mileage on the approach in general before tweaking the > ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt > within the cluster. But now M_NOFREE has vanished without a warning... I'm looking through your experimental code and that is some really good numbers you're achieving there! However a couple things don't feel quite right, hackish even, and not fit for HEAD. This is a bit the same situation we had with some of the first 1GigE cards quite a number of years back (mostly ti(4)). There we ended up with a couple of just good enough hacks to make it fast. Most of the remains I've collected today. I believe most of the improvements you've shown can be implemented in a more generic and safe way into the mbuf system. Also a number of things in your experimental code may have side-effects in situations other than netperf runs. To summarize what I get from your experimental branch commits: - the Chelsio T4/T5 card can DMA multiple ethernet frames (packets) into a single memory buffer, provided it is large enough. - you make use of that feature and point multiple m_ext mbufs into that buffer to separate the packets and send them up the stack. - you embed the m_ext refcount into the single memory buffer as well. - you recycle mbufs? (I'm not entirely clear on that as I'm not familiar with the cxgbe code) Lets examine and discuss these parts: - M_NOFREE wasn't really safe with bpf anyway at least for packets going down the stack. - Instead of M_NOFREE a custom *ext_free should be used that has the same and even more functionality. - Recycling mbufs may cause imbalances to the mbuf pool with multiple cores and possibly NUMA in the future. Not that we are very good with it at the moment but bypassing the mbuf allocator shouldn't become the norm. If it is a problem/bottleneck again it should be fixed, not worked around and copy-pasted n-times in so many drivers. - jumbo9 and jumbo16 mbufs should not be used because they are more special than necessary with being KVM and physically contiguous. This probably isn't necessary for the T4/T5 cards and any other modern DMA engine. Under heavy diverse network the kernel memory becomes fragmented and can't find memory fulfilling both criteria anymore. In fact both are an artifact of the early GigE hacks when high speed DMA engines were in their infancy. Both jumbo9 and jumbo16 should go away without direct replacement. In your T4/T5 case the alternative would be either to a) allocate your own memory directly from KVM with the necessary properties (KVM and/or phys contig); b) have such a generic kernel mbuf type fulfilling the same role. There may be some cache line issues on non-x86 systems that have to be though and taken care of. - Refcounts should have the option of being separately allocated. It was mandatory to use the refcount zone so far because there wasn't any other type of refcount. Now that we have one we should revisit the issue. Actually the entire mbuf allocation and initialization could be streamlined as a whole. On a side note a different mbuf handling for the RX DMA rings may give some significant improvements as well: allocate just a cluster without a mbuf through m_cljget() and put it into the RX ring. Only when the DMA has put a packet into it allocated attach the mbuf (in the drivers RX function). This avoids the cache pollution from touching the mbuf fields during initial allocation, including the refcount. Another nice trick would be to shorten the mbuf by 4 bytes (in ext_size) and put the refcount there. Lets work on these together. -- Andre From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 21:08:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E75D3A1 for ; Mon, 19 Aug 2013 21:08:11 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E585828D3 for ; Mon, 19 Aug 2013 21:08:10 +0000 (UTC) Received: (qmail 76569 invoked from network); 19 Aug 2013 21:51:34 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 19 Aug 2013 21:51:34 -0000 Message-ID: <52128937.1010407@freebsd.org> Date: Mon, 19 Aug 2013 23:08:07 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Peter Grehan Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212587A.2080202@freebsd.org> In-Reply-To: <5212587A.2080202@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, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 21:08:11 -0000 On 19.08.2013 19:40, Peter Grehan wrote: >> I recently tried some experiments to reduce the number of mbuf and >> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >> very useful and the code changes to the kernel were minimal. See >> user/np/cxl_tuning. The experiment was quite successful and I was >> planning to bring in most of those changes to HEAD. I was hoping to get >> some runtime mileage on the approach in general before tweaking the >> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >> within the cluster. But now M_NOFREE has vanished without a warning... > > I also had a virtualization work-in-progress where static mbufs were allocated in the kernel and > M_NOFREE set. > > Might be worth sending a prior heads-up for these type of changes. I'm sorry for ambushing but this stuff has to be done. I have provided an alternative way of handling it and I'm happy to help you with your use case to make it good for you and to prevent the mbuf system from getting bloated and hackish again. Mbuf is a core system for the kernel and we should avoid to kitchen-sink it again while at the same time to keep speedy enough to keep up with the speed requirements. I believe it would be bad to have Navdeep, you and others invent their own network buffer management routines over again in slightly different ways tailored to each immediate use case. Can you please describe your intended use of M_NOFREE to better understand the shortcomings of the current mbuf systems and the additional advantages of the M_NOFREE case? -- Andre From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 21:41:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3F372CA3; Mon, 19 Aug 2013 21:41:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 028C02A9F; Mon, 19 Aug 2013 21:41:50 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id hq12so3500626wib.4 for ; Mon, 19 Aug 2013 14:41:49 -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:message-id:subject :from:to:cc:content-type; bh=xbb2/2QlO6p/gnegfxkEZxaZRMgdensFPCAixbk+lWs=; b=DdP4yMYKFne9mh2U1/Fmv8mDPoBvqdfEvpd4vzDLN6Z+nOgvphv938iFXZWPqFZo9o Qb5f8hbvyNGzgKrWNjpVCgWs+TcDSCdeR4p8M6kOprYsx0m3PnfGzf5ZuEq45gL3LhCk PHBqWXaAafexYujVFuOiy6lOy0Pg++FgLSoWHPkKfNsuZ0qAyNgOI35CzEbikq55bukM 0B3/enbQ3uUDYX8D8ipMCB+k0brWkTobldbFXIMWbe+r7IFJXo1hYpntBDq21m/FKC/2 iv/2wTwoyVXFvsCnE6oZfmWBCsVIBp+IWF4JC2tJU/YsEp1uuLuTgwymfbstO0gkDJJw ra7A== MIME-Version: 1.0 X-Received: by 10.180.211.206 with SMTP id ne14mr9964441wic.30.1376948509314; Mon, 19 Aug 2013 14:41:49 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.116.136 with HTTP; Mon, 19 Aug 2013 14:41:49 -0700 (PDT) In-Reply-To: <52128937.1010407@freebsd.org> References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212587A.2080202@freebsd.org> <52128937.1010407@freebsd.org> Date: Mon, 19 Aug 2013 14:41:49 -0700 X-Google-Sender-Auth: qCfNg0q-81bHua1GbU9INcUbbKY Message-ID: Subject: Re: svn commit: r254520 - in head/sys: kern sys From: Adrian Chadd To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Navdeep Parhar , Peter Grehan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 21:41:52 -0000 fwiw - +1 on everything you've said to date about this. -adrian From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 21:45:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB304EDA; Mon, 19 Aug 2013 21:45:24 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 825012AD9; Mon, 19 Aug 2013 21:45:24 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id fb10so533253pad.37 for ; Mon, 19 Aug 2013 14:45:24 -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=iCQlYnHaeuHWrLnqjEuOagNdbVT9w4H5X9BNTSOgj9A=; b=0Z8UMaU62G6+58Pi2Okm4x2LwvdZAd031xGkEg4vAejV1WE2Mj6GL3zebUnNFLwq2x LNBTp3cutdns0bjhNtm5Mi+NL03utFbhFnAVPAZThmRsZxhqZ6qNPAD1+2SSmZDNu2qb U2hIoMI+QYHY2qDcHkFsiyDdUq+l3A8NCiUD6ujSEI/OQCtw8OiPMfaaPb9Na6LcLUG5 w8zO/1Lug52UDW/okHdx5qwal06A/zn3HqkgxwoKlBbMlfJMWARW+EoUdGxA4bSixWRf JJif0JRwaSpiiMXknN72yKxvNpXRPL3pYX4KBkTDXJR46qyWbNer6at0Ij7Z4LZkVPNL /+3Q== X-Received: by 10.68.134.65 with SMTP id pi1mr15466643pbb.59.1376948723964; Mon, 19 Aug 2013 14:45:23 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id ts6sm17149865pbc.12.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 14:45:22 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <521291F1.8060500@FreeBSD.org> Date: Mon, 19 Aug 2013 14:45:21 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> In-Reply-To: <5212870A.50105@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 21:45:24 -0000 On 08/19/13 13:58, Andre Oppermann wrote: > On 19.08.2013 19:33, Navdeep Parhar wrote: >> On 08/19/13 04:16, Andre Oppermann wrote: >>> Author: andre >>> Date: Mon Aug 19 11:16:53 2013 >>> New Revision: 254520 >>> URL: http://svnweb.freebsd.org/changeset/base/254520 >>> >>> Log: >>> Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree >>> users >>> for a very long time, if ever. >>> >>> Should such a functionality ever be needed again the appropriate and >>> much better way to do it is through a custom EXT_SOMETHING >>> external mbuf >>> type together with a dedicated *ext_free function. >>> >>> Discussed with: trociny, glebius >>> >>> Modified: >>> head/sys/kern/kern_mbuf.c >>> head/sys/kern/uipc_mbuf.c >>> head/sys/sys/mbuf.h >>> >> >> Hello Andre, >> >> Is this just garbage collection or is there some other reason for this? > > This is garbage collection and removal of not quite right, rotten, > functionality. > >> I recently tried some experiments to reduce the number of mbuf and >> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >> very useful and the code changes to the kernel were minimal. See >> user/np/cxl_tuning. The experiment was quite successful and I was >> planning to bring in most of those changes to HEAD. I was hoping to get >> some runtime mileage on the approach in general before tweaking the >> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >> within the cluster. But now M_NOFREE has vanished without a warning... > > I'm looking through your experimental code and that is some really good > numbers you're achieving there! > > However a couple things don't feel quite right, hackish even, and not > fit for HEAD. This is a bit the same situation we had with some of the > first 1GigE cards quite a number of years back (mostly ti(4)). There > we ended up with a couple of just good enough hacks to make it fast. > Most of the remains I've collected today. If M_NOFREE and EXT_EXTREF are properly supported in the tree (and I'm arguing that they were, before r254520) then the changes are perfectly legitimate. The only hackish part was that I was getting the cluster from the jumbop zone while bypassing its normal refcnt mechanism. This I did so as to use the same zone as m_uiotombuf to keep it "hot" for all consumers (driver + network stack). > I believe most of the improvements you've shown can be implemented in > a more generic and safe way into the mbuf system. Also a number of things > in your experimental code may have side-effects in situations other than > netperf runs. Agreed. As I mentioned my long term plan was to tweak the jumboX zones to allow them to allocate cluster with embedded mbuf + refcount. The M_NOFREE+EXT_EXTREF approach is the perfect bridge from here to there. It is non-intrusive and lends itself well to experimentation. > > To summarize what I get from your experimental branch commits: > - the Chelsio T4/T5 card can DMA multiple ethernet frames (packets) into > a single memory buffer, provided it is large enough. > - you make use of that feature and point multiple m_ext mbufs into that > buffer to separate the packets and send them up the stack. > - you embed the m_ext refcount into the single memory buffer as well. yes, yes, and yes. > - you recycle mbufs? (I'm not entirely clear on that as I'm not familiar > with the cxgbe code) I recycle the cluster (and the embedded mbuf in it) when possible. All depends on whether it's still in use by the time the rx queue needs it back. > > Lets examine and discuss these parts: > - M_NOFREE wasn't really safe with bpf anyway at least for packets going > down the stack. I see. Can you point out the parts of bpf unable to deal with M_NOFREE? > - Instead of M_NOFREE a custom *ext_free should be used that has the same > and even more functionality. Yes, that's what I was planning too, with the jumboX zone changes. It would be faster than running the m_ext's free function (which is a function dereference+call). > - Recycling mbufs may cause imbalances to the mbuf pool with multiple cores > and possibly NUMA in the future. Not that we are very good with it at > the moment but bypassing the mbuf allocator shouldn't become the norm. > If it is a problem/bottleneck again it should be fixed, not worked around > and copy-pasted n-times in so many drivers. If/when a cluster is recycled, it is given back to the same rx ithread that originally allocated it, and not not any other queue. If the ithread stays in the same NUMA domain (and it really should) then recycling the cluster in the same queue really shouldn't cause imbalances. > - jumbo9 and jumbo16 mbufs should not be used because they are more special > than necessary with being KVM and physically contiguous. This probably > isn't necessary for the T4/T5 cards and any other modern DMA engine. > Under heavy diverse network the kernel memory becomes fragmented and > can't > find memory fulfilling both criteria anymore. In fact both are an > artifact > of the early GigE hacks when high speed DMA engines were in their > infancy. > Both jumbo9 and jumbo16 should go away without direct replacement. The devices I deal will be able to cope, but I suspect this will be disruptive (for not enough reason to justify the disruption, imho) to others. That's a separate discussion anyway. > In your T4/T5 case the alternative would be either to a) allocate your > own memory directly from KVM with the necessary properties (KVM and/or > phys > contig); b) have such a generic kernel mbuf type fulfilling the same > role. > There may be some cache line issues on non-x86 systems that have to be > though and taken care of. > - Refcounts should have the option of being separately allocated. It was > mandatory to use the refcount zone so far because there wasn't any other > type of refcount. Now that we have one we should revisit the issue. > Actually the entire mbuf allocation and initialization could be > streamlined > as a whole. > > On a side note a different mbuf handling for the RX DMA rings may give some > significant improvements as well: allocate just a cluster without a mbuf > through > m_cljget() and put it into the RX ring. Only when the DMA has put a > packet into > it allocated attach the mbuf (in the drivers RX function). This avoids > the cache > pollution from touching the mbuf fields during initial allocation, > including the > refcount. Er, this is pretty much how cxgbe(4) has always done it. A cluster is allocated with m_cljget, an mbuf is allocated with MT_NOINIT to avoid touching any line in the mbuf. m_init is called later in the rx ithread. > > Another nice trick would be to shorten the mbuf by 4 bytes (in ext_size) > and put > the refcount there. > > Lets work on these together. Yes. I think we agree on the long term optimization, or are at least headed in the same general direction. But removing M_NOFREE removed a dirt-cheap way to test and exercise the approach without implementing the "real thing." Why not just let it be? Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 22:03:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6A3056D; Mon, 19 Aug 2013 22:03:36 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68C9F2BCC; Mon, 19 Aug 2013 22:03:36 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id y10so5791485pdj.36 for ; Mon, 19 Aug 2013 15:03:36 -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=gZ+LY82r/XKH1Vg5YMnKQd56dRuNzynCfNvW3/ZNdhw=; b=gzLXrppjUI3XLAKfPs2QIonW4sXEpAXs3XiA+lNDFbOcT0xXKt3ZPZf/q0Ol7hLXqf bEuliNEr1h5RvvcYeXrbpKwelacEkivwLk6Knk3tqgyfgP3lSA5xAfcCOY5Ze1cA4sWn vO1kz8uo/tbsfy5e45/BsIocCcxaP5NKQSLtcpeXBo6i/9xA5Iqcs6V4q2z6y4F7vXVm IYROG4NQf7NmGKAqjteE3WyzYv719W+ZBT7trb6bqAqR2QymhtRsa8rYPsxojyidfh22 FrzUPWWlRIHOHbT2SK2bSu6ce7eN7FelTfaDfA3AvJ1JuKb82c4dLvDk/tS9Uj79Dr2P O//w== X-Received: by 10.68.228.201 with SMTP id sk9mr15493204pbc.4.1376949816097; Mon, 19 Aug 2013 15:03:36 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id mr3sm17191807pbb.27.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Aug 2013 15:03:34 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <52129634.7000509@FreeBSD.org> Date: Mon, 19 Aug 2013 15:03:32 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212587A.2080202@freebsd.org> <52128937.1010407@freebsd.org> In-Reply-To: <52128937.1010407@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Grehan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 22:03:36 -0000 On 08/19/13 14:08, Andre Oppermann wrote: > On 19.08.2013 19:40, Peter Grehan wrote: >>> I recently tried some experiments to reduce the number of mbuf and >>> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >>> very useful and the code changes to the kernel were minimal. See >>> user/np/cxl_tuning. The experiment was quite successful and I was >>> planning to bring in most of those changes to HEAD. I was hoping to get >>> some runtime mileage on the approach in general before tweaking the >>> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >>> within the cluster. But now M_NOFREE has vanished without a warning... >> >> I also had a virtualization work-in-progress where static mbufs were >> allocated in the kernel and >> M_NOFREE set. >> >> Might be worth sending a prior heads-up for these type of changes. > > I'm sorry for ambushing but this stuff has to be done. I have provided > an alternative way of handling it and I'm happy to help you with your > use case to make it good for you and to prevent the mbuf system from > getting bloated and hackish again. I don't know what Peter's use case is but I'm curious about the already-available alternative to M_NOFREE, if that's what you meant. Can you please elaborate? Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 22:25:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 33A2EA50; Mon, 19 Aug 2013 22:25:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2131B2CD4; Mon, 19 Aug 2013 22:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JMPanF073988; Mon, 19 Aug 2013 22:25:37 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JMPaR9073987; Mon, 19 Aug 2013 22:25:36 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308192225.r7JMPaR9073987@svn.freebsd.org> From: Andrew Turner Date: Mon, 19 Aug 2013 22:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254542 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 22:25:37 -0000 Author: andrew Date: Mon Aug 19 22:25:36 2013 New Revision: 254542 URL: http://svnweb.freebsd.org/changeset/base/254542 Log: Enable VFP on the Zedboard. Modified: head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Mon Aug 19 20:46:14 2013 (r254541) +++ head/sys/arm/conf/ZEDBOARD Mon Aug 19 22:25:36 2013 (r254542) @@ -52,6 +52,7 @@ options SYSVMSG #SYSV-style message q options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options FREEBSD_BOOT_LOADER +options VFP # vfp/neon # Debugging makeoptions DEBUG=-g From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 23:02:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C5A77151; Mon, 19 Aug 2013 23:02:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97D522EB7; Mon, 19 Aug 2013 23:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JN2eMv088399; Mon, 19 Aug 2013 23:02:40 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JN2eLq088397; Mon, 19 Aug 2013 23:02:40 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201308192302.r7JN2eLq088397@svn.freebsd.org> From: Jeff Roberson Date: Mon, 19 Aug 2013 23:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254543 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 23:02:40 -0000 Author: jeff Date: Mon Aug 19 23:02:39 2013 New Revision: 254543 URL: http://svnweb.freebsd.org/changeset/base/254543 Log: - Use an arbitrary but reasonably large import size for kva on architectures that don't support superpages. This keeps the number of spans and internal fragmentation lower. - When the user asks for alignment from vmem_xalloc adjust the imported size by 2*align to be certain we can satisfy the allocation. This comes at the expense of potential failures when the backend can't supply enough memory but could supply the requested size and alignment. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/subr_vmem.c head/sys/vm/vm_init.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Mon Aug 19 22:25:36 2013 (r254542) +++ head/sys/kern/subr_vmem.c Mon Aug 19 23:02:39 2013 (r254543) @@ -758,6 +758,7 @@ vmem_add1(vmem_t *vm, vmem_addr_t addr, bt_t *btfree; MPASS(type == BT_TYPE_SPAN || type == BT_TYPE_SPAN_STATIC); + MPASS((size & vm->vm_quantum_mask) == 0); btspan = bt_alloc(vm); btspan->bt_type = type; @@ -805,7 +806,7 @@ vmem_destroy1(vmem_t *vm) } static int -vmem_import(vmem_t *vm, vmem_size_t size, int flags) +vmem_import(vmem_t *vm, vmem_size_t size, vmem_size_t align, int flags) { vmem_addr_t addr; int error; @@ -813,6 +814,12 @@ vmem_import(vmem_t *vm, vmem_size_t size if (vm->vm_importfn == NULL) return EINVAL; + /* + * To make sure we get a span that meets the alignment we double it + * and add the size to the tail. This slightly overestimates. + */ + if (align != vm->vm_quantum_mask + 1) + size = (align * 2) + size; size = roundup(size, vm->vm_import_quantum); /* @@ -1157,7 +1164,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_ * imported region. It is up to the user to specify the * import quantum such that it can satisfy any allocation. */ - if (vmem_import(vm, size, flags) == 0) + if (vmem_import(vm, size, align, flags) == 0) continue; /* Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Mon Aug 19 22:25:36 2013 (r254542) +++ head/sys/vm/vm_init.c Mon Aug 19 23:02:39 2013 (r254543) @@ -156,7 +156,8 @@ vm_mem_init(dummy) #if VM_NRESERVLEVEL > 0 1 << (VM_LEVEL_0_ORDER + PAGE_SHIFT)); #else - PAGE_SIZE); + /* On non-superpage architectures want large import sizes. */ + PAGE_SIZE * 1024); #endif kmem_init_zero_region(); From owner-svn-src-all@FreeBSD.ORG Mon Aug 19 23:54:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4FEBD81D; Mon, 19 Aug 2013 23:54:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 228492104; Mon, 19 Aug 2013 23:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JNsPci007504; Mon, 19 Aug 2013 23:54:25 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JNsPD1007503; Mon, 19 Aug 2013 23:54:25 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201308192354.r7JNsPD1007503@svn.freebsd.org> From: Jeff Roberson Date: Mon, 19 Aug 2013 23:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254544 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 23:54:25 -0000 Author: jeff Date: Mon Aug 19 23:54:24 2013 New Revision: 254544 URL: http://svnweb.freebsd.org/changeset/base/254544 Log: - Increase the active lru refresh interval to 10 minutes. This has been shown to negatively impact some workloads and the goal is only to eliminate worst case behaviors for very long periods of paging inactivity. Eventually we should determine a more complex scaling factor for this feature. - Rate limit low memory callback handlers to limit thrashing. Set the default to 10 seconds. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Aug 19 23:02:39 2013 (r254543) +++ head/sys/vm/vm_pageout.c Mon Aug 19 23:54:24 2013 (r254544) @@ -159,6 +159,8 @@ static int vm_max_launder = 32; static int vm_pageout_update_period; static int defer_swap_pageouts; static int disable_swap_pageouts; +static int lowmem_period = 10; +static int lowmem_ticks; #if defined(NO_SWAPPING) static int vm_swap_enabled = 0; @@ -179,6 +181,9 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update CTLFLAG_RW, &vm_pageout_update_period, 0, "Maximum active LRU update period"); +SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, &lowmem_period, 0, + "Low memory callback period"); + #if defined(NO_SWAPPING) SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, CTLFLAG_RD, &vm_swap_enabled, 0, "Enable entire process swapout"); @@ -901,9 +906,10 @@ vm_pageout_scan(struct vm_domain *vmd, i /* * If we need to reclaim memory ask kernel caches to return - * some. + * some. We rate limit to avoid thrashing. */ - if (pass > 0) { + if (vmd == &vm_dom[0] && pass > 0 && + lowmem_ticks + (lowmem_period * hz) < ticks) { /* * Decrease registered cache sizes. */ @@ -913,6 +919,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * drained above. */ uma_reclaim(); + lowmem_ticks = ticks; } /* @@ -1680,10 +1687,11 @@ vm_pageout(void) /* * Set interval in seconds for active scan. We want to visit each - * page at least once a minute. + * page at least once every ten minutes. This is to prevent worst + * case paging behaviors with stale active LRU. */ if (vm_pageout_update_period == 0) - vm_pageout_update_period = 60; + vm_pageout_update_period = 600; /* XXX does not really belong here */ if (vm_page_max_wired == 0) From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 00:35:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C839C4A; Tue, 20 Aug 2013 00:35:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39A9A22EB; Tue, 20 Aug 2013 00:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K0ZMPT023140; Tue, 20 Aug 2013 00:35:22 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K0ZLwE023136; Tue, 20 Aug 2013 00:35:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308200035.r7K0ZLwE023136@svn.freebsd.org> From: Glen Barber Date: Tue, 20 Aug 2013 00:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254545 - stable/9/usr.sbin/makefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 00:35:22 -0000 Author: gjb Date: Tue Aug 20 00:35:21 2013 New Revision: 254545 URL: http://svnweb.freebsd.org/changeset/base/254545 Log: MFC r254397: Mark the makefs(8) '-p' flag as deprecated in preference for the '-Z' flag for compatibility with NetBSD. Modified: stable/9/usr.sbin/makefs/makefs.8 stable/9/usr.sbin/makefs/makefs.c Directory Properties: stable/9/usr.sbin/makefs/ (props changed) Modified: stable/9/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/9/usr.sbin/makefs/makefs.8 Mon Aug 19 23:54:24 2013 (r254544) +++ stable/9/usr.sbin/makefs/makefs.8 Tue Aug 20 00:35:21 2013 (r254545) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2012 +.Dd August 16, 2013 .Dt MAKEFS 8 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm -.Op Fl Dpx +.Op Fl DxZ .Op Fl B Ar byte-order .Op Fl b Ar free-blocks .Op Fl d Ar debug-mask @@ -191,7 +191,10 @@ Set file system specific options. is a comma separated list of options. Valid file system specific options are detailed below. .It Fl p -Create the image as a sparse file. +Deprecated. +See the +.Fl Z +flag. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . @@ -213,6 +216,8 @@ ISO 9660 file system. .El .It Fl x Exclude file system nodes not explicitly listed in the specfile. +.It Fl Z +Create the image as a sparse file. .El .Pp Where sizes are specified, a decimal number of bytes is expected. Modified: stable/9/usr.sbin/makefs/makefs.c ============================================================================== --- stable/9/usr.sbin/makefs/makefs.c Mon Aug 19 23:54:24 2013 (r254544) +++ stable/9/usr.sbin/makefs/makefs.c Tue Aug 20 00:35:21 2013 (r254545) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:x")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -205,6 +205,7 @@ main(int argc, char *argv[]) break; } case 'p': + /* Deprecated in favor of 'Z' */ fsoptions.sparse = 1; break; @@ -233,6 +234,11 @@ main(int argc, char *argv[]) fsoptions.onlyspec = 1; break; + case 'Z': + /* Superscedes 'p' for compatibility with NetBSD makefs(8) */ + fsoptions.sparse = 1; + break; + case '?': default: usage(); @@ -354,7 +360,7 @@ usage(void) fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n" +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 01:14:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6BC575F9; Tue, 20 Aug 2013 01:14:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 466D424DE; Tue, 20 Aug 2013 01:14:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K1EHQX040411; Tue, 20 Aug 2013 01:14:17 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K1EGcQ040405; Tue, 20 Aug 2013 01:14:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308200114.r7K1EGcQ040405@svn.freebsd.org> From: Glen Barber Date: Tue, 20 Aug 2013 01:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254546 - releng/9.2/usr.sbin/makefs X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 01:14:17 -0000 Author: gjb Date: Tue Aug 20 01:14:16 2013 New Revision: 254546 URL: http://svnweb.freebsd.org/changeset/base/254546 Log: MFC r254397: Mark the makefs(8) '-p' flag as deprecated in preference for the '-Z' flag for compatibility with NetBSD. Approved by: re (rodrigc) Modified: releng/9.2/usr.sbin/makefs/makefs.8 releng/9.2/usr.sbin/makefs/makefs.c Directory Properties: releng/9.2/usr.sbin/makefs/ (props changed) Modified: releng/9.2/usr.sbin/makefs/makefs.8 ============================================================================== --- releng/9.2/usr.sbin/makefs/makefs.8 Tue Aug 20 00:35:21 2013 (r254545) +++ releng/9.2/usr.sbin/makefs/makefs.8 Tue Aug 20 01:14:16 2013 (r254546) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2012 +.Dd August 16, 2013 .Dt MAKEFS 8 .Os .Sh NAME @@ -43,7 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm -.Op Fl Dpx +.Op Fl DxZ .Op Fl B Ar byte-order .Op Fl b Ar free-blocks .Op Fl d Ar debug-mask @@ -191,7 +191,10 @@ Set file system specific options. is a comma separated list of options. Valid file system specific options are detailed below. .It Fl p -Create the image as a sparse file. +Deprecated. +See the +.Fl Z +flag. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . @@ -213,6 +216,8 @@ ISO 9660 file system. .El .It Fl x Exclude file system nodes not explicitly listed in the specfile. +.It Fl Z +Create the image as a sparse file. .El .Pp Where sizes are specified, a decimal number of bytes is expected. Modified: releng/9.2/usr.sbin/makefs/makefs.c ============================================================================== --- releng/9.2/usr.sbin/makefs/makefs.c Tue Aug 20 00:35:21 2013 (r254545) +++ releng/9.2/usr.sbin/makefs/makefs.c Tue Aug 20 01:14:16 2013 (r254546) @@ -113,7 +113,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:x")) != -1) { + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { switch (ch) { case 'B': @@ -205,6 +205,7 @@ main(int argc, char *argv[]) break; } case 'p': + /* Deprecated in favor of 'Z' */ fsoptions.sparse = 1; break; @@ -233,6 +234,11 @@ main(int argc, char *argv[]) fsoptions.onlyspec = 1; break; + case 'Z': + /* Superscedes 'p' for compatibility with NetBSD makefs(8) */ + fsoptions.sparse = 1; + break; + case '?': default: usage(); @@ -354,7 +360,7 @@ usage(void) fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n" +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 02:09:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DBB13141; Tue, 20 Aug 2013 02:09:26 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEE88271C; Tue, 20 Aug 2013 02:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K29QLp061211; Tue, 20 Aug 2013 02:09:26 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K29QHY061210; Tue, 20 Aug 2013 02:09:26 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201308200209.r7K29QHY061210@svn.freebsd.org> From: Neel Natu Date: Tue, 20 Aug 2013 02:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254547 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 02:09:26 -0000 Author: neel Date: Tue Aug 20 02:09:26 2013 New Revision: 254547 URL: http://svnweb.freebsd.org/changeset/base/254547 Log: Fix breakage caused by r254466 in minidumpsys(). r254466 increased the KVA from 512GB to 2TB which requires 4 PDP pages as opposed to a single one before the change. This broke minidumpsys() since it assumed that the entire KVA could be addressed via a single PDP page. Fix this by obtaining the address of the PDP page from the PML4 entry associated with the KVA being dumped. Reported by: pho Submitted by: kib Pointy hat to: neel Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Tue Aug 20 01:14:16 2013 (r254546) +++ head/sys/amd64/amd64/minidump_machdep.c Tue Aug 20 02:09:26 2013 (r254547) @@ -221,8 +221,8 @@ minidumpsys(struct dumperinfo *di) vm_offset_t va; int error; uint64_t bits; - uint64_t *pdp, *pd, *pt, pa; - int i, j, k, n, bit; + uint64_t *pml4, *pdp, *pd, *pt, pa; + int i, ii, j, k, n, bit; int retry_count; struct minidumphdr mdhdr; @@ -232,7 +232,6 @@ minidumpsys(struct dumperinfo *di) counter = 0; /* Walk page table pages, set bits in vm_page_dump */ pmapsize = 0; - pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR, kernel_vm_end); ) { /* @@ -240,6 +239,9 @@ minidumpsys(struct dumperinfo *di) * page written corresponds to 1GB of space */ pmapsize += PAGE_SIZE; + ii = (va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1); + pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii; + pdp = (uint64_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); if ((pdp[i] & PG_V) == 0) { va += NBPDP; @@ -364,9 +366,11 @@ minidumpsys(struct dumperinfo *di) /* Dump kernel page directory pages */ bzero(fakepd, sizeof(fakepd)); - pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR, kernel_vm_end); va += NBPDP) { + ii = (va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1); + pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii; + pdp = (uint64_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); /* We always write a page, even if it is zero */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 03:05:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2BBC0977; Tue, 20 Aug 2013 03:05:08 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08D0029E3; Tue, 20 Aug 2013 03:05:07 +0000 (UTC) Received: from Julian-MBP3.local (etroy.elischer.org [121.45.226.51]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.6) with ESMTP id r7K351Qq003361 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 19 Aug 2013 20:05:04 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5212DCD8.4050004@freebsd.org> Date: Tue, 20 Aug 2013 11:04:56 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254519 - in head/sys: netinet netinet6 sys References: <201308191108.r7JB8aQ4057777@svn.freebsd.org> In-Reply-To: <201308191108.r7JB8aQ4057777@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 03:05:08 -0000 On 8/19/13 7:08 PM, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 19 11:08:36 2013 > New Revision: 254519 > URL: http://svnweb.freebsd.org/changeset/base/254519 > > Log: > Move the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific > flag instead. The flag is only used within the IP and IPv6 layer 3 > protocols. weeeeelllll, "maybe" Layer 2 usage of ipfw could make use of this flag as well. Cisco were using L2 ipfw some years back. I don't know if this affects them at all. > > Because some firewall packages treat IPv4 and IPv6 packets the same the > flag should have the same value for both. > > Discussed with: trociny, glebius > > Modified: > head/sys/netinet/ip_var.h > head/sys/netinet6/ip6_var.h > head/sys/sys/mbuf.h > > Modified: head/sys/netinet/ip_var.h > ============================================================================== > --- head/sys/netinet/ip_var.h Mon Aug 19 10:34:10 2013 (r254518) > +++ head/sys/netinet/ip_var.h Mon Aug 19 11:08:36 2013 (r254519) > @@ -163,10 +163,12 @@ void kmod_ipstat_dec(int statnum); > #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ > > /* > - * mbuf flag used by ip_fastfwd > + * IPv4 protocol layer specific mbuf flags. > */ > #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ > #define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ > +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, > + keep in sync with IP6 */ > #define M_IP_FRAG M_PROTO4 /* fragment reassembly */ > > #ifdef __NO_STRICT_ALIGNMENT > > Modified: head/sys/netinet6/ip6_var.h > ============================================================================== > --- head/sys/netinet6/ip6_var.h Mon Aug 19 10:34:10 2013 (r254518) > +++ head/sys/netinet6/ip6_var.h Mon Aug 19 11:08:36 2013 (r254519) > @@ -293,7 +293,12 @@ struct ip6aux { > #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ > #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ > > -#define M_IP6_NEXTHOP M_PROTO7 /* explicit ip nexthop */ > +/* > + * IPv6 protocol layer specific mbuf flags. > + */ > +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ > +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, > + keep in sync with IPv4 */ > > #ifdef __NO_STRICT_ALIGNMENT > #define IP6_HDR_ALIGNED_P(ip) 1 > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Mon Aug 19 10:34:10 2013 (r254518) > +++ head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013 (r254519) > @@ -196,7 +196,7 @@ struct mbuf { > #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ > #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ > #define M_LASTFRAG 0x00002000 /* packet is last fragment */ > -#define M_SKIP_FIREWALL 0x00004000 /* skip firewall processing */ > + /* 0x00004000 free */ > /* 0x00008000 free */ > #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ > #define M_PROMISC 0x00020000 /* packet was not for us */ > @@ -253,7 +253,7 @@ struct mbuf { > * Flags preserved when copying m_pkthdr. > */ > #define M_COPYFLAGS \ > - (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_SKIP_FIREWALL|M_BCAST|M_MCAST|\ > + (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\ > M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_HASHTYPEBITS) > > /* > > From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 04:44:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 35CABC80; Tue, 20 Aug 2013 04:44:31 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D49112F14; Tue, 20 Aug 2013 04:44:30 +0000 (UTC) Received: from [127.0.0.1] (Scott4long@pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.5/8.14.5) with ESMTP id r7K4iNAd036856; Mon, 19 Aug 2013 22:44:23 -0600 (MDT) (envelope-from scott4long@yahoo.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r254544 - head/sys/vm From: Scott Long In-Reply-To: <201308192354.r7JNsPD1007503@svn.freebsd.org> Date: Mon, 19 Aug 2013 22:44:23 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <16628F63-B2B5-42C5-A537-4AD87456C2F2@yahoo.com> References: <201308192354.r7JNsPD1007503@svn.freebsd.org> To: Jeff Roberson X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 04:44:31 -0000 On Aug 19, 2013, at 5:54 PM, Jeff Roberson wrote: > Author: jeff > Date: Mon Aug 19 23:54:24 2013 > New Revision: 254544 > URL: http://svnweb.freebsd.org/changeset/base/254544 >=20 > Log: > - Increase the active lru refresh interval to 10 minutes. This has = been > shown to negatively impact some workloads and the goal is only to > eliminate worst case behaviors for very long periods of paging > inactivity. Eventually we should determine a more complex scaling > factor for this feature. > - Rate limit low memory callback handlers to limit thrashing. Set = the > default to 10 seconds. A more primitive version of this was tested at Netflix and found to be = very advantageous. Thanks for turning it into a more polished thing. Scott From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 06:20:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D3C1AE6D; Tue, 20 Aug 2013 06:20:05 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C12B6256A; Tue, 20 Aug 2013 06:20:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K6K5Lh058716; Tue, 20 Aug 2013 06:20:05 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K6K5wZ058715; Tue, 20 Aug 2013 06:20:05 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201308200620.r7K6K5wZ058715@svn.freebsd.org> From: Neel Natu Date: Tue, 20 Aug 2013 06:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254548 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 06:20:05 -0000 Author: neel Date: Tue Aug 20 06:20:05 2013 New Revision: 254548 URL: http://svnweb.freebsd.org/changeset/base/254548 Log: Extract the location of the remapping hardware units from the ACPI DMAR table. Submitted by: Gopakumar T (gopakumar_thekkedath@yahoo.co.in) Modified: head/sys/amd64/vmm/intel/vtd.c Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue Aug 20 02:09:26 2013 (r254547) +++ head/sys/amd64/vmm/intel/vtd.c Tue Aug 20 06:20:05 2013 (r254548) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "io/iommu.h" @@ -123,60 +123,6 @@ static uint64_t ctx_tables[256][PAGE_SIZ static MALLOC_DEFINE(M_VTD, "vtd", "vtd"); -/* - * Config space register definitions from the "Intel 5520 and 5500" datasheet. - */ -static int -tylersburg_vtd_ident(void) -{ - int units, nlbus; - uint16_t did, vid; - uint32_t miscsts, vtbar; - - const int bus = 0; - const int slot = 20; - const int func = 0; - - units = 0; - - vid = pci_cfgregread(bus, slot, func, PCIR_VENDOR, 2); - did = pci_cfgregread(bus, slot, func, PCIR_DEVICE, 2); - if (vid != 0x8086 || did != 0x342E) - goto done; - - /* - * Check if this is a dual IOH configuration. - */ - miscsts = pci_cfgregread(bus, slot, func, 0x9C, 4); - if (miscsts & (1 << 25)) - nlbus = pci_cfgregread(bus, slot, func, 0x160, 1); - else - nlbus = -1; - - vtbar = pci_cfgregread(bus, slot, func, 0x180, 4); - if (vtbar & 0x1) { - vtdmaps[units++] = (struct vtdmap *) - PHYS_TO_DMAP(vtbar & 0xffffe000); - } else if (bootverbose) - printf("VT-d unit in legacy IOH is disabled!\n"); - - if (nlbus != -1) { - vtbar = pci_cfgregread(nlbus, slot, func, 0x180, 4); - if (vtbar & 0x1) { - vtdmaps[units++] = (struct vtdmap *) - PHYS_TO_DMAP(vtbar & 0xffffe000); - } else if (bootverbose) - printf("VT-d unit in non-legacy IOH is disabled!\n"); - } -done: - return (units); -} - -static drhd_ident_func_t drhd_ident_funcs[] = { - tylersburg_vtd_ident, - NULL -}; - static int vtd_max_domains(struct vtdmap *vtdmap) { @@ -291,19 +237,67 @@ vtd_translation_disable(struct vtdmap *v static int vtd_init(void) { - int i, units; + int i, units, remaining; struct vtdmap *vtdmap; vm_paddr_t ctx_paddr; - - for (i = 0; drhd_ident_funcs[i] != NULL; i++) { - units = (*drhd_ident_funcs[i])(); - if (units > 0) + char *end, envname[32]; + unsigned long mapaddr; + ACPI_STATUS status; + ACPI_TABLE_DMAR *dmar; + ACPI_DMAR_HEADER *hdr; + ACPI_DMAR_HARDWARE_UNIT *drhd; + + /* + * Allow the user to override the ACPI DMAR table by specifying the + * physical address of each remapping unit. + * + * The following example specifies two remapping units at + * physical addresses 0xfed90000 and 0xfeda0000 respectively. + * set vtd.regmap.0.addr=0xfed90000 + * set vtd.regmap.1.addr=0xfeda0000 + */ + for (units = 0; units < DRHD_MAX_UNITS; units++) { + snprintf(envname, sizeof(envname), "vtd.regmap.%d.addr", units); + if (getenv_ulong(envname, &mapaddr) == 0) + break; + vtdmaps[units] = (struct vtdmap *)PHYS_TO_DMAP(mapaddr); + } + + if (units > 0) + goto skip_dmar; + + /* Search for DMAR table. */ + status = AcpiGetTable(ACPI_SIG_DMAR, 0, (ACPI_TABLE_HEADER **)&dmar); + if (ACPI_FAILURE(status)) + return (ENXIO); + + end = (char *)dmar + dmar->Header.Length; + remaining = dmar->Header.Length - sizeof(ACPI_TABLE_DMAR); + while (remaining > sizeof(ACPI_DMAR_HEADER)) { + hdr = (ACPI_DMAR_HEADER *)(end - remaining); + if (hdr->Length > remaining) + break; + /* + * From Intel VT-d arch spec, version 1.3: + * BIOS implementations must report mapping structures + * in numerical order, i.e. All remapping structures of + * type 0 (DRHD) enumerated before remapping structures of + * type 1 (RMRR) and so forth. + */ + if (hdr->Type != ACPI_DMAR_TYPE_HARDWARE_UNIT) + break; + + drhd = (ACPI_DMAR_HARDWARE_UNIT *)hdr; + vtdmaps[units++] = (struct vtdmap *)PHYS_TO_DMAP(drhd->Address); + if (units >= DRHD_MAX_UNITS) break; + remaining -= hdr->Length; } if (units <= 0) return (ENXIO); +skip_dmar: drhd_num = units; vtdmap = vtdmaps[0]; From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 06:46:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4605F3BF; Tue, 20 Aug 2013 06:46:41 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33A67269F; Tue, 20 Aug 2013 06:46:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K6kfjK067845; Tue, 20 Aug 2013 06:46:41 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K6kf0Q067844; Tue, 20 Aug 2013 06:46:41 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201308200646.r7K6kf0Q067844@svn.freebsd.org> From: Neel Natu Date: Tue, 20 Aug 2013 06:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254549 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 06:46:41 -0000 Author: neel Date: Tue Aug 20 06:46:40 2013 New Revision: 254549 URL: http://svnweb.freebsd.org/changeset/base/254549 Log: Do not create superpage mappings in the iommu. This is a workaround to hide the fact that we do not have any code to demote a superpage mapping before we unmap a single page that is part of the superpage. Modified: head/sys/amd64/vmm/intel/vtd.c Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue Aug 20 06:20:05 2013 (r254548) +++ head/sys/amd64/vmm/intel/vtd.c Tue Aug 20 06:46:40 2013 (r254549) @@ -611,13 +611,30 @@ vtd_create_domain(vm_paddr_t maxaddr) dom = malloc(sizeof(struct domain), M_VTD, M_ZERO | M_WAITOK); dom->pt_levels = pt_levels; dom->addrwidth = addrwidth; - dom->spsmask = VTD_CAP_SPS(vtdmap->cap); dom->id = domain_id(); dom->maxaddr = maxaddr; dom->ptp = malloc(PAGE_SIZE, M_VTD, M_ZERO | M_WAITOK); if ((uintptr_t)dom->ptp & PAGE_MASK) panic("vtd_create_domain: ptp (%p) not page aligned", dom->ptp); +#ifdef notyet + /* + * XXX superpage mappings for the iommu do not work correctly. + * + * By default all physical memory is mapped into the host_domain. + * When a VM is allocated wired memory the pages belonging to it + * are removed from the host_domain and added to the vm's domain. + * + * If the page being removed was mapped using a superpage mapping + * in the host_domain then we need to demote the mapping before + * removing the page. + * + * There is not any code to deal with the demotion at the moment + * so we disable superpage mappings altogether. + */ + dom->spsmask = VTD_CAP_SPS(vtdmap->cap); +#endif + SLIST_INSERT_HEAD(&domhead, dom, next); return (dom); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:11:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 11EC284C; Tue, 20 Aug 2013 07:11:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D927527DD; Tue, 20 Aug 2013 07:11:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7BrJS078589; Tue, 20 Aug 2013 07:11:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7Brun078586; Tue, 20 Aug 2013 07:11:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308200711.r7K7Brun078586@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 Aug 2013 07:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254550 - stable/9/sys/fs/tmpfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:11:54 -0000 Author: kib Date: Tue Aug 20 07:11:53 2013 New Revision: 254550 URL: http://svnweb.freebsd.org/changeset/base/254550 Log: MFC r253967: Wait for the doomed vnode to be detached from the tmpfs node if sleepable allocation is requested. Modified: stable/9/sys/fs/tmpfs/tmpfs.h stable/9/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/9/sys/fs/tmpfs/tmpfs.h Tue Aug 20 06:46:40 2013 (r254549) +++ stable/9/sys/fs/tmpfs/tmpfs.h Tue Aug 20 07:11:53 2013 (r254550) @@ -327,6 +327,7 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_VNODE_ALLOCATING 1 #define TMPFS_VNODE_WANT 2 #define TMPFS_VNODE_DOOMED 4 +#define TMPFS_VNODE_WRECLAIM 8 /* --------------------------------------------------------------------- */ /* Modified: stable/9/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/9/sys/fs/tmpfs/tmpfs_subr.c Tue Aug 20 06:46:40 2013 (r254549) +++ stable/9/sys/fs/tmpfs/tmpfs_subr.c Tue Aug 20 07:11:53 2013 (r254550) @@ -386,11 +386,32 @@ tmpfs_alloc_vp(struct mount *mp, struct loop: TMPFS_NODE_LOCK(node); +loop1: if ((vp = node->tn_vnode) != NULL) { MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); VI_LOCK(vp); + if ((node->tn_type == VDIR && node->tn_dir.tn_parent == NULL) || + ((vp->v_iflag & VI_DOOMED) != 0 && + (lkflag & LK_NOWAIT) != 0)) { + VI_UNLOCK(vp); + TMPFS_NODE_UNLOCK(node); + error = ENOENT; + vp = NULL; + goto out; + } + if ((vp->v_iflag & VI_DOOMED) != 0) { + VI_UNLOCK(vp); + node->tn_vpstate |= TMPFS_VNODE_WRECLAIM; + while ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) { + msleep(&node->tn_vnode, TMPFS_NODE_MTX(node), + 0, "tmpfsE", 0); + } + goto loop1; + } TMPFS_NODE_UNLOCK(node); error = vget(vp, lkflag | LK_INTERLOCK, curthread); + if (error == ENOENT) + goto loop; if (error != 0) { vp = NULL; goto out; @@ -519,6 +540,9 @@ tmpfs_free_vp(struct vnode *vp) mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); node->tn_vnode = NULL; + if ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) + wakeup(&node->tn_vnode); + node->tn_vpstate &= ~TMPFS_VNODE_WRECLAIM; vp->v_data = NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:13:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD64F98A; Tue, 20 Aug 2013 07:13:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AACC927EC; Tue, 20 Aug 2013 07:13:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7D1Y9078858; Tue, 20 Aug 2013 07:13:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7D17K078857; Tue, 20 Aug 2013 07:13:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308200713.r7K7D17K078857@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 Aug 2013 07:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254551 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:13:01 -0000 Author: hselasky Date: Tue Aug 20 07:13:01 2013 New Revision: 254551 URL: http://svnweb.freebsd.org/changeset/base/254551 Log: MFC r254238: Correct an EHCI register write. Reported by: aseem.jolly@gmail.com Modified: stable/9/sys/dev/usb/controller/ehci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci.c Tue Aug 20 07:11:53 2013 (r254550) +++ stable/9/sys/dev/usb/controller/ehci.c Tue Aug 20 07:13:01 2013 (r254551) @@ -256,7 +256,7 @@ ehci_init_sub(struct ehci_softc *sc) DPRINTF("HCC uses 64-bit structures\n"); /* MUST clear segment register if 64 bit capable */ - EWRITE4(sc, EHCI_CTRLDSSEGMENT, 0); + EOWRITE4(sc, EHCI_CTRLDSSEGMENT, 0); } usbd_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:15:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8ECA9B91; Tue, 20 Aug 2013 07:15:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C483280A; Tue, 20 Aug 2013 07:15:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7FH8Z079614; Tue, 20 Aug 2013 07:15:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7FHVx079613; Tue, 20 Aug 2013 07:15:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308200715.r7K7FHVx079613@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 Aug 2013 07:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254552 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:15:17 -0000 Author: hselasky Date: Tue Aug 20 07:15:16 2013 New Revision: 254552 URL: http://svnweb.freebsd.org/changeset/base/254552 Log: MFC r254238: Correct an EHCI register write. Reported by: aseem.jolly@gmail.com Modified: stable/8/sys/dev/usb/controller/ehci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Tue Aug 20 07:13:01 2013 (r254551) +++ stable/8/sys/dev/usb/controller/ehci.c Tue Aug 20 07:15:16 2013 (r254552) @@ -256,7 +256,7 @@ ehci_init_sub(struct ehci_softc *sc) DPRINTF("HCC uses 64-bit structures\n"); /* MUST clear segment register if 64 bit capable */ - EWRITE4(sc, EHCI_CTRLDSSEGMENT, 0); + EOWRITE4(sc, EHCI_CTRLDSSEGMENT, 0); } usbd_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:19:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1D09DDA1; Tue, 20 Aug 2013 07:19:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1082840; Tue, 20 Aug 2013 07:19:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7Jw1Q080409; Tue, 20 Aug 2013 07:19:58 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7JwQh080408; Tue, 20 Aug 2013 07:19:58 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201308200719.r7K7JwQh080408@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 20 Aug 2013 07:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254553 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:19:59 -0000 Author: des Date: Tue Aug 20 07:19:58 2013 New Revision: 254553 URL: http://svnweb.freebsd.org/changeset/base/254553 Log: Fix the zeroing loop. I must have been drunk when I wrote this... MFC after: 3 days Modified: head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Tue Aug 20 07:15:16 2013 (r254552) +++ head/sbin/fsck_ffs/fsutil.c Tue Aug 20 07:19:58 2013 (r254553) @@ -629,6 +629,10 @@ blerase(int fd, ufs2_daddr_t blk, long s return; } +/* + * Fill a contiguous region with all-zeroes. Note ZEROBUFSIZE is by + * definition a multiple of dev_bsize. + */ void blzero(int fd, ufs2_daddr_t blk, long size) { @@ -637,9 +641,8 @@ blzero(int fd, ufs2_daddr_t blk, long si if (fd < 0) return; - len = ZEROBUFSIZE; if (zero == NULL) { - zero = calloc(len, 1); + zero = calloc(ZEROBUFSIZE, 1); if (zero == NULL) errx(EEXIT, "cannot allocate buffer pool"); } @@ -647,10 +650,7 @@ blzero(int fd, ufs2_daddr_t blk, long si if (lseek(fd, offset, 0) < 0) rwerror("SEEK BLK", blk); while (size > 0) { - if (size > len) - size = len; - else - len = size; + len = size > ZEROBUFSIZE ? ZEROBUFSIZE : size; if (write(fd, zero, len) != len) rwerror("WRITE BLK", blk); blk += len / dev_bsize; From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:22:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0DCFE73; Tue, 20 Aug 2013 07:22:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE9C12898; Tue, 20 Aug 2013 07:22:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7MKqj082953; Tue, 20 Aug 2013 07:22:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7MKxN082952; Tue, 20 Aug 2013 07:22:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201308200722.r7K7MKxN082952@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 20 Aug 2013 07:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254554 - stable/9/crypto/openssh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:22:21 -0000 Author: des Date: Tue Aug 20 07:22:20 2013 New Revision: 254554 URL: http://svnweb.freebsd.org/changeset/base/254554 Log: MFH (r254278): fix relative symlinks Modified: stable/9/crypto/openssh/sftp.c Directory Properties: stable/9/crypto/openssh/ (props changed) Modified: stable/9/crypto/openssh/sftp.c ============================================================================== --- stable/9/crypto/openssh/sftp.c Tue Aug 20 07:19:58 2013 (r254553) +++ stable/9/crypto/openssh/sftp.c Tue Aug 20 07:22:20 2013 (r254554) @@ -1328,7 +1328,8 @@ parse_dispatch_command(struct sftp_conn case I_SYMLINK: sflag = 1; case I_LINK: - path1 = make_absolute(path1, *pwd); + if (!sflag) + path1 = make_absolute(path1, *pwd); path2 = make_absolute(path2, *pwd); err = (sflag ? do_symlink : do_hardlink)(conn, path1, path2); break; From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:28:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 19645316; Tue, 20 Aug 2013 07:28:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06B2628D3; Tue, 20 Aug 2013 07:28:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7SP6Y083983; Tue, 20 Aug 2013 07:28:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7SPoL083979; Tue, 20 Aug 2013 07:28:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308200728.r7K7SPoL083979@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 Aug 2013 07:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254555 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:28:26 -0000 Author: hselasky Date: Tue Aug 20 07:28:24 2013 New Revision: 254555 URL: http://svnweb.freebsd.org/changeset/base/254555 Log: MFC r254243: - Try to fix build of 32-bit compatibility USB support for FreeBSD and Linux targets without breaking the existing IOCTL API. - Remove some not-needed header file inclusions. - Wrap a long line. Reported by: Damjan Jovanovic Modified: stable/9/sys/dev/usb/usb_compat_linux.c stable/9/sys/dev/usb/usb_hub.c stable/9/sys/dev/usb/usb_ioctl.h stable/9/sys/dev/usb/usb_request.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_compat_linux.c ============================================================================== --- stable/9/sys/dev/usb/usb_compat_linux.c Tue Aug 20 07:22:20 2013 (r254554) +++ stable/9/sys/dev/usb/usb_compat_linux.c Tue Aug 20 07:28:24 2013 (r254555) @@ -45,7 +45,6 @@ #include #include -#include #include #include Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Tue Aug 20 07:22:20 2013 (r254554) +++ stable/9/sys/dev/usb/usb_hub.c Tue Aug 20 07:28:24 2013 (r254555) @@ -50,7 +50,6 @@ #include #include -#include #include #include Modified: stable/9/sys/dev/usb/usb_ioctl.h ============================================================================== --- stable/9/sys/dev/usb/usb_ioctl.h Tue Aug 20 07:22:20 2013 (r254554) +++ stable/9/sys/dev/usb/usb_ioctl.h Tue Aug 20 07:28:24 2013 (r254555) @@ -30,6 +30,7 @@ #define _USB_IOCTL_H_ #include +#include /* Building "kdump" depends on these includes */ @@ -41,6 +42,16 @@ #define USB_GENERIC_NAME "ugen" #define USB_TEMPLATE_SYSCTL "hw.usb.template" /* integer type */ +/* + * Align IOCTL structures to hide differences when running 32-bit + * programs under 64-bit kernels: + */ +#ifdef COMPAT_32BIT +#define USB_IOCTL_STRUCT_ALIGN(n) __aligned(n) +#else +#define USB_IOCTL_STRUCT_ALIGN(n) +#endif + /* Definition of valid template sysctl values */ enum { @@ -62,7 +73,7 @@ struct usb_read_dir { #endif uint32_t urd_startentry; uint32_t urd_maxlen; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_ctl_request { #ifdef COMPAT_32BIT @@ -74,12 +85,12 @@ struct usb_ctl_request { uint16_t ucr_actlen; /* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ struct usb_device_request ucr_request; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_alt_interface { uint8_t uai_interface_index; uint8_t uai_alt_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_gen_descriptor { #ifdef COMPAT_32BIT @@ -98,7 +109,7 @@ struct usb_gen_descriptor { uint8_t ugd_endpt_index; uint8_t ugd_report_type; uint8_t reserved[8]; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_device_info { uint16_t udi_productNo; @@ -127,24 +138,33 @@ struct usb_device_info { char udi_vendor[128]; char udi_serial[64]; char udi_release[8]; -}; +} USB_IOCTL_STRUCT_ALIGN(2); + +#define USB_DEVICE_PORT_PATH_MAX 32 + +struct usb_device_port_path { + uint8_t udp_bus; /* which bus we are on */ + uint8_t udp_index; /* which device index */ + uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ + uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_device_stats { uint32_t uds_requests_ok[4]; /* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ -}; +} USB_IOCTL_STRUCT_ALIGN(4); struct usb_fs_start { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_stop { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_complete { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); /* This structure is used for all endpoint types */ struct usb_fs_endpoint { @@ -177,7 +197,7 @@ struct usb_fs_endpoint { /* timeout value for no timeout */ #define USB_FS_TIMEOUT_NONE 0 int status; /* see USB_ERR_XXX */ -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_fs_init { /* userland pointer to endpoints structure */ @@ -188,11 +208,11 @@ struct usb_fs_init { #endif /* maximum number of endpoints */ uint8_t ep_index_max; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_fs_uninit { uint8_t dummy; /* zero */ -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_open { #define USB_FS_MAX_BUFSIZE (1 << 18) @@ -204,15 +224,20 @@ struct usb_fs_open { uint8_t dev_index; /* currently unused */ uint8_t ep_index; uint8_t ep_no; /* bEndpointNumber */ -}; +} USB_IOCTL_STRUCT_ALIGN(4); + +struct usb_fs_open_stream { + struct usb_fs_open fs_open; + uint16_t stream_id; /* stream ID */ +} USB_IOCTL_STRUCT_ALIGN(4); struct usb_fs_close { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_clear_stall_sync { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_gen_quirk { uint16_t index; /* Quirk Index */ @@ -222,11 +247,11 @@ struct usb_gen_quirk { uint16_t bcdDeviceHigh; /* High Device Revision */ uint16_t reserved[2]; /* - * String version of quirk including terminating zero. See UQ_XXX in - * "usb_quirk.h". + * String version of quirk including terminating zero. See + * UQ_XXX in "usb_quirk.h". */ char quirkname[64 - 14]; -}; +} USB_IOCTL_STRUCT_ALIGN(2); /* USB controller */ #define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request) Modified: stable/9/sys/dev/usb/usb_request.c ============================================================================== --- stable/9/sys/dev/usb/usb_request.c Tue Aug 20 07:22:20 2013 (r254554) +++ stable/9/sys/dev/usb/usb_request.c Tue Aug 20 07:28:24 2013 (r254555) @@ -48,7 +48,6 @@ #include #include #include -#include #include #define USB_DEBUG_VAR usb_debug From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 07:40:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E81C7676; Tue, 20 Aug 2013 07:40:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D42312971; Tue, 20 Aug 2013 07:40:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7K7efnr089699; Tue, 20 Aug 2013 07:40:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7K7efRr089695; Tue, 20 Aug 2013 07:40:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308200740.r7K7efRr089695@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 Aug 2013 07:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254556 - stable/8/sys/dev/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 07:40:42 -0000 Author: hselasky Date: Tue Aug 20 07:40:40 2013 New Revision: 254556 URL: http://svnweb.freebsd.org/changeset/base/254556 Log: MFC r254243: - Try to fix build of 32-bit compatibility USB support for FreeBSD and Linux targets without breaking the existing IOCTL API. - Remove some not-needed header file inclusions. - Wrap a long line. Reported by: Damjan Jovanovic Modified: stable/8/sys/dev/usb/usb_compat_linux.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_ioctl.h stable/8/sys/dev/usb/usb_request.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/usb_compat_linux.c ============================================================================== --- stable/8/sys/dev/usb/usb_compat_linux.c Tue Aug 20 07:28:24 2013 (r254555) +++ stable/8/sys/dev/usb/usb_compat_linux.c Tue Aug 20 07:40:40 2013 (r254556) @@ -45,7 +45,6 @@ #include #include -#include #include #include Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Tue Aug 20 07:28:24 2013 (r254555) +++ stable/8/sys/dev/usb/usb_hub.c Tue Aug 20 07:40:40 2013 (r254556) @@ -50,7 +50,6 @@ #include #include -#include #include #include Modified: stable/8/sys/dev/usb/usb_ioctl.h ============================================================================== --- stable/8/sys/dev/usb/usb_ioctl.h Tue Aug 20 07:28:24 2013 (r254555) +++ stable/8/sys/dev/usb/usb_ioctl.h Tue Aug 20 07:40:40 2013 (r254556) @@ -30,6 +30,7 @@ #define _USB_IOCTL_H_ #include +#include /* Building "kdump" depends on these includes */ @@ -41,6 +42,16 @@ #define USB_GENERIC_NAME "ugen" #define USB_TEMPLATE_SYSCTL "hw.usb.template" /* integer type */ +/* + * Align IOCTL structures to hide differences when running 32-bit + * programs under 64-bit kernels: + */ +#ifdef COMPAT_32BIT +#define USB_IOCTL_STRUCT_ALIGN(n) __aligned(n) +#else +#define USB_IOCTL_STRUCT_ALIGN(n) +#endif + /* Definition of valid template sysctl values */ enum { @@ -62,7 +73,7 @@ struct usb_read_dir { #endif uint32_t urd_startentry; uint32_t urd_maxlen; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_ctl_request { #ifdef COMPAT_32BIT @@ -74,12 +85,12 @@ struct usb_ctl_request { uint16_t ucr_actlen; /* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ struct usb_device_request ucr_request; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_alt_interface { uint8_t uai_interface_index; uint8_t uai_alt_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_gen_descriptor { #ifdef COMPAT_32BIT @@ -98,7 +109,7 @@ struct usb_gen_descriptor { uint8_t ugd_endpt_index; uint8_t ugd_report_type; uint8_t reserved[8]; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_device_info { uint16_t udi_productNo; @@ -127,24 +138,33 @@ struct usb_device_info { char udi_vendor[128]; char udi_serial[64]; char udi_release[8]; -}; +} USB_IOCTL_STRUCT_ALIGN(2); + +#define USB_DEVICE_PORT_PATH_MAX 32 + +struct usb_device_port_path { + uint8_t udp_bus; /* which bus we are on */ + uint8_t udp_index; /* which device index */ + uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ + uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_device_stats { uint32_t uds_requests_ok[4]; /* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ -}; +} USB_IOCTL_STRUCT_ALIGN(4); struct usb_fs_start { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_stop { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_complete { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); /* This structure is used for all endpoint types */ struct usb_fs_endpoint { @@ -177,7 +197,7 @@ struct usb_fs_endpoint { /* timeout value for no timeout */ #define USB_FS_TIMEOUT_NONE 0 int status; /* see USB_ERR_XXX */ -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_fs_init { /* userland pointer to endpoints structure */ @@ -188,11 +208,11 @@ struct usb_fs_init { #endif /* maximum number of endpoints */ uint8_t ep_index_max; -}; +} USB_IOCTL_STRUCT_ALIGN(8); struct usb_fs_uninit { uint8_t dummy; /* zero */ -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_open { #define USB_FS_MAX_BUFSIZE (1 << 18) @@ -204,15 +224,20 @@ struct usb_fs_open { uint8_t dev_index; /* currently unused */ uint8_t ep_index; uint8_t ep_no; /* bEndpointNumber */ -}; +} USB_IOCTL_STRUCT_ALIGN(4); + +struct usb_fs_open_stream { + struct usb_fs_open fs_open; + uint16_t stream_id; /* stream ID */ +} USB_IOCTL_STRUCT_ALIGN(4); struct usb_fs_close { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_clear_stall_sync { uint8_t ep_index; -}; +} USB_IOCTL_STRUCT_ALIGN(1); struct usb_gen_quirk { uint16_t index; /* Quirk Index */ @@ -222,11 +247,11 @@ struct usb_gen_quirk { uint16_t bcdDeviceHigh; /* High Device Revision */ uint16_t reserved[2]; /* - * String version of quirk including terminating zero. See UQ_XXX in - * "usb_quirk.h". + * String version of quirk including terminating zero. See + * UQ_XXX in "usb_quirk.h". */ char quirkname[64 - 14]; -}; +} USB_IOCTL_STRUCT_ALIGN(2); /* USB controller */ #define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request) Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Tue Aug 20 07:28:24 2013 (r254555) +++ stable/8/sys/dev/usb/usb_request.c Tue Aug 20 07:40:40 2013 (r254556) @@ -48,7 +48,6 @@ #include #include #include -#include #include #define USB_DEBUG_VAR usb_debug From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 11:06:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 83ED8CF6; Tue, 20 Aug 2013 11:06:57 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7194F25CB; Tue, 20 Aug 2013 11:06:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KB6v0M067985; Tue, 20 Aug 2013 11:06:57 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KB6vB7067983; Tue, 20 Aug 2013 11:06:57 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201308201106.r7KB6vB7067983@svn.freebsd.org> From: Peter Holm Date: Tue, 20 Aug 2013 11:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254558 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 11:06:57 -0000 Author: pho Date: Tue Aug 20 11:06:56 2013 New Revision: 254558 URL: http://svnweb.freebsd.org/changeset/base/254558 Log: Added sysctl to turn off calls to vmem_check(). Sponsored by: EMC / Isilon storage division Discussed with: jeff Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Tue Aug 20 07:48:20 2013 (r254557) +++ head/sys/kern/subr_vmem.c Tue Aug 20 11:06:56 2013 (r254558) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -167,6 +168,9 @@ struct vmem_btag { #define BT_END(bt) ((bt)->bt_start + (bt)->bt_size - 1) #if defined(DIAGNOSTIC) +static int enable_vmem_check = 1; +SYSCTL_INT(_debug, OID_AUTO, vmem_check, CTLFLAG_RW, + &enable_vmem_check, 0, "Enable vmem check"); static void vmem_check(vmem_t *); #endif @@ -720,9 +724,11 @@ vmem_periodic(void *unused, int pending) LIST_FOREACH(vm, &vmem_list, vm_alllist) { #ifdef DIAGNOSTIC /* Convenient time to verify vmem state. */ - VMEM_LOCK(vm); - vmem_check(vm); - VMEM_UNLOCK(vm); + if (enable_vmem_check == 1) { + VMEM_LOCK(vm); + vmem_check(vm); + VMEM_UNLOCK(vm); + } #endif desired = 1 << flsl(vm->vm_nbusytag); desired = MIN(MAX(desired, VMEM_HASHSIZE_MIN), From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 12:33:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A10005D5; Tue, 20 Aug 2013 12:33:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80D6D2B94; Tue, 20 Aug 2013 12:33:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KCXakM002833; Tue, 20 Aug 2013 12:33:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KCXZ3p002825; Tue, 20 Aug 2013 12:33:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308201233.r7KCXZ3p002825@svn.freebsd.org> From: Ian Lepore Date: Tue, 20 Aug 2013 12:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254559 - in head/sys: arm/conf arm/ti arm/ti/am335x boot/fdt/dts dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 12:33:36 -0000 Author: ian Date: Tue Aug 20 12:33:35 2013 New Revision: 254559 URL: http://svnweb.freebsd.org/changeset/base/254559 Log: Make the standard sdhci(4) driver work for the TI OMAP family SoCs. The MMCHS hardware is pretty much a standard SDHCI v2.0 controller with a couple quirks, which are now supported by sdhci(4) as of r254507. This should work for all TI SoCs that use the MMCHS hardware, but it has only been tested on AM335x right now, so this enables it on those platforms but leaves the existing ti_mmchs driver in place for other OMAP variants until they can be tested. This initial incarnation lacks DMA support (coming soon). Even without it this improves performance pretty noticibly over the ti_mmchs driver, primarily because it now does multiblock IO. Added: head/sys/arm/ti/ti_sdhci.c (contents, props changed) Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/ti/am335x/files.am335x head/sys/boot/fdt/dts/am335x.dtsi head/sys/dev/mmc/mmc.c Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue Aug 20 11:06:56 2013 (r254558) +++ head/sys/arm/conf/BEAGLEBONE Tue Aug 20 12:33:35 2013 (r254559) @@ -80,6 +80,7 @@ options NFSLOCKD # MMC/SD/SDIO card slot support device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards +device sdhci # mmc/sd host controller # Boot device is 2nd slice on MMC/SD card options ROOTDEVNAME=\"ufs:mmcsd0s2\" Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Tue Aug 20 11:06:56 2013 (r254558) +++ head/sys/arm/ti/am335x/files.am335x Tue Aug 20 12:33:35 2013 (r254559) @@ -9,5 +9,6 @@ arm/ti/am335x/am335x_lcd_syscons.c optio arm/ti/am335x/am335x_pwm.c standard arm/ti/am335x/am335x_usbss.c optional musb fdt arm/ti/ti_edma3.c standard -arm/ti/ti_mmchs.c optional mmc +arm/ti/ti_sdhci.c optional sdhci +#arm/ti/ti_mmchs.c optional mmc arm/ti/cpsw/if_cpsw.c optional cpsw Added: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_sdhci.c Tue Aug 20 12:33:35 2013 (r254559) @@ -0,0 +1,565 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2011 Ben Gray . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include "sdhci_if.h" + +#include +#include +#include "gpio_if.h" + +struct ti_sdhci_softc { + device_t dev; + device_t gpio_dev; + struct resource * mem_res; + struct resource * irq_res; + void * intr_cookie; + struct sdhci_slot slot; + uint32_t mmchs_device_id; + uint32_t mmchs_reg_off; + uint32_t sdhci_reg_off; + uint32_t baseclk_hz; + uint32_t wp_gpio_pin; + uint32_t cmd_and_mode; + uint32_t sdhci_clkdiv; +}; + +/* + * The MMCHS hardware has a few control and status registers at the beginning of + * the device's memory map, followed by the standard sdhci register block. + * Different SoCs have the register blocks at different offsets from the + * beginning of the device. Define some constants to map out the registers we + * access, and the various per-SoC offsets. The SDHCI_REG_OFFSET is how far + * beyond the MMCHS block the SDHCI block is found; it's the same on all SoCs. + */ +#define OMAP3_MMCHS_REG_OFFSET 0x000 +#define OMAP4_MMCHS_REG_OFFSET 0x100 +#define AM335X_MMCHS_REG_OFFSET 0x100 +#define SDHCI_REG_OFFSET 0x100 + +#define MMCHS_SYSCONFIG 0x010 +#define MMCHS_SYSCONFIG_RESET (1 << 1) +#define MMCHS_SYSSTATUS 0x014 +#define MMCHS_CON 0x02C +#define MMCHS_CON_DW8 (1 << 5) +#define MMCHS_CON_DVAL_8_4MS (3 << 9) + +static inline uint32_t +ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off + sc->mmchs_reg_off)); +} + +static inline void +ti_mmchs_write_4(struct ti_sdhci_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off + sc->mmchs_reg_off, val); +} + +static inline uint32_t +RD4(struct ti_sdhci_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off + sc->sdhci_reg_off)); +} + +static inline void +WR4(struct ti_sdhci_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off + sc->sdhci_reg_off, val); +} + +static uint8_t +ti_sdhci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xff); +} + +static uint16_t +ti_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + uint32_t clkdiv, val32; + + /* + * The MMCHS hardware has a non-standard interpretation of the sdclock + * divisor bits. It uses the same bit positions as SDHCI 3.0 (15..6) + * but doesn't split them into low:high fields. Instead they're a + * single number in the range 0..1023 and the number is exactly the + * clock divisor (with 0 and 1 both meaning divide by 1). The SDHCI + * driver code expects a v2.0 divisor (value N is power of two in the + * range 0..128 and clock is divided by 2N). The shifting and masking + * here extracts the MMCHS representation from the hardware word, cleans + * those bits out, applies the 2N adjustment, and plugs that into the + * bit positions for the 2.0 divisor in the returned register value. The + * ti_sdhci_write_2() routine performs the opposite transformation when + * the SDHCI driver writes to the register. + */ + if (off == SDHCI_CLOCK_CONTROL) { + val32 = RD4(sc, SDHCI_CLOCK_CONTROL); + clkdiv = (val32 >> SDHCI_DIVIDER_HI_SHIFT) & 0xff; + val32 &= ~(0xff << SDHCI_DIVIDER_HI_SHIFT); + val32 |= (clkdiv / 2) << SDHCI_DIVIDER_SHIFT; + return (val32 & 0xffff); + } + + /* + * Standard 32-bit handling of command and transfer mode. + */ + if (off == SDHCI_TRANSFER_MODE) { + return (sc->cmd_and_mode >> 16); + } else if (off == SDHCI_COMMAND_FLAGS) { + return (sc->cmd_and_mode & 0x0000ffff); + } + + return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xffff); +} + +static uint32_t +ti_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + return (RD4(sc, off)); +} + +static void +ti_sdhci_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + bus_read_multi_4(sc->mem_res, off + sc->sdhci_reg_off, data, count); +} + +static void +ti_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint8_t val) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + val32 = RD4(sc, off & ~3); + val32 &= ~(0xff << (off & 3) * 8); + val32 |= (val << (off & 3) * 8); + + WR4(sc, off & ~3, val32); +} + +static void +ti_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint16_t val) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + uint32_t clkdiv, val32; + + /* + * Translate between the hardware and SDHCI 2.0 representations of the + * clock divisor. See the comments in ti_sdhci_read_2() for details. + */ + if (off == SDHCI_CLOCK_CONTROL) { + clkdiv = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK; + val32 = RD4(sc, SDHCI_CLOCK_CONTROL); + val32 &= 0xffff0000; + val32 |= val & ~(SDHCI_DIVIDER_MASK << SDHCI_DIVIDER_SHIFT); + val32 |= (clkdiv * 2) << SDHCI_DIVIDER_HI_SHIFT; + WR4(sc, SDHCI_CLOCK_CONTROL, val32); + return; + } + + /* + * Standard 32-bit handling of command and transfer mode. + */ + if (off == SDHCI_TRANSFER_MODE) { + sc->cmd_and_mode = (sc->cmd_and_mode & 0xffff0000) | + ((uint32_t)val & 0x0000ffff); + return; + } else if (off == SDHCI_COMMAND_FLAGS) { + sc->cmd_and_mode = (sc->cmd_and_mode & 0x0000ffff) | + ((uint32_t)val << 16); + WR4(sc, SDHCI_TRANSFER_MODE, sc->cmd_and_mode); + return; + } + + val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3) * 8); + val32 |= ((val & 0xffff) << (off & 3) * 8); + WR4(sc, off & ~3, val32); +} + +static void +ti_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t val) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + WR4(sc, off, val); +} + +static void +ti_sdhci_write_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + bus_write_multi_4(sc->mem_res, off + sc->sdhci_reg_off, data, count); +} + +static void +ti_sdhci_intr(void *arg) +{ + struct ti_sdhci_softc *sc = arg; + + sdhci_generic_intr(&sc->slot); +} + +static int +ti_sdhci_update_ios(device_t brdev, device_t reqdev) +{ + struct ti_sdhci_softc *sc = device_get_softc(brdev); + struct sdhci_slot *slot; + struct mmc_ios *ios; + uint32_t val32; + + slot = device_get_ivars(reqdev); + ios = &slot->host.ios; + + /* + * There is an 8-bit-bus bit in the MMCHS control register which, when + * set, overrides the 1 vs 4 bit setting in the standard SDHCI + * registers. Set that bit first according to whether an 8-bit bus is + * requested, then let the standard driver handle everything else. + */ + val32 = ti_mmchs_read_4(sc, MMCHS_CON); + if (ios->bus_width == bus_width_8) + ti_mmchs_write_4(sc, MMCHS_CON, val32 | MMCHS_CON_DW8); + else + ti_mmchs_write_4(sc, MMCHS_CON, val32 & ~MMCHS_CON_DW8); + + return (sdhci_generic_update_ios(brdev, reqdev)); +} + +static int +ti_sdhci_get_ro(device_t brdev, device_t reqdev) +{ + struct ti_sdhci_softc *sc = device_get_softc(brdev); + unsigned int readonly = 0; + + /* If a gpio pin is configured, read it. */ + if (sc->gpio_dev != NULL) { + GPIO_PIN_GET(sc->gpio_dev, sc->wp_gpio_pin, &readonly); + } + + return (readonly); +} + +static int +ti_sdhci_detach(device_t dev) +{ + + return (EBUSY); +} + +static void +ti_sdhci_hw_init(device_t dev) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + clk_ident_t clk; + unsigned long timeout; + + /* Enable the controller and interface/functional clocks */ + clk = MMC0_CLK + sc->mmchs_device_id; + if (ti_prcm_clk_enable(clk) != 0) { + device_printf(dev, "Error: failed to enable MMC clock\n"); + return; + } + + /* Get the frequency of the source clock */ + if (ti_prcm_clk_get_source_freq(clk, &sc->baseclk_hz) != 0) { + device_printf(dev, "Error: failed to get source clock freq\n"); + return; + } + + /* Issue a softreset to the controller */ + ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, MMCHS_SYSCONFIG_RESET); + timeout = 1000; + while ((ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & MMCHS_SYSCONFIG_RESET)) { + if (--timeout == 0) { + device_printf(dev, "Error: Controller reset operation timed out\n"); + break; + } + DELAY(100); + } + + /* Reset both the command and data state machines */ + ti_sdhci_write_1(dev, NULL, SDHCI_SOFTWARE_RESET, SDHCI_RESET_ALL); + timeout = 1000; + while ((ti_sdhci_read_1(dev, NULL, SDHCI_SOFTWARE_RESET) & SDHCI_RESET_ALL)) { + if (--timeout == 0) { + device_printf(dev, "Error: Software reset operation timed out\n"); + break; + } + DELAY(100); + } + + /* Set initial host configuration (1-bit, std speed, pwr off). */ + ti_sdhci_write_1(dev, NULL, SDHCI_HOST_CONTROL, 0); + ti_sdhci_write_1(dev, NULL, SDHCI_POWER_CONTROL, 0); + + /* Set the initial controller configuration. */ + ti_mmchs_write_4(sc, MMCHS_CON, MMCHS_CON_DVAL_8_4MS); +} + +static int +ti_sdhci_attach(device_t dev) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + int rid, err; + pcell_t prop; + phandle_t node; + + sc->dev = dev; + + /* + * Get the MMCHS device id from FDT. If it's not there use the newbus + * unit number (which will work as long as the devices are in order and + * none are skipped in the fdt). + */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "mmchs-device-id", &prop, sizeof(prop))) <= 0) { + sc->mmchs_device_id = device_get_unit(dev); + device_printf(dev, "missing mmchs-device-id attribute in FDT, " + "using unit number (%d)", sc->mmchs_device_id); + } else + sc->mmchs_device_id = fdt32_to_cpu(prop); + + /* See if we've got a GPIO-based write detect pin. */ + if ((OF_getprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) + sc->wp_gpio_pin = 0xffffffff; + else + sc->wp_gpio_pin = fdt32_to_cpu(prop); + + if (sc->wp_gpio_pin != 0xffffffff) { + sc->gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (sc->gpio_dev == NULL) + device_printf(dev, "Error: No GPIO device, " + "Write Protect pin will not function\n"); + else + GPIO_PIN_SETFLAGS(sc->gpio_dev, sc->wp_gpio_pin, + GPIO_PIN_INPUT); + } + + /* + * Set the offset from the device's memory start to the MMCHS registers. + * + * XXX A better way to handle this would be to have separate memory + * resources for the sdhci registers and the mmchs registers. That + * requires changing everyone's DTS files. + */ + if (ti_chip() == CHIP_OMAP_3) + sc->mmchs_reg_off = OMAP3_MMCHS_REG_OFFSET; + else if (ti_chip() == CHIP_OMAP_4) + sc->mmchs_reg_off = OMAP4_MMCHS_REG_OFFSET; + else if (ti_chip() == CHIP_AM335X) + sc->mmchs_reg_off = AM335X_MMCHS_REG_OFFSET; + else + panic("Unknown OMAP device\n"); + + /* + * The standard SDHCI registers are at a fixed offset (the same on all + * SoCs) beyond the MMCHS registers. + */ + sc->sdhci_reg_off = sc->mmchs_reg_off + SDHCI_REG_OFFSET; + + /* Resource setup. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + err = ENXIO; + goto fail; + } + + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->irq_res) { + device_printf(dev, "cannot allocate interrupt\n"); + err = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, ti_sdhci_intr, sc, &sc->intr_cookie)) { + device_printf(dev, "cannot setup interrupt handler\n"); + err = ENXIO; + goto fail; + } + + /* Initialise the MMCHS hardware. */ + ti_sdhci_hw_init(dev); + + /* + * The capabilities register can only express base clock frequencies in + * the range of 0-63MHz for a v2.0 controller. Since our clock runs + * faster than that, the hardware sets the frequency to zero in the + * register. When the register contains zero, the sdhci driver expects + * slot.max_clk to already have the right value in it. + */ + sc->slot.max_clk = sc->baseclk_hz; + + /* + * The MMCHS timeout counter is based on the output sdclock. Tell the + * sdhci driver to recalculate the timeout clock whenever the output + * sdclock frequency changes. + */ + sc->slot.quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; + + /* + * The MMCHS hardware shifts the 136-bit response data (in violation of + * the spec), so tell the sdhci driver not to do the same in software. + */ + sc->slot.quirks |= SDHCI_QUIRK_DONT_SHIFT_RESPONSE; + + /* + * DMA is not really broken, I just haven't implemented it yet. + */ + sc->slot.quirks |= SDHCI_QUIRK_BROKEN_DMA; + + /* Set up the hardware and go. */ + sdhci_init_slot(dev, &sc->slot, 0); + + /* + * The SDHCI controller doesn't realize it, but we support 8-bit even + * though we're not a v3.0 controller. Advertise the ability. + */ + sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + + bus_generic_probe(dev); + bus_generic_attach(dev); + + sdhci_start_slot(&sc->slot); + + return (0); + +fail: + if (sc->intr_cookie) + bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie); + if (sc->irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + if (sc->mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (err); +} + +static int +ti_sdhci_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ti,mmchs")) { + return (ENXIO); + } + + device_set_desc(dev, "TI MMCHS (SDHCI 2.0)"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t ti_sdhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ti_sdhci_probe), + DEVMETHOD(device_attach, ti_sdhci_attach), + DEVMETHOD(device_detach, ti_sdhci_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + DEVMETHOD(bus_print_child, bus_generic_print_child), + + /* MMC bridge interface */ + DEVMETHOD(mmcbr_update_ios, ti_sdhci_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, ti_sdhci_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, ti_sdhci_read_1), + DEVMETHOD(sdhci_read_2, ti_sdhci_read_2), + DEVMETHOD(sdhci_read_4, ti_sdhci_read_4), + DEVMETHOD(sdhci_read_multi_4, ti_sdhci_read_multi_4), + DEVMETHOD(sdhci_write_1, ti_sdhci_write_1), + DEVMETHOD(sdhci_write_2, ti_sdhci_write_2), + DEVMETHOD(sdhci_write_4, ti_sdhci_write_4), + DEVMETHOD(sdhci_write_multi_4, ti_sdhci_write_multi_4), + + DEVMETHOD_END +}; + +static devclass_t ti_sdhci_devclass; + +static driver_t ti_sdhci_driver = { + "sdhci_ti", + ti_sdhci_methods, + sizeof(struct ti_sdhci_softc), +}; + +DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, 0, 0); +MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Tue Aug 20 11:06:56 2013 (r254558) +++ head/sys/boot/fdt/dts/am335x.dtsi Tue Aug 20 12:33:35 2013 (r254559) @@ -112,6 +112,7 @@ interrupts = <64>; interrupt-parent = <&AINTC>; mmchs-device-id = <0>; + mmchs-wp-gpio-pin = <0xffffffff>; }; mmchs1@481D8000 { @@ -120,6 +121,7 @@ interrupts = <28>; interrupt-parent = <&AINTC>; mmchs-device-id = <1>; + mmchs-wp-gpio-pin = <0xffffffff>; status = "disabled"; }; Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Tue Aug 20 11:06:56 2013 (r254558) +++ head/sys/dev/mmc/mmc.c Tue Aug 20 12:33:35 2013 (r254559) @@ -1761,3 +1761,4 @@ DRIVER_MODULE(mmc, at91_mci, mmc_driver, DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:19:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AEAE31C6; Tue, 20 Aug 2013 13:19:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 822302E0A; Tue, 20 Aug 2013 13:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KDJact022187; Tue, 20 Aug 2013 13:19:36 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KDJZV4022186; Tue, 20 Aug 2013 13:19:35 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201308201319.r7KDJZV4022186@svn.freebsd.org> From: Cy Schubert Date: Tue, 20 Aug 2013 13:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254560 - vendor/ipfilter/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:19:36 -0000 Author: cy Date: Tue Aug 20 13:19:35 2013 New Revision: 254560 URL: http://svnweb.freebsd.org/changeset/base/254560 Log: Document the FreeBSD use of IP-FIlter under the previously existing non-GPL license. Approved by: Darren Reed (IP-Filter author) glebius (mentor) Added: vendor/ipfilter/dist/IPFILTER.LICENCE.FreeBSD Added: vendor/ipfilter/dist/IPFILTER.LICENCE.FreeBSD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/ipfilter/dist/IPFILTER.LICENCE.FreeBSD Tue Aug 20 13:19:35 2013 (r254560) @@ -0,0 +1,83 @@ +Received: from slippy (localhost [127.0.0.1]) + by slippy.cwsent.com (8.14.7/8.14.7) with ESMTP id r68DreQv004291 + for ; Mon, 8 Jul 2013 06:53:40 -0700 (PDT) + (envelope-from Cy.Schubert@komquats.com) +X-Original-To: slippy +Delivered-To: slippy@komquats.com +Received: from cwfw [10.1.1.254] + by slippy with POP3 (fetchmail-6.3.22) + for (single-drop); Mon, 08 Jul 2013 06:53:40 -0700 (PDT) +Received: by spqr.komquats.com (Postfix, from userid 1000) + id 377821BC; Mon, 8 Jul 2013 06:53:38 -0700 (PDT) +X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on cwfw.cwsent.com +X-Spam-Level: +X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,MY_DSL,SMILEY + autolearn=no version=3.3.2 +X-Original-To: Cy.Schubert@komquats.com +Delivered-To: Cy.Schubert@komquats.com +Received: from mail.ipfilter.com.au (dsl-202-45-110-141-static.VIC.netspace.net.au [202.45.110.141]) + by spqr.komquats.com (Postfix) with ESMTP id C69AE18D + for ; Mon, 8 Jul 2013 06:53:31 -0700 (PDT) +Received: (from root@localhost) + by firewall.reed.wattle.id.au (8.12.10/8.11.0) id r68DrJF8001558; + Mon, 8 Jul 2013 23:53:19 +1000 (EST) +Message-ID: <51DAC488.1050700@reed.wattle.id.au> +Date: Mon, 08 Jul 2013 23:54:16 +1000 +From: Darren Reed +Reply-To: darrenr@reed.wattle.id.au +User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 +MIME-Version: 1.0 +To: Cy Schubert +CC: Gleb Smirnoff , Andre Oppermann , + Pedro Giffuni +Subject: Re: IP Filter 5.1.2 License +References: <201307011513.r61FD9IK005944@slippy.cwsent.com> +In-Reply-To: <201307011513.r61FD9IK005944@slippy.cwsent.com> +X-Enigmail-Version: 1.5.1 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +X-UIDL: NC"#!o_F!!BlL!!bL6!! + +On 2/07/2013 1:13 AM, Cy Schubert wrote: +> In message <51D19503.2090805@reed.wattle.id.au>, Darren Reed writes: +>> On 25/06/2013 11:03 AM, Cy Schubert wrote: +>>> Hi Darren, +>>> +>>> I'm not sure if you remember me or not but I'm a committer at the FreeBSD +>>> Project. I've been a long time IPF user, both under FreeBSD and Solaris. +>>> I've volunteered to maintain IP Filter in the src/ tree. I noticed that the +>> +>>> IP Filter license changed from the previous IP Filter license to GPLv2 +>>> somewhere between 4.1.34 and 4.1.35. I was planning on importing 5.1.2 +>>> however upon discovering it was GPL I decided to update the FreeBSD IPF +>>> from 4.1.28 to 4.1.34 until it was brought to my attention a few days ago +>>> that IPF 5.1.2 was imported into NetBSD. I'm not sure what kind of policy +>>> the NetBSD folks have toward GPL so I thought it best to ask you directly +>>> under what license you imported IPF into NetBSD? If I can I'd like to +>>> import 5.1.2. As IPF author and owner of the code, what are your thoughts. +>> +>>> Can I import IPF 5.1.2 into FreeBSD under a different license from GPL? +>> I imported IPF into NetBSD under the same license that has had previously. +>> When I eventually update FreeBSD, I'll publish the code under the same +>> license that it has now. +>> + +[...] + +> +> When we import into FreeBSD we will not touch the IPFILTER.LICENSE file +> keeping the license as before in our tree. +> +> I don't mind doing the work if you won't mind. + +Not at all. + +Ok, I think there's one important thing for me to say here: + +I, Darren Reed, authorise Cy Schubert to use the IP-Filter source code from CVS on sourceforge in the FreeBSD source code tree using the existing license that currently covers IP-Filter in FreeBSD . + +I think something like that should cover you. + +Cheers, +Darren + From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:22:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 971AA385; Tue, 20 Aug 2013 13:22:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8350D2E7A; Tue, 20 Aug 2013 13:22:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KDMMUr024877; Tue, 20 Aug 2013 13:22:22 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KDMMO5024873; Tue, 20 Aug 2013 13:22:22 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201308201322.r7KDMMO5024873@svn.freebsd.org> From: Cy Schubert Date: Tue, 20 Aug 2013 13:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254561 - vendor-sys/ipfilter/dist/netinet X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:22:22 -0000 Author: cy Date: Tue Aug 20 13:22:21 2013 New Revision: 254561 URL: http://svnweb.freebsd.org/changeset/base/254561 Log: Revert to the previous IP-Filter license which was inadvertently overwritten by the new GPL license for IP-Filter. ` Document the FreeBSD use of IP-FIlter under the previously existing non-GPL license. Approved by: Darren Reed (IP-Filter author) glebius (mentor) Added: vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE.FreeBSD Modified: vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE Modified: vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE ============================================================================== --- vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE Tue Aug 20 13:19:35 2013 (r254560) +++ vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE Tue Aug 20 13:22:21 2013 (r254561) @@ -1,340 +1,29 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +/* + * Copyright (C) 1993-2001 by Darren Reed. + * + * The author accepts no responsibility for the use of this software and + * provides it on an ``as is'' basis without express or implied warranty. + * + * Redistribution and use, with or without modification, in source and binary + * forms, are permitted provided that this notice is preserved in its entirety + * and due credit is given to the original author and the contributors. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied, in part or in whole, and put under another distribution licence + * [including the GNU Public Licence.] + * + * 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. + * + * I hate legalese, don't you ? + */ Added: vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE.FreeBSD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE.FreeBSD Tue Aug 20 13:22:21 2013 (r254561) @@ -0,0 +1,83 @@ +Received: from slippy (localhost [127.0.0.1]) + by slippy.cwsent.com (8.14.7/8.14.7) with ESMTP id r68DreQv004291 + for ; Mon, 8 Jul 2013 06:53:40 -0700 (PDT) + (envelope-from Cy.Schubert@komquats.com) +X-Original-To: slippy +Delivered-To: slippy@komquats.com +Received: from cwfw [10.1.1.254] + by slippy with POP3 (fetchmail-6.3.22) + for (single-drop); Mon, 08 Jul 2013 06:53:40 -0700 (PDT) +Received: by spqr.komquats.com (Postfix, from userid 1000) + id 377821BC; Mon, 8 Jul 2013 06:53:38 -0700 (PDT) +X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on cwfw.cwsent.com +X-Spam-Level: +X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,MY_DSL,SMILEY + autolearn=no version=3.3.2 +X-Original-To: Cy.Schubert@komquats.com +Delivered-To: Cy.Schubert@komquats.com +Received: from mail.ipfilter.com.au (dsl-202-45-110-141-static.VIC.netspace.net.au [202.45.110.141]) + by spqr.komquats.com (Postfix) with ESMTP id C69AE18D + for ; Mon, 8 Jul 2013 06:53:31 -0700 (PDT) +Received: (from root@localhost) + by firewall.reed.wattle.id.au (8.12.10/8.11.0) id r68DrJF8001558; + Mon, 8 Jul 2013 23:53:19 +1000 (EST) +Message-ID: <51DAC488.1050700@reed.wattle.id.au> +Date: Mon, 08 Jul 2013 23:54:16 +1000 +From: Darren Reed +Reply-To: darrenr@reed.wattle.id.au +User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 +MIME-Version: 1.0 +To: Cy Schubert +CC: Gleb Smirnoff , Andre Oppermann , + Pedro Giffuni +Subject: Re: IP Filter 5.1.2 License +References: <201307011513.r61FD9IK005944@slippy.cwsent.com> +In-Reply-To: <201307011513.r61FD9IK005944@slippy.cwsent.com> +X-Enigmail-Version: 1.5.1 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +X-UIDL: NC"#!o_F!!BlL!!bL6!! + +On 2/07/2013 1:13 AM, Cy Schubert wrote: +> In message <51D19503.2090805@reed.wattle.id.au>, Darren Reed writes: +>> On 25/06/2013 11:03 AM, Cy Schubert wrote: +>>> Hi Darren, +>>> +>>> I'm not sure if you remember me or not but I'm a committer at the FreeBSD +>>> Project. I've been a long time IPF user, both under FreeBSD and Solaris. +>>> I've volunteered to maintain IP Filter in the src/ tree. I noticed that the +>> +>>> IP Filter license changed from the previous IP Filter license to GPLv2 +>>> somewhere between 4.1.34 and 4.1.35. I was planning on importing 5.1.2 +>>> however upon discovering it was GPL I decided to update the FreeBSD IPF +>>> from 4.1.28 to 4.1.34 until it was brought to my attention a few days ago +>>> that IPF 5.1.2 was imported into NetBSD. I'm not sure what kind of policy +>>> the NetBSD folks have toward GPL so I thought it best to ask you directly +>>> under what license you imported IPF into NetBSD? If I can I'd like to +>>> import 5.1.2. As IPF author and owner of the code, what are your thoughts. +>> +>>> Can I import IPF 5.1.2 into FreeBSD under a different license from GPL? +>> I imported IPF into NetBSD under the same license that has had previously. +>> When I eventually update FreeBSD, I'll publish the code under the same +>> license that it has now. +>> + +[...] + +> +> When we import into FreeBSD we will not touch the IPFILTER.LICENSE file +> keeping the license as before in our tree. +> +> I don't mind doing the work if you won't mind. + +Not at all. + +Ok, I think there's one important thing for me to say here: + +I, Darren Reed, authorise Cy Schubert to use the IP-Filter source code from CVS on sourceforge in the FreeBSD source code tree using the existing license that currently covers IP-Filter in FreeBSD . + +I think something like that should cover you. + +Cheers, +Darren + From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:24:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F352C6A8; Tue, 20 Aug 2013 13:24:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E03E32E9F; Tue, 20 Aug 2013 13:24:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KDOi3b025412; Tue, 20 Aug 2013 13:24:44 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KDOiOr025410; Tue, 20 Aug 2013 13:24:44 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201308201324.r7KDOiOr025410@svn.freebsd.org> From: Cy Schubert Date: Tue, 20 Aug 2013 13:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254562 - vendor-sys/ipfilter/dist/netinet X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:24:45 -0000 Author: cy Date: Tue Aug 20 13:24:44 2013 New Revision: 254562 URL: http://svnweb.freebsd.org/changeset/base/254562 Log: Add kernel sources from IP-Filter 5.1.2 to vendor-sys/ branch. Approved by: glebius (mentor) Added: vendor-sys/ipfilter/dist/netinet/ip_dstlist.c (contents, props changed) vendor-sys/ipfilter/dist/netinet/ip_dstlist.h vendor-sys/ipfilter/dist/netinet/ipf_rb.h vendor-sys/ipfilter/dist/netinet/radix_ipf.c (contents, props changed) vendor-sys/ipfilter/dist/netinet/radix_ipf.h Added: vendor-sys/ipfilter/dist/netinet/ip_dstlist.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ipfilter/dist/netinet/ip_dstlist.c Tue Aug 20 13:24:44 2013 (r254562) @@ -0,0 +1,1351 @@ +/* + * Copyright (C) 2012 by Darren Reed. + * + * See the IPFILTER.LICENCE file for details on licencing. + */ +#if defined(KERNEL) || defined(_KERNEL) +# undef KERNEL +# undef _KERNEL +# define KERNEL 1 +# define _KERNEL 1 +#endif +#if defined(__osf__) +# define _PROTO_NET_H_ +#endif +#include +#include +#include +#include +#if !defined(_KERNEL) && !defined(__KERNEL__) +# include +# include +# include +# define _KERNEL +# ifdef __OpenBSD__ +struct file; +# endif +# include +# undef _KERNEL +#else +# include +# if defined(NetBSD) && (__NetBSD_Version__ >= 104000000) +# include +# endif +#endif +#include +#if !defined(linux) +# include +#endif +#include +#if defined(_KERNEL) && (!defined(__SVR4) && !defined(__svr4__)) +# include +#endif +#if defined(__SVR4) || defined(__svr4__) +# include +# include +# ifdef _KERNEL +# include +# endif +# include +# include +#endif +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +# include +#endif + +#include +#include + +#include "netinet/ip_compat.h" +#include "netinet/ip_fil.h" +#include "netinet/ip_nat.h" +#include "netinet/ip_lookup.h" +#include "netinet/ip_dstlist.h" + +/* END OF INCLUDES */ + +#ifdef HAS_SYS_MD5_H +# include +#else +# include "md5.h" +#endif + +#if !defined(lint) +static const char rcsid[] = "@(#)$Id: ip_dstlist.c,v 1.13.2.12 2012/07/20 08:40:19 darren_r Exp $"; +#endif + +typedef struct ipf_dstl_softc_s { + ippool_dst_t *dstlist[LOOKUP_POOL_SZ]; + ippool_dst_t **tails[LOOKUP_POOL_SZ]; + ipf_dstl_stat_t stats; +} ipf_dstl_softc_t; + + +static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *)); +static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *)); +static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *)); +static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *)); +static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int, + void *, u_int)); +static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *, + iplookupflush_t *)); +static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int, + void *)); +static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *, + ipflookupiter_t *)); +static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *, + iplookupop_t *, int)); +static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *, + iplookupop_t *, int)); +static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *, + iplookupop_t *)); +static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *, + iplookupop_t *)); +static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *, + iplookupop_t *)); +static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *)); +static void *ipf_dstlist_table_find __P((void *, int, char *)); +static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *)); +static void ipf_dstlist_table_remove __P((ipf_main_softc_t *, + ipf_dstl_softc_t *, ippool_dst_t *)); +static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *, + ippool_dst_t *)); +static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *)); +static void *ipf_dstlist_select_ref __P((void *, int, char *)); +static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *)); +static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *)); +static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *)); +static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *)); + +ipf_lookup_t ipf_dstlist_backend = { + IPLT_DSTLIST, + ipf_dstlist_soft_create, + ipf_dstlist_soft_destroy, + ipf_dstlist_soft_init, + ipf_dstlist_soft_fini, + ipf_dstlist_addr_find, + ipf_dstlist_flush, + ipf_dstlist_iter_deref, + ipf_dstlist_iter_next, + ipf_dstlist_node_add, + ipf_dstlist_node_del, + ipf_dstlist_stats_get, + ipf_dstlist_table_add, + ipf_dstlist_table_del, + ipf_dstlist_table_deref, + ipf_dstlist_table_find, + ipf_dstlist_select_ref, + ipf_dstlist_select_node, + ipf_dstlist_expire, + ipf_dstlist_sync +}; + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_create */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* */ +/* Allocating a chunk of memory filled with 0's is enough for the current */ +/* soft context used with destination lists. */ +/* ------------------------------------------------------------------------ */ +static void * +ipf_dstlist_soft_create(softc) + ipf_main_softc_t *softc; +{ + ipf_dstl_softc_t *softd; + int i; + + KMALLOC(softd, ipf_dstl_softc_t *); + if (softd == NULL) { + IPFERROR(120028); + return NULL; + } + + bzero((char *)softd, sizeof(*softd)); + for (i = 0; i <= IPL_LOGMAX; i++) + softd->tails[i] = &softd->dstlist[i]; + + return softd; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_destroy */ +/* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* */ +/* For destination lists, the only thing we have to do when destroying the */ +/* soft context is free it! */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_soft_destroy(softc, arg) + ipf_main_softc_t *softc; + void *arg; +{ + ipf_dstl_softc_t *softd = arg; + + KFREE(softd); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_init */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* */ +/* There is currently no soft context for destination list management. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_soft_init(softc, arg) + ipf_main_softc_t *softc; + void *arg; +{ + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_fini */ +/* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* */ +/* There is currently no soft context for destination list management. */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_soft_fini(softc, arg) + ipf_main_softc_t *softc; + void *arg; +{ + ipf_dstl_softc_t *softd = arg; + int i; + + for (i = -1; i <= IPL_LOGMAX; i++) { + while (softd->dstlist[i + 1] != NULL) { + ipf_dstlist_table_remove(softc, softd, + softd->dstlist[i + 1]); + } + } + + ASSERT(softd->stats.ipls_numderefnodes == 0); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_addr_find */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg1(I) - pointer to local context to use */ +/* arg2(I) - pointer to local context to use */ +/* arg3(I) - pointer to local context to use */ +/* arg4(I) - pointer to local context to use */ +/* */ +/* There is currently no such thing as searching a destination list for an */ +/* address so this function becomes a no-op. Its presence is required as */ +/* ipf_lookup_res_name() stores the "addr_find" function pointer in the */ +/* pointer passed in to it as funcptr, although it could be a generic null- */ +/* op function rather than a specific one. */ +/* ------------------------------------------------------------------------ */ +/*ARGSUSED*/ +static int +ipf_dstlist_addr_find(softc, arg1, arg2, arg3, arg4) + ipf_main_softc_t *softc; + void *arg1, *arg3; + int arg2; + u_int arg4; +{ + return -1; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_flush */ +/* Returns: int - number of objects deleted */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* fop(I) - pointer to lookup flush operation data */ +/* */ +/* Flush all of the destination tables that match the data passed in with */ +/* the iplookupflush_t. There are two ways to match objects: the device for */ +/* which they are to be used with and their name. */ +/* ------------------------------------------------------------------------ */ +static size_t +ipf_dstlist_flush(softc, arg, fop) + ipf_main_softc_t *softc; + void *arg; + iplookupflush_t *fop; +{ + ipf_dstl_softc_t *softd = arg; + ippool_dst_t *node, *next; + int n, i; + + for (n = 0, i = -1; i <= IPL_LOGMAX; i++) { + if (fop->iplf_unit != IPLT_ALL && fop->iplf_unit != i) + continue; + for (node = softd->dstlist[i + 1]; node != NULL; node = next) { + next = node->ipld_next; + + if ((*fop->iplf_name != '\0') && + strncmp(fop->iplf_name, node->ipld_name, + FR_GROUPLEN)) + continue; + + ipf_dstlist_table_remove(softc, softd, node); + n++; + } + } + return n; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_iter_deref */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* otype(I) - type of data structure to iterate through */ +/* unit(I) - device we are working with */ +/* data(I) - address of object in kernel space */ +/* */ +/* This function is called when the iteration token is being free'd and is */ +/* responsible for dropping the reference count of the structure it points */ +/* to. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_iter_deref(softc, arg, otype, unit, data) + ipf_main_softc_t *softc; + void *arg; + int otype, unit; + void *data; +{ + if (data == NULL) { + IPFERROR(120001); + return EINVAL; + } + + if (unit < -1 || unit > IPL_LOGMAX) { + IPFERROR(120002); + return EINVAL; + } + + switch (otype) + { + case IPFLOOKUPITER_LIST : + ipf_dstlist_table_deref(softc, arg, (ippool_dst_t *)data); + break; + + case IPFLOOKUPITER_NODE : + ipf_dstlist_node_deref(arg, (ipf_dstnode_t *)data); + break; + } + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_iter_next */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* uid(I) - uid of process doing the ioctl */ +/* */ +/* This function is responsible for either selecting the next destination */ +/* list or node on a destination list to be returned as a user process */ +/* iterates through the list of destination lists or nodes. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_iter_next(softc, arg, token, iter) + ipf_main_softc_t *softc; + void *arg; + ipftoken_t *token; + ipflookupiter_t *iter; +{ + ipf_dstnode_t zn, *nextnode = NULL, *node = NULL; + ippool_dst_t zero, *next = NULL, *dsttab = NULL; + ipf_dstl_softc_t *softd = arg; + int err = 0; + void *hint; + + switch (iter->ili_otype) + { + case IPFLOOKUPITER_LIST : + dsttab = token->ipt_data; + if (dsttab == NULL) { + next = softd->dstlist[(int)iter->ili_unit + 1]; + } else { + next = dsttab->ipld_next; + } + + if (next != NULL) { + ATOMIC_INC32(next->ipld_ref); + token->ipt_data = next; + hint = next->ipld_next; + } else { + bzero((char *)&zero, sizeof(zero)); + next = &zero; + token->ipt_data = NULL; + hint = NULL; + } + break; + + case IPFLOOKUPITER_NODE : + node = token->ipt_data; + if (node == NULL) { + dsttab = ipf_dstlist_table_find(arg, iter->ili_unit, + iter->ili_name); + if (dsttab == NULL) { + IPFERROR(120004); + err = ESRCH; + nextnode = NULL; + } else { + if (dsttab->ipld_dests == NULL) + nextnode = NULL; + else + nextnode = *dsttab->ipld_dests; + dsttab = NULL; + } + } else { + nextnode = node->ipfd_next; + } + + if (nextnode != NULL) { + MUTEX_ENTER(&nextnode->ipfd_lock); + nextnode->ipfd_ref++; + MUTEX_EXIT(&nextnode->ipfd_lock); + token->ipt_data = nextnode; + hint = nextnode->ipfd_next; + } else { + bzero((char *)&zn, sizeof(zn)); + nextnode = &zn; + token->ipt_data = NULL; + hint = NULL; + } + break; + default : + IPFERROR(120003); + err = EINVAL; + break; + } + + if (err != 0) + return err; + + switch (iter->ili_otype) + { + case IPFLOOKUPITER_LIST : + if (dsttab != NULL) + ipf_dstlist_table_deref(softc, arg, dsttab); + err = COPYOUT(next, iter->ili_data, sizeof(*next)); + if (err != 0) { + IPFERROR(120005); + err = EFAULT; + } + break; + + case IPFLOOKUPITER_NODE : + if (node != NULL) + ipf_dstlist_node_deref(arg, node); + err = COPYOUT(nextnode, iter->ili_data, sizeof(*nextnode)); + if (err != 0) { + IPFERROR(120006); + err = EFAULT; + } + break; + } + + if (hint == NULL) + ipf_token_mark_complete(token); + + return err; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_add */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* uid(I) - uid of process doing the ioctl */ +/* Locks: WRITE(ipf_poolrw) */ +/* */ +/* Add a new node to a destination list. To do this, we only copy in the */ +/* frdest_t structure because that contains the only data required from the */ +/* application to create a new node. The frdest_t doesn't contain the name */ +/* itself. When loading filter rules, fd_name is a 'pointer' to the name. */ +/* In this case, the 'pointer' does not work, instead it is the length of */ +/* the name and the name is immediately following the frdest_t structure. */ +/* fd_name must include the trailing \0, so it should be strlen(str) + 1. */ +/* For simple sanity checking, an upper bound on the size of fd_name is */ +/* imposed - 128. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_node_add(softc, arg, op, uid) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; + int uid; +{ + ipf_dstl_softc_t *softd = arg; + ipf_dstnode_t *node, **nodes; + ippool_dst_t *d; + frdest_t dest; + int err; + + if (op->iplo_size < sizeof(frdest_t)) { + IPFERROR(120007); + return EINVAL; + } + + err = COPYIN(op->iplo_struct, &dest, sizeof(dest)); + if (err != 0) { + IPFERROR(120009); + return EFAULT; + } + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d == NULL) { + IPFERROR(120010); + return ESRCH; + } + + switch (dest.fd_addr.adf_family) + { + case AF_INET : + case AF_INET6 : + break; + default : + IPFERROR(120019); + return EINVAL; + } + + if (dest.fd_name < -1 || dest.fd_name > 128) { + IPFERROR(120018); + return EINVAL; + } + + KMALLOCS(node, ipf_dstnode_t *, sizeof(*node) + dest.fd_name); + if (node == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120008); + return ENOMEM; + } + bzero((char *)node, sizeof(*node) + dest.fd_name); + + bcopy(&dest, &node->ipfd_dest, sizeof(dest)); + node->ipfd_size = sizeof(*node) + dest.fd_name; + + if (dest.fd_name > 0) { + /* + * fd_name starts out as the length of the string to copy + * in (including \0) and ends up being the offset from + * fd_names (0). + */ + err = COPYIN((char *)op->iplo_struct + sizeof(dest), + node->ipfd_names, dest.fd_name); + if (err != 0) { + IPFERROR(120017); + KFREES(node, node->ipfd_size); + return EFAULT; + } + node->ipfd_dest.fd_name = 0; + } else { + node->ipfd_dest.fd_name = -1; + } + + if (d->ipld_nodes == d->ipld_maxnodes) { + KMALLOCS(nodes, ipf_dstnode_t **, + sizeof(*nodes) * (d->ipld_maxnodes + 1)); + if (nodes == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120022); + KFREES(node, node->ipfd_size); + return ENOMEM; + } + if (d->ipld_dests != NULL) { + bcopy(d->ipld_dests, nodes, + sizeof(*nodes) * d->ipld_maxnodes); + KFREES(d->ipld_dests, sizeof(*nodes) * d->ipld_nodes); + nodes[0]->ipfd_pnext = nodes; + } + d->ipld_dests = nodes; + d->ipld_maxnodes++; + } + d->ipld_dests[d->ipld_nodes] = node; + d->ipld_nodes++; + + if (d->ipld_nodes == 1) { + node->ipfd_pnext = d->ipld_dests; + } else if (d->ipld_nodes > 1) { + node->ipfd_pnext = &d->ipld_dests[d->ipld_nodes - 2]->ipfd_next; + } + *node->ipfd_pnext = node; + + MUTEX_INIT(&node->ipfd_lock, "ipf dst node lock"); + node->ipfd_uid = uid; + node->ipfd_ref = 1; + if (node->ipfd_dest.fd_name == 0) + (void) ipf_resolvedest(softc, node->ipfd_names, + &node->ipfd_dest, AF_INET); +#ifdef USE_INET6 + if (node->ipfd_dest.fd_name == 0 && + node->ipfd_dest.fd_ptr == (void *)-1) + (void) ipf_resolvedest(softc, node->ipfd_names, + &node->ipfd_dest, AF_INET6); +#endif + + softd->stats.ipls_numnodes++; + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_deref */ +/* Returns: int - 0 = success, else error */ +/* Parameters: arg(I) - pointer to local context to use */ +/* node(I) - pointer to destionation node to free */ +/* */ +/* Dereference the use count by one. If it drops to zero then we can assume */ +/* that it has been removed from any lists/tables and is ripe for freeing. */ +/* The pointer to context is required for the purpose of maintaining */ +/* statistics. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_node_deref(arg, node) + void *arg; + ipf_dstnode_t *node; +{ + ipf_dstl_softc_t *softd = arg; + int ref; + + MUTEX_ENTER(&node->ipfd_lock); + ref = --node->ipfd_ref; + MUTEX_EXIT(&node->ipfd_lock); + + if (ref > 0) + return 0; + + if ((node->ipfd_flags & IPDST_DELETE) != 0) + softd->stats.ipls_numderefnodes--; + MUTEX_DESTROY(&node->ipfd_lock); + KFREES(node, node->ipfd_size); + softd->stats.ipls_numnodes--; + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_del */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* uid(I) - uid of process doing the ioctl */ +/* */ +/* Look for a matching destination node on the named table and free it if */ +/* found. Because the name embedded in the frdest_t is variable in length, */ +/* it is necessary to allocate some memory locally, to complete this op. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_node_del(softc, arg, op, uid) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; + int uid; +{ + ipf_dstl_softc_t *softd = arg; + ipf_dstnode_t *node; + frdest_t frd, *temp; + ippool_dst_t *d; + size_t size; + int err; + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d == NULL) { + IPFERROR(120012); + return ESRCH; + } + + err = COPYIN(op->iplo_struct, &frd, sizeof(frd)); + if (err != 0) { + IPFERROR(120011); + return EFAULT; + } + + size = sizeof(*temp) + frd.fd_name; + KMALLOCS(temp, frdest_t *, size); + if (temp == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120026); + return ENOMEM; + } + + err = COPYIN(op->iplo_struct, temp, size); + if (err != 0) { + IPFERROR(120027); + return EFAULT; + } + + MUTEX_ENTER(&d->ipld_lock); + for (node = *d->ipld_dests; node != NULL; node = node->ipfd_next) { + if ((uid != 0) && (node->ipfd_uid != uid)) + continue; + if (node->ipfd_size != size) + continue; + if (!bcmp(&node->ipfd_dest.fd_ip6, &frd.fd_ip6, + size - offsetof(frdest_t, fd_ip6))) { + ipf_dstlist_node_free(softd, d, node); + MUTEX_EXIT(&d->ipld_lock); + KFREES(temp, size); + return 0; + } + } + MUTEX_EXIT(&d->ipld_lock); + KFREES(temp, size); + + return ESRCH; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_free */ +/* Returns: Nil */ +/* Parameters: softd(I) - pointer to the destination list context */ +/* d(I) - pointer to destination list */ +/* node(I) - pointer to node to free */ +/* Locks: MUTEX(ipld_lock) or WRITE(ipf_poolrw) */ +/* */ +/* Free the destination node by first removing it from any lists and then */ +/* checking if this was the last reference held to the object. While the */ +/* array of pointers to nodes is compacted, its size isn't reduced (by way */ +/* of allocating a new smaller one and copying) because the belief is that */ +/* it is likely the array will again reach that size. */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_node_free(softd, d, node) + ipf_dstl_softc_t *softd; + ippool_dst_t *d; + ipf_dstnode_t *node; +{ + int i; + + /* + * Compact the array of pointers to nodes. + */ + for (i = 0; i < d->ipld_nodes; i++) + if (d->ipld_dests[i] == node) + break; + if (d->ipld_nodes - i > 1) { + bcopy(&d->ipld_dests[i + 1], &d->ipld_dests[i], + sizeof(*d->ipld_dests) * (d->ipld_nodes - i - 1)); + } + d->ipld_nodes--; + + if (node->ipfd_pnext != NULL) + *node->ipfd_pnext = node->ipfd_next; + if (node->ipfd_next != NULL) + node->ipfd_next->ipfd_pnext = node->ipfd_pnext; + node->ipfd_pnext = NULL; + node->ipfd_next = NULL; + + if ((node->ipfd_flags & IPDST_DELETE) == 0) { + softd->stats.ipls_numderefnodes++; + node->ipfd_flags |= IPDST_DELETE; + } + + ipf_dstlist_node_deref(softd, node); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_stats_get */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Return the current statistics for destination lists. This may be for all */ +/* of them or just information pertaining to a particular table. */ +/* ------------------------------------------------------------------------ */ +/*ARGSUSED*/ +static int +ipf_dstlist_stats_get(softc, arg, op) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; +{ + ipf_dstl_softc_t *softd = arg; + ipf_dstl_stat_t stats; + int unit, i, err = 0; + + if (op->iplo_size != sizeof(ipf_dstl_stat_t)) { + IPFERROR(120023); + return EINVAL; + } + + stats = softd->stats; + unit = op->iplo_unit; + if (unit == IPL_LOGALL) { + for (i = 0; i <= IPL_LOGMAX; i++) + stats.ipls_list[i] = softd->dstlist[i]; + } else if (unit >= 0 && unit <= IPL_LOGMAX) { + void *ptr; + + if (op->iplo_name[0] != '\0') + ptr = ipf_dstlist_table_find(softd, unit, + op->iplo_name); + else + ptr = softd->dstlist[unit + 1]; + stats.ipls_list[unit] = ptr; + } else { + IPFERROR(120024); + err = EINVAL; + } + + if (err == 0) { + err = COPYOUT(&stats, op->iplo_struct, sizeof(stats)); + if (err != 0) { + IPFERROR(120025); + return EFAULT; + } + } + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_add */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Add a new destination table to the list of those available for the given */ +/* device. Because we seldom operate on these objects (find/add/delete), */ +/* they are just kept in a simple linked list. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_table_add(softc, arg, op) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; +{ + ipf_dstl_softc_t *softd = arg; + ippool_dst_t user, *d, *new; + int unit, err; + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d != NULL) { + IPFERROR(120013); + return EEXIST; + } + + err = COPYIN(op->iplo_struct, &user, sizeof(user)); + if (err != 0) { + IPFERROR(120021); + return EFAULT; + } + + KMALLOC(new, ippool_dst_t *); + if (new == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120014); + return ENOMEM; + } + bzero((char *)new, sizeof(*new)); + + MUTEX_INIT(&new->ipld_lock, "ipf dst table lock"); + + strncpy(new->ipld_name, op->iplo_name, FR_GROUPLEN); + unit = op->iplo_unit; + new->ipld_unit = unit; + new->ipld_policy = user.ipld_policy; + new->ipld_seed = ipf_random(); + new->ipld_ref = 1; + + new->ipld_pnext = softd->tails[unit + 1]; + *softd->tails[unit + 1] = new; + softd->tails[unit + 1] = &new->ipld_next; + softd->stats.ipls_numlists++; + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_del */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Find a named destinstion list table and delete it. If there are other */ +/* references to it, the caller isn't told. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_table_del(softc, arg, op) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; +{ + ippool_dst_t *d; + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d == NULL) { + IPFERROR(120015); + return ESRCH; + } + + if (d->ipld_dests != NULL) { + IPFERROR(120016); + return EBUSY; + } + + ipf_dstlist_table_remove(softc, arg, d); + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_remove */ +/* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* softd(I) - pointer to the destination list context */ +/* d(I) - pointer to destination list */ +/* */ +/* Remove a given destination list from existance. While the IPDST_DELETE */ +/* flag is set every time we call this function and the reference count is */ +/* non-zero, the "numdereflists" counter is always incremented because the */ +/* decision about whether it will be freed or not is not made here. This */ +/* means that the only action the code can take here is to treat it as if */ +/* it will become a detached. */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_table_remove(softc, softd, d) + ipf_main_softc_t *softc; + ipf_dstl_softc_t *softd; + ippool_dst_t *d; +{ + + if (softd->tails[d->ipld_unit + 1] == &d->ipld_next) + softd->tails[d->ipld_unit + 1] = d->ipld_pnext; + + if (d->ipld_pnext != NULL) + *d->ipld_pnext = d->ipld_next; + if (d->ipld_next != NULL) + d->ipld_next->ipld_pnext = d->ipld_pnext; + d->ipld_pnext = NULL; + d->ipld_next = NULL; + + ipf_dstlist_table_clearnodes(softd, d); + + softd->stats.ipls_numdereflists++; + d->ipld_flags |= IPDST_DELETE; + + ipf_dstlist_table_deref(softc, softd, d); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_free */ +/* Returns: Nil */ +/* Parameters: softd(I) - pointer to the destination list context */ +/* d(I) - pointer to destination list */ +/* */ +/* Free up a destination list data structure and any other memory that was */ +/* directly allocated as part of creating it. Individual destination list */ +/* nodes are not freed. It is assumed the caller will have already emptied */ +/* the destination list. */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_table_free(softd, d) + ipf_dstl_softc_t *softd; + ippool_dst_t *d; +{ + MUTEX_DESTROY(&d->ipld_lock); + + if ((d->ipld_flags & IPDST_DELETE) != 0) + softd->stats.ipls_numdereflists--; + softd->stats.ipls_numlists--; + + if (d->ipld_dests != NULL) { + KFREES(d->ipld_dests, + d->ipld_maxnodes * sizeof(*d->ipld_dests)); + } + + KFREE(d); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_deref */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Drops the reference count on a destination list table object and free's */ +/* it if 0 has been reached. */ +/* ------------------------------------------------------------------------ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:38:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6529BCD0; Tue, 20 Aug 2013 13:38:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51FE72F82; Tue, 20 Aug 2013 13:38:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KDcfkU030634; Tue, 20 Aug 2013 13:38:41 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KDcfno030633; Tue, 20 Aug 2013 13:38:41 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201308201338.r7KDcfno030633@svn.freebsd.org> From: Cy Schubert Date: Tue, 20 Aug 2013 13:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254563 - vendor/ipfilter/5.1.2 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:38:41 -0000 Author: cy Date: Tue Aug 20 13:38:40 2013 New Revision: 254563 URL: http://svnweb.freebsd.org/changeset/base/254563 Log: Tag authorization to use IP-Filter under old license. Approved by: glebius (mentor) Added: vendor/ipfilter/5.1.2/IPFILTER.LICENCE.FreeBSD - copied unchanged from r254562, vendor/ipfilter/dist/IPFILTER.LICENCE.FreeBSD Copied: vendor/ipfilter/5.1.2/IPFILTER.LICENCE.FreeBSD (from r254562, vendor/ipfilter/dist/IPFILTER.LICENCE.FreeBSD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/ipfilter/5.1.2/IPFILTER.LICENCE.FreeBSD Tue Aug 20 13:38:40 2013 (r254563, copy of r254562, vendor/ipfilter/dist/IPFILTER.LICENCE.FreeBSD) @@ -0,0 +1,83 @@ +Received: from slippy (localhost [127.0.0.1]) + by slippy.cwsent.com (8.14.7/8.14.7) with ESMTP id r68DreQv004291 + for ; Mon, 8 Jul 2013 06:53:40 -0700 (PDT) + (envelope-from Cy.Schubert@komquats.com) +X-Original-To: slippy +Delivered-To: slippy@komquats.com +Received: from cwfw [10.1.1.254] + by slippy with POP3 (fetchmail-6.3.22) + for (single-drop); Mon, 08 Jul 2013 06:53:40 -0700 (PDT) +Received: by spqr.komquats.com (Postfix, from userid 1000) + id 377821BC; Mon, 8 Jul 2013 06:53:38 -0700 (PDT) +X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on cwfw.cwsent.com +X-Spam-Level: +X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,MY_DSL,SMILEY + autolearn=no version=3.3.2 +X-Original-To: Cy.Schubert@komquats.com +Delivered-To: Cy.Schubert@komquats.com +Received: from mail.ipfilter.com.au (dsl-202-45-110-141-static.VIC.netspace.net.au [202.45.110.141]) + by spqr.komquats.com (Postfix) with ESMTP id C69AE18D + for ; Mon, 8 Jul 2013 06:53:31 -0700 (PDT) +Received: (from root@localhost) + by firewall.reed.wattle.id.au (8.12.10/8.11.0) id r68DrJF8001558; + Mon, 8 Jul 2013 23:53:19 +1000 (EST) +Message-ID: <51DAC488.1050700@reed.wattle.id.au> +Date: Mon, 08 Jul 2013 23:54:16 +1000 +From: Darren Reed +Reply-To: darrenr@reed.wattle.id.au +User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 +MIME-Version: 1.0 +To: Cy Schubert +CC: Gleb Smirnoff , Andre Oppermann , + Pedro Giffuni +Subject: Re: IP Filter 5.1.2 License +References: <201307011513.r61FD9IK005944@slippy.cwsent.com> +In-Reply-To: <201307011513.r61FD9IK005944@slippy.cwsent.com> +X-Enigmail-Version: 1.5.1 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +X-UIDL: NC"#!o_F!!BlL!!bL6!! + +On 2/07/2013 1:13 AM, Cy Schubert wrote: +> In message <51D19503.2090805@reed.wattle.id.au>, Darren Reed writes: +>> On 25/06/2013 11:03 AM, Cy Schubert wrote: +>>> Hi Darren, +>>> +>>> I'm not sure if you remember me or not but I'm a committer at the FreeBSD +>>> Project. I've been a long time IPF user, both under FreeBSD and Solaris. +>>> I've volunteered to maintain IP Filter in the src/ tree. I noticed that the +>> +>>> IP Filter license changed from the previous IP Filter license to GPLv2 +>>> somewhere between 4.1.34 and 4.1.35. I was planning on importing 5.1.2 +>>> however upon discovering it was GPL I decided to update the FreeBSD IPF +>>> from 4.1.28 to 4.1.34 until it was brought to my attention a few days ago +>>> that IPF 5.1.2 was imported into NetBSD. I'm not sure what kind of policy +>>> the NetBSD folks have toward GPL so I thought it best to ask you directly +>>> under what license you imported IPF into NetBSD? If I can I'd like to +>>> import 5.1.2. As IPF author and owner of the code, what are your thoughts. +>> +>>> Can I import IPF 5.1.2 into FreeBSD under a different license from GPL? +>> I imported IPF into NetBSD under the same license that has had previously. +>> When I eventually update FreeBSD, I'll publish the code under the same +>> license that it has now. +>> + +[...] + +> +> When we import into FreeBSD we will not touch the IPFILTER.LICENSE file +> keeping the license as before in our tree. +> +> I don't mind doing the work if you won't mind. + +Not at all. + +Ok, I think there's one important thing for me to say here: + +I, Darren Reed, authorise Cy Schubert to use the IP-Filter source code from CVS on sourceforge in the FreeBSD source code tree using the existing license that currently covers IP-Filter in FreeBSD . + +I think something like that should cover you. + +Cheers, +Darren + From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:50:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56D2D40D; Tue, 20 Aug 2013 13:50:37 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42BFF2096; Tue, 20 Aug 2013 13:50:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KDobaE037827; Tue, 20 Aug 2013 13:50:37 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KDobMn037824; Tue, 20 Aug 2013 13:50:37 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201308201350.r7KDobMn037824@svn.freebsd.org> From: Cy Schubert Date: Tue, 20 Aug 2013 13:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254564 - vendor-sys/ipfilter/5-1-2/netinet X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:50:37 -0000 Author: cy Date: Tue Aug 20 13:50:36 2013 New Revision: 254564 URL: http://svnweb.freebsd.org/changeset/base/254564 Log: Tag authorization to use IP-Filter under old license. Tag additional kernel sources from IP-Filter 5.1.2 tarball. Approved by: glebius Added: vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE.FreeBSD - copied unchanged from r254563, vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE.FreeBSD vendor-sys/ipfilter/5-1-2/netinet/ip_dstlist.c - copied unchanged from r254563, vendor-sys/ipfilter/dist/netinet/ip_dstlist.c vendor-sys/ipfilter/5-1-2/netinet/ip_dstlist.h - copied unchanged from r254563, vendor-sys/ipfilter/dist/netinet/ip_dstlist.h vendor-sys/ipfilter/5-1-2/netinet/ipf_rb.h - copied unchanged from r254563, vendor-sys/ipfilter/dist/netinet/ipf_rb.h vendor-sys/ipfilter/5-1-2/netinet/radix_ipf.c - copied unchanged from r254563, vendor-sys/ipfilter/dist/netinet/radix_ipf.c vendor-sys/ipfilter/5-1-2/netinet/radix_ipf.h - copied unchanged from r254563, vendor-sys/ipfilter/dist/netinet/radix_ipf.h Copied: vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE.FreeBSD (from r254563, vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE.FreeBSD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE.FreeBSD Tue Aug 20 13:50:36 2013 (r254564, copy of r254563, vendor-sys/ipfilter/dist/netinet/IPFILTER.LICENCE.FreeBSD) @@ -0,0 +1,83 @@ +Received: from slippy (localhost [127.0.0.1]) + by slippy.cwsent.com (8.14.7/8.14.7) with ESMTP id r68DreQv004291 + for ; Mon, 8 Jul 2013 06:53:40 -0700 (PDT) + (envelope-from Cy.Schubert@komquats.com) +X-Original-To: slippy +Delivered-To: slippy@komquats.com +Received: from cwfw [10.1.1.254] + by slippy with POP3 (fetchmail-6.3.22) + for (single-drop); Mon, 08 Jul 2013 06:53:40 -0700 (PDT) +Received: by spqr.komquats.com (Postfix, from userid 1000) + id 377821BC; Mon, 8 Jul 2013 06:53:38 -0700 (PDT) +X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on cwfw.cwsent.com +X-Spam-Level: +X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,MY_DSL,SMILEY + autolearn=no version=3.3.2 +X-Original-To: Cy.Schubert@komquats.com +Delivered-To: Cy.Schubert@komquats.com +Received: from mail.ipfilter.com.au (dsl-202-45-110-141-static.VIC.netspace.net.au [202.45.110.141]) + by spqr.komquats.com (Postfix) with ESMTP id C69AE18D + for ; Mon, 8 Jul 2013 06:53:31 -0700 (PDT) +Received: (from root@localhost) + by firewall.reed.wattle.id.au (8.12.10/8.11.0) id r68DrJF8001558; + Mon, 8 Jul 2013 23:53:19 +1000 (EST) +Message-ID: <51DAC488.1050700@reed.wattle.id.au> +Date: Mon, 08 Jul 2013 23:54:16 +1000 +From: Darren Reed +Reply-To: darrenr@reed.wattle.id.au +User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 +MIME-Version: 1.0 +To: Cy Schubert +CC: Gleb Smirnoff , Andre Oppermann , + Pedro Giffuni +Subject: Re: IP Filter 5.1.2 License +References: <201307011513.r61FD9IK005944@slippy.cwsent.com> +In-Reply-To: <201307011513.r61FD9IK005944@slippy.cwsent.com> +X-Enigmail-Version: 1.5.1 +Content-Type: text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: 7bit +X-UIDL: NC"#!o_F!!BlL!!bL6!! + +On 2/07/2013 1:13 AM, Cy Schubert wrote: +> In message <51D19503.2090805@reed.wattle.id.au>, Darren Reed writes: +>> On 25/06/2013 11:03 AM, Cy Schubert wrote: +>>> Hi Darren, +>>> +>>> I'm not sure if you remember me or not but I'm a committer at the FreeBSD +>>> Project. I've been a long time IPF user, both under FreeBSD and Solaris. +>>> I've volunteered to maintain IP Filter in the src/ tree. I noticed that the +>> +>>> IP Filter license changed from the previous IP Filter license to GPLv2 +>>> somewhere between 4.1.34 and 4.1.35. I was planning on importing 5.1.2 +>>> however upon discovering it was GPL I decided to update the FreeBSD IPF +>>> from 4.1.28 to 4.1.34 until it was brought to my attention a few days ago +>>> that IPF 5.1.2 was imported into NetBSD. I'm not sure what kind of policy +>>> the NetBSD folks have toward GPL so I thought it best to ask you directly +>>> under what license you imported IPF into NetBSD? If I can I'd like to +>>> import 5.1.2. As IPF author and owner of the code, what are your thoughts. +>> +>>> Can I import IPF 5.1.2 into FreeBSD under a different license from GPL? +>> I imported IPF into NetBSD under the same license that has had previously. +>> When I eventually update FreeBSD, I'll publish the code under the same +>> license that it has now. +>> + +[...] + +> +> When we import into FreeBSD we will not touch the IPFILTER.LICENSE file +> keeping the license as before in our tree. +> +> I don't mind doing the work if you won't mind. + +Not at all. + +Ok, I think there's one important thing for me to say here: + +I, Darren Reed, authorise Cy Schubert to use the IP-Filter source code from CVS on sourceforge in the FreeBSD source code tree using the existing license that currently covers IP-Filter in FreeBSD . + +I think something like that should cover you. + +Cheers, +Darren + Copied: vendor-sys/ipfilter/5-1-2/netinet/ip_dstlist.c (from r254563, vendor-sys/ipfilter/dist/netinet/ip_dstlist.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ipfilter/5-1-2/netinet/ip_dstlist.c Tue Aug 20 13:50:36 2013 (r254564, copy of r254563, vendor-sys/ipfilter/dist/netinet/ip_dstlist.c) @@ -0,0 +1,1351 @@ +/* + * Copyright (C) 2012 by Darren Reed. + * + * See the IPFILTER.LICENCE file for details on licencing. + */ +#if defined(KERNEL) || defined(_KERNEL) +# undef KERNEL +# undef _KERNEL +# define KERNEL 1 +# define _KERNEL 1 +#endif +#if defined(__osf__) +# define _PROTO_NET_H_ +#endif +#include +#include +#include +#include +#if !defined(_KERNEL) && !defined(__KERNEL__) +# include +# include +# include +# define _KERNEL +# ifdef __OpenBSD__ +struct file; +# endif +# include +# undef _KERNEL +#else +# include +# if defined(NetBSD) && (__NetBSD_Version__ >= 104000000) +# include +# endif +#endif +#include +#if !defined(linux) +# include +#endif +#include +#if defined(_KERNEL) && (!defined(__SVR4) && !defined(__svr4__)) +# include +#endif +#if defined(__SVR4) || defined(__svr4__) +# include +# include +# ifdef _KERNEL +# include +# endif +# include +# include +#endif +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +# include +#endif + +#include +#include + +#include "netinet/ip_compat.h" +#include "netinet/ip_fil.h" +#include "netinet/ip_nat.h" +#include "netinet/ip_lookup.h" +#include "netinet/ip_dstlist.h" + +/* END OF INCLUDES */ + +#ifdef HAS_SYS_MD5_H +# include +#else +# include "md5.h" +#endif + +#if !defined(lint) +static const char rcsid[] = "@(#)$Id: ip_dstlist.c,v 1.13.2.12 2012/07/20 08:40:19 darren_r Exp $"; +#endif + +typedef struct ipf_dstl_softc_s { + ippool_dst_t *dstlist[LOOKUP_POOL_SZ]; + ippool_dst_t **tails[LOOKUP_POOL_SZ]; + ipf_dstl_stat_t stats; +} ipf_dstl_softc_t; + + +static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *)); +static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *)); +static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *)); +static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *)); +static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int, + void *, u_int)); +static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *, + iplookupflush_t *)); +static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int, + void *)); +static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *, + ipflookupiter_t *)); +static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *, + iplookupop_t *, int)); +static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *, + iplookupop_t *, int)); +static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *, + iplookupop_t *)); +static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *, + iplookupop_t *)); +static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *, + iplookupop_t *)); +static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *)); +static void *ipf_dstlist_table_find __P((void *, int, char *)); +static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *)); +static void ipf_dstlist_table_remove __P((ipf_main_softc_t *, + ipf_dstl_softc_t *, ippool_dst_t *)); +static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *, + ippool_dst_t *)); +static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *)); +static void *ipf_dstlist_select_ref __P((void *, int, char *)); +static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *)); +static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *)); +static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *)); +static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *)); + +ipf_lookup_t ipf_dstlist_backend = { + IPLT_DSTLIST, + ipf_dstlist_soft_create, + ipf_dstlist_soft_destroy, + ipf_dstlist_soft_init, + ipf_dstlist_soft_fini, + ipf_dstlist_addr_find, + ipf_dstlist_flush, + ipf_dstlist_iter_deref, + ipf_dstlist_iter_next, + ipf_dstlist_node_add, + ipf_dstlist_node_del, + ipf_dstlist_stats_get, + ipf_dstlist_table_add, + ipf_dstlist_table_del, + ipf_dstlist_table_deref, + ipf_dstlist_table_find, + ipf_dstlist_select_ref, + ipf_dstlist_select_node, + ipf_dstlist_expire, + ipf_dstlist_sync +}; + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_create */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* */ +/* Allocating a chunk of memory filled with 0's is enough for the current */ +/* soft context used with destination lists. */ +/* ------------------------------------------------------------------------ */ +static void * +ipf_dstlist_soft_create(softc) + ipf_main_softc_t *softc; +{ + ipf_dstl_softc_t *softd; + int i; + + KMALLOC(softd, ipf_dstl_softc_t *); + if (softd == NULL) { + IPFERROR(120028); + return NULL; + } + + bzero((char *)softd, sizeof(*softd)); + for (i = 0; i <= IPL_LOGMAX; i++) + softd->tails[i] = &softd->dstlist[i]; + + return softd; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_destroy */ +/* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* */ +/* For destination lists, the only thing we have to do when destroying the */ +/* soft context is free it! */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_soft_destroy(softc, arg) + ipf_main_softc_t *softc; + void *arg; +{ + ipf_dstl_softc_t *softd = arg; + + KFREE(softd); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_init */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* */ +/* There is currently no soft context for destination list management. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_soft_init(softc, arg) + ipf_main_softc_t *softc; + void *arg; +{ + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_soft_fini */ +/* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* */ +/* There is currently no soft context for destination list management. */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_soft_fini(softc, arg) + ipf_main_softc_t *softc; + void *arg; +{ + ipf_dstl_softc_t *softd = arg; + int i; + + for (i = -1; i <= IPL_LOGMAX; i++) { + while (softd->dstlist[i + 1] != NULL) { + ipf_dstlist_table_remove(softc, softd, + softd->dstlist[i + 1]); + } + } + + ASSERT(softd->stats.ipls_numderefnodes == 0); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_addr_find */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg1(I) - pointer to local context to use */ +/* arg2(I) - pointer to local context to use */ +/* arg3(I) - pointer to local context to use */ +/* arg4(I) - pointer to local context to use */ +/* */ +/* There is currently no such thing as searching a destination list for an */ +/* address so this function becomes a no-op. Its presence is required as */ +/* ipf_lookup_res_name() stores the "addr_find" function pointer in the */ +/* pointer passed in to it as funcptr, although it could be a generic null- */ +/* op function rather than a specific one. */ +/* ------------------------------------------------------------------------ */ +/*ARGSUSED*/ +static int +ipf_dstlist_addr_find(softc, arg1, arg2, arg3, arg4) + ipf_main_softc_t *softc; + void *arg1, *arg3; + int arg2; + u_int arg4; +{ + return -1; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_flush */ +/* Returns: int - number of objects deleted */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* fop(I) - pointer to lookup flush operation data */ +/* */ +/* Flush all of the destination tables that match the data passed in with */ +/* the iplookupflush_t. There are two ways to match objects: the device for */ +/* which they are to be used with and their name. */ +/* ------------------------------------------------------------------------ */ +static size_t +ipf_dstlist_flush(softc, arg, fop) + ipf_main_softc_t *softc; + void *arg; + iplookupflush_t *fop; +{ + ipf_dstl_softc_t *softd = arg; + ippool_dst_t *node, *next; + int n, i; + + for (n = 0, i = -1; i <= IPL_LOGMAX; i++) { + if (fop->iplf_unit != IPLT_ALL && fop->iplf_unit != i) + continue; + for (node = softd->dstlist[i + 1]; node != NULL; node = next) { + next = node->ipld_next; + + if ((*fop->iplf_name != '\0') && + strncmp(fop->iplf_name, node->ipld_name, + FR_GROUPLEN)) + continue; + + ipf_dstlist_table_remove(softc, softd, node); + n++; + } + } + return n; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_iter_deref */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* otype(I) - type of data structure to iterate through */ +/* unit(I) - device we are working with */ +/* data(I) - address of object in kernel space */ +/* */ +/* This function is called when the iteration token is being free'd and is */ +/* responsible for dropping the reference count of the structure it points */ +/* to. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_iter_deref(softc, arg, otype, unit, data) + ipf_main_softc_t *softc; + void *arg; + int otype, unit; + void *data; +{ + if (data == NULL) { + IPFERROR(120001); + return EINVAL; + } + + if (unit < -1 || unit > IPL_LOGMAX) { + IPFERROR(120002); + return EINVAL; + } + + switch (otype) + { + case IPFLOOKUPITER_LIST : + ipf_dstlist_table_deref(softc, arg, (ippool_dst_t *)data); + break; + + case IPFLOOKUPITER_NODE : + ipf_dstlist_node_deref(arg, (ipf_dstnode_t *)data); + break; + } + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_iter_next */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* uid(I) - uid of process doing the ioctl */ +/* */ +/* This function is responsible for either selecting the next destination */ +/* list or node on a destination list to be returned as a user process */ +/* iterates through the list of destination lists or nodes. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_iter_next(softc, arg, token, iter) + ipf_main_softc_t *softc; + void *arg; + ipftoken_t *token; + ipflookupiter_t *iter; +{ + ipf_dstnode_t zn, *nextnode = NULL, *node = NULL; + ippool_dst_t zero, *next = NULL, *dsttab = NULL; + ipf_dstl_softc_t *softd = arg; + int err = 0; + void *hint; + + switch (iter->ili_otype) + { + case IPFLOOKUPITER_LIST : + dsttab = token->ipt_data; + if (dsttab == NULL) { + next = softd->dstlist[(int)iter->ili_unit + 1]; + } else { + next = dsttab->ipld_next; + } + + if (next != NULL) { + ATOMIC_INC32(next->ipld_ref); + token->ipt_data = next; + hint = next->ipld_next; + } else { + bzero((char *)&zero, sizeof(zero)); + next = &zero; + token->ipt_data = NULL; + hint = NULL; + } + break; + + case IPFLOOKUPITER_NODE : + node = token->ipt_data; + if (node == NULL) { + dsttab = ipf_dstlist_table_find(arg, iter->ili_unit, + iter->ili_name); + if (dsttab == NULL) { + IPFERROR(120004); + err = ESRCH; + nextnode = NULL; + } else { + if (dsttab->ipld_dests == NULL) + nextnode = NULL; + else + nextnode = *dsttab->ipld_dests; + dsttab = NULL; + } + } else { + nextnode = node->ipfd_next; + } + + if (nextnode != NULL) { + MUTEX_ENTER(&nextnode->ipfd_lock); + nextnode->ipfd_ref++; + MUTEX_EXIT(&nextnode->ipfd_lock); + token->ipt_data = nextnode; + hint = nextnode->ipfd_next; + } else { + bzero((char *)&zn, sizeof(zn)); + nextnode = &zn; + token->ipt_data = NULL; + hint = NULL; + } + break; + default : + IPFERROR(120003); + err = EINVAL; + break; + } + + if (err != 0) + return err; + + switch (iter->ili_otype) + { + case IPFLOOKUPITER_LIST : + if (dsttab != NULL) + ipf_dstlist_table_deref(softc, arg, dsttab); + err = COPYOUT(next, iter->ili_data, sizeof(*next)); + if (err != 0) { + IPFERROR(120005); + err = EFAULT; + } + break; + + case IPFLOOKUPITER_NODE : + if (node != NULL) + ipf_dstlist_node_deref(arg, node); + err = COPYOUT(nextnode, iter->ili_data, sizeof(*nextnode)); + if (err != 0) { + IPFERROR(120006); + err = EFAULT; + } + break; + } + + if (hint == NULL) + ipf_token_mark_complete(token); + + return err; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_add */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* uid(I) - uid of process doing the ioctl */ +/* Locks: WRITE(ipf_poolrw) */ +/* */ +/* Add a new node to a destination list. To do this, we only copy in the */ +/* frdest_t structure because that contains the only data required from the */ +/* application to create a new node. The frdest_t doesn't contain the name */ +/* itself. When loading filter rules, fd_name is a 'pointer' to the name. */ +/* In this case, the 'pointer' does not work, instead it is the length of */ +/* the name and the name is immediately following the frdest_t structure. */ +/* fd_name must include the trailing \0, so it should be strlen(str) + 1. */ +/* For simple sanity checking, an upper bound on the size of fd_name is */ +/* imposed - 128. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_node_add(softc, arg, op, uid) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; + int uid; +{ + ipf_dstl_softc_t *softd = arg; + ipf_dstnode_t *node, **nodes; + ippool_dst_t *d; + frdest_t dest; + int err; + + if (op->iplo_size < sizeof(frdest_t)) { + IPFERROR(120007); + return EINVAL; + } + + err = COPYIN(op->iplo_struct, &dest, sizeof(dest)); + if (err != 0) { + IPFERROR(120009); + return EFAULT; + } + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d == NULL) { + IPFERROR(120010); + return ESRCH; + } + + switch (dest.fd_addr.adf_family) + { + case AF_INET : + case AF_INET6 : + break; + default : + IPFERROR(120019); + return EINVAL; + } + + if (dest.fd_name < -1 || dest.fd_name > 128) { + IPFERROR(120018); + return EINVAL; + } + + KMALLOCS(node, ipf_dstnode_t *, sizeof(*node) + dest.fd_name); + if (node == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120008); + return ENOMEM; + } + bzero((char *)node, sizeof(*node) + dest.fd_name); + + bcopy(&dest, &node->ipfd_dest, sizeof(dest)); + node->ipfd_size = sizeof(*node) + dest.fd_name; + + if (dest.fd_name > 0) { + /* + * fd_name starts out as the length of the string to copy + * in (including \0) and ends up being the offset from + * fd_names (0). + */ + err = COPYIN((char *)op->iplo_struct + sizeof(dest), + node->ipfd_names, dest.fd_name); + if (err != 0) { + IPFERROR(120017); + KFREES(node, node->ipfd_size); + return EFAULT; + } + node->ipfd_dest.fd_name = 0; + } else { + node->ipfd_dest.fd_name = -1; + } + + if (d->ipld_nodes == d->ipld_maxnodes) { + KMALLOCS(nodes, ipf_dstnode_t **, + sizeof(*nodes) * (d->ipld_maxnodes + 1)); + if (nodes == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120022); + KFREES(node, node->ipfd_size); + return ENOMEM; + } + if (d->ipld_dests != NULL) { + bcopy(d->ipld_dests, nodes, + sizeof(*nodes) * d->ipld_maxnodes); + KFREES(d->ipld_dests, sizeof(*nodes) * d->ipld_nodes); + nodes[0]->ipfd_pnext = nodes; + } + d->ipld_dests = nodes; + d->ipld_maxnodes++; + } + d->ipld_dests[d->ipld_nodes] = node; + d->ipld_nodes++; + + if (d->ipld_nodes == 1) { + node->ipfd_pnext = d->ipld_dests; + } else if (d->ipld_nodes > 1) { + node->ipfd_pnext = &d->ipld_dests[d->ipld_nodes - 2]->ipfd_next; + } + *node->ipfd_pnext = node; + + MUTEX_INIT(&node->ipfd_lock, "ipf dst node lock"); + node->ipfd_uid = uid; + node->ipfd_ref = 1; + if (node->ipfd_dest.fd_name == 0) + (void) ipf_resolvedest(softc, node->ipfd_names, + &node->ipfd_dest, AF_INET); +#ifdef USE_INET6 + if (node->ipfd_dest.fd_name == 0 && + node->ipfd_dest.fd_ptr == (void *)-1) + (void) ipf_resolvedest(softc, node->ipfd_names, + &node->ipfd_dest, AF_INET6); +#endif + + softd->stats.ipls_numnodes++; + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_deref */ +/* Returns: int - 0 = success, else error */ +/* Parameters: arg(I) - pointer to local context to use */ +/* node(I) - pointer to destionation node to free */ +/* */ +/* Dereference the use count by one. If it drops to zero then we can assume */ +/* that it has been removed from any lists/tables and is ripe for freeing. */ +/* The pointer to context is required for the purpose of maintaining */ +/* statistics. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_node_deref(arg, node) + void *arg; + ipf_dstnode_t *node; +{ + ipf_dstl_softc_t *softd = arg; + int ref; + + MUTEX_ENTER(&node->ipfd_lock); + ref = --node->ipfd_ref; + MUTEX_EXIT(&node->ipfd_lock); + + if (ref > 0) + return 0; + + if ((node->ipfd_flags & IPDST_DELETE) != 0) + softd->stats.ipls_numderefnodes--; + MUTEX_DESTROY(&node->ipfd_lock); + KFREES(node, node->ipfd_size); + softd->stats.ipls_numnodes--; + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_del */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* uid(I) - uid of process doing the ioctl */ +/* */ +/* Look for a matching destination node on the named table and free it if */ +/* found. Because the name embedded in the frdest_t is variable in length, */ +/* it is necessary to allocate some memory locally, to complete this op. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_node_del(softc, arg, op, uid) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; + int uid; +{ + ipf_dstl_softc_t *softd = arg; + ipf_dstnode_t *node; + frdest_t frd, *temp; + ippool_dst_t *d; + size_t size; + int err; + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d == NULL) { + IPFERROR(120012); + return ESRCH; + } + + err = COPYIN(op->iplo_struct, &frd, sizeof(frd)); + if (err != 0) { + IPFERROR(120011); + return EFAULT; + } + + size = sizeof(*temp) + frd.fd_name; + KMALLOCS(temp, frdest_t *, size); + if (temp == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120026); + return ENOMEM; + } + + err = COPYIN(op->iplo_struct, temp, size); + if (err != 0) { + IPFERROR(120027); + return EFAULT; + } + + MUTEX_ENTER(&d->ipld_lock); + for (node = *d->ipld_dests; node != NULL; node = node->ipfd_next) { + if ((uid != 0) && (node->ipfd_uid != uid)) + continue; + if (node->ipfd_size != size) + continue; + if (!bcmp(&node->ipfd_dest.fd_ip6, &frd.fd_ip6, + size - offsetof(frdest_t, fd_ip6))) { + ipf_dstlist_node_free(softd, d, node); + MUTEX_EXIT(&d->ipld_lock); + KFREES(temp, size); + return 0; + } + } + MUTEX_EXIT(&d->ipld_lock); + KFREES(temp, size); + + return ESRCH; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_node_free */ +/* Returns: Nil */ +/* Parameters: softd(I) - pointer to the destination list context */ +/* d(I) - pointer to destination list */ +/* node(I) - pointer to node to free */ +/* Locks: MUTEX(ipld_lock) or WRITE(ipf_poolrw) */ +/* */ +/* Free the destination node by first removing it from any lists and then */ +/* checking if this was the last reference held to the object. While the */ +/* array of pointers to nodes is compacted, its size isn't reduced (by way */ +/* of allocating a new smaller one and copying) because the belief is that */ +/* it is likely the array will again reach that size. */ +/* ------------------------------------------------------------------------ */ +static void +ipf_dstlist_node_free(softd, d, node) + ipf_dstl_softc_t *softd; + ippool_dst_t *d; + ipf_dstnode_t *node; +{ + int i; + + /* + * Compact the array of pointers to nodes. + */ + for (i = 0; i < d->ipld_nodes; i++) + if (d->ipld_dests[i] == node) + break; + if (d->ipld_nodes - i > 1) { + bcopy(&d->ipld_dests[i + 1], &d->ipld_dests[i], + sizeof(*d->ipld_dests) * (d->ipld_nodes - i - 1)); + } + d->ipld_nodes--; + + if (node->ipfd_pnext != NULL) + *node->ipfd_pnext = node->ipfd_next; + if (node->ipfd_next != NULL) + node->ipfd_next->ipfd_pnext = node->ipfd_pnext; + node->ipfd_pnext = NULL; + node->ipfd_next = NULL; + + if ((node->ipfd_flags & IPDST_DELETE) == 0) { + softd->stats.ipls_numderefnodes++; + node->ipfd_flags |= IPDST_DELETE; + } + + ipf_dstlist_node_deref(softd, node); +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_stats_get */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Return the current statistics for destination lists. This may be for all */ +/* of them or just information pertaining to a particular table. */ +/* ------------------------------------------------------------------------ */ +/*ARGSUSED*/ +static int +ipf_dstlist_stats_get(softc, arg, op) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; +{ + ipf_dstl_softc_t *softd = arg; + ipf_dstl_stat_t stats; + int unit, i, err = 0; + + if (op->iplo_size != sizeof(ipf_dstl_stat_t)) { + IPFERROR(120023); + return EINVAL; + } + + stats = softd->stats; + unit = op->iplo_unit; + if (unit == IPL_LOGALL) { + for (i = 0; i <= IPL_LOGMAX; i++) + stats.ipls_list[i] = softd->dstlist[i]; + } else if (unit >= 0 && unit <= IPL_LOGMAX) { + void *ptr; + + if (op->iplo_name[0] != '\0') + ptr = ipf_dstlist_table_find(softd, unit, + op->iplo_name); + else + ptr = softd->dstlist[unit + 1]; + stats.ipls_list[unit] = ptr; + } else { + IPFERROR(120024); + err = EINVAL; + } + + if (err == 0) { + err = COPYOUT(&stats, op->iplo_struct, sizeof(stats)); + if (err != 0) { + IPFERROR(120025); + return EFAULT; + } + } + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_add */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Add a new destination table to the list of those available for the given */ +/* device. Because we seldom operate on these objects (find/add/delete), */ +/* they are just kept in a simple linked list. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_table_add(softc, arg, op) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; +{ + ipf_dstl_softc_t *softd = arg; + ippool_dst_t user, *d, *new; + int unit, err; + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d != NULL) { + IPFERROR(120013); + return EEXIST; + } + + err = COPYIN(op->iplo_struct, &user, sizeof(user)); + if (err != 0) { + IPFERROR(120021); + return EFAULT; + } + + KMALLOC(new, ippool_dst_t *); + if (new == NULL) { + softd->stats.ipls_nomem++; + IPFERROR(120014); + return ENOMEM; + } + bzero((char *)new, sizeof(*new)); + + MUTEX_INIT(&new->ipld_lock, "ipf dst table lock"); + + strncpy(new->ipld_name, op->iplo_name, FR_GROUPLEN); + unit = op->iplo_unit; + new->ipld_unit = unit; + new->ipld_policy = user.ipld_policy; + new->ipld_seed = ipf_random(); + new->ipld_ref = 1; + + new->ipld_pnext = softd->tails[unit + 1]; + *softd->tails[unit + 1] = new; + softd->tails[unit + 1] = &new->ipld_next; + softd->stats.ipls_numlists++; + + return 0; +} + + +/* ------------------------------------------------------------------------ */ +/* Function: ipf_dstlist_table_del */ +/* Returns: int - 0 = success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* arg(I) - pointer to local context to use */ +/* op(I) - pointer to lookup operation data */ +/* */ +/* Find a named destinstion list table and delete it. If there are other */ +/* references to it, the caller isn't told. */ +/* ------------------------------------------------------------------------ */ +static int +ipf_dstlist_table_del(softc, arg, op) + ipf_main_softc_t *softc; + void *arg; + iplookupop_t *op; +{ + ippool_dst_t *d; + + d = ipf_dstlist_table_find(arg, op->iplo_unit, op->iplo_name); + if (d == NULL) { + IPFERROR(120015); + return ESRCH; + } + + if (d->ipld_dests != NULL) { + IPFERROR(120016); + return EBUSY; + } + + ipf_dstlist_table_remove(softc, arg, d); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:50:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3AFDF53E; Tue, 20 Aug 2013 13:50:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BDC6209A; Tue, 20 Aug 2013 13:50:58 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 52AA5B924; Tue, 20 Aug 2013 09:50:55 -0400 (EDT) From: John Baldwin To: Mark Johnston Subject: Re: svn commit: r254309 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/kern sys/sys Date: Tue, 20 Aug 2013 08:14:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308140042.r7E0gMtf054550@svn.freebsd.org> <201308191542.30797.jhb@freebsd.org> <20130819201445.GB4765@charmander.sandvine.com> In-Reply-To: <20130819201445.GB4765@charmander.sandvine.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308200814.26924.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Aug 2013 09:50:55 -0400 (EDT) Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:50:58 -0000 On Monday, August 19, 2013 4:14:45 pm Mark Johnston wrote: > On Mon, Aug 19, 2013 at 03:42:30PM -0400, John Baldwin wrote: > > On Friday, August 16, 2013 1:41:31 pm Mark Johnston wrote: > > > On Fri, Aug 16, 2013 at 07:13:16PM +0200, Davide Italiano wrote: > > > > [trim old mails] > > > > > > > > > diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h > > > > > index e3e18a6..90585de 100644 > > > > > --- a/sys/sys/pmckern.h > > > > > +++ b/sys/sys/pmckern.h > > > > > @@ -51,13 +51,11 @@ > > > > > #define PMC_FN_CSW_IN 2 > > > > > #define PMC_FN_CSW_OUT 3 > > > > > #define PMC_FN_DO_SAMPLES 4 > > > > > -#define PMC_FN_KLD_LOAD 5 > > > > > -#define PMC_FN_KLD_UNLOAD 6 > > > > > -#define PMC_FN_MMAP 7 > > > > > -#define PMC_FN_MUNMAP 8 > > > > > -#define PMC_FN_USER_CALLCHAIN 9 > > > > > -#define PMC_FN_USER_CALLCHAIN_SOFT 10 > > > > > -#define PMC_FN_SOFT_SAMPLING 11 > > > > > +#define PMC_FN_MMAP 5 > > > > > +#define PMC_FN_MUNMAP 6 > > > > > +#define PMC_FN_USER_CALLCHAIN 7 > > > > > +#define PMC_FN_USER_CALLCHAIN_SOFT 8 > > > > > +#define PMC_FN_SOFT_SAMPLING 9 > > > > > > > > > > > > > I've skimmed over your patch quickly so I could miss something, but I > > > > worry about this change breaking the KBI. > > > > Does this make sense for you? > > > > > > I think you're right. I considered this last night, but it didn't occur > > > to me that external modules might try to invoke these hooks. I'm not > > > sure if such modules exist, but it's better to be safe. I updated the > > > patch here: > > > > > > http://people.freebsd.org/~markj/patches/hwpmc-eh/hwpmc-eh-3.diff > > > > This generally looks correct. I would probably not call it > > KLD_LOCK_ASSERT_READ() as it asserts any lock (not specifically a > > read lock). Normally I would use macros like this: > > > > KLD_WLOCK/WUNLOCK > > KLD_RLOCK/RUNLOCK > > KLD_ASSERT_LOCKED/KLD_ASSERT_WLOCKED > > > > However, the existing macros all were named to not assume read > > locking and then some read locking was added on the side. I'm > > not sure exactly what macro name makes the most sense, and would > > in fact be tempted to just retire all the KLD_* macros for locking > > and use sx(9) directly, but that is a fairly minor point. (And if > > done should be a separate commit). > > Yeah, KLD_LOCK_ASSERT_READ() is awkward, but I couldn't come up with > anything better without renaming the existing macros. I'm fine with > getting rid of them and using the sx_* calls directly; it'll be the same > amount of churn as changing the macro names anyway. > > So how about this: I'll get rid of the macros in one commit, change the > locking rules for linker_file_lookup_set() using my existing patch but > without the KLD lock macros, and then convert the hwpmc(4) hooks to use > the new event handlers (making sure to avoid breaking the KBI as Davide > pointed out). That sounds great to me. Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 13:55:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2029D8D3; Tue, 20 Aug 2013 13:55:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F36F520F6; Tue, 20 Aug 2013 13:55:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KDtn2O039300; Tue, 20 Aug 2013 13:55:49 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KDtn2J039299; Tue, 20 Aug 2013 13:55:49 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201308201355.r7KDtn2J039299@svn.freebsd.org> From: Cy Schubert Date: Tue, 20 Aug 2013 13:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254565 - vendor-sys/ipfilter/5-1-2/netinet X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 13:55:50 -0000 Author: cy Date: Tue Aug 20 13:55:49 2013 New Revision: 254565 URL: http://svnweb.freebsd.org/changeset/base/254565 Log: Tag the revert of IP-Filter 5.1.2 licence to the old licence currently used under FreeBSD. Approved by: Darren Reed (IP-Filter author) glebius (mentor) Modified: vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE (contents, props changed) Modified: vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE ============================================================================== --- vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE Tue Aug 20 13:50:36 2013 (r254564) +++ vendor-sys/ipfilter/5-1-2/netinet/IPFILTER.LICENCE Tue Aug 20 13:55:49 2013 (r254565) @@ -1,340 +1,29 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +/* + * Copyright (C) 1993-2001 by Darren Reed. + * + * The author accepts no responsibility for the use of this software and + * provides it on an ``as is'' basis without express or implied warranty. + * + * Redistribution and use, with or without modification, in source and binary + * forms, are permitted provided that this notice is preserved in its entirety + * and due credit is given to the original author and the contributors. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied, in part or in whole, and put under another distribution licence + * [including the GNU Public Licence.] + * + * 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. + * + * I hate legalese, don't you ? + */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 14:19:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BDF6FF99; Tue, 20 Aug 2013 14:19:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA5EA2300; Tue, 20 Aug 2013 14:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KEJ28w049556; Tue, 20 Aug 2013 14:19:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KEJ12x049543; Tue, 20 Aug 2013 14:19:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308201419.r7KEJ12x049543@svn.freebsd.org> From: Ed Maste Date: Tue, 20 Aug 2013 14:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254566 - in stable/9: lib/libusb sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 14:19:02 -0000 Author: emaste Date: Tue Aug 20 14:19:00 2013 New Revision: 254566 URL: http://svnweb.freebsd.org/changeset/base/254566 Log: MFC r250201 from hselasky: Add new USB API to get the port path of a USB device. Modified: stable/9/lib/libusb/Makefile stable/9/lib/libusb/libusb20.3 stable/9/lib/libusb/libusb20.c stable/9/lib/libusb/libusb20.h stable/9/lib/libusb/libusb20_int.h stable/9/lib/libusb/libusb20_ugen20.c stable/9/sys/dev/usb/usb_generic.c stable/9/sys/dev/usb/usb_ioctl.h Directory Properties: stable/9/lib/libusb/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/lib/libusb/Makefile ============================================================================== --- stable/9/lib/libusb/Makefile Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/lib/libusb/Makefile Tue Aug 20 14:19:00 2013 (r254566) @@ -189,6 +189,7 @@ MLINKS += libusb20.3 libusb20_dev_reset. MLINKS += libusb20.3 libusb20_dev_check_connected.3 MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_port_path.3 MLINKS += libusb20.3 libusb20_dev_get_power_usage.3 MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 Modified: stable/9/lib/libusb/libusb20.3 ============================================================================== --- stable/9/lib/libusb/libusb20.3 Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/lib/libusb/libusb20.3 Tue Aug 20 14:19:00 2013 (r254566) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2013 +.Dd May 3, 2013 .Dt LIBUSB20 3 .Os .Sh NAME @@ -113,6 +113,8 @@ USB access library (libusb -lusb) .Ft const char * .Fn libusb20_dev_get_backend_name "struct libusb20_device *" .Ft int +.Fn libusb20_dev_get_port_path "struct libusb20_device *pdev" "uint8_t *buf" "uint8_t bufsize" +.Ft int .Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb_device_info *pinfo" .Ft int .Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len" @@ -541,6 +543,20 @@ returns a zero terminated string describ . .Pp . +.Fn libusb20_dev_get_port_path +retrieves the list of USB port numbers which the datastream for a given USB device follows. +The first port number is the Root HUB port number. +Then children port numbers follow. +The Root HUB device itself has a port path length of zero. +Valid port numbers start at one and range until and including 255. +Typically there should not be more than 16 levels, due to electrical and protocol limitations. +This functions returns the number of actual port levels upon success +else a LIBUSB20_ERROR value is returned which are always negative. +If the actual number of port levels is greater than the maximum +specified, a LIBUSB20_ERROR value is returned. +. +.Pp +. .Fn libusb20_dev_get_info retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . Modified: stable/9/lib/libusb/libusb20.c ============================================================================== --- stable/9/lib/libusb/libusb20.c Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/lib/libusb/libusb20.c Tue Aug 20 14:19:00 2013 (r254566) @@ -71,6 +71,7 @@ dummy_callback(struct libusb20_transfer #define dummy_check_connected (void *)dummy_int #define dummy_set_power_mode (void *)dummy_int #define dummy_get_power_mode (void *)dummy_int +#define dummy_get_port_path (void *)dummy_int #define dummy_get_power_usage (void *)dummy_int #define dummy_kernel_driver_active (void *)dummy_int #define dummy_detach_kernel_driver (void *)dummy_int @@ -711,6 +712,12 @@ libusb20_dev_get_power_mode(struct libus return (power_mode); } +int +libusb20_dev_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize) +{ + return (pdev->methods->get_port_path(pdev, buf, bufsize)); +} + uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev) { Modified: stable/9/lib/libusb/libusb20.h ============================================================================== --- stable/9/lib/libusb/libusb20.h Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/lib/libusb/libusb20.h Tue Aug 20 14:19:00 2013 (r254566) @@ -254,6 +254,7 @@ int libusb20_dev_reset(struct libusb20_d int libusb20_dev_check_connected(struct libusb20_device *pdev); int libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode); uint8_t libusb20_dev_get_power_mode(struct libusb20_device *pdev); +int libusb20_dev_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize); uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev); int libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo); Modified: stable/9/lib/libusb/libusb20_int.h ============================================================================== --- stable/9/lib/libusb/libusb20_int.h Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/lib/libusb/libusb20_int.h Tue Aug 20 14:19:00 2013 (r254566) @@ -105,6 +105,7 @@ typedef int (libusb20_process_t)(struct typedef int (libusb20_reset_device_t)(struct libusb20_device *pdev); typedef int (libusb20_set_power_mode_t)(struct libusb20_device *pdev, uint8_t power_mode); typedef int (libusb20_get_power_mode_t)(struct libusb20_device *pdev, uint8_t *power_mode); +typedef int (libusb20_get_port_path_t)(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize); typedef int (libusb20_get_power_usage_t)(struct libusb20_device *pdev, uint16_t *power_usage); typedef int (libusb20_set_alt_index_t)(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); typedef int (libusb20_set_config_index_t)(struct libusb20_device *pdev, uint8_t index); @@ -128,6 +129,7 @@ typedef void (libusb20_tr_cancel_async_t m(n, check_connected) \ m(n, set_power_mode) \ m(n, get_power_mode) \ + m(n, get_port_path) \ m(n, get_power_usage) \ m(n, set_alt_index) \ m(n, set_config_index) \ Modified: stable/9/lib/libusb/libusb20_ugen20.c ============================================================================== --- stable/9/lib/libusb/libusb20_ugen20.c Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/lib/libusb/libusb20_ugen20.c Tue Aug 20 14:19:00 2013 (r254566) @@ -69,6 +69,7 @@ static libusb20_reset_device_t ugen20_re static libusb20_check_connected_t ugen20_check_connected; static libusb20_set_power_mode_t ugen20_set_power_mode; static libusb20_get_power_mode_t ugen20_get_power_mode; +static libusb20_get_port_path_t ugen20_get_port_path; static libusb20_get_power_usage_t ugen20_get_power_usage; static libusb20_kernel_driver_active_t ugen20_kernel_driver_active; static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver; @@ -640,6 +641,22 @@ ugen20_get_power_mode(struct libusb20_de } static int +ugen20_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize) +{ + struct usb_device_port_path udpp; + + if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp)) + return (LIBUSB20_ERROR_OTHER); + + if (udpp.udp_port_level > bufsize) + return (LIBUSB20_ERROR_OVERFLOW); + + memcpy(buf, udpp.udp_port_no, udpp.udp_port_level); + + return (udpp.udp_port_level); /* success */ +} + +static int ugen20_get_power_usage(struct libusb20_device *pdev, uint16_t *power_usage) { int temp; Modified: stable/9/sys/dev/usb/usb_generic.c ============================================================================== --- stable/9/sys/dev/usb/usb_generic.c Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/sys/dev/usb/usb_generic.c Tue Aug 20 14:19:00 2013 (r254566) @@ -1831,6 +1831,46 @@ ugen_get_power_mode(struct usb_fifo *f) } static int +ugen_get_port_path(struct usb_fifo *f, struct usb_device_port_path *dpp) +{ + struct usb_device *udev = f->udev; + struct usb_device *next; + unsigned int nlevel = 0; + + if (udev == NULL) + goto error; + + dpp->udp_bus = device_get_unit(udev->bus->bdev); + dpp->udp_index = udev->device_index; + + /* count port levels */ + next = udev; + while (next->parent_hub != NULL) { + nlevel++; + next = next->parent_hub; + } + + /* check if too many levels */ + if (nlevel > USB_DEVICE_PORT_PATH_MAX) + goto error; + + /* store port index array */ + next = udev; + while (next->parent_hub != NULL) { + nlevel--; + + dpp->udp_port_no[nlevel] = next->port_no; + dpp->udp_port_level = nlevel; + + next = next->parent_hub; + } + return (0); /* success */ + +error: + return (EINVAL); /* failure */ +} + +static int ugen_get_power_usage(struct usb_fifo *f) { struct usb_device *udev = f->udev; @@ -2031,6 +2071,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo struct usb_device_stats *stat; struct usb_fs_init *pinit; struct usb_fs_uninit *puninit; + struct usb_device_port_path *dpp; uint32_t *ptime; void *addr; int *pint; @@ -2203,6 +2244,10 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo *u.pint = ugen_get_power_mode(f); break; + case USB_GET_DEV_PORT_PATH: + error = ugen_get_port_path(f, u.dpp); + break; + case USB_GET_POWER_USAGE: *u.pint = ugen_get_power_usage(f); break; Modified: stable/9/sys/dev/usb/usb_ioctl.h ============================================================================== --- stable/9/sys/dev/usb/usb_ioctl.h Tue Aug 20 13:55:49 2013 (r254565) +++ stable/9/sys/dev/usb/usb_ioctl.h Tue Aug 20 14:19:00 2013 (r254566) @@ -295,7 +295,8 @@ struct usb_gen_quirk { #define USB_IFACE_DRIVER_DETACH _IOW ('U', 125, int) #define USB_GET_PLUGTIME _IOR ('U', 126, uint32_t) #define USB_READ_DIR _IOW ('U', 127, struct usb_read_dir) -/* 128 - 134 unused */ +/* 128 - 133 unused */ +#define USB_GET_DEV_PORT_PATH _IOR ('U', 134, struct usb_device_port_path) #define USB_GET_POWER_USAGE _IOR ('U', 135, int) #define USB_SET_TX_FORCE_SHORT _IOW ('U', 136, int) #define USB_SET_TX_TIMEOUT _IOW ('U', 137, int) From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 14:25:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B10FF379; Tue, 20 Aug 2013 14:25:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7302385; Tue, 20 Aug 2013 14:25:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KEPjX5053129; Tue, 20 Aug 2013 14:25:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KEPjaK053125; Tue, 20 Aug 2013 14:25:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308201425.r7KEPjaK053125@svn.freebsd.org> From: Ed Maste Date: Tue, 20 Aug 2013 14:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254567 - stable/9/lib/libusb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 14:25:45 -0000 Author: emaste Date: Tue Aug 20 14:25:44 2013 New Revision: 254567 URL: http://svnweb.freebsd.org/changeset/base/254567 Log: MFC r250335: Constify libusb_get_pollfds return The correct return type, per our libusb(3) man page and the libusb.org and libusbx projects (whose interface we intend to follow for our libusb), is const struct libusb_pollfd **. Modified: stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10_io.c Directory Properties: stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb.h ============================================================================== --- stable/9/lib/libusb/libusb.h Tue Aug 20 14:19:00 2013 (r254566) +++ stable/9/lib/libusb/libusb.h Tue Aug 20 14:25:44 2013 (r254567) @@ -438,7 +438,7 @@ int libusb_handle_events(libusb_context int libusb_handle_events_locked(libusb_context * ctx, struct timeval *tv); int libusb_get_next_timeout(libusb_context * ctx, struct timeval *tv); void libusb_set_pollfd_notifiers(libusb_context * ctx, libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data); -struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx); +const struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx); /* Synchronous device I/O */ Modified: stable/9/lib/libusb/libusb10_io.c ============================================================================== --- stable/9/lib/libusb/libusb10_io.c Tue Aug 20 14:19:00 2013 (r254566) +++ stable/9/lib/libusb/libusb10_io.c Tue Aug 20 14:25:44 2013 (r254567) @@ -392,7 +392,7 @@ libusb_set_pollfd_notifiers(libusb_conte ctx->fd_cb_user_data = user_data; } -struct libusb_pollfd ** +const struct libusb_pollfd ** libusb_get_pollfds(libusb_context *ctx) { struct libusb_super_pollfd *pollfd; @@ -418,7 +418,7 @@ libusb_get_pollfds(libusb_context *ctx) done: CTX_UNLOCK(ctx); - return (ret); + return ((const struct libusb_pollfd **)ret); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 14:29:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDB9A56F; Tue, 20 Aug 2013 14:29:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB97E23D8; Tue, 20 Aug 2013 14:29:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KETiPQ053904; Tue, 20 Aug 2013 14:29:44 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KETieE053899; Tue, 20 Aug 2013 14:29:44 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308201429.r7KETieE053899@svn.freebsd.org> From: Ed Maste Date: Tue, 20 Aug 2013 14:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254568 - stable/9/lib/libusb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 14:29:45 -0000 Author: emaste Date: Tue Aug 20 14:29:43 2013 New Revision: 254568 URL: http://svnweb.freebsd.org/changeset/base/254568 Log: MFC r250342, r251495: Add libusb_get_port_path wrapper This follows the libusbx API reference at http://libusbx.sourceforge.net/api-1.0/group__dev.html Add libusb_get_port_numbers libusbx deprecated libusb_get_port_path and replaced it with libusb_get_port_numbers. The latter omits an extra parameter which was unused in the FreeBSD implementation anyway. Modified: stable/9/lib/libusb/libusb.3 stable/9/lib/libusb/libusb.h stable/9/lib/libusb/libusb10.c Directory Properties: stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb.3 ============================================================================== --- stable/9/lib/libusb/libusb.3 Tue Aug 20 14:25:44 2013 (r254567) +++ stable/9/lib/libusb/libusb.3 Tue Aug 20 14:29:43 2013 (r254568) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 12, 2012 +.Dd August 20, 2013 .Dt LIBUSB 3 .Os .Sh NAME @@ -102,6 +102,19 @@ counter decremented once. Returns the number of the bus contained by the device .Fa dev . .Pp +.Ft int +.Fn libusb_get_port_numbers "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize" +Stores, in the buffer +.Fa buf +of size +.Fa bufsize , +the list of all port numbers from root for the device +.Fa dev . +.Pp +.Ft int +.Fn libusb_get_port_path "libusb_context *ctx" "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize" +Deprecated function equivalent to libusb_get_port_numbers. +.Pp .Ft uint8_t .Fn libusb_get_device_address "libusb_device *dev" Returns the device_address contained by the device Modified: stable/9/lib/libusb/libusb.h ============================================================================== --- stable/9/lib/libusb/libusb.h Tue Aug 20 14:25:44 2013 (r254567) +++ stable/9/lib/libusb/libusb.h Tue Aug 20 14:29:43 2013 (r254568) @@ -367,6 +367,8 @@ void libusb_exit(struct libusb_context * ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list); void libusb_free_device_list(libusb_device ** list, int unref_devices); uint8_t libusb_get_bus_number(libusb_device * dev); +int libusb_get_port_numbers(libusb_device *dev, uint8_t *buf, uint8_t bufsize); +int libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, uint8_t bufsize); uint8_t libusb_get_device_address(libusb_device * dev); enum libusb_speed libusb_get_device_speed(libusb_device * dev); int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint); Modified: stable/9/lib/libusb/libusb10.c ============================================================================== --- stable/9/lib/libusb/libusb10.c Tue Aug 20 14:25:44 2013 (r254567) +++ stable/9/lib/libusb/libusb10.c Tue Aug 20 14:29:43 2013 (r254568) @@ -284,6 +284,19 @@ libusb_get_bus_number(libusb_device *dev return (libusb20_dev_get_bus_number(dev->os_priv)); } +int +libusb_get_port_numbers(libusb_device *dev, uint8_t *buf, uint8_t bufsize) +{ + return (libusb20_dev_get_port_path(dev->os_priv, buf, bufsize)); +} + +int +libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, + uint8_t bufsize) +{ + return (libusb20_dev_get_port_path(dev->os_priv, buf, bufsize)); +} + uint8_t libusb_get_device_address(libusb_device *dev) { From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 14:35:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 878F782B; Tue, 20 Aug 2013 14:35:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 759AA244A; Tue, 20 Aug 2013 14:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KEZIHS057043; Tue, 20 Aug 2013 14:35:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KEZIKV057042; Tue, 20 Aug 2013 14:35:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201308201435.r7KEZIKV057042@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 20 Aug 2013 14:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254569 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 14:35:18 -0000 Author: bz Date: Tue Aug 20 14:35:17 2013 New Revision: 254569 URL: http://svnweb.freebsd.org/changeset/base/254569 Log: After r241616 properly export ifi_baudrate_pf in the 32bit compat case. MFC after: 3 days Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Aug 20 14:29:43 2013 (r254568) +++ head/sys/net/rtsock.c Tue Aug 20 14:35:17 2013 (r254569) @@ -86,7 +86,7 @@ struct if_data32 { uint8_t ifi_hdrlen; uint8_t ifi_link_state; uint8_t ifi_vhid; - uint8_t ifi_spare_char2; + uint8_t ifi_baudrate_pf; uint8_t ifi_datalen; uint32_t ifi_mtu; uint32_t ifi_metric; @@ -1629,6 +1629,7 @@ copy_ifdata32(struct if_data *src, struc CP(*src, *dst, ifi_hdrlen); CP(*src, *dst, ifi_link_state); CP(*src, *dst, ifi_vhid); + CP(*src, *dst, ifi_baudrate_pf); dst->ifi_datalen = sizeof(struct if_data32); CP(*src, *dst, ifi_mtu); CP(*src, *dst, ifi_metric); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 14:37:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B8FE59A0; Tue, 20 Aug 2013 14:37:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6A752469; Tue, 20 Aug 2013 14:37:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KEb6u7057381; Tue, 20 Aug 2013 14:37:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KEb6Po057380; Tue, 20 Aug 2013 14:37:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201308201437.r7KEb6Po057380@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 20 Aug 2013 14:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254570 - head/tools/tools/ifinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 14:37:06 -0000 Author: bz Date: Tue Aug 20 14:37:06 2013 New Revision: 254570 URL: http://svnweb.freebsd.org/changeset/base/254570 Log: Catch up with various changes to if_data and make this compile again on HEAD. Seems to be one of the the only tools giving us access to ifi_baudrate and ifi_baudrate_pf values. MFC after: 3 days Modified: head/tools/tools/ifinfo/ifinfo.c Modified: head/tools/tools/ifinfo/ifinfo.c ============================================================================== --- head/tools/tools/ifinfo/ifinfo.c Tue Aug 20 14:35:17 2013 (r254569) +++ head/tools/tools/ifinfo/ifinfo.c Tue Aug 20 14:37:06 2013 (r254570) @@ -169,8 +169,11 @@ printit(const struct ifmibdata *ifmd, co ifmd->ifmd_data.ifi_physical)); printf("\taddress length: %d\n", ifmd->ifmd_data.ifi_addrlen); printf("\theader length: %d\n", ifmd->ifmd_data.ifi_hdrlen); - printf("\treceive spare char1: %u\n", ifmd->ifmd_data.ifi_spare_char1); - printf("\ttransmit spare char2: %u\n", ifmd->ifmd_data.ifi_spare_char2); + printf("\tlink state: %u\n", ifmd->ifmd_data.ifi_link_state); + printf("\tvhid: %u\n", ifmd->ifmd_data.ifi_vhid); + printf("\tbaudrate power factor: %u\n", + ifmd->ifmd_data.ifi_baudrate_pf); + printf("\tdatalen: %u\n", ifmd->ifmd_data.ifi_datalen); printf("\tmtu: %lu\n", ifmd->ifmd_data.ifi_mtu); printf("\tmetric: %lu\n", ifmd->ifmd_data.ifi_metric); printf("\tline rate: %lu bit/s\n", ifmd->ifmd_data.ifi_baudrate); @@ -186,6 +189,10 @@ printit(const struct ifmibdata *ifmd, co printf("\tinput queue drops: %lu\n", ifmd->ifmd_data.ifi_iqdrops); printf("\tpackets for unknown protocol: %lu\n", ifmd->ifmd_data.ifi_noproto); + printf("\tHW offload capabilities: 0x%lx\n", + ifmd->ifmd_data.ifi_hwassist); + printf("\tuptime at attach or stat reset: %lu\n", + ifmd->ifmd_data.ifi_epoch); #ifdef notdef printf("\treceive timing: %lu usec\n", ifmd->ifmd_data.ifi_recvtiming); printf("\ttransmit timing: %lu usec\n", From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 14:59:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6F49DB2; Tue, 20 Aug 2013 14:59:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94FD325CC; Tue, 20 Aug 2013 14:59:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KExVYg064938; Tue, 20 Aug 2013 14:59:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KExVIp064937; Tue, 20 Aug 2013 14:59:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201308201459.r7KExVIp064937@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 20 Aug 2013 14:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254571 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 14:59:31 -0000 Author: bz Date: Tue Aug 20 14:59:31 2013 New Revision: 254571 URL: http://svnweb.freebsd.org/changeset/base/254571 Log: Correct a typo in the event mask mnemonic. Reviewed by: gnn MFC after: 3 days Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Aug 20 14:37:06 2013 (r254570) +++ head/sys/dev/hwpmc/pmc_events.h Tue Aug 20 14:59:31 2013 (r254571) @@ -3185,7 +3185,7 @@ __PMC_EV_ALIAS("LOCK_CYCLES.SPLIT_LOCK_U IAP_EVENT_63H_01H) \ __PMC_EV_ALIAS("LOCK_CYCLES.CACHE_LOCK_DURATION", IAP_EVENT_63H_02H) \ __PMC_EV_ALIAS("IDQ.EMPTY", IAP_EVENT_79H_02H) \ -__PMC_EV_ALIAS("IQD.MITE_UOPS", IAP_EVENT_79H_04H) \ +__PMC_EV_ALIAS("IDQ.MITE_UOPS", IAP_EVENT_79H_04H) \ __PMC_EV_ALIAS("IDQ.DSB_UOPS", IAP_EVENT_79H_08H) \ __PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \ __PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \ From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 16:21:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9BFDC59B; Tue, 20 Aug 2013 16:21:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0CD2B50; Tue, 20 Aug 2013 16:21:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KGL5O1098882; Tue, 20 Aug 2013 16:21:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KGL5T4098881; Tue, 20 Aug 2013 16:21:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308201621.r7KGL5T4098881@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 Aug 2013 16:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254572 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 16:21:05 -0000 Author: hselasky Date: Tue Aug 20 16:21:05 2013 New Revision: 254572 URL: http://svnweb.freebsd.org/changeset/base/254572 Log: Force keyboards which don't have the required HID fields to use the USB BOOT protocol for now. PR: usb/181425 Submitted by: Andrey Zholos MFC after: 4 weeks Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Tue Aug 20 14:59:31 2013 (r254571) +++ head/sys/dev/usb/input/ukbd.c Tue Aug 20 16:21:05 2013 (r254572) @@ -1130,8 +1130,12 @@ ukbd_parse_hid(struct ukbd_softc *sc, co HID_USAGE2(HUP_KEYBOARD, 0x00), hid_input, 0, &sc->sc_loc_events, &flags, &sc->sc_id_events)) { - sc->sc_flags |= UKBD_FLAG_EVENTS; - DPRINTFN(1, "Found keyboard events\n"); + if (flags & HIO_VARIABLE) { + DPRINTFN(1, "Ignoring keyboard event control\n"); + } else { + sc->sc_flags |= UKBD_FLAG_EVENTS; + DPRINTFN(1, "Found keyboard event array\n"); + } } /* figure out leds on keyboard */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 17:43:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 376848ED for ; Tue, 20 Aug 2013 17:43:04 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84B582FE8 for ; Tue, 20 Aug 2013 17:43:02 +0000 (UTC) Received: (qmail 66588 invoked from network); 20 Aug 2013 18:26:17 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 20 Aug 2013 18:26:17 -0000 Message-ID: <5213AAA1.6020700@freebsd.org> Date: Tue, 20 Aug 2013 19:42:57 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r254524 - head/sys/sys References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> In-Reply-To: <521257E2.4020502@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 17:43:04 -0000 On 19.08.2013 19:37, Navdeep Parhar wrote: > On 08/19/13 06:56, Andre Oppermann wrote: >> Author: andre >> Date: Mon Aug 19 13:56:14 2013 >> New Revision: 254524 >> URL: http://svnweb.freebsd.org/changeset/base/254524 >> >> Log: >> Add four additional M_PROTOFLAGS[9-12] for protocol specific use. >> >> Discussed with: trociny, glebius, adrian >> >> Modified: >> head/sys/sys/mbuf.h >> >> Modified: head/sys/sys/mbuf.h >> ============================================================================== >> --- head/sys/sys/mbuf.h Mon Aug 19 13:27:32 2013 (r254523) >> +++ head/sys/sys/mbuf.h Mon Aug 19 13:56:14 2013 (r254524) >> @@ -196,22 +196,24 @@ struct mbuf { >> #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ >> #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ >> #define M_LASTFRAG 0x00002000 /* packet is last fragment */ >> - /* 0x00004000 free */ >> - /* 0x00008000 free */ >> +#define M_PROTO9 0x00004000 /* protocol-specific */ >> +#define M_PROTO10 0x00008000 /* protocol-specific */ >> #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ >> #define M_PROMISC 0x00020000 /* packet was not for us */ >> - /* 0x00040000 free */ >> +#define M_PROTO11 0x00040000 /* protocol-specific */ >> #define M_PROTO6 0x00080000 /* protocol-specific */ >> #define M_PROTO7 0x00100000 /* protocol-specific */ >> #define M_PROTO8 0x00200000 /* protocol-specific */ >> #define M_FLOWID 0x00400000 /* deprecated: flowid is valid */ >> +#define M_PROTO12 0x00800000 /* protocol-specific */ >> #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ > > Why reuse the freed up bits so soon (at least one of which I think was > prematurely GC'ed -- see my other email on M_NOFREE). There was room > beyond M_HASHTYPEBITS, no? This is HEAD where kernel and modules have to be (re)compiled together at any point in time. On stable this reuse would not have been possible. In a subsequent commit I compacted and ordered the flags. There's a couple of free ones remaining. I have some additional mbuf changes coming up to be posted for possible objections later today. The close HEAD freeze deadline has got me rushed a bit to allow 10.x backporting of the checksum/offload overhaul. -- Andre From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 17:50:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 52FE8BFB; Tue, 20 Aug 2013 17:50:32 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21235205F; Tue, 20 Aug 2013 17:50:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KHoVjn033996; Tue, 20 Aug 2013 17:50:31 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KHoVo6033991; Tue, 20 Aug 2013 17:50:31 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201308201750.r7KHoVo6033991@svn.freebsd.org> From: Jack F Vogel Date: Tue, 20 Aug 2013 17:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254573 - in releng/9.2/sys/dev: e1000 ixgbe X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 17:50:32 -0000 Author: jfv Date: Tue Aug 20 17:50:30 2013 New Revision: 254573 URL: http://svnweb.freebsd.org/changeset/base/254573 Log: MFC r254008,254262: Improve the MSIX setup logic, making sure the requested number of vectors are actually obtained, and if not cleaning up before falling back to MSI. Also make the fallback decision as early as possible. Approved by: re Modified: releng/9.2/sys/dev/e1000/if_em.c releng/9.2/sys/dev/e1000/if_igb.c releng/9.2/sys/dev/ixgbe/ixgbe.c releng/9.2/sys/dev/ixgbe/ixv.c Directory Properties: releng/9.2/sys/ (props changed) releng/9.2/sys/dev/ (props changed) releng/9.2/sys/dev/e1000/ (props changed) releng/9.2/sys/dev/ixgbe/ (props changed) Modified: releng/9.2/sys/dev/e1000/if_em.c ============================================================================== --- releng/9.2/sys/dev/e1000/if_em.c Tue Aug 20 16:21:05 2013 (r254572) +++ releng/9.2/sys/dev/e1000/if_em.c Tue Aug 20 17:50:30 2013 (r254573) @@ -2277,7 +2277,7 @@ em_local_timer(void *arg) /* Mask to use in the irq trigger */ if (adapter->msix_mem) - trigger = rxr->ims; /* RX for 82574 */ + trigger = rxr->ims; else trigger = E1000_ICS_RXDMT0; @@ -2742,7 +2742,7 @@ static int em_setup_msix(struct adapter *adapter) { device_t dev = adapter->dev; - int val = 0; + int val; /* ** Setup MSI/X for Hartwell: tests have shown @@ -2756,37 +2756,43 @@ em_setup_msix(struct adapter *adapter) int rid = PCIR_BAR(EM_MSIX_BAR); adapter->msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (!adapter->msix_mem) { + if (adapter->msix_mem == NULL) { /* May not be enabled */ device_printf(adapter->dev, "Unable to map MSIX table \n"); goto msi; } val = pci_msix_count(dev); - /* We only need 3 vectors */ - if (val > 3) + /* We only need/want 3 vectors */ + if (val >= 3) val = 3; - if ((val != 3) && (val != 5)) { - bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem); - adapter->msix_mem = NULL; + else { device_printf(adapter->dev, - "MSIX: incorrect vectors, using MSI\n"); + "MSIX: insufficient vectors, using MSI\n"); goto msi; } - if (pci_alloc_msix(dev, &val) == 0) { + if ((pci_alloc_msix(dev, &val) == 0) && (val == 3)) { device_printf(adapter->dev, "Using MSIX interrupts " "with %d vectors\n", val); + return (val); } - return (val); + /* + ** If MSIX alloc failed or provided us with + ** less than needed, free and fall through to MSI + */ + pci_release_msi(dev); } msi: - val = pci_msi_count(dev); - if (val == 1 && pci_alloc_msi(dev, &val) == 0) { - adapter->msix = 1; + if (adapter->msix_mem != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(EM_MSIX_BAR), adapter->msix_mem); + adapter->msix_mem = NULL; + } + val = 1; + if (pci_alloc_msi(dev, &val) == 0) { device_printf(adapter->dev,"Using an MSI interrupt\n"); return (val); } Modified: releng/9.2/sys/dev/e1000/if_igb.c ============================================================================== --- releng/9.2/sys/dev/e1000/if_igb.c Tue Aug 20 16:21:05 2013 (r254572) +++ releng/9.2/sys/dev/e1000/if_igb.c Tue Aug 20 17:50:30 2013 (r254573) @@ -972,7 +972,13 @@ igb_mq_start(struct ifnet *ifp, struct m que = &adapter->queues[i]; err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &txr->txq_task); + if (err) + return (err); + if (IGB_TX_TRYLOCK(txr)) { + err = igb_mq_start_locked(ifp, txr); + IGB_TX_UNLOCK(txr); + } else + taskqueue_enqueue(que->tq, &txr->txq_task); return (err); } @@ -2834,24 +2840,19 @@ igb_setup_msix(struct adapter *adapter) goto msi; /* First try MSI/X */ + msgs = pci_msix_count(dev); + if (msgs == 0) + goto msi; rid = PCIR_BAR(IGB_MSIX_BAR); adapter->msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (!adapter->msix_mem) { + if (adapter->msix_mem == NULL) { /* May not be enabled */ device_printf(adapter->dev, "Unable to map MSIX table \n"); goto msi; } - msgs = pci_msix_count(dev); - if (msgs == 0) { /* system has msix disabled */ - bus_release_resource(dev, SYS_RES_MEMORY, - PCIR_BAR(IGB_MSIX_BAR), adapter->msix_mem); - adapter->msix_mem = NULL; - goto msi; - } - /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; @@ -2894,20 +2895,32 @@ igb_setup_msix(struct adapter *adapter) "MSIX Configuration Problem, " "%d vectors configured, but %d queues wanted!\n", msgs, want); - return (0); + goto msi; } - if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) { + if ((pci_alloc_msix(dev, &msgs) == 0) && (msgs == want)) { device_printf(adapter->dev, "Using MSIX interrupts with %d vectors\n", msgs); adapter->num_queues = queues; return (msgs); } + /* + ** If MSIX alloc failed or provided us with + ** less than needed, free and fall through to MSI + */ + pci_release_msi(dev); + msi: - msgs = pci_msi_count(dev); - if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) { - device_printf(adapter->dev," Using MSI interrupt\n"); + if (adapter->msix_mem != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + PCIR_BAR(IGB_MSIX_BAR), adapter->msix_mem); + adapter->msix_mem = NULL; + } + msgs = 1; + if (pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev," Using an MSI interrupt\n"); return (msgs); } + device_printf(adapter->dev," Using a Legacy interrupt\n"); return (0); } Modified: releng/9.2/sys/dev/ixgbe/ixgbe.c ============================================================================== --- releng/9.2/sys/dev/ixgbe/ixgbe.c Tue Aug 20 16:21:05 2013 (r254572) +++ releng/9.2/sys/dev/ixgbe/ixgbe.c Tue Aug 20 17:50:30 2013 (r254573) @@ -2415,29 +2415,24 @@ ixgbe_setup_msix(struct adapter *adapter goto msi; /* First try MSI/X */ + msgs = pci_msix_count(dev); + if (msgs == 0) + goto msi; rid = PCIR_BAR(MSIX_82598_BAR); adapter->msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (!adapter->msix_mem) { + if (adapter->msix_mem == NULL) { rid += 4; /* 82599 maps in higher BAR */ adapter->msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); } - if (!adapter->msix_mem) { + if (adapter->msix_mem == NULL) { /* May not be enabled */ device_printf(adapter->dev, "Unable to map MSIX table \n"); goto msi; } - msgs = pci_msix_count(dev); - if (msgs == 0) { /* system has msix disabled */ - bus_release_resource(dev, SYS_RES_MEMORY, - rid, adapter->msix_mem); - adapter->msix_mem = NULL; - goto msi; - } - /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; @@ -2459,21 +2454,33 @@ ixgbe_setup_msix(struct adapter *adapter "MSIX Configuration Problem, " "%d vectors but %d queues wanted!\n", msgs, want); - return (0); /* Will go to Legacy setup */ + goto msi; } - if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) { + if ((pci_alloc_msix(dev, &msgs) == 0) && (msgs == want)) { device_printf(adapter->dev, "Using MSIX interrupts with %d vectors\n", msgs); adapter->num_queues = queues; return (msgs); } + /* + ** If MSIX alloc failed or provided us with + ** less than needed, free and fall through to MSI + */ + pci_release_msi(dev); + msi: - msgs = pci_msi_count(dev); - if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) + if (adapter->msix_mem != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + rid, adapter->msix_mem); + adapter->msix_mem = NULL; + } + msgs = 1; + if (pci_alloc_msi(dev, &msgs) == 0) { device_printf(adapter->dev,"Using an MSI interrupt\n"); - else - device_printf(adapter->dev,"Using a Legacy interrupt\n"); - return (msgs); + return (msgs); + } + device_printf(adapter->dev,"Using a Legacy interrupt\n"); + return (0); } Modified: releng/9.2/sys/dev/ixgbe/ixv.c ============================================================================== --- releng/9.2/sys/dev/ixgbe/ixv.c Tue Aug 20 16:21:05 2013 (r254572) +++ releng/9.2/sys/dev/ixgbe/ixv.c Tue Aug 20 17:50:30 2013 (r254573) @@ -1680,37 +1680,37 @@ static int ixv_setup_msix(struct adapter *adapter) { device_t dev = adapter->dev; - int rid, vectors, want = 2; + int rid, want; /* First try MSI/X */ rid = PCIR_BAR(3); adapter->msix_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (!adapter->msix_mem) { + if (adapter->msix_mem == NULL) { device_printf(adapter->dev, "Unable to map MSIX table \n"); goto out; } - vectors = pci_msix_count(dev); - if (vectors < 2) { - bus_release_resource(dev, SYS_RES_MEMORY, - rid, adapter->msix_mem); - adapter->msix_mem = NULL; - goto out; - } - /* ** Want two vectors: one for a queue, ** plus an additional for mailbox. */ - if (pci_alloc_msix(dev, &want) == 0) { + want = 2; + if ((pci_alloc_msix(dev, &want) == 0) && (want == 2)) { device_printf(adapter->dev, "Using MSIX interrupts with %d vectors\n", want); return (want); } + /* Release in case alloc was insufficient */ + pci_release_msi(dev); out: + if (adapter->msix_mem != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + rid, adapter->msix_mem); + adapter->msix_mem = NULL; + } device_printf(adapter->dev,"MSIX config error\n"); return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 18:08:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67A972B3; Tue, 20 Aug 2013 18:08:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 559D62161; Tue, 20 Aug 2013 18:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KI87m2040015; Tue, 20 Aug 2013 18:08:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KI87bw040014; Tue, 20 Aug 2013 18:08:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201308201808.r7KI87bw040014@svn.freebsd.org> From: John Baldwin Date: Tue, 20 Aug 2013 18:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254576 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 18:08:07 -0000 Author: jhb Date: Tue Aug 20 18:08:06 2013 New Revision: 254576 URL: http://svnweb.freebsd.org/changeset/base/254576 Log: Stop an ipoib interface before detaching it. PR: kern/181225 Submitted by: Shahar Klein Obtained from: Mellanox MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Aug 20 18:06:18 2013 (r254575) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Aug 20 18:08:06 2013 (r254576) @@ -1073,6 +1073,8 @@ ipoib_remove_one(struct ib_device *devic if (rdma_port_get_link_layer(device, priv->port) != IB_LINK_LAYER_INFINIBAND) continue; + ipoib_stop(priv); + ib_unregister_event_handler(&priv->event_handler); /* dev_change_flags(priv->dev, priv->dev->flags & ~IFF_UP); */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 18:13:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 056DC695; Tue, 20 Aug 2013 18:13:16 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x229.google.com (mail-vc0-x229.google.com [IPv6:2607:f8b0:400c:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7007721DA; Tue, 20 Aug 2013 18:13:15 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id ib11so577894vcb.28 for ; Tue, 20 Aug 2013 11:13:14 -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:message-id:subject :from:to:cc:content-type; bh=knnUfl9PHVgzFl530Cf1XsprQlZbeAc9JoeL/KZH2pI=; b=kI7C1H9UTvlGqi6FQVxP29ISEmowiAgX2opRYjMKuly/tfvkgPguAYe5ziU/u++jcO WiMpmExjVYqFYPa8O26zG+FxukrWP8VAwmLTuYiqB3mRQQKfd7GqSQJDJ3akmhoxirzg yrslyL0pSLNvFYp0rKmJVmvCDDEkgzYATgv+Q/gQ9KKHb6wWaU3tz/LKb8g7R7LxIQfb l1Xhaq07RjIA+zGVy1B52yCk+OYsEFsHfdU93VYtc0wHLeg9+q4xLFpHLqBuj1KjGMBR mbQRt4PqxlQiZGHTtEikGq4B6X6uLwaQZZRw64TFPzKd31XeISC7q0ELE3rkbGtjMcgv 0uYw== MIME-Version: 1.0 X-Received: by 10.52.120.114 with SMTP id lb18mr1949741vdb.23.1377022394391; Tue, 20 Aug 2013 11:13:14 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Tue, 20 Aug 2013 11:13:14 -0700 (PDT) In-Reply-To: <5213AAA1.6020700@freebsd.org> References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> <5213AAA1.6020700@freebsd.org> Date: Tue, 20 Aug 2013 20:13:14 +0200 X-Google-Sender-Auth: G2g3t799u9D7qeP8IaWnee0SxNo Message-ID: Subject: Re: svn commit: r254524 - head/sys/sys From: Davide Italiano To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 18:13:16 -0000 On Tue, Aug 20, 2013 at 7:42 PM, Andre Oppermann wrote: > On 19.08.2013 19:37, Navdeep Parhar wrote: >> >> On 08/19/13 06:56, Andre Oppermann wrote: >>> >>> Author: andre >>> Date: Mon Aug 19 13:56:14 2013 >>> New Revision: 254524 >>> URL: http://svnweb.freebsd.org/changeset/base/254524 >>> >>> Log: >>> Add four additional M_PROTOFLAGS[9-12] for protocol specific use. >>> >>> Discussed with: trociny, glebius, adrian >>> >>> Modified: >>> head/sys/sys/mbuf.h >>> >>> Modified: head/sys/sys/mbuf.h >>> >>> ============================================================================== >>> --- head/sys/sys/mbuf.h Mon Aug 19 13:27:32 2013 (r254523) >>> +++ head/sys/sys/mbuf.h Mon Aug 19 13:56:14 2013 (r254524) >>> @@ -196,22 +196,24 @@ struct mbuf { >>> #define M_FRAG 0x00000800 /* packet is a fragment of a >>> larger packet */ >>> #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ >>> #define M_LASTFRAG 0x00002000 /* packet is last fragment */ >>> - /* 0x00004000 free */ >>> - /* 0x00008000 free */ >>> +#define M_PROTO9 0x00004000 /* protocol-specific */ >>> +#define M_PROTO10 0x00008000 /* protocol-specific */ >>> #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ >>> #define M_PROMISC 0x00020000 /* packet was not for us */ >>> - /* 0x00040000 free */ >>> +#define M_PROTO11 0x00040000 /* protocol-specific */ >>> #define M_PROTO6 0x00080000 /* protocol-specific */ >>> #define M_PROTO7 0x00100000 /* protocol-specific */ >>> #define M_PROTO8 0x00200000 /* protocol-specific */ >>> #define M_FLOWID 0x00400000 /* deprecated: flowid is valid >>> */ >>> +#define M_PROTO12 0x00800000 /* protocol-specific */ >>> #define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid >>> hash type */ >> >> >> Why reuse the freed up bits so soon (at least one of which I think was >> prematurely GC'ed -- see my other email on M_NOFREE). There was room >> beyond M_HASHTYPEBITS, no? > > > This is HEAD where kernel and modules have to be (re)compiled together > at any point in time. On stable this reuse would not have been possible. > > In a subsequent commit I compacted and ordered the flags. There's a couple > of free ones remaining. > > I have some additional mbuf changes coming up to be posted for possible > objections later today. The close HEAD freeze deadline has got me rushed > a bit to allow 10.x backporting of the checksum/offload overhaul. > > -- > Andre > In my opinion the possibility we have about breaking KPI/KBI should not be abused, even if it's allowed in HEAD. In other words,people should go for preserving it when (as in this case) it's easy and without additional costs. Your point about "this is HEAD, it can be broken at any time" makes relatively little sense to me. Note that in the worst case such KPI/KBI breakages are annoying for $VENDORS who maintain out-of-tree code, which need to rebuild/change their code, or, if they get pissed off, drop FreeBSD support. In your case, it's just a matter of "code cleaness" about few lines, which, IMHO and always IMHO, doesn't justify the breakage. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 18:22:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3D65AA57; Tue, 20 Aug 2013 18:22:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B6B2228D; Tue, 20 Aug 2013 18:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KIM5da046847; Tue, 20 Aug 2013 18:22:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KIM5Un046846; Tue, 20 Aug 2013 18:22:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201308201822.r7KIM5Un046846@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 20 Aug 2013 18:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254577 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 18:22:05 -0000 Author: np Date: Tue Aug 20 18:22:04 2013 New Revision: 254577 URL: http://svnweb.freebsd.org/changeset/base/254577 Log: Display P/N information in the description. Submitted by: gnn MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Aug 20 18:08:06 2013 (r254576) +++ head/sys/dev/cxgbe/t4_main.c Tue Aug 20 18:22:04 2013 (r254577) @@ -2549,9 +2549,9 @@ t4_set_desc(struct adapter *sc) char buf[128]; struct adapter_params *p = &sc->params; - snprintf(buf, sizeof(buf), "Chelsio %s %sNIC (rev %d), S/N:%s, E/C:%s", - p->vpd.id, is_offload(sc) ? "R" : "", chip_rev(sc), p->vpd.sn, - p->vpd.ec); + snprintf(buf, sizeof(buf), "Chelsio %s %sNIC (rev %d), S/N:%s, " + "P/N:%s, E/C:%s", p->vpd.id, is_offload(sc) ? "R" : "", + chip_rev(sc), p->vpd.sn, p->vpd.pn, p->vpd.ec); device_set_desc_copy(sc->dev, buf); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 19:13:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6A52A6AF; Tue, 20 Aug 2013 19:13:14 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 56FFF2590; Tue, 20 Aug 2013 19:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KJDEsR066629; Tue, 20 Aug 2013 19:13:14 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KJDENI066628; Tue, 20 Aug 2013 19:13:14 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201308201913.r7KJDENI066628@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 20 Aug 2013 19:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254578 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 19:13:14 -0000 Author: bryanv Date: Tue Aug 20 19:13:13 2013 New Revision: 254578 URL: http://svnweb.freebsd.org/changeset/base/254578 Log: MFC r254457 Do not use potentially stale thread in kthread_add() When an existing process is provided, the thread selected to use to initialize the new thread could have exited and be reaped. Acquire the proc lock earlier to ensure the thread remains valid. Modified: stable/9/sys/kern/kern_kthread.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_kthread.c ============================================================================== --- stable/9/sys/kern/kern_kthread.c Tue Aug 20 18:22:04 2013 (r254577) +++ stable/9/sys/kern/kern_kthread.c Tue Aug 20 19:13:13 2013 (r254578) @@ -257,18 +257,17 @@ kthread_add(void (*func)(void *), void * panic("kthread_add called too soon"); /* If no process supplied, put it on proc0 */ - if (p == NULL) { + if (p == NULL) p = &proc0; - oldtd = &thread0; - } else { - oldtd = FIRST_THREAD_IN_PROC(p); - } /* Initialize our new td */ newtd = thread_alloc(pages); if (newtd == NULL) return (ENOMEM); + PROC_LOCK(p); + oldtd = FIRST_THREAD_IN_PROC(p); + bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); /* XXX check if we should zero. */ @@ -293,7 +292,6 @@ kthread_add(void (*func)(void *), void * newtd->td_ucred = crhold(p->p_ucred); /* this code almost the same as create_thread() in kern_thr.c */ - PROC_LOCK(p); p->p_flag |= P_HADTHREADS; newtd->td_sigmask = oldtd->td_sigmask; /* XXX dubious */ thread_link(newtd, p); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 19:17:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BFC2B81A; Tue, 20 Aug 2013 19:17:01 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACA1725AE; Tue, 20 Aug 2013 19:17:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KJH1p0067373; Tue, 20 Aug 2013 19:17:01 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KJH1r3067372; Tue, 20 Aug 2013 19:17:01 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201308201917.r7KJH1r3067372@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 20 Aug 2013 19:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254579 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 19:17:01 -0000 Author: bryanv Date: Tue Aug 20 19:17:01 2013 New Revision: 254579 URL: http://svnweb.freebsd.org/changeset/base/254579 Log: MFC r254457 Do not use potentially stale thread in kthread_add() When an existing process is provided, the thread selected to use to initialize the new thread could have exited and be reaped. Acquire the proc lock earlier to ensure the thread remains valid. Modified: stable/8/sys/kern/kern_kthread.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_kthread.c ============================================================================== --- stable/8/sys/kern/kern_kthread.c Tue Aug 20 19:13:13 2013 (r254578) +++ stable/8/sys/kern/kern_kthread.c Tue Aug 20 19:17:01 2013 (r254579) @@ -256,18 +256,17 @@ kthread_add(void (*func)(void *), void * panic("kthread_add called too soon"); /* If no process supplied, put it on proc0 */ - if (p == NULL) { + if (p == NULL) p = &proc0; - oldtd = &thread0; - } else { - oldtd = FIRST_THREAD_IN_PROC(p); - } /* Initialize our new td */ newtd = thread_alloc(pages); if (newtd == NULL) return (ENOMEM); + PROC_LOCK(p); + oldtd = FIRST_THREAD_IN_PROC(p); + bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); bzero(&newtd->td_rux, sizeof(newtd->td_rux)); @@ -295,7 +294,6 @@ kthread_add(void (*func)(void *), void * newtd->td_ucred = crhold(p->p_ucred); /* this code almost the same as create_thread() in kern_thr.c */ - PROC_LOCK(p); p->p_flag |= P_HADTHREADS; newtd->td_sigmask = oldtd->td_sigmask; /* XXX dubious */ thread_link(newtd, p); From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 20:40:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B693DEE8; Tue, 20 Aug 2013 20:40:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89F4A2B00; Tue, 20 Aug 2013 20:40:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KKeKCY009164; Tue, 20 Aug 2013 20:40:20 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KKeK2A009163; Tue, 20 Aug 2013 20:40:20 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201308202040.r7KKeK2A009163@svn.freebsd.org> From: Andrew Turner Date: Tue, 20 Aug 2013 20:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254580 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 20:40:20 -0000 Author: andrew Date: Tue Aug 20 20:40:20 2013 New Revision: 254580 URL: http://svnweb.freebsd.org/changeset/base/254580 Log: Enable VFP on ARMADA XP. Modified: head/sys/arm/conf/ARMADAXP Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue Aug 20 19:17:01 2013 (r254579) +++ head/sys/arm/conf/ARMADAXP Tue Aug 20 20:40:20 2013 (r254580) @@ -37,6 +37,7 @@ options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING +options VFP options SMP From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 20:46:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9F8F5244; Tue, 20 Aug 2013 20:46:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C6062B77; Tue, 20 Aug 2013 20:46:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KKkTA1011367; Tue, 20 Aug 2013 20:46:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KKkT8S011366; Tue, 20 Aug 2013 20:46:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201308202046.r7KKkT8S011366@svn.freebsd.org> From: Dimitry Andric Date: Tue, 20 Aug 2013 20:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254581 - head/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 20:46:29 -0000 Author: dim Date: Tue Aug 20 20:46:29 2013 New Revision: 254581 URL: http://svnweb.freebsd.org/changeset/base/254581 Log: Pull in r188716 from upstream clang trunk: PR16727: don't try to evaluate a potentially value-dependent expression when checking for missing parens in &&/|| expressions. This fixes an assertion encountered when building the lang/sdcc port. Reported by: kwm Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Tue Aug 20 20:40:20 2013 (r254580) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Tue Aug 20 20:46:29 2013 (r254581) @@ -8884,14 +8884,16 @@ EmitDiagnosticForLogicalAndInLogicalOr(S /// 'true'. static bool EvaluatesAsTrue(Sema &S, Expr *E) { bool Res; - return E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && Res; + return !E->isValueDependent() && + E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && Res; } /// \brief Returns true if the given expression can be evaluated as a constant /// 'false'. static bool EvaluatesAsFalse(Sema &S, Expr *E) { bool Res; - return E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && !Res; + return !E->isValueDependent() && + E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && !Res; } /// \brief Look for '&&' in the left hand of a '||' expr. From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 20:51:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 11B90411; Tue, 20 Aug 2013 20:51:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9A862BEB; Tue, 20 Aug 2013 20:51:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KKpWtq014991; Tue, 20 Aug 2013 20:51:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KKpWHJ014990; Tue, 20 Aug 2013 20:51:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201308202051.r7KKpWHJ014990@svn.freebsd.org> From: Dimitry Andric Date: Tue, 20 Aug 2013 20:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254582 - head/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 20:51:33 -0000 Author: dim Date: Tue Aug 20 20:51:32 2013 New Revision: 254582 URL: http://svnweb.freebsd.org/changeset/base/254582 Log: Pull in r182983 from upstream clang trunk: Fix handling of braced-init-list as reference initializer within aggregate initialization. Previously we would incorrectly require an extra set of braces around such initializers. Pull in r188718 from upstream clang trunk: Handle init lists and _Atomic fields. Fixes PR16931. These fixes are needed for the atomic_flag type to work correctly in our stdatomic.h. Requested by: theraven Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Tue Aug 20 20:46:29 2013 (r254581) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Tue Aug 20 20:51:32 2013 (r254582) @@ -774,6 +774,11 @@ void InitListChecker::CheckSubElementTyp InitListExpr *StructuredList, unsigned &StructuredIndex) { Expr *expr = IList->getInit(Index); + + if (ElemType->isReferenceType()) + return CheckReferenceType(Entity, IList, ElemType, Index, + StructuredList, StructuredIndex); + if (InitListExpr *SubInitList = dyn_cast(expr)) { if (!ElemType->isRecordType() || ElemType->isAggregateType()) { unsigned newIndex = 0; @@ -793,13 +798,13 @@ void InitListChecker::CheckSubElementTyp // C++ initialization is handled later. } - if (ElemType->isScalarType()) { + // FIXME: Need to handle atomic aggregate types with implicit init lists. + if (ElemType->isScalarType() || ElemType->isAtomicType()) return CheckScalarType(Entity, IList, ElemType, Index, StructuredList, StructuredIndex); - } else if (ElemType->isReferenceType()) { - return CheckReferenceType(Entity, IList, ElemType, Index, - StructuredList, StructuredIndex); - } + + assert((ElemType->isRecordType() || ElemType->isVectorType() || + ElemType->isArrayType()) && "Unexpected type"); if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) { // arrayType can be incomplete if we're initializing a flexible From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 22:27:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0CCB07C0; Tue, 20 Aug 2013 22:27:07 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from aslan.scsiguy.com (mail.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C91042159; Tue, 20 Aug 2013 22:27:06 +0000 (UTC) Received: from [192.168.6.147] (207-225-98-3.dia.static.qwest.net [207.225.98.3]) (authenticated bits=0) by aslan.scsiguy.com (8.14.7/8.14.5) with ESMTP id r7KMR4jh007017 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 20 Aug 2013 22:27:05 GMT (envelope-from gibbs@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r254138 - in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/agp sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs... From: "Justin T. Gibbs" In-Reply-To: Date: Tue, 20 Aug 2013 16:26:59 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201308091111.r79BBCbY095386@svn.freebsd.org> <20130813142230.GE54133@acme.spoerlein.net> To: attilio@FreeBSD.org X-Mailer: Apple Mail (2.1508) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (aslan.scsiguy.com [70.89.174.89]); Tue, 20 Aug 2013 22:27:05 +0000 (UTC) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?iso-8859-1?Q?Ulrich_Sp=F6rlein?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 22:27:07 -0000 On Aug 13, 2013, at 8:59 AM, Attilio Rao wrote: > On Tue, Aug 13, 2013 at 4:22 PM, Ulrich Sp=F6rlein = wrote: >> On Fri, 2013-08-09 at 11:11:12 +0000, Attilio Rao wrote: >>> Author: attilio >>> Date: Fri Aug 9 11:11:11 2013 >>> New Revision: 254138 >>> URL: http://svnweb.freebsd.org/changeset/base/254138 >>>=20 >>> Log: >>> The soft and hard busy mechanism rely on the vm object lock to = work. >>> Unify the 2 concept into a real, minimal, sxlock where the shared >>> acquisition represent the soft busy and the exclusive acquisition >>> represent the hard busy. >>> The old VPO_WANTED mechanism becames the hard-path for this new = lock >>> and it becomes per-page rather than per-object. >>> The vm_object lock becames an interlock for this functionality: >>> it can be held in both read or write mode. >>> However, if the vm_object lock is held in read mode while acquiring >>> or releasing the busy state, the thread owner cannot make any >>> assumption on the busy state unless it is also busying it. >>>=20 >>> Also: >>> - Add a new flag to directly shared busy pages while vm_page_alloc >>> and vm_page_grab are being executed. This will be very helpful >>> once these functions happen under a read object lock. >>> - Move the swapping sleep into its own per-object flag >>>=20 >>> The KPI is heavilly changed this is why the version is bumped. >>> It is very likely that some VM ports users will need to change >>> their own code. >>>=20 >>> Sponsored by: EMC / Isilon storage division >>> Discussed with: alc >>> Reviewed by: jeff, kib >>> Tested by: gavin, bapt (older version) >>> Tested by: pho, scottl >>=20 >> The changes to sys/vm/vm_fault.c introduce a call to >> vm_page_sleep_if_busy() where the return code is not checked. The = other >> 5 places in the tree check the return code, please fix this here too. >> It's CID 1062398, and I would encourage folks to get an account with >> scan.coverity.com and have an eye on newly found defects. >=20 > Not true. > The same call existed also before with exactly the same semantic. > The trick there is that it is not important to check for the return > value because we are going to retry the operation anyway. > The code looks ok to me. >=20 > Attilio If this is the case, perhaps the call should be prefixed with "(void)". That would at least tell the next person reading the code that this is intentional. -- Justin= From owner-svn-src-all@FreeBSD.ORG Tue Aug 20 22:31:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55856942; Tue, 20 Aug 2013 22:31:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2809421A2; Tue, 20 Aug 2013 22:31:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7KMVEGw068301; Tue, 20 Aug 2013 22:31:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7KMVERi068300; Tue, 20 Aug 2013 22:31:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308202231.r7KMVERi068300@svn.freebsd.org> From: Xin LI Date: Tue, 20 Aug 2013 22:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 22:31:14 -0000 Author: delphij Date: Tue Aug 20 22:31:13 2013 New Revision: 254585 URL: http://svnweb.freebsd.org/changeset/base/254585 Log: MFV r254220: Illumos ZFS issues: 4039 zfs_rename()/zfs_link() needs stronger test for XDEV Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 20 21:47:07 2013 (r254584) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 20 22:31:13 2013 (r254585) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -3727,13 +3728,18 @@ zfs_rename(vnode_t *sdvp, char *snm, vno if (VOP_REALVP(tdvp, &realvp, ct) == 0) tdvp = realvp; - if (tdvp->v_vfsp != sdvp->v_vfsp || zfsctl_is_node(tdvp)) { + tdzp = VTOZ(tdvp); + ZFS_VERIFY_ZP(tdzp); + + /* + * We check z_zfsvfs rather than v_vfsp here, because snapshots and the + * ctldir appear to have the same v_vfsp. + */ + if (tdzp->z_zfsvfs != zfsvfs || zfsctl_is_node(tdvp)) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EXDEV)); } - tdzp = VTOZ(tdvp); - ZFS_VERIFY_ZP(tdzp); if (zfsvfs->z_utf8 && u8_validate(tnm, strlen(tnm), NULL, U8_VALIDATE_ENTIRE, &error) < 0) { ZFS_EXIT(zfsvfs); @@ -4293,14 +4299,18 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch return (SET_ERROR(EPERM)); } - if (svp->v_vfsp != tdvp->v_vfsp || zfsctl_is_node(svp)) { + szp = VTOZ(svp); + ZFS_VERIFY_ZP(szp); + + /* + * We check z_zfsvfs rather than v_vfsp here, because snapshots and the + * ctldir appear to have the same v_vfsp. + */ + if (szp->z_zfsvfs != zfsvfs || zfsctl_is_node(svp)) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EXDEV)); } - szp = VTOZ(svp); - ZFS_VERIFY_ZP(szp); - /* Prevent links to .zfs/shares files */ if ((error = sa_lookup(szp->z_sa_hdl, SA_ZPL_PARENT(zfsvfs), From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 00:04:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 983452E1; Wed, 21 Aug 2013 00:04:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8333D2554; Wed, 21 Aug 2013 00:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L04XpY016498; Wed, 21 Aug 2013 00:04:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L04W3l016438; Wed, 21 Aug 2013 00:04:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308210004.r7L04W3l016438@svn.freebsd.org> From: Xin LI Date: Wed, 21 Aug 2013 00:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254587 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 00:04:33 -0000 Author: delphij Date: Wed Aug 21 00:04:31 2013 New Revision: 254587 URL: http://svnweb.freebsd.org/changeset/base/254587 Log: MFV r254421: Illumos ZFS issues: 3996 want a libzfs_core API to rollback to latest snapshot Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 20 22:53:06 2013 (r254586) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Aug 21 00:04:31 2013 (r254587) @@ -3572,7 +3572,6 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand { rollback_data_t cb = { 0 }; int err; - zfs_cmd_t zc = { 0 }; boolean_t restore_resv = 0; uint64_t old_volsize, new_volsize; zfs_prop_t resv_prop; @@ -3604,22 +3603,15 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand (old_volsize == zfs_prop_get_int(zhp, resv_prop)); } - (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - - if (ZFS_IS_VOLUME(zhp)) - zc.zc_objset_type = DMU_OST_ZVOL; - else - zc.zc_objset_type = DMU_OST_ZFS; - /* * We rely on zfs_iter_children() to verify that there are no * newer snapshots for the given dataset. Therefore, we can * simply pass the name on to the ioctl() call. There is still * an unlikely race condition where the user has taken a * snapshot since we verified that this was the most recent. - * */ - if ((err = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_ROLLBACK, &zc)) != 0) { + err = lzc_rollback(zhp->zfs_name, NULL, 0); + if (err != 0) { (void) zfs_standard_error_fmt(zhp->zfs_hdl, errno, dgettext(TEXT_DOMAIN, "cannot rollback '%s'"), zhp->zfs_name); Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Tue Aug 20 22:53:06 2013 (r254586) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 21 00:04:31 2013 (r254587) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -628,3 +628,27 @@ out: free((void*)(uintptr_t)zc.zc_nvlist_dst); return (error); } + +/* + * Roll back this filesystem or volume to its most recent snapshot. + * If snapnamebuf is not NULL, it will be filled in with the name + * of the most recent snapshot. + * + * Return 0 on success or an errno on failure. + */ +int +lzc_rollback(const char *fsname, char *snapnamebuf, int snapnamelen) +{ + nvlist_t *args; + nvlist_t *result; + int err; + + args = fnvlist_alloc(); + err = lzc_ioctl(ZFS_IOC_ROLLBACK, fsname, args, &result); + nvlist_free(args); + if (err == 0 && snapnamebuf != NULL) { + const char *snapname = fnvlist_lookup_string(result, "target"); + (void) strlcpy(snapnamebuf, snapname, snapnamelen); + } + return (err); +} Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Tue Aug 20 22:53:06 2013 (r254586) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Aug 21 00:04:31 2013 (r254587) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Martin Matuska . All rights reserved. */ @@ -59,6 +59,7 @@ int lzc_send_space(const char *snapname, boolean_t lzc_exists(const char *dataset); +int lzc_rollback(const char *fsname, char *snapnamebuf, int snapnamelen); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Aug 20 22:53:06 2013 (r254586) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Aug 21 00:04:31 2013 (r254587) @@ -1802,6 +1802,7 @@ dsl_dataset_handoff_check(dsl_dataset_t typedef struct dsl_dataset_rollback_arg { const char *ddra_fsname; void *ddra_owner; + nvlist_t *ddra_result; } dsl_dataset_rollback_arg_t; static int @@ -1873,9 +1874,13 @@ dsl_dataset_rollback_sync(void *arg, dmu dsl_pool_t *dp = dmu_tx_pool(tx); dsl_dataset_t *ds, *clone; uint64_t cloneobj; + char namebuf[ZFS_MAXNAMELEN]; VERIFY0(dsl_dataset_hold(dp, ddra->ddra_fsname, FTAG, &ds)); + dsl_dataset_name(ds->ds_prev, namebuf); + fnvlist_add_string(ddra->ddra_result, "target", namebuf); + cloneobj = dsl_dataset_create_sync(ds->ds_dir, "%rollback", ds->ds_prev, DS_CREATE_FLAG_NODIRTY, kcred, tx); @@ -1891,8 +1896,11 @@ dsl_dataset_rollback_sync(void *arg, dmu } /* - * If owner != NULL: + * Rolls back the given filesystem or volume to the most recent snapshot. + * The name of the most recent snapshot will be returned under key "target" + * in the result nvlist. * + * If owner != NULL: * - The existing dataset MUST be owned by the specified owner at entry * - Upon return, dataset will still be held by the same owner, whether we * succeed or not. @@ -1901,15 +1909,16 @@ dsl_dataset_rollback_sync(void *arg, dmu * notes above zfs_suspend_fs() for further details. */ int -dsl_dataset_rollback(const char *fsname, void *owner) +dsl_dataset_rollback(const char *fsname, void *owner, nvlist_t *result) { dsl_dataset_rollback_arg_t ddra; ddra.ddra_fsname = fsname; ddra.ddra_owner = owner; + ddra.ddra_result = result; return (dsl_sync_task(fsname, dsl_dataset_rollback_check, - dsl_dataset_rollback_sync, (void *)&ddra, 1)); + dsl_dataset_rollback_sync, &ddra, 1)); } struct promotenode { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Aug 20 22:53:06 2013 (r254586) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Aug 21 00:04:31 2013 (r254587) @@ -265,7 +265,7 @@ int dsl_dataset_snap_lookup(dsl_dataset_ int dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx); void dsl_dataset_set_refreservation_sync_impl(dsl_dataset_t *ds, zprop_source_t source, uint64_t value, dmu_tx_t *tx); -int dsl_dataset_rollback(const char *fsname, void *owner); +int dsl_dataset_rollback(const char *fsname, void *owner, nvlist_t *result); #ifdef ZFS_DEBUG #define dprintf_ds(ds, fmt, ...) do { \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Aug 20 22:53:06 2013 (r254586) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 21 00:04:31 2013 (r254587) @@ -3550,29 +3550,32 @@ zfs_ioc_destroy(zfs_cmd_t *zc) } /* - * inputs: - * zc_name name of dataset to rollback (to most recent snapshot) + * fsname is name of dataset to rollback (to most recent snapshot) * - * outputs: none + * innvl is not used. + * + * outnvl: "target" -> name of most recent snapshot + * } */ +/* ARGSUSED */ static int -zfs_ioc_rollback(zfs_cmd_t *zc) +zfs_ioc_rollback(const char *fsname, nvlist_t *args, nvlist_t *outnvl) { zfsvfs_t *zfsvfs; int error; - if (getzfsvfs(zc->zc_name, &zfsvfs) == 0) { + if (getzfsvfs(fsname, &zfsvfs) == 0) { error = zfs_suspend_fs(zfsvfs); if (error == 0) { int resume_err; - error = dsl_dataset_rollback(zc->zc_name, zfsvfs); - resume_err = zfs_resume_fs(zfsvfs, zc->zc_name); + error = dsl_dataset_rollback(fsname, zfsvfs, outnvl); + resume_err = zfs_resume_fs(zfsvfs, fsname); error = error ? error : resume_err; } VFS_RELE(zfsvfs->z_vfs); } else { - error = dsl_dataset_rollback(zc->zc_name, NULL); + error = dsl_dataset_rollback(fsname, NULL, outnvl); } return (error); } @@ -5446,6 +5449,10 @@ zfs_ioctl_init(void) zfs_ioc_get_holds, zfs_secpolicy_read, DATASET_NAME, POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE); + zfs_ioctl_register("rollback", ZFS_IOC_ROLLBACK, + zfs_ioc_rollback, zfs_secpolicy_rollback, DATASET_NAME, + POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_TRUE); + /* IOCTLS that use the legacy function signature */ zfs_ioctl_register_legacy(ZFS_IOC_POOL_FREEZE, zfs_ioc_pool_freeze, @@ -5557,8 +5564,6 @@ zfs_ioctl_init(void) zfs_secpolicy_none); zfs_ioctl_register_dataset_modify(ZFS_IOC_DESTROY, zfs_ioc_destroy, zfs_secpolicy_destroy); - zfs_ioctl_register_dataset_modify(ZFS_IOC_ROLLBACK, zfs_ioc_rollback, - zfs_secpolicy_rollback); zfs_ioctl_register_dataset_modify(ZFS_IOC_RENAME, zfs_ioc_rename, zfs_secpolicy_rename); zfs_ioctl_register_dataset_modify(ZFS_IOC_RECV, zfs_ioc_recv, From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 04:05:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DC843242; Wed, 21 Aug 2013 04:05:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA4C521F2; Wed, 21 Aug 2013 04:05:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L456Md044144; Wed, 21 Aug 2013 04:05:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L456DY044143; Wed, 21 Aug 2013 04:05:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308210405.r7L456DY044143@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 04:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254589 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 04:05:06 -0000 Author: ian Date: Wed Aug 21 04:05:06 2013 New Revision: 254589 URL: http://svnweb.freebsd.org/changeset/base/254589 Log: Check for generic ns16550 after all other types. A device may be compatible with 16550 but also have a more specific/capable driver earlier in the list. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Wed Aug 21 02:14:23 2013 (r254588) +++ head/sys/dev/uart/uart_bus_fdt.c Wed Aug 21 04:05:06 2013 (r254589) @@ -101,9 +101,7 @@ uart_fdt_probe(device_t dev) int err; sc = device_get_softc(dev); - if (ofw_bus_is_compatible(dev, "ns16550")) - sc->sc_class = &uart_ns8250_class; - else if (ofw_bus_is_compatible(dev, "lpc,uart")) + if (ofw_bus_is_compatible(dev, "lpc,uart")) sc->sc_class = &uart_lpc_class; else if (ofw_bus_is_compatible(dev, "fsl,imx-uart")) sc->sc_class = &uart_imx_class; @@ -113,6 +111,8 @@ uart_fdt_probe(device_t dev) sc->sc_class = &uart_s3c2410_class; else if (ofw_bus_is_compatible(dev, "cadence,uart")) sc->sc_class = &uart_cdnc_class; + else if (ofw_bus_is_compatible(dev, "ns16550")) + sc->sc_class = &uart_ns8250_class; else return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 04:08:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9BB03B9; Wed, 21 Aug 2013 04:08:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7132220A; Wed, 21 Aug 2013 04:08:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L48w15045490; Wed, 21 Aug 2013 04:08:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L48w2X045489; Wed, 21 Aug 2013 04:08:58 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308210408.r7L48w2X045489@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 04:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254590 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 04:08:58 -0000 Author: ian Date: Wed Aug 21 04:08:58 2013 New Revision: 254590 URL: http://svnweb.freebsd.org/changeset/base/254590 Log: Use an if/else sequence rather than unrelated if statements, so that a device compatible with multiple drivers matches the more specific driver first and doesn't overwrite it later with the more generic. Move the generic ns16550 to the end of the list. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 04:05:06 2013 (r254589) +++ head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 04:08:58 2013 (r254590) @@ -141,18 +141,18 @@ uart_cpu_getdev(int devtype, struct uart */ if (fdt_is_compatible(node, "fsl,imx-uart")) class = &uart_imx_class; - if (fdt_is_compatible(node, "quicc")) + else if (fdt_is_compatible(node, "quicc")) class = &uart_quicc_class; - if (fdt_is_compatible(node, "lpc")) + else if (fdt_is_compatible(node, "lpc")) class = &uart_lpc_class; - if (fdt_is_compatible(node, "ns16550")) - class = &uart_ns8250_class; - if (fdt_is_compatible(node, "arm,pl011")) + else if (fdt_is_compatible(node, "arm,pl011")) class = &uart_pl011_class; - if (fdt_is_compatible(node, "exynos")) + else if (fdt_is_compatible(node, "exynos")) class = &uart_s3c2410_class; - if (fdt_is_compatible(node, "cadence,uart")) + else if (fdt_is_compatible(node, "cadence,uart")) class = &uart_cdnc_class; + else if (fdt_is_compatible(node, "ns16550")) + class = &uart_ns8250_class; di->bas.chan = 0; di->bas.regshft = (u_int)shift; From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 04:10:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6DB46FF; Wed, 21 Aug 2013 04:10:30 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 918A72224; Wed, 21 Aug 2013 04:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L4AUmg047835; Wed, 21 Aug 2013 04:10:30 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L4APrN047641; Wed, 21 Aug 2013 04:10:25 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201308210410.r7L4APrN047641@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Aug 2013 04:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254591 - in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/commo... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 04:10:30 -0000 Author: gibbs Date: Wed Aug 21 04:10:24 2013 New Revision: 254591 URL: http://svnweb.freebsd.org/changeset/base/254591 Log: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices. Use this information to automatically increase ZFS's minimum allocation size for new top-level vdevs to a value that more closely matches the optimum device allocation size. Use GEOM's stripesize attribute, if set, as the physical sector size of the GEOM. Calculate the minimum blocksize of each metaslab class. Use the calculated value instead of SPA_MINBLOCKSIZE (512b) when determining the likelyhood of compression yeilding a reduction in physical space usage. Report devices with sub-optimal block size configuration in "zpool status". Also properly fail attempts to attach devices with a logical block size greater than 8kB, since this will cause corruption to ZFS's label area. Sponsored by: Spectra Logic Corporaion MFC after: 2 weeks Background ========== Many modern devices use physical allocation units that are much larger than the minimum logical allocation size accessible by external commands. Two prevalent examples of this are 512e disk drives (512b logical sector, 4K physical sector) and flash devices (512b logical sector, 4K or larger allocation block size, and 128k or larger erase block size). Operations that modify less than the physical sector size result in a costly read-modify-write or garbage collection sequence on these devices. Simply exporting the true physical sector of the device to ZFS would yield optimal performance, but has two serious drawbacks: 1) Existing pools created with devices that have different logical and physical block sizes, but were configured to use the logical block size (e.g. because the OS version used for pool construction reported the logical block size instead of the physical block size) will suddenly find that the vdev allocation size has increased. This can be easily tolerated for active members of the array, but ZFS would prevent replacement of a vdev with another identical device because it now appears that the smaller allocation size required by the pool is not supported by the new device. 2) The device's physical block size may be too large to be supported by ZFS. The optimal allocation size for the vdev may be quite large. For example, a RAID controller may export a vdev that requires read-modify-write cycles unless accessed using 64k aligned/sized requests. ZFS currently has an 8k minimum block size limit. Reporting both the logical and physical allocation sizes for vdevs solves these problems. A device may be used so long as the logical block size is compatible with the configuration. By comparing the logical and physical block sizes, new configurations can be optimized and administrators can be notified of any existing pools that are sub-optimal. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: Add the SPA_ASHIFT constant. ZFS currently has a hard upper limit of 13 (8k) for ashift and this constant is used to both document and enforce this limit. sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h: Add the VDEV_AUX_ASHIFT_TOO_BIG error code. Add fields for exporting the configured, logical, and physical ashift to the vdev_stat_t structure. Add VDEV_STAT_VALID() macro which can be used to verify the presence of required vdev_stat_t fields in nvlist data. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c: Provide a SYSCTL_PROC handler for "max_auto_ashift". Since the limit is only referenced long after boot when a create operation occurs, there's no compelling need for it to be a boot time configurable tunable. This also allows the validation code for the max_auto_ashift value to be contained within the sysctl handler. Populate the new fields in the vdev_stat_t structure. Fail vdev opens if the vdev reports an ashift larger than SPA_MAXASHIFT. Propogate vdev_logical_ashift and vdev_physical_ashift between child and parent vdevs as is done for vdev_ashift. In vdev_open(), restore code that fails opens for devices where vdev_ashift grows. This can only happen now if the device's logical ashift grows, which means it really isn't safe to use the device. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c: Update the vdev_open() API so that both logical (what was just ashift before) and physical ashift are reported. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h: Add two new fields, vdev_physical_ashift and vdev_logical_ashift, to vdev_t. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: Add vdev_ashift_optimize(). Call it anytime a new top-level vdev is allocated. cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: Add text for the VDEV_AUX_ASHIFT_TOO_BIG error. For each sub-optimally configured leaf vdev, report configured and native block sizes. cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c: Introduce a new zpool status: ZPOOL_STATUS_NON_NATIVE_ASHIFT. This status is reported on healthy pools containing vdevs configured to use a block size smaller than their reported physical block size. cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c: Update find_vdev_problem() and supporting functions to provide the full vdev_stat_t structure to problem checking routines, and to allow decent into replacing vdevs. Add a vdev_non_native_ashift() validator which is used on the full vdev tree to check for ZPOOL_STATUS_NON_NATIVE_ASHIFT. cddl/contrib/opensolaris/lib/libzpool/common/kernel.c: cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h: Enhance sysctl userland stubs now that a SYSCTL_PROC handler is used in vdev.c. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h: When the group membership of a metaslab class changes (i.e. when a vdev is added or removed from a pool), walk the group list to determine the smallest block size currently available and record this in the metaslab class. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c: Add the metaslab_class_get_minblocksize() accessor. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c: In zio_compress_data(), take the minimum blocksize as an input parameter instead of assuming SPA_MINBLOCKSIZE. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c: In l2arc_compress_buf(), pass SPA_MINBLOCKSIZE as the minimum blocksize of the device. The l2arc code performs has it's own code for deciding if compression is worth while, so this effectively disables zio_compress_data() from second guessing the original decision. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c: In zio_write_bp_init(), use the minimum blocksize of the normal metaslab class when compressing data. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Aug 21 04:10:24 2013 (r254591) @@ -1295,12 +1295,13 @@ print_status_config(zpool_handle_t *zhp, int namewidth, int depth, boolean_t isspare) { nvlist_t **child; - uint_t c, children; + uint_t c, vsc, children; pool_scan_stat_t *ps = NULL; vdev_stat_t *vs; char rbuf[6], wbuf[6], cbuf[6]; char *vname; uint64_t notpresent; + uint64_t ashift; spare_cbdata_t cb; const char *state; @@ -1309,7 +1310,7 @@ print_status_config(zpool_handle_t *zhp, children = 0; verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &c) == 0); + (uint64_t **)&vs, &vsc) == 0); state = zpool_state_to_name(vs->vs_state, vs->vs_aux); if (isspare) { @@ -1363,6 +1364,10 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("unsupported feature(s)")); break; + case VDEV_AUX_ASHIFT_TOO_BIG: + (void) printf(gettext("unsupported minimum blocksize")); + break; + case VDEV_AUX_SPARED: verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &cb.cb_guid) == 0); @@ -1405,6 +1410,12 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("corrupted data")); break; } + } else if (children == 0 && !isspare && + VDEV_STAT_VALID(vs_physical_ashift, vsc) && + vs->vs_configured_ashift < vs->vs_physical_ashift) { + (void) printf( + gettext(" block size: %dB configured, %dB native"), + 1 << vs->vs_configured_ashift, 1 << vs->vs_physical_ashift); } (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, @@ -4268,6 +4279,15 @@ status_callback(zpool_handle_t *zhp, voi "'zpool clear'.\n")); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + (void) printf(gettext("status: One or more devices are " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + (void) printf(gettext("action: Replace affected devices with " + "devices that support the\n\tconfigured block size, or " + "migrate data to a properly configured\n\tpool.\n")); + break; + default: /* * The remaining errors can't actually be generated, yet. Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Aug 21 04:10:24 2013 (r254591) @@ -326,6 +326,7 @@ typedef enum { ZPOOL_STATUS_RESILVERING, /* device being resilvered */ ZPOOL_STATUS_OFFLINE_DEV, /* device online */ ZPOOL_STATUS_REMOVED_DEV, /* removed device */ + ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */ /* * Finally, the following indicates a healthy pool. Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Wed Aug 21 04:10:24 2013 (r254591) @@ -73,57 +73,66 @@ static char *zfs_msgid_table[] = { /* ARGSUSED */ static int -vdev_missing(uint64_t state, uint64_t aux, uint64_t errs) +vdev_missing(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_CANT_OPEN && - aux == VDEV_AUX_OPEN_FAILED); + return (vs->vs_state == VDEV_STATE_CANT_OPEN && + vs->vs_aux == VDEV_AUX_OPEN_FAILED); } /* ARGSUSED */ static int -vdev_faulted(uint64_t state, uint64_t aux, uint64_t errs) +vdev_faulted(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_FAULTED); + return (vs->vs_state == VDEV_STATE_FAULTED); } /* ARGSUSED */ static int -vdev_errors(uint64_t state, uint64_t aux, uint64_t errs) +vdev_errors(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_DEGRADED || errs != 0); + return (vs->vs_state == VDEV_STATE_DEGRADED || + vs->vs_read_errors != 0 || vs->vs_write_errors != 0 || + vs->vs_checksum_errors != 0); } /* ARGSUSED */ static int -vdev_broken(uint64_t state, uint64_t aux, uint64_t errs) +vdev_broken(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_CANT_OPEN); + return (vs->vs_state == VDEV_STATE_CANT_OPEN); } /* ARGSUSED */ static int -vdev_offlined(uint64_t state, uint64_t aux, uint64_t errs) +vdev_offlined(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_OFFLINE); + return (vs->vs_state == VDEV_STATE_OFFLINE); } /* ARGSUSED */ static int -vdev_removed(uint64_t state, uint64_t aux, uint64_t errs) +vdev_removed(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_REMOVED); + return (vs->vs_state == VDEV_STATE_REMOVED); +} + +static int +vdev_non_native_ashift(vdev_stat_t *vs, uint_t vsc) +{ + return (VDEV_STAT_VALID(vs_physical_ashift, vsc) && + vs->vs_configured_ashift < vs->vs_physical_ashift); } /* * Detect if any leaf devices that have seen errors or could not be opened. */ static boolean_t -find_vdev_problem(nvlist_t *vdev, int (*func)(uint64_t, uint64_t, uint64_t)) +find_vdev_problem(nvlist_t *vdev, int (*func)(vdev_stat_t *, uint_t), + boolean_t ignore_replacing) { nvlist_t **child; vdev_stat_t *vs; - uint_t c, children; - char *type; + uint_t c, vsc, children; /* * Ignore problems within a 'replacing' vdev, since we're presumably in @@ -131,23 +140,25 @@ find_vdev_problem(nvlist_t *vdev, int (* * out again. We'll pick up the fact that a resilver is happening * later. */ - verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0); - if (strcmp(type, VDEV_TYPE_REPLACING) == 0) - return (B_FALSE); + if (ignore_replacing == B_TRUE) { + char *type; + + verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, + &type) == 0); + if (strcmp(type, VDEV_TYPE_REPLACING) == 0) + return (B_FALSE); + } if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child, &children) == 0) { for (c = 0; c < children; c++) - if (find_vdev_problem(child[c], func)) + if (find_vdev_problem(child[c], func, ignore_replacing)) return (B_TRUE); } else { verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &c) == 0); + (uint64_t **)&vs, &vsc) == 0); - if (func(vs->vs_state, vs->vs_aux, - vs->vs_read_errors + - vs->vs_write_errors + - vs->vs_checksum_errors)) + if (func(vs, vsc) != 0) return (B_TRUE); } @@ -157,7 +168,7 @@ find_vdev_problem(nvlist_t *vdev, int (* if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child, &children) == 0) { for (c = 0; c < children; c++) - if (find_vdev_problem(child[c], func)) + if (find_vdev_problem(child[c], func, ignore_replacing)) return (B_TRUE); } @@ -270,15 +281,15 @@ check_status(nvlist_t *config, boolean_t * Bad devices in non-replicated config. */ if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_faulted)) + find_vdev_problem(nvroot, vdev_faulted, B_TRUE)) return (ZPOOL_STATUS_FAULTED_DEV_NR); if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_missing)) + find_vdev_problem(nvroot, vdev_missing, B_TRUE)) return (ZPOOL_STATUS_MISSING_DEV_NR); if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_broken)) + find_vdev_problem(nvroot, vdev_broken, B_TRUE)) return (ZPOOL_STATUS_CORRUPT_LABEL_NR); /* @@ -300,32 +311,38 @@ check_status(nvlist_t *config, boolean_t /* * Missing devices in a replicated config. */ - if (find_vdev_problem(nvroot, vdev_faulted)) + if (find_vdev_problem(nvroot, vdev_faulted, B_TRUE)) return (ZPOOL_STATUS_FAULTED_DEV_R); - if (find_vdev_problem(nvroot, vdev_missing)) + if (find_vdev_problem(nvroot, vdev_missing, B_TRUE)) return (ZPOOL_STATUS_MISSING_DEV_R); - if (find_vdev_problem(nvroot, vdev_broken)) + if (find_vdev_problem(nvroot, vdev_broken, B_TRUE)) return (ZPOOL_STATUS_CORRUPT_LABEL_R); /* * Devices with errors */ - if (!isimport && find_vdev_problem(nvroot, vdev_errors)) + if (!isimport && find_vdev_problem(nvroot, vdev_errors, B_TRUE)) return (ZPOOL_STATUS_FAILING_DEV); /* * Offlined devices */ - if (find_vdev_problem(nvroot, vdev_offlined)) + if (find_vdev_problem(nvroot, vdev_offlined, B_TRUE)) return (ZPOOL_STATUS_OFFLINE_DEV); /* * Removed device */ - if (find_vdev_problem(nvroot, vdev_removed)) + if (find_vdev_problem(nvroot, vdev_removed, B_TRUE)) return (ZPOOL_STATUS_REMOVED_DEV); /* + * Suboptimal, but usable, ashift configuration. + */ + if (find_vdev_problem(nvroot, vdev_non_native_ashift, B_FALSE)) + return (ZPOOL_STATUS_NON_NATIVE_ASHIFT); + + /* * Outdated, but usable, version */ if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed Aug 21 04:10:24 2013 (r254591) @@ -591,6 +591,12 @@ dprintf_setup(int *argc, char **argv) dprintf_print_all = 1; } +int +sysctl_handle_64(SYSCTL_HANDLER_ARGS) +{ + return (0); +} + /* * ========================================================================= * debug printfs Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed Aug 21 04:10:24 2013 (r254591) @@ -659,11 +659,55 @@ typedef uint32_t idmap_rid_t; #define SX_SYSINIT(name, lock, desc) +#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \ + intptr_t arg2, struct sysctl_req *req + +/* + * This describes the access space for a sysctl request. This is needed + * so that we can use the interface from the kernel or from user-space. + */ +struct sysctl_req { + struct thread *td; /* used for access checking */ + int lock; /* wiring state */ + void *oldptr; + size_t oldlen; + size_t oldidx; + int (*oldfunc)(struct sysctl_req *, const void *, size_t); + void *newptr; + size_t newlen; + size_t newidx; + int (*newfunc)(struct sysctl_req *, void *, size_t); + size_t validlen; + int flags; +}; + +SLIST_HEAD(sysctl_oid_list, sysctl_oid); + +/* + * This describes one "oid" in the MIB tree. Potentially more nodes can + * be hidden behind it, expanded by the handler. + */ +struct sysctl_oid { + struct sysctl_oid_list *oid_parent; + SLIST_ENTRY(sysctl_oid) oid_link; + int oid_number; + u_int oid_kind; + void *oid_arg1; + intptr_t oid_arg2; + const char *oid_name; + int (*oid_handler)(SYSCTL_HANDLER_ARGS); + const char *oid_fmt; + int oid_refcnt; + u_int oid_running; + const char *oid_descr; +}; + #define SYSCTL_DECL(...) #define SYSCTL_NODE(...) #define SYSCTL_INT(...) #define SYSCTL_UINT(...) #define SYSCTL_ULONG(...) +#define SYSCTL_PROC(...) #define SYSCTL_QUAD(...) #define SYSCTL_UQUAD(...) #ifdef TUNABLE_INT @@ -675,6 +719,8 @@ typedef uint32_t idmap_rid_t; #define TUNABLE_ULONG(...) #define TUNABLE_QUAD(...) +int sysctl_handle_64(SYSCTL_HANDLER_ARGS); + /* Errors */ #ifndef ERESTART Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Aug 21 04:10:24 2013 (r254591) @@ -5147,7 +5147,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize); + cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); if (csize == 0) { /* zero block, indicate that there's nothing to write */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Aug 21 04:10:24 2013 (r254591) @@ -180,6 +180,27 @@ metaslab_class_space_update(metaslab_cla atomic_add_64(&mc->mc_dspace, dspace_delta); } +void +metaslab_class_minblocksize_update(metaslab_class_t *mc) +{ + metaslab_group_t *mg; + vdev_t *vd; + uint64_t minashift = UINT64_MAX; + + if ((mg = mc->mc_rotor) == NULL) { + mc->mc_minblocksize = SPA_MINBLOCKSIZE; + return; + } + + do { + vd = mg->mg_vd; + if (vd->vdev_ashift < minashift) + minashift = vd->vdev_ashift; + } while ((mg = mg->mg_next) != mc->mc_rotor); + + mc->mc_minblocksize = 1ULL << minashift; +} + uint64_t metaslab_class_get_alloc(metaslab_class_t *mc) { @@ -204,6 +225,12 @@ metaslab_class_get_dspace(metaslab_class return (spa_deflate(mc->mc_spa) ? mc->mc_dspace : mc->mc_space); } +uint64_t +metaslab_class_get_minblocksize(metaslab_class_t *mc) +{ + return (mc->mc_minblocksize); +} + /* * ========================================================================== * Metaslab groups @@ -295,6 +322,7 @@ metaslab_group_activate(metaslab_group_t mgnext->mg_prev = mg; } mc->mc_rotor = mg; + metaslab_class_minblocksize_update(mc); } void @@ -326,6 +354,7 @@ metaslab_group_passivate(metaslab_group_ mg->mg_prev = NULL; mg->mg_next = NULL; + metaslab_class_minblocksize_update(mc); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Aug 21 04:10:24 2013 (r254591) @@ -3424,6 +3424,7 @@ spa_create(const char *pool, nvlist_t *n (error = spa_validate_aux(spa, nvroot, txg, VDEV_ALLOC_ADD)) == 0) { for (int c = 0; c < rvd->vdev_children; c++) { + vdev_ashift_optimize(rvd->vdev_child[c]); vdev_metaslab_set_size(rvd->vdev_child[c]); vdev_expand(rvd->vdev_child[c], txg); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Wed Aug 21 04:10:24 2013 (r254591) @@ -519,8 +519,10 @@ spa_config_update(spa_t *spa, int what) */ for (c = 0; c < rvd->vdev_children; c++) { vdev_t *tvd = rvd->vdev_child[c]; - if (tvd->vdev_ms_array == 0) + if (tvd->vdev_ms_array == 0) { + vdev_ashift_optimize(tvd); vdev_metaslab_set_size(tvd); + } vdev_expand(tvd, txg); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Wed Aug 21 04:10:24 2013 (r254591) @@ -70,6 +70,7 @@ extern uint64_t metaslab_class_get_alloc extern uint64_t metaslab_class_get_space(metaslab_class_t *mc); extern uint64_t metaslab_class_get_dspace(metaslab_class_t *mc); extern uint64_t metaslab_class_get_deferred(metaslab_class_t *mc); +extern uint64_t metaslab_class_get_minblocksize(metaslab_class_t *mc); extern metaslab_group_t *metaslab_group_create(metaslab_class_t *mc, vdev_t *vd); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Wed Aug 21 04:10:24 2013 (r254591) @@ -49,6 +49,7 @@ struct metaslab_class { uint64_t mc_deferred; /* total deferred frees */ uint64_t mc_space; /* total space (alloc + free) */ uint64_t mc_dspace; /* total deflated space */ + uint64_t mc_minblocksize; }; struct metaslab_group { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Wed Aug 21 04:10:24 2013 (r254591) @@ -93,6 +93,17 @@ struct dsl_dataset; #define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) /* + * Maximum supported logical ashift. + * + * The current 8k allocation block size limit is due to the 8k + * aligned/sized operations performed by vdev_probe() on + * vdev_label->vl_pad2. Using another "safe region" for these tests + * would allow the limit to be raised to 16k, at the expense of + * only having 8 available uberblocks in the label area. + */ +#define SPA_MAXASHIFT 13 + +/* * Size of block to hold the configuration data (a packed nvlist) */ #define SPA_CONFIG_BLOCKSIZE (1ULL << 14) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Aug 21 04:10:24 2013 (r254591) @@ -78,6 +78,7 @@ extern void vdev_rele(vdev_t *); extern int vdev_metaslab_init(vdev_t *vd, uint64_t txg); extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); +extern void vdev_ashift_optimize(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); extern void vdev_deadman(vdev_t *vd); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Aug 21 04:10:24 2013 (r254591) @@ -57,7 +57,7 @@ typedef struct vdev_cache_entry vdev_cac * Virtual device operations */ typedef int vdev_open_func_t(vdev_t *vd, uint64_t *size, uint64_t *max_size, - uint64_t *ashift); + uint64_t *logical_ashift, uint64_t *physical_ashift); typedef void vdev_close_func_t(vdev_t *vd); typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); typedef int vdev_io_start_func_t(zio_t *zio); @@ -123,6 +123,24 @@ struct vdev { uint64_t vdev_min_asize; /* min acceptable asize */ uint64_t vdev_max_asize; /* max acceptable asize */ uint64_t vdev_ashift; /* block alignment shift */ + /* + * Logical block alignment shift + * + * The smallest sized/aligned I/O supported by the device. + */ + uint64_t vdev_logical_ashift; + /* + * Physical block alignment shift + * + * The device supports logical I/Os with vdev_logical_ashift + * size/alignment, but optimum performance will be achieved by + * aligning/sizing requests to vdev_physical_ashift. Smaller + * requests may be inflated or incur device level read-modify-write + * operations. + * + * May be 0 to indicate no preference (i.e. use vdev_logical_ashift). + */ + uint64_t vdev_physical_ashift; uint64_t vdev_state; /* see VDEV_STATE_* #defines */ uint64_t vdev_prevstate; /* used when reopening a vdev */ vdev_ops_t *vdev_ops; /* vdev operations */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Wed Aug 21 04:10:24 2013 (r254591) @@ -79,7 +79,7 @@ extern int lz4_decompress(void *src, voi * Compress and decompress data if necessary. */ extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst, - size_t s_len); + size_t s_len, size_t minblocksize); extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Aug 21 04:10:24 2013 (r254591) @@ -52,6 +52,51 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * Virtual device management. */ +/** + * The limit for ZFS to automatically increase a top-level vdev's ashift + * from logical ashift to physical ashift. + * + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 12 (4096 bytes) + * zfs_max_auto_ashift = 11 (2048 bytes) + * + * On pool creation or the addition of a new top-leve vdev, ZFS will + * bump the ashift of the top-level vdev to 2048. + * + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 12 (4096 bytes) + * zfs_max_auto_ashift = 13 (8192 bytes) + * + * On pool creation or the addition of a new top-leve vdev, ZFS will + * bump the ashift of the top-level vdev to 4096. + */ +static uint64_t zfs_max_auto_ashift = SPA_MAXASHIFT; + +static int +sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int err; + + val = zfs_max_auto_ashift; + err = sysctl_handle_64(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val > SPA_MAXASHIFT) + val = SPA_MAXASHIFT; + + zfs_max_auto_ashift = val; + + return (0); +} +SYSCTL_PROC(_vfs_zfs, OID_AUTO, max_auto_ashift, + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_vfs_zfs_max_auto_ashift, "QU", + "Cap on logical -> physical ashift adjustment on new top-level vdevs."); + static vdev_ops_t *vdev_ops_table[] = { &vdev_root_ops, &vdev_raidz_ops, @@ -746,6 +791,8 @@ vdev_add_parent(vdev_t *cvd, vdev_ops_t mvd->vdev_min_asize = cvd->vdev_min_asize; mvd->vdev_max_asize = cvd->vdev_max_asize; mvd->vdev_ashift = cvd->vdev_ashift; + mvd->vdev_logical_ashift = cvd->vdev_logical_ashift; + mvd->vdev_physical_ashift = cvd->vdev_physical_ashift; mvd->vdev_state = cvd->vdev_state; mvd->vdev_crtxg = cvd->vdev_crtxg; @@ -777,6 +824,8 @@ vdev_remove_parent(vdev_t *cvd) mvd->vdev_ops == &vdev_replacing_ops || mvd->vdev_ops == &vdev_spare_ops); cvd->vdev_ashift = mvd->vdev_ashift; + cvd->vdev_logical_ashift = mvd->vdev_logical_ashift; + cvd->vdev_physical_ashift = mvd->vdev_physical_ashift; vdev_remove_child(mvd, cvd); vdev_remove_child(pvd, mvd); @@ -1120,7 +1169,8 @@ vdev_open(vdev_t *vd) uint64_t osize = 0; uint64_t max_osize = 0; uint64_t asize, max_asize, psize; - uint64_t ashift = 0; + uint64_t logical_ashift = 0; + uint64_t physical_ashift = 0; ASSERT(vd->vdev_open_thread == curthread || spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); @@ -1150,7 +1200,8 @@ vdev_open(vdev_t *vd) return (SET_ERROR(ENXIO)); } - error = vd->vdev_ops->vdev_op_open(vd, &osize, &max_osize, &ashift); + error = vd->vdev_ops->vdev_op_open(vd, &osize, &max_osize, + &logical_ashift, &physical_ashift); /* * Reset the vdev_reopening flag so that we actually close @@ -1248,6 +1299,17 @@ vdev_open(vdev_t *vd) return (SET_ERROR(EINVAL)); } + vd->vdev_physical_ashift = + MAX(physical_ashift, vd->vdev_physical_ashift); + vd->vdev_logical_ashift = MAX(logical_ashift, vd->vdev_logical_ashift); + vd->vdev_ashift = MAX(vd->vdev_logical_ashift, vd->vdev_ashift); + + if (vd->vdev_logical_ashift > SPA_MAXASHIFT) { + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_ASHIFT_TOO_BIG); + return (EINVAL); + } + if (vd->vdev_asize == 0) { /* * This is the first-ever open, so use the computed values. @@ -1255,19 +1317,15 @@ vdev_open(vdev_t *vd) */ vd->vdev_asize = asize; vd->vdev_max_asize = max_asize; - vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Detect if the alignment requirement has increased. - * We don't want to make the pool unavailable, just - * issue a warning instead. + * Make sure the alignment requirement hasn't increased. */ - if (ashift > vd->vdev_top->vdev_ashift && + if (vd->vdev_ashift > vd->vdev_top->vdev_ashift && vd->vdev_ops->vdev_op_leaf) { - cmn_err(CE_WARN, - "Disk, '%s', has a block alignment that is " - "larger than the pool's alignment\n", - vd->vdev_path); + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_BAD_LABEL); + return (EINVAL); } vd->vdev_max_asize = max_asize; } @@ -1577,6 +1635,23 @@ vdev_metaslab_set_size(vdev_t *vd) vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); } +/* + * Maximize performance by inflating the configured ashift for + * top level vdevs to be as close to the physical ashift as + * possible without exceeding the administrator specified + * limit. + */ +void +vdev_ashift_optimize(vdev_t *vd) +{ + if (vd == vd->vdev_top && + (vd->vdev_ashift < vd->vdev_physical_ashift) && + (vd->vdev_ashift < zfs_max_auto_ashift)) { + vd->vdev_ashift = MIN(zfs_max_auto_ashift, + vd->vdev_physical_ashift); + } +} + void vdev_dirty(vdev_t *vd, int flags, void *arg, uint64_t txg) { @@ -2595,6 +2670,10 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t * if (vd->vdev_ops->vdev_op_leaf) vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize; + vs->vs_configured_ashift = vd->vdev_top != NULL + ? vd->vdev_top->vdev_ashift : vd->vdev_ashift; + vs->vs_logical_ashift = vd->vdev_logical_ashift; + vs->vs_physical_ashift = vd->vdev_physical_ashift; mutex_exit(&vd->vdev_stat_lock); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Wed Aug 21 04:10:24 2013 (r254591) @@ -49,7 +49,7 @@ vdev_file_rele(vdev_t *vd) static int vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { vdev_file_t *vf; vnode_t *vp; @@ -130,7 +130,8 @@ skip_open: } *max_psize = *psize = vattr.va_size; - *ashift = SPA_MINBLOCKSHIFT; + *logical_ashift = SPA_MINBLOCKSHIFT; + *physical_ashift = SPA_MINBLOCKSHIFT; return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Aug 21 04:10:24 2013 (r254591) @@ -576,7 +576,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c static int vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { struct g_provider *pp; struct g_consumer *cp; @@ -662,9 +662,13 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi *max_psize = *psize = pp->mediasize; /* - * Determine the device's minimum transfer size. + * Determine the device's minimum transfer size and preferred + * transfer size. */ - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *physical_ashift = 0; + if (pp->stripesize) + *physical_ashift = highbit(pp->stripesize) - 1; /* * Clear the nowritecache settings, so that on a vdev_reopen() Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Wed Aug 21 04:10:24 2013 (r254591) @@ -132,7 +132,7 @@ vdev_mirror_map_alloc(zio_t *zio) static int vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { int numerrors = 0; int lasterror = 0; @@ -155,7 +155,9 @@ vdev_mirror_open(vdev_t *vd, uint64_t *a *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; - *ashift = MAX(*ashift, cvd->vdev_ashift); + *logical_ashift = MAX(*logical_ashift, cvd->vdev_ashift); + *physical_ashift = MAX(*physical_ashift, + cvd->vdev_physical_ashift); } if (numerrors == vd->vdev_children) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Wed Aug 21 04:10:24 2013 (r254591) @@ -45,7 +45,7 @@ /* ARGSUSED */ static int vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { /* * Really this should just fail. But then the root vdev will be in the @@ -55,7 +55,8 @@ vdev_missing_open(vdev_t *vd, uint64_t * */ *psize = 0; *max_psize = 0; - *ashift = 0; + *logical_ashift = 0; + *physical_ashift = 0; return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Wed Aug 21 04:10:24 2013 (r254591) @@ -1478,7 +1478,7 @@ vdev_raidz_reconstruct(raidz_map_t *rm, static int vdev_raidz_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { vdev_t *cvd; uint64_t nparity = vd->vdev_nparity; @@ -1507,7 +1507,9 @@ vdev_raidz_open(vdev_t *vd, uint64_t *as *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; - *ashift = MAX(*ashift, cvd->vdev_ashift); + *logical_ashift = MAX(*logical_ashift, cvd->vdev_ashift); + *physical_ashift = MAX(*physical_ashift, + cvd->vdev_physical_ashift); } *asize *= vd->vdev_children; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Wed Aug 21 04:10:24 2013 (r254591) @@ -55,7 +55,7 @@ too_many_errors(vdev_t *vd, int numerror static int vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { int lasterror = 0; int numerrors = 0; @@ -83,7 +83,8 @@ vdev_root_open(vdev_t *vd, uint64_t *asi *asize = 0; *max_asize = 0; - *ashift = 0; + *logical_ashift = 0; + *physical_ashift = 0; return (0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Aug 21 04:10:24 2013 (r254591) @@ -1137,8 +1137,10 @@ zio_write_bp_init(zio_t *zio) } if (compress != ZIO_COMPRESS_OFF) { + metaslab_class_t *mc = spa_normal_class(spa); void *cbuf = zio_buf_alloc(lsize); - psize = zio_compress_data(compress, zio->io_data, cbuf, lsize); + psize = zio_compress_data(compress, zio->io_data, cbuf, lsize, + (size_t)metaslab_class_get_minblocksize(mc)); if (psize == 0 || psize == lsize) { compress = ZIO_COMPRESS_OFF; zio_buf_free(cbuf, lsize); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Wed Aug 21 04:10:24 2013 (r254591) @@ -77,7 +77,8 @@ zio_compress_select(enum zio_compress ch } size_t -zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len) +zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len, + size_t minblocksize) { uint64_t *word, *word_end; size_t c_len, d_len, r_len; @@ -102,7 +103,7 @@ zio_compress_data(enum zio_compress c, v return (s_len); /* Compress at least 12.5% */ - d_len = P2ALIGN(s_len - (s_len >> 3), (size_t)SPA_MINBLOCKSIZE); + d_len = P2ALIGN(s_len - (s_len >> 3), minblocksize); if (d_len == 0) return (s_len); @@ -115,14 +116,14 @@ zio_compress_data(enum zio_compress c, v * Cool. We compressed at least as much as we were hoping to. * For both security and repeatability, pad out the last sector. */ - r_len = P2ROUNDUP(c_len, (size_t)SPA_MINBLOCKSIZE); + r_len = P2ROUNDUP(c_len, minblocksize); if (r_len > c_len) { bzero((char *)dst + c_len, r_len - c_len); c_len = r_len; } ASSERT3U(c_len, <=, d_len); - ASSERT(P2PHASE(c_len, (size_t)SPA_MINBLOCKSIZE) == 0); + ASSERT(P2PHASE(c_len, minblocksize) == 0); return (c_len); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Aug 21 04:08:58 2013 (r254590) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Aug 21 04:10:24 2013 (r254591) @@ -621,7 +621,8 @@ typedef enum vdev_aux { VDEV_AUX_IO_FAILURE, /* experienced I/O failure */ VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */ VDEV_AUX_EXTERNAL, /* external diagnosis */ - VDEV_AUX_SPLIT_POOL /* vdev was split off into another pool */ + VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */ + VDEV_AUX_ASHIFT_TOO_BIG /* vdev's min block size is too large */ } vdev_aux_t; /* @@ -715,7 +716,13 @@ typedef struct vdev_stat { uint64_t vs_self_healed; /* self-healed bytes */ uint64_t vs_scan_removing; /* removing? */ uint64_t vs_scan_processed; /* scan processed bytes */ + uint64_t vs_configured_ashift; /* TLV vdev_ashift */ + uint64_t vs_logical_ashift; /* vdev_logical_ashift */ + uint64_t vs_physical_ashift; /* vdev_physical_ashift */ } vdev_stat_t; +#define VDEV_STAT_VALID(field, uint64_t_field_count) \ + ((uint64_t_field_count * sizeof(uint64_t)) >= \ + (offsetof(vdev_stat_t, field) + sizeof(((vdev_stat_t *)NULL)->field))) /* * DDT statistics. Note: all fields should be 64-bit because this From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 04:20:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 63D4B953; Wed, 21 Aug 2013 04:20:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42D4022A3; Wed, 21 Aug 2013 04:20:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L4KIvv051428; Wed, 21 Aug 2013 04:20:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L4KHbE051426; Wed, 21 Aug 2013 04:20:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308210420.r7L4KHbE051426@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 04:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254592 - in head/sys/arm/ti: . am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 04:20:18 -0000 Author: ian Date: Wed Aug 21 04:20:17 2013 New Revision: 254592 URL: http://svnweb.freebsd.org/changeset/base/254592 Log: Define the uart clocks so that they can be en/disabled at runtime. Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/ti_prcm.h Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 21 04:10:24 2013 (r254591) +++ head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 21 04:20:17 2013 (r254592) @@ -62,9 +62,14 @@ __FBSDID("$FreeBSD$"); #define CM_PER_LCDC_CLKCTRL (CM_PER + 0x018) #define CM_PER_USB0_CLKCTRL (CM_PER + 0x01C) #define CM_PER_TPTC0_CLKCTRL (CM_PER + 0x024) +#define CM_PER_UART5_CLKCTRL (CM_PER + 0x038) #define CM_PER_MMC0_CLKCTRL (CM_PER + 0x03C) #define CM_PER_I2C2_CLKCTRL (CM_PER + 0x044) #define CM_PER_I2C1_CLKCTRL (CM_PER + 0x048) +#define CM_PER_UART1_CLKCTRL (CM_PER + 0x06C) +#define CM_PER_UART2_CLKCTRL (CM_PER + 0x070) +#define CM_PER_UART3_CLKCTRL (CM_PER + 0x074) +#define CM_PER_UART4_CLKCTRL (CM_PER + 0x078) #define CM_PER_TIMER7_CLKCTRL (CM_PER + 0x07C) #define CM_PER_TIMER2_CLKCTRL (CM_PER + 0x080) #define CM_PER_TIMER3_CLKCTRL (CM_PER + 0x084) @@ -146,6 +151,9 @@ static int am335x_clk_musb0_activate(str static int am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev); static int am335x_clk_pruss_activate(struct ti_clock_dev *clkdev); +#define AM335X_NOOP_CLOCK_DEV(i) \ + { .id = (i) } + #define AM335X_GENERIC_CLOCK_DEV(i) \ { .id = (i), \ .clk_activate = am335x_clk_generic_activate, \ @@ -217,6 +225,14 @@ struct ti_clock_dev ti_clk_devmap[] = { .clk_get_source_freq = am335x_clk_get_arm_disp_freq, }, + /* UART. Uart0 clock cannot be controlled. */ + AM335X_NOOP_CLOCK_DEV(UART0_CLK), + AM335X_GENERIC_CLOCK_DEV(UART1_CLK), + AM335X_GENERIC_CLOCK_DEV(UART2_CLK), + AM335X_GENERIC_CLOCK_DEV(UART3_CLK), + AM335X_GENERIC_CLOCK_DEV(UART4_CLK), + AM335X_GENERIC_CLOCK_DEV(UART5_CLK), + /* DMTimer */ AM335X_GENERIC_CLOCK_DEV(DMTIMER2_CLK), AM335X_GENERIC_CLOCK_DEV(DMTIMER3_CLK), @@ -286,6 +302,14 @@ struct am335x_clk_details { static struct am335x_clk_details g_am335x_clk_details[] = { + /* UART. UART0 clock not controllable. */ + _CLK_DETAIL(UART0_CLK, 0, 0), + _CLK_DETAIL(UART1_CLK, CM_PER_UART1_CLKCTRL, 0), + _CLK_DETAIL(UART2_CLK, CM_PER_UART2_CLKCTRL, 0), + _CLK_DETAIL(UART3_CLK, CM_PER_UART3_CLKCTRL, 0), + _CLK_DETAIL(UART4_CLK, CM_PER_UART4_CLKCTRL, 0), + _CLK_DETAIL(UART5_CLK, CM_PER_UART5_CLKCTRL, 0), + /* DMTimer modules */ _CLK_DETAIL(DMTIMER2_CLK, CM_PER_TIMER2_CLKCTRL, CLKSEL_TIMER2_CLK), _CLK_DETAIL(DMTIMER3_CLK, CM_PER_TIMER3_CLKCTRL, CLKSEL_TIMER3_CLK), Modified: head/sys/arm/ti/ti_prcm.h ============================================================================== --- head/sys/arm/ti/ti_prcm.h Wed Aug 21 04:10:24 2013 (r254591) +++ head/sys/arm/ti/ti_prcm.h Wed Aug 21 04:20:17 2013 (r254592) @@ -81,10 +81,15 @@ typedef enum { USBP2_HSIC_CLK, /* UART modules */ - UART1_CLK = 400, + UART0_CLK = 400, + UART1_CLK, UART2_CLK, UART3_CLK, UART4_CLK, + UART5_CLK, + UART6_CLK, + UART7_CLK, + UART8_CLK, /* General purpose timer modules */ GPTIMER1_CLK = 500, From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 04:49:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D05FBD4D; Wed, 21 Aug 2013 04:49:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A43AE23ED; Wed, 21 Aug 2013 04:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L4nwHo066297; Wed, 21 Aug 2013 04:49:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L4nwUS066296; Wed, 21 Aug 2013 04:49:58 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308210449.r7L4nwUS066296@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 04:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254593 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 04:49:58 -0000 Author: ian Date: Wed Aug 21 04:49:58 2013 New Revision: 254593 URL: http://svnweb.freebsd.org/changeset/base/254593 Log: Make the noop clock successfully do nothing, because doing nothing and returning an error status (which the NULL method pointers caused) isn't nearly as useful. Modified: head/sys/arm/ti/am335x/am335x_prcm.c Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 21 04:20:17 2013 (r254592) +++ head/sys/arm/ti/am335x/am335x_prcm.c Wed Aug 21 04:49:58 2013 (r254593) @@ -137,9 +137,12 @@ static struct resource_spec am335x_prcm_ static struct am335x_prcm_softc *am335x_prcm_sc = NULL; +static int am335x_clk_noop_activate(struct ti_clock_dev *clkdev); static int am335x_clk_generic_activate(struct ti_clock_dev *clkdev); static int am335x_clk_gpio_activate(struct ti_clock_dev *clkdev); +static int am335x_clk_noop_deactivate(struct ti_clock_dev *clkdev); static int am335x_clk_generic_deactivate(struct ti_clock_dev *clkdev); +static int am335x_clk_noop_set_source(struct ti_clock_dev *clkdev, clk_src_t clksrc); static int am335x_clk_generic_set_source(struct ti_clock_dev *clkdev, clk_src_t clksrc); static int am335x_clk_hsmmc_get_source_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_sysclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); @@ -152,7 +155,13 @@ static int am335x_clk_lcdc_activate(stru static int am335x_clk_pruss_activate(struct ti_clock_dev *clkdev); #define AM335X_NOOP_CLOCK_DEV(i) \ - { .id = (i) } + { .id = (i), \ + .clk_activate = am335x_clk_noop_activate, \ + .clk_deactivate = am335x_clk_noop_deactivate, \ + .clk_set_source = am335x_clk_noop_set_source, \ + .clk_accessible = NULL, \ + .clk_get_source_freq = NULL \ + } #define AM335X_GENERIC_CLOCK_DEV(i) \ { .id = (i), \ @@ -430,6 +439,13 @@ am335x_clk_details(clk_ident_t id) } static int +am335x_clk_noop_activate(struct ti_clock_dev *clkdev) +{ + + return (0); +} + +static int am335x_clk_generic_activate(struct ti_clock_dev *clkdev) { struct am335x_prcm_softc *sc = am335x_prcm_sc; @@ -476,6 +492,13 @@ am335x_clk_gpio_activate(struct ti_clock } static int +am335x_clk_noop_deactivate(struct ti_clock_dev *clkdev) +{ + + return(0); +} + +static int am335x_clk_generic_deactivate(struct ti_clock_dev *clkdev) { struct am335x_prcm_softc *sc = am335x_prcm_sc; @@ -498,6 +521,13 @@ am335x_clk_generic_deactivate(struct ti_ } static int +am335x_clk_noop_set_source(struct ti_clock_dev *clkdev, clk_src_t clksrc) +{ + + return (0); +} + +static int am335x_clk_generic_set_source(struct ti_clock_dev *clkdev, clk_src_t clksrc) { struct am335x_prcm_softc *sc = am335x_prcm_sc; From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 06:09:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4F9C5BAC for ; Wed, 21 Aug 2013 06:09:22 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D773A28E7 for ; Wed, 21 Aug 2013 06:09:21 +0000 (UTC) Received: by mail-ee0-f47.google.com with SMTP id d49so1019eek.20 for ; Tue, 20 Aug 2013 23:09:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-type:content-transfer-encoding:subject:from:date:to :message-id; bh=HLMv5mO3wcvTHB2yr/uFjcioHTC/ZW4PoxynRgnl3Gk=; b=bbr0Bcq+ysdCwEXWaVQkyYG3RMtKMq/C1TQNQR059n9/0/NCRUylbu1Z3XLx+uczG0 s95KRAFjxVUGTk9xuAwMtWZ99aNA9pOjgZ7BScpl8KH12frD2fmKkduYB6LpXS+LSbdT 0vB9VvpqV70U/mSyWwio+nf3BNIacjLNk7/ns/JXqjkQfyUVPJdh/YW5UAiE7pDH1Ose yq393xrzfuT/DyXNE9wFa/Yf5iCWFg1xjzPF90jJObfgYk2E6gSYLqlqIy5yJvzrxiOa LOdos+C/hih7vbQLgG2MyVfMlfyuCRMbbZR1MNz6lgXriNuKDawdk8k1wNbmJPVo2fdR /R3w== X-Gm-Message-State: ALoCoQnRlCeBRBbfUXD2VSDfmLh8mlat7BjnaqyAE2/3+MXfvPGwdKTtqK99O6r3AxNI1tTka5Si X-Received: by 10.15.64.1 with SMTP id n1mr7721600eex.15.1377063938872; Tue, 20 Aug 2013 22:45:38 -0700 (PDT) Received: from [159.160.207.62] ([159.160.207.62]) by mx.google.com with ESMTPSA id t6sm6903905eel.12.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Aug 2013 22:45:37 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: <201308210408.r7L48w2X045489@svn.freebsd.org> References: <201308210408.r7L48w2X045489@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: svn commit: r254590 - head/sys/dev/uart From: Aleksandr Rybalko Date: Wed, 21 Aug 2013 08:45:25 +0300 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 06:09:22 -0000 Ian Lepore написав(ла): >Author: ian >Date: Wed Aug 21 04:08:58 2013 >New Revision: 254590 >URL: http://svnweb.freebsd.org/changeset/base/254590 > >Log: > Use an if/else sequence rather than unrelated if statements, so that a >device compatible with multiple drivers matches the more specific >driver > first and doesn't overwrite it later with the more generic. Move the > generic ns16550 to the end of the list. > >Modified: > head/sys/dev/uart/uart_cpu_fdt.c > >Modified: head/sys/dev/uart/uart_cpu_fdt.c >============================================================================== >--- head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 04:05:06 2013 (r254589) >+++ head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 04:08:58 2013 (r254590) >@@ -141,18 +141,18 @@ uart_cpu_getdev(int devtype, struct uart > */ > if (fdt_is_compatible(node, "fsl,imx-uart")) > class = &uart_imx_class; >- if (fdt_is_compatible(node, "quicc")) >+ else if (fdt_is_compatible(node, "quicc")) > class = &uart_quicc_class; >- if (fdt_is_compatible(node, "lpc")) >+ else if (fdt_is_compatible(node, "lpc")) > class = &uart_lpc_class; >- if (fdt_is_compatible(node, "ns16550")) >- class = &uart_ns8250_class; >- if (fdt_is_compatible(node, "arm,pl011")) >+ else if (fdt_is_compatible(node, "arm,pl011")) > class = &uart_pl011_class; >- if (fdt_is_compatible(node, "exynos")) >+ else if (fdt_is_compatible(node, "exynos")) > class = &uart_s3c2410_class; >- if (fdt_is_compatible(node, "cadence,uart")) >+ else if (fdt_is_compatible(node, "cadence,uart")) > class = &uart_cdnc_class; >+ else if (fdt_is_compatible(node, "ns16550")) >+ class = &uart_ns8250_class; > > di->bas.chan = 0; > di->bas.regshft = (u_int)shift; Hi Ian! Correct order should be specified in compatible list, other thing must be covered by some quirks. Maybe inside driver or in machine/board specific fixup handler. Thanks. WBW ------ Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 07:45:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2383F7D8; Wed, 21 Aug 2013 07:45:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1083C209D; Wed, 21 Aug 2013 07:45:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L7jlSq058704; Wed, 21 Aug 2013 07:45:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L7jlIZ058703; Wed, 21 Aug 2013 07:45:47 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201308210745.r7L7jlIZ058703@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 21 Aug 2013 07:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254595 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 07:45:48 -0000 Author: trasz Date: Wed Aug 21 07:45:47 2013 New Revision: 254595 URL: http://svnweb.freebsd.org/changeset/base/254595 Log: Fix the (unused for now) SCSI_PROTO_iSCSI define to match style(9). Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Aug 21 06:32:32 2013 (r254594) +++ head/sys/cam/scsi/scsi_all.h Wed Aug 21 07:45:47 2013 (r254595) @@ -1288,7 +1288,7 @@ struct scsi_vpd_id_descriptor #define SCSI_PROTO_SSA 0x02 #define SCSI_PROTO_1394 0x03 #define SCSI_PROTO_RDMA 0x04 -#define SCSI_PROTO_iSCSI 0x05 +#define SCSI_PROTO_ISCSI 0x05 #define SCSI_PROTO_SAS 0x06 #define SCSI_PROTO_ADT 0x07 #define SCSI_PROTO_ATA 0x08 From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 08:01:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8C96CC11; Wed, 21 Aug 2013 08:01:53 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78FEF2197; Wed, 21 Aug 2013 08:01:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7L81rnM068142; Wed, 21 Aug 2013 08:01:53 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7L81r4J068141; Wed, 21 Aug 2013 08:01:53 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201308210801.r7L81r4J068141@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 21 Aug 2013 08:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254596 - head/sys/modules/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 08:01:53 -0000 Author: uqs Date: Wed Aug 21 08:01:52 2013 New Revision: 254596 URL: http://svnweb.freebsd.org/changeset/base/254596 Log: Fix 'make depend'. Modified: head/sys/modules/vmm/Makefile Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Wed Aug 21 07:45:47 2013 (r254595) +++ head/sys/modules/vmm/Makefile Wed Aug 21 08:01:52 2013 (r254596) @@ -2,11 +2,11 @@ KMOD= vmm -SRCS= opt_ddb.h device_if.h bus_if.h pci_if.h +SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h CFLAGS+= -DVMM_KEEP_STATS -DSMP -CFLAGS+= -I${.CURDIR}/../../amd64/vmm -CFLAGS+= -I${.CURDIR}/../../amd64/vmm/io +CFLAGS+= -I${.CURDIR}/../../amd64/vmm +CFLAGS+= -I${.CURDIR}/../../amd64/vmm/io CFLAGS+= -I${.CURDIR}/../../amd64/vmm/intel # generic vmm support From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 14:26:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 083A56E7; Wed, 21 Aug 2013 14:26:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9C1F2F55; Wed, 21 Aug 2013 14:26:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LEQFda075739; Wed, 21 Aug 2013 14:26:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LEQFL5075737; Wed, 21 Aug 2013 14:26:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308211426.r7LEQFL5075737@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 14:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254597 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 14:26:16 -0000 Author: ian Date: Wed Aug 21 14:26:15 2013 New Revision: 254597 URL: http://svnweb.freebsd.org/changeset/base/254597 Log: Make the uart ns8250 high-level interface public rather than static. This makes it easier to implement new drivers which are "mostly ns8250" but with some small difference such as needing to enable clocks or poke a non-standard register at probe or attach time. Added: head/sys/dev/uart/uart_dev_ns8250.h (contents, props changed) Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/uart/uart_dev_ns8250.c Wed Aug 21 14:26:15 2013 (r254597) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -239,7 +240,7 @@ static void ns8250_putc(struct uart_bas static int ns8250_rxready(struct uart_bas *bas); static int ns8250_getc(struct uart_bas *bas, struct mtx *); -static struct uart_ops uart_ns8250_ops = { +struct uart_ops uart_ns8250_ops = { .probe = ns8250_probe, .init = ns8250_init, .term = ns8250_term, @@ -352,32 +353,6 @@ ns8250_getc(struct uart_bas *bas, struct return (c); } -/* - * High-level UART interface. - */ -struct ns8250_softc { - struct uart_softc base; - uint8_t fcr; - uint8_t ier; - uint8_t mcr; - - uint8_t ier_mask; - uint8_t ier_rxbits; - uint8_t busy_detect; -}; - -static int ns8250_bus_attach(struct uart_softc *); -static int ns8250_bus_detach(struct uart_softc *); -static int ns8250_bus_flush(struct uart_softc *, int); -static int ns8250_bus_getsig(struct uart_softc *); -static int ns8250_bus_ioctl(struct uart_softc *, int, intptr_t); -static int ns8250_bus_ipend(struct uart_softc *); -static int ns8250_bus_param(struct uart_softc *, int, int, int, int); -static int ns8250_bus_probe(struct uart_softc *); -static int ns8250_bus_receive(struct uart_softc *); -static int ns8250_bus_setsig(struct uart_softc *, int); -static int ns8250_bus_transmit(struct uart_softc *); - static kobj_method_t ns8250_methods[] = { KOBJMETHOD(uart_attach, ns8250_bus_attach), KOBJMETHOD(uart_detach, ns8250_bus_detach), @@ -409,7 +384,7 @@ struct uart_class uart_ns8250_class = { i = (i & s) ? (i & ~s) | d : i; \ } -static int +int ns8250_bus_attach(struct uart_softc *sc) { struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; @@ -482,7 +457,7 @@ ns8250_bus_attach(struct uart_softc *sc) return (0); } -static int +int ns8250_bus_detach(struct uart_softc *sc) { struct ns8250_softc *ns8250; @@ -498,7 +473,7 @@ ns8250_bus_detach(struct uart_softc *sc) return (0); } -static int +int ns8250_bus_flush(struct uart_softc *sc, int what) { struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; @@ -518,7 +493,7 @@ ns8250_bus_flush(struct uart_softc *sc, return (error); } -static int +int ns8250_bus_getsig(struct uart_softc *sc) { uint32_t new, old, sig; @@ -539,7 +514,7 @@ ns8250_bus_getsig(struct uart_softc *sc) return (sig); } -static int +int ns8250_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) { struct uart_bas *bas; @@ -612,7 +587,7 @@ ns8250_bus_ioctl(struct uart_softc *sc, return (error); } -static int +int ns8250_bus_ipend(struct uart_softc *sc) { struct uart_bas *bas; @@ -656,7 +631,7 @@ ns8250_bus_ipend(struct uart_softc *sc) return (ipend); } -static int +int ns8250_bus_param(struct uart_softc *sc, int baudrate, int databits, int stopbits, int parity) { @@ -670,7 +645,7 @@ ns8250_bus_param(struct uart_softc *sc, return (error); } -static int +int ns8250_bus_probe(struct uart_softc *sc) { struct ns8250_softc *ns8250; @@ -820,7 +795,7 @@ ns8250_bus_probe(struct uart_softc *sc) return (0); } -static int +int ns8250_bus_receive(struct uart_softc *sc) { struct uart_bas *bas; @@ -853,7 +828,7 @@ ns8250_bus_receive(struct uart_softc *sc return (0); } -static int +int ns8250_bus_setsig(struct uart_softc *sc, int sig) { struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; @@ -885,7 +860,7 @@ ns8250_bus_setsig(struct uart_softc *sc, return (0); } -static int +int ns8250_bus_transmit(struct uart_softc *sc) { struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; Added: head/sys/dev/uart/uart_dev_ns8250.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_ns8250.h Wed Aug 21 14:26:15 2013 (r254597) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2003 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_UART_DEV_NS8250_H_ +#define _DEV_UART_DEV_NS8250_H_ + +/* + * High-level UART interface. + */ +struct ns8250_softc { + struct uart_softc base; + uint8_t fcr; + uint8_t ier; + uint8_t mcr; + + uint8_t ier_mask; + uint8_t ier_rxbits; + uint8_t busy_detect; +}; + +extern struct uart_ops uart_ns8250_ops; + +int ns8250_bus_attach(struct uart_softc *); +int ns8250_bus_detach(struct uart_softc *); +int ns8250_bus_flush(struct uart_softc *, int); +int ns8250_bus_getsig(struct uart_softc *); +int ns8250_bus_ioctl(struct uart_softc *, int, intptr_t); +int ns8250_bus_ipend(struct uart_softc *); +int ns8250_bus_param(struct uart_softc *, int, int, int, int); +int ns8250_bus_probe(struct uart_softc *); +int ns8250_bus_receive(struct uart_softc *); +int ns8250_bus_setsig(struct uart_softc *, int); +int ns8250_bus_transmit(struct uart_softc *); + +#endif /* _DEV_UART_DEV_NS8250_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 14:33:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92EAF954; Wed, 21 Aug 2013 14:33:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6292FCD; Wed, 21 Aug 2013 14:33:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LEX4Iq079884; Wed, 21 Aug 2013 14:33:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LEX35r079877; Wed, 21 Aug 2013 14:33:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308211433.r7LEX35r079877@svn.freebsd.org> From: Ian Lepore Date: Wed, 21 Aug 2013 14:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254598 - in head/sys: arm/ti boot/fdt/dts dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 14:33:04 -0000 Author: ian Date: Wed Aug 21 14:33:02 2013 New Revision: 254598 URL: http://svnweb.freebsd.org/changeset/base/254598 Log: Add support for uarts other than the serial console in TI OMAP SoCs. The TI uart hardware is ns16550-compatible, except that before it can be used the clocks and power have to be enabled and a non-standard mode control register has to be set to put the device in uart mode (as opposed to irDa or other serial protocols). This adds the extra code in an extension to the standard ns8250 probe routine, and the rest of the driver is just the standard ns8250 code. Added: head/sys/dev/uart/uart_dev_ti8250.c (contents, props changed) Modified: head/sys/arm/ti/files.ti head/sys/boot/fdt/dts/am335x.dtsi head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Wed Aug 21 14:26:15 2013 (r254597) +++ head/sys/arm/ti/files.ti Wed Aug 21 14:33:02 2013 (r254598) @@ -21,5 +21,6 @@ arm/ti/ti_gpio.c optional gpio arm/ti/ti_i2c.c optional ti_i2c dev/ofw/ofw_iicbus.c optional iicbus +dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Wed Aug 21 14:26:15 2013 (r254597) +++ head/sys/boot/fdt/dts/am335x.dtsi Wed Aug 21 14:33:02 2013 (r254598) @@ -88,13 +88,69 @@ }; uart0: serial@44E09000 { - compatible = "ns16550"; + compatible = "ti,ns16550"; reg = <0x44E09000 0x1000>; reg-shift = <2>; interrupts = < 72 >; interrupt-parent = <&AINTC>; - clock-frequency = < 48000000 >; /* FIXME */ - }; + clock-frequency = < 48000000 >; + uart-device-id = < 0 >; + }; + + uart1: serial@48022000 { + compatible = "ti,ns16550"; + reg = <0x48022000 0x1000>; + reg-shift = <2>; + interrupts = < 73 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 48000000 >; + uart-device-id = < 1 >; + status = "disabled"; + }; + + uart2: serial@48024000 { + compatible = "ti,ns16550"; + reg = <0x48024000 0x1000>; + reg-shift = <2>; + interrupts = < 74 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 48000000 >; + uart-device-id = < 2 >; + status = "disabled"; + }; + + uart3: serial@481a6000 { + compatible = "ti,ns16550"; + reg = <0x481A6000 0x1000>; + reg-shift = <2>; + interrupts = < 44 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 48000000 >; + uart-device-id = < 3 >; + status = "disabled"; + }; + + uart4: serial@481a8000 { + compatible = "ti,ns16550"; + reg = <0x481A8000 0x1000>; + reg-shift = <2>; + interrupts = < 45 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 48000000 >; + uart-device-id = < 4 >; + status = "disabled"; + }; + + uart5: serial@481aa000 { + compatible = "ti,ns16550"; + reg = <0x481AA000 0x1000>; + reg-shift = <2>; + interrupts = < 46 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 48000000 >; + uart-device-id = < 5 >; + status = "disabled"; + }; edma3@49000000 { compatible = "ti,edma3"; Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Wed Aug 21 14:26:15 2013 (r254597) +++ head/sys/dev/uart/uart.h Wed Aug 21 14:33:02 2013 (r254598) @@ -74,6 +74,7 @@ extern struct uart_class uart_z8530_clas extern struct uart_class uart_lpc_class __attribute__((weak)); extern struct uart_class uart_pl011_class __attribute__((weak)); extern struct uart_class uart_cdnc_class __attribute__((weak)); +extern struct uart_class uart_ti8250_class __attribute__((weak)); #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Wed Aug 21 14:26:15 2013 (r254597) +++ head/sys/dev/uart/uart_bus_fdt.c Wed Aug 21 14:33:02 2013 (r254598) @@ -111,6 +111,8 @@ uart_fdt_probe(device_t dev) sc->sc_class = &uart_s3c2410_class; else if (ofw_bus_is_compatible(dev, "cadence,uart")) sc->sc_class = &uart_cdnc_class; + else if (ofw_bus_is_compatible(dev, "ti,ns16550")) + sc->sc_class = &uart_ti8250_class; else if (ofw_bus_is_compatible(dev, "ns16550")) sc->sc_class = &uart_ns8250_class; else Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 14:26:15 2013 (r254597) +++ head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 14:33:02 2013 (r254598) @@ -151,6 +151,8 @@ uart_cpu_getdev(int devtype, struct uart class = &uart_s3c2410_class; else if (fdt_is_compatible(node, "cadence,uart")) class = &uart_cdnc_class; + else if (fdt_is_compatible(node, "ti,ns16550")) + class = &uart_ti8250_class; else if (fdt_is_compatible(node, "ns16550")) class = &uart_ns8250_class; Added: head/sys/dev/uart/uart_dev_ti8250.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_ti8250.c Wed Aug 21 14:33:02 2013 (r254598) @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "uart_if.h" + +/* + * High-level UART interface. + */ +struct ti8250_softc { + struct ns8250_softc ns8250_base; + /*uint32_t mystuff;*/ +}; + +#define MDR1_REG 8 +#define MDR1_MODE_UART 0 +#define MDR1_MODE_DISABLE 7 +#define SYSCC_REG 15 +#define SYSCC_SOFTRESET (1 << 1) +#define SYSS_REG 16 +#define SYSS_STATUS_RESETDONE (1 << 0) + +static int +ti8250_bus_probe(struct uart_softc *sc) +{ + int status; + int devid; + clk_ident_t clkid; + pcell_t prop; + phandle_t node; + + /* + * Get the device id from FDT. If it's not there we can't turn on the + * right clocks, so bail, unless we're doing unit 0. We assume that's + * the serial console, whose clock isn't controllable anyway, and we + * sure don't want to break the console because of a config error. + */ + node = ofw_bus_get_node(sc->sc_dev); + if ((OF_getprop(node, "uart-device-id", &prop, sizeof(prop))) <= 0) { + device_printf(sc->sc_dev, + "missing uart-device-id attribute in FDT\n"); + if (device_get_unit(sc->sc_dev) != 0) + return (ENXIO); + devid = 0; + } else + devid = fdt32_to_cpu(prop); + + /* Enable clocks for this device. We can't continue if that fails. */ + clkid = UART0_CLK + devid; + if ((status = ti_prcm_clk_enable(clkid)) != 0) + return (status); + + /* + * Set the hardware to disabled mode, do a full device reset, then set + * it to uart mode. Most devices will be reset-and-disabled already, + * but you never know what a bootloader might have done. + */ + uart_setreg(&sc->sc_bas, MDR1_REG, MDR1_MODE_DISABLE); + uart_setreg(&sc->sc_bas, SYSCC_REG, SYSCC_SOFTRESET); + while (uart_getreg(&sc->sc_bas, SYSS_REG) & SYSS_STATUS_RESETDONE) + continue; + uart_setreg(&sc->sc_bas, MDR1_REG, MDR1_MODE_UART); + + status = ns8250_bus_probe(sc); + if (status == 0) + device_set_desc(sc->sc_dev, "TI UART (16550 compatible)"); + + return (status); +} + +static kobj_method_t ti8250_methods[] = { + KOBJMETHOD(uart_probe, ti8250_bus_probe), + + KOBJMETHOD(uart_attach, ns8250_bus_attach), + KOBJMETHOD(uart_detach, ns8250_bus_detach), + KOBJMETHOD(uart_flush, ns8250_bus_flush), + KOBJMETHOD(uart_getsig, ns8250_bus_getsig), + KOBJMETHOD(uart_ioctl, ns8250_bus_ioctl), + KOBJMETHOD(uart_ipend, ns8250_bus_ipend), + KOBJMETHOD(uart_param, ns8250_bus_param), + KOBJMETHOD(uart_receive, ns8250_bus_receive), + KOBJMETHOD(uart_setsig, ns8250_bus_setsig), + KOBJMETHOD(uart_transmit, ns8250_bus_transmit), + KOBJMETHOD_END +}; + +struct uart_class uart_ti8250_class = { + "ti8250", + ti8250_methods, + sizeof(struct ti8250_softc), + .uc_ops = &uart_ns8250_ops, + .uc_range = 0x88, + .uc_rclk = 48000000 +}; + From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 14:59:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E8A8C56 for ; Wed, 21 Aug 2013 14:59:52 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 653C921B4 for ; Wed, 21 Aug 2013 14:59:51 +0000 (UTC) Received: (qmail 72615 invoked from network); 21 Aug 2013 15:42:55 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 15:42:55 -0000 Message-ID: <5214D5E0.9040002@freebsd.org> Date: Wed, 21 Aug 2013 16:59:44 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> In-Reply-To: <521291F1.8060500@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 14:59:52 -0000 On 19.08.2013 23:45, Navdeep Parhar wrote: > On 08/19/13 13:58, Andre Oppermann wrote: >> On 19.08.2013 19:33, Navdeep Parhar wrote: >>> On 08/19/13 04:16, Andre Oppermann wrote: >>>> Author: andre >>>> Date: Mon Aug 19 11:16:53 2013 >>>> New Revision: 254520 >>>> URL: http://svnweb.freebsd.org/changeset/base/254520 >>>> >>>> Log: >>>> Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree >>>> users >>>> for a very long time, if ever. >>>> >>>> Should such a functionality ever be needed again the appropriate and >>>> much better way to do it is through a custom EXT_SOMETHING >>>> external mbuf >>>> type together with a dedicated *ext_free function. >>>> >>>> Discussed with: trociny, glebius >>>> >>>> Modified: >>>> head/sys/kern/kern_mbuf.c >>>> head/sys/kern/uipc_mbuf.c >>>> head/sys/sys/mbuf.h >>>> >>> >>> Hello Andre, >>> >>> Is this just garbage collection or is there some other reason for this? >> >> This is garbage collection and removal of not quite right, rotten, >> functionality. >> >>> I recently tried some experiments to reduce the number of mbuf and >>> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >>> very useful and the code changes to the kernel were minimal. See >>> user/np/cxl_tuning. The experiment was quite successful and I was >>> planning to bring in most of those changes to HEAD. I was hoping to get >>> some runtime mileage on the approach in general before tweaking the >>> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >>> within the cluster. But now M_NOFREE has vanished without a warning... >> >> I'm looking through your experimental code and that is some really good >> numbers you're achieving there! >> >> However a couple things don't feel quite right, hackish even, and not >> fit for HEAD. This is a bit the same situation we had with some of the >> first 1GigE cards quite a number of years back (mostly ti(4)). There >> we ended up with a couple of just good enough hacks to make it fast. >> Most of the remains I've collected today. > > If M_NOFREE and EXT_EXTREF are properly supported in the tree (and I'm > arguing that they were, before r254520) then the changes are perfectly > legitimate. The only hackish part was that I was getting the cluster > from the jumbop zone while bypassing its normal refcnt mechanism. This > I did so as to use the same zone as m_uiotombuf to keep it "hot" for all > consumers (driver + network stack). If you insist I'll revert the commit removing M_NOFREE. EXT_EXTREF isn't touched yet, but should get better support. The hackish part for me is that the driver again manages its own memory pool. Windows works that way, NetBSD is moving towards it while FreeBSD has and remains at a central network memory pool. The latter (our current) way of doing it seems more efficient overall especially on heavily loaded networked machines. There may be significant queues building (think app blocked having many sockets buffer fill up) up delaying the freeing and returning of network memory resources. Together with fragmentation this can lead to bad very outcomes. Router applications with many interfaces also greatly benefit from central memory pools. So I'm really not sure that we should move back in the driver owned pool direction with lots of code duplication and copy-pasting (see NetBSD). Also it is kinda weird to have a kernel based pool for data going down the stack and another one in each driver for those going up. Actually I'm of the opinion that we should stay with the central memory pool and fix so that it works just as well for those cases a driver pool currently performs better. >> I believe most of the improvements you've shown can be implemented in >> a more generic and safe way into the mbuf system. Also a number of things >> in your experimental code may have side-effects in situations other than >> netperf runs. > > Agreed. As I mentioned my long term plan was to tweak the jumboX zones > to allow them to allocate cluster with embedded mbuf + refcount. The > M_NOFREE+EXT_EXTREF approach is the perfect bridge from here to there. > It is non-intrusive and lends itself well to experimentation. Agreed, full support on fixing the refcount issue. >> To summarize what I get from your experimental branch commits: >> - the Chelsio T4/T5 card can DMA multiple ethernet frames (packets) into >> a single memory buffer, provided it is large enough. >> - you make use of that feature and point multiple m_ext mbufs into that >> buffer to separate the packets and send them up the stack. >> - you embed the m_ext refcount into the single memory buffer as well. > > yes, yes, and yes. > >> - you recycle mbufs? (I'm not entirely clear on that as I'm not familiar >> with the cxgbe code) > > I recycle the cluster (and the embedded mbuf in it) when possible. All > depends on whether it's still in use by the time the rx queue needs it back. There's always a couple of problems with driver managed pools. Driver shutdown/ unloading requires all such managed mbufs to have returned before it can proceed. This may take a undetermined long time as mbufs are sitting in socket buffers or other queues. >> Lets examine and discuss these parts: >> - M_NOFREE wasn't really safe with bpf anyway at least for packets going >> down the stack. > > I see. Can you point out the parts of bpf unable to deal with M_NOFREE? Sorry, false alarm. >> - Instead of M_NOFREE a custom *ext_free should be used that has the same >> and even more functionality. > > Yes, that's what I was planning too, with the jumboX zone changes. It > would be faster than running the m_ext's free function (which is a > function dereference+call). It would be a bit faster but how do you know when an mbuf itself has been free'd and can be reused without notification? >> - Recycling mbufs may cause imbalances to the mbuf pool with multiple cores >> and possibly NUMA in the future. Not that we are very good with it at >> the moment but bypassing the mbuf allocator shouldn't become the norm. >> If it is a problem/bottleneck again it should be fixed, not worked around >> and copy-pasted n-times in so many drivers. > > If/when a cluster is recycled, it is given back to the same rx ithread > that originally allocated it, and not not any other queue. If the > ithread stays in the same NUMA domain (and it really should) then > recycling the cluster in the same queue really shouldn't cause imbalances. OK. (Side note at the moment the mbuf allocator isn't NUMA aware at all.) >> - jumbo9 and jumbo16 mbufs should not be used because they are more special >> than necessary with being KVM and physically contiguous. This probably >> isn't necessary for the T4/T5 cards and any other modern DMA engine. >> Under heavy diverse network the kernel memory becomes fragmented and >> can't >> find memory fulfilling both criteria anymore. In fact both are an >> artifact >> of the early GigE hacks when high speed DMA engines were in their >> infancy. >> Both jumbo9 and jumbo16 should go away without direct replacement. > > The devices I deal will be able to cope, but I suspect this will be > disruptive (for not enough reason to justify the disruption, imho) to > others. That's a separate discussion anyway. Again using the jumbo9 or jumbo16 doesn't scale. Wollman had it fail quite badly on his heavily loaded NFS server. The way to go should be 4K clusters as they are native to the architecture. IIRC a PCIe DMA can't cross a 4K boundary anyway, so it having a number of them together shouldn't have much of an impact except for consuming descriptors? On a well loaded system it's almost impossible to obtain physically contiguous pages after some time, except through pre-allocation. But then the pre-allocation has to be properly sized in advance and takes memory away from other uses. >> In your T4/T5 case the alternative would be either to a) allocate your >> own memory directly from KVM with the necessary properties (KVM and/or >> phys >> contig); b) have such a generic kernel mbuf type fulfilling the same >> role. >> There may be some cache line issues on non-x86 systems that have to be >> though and taken care of. >> - Refcounts should have the option of being separately allocated. It was >> mandatory to use the refcount zone so far because there wasn't any other >> type of refcount. Now that we have one we should revisit the issue. >> Actually the entire mbuf allocation and initialization could be >> streamlined >> as a whole. >> >> On a side note a different mbuf handling for the RX DMA rings may give some >> significant improvements as well: allocate just a cluster without a mbuf >> through >> m_cljget() and put it into the RX ring. Only when the DMA has put a >> packet into >> it allocated attach the mbuf (in the drivers RX function). This avoids >> the cache >> pollution from touching the mbuf fields during initial allocation, >> including the >> refcount. > > Er, this is pretty much how cxgbe(4) has always done it. A cluster is > allocated with m_cljget, an mbuf is allocated with MT_NOINIT to avoid > touching any line in the mbuf. m_init is called later in the rx ithread. Excellent. I haven't (yet) spent much time reading the cxgbe(4) code. >> Another nice trick would be to shorten the mbuf by 4 bytes (in ext_size) >> and put >> the refcount there. >> >> Lets work on these together. > > Yes. I think we agree on the long term optimization, or are at least > headed in the same general direction. But removing M_NOFREE removed a > dirt-cheap way to test and exercise the approach without implementing > the "real thing." Why not just let it be? I don't mind too much having M_NOFREE return but, while convenient, I'm not convinced at all that it is the right and best way of handling that use case. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:03:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45189ED7 for ; Wed, 21 Aug 2013 15:03:07 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AABE1220C for ; Wed, 21 Aug 2013 15:03:06 +0000 (UTC) Received: (qmail 72647 invoked from network); 21 Aug 2013 15:46:11 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 15:46:11 -0000 Message-ID: <5214D6A3.608@freebsd.org> Date: Wed, 21 Aug 2013 17:02:59 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212587A.2080202@freebsd.org> <52128937.1010407@freebsd.org> <52129634.7000509@FreeBSD.org> In-Reply-To: <52129634.7000509@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, Peter Grehan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:03:07 -0000 On 20.08.2013 00:03, Navdeep Parhar wrote: > On 08/19/13 14:08, Andre Oppermann wrote: >> On 19.08.2013 19:40, Peter Grehan wrote: >>>> I recently tried some experiments to reduce the number of mbuf and >>>> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >>>> very useful and the code changes to the kernel were minimal. See >>>> user/np/cxl_tuning. The experiment was quite successful and I was >>>> planning to bring in most of those changes to HEAD. I was hoping to get >>>> some runtime mileage on the approach in general before tweaking the >>>> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >>>> within the cluster. But now M_NOFREE has vanished without a warning... >>> >>> I also had a virtualization work-in-progress where static mbufs were >>> allocated in the kernel and >>> M_NOFREE set. >>> >>> Might be worth sending a prior heads-up for these type of changes. >> >> I'm sorry for ambushing but this stuff has to be done. I have provided >> an alternative way of handling it and I'm happy to help you with your >> use case to make it good for you and to prevent the mbuf system from >> getting bloated and hackish again. > > I don't know what Peter's use case is but I'm curious about the > already-available alternative to M_NOFREE, if that's what you meant. > Can you please elaborate? When you supply your own (*ext_free) function you can simply omit freeing the mbuf itself. Should make sure not to leak it though. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:03:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2A45DF0; Wed, 21 Aug 2013 15:03:43 +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 DD947221A; Wed, 21 Aug 2013 15:03:42 +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 2E1EE1221E; Thu, 22 Aug 2013 01:03:42 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-67-161-27-37.hsd1.ca.comcast.net [67.161.27.37]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BOC73155 (AUTH peterg@ptree32.com.au); Thu, 22 Aug 2013 01:03:40 +1000 Message-ID: <5214D6CA.2040405@freebsd.org> Date: Wed, 21 Aug 2013 08:03:38 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> <5214D5E0.9040002@freebsd.org> In-Reply-To: <5214D5E0.9040002@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, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:03:43 -0000 > The way to go should be 4K clusters as they are native to the architecture. > IIRC a PCIe DMA can't cross a 4K boundary anyway That's a 4G boundary, for some devices. later, Peter. From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:13:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 451297DB for ; Wed, 21 Aug 2013 15:13:46 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB8E2231B for ; Wed, 21 Aug 2013 15:13:45 +0000 (UTC) Received: (qmail 72728 invoked from network); 21 Aug 2013 15:56:50 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 15:56:50 -0000 Message-ID: <5214D922.6010208@freebsd.org> Date: Wed, 21 Aug 2013 17:13:38 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Julian Elischer Subject: Re: svn commit: r254519 - in head/sys: netinet netinet6 sys References: <201308191108.r7JB8aQ4057777@svn.freebsd.org> <5212DCD8.4050004@freebsd.org> In-Reply-To: <5212DCD8.4050004@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:13:46 -0000 On 20.08.2013 05:04, Julian Elischer wrote: > On 8/19/13 7:08 PM, Andre Oppermann wrote: >> Author: andre >> Date: Mon Aug 19 11:08:36 2013 >> New Revision: 254519 >> URL: http://svnweb.freebsd.org/changeset/base/254519 >> >> Log: >> Move the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific >> flag instead. The flag is only used within the IP and IPv6 layer 3 >> protocols. > > weeeeelllll, "maybe" > Layer 2 usage of ipfw could make use of this flag as well. > Cisco were using L2 ipfw some years back. I don't know if this affects them at all. L2 firewalls are not affected directly. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:31:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2DC3BE8C for ; Wed, 21 Aug 2013 15:31:05 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 771B7246F for ; Wed, 21 Aug 2013 15:31:04 +0000 (UTC) Received: (qmail 72800 invoked from network); 21 Aug 2013 16:14:08 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 16:14:08 -0000 Message-ID: <5214DD31.6010205@freebsd.org> Date: Wed, 21 Aug 2013 17:30:57 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Davide Italiano Subject: Re: svn commit: r254524 - head/sys/sys References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> <5213AAA1.6020700@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:31:05 -0000 On 20.08.2013 20:13, Davide Italiano wrote: > On Tue, Aug 20, 2013 at 7:42 PM, Andre Oppermann wrote: >> On 19.08.2013 19:37, Navdeep Parhar wrote: >>> Why reuse the freed up bits so soon (at least one of which I think was >>> prematurely GC'ed -- see my other email on M_NOFREE). There was room >>> beyond M_HASHTYPEBITS, no? >> >> This is HEAD where kernel and modules have to be (re)compiled together >> at any point in time. On stable this reuse would not have been possible. >> >> In a subsequent commit I compacted and ordered the flags. There's a couple >> of free ones remaining. >> >> I have some additional mbuf changes coming up to be posted for possible >> objections later today. The close HEAD freeze deadline has got me rushed >> a bit to allow 10.x backporting of the checksum/offload overhaul. >> >> -- >> Andre >> > > In my opinion the possibility we have about breaking KPI/KBI should > not be abused, even if it's allowed in HEAD. In other words,people > should go for preserving it when (as in this case) it's easy and > without additional costs. Your point about "this is HEAD, it can be > broken at any time" makes relatively little sense to me. Note that in > the worst case such KPI/KBI breakages are annoying for $VENDORS who > maintain out-of-tree code, which need to rebuild/change their code, > or, if they get pissed off, drop FreeBSD support. > In your case, it's just a matter of "code cleaness" about few lines, > which, IMHO and always IMHO, doesn't justify the breakage. Preserving the API but having to recompile is always fair game in HEAD. In fact it happens all the time and the only supported way to track HEAD is to recompile kernel and modules together. For removing (crufty) functionality I agree that it shouldn't be done just for the sake of it and also shouldn't be done often. Sometimes it is necessary in the name of progress. Having to support old, crufty or broken ways of doing something is a waste of developer time too. It's always a judgement call. In this case there is a perfectly valid alternative way of doing that also is less dangerous to leak mbufs. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:31:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6F5A4FD9; Wed, 21 Aug 2013 15:31:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0AD2478; Wed, 21 Aug 2013 15:31:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LFVi3I013064; Wed, 21 Aug 2013 15:31:44 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LFVieh013063; Wed, 21 Aug 2013 15:31:44 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201308211531.r7LFVieh013063@svn.freebsd.org> From: Alan Cox Date: Wed, 21 Aug 2013 15:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254599 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:31:44 -0000 Author: alc Date: Wed Aug 21 15:31:43 2013 New Revision: 254599 URL: http://svnweb.freebsd.org/changeset/base/254599 Log: Addendum to r254141: Allow recursion on the free pages queues lock in vm_page_alloc_freelist(). Reported and tested by: sbruno Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Aug 21 14:33:02 2013 (r254598) +++ head/sys/vm/vm_page.c Wed Aug 21 15:31:43 2013 (r254599) @@ -1927,7 +1927,7 @@ vm_page_alloc_freelist(int flind, int re /* * Do not allocate reserved pages unless the req has asked for it. */ - mtx_lock(&vm_page_queue_free_mtx); + mtx_lock_flags(&vm_page_queue_free_mtx, MTX_RECURSE); if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:33:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12EDD1FC for ; Wed, 21 Aug 2013 15:33:00 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0C0A248C for ; Wed, 21 Aug 2013 15:32:59 +0000 (UTC) Received: (qmail 72831 invoked from network); 21 Aug 2013 16:16:03 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 16:16:03 -0000 Message-ID: <5214DDA4.4010504@freebsd.org> Date: Wed, 21 Aug 2013 17:32:52 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Peter Grehan Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> <5214D5E0.9040002@freebsd.org> <5214D6CA.2040405@freebsd.org> In-Reply-To: <5214D6CA.2040405@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, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:33:00 -0000 On 21.08.2013 17:03, Peter Grehan wrote: >> The way to go should be 4K clusters as they are native to the architecture. >> IIRC a PCIe DMA can't cross a 4K boundary anyway > > That's a 4G boundary, for some devices. I meant a single PCIe DMA transaction can be at most 4K before it has to set up another one? -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:53:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CCEBFB9E; Wed, 21 Aug 2013 15:53:56 +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 89A5725EA; Wed, 21 Aug 2013 15:53:56 +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 17B60121E5; Thu, 22 Aug 2013 01:53:55 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-67-161-27-37.hsd1.ca.comcast.net [67.161.27.37]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BOC74114 (AUTH peterg@ptree32.com.au); Thu, 22 Aug 2013 01:53:53 +1000 Message-ID: <5214E28F.2060703@freebsd.org> Date: Wed, 21 Aug 2013 08:53:51 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> <5214D5E0.9040002@freebsd.org> <5214D6CA.2040405@freebsd.org> <5214DDA4.4010504@freebsd.org> In-Reply-To: <5214DDA4.4010504@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, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:53:56 -0000 Hi Andre, > On 21.08.2013 17:03, Peter Grehan wrote: >>> The way to go should be 4K clusters as they are native to the >>> architecture. >>> IIRC a PCIe DMA can't cross a 4K boundary anyway >> >> That's a 4G boundary, for some devices. > > I meant a single PCIe DMA transaction can be at most 4K before it has to > set up another one? 4K is the maximum TLP size but that's rarely (ever?) used - 128 or 256 bytes is more common. A DMA operation is just a sequence of TLPs originating from the endpoint. later, Peter. From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 15:59:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48C83D64; Wed, 21 Aug 2013 15:59:56 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [IPv6:2607:f8b0:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B19992618; Wed, 21 Aug 2013 15:59:55 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id gf11so381706vcb.39 for ; Wed, 21 Aug 2013 08:59: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:message-id:subject :from:to:cc:content-type; bh=Qa72VUObh0GwmtRyz0TDezMH0kApgjxNl7v47uAj+uE=; b=V3V+5Fvxe8waaEWkjw/CN++06HLOc5vLy+y2dKnFeKy0mrj6GW3eOljkLGFj8uwgx3 +etflA5v4sX8sTKuIAHOhPzQDcMVxigSxA1Ayr93SqIWlJLMh0IAURCRz0N9n0gva+UF FI2zlJpMmFFmAhYUQMjiwJrzSaT/sIgLkjaahzaGDMSMkQjaG9T6/1gYq6Fgw9j6aVvI 6YdJDmtUTpYT2Oh+aFHKw5Eh5Jnw5EhQDrdKhbhWQenviYrQQmQYn7S4VXf27W7ct9k2 g6dgx0R6TtDdYoUmDbvOD6/AjTO2eWxvn2iWA7pr5hvQEKWcSNF+3rVNm/AduG5uy1oI MopQ== MIME-Version: 1.0 X-Received: by 10.52.35.171 with SMTP id i11mr5982177vdj.4.1377100794500; Wed, 21 Aug 2013 08:59:54 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Wed, 21 Aug 2013 08:59:54 -0700 (PDT) In-Reply-To: <5214DD31.6010205@freebsd.org> References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> <5213AAA1.6020700@freebsd.org> <5214DD31.6010205@freebsd.org> Date: Wed, 21 Aug 2013 17:59:54 +0200 X-Google-Sender-Auth: PbEb1t4qWmkwpbWsbTgslT_-VWo Message-ID: Subject: Re: svn commit: r254524 - head/sys/sys From: Davide Italiano To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 15:59:56 -0000 On Wed, Aug 21, 2013 at 5:30 PM, Andre Oppermann wrote: > On 20.08.2013 20:13, Davide Italiano wrote: >> >> On Tue, Aug 20, 2013 at 7:42 PM, Andre Oppermann >> wrote: >>> >>> On 19.08.2013 19:37, Navdeep Parhar wrote: >>>> >>>> Why reuse the freed up bits so soon (at least one of which I think was >>>> prematurely GC'ed -- see my other email on M_NOFREE). There was room >>>> beyond M_HASHTYPEBITS, no? >>> >>> >>> This is HEAD where kernel and modules have to be (re)compiled together >>> at any point in time. On stable this reuse would not have been possible. >>> >>> In a subsequent commit I compacted and ordered the flags. There's a >>> couple >>> of free ones remaining. >>> >>> I have some additional mbuf changes coming up to be posted for possible >>> objections later today. The close HEAD freeze deadline has got me rushed >>> a bit to allow 10.x backporting of the checksum/offload overhaul. >>> >>> -- >>> Andre >>> >> >> In my opinion the possibility we have about breaking KPI/KBI should >> not be abused, even if it's allowed in HEAD. In other words,people >> should go for preserving it when (as in this case) it's easy and >> without additional costs. Your point about "this is HEAD, it can be >> broken at any time" makes relatively little sense to me. Note that in >> the worst case such KPI/KBI breakages are annoying for $VENDORS who >> maintain out-of-tree code, which need to rebuild/change their code, >> or, if they get pissed off, drop FreeBSD support. >> In your case, it's just a matter of "code cleaness" about few lines, >> which, IMHO and always IMHO, doesn't justify the breakage. > > > Preserving the API but having to recompile is always fair game in HEAD. > In fact it happens all the time and the only supported way to track HEAD > is to recompile kernel and modules together. > > For removing (crufty) functionality I agree that it shouldn't be done > just for the sake of it and also shouldn't be done often. Sometimes it > is necessary in the name of progress. Having to support old, crufty or > broken ways of doing something is a waste of developer time too. > > It's always a judgement call. In this case there is a perfectly valid > alternative way of doing that also is less dangerous to leak mbufs. > > -- > Andre > I don't see in any way how flags reordering might be in any way connected to mbufs leaks, alas. There's a similar recent('ish) discussion and it was decided to not compact/reorder flags. See r253662/r253775 for references. So, I'm not sure what's the de-facto policy, but still, as a community FreeBSD should decide one strategy and be stuck with that. It's a matter of being consistent, which, IMHO, is something that should not be undervaluated. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 16:19:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4D68521 for ; Wed, 21 Aug 2013 16:19:02 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12275272B for ; Wed, 21 Aug 2013 16:19:01 +0000 (UTC) Received: (qmail 72994 invoked from network); 21 Aug 2013 17:02:05 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 17:02:05 -0000 Message-ID: <5214E86F.1060102@freebsd.org> Date: Wed, 21 Aug 2013 18:18:55 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Davide Italiano Subject: Re: svn commit: r254524 - head/sys/sys References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> <5213AAA1.6020700@freebsd.org> <5214DD31.6010205@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 16:19:02 -0000 On 21.08.2013 17:59, Davide Italiano wrote: > On Wed, Aug 21, 2013 at 5:30 PM, Andre Oppermann wrote: >> On 20.08.2013 20:13, Davide Italiano wrote: >>> >>> On Tue, Aug 20, 2013 at 7:42 PM, Andre Oppermann >>> wrote: >>>> >>>> On 19.08.2013 19:37, Navdeep Parhar wrote: >>>>> >>>>> Why reuse the freed up bits so soon (at least one of which I think was >>>>> prematurely GC'ed -- see my other email on M_NOFREE). There was room >>>>> beyond M_HASHTYPEBITS, no? >>>> >>>> >>>> This is HEAD where kernel and modules have to be (re)compiled together >>>> at any point in time. On stable this reuse would not have been possible. >>>> >>>> In a subsequent commit I compacted and ordered the flags. There's a >>>> couple >>>> of free ones remaining. >>>> >>>> I have some additional mbuf changes coming up to be posted for possible >>>> objections later today. The close HEAD freeze deadline has got me rushed >>>> a bit to allow 10.x backporting of the checksum/offload overhaul. >>>> >>>> -- >>>> Andre >>>> >>> >>> In my opinion the possibility we have about breaking KPI/KBI should >>> not be abused, even if it's allowed in HEAD. In other words,people >>> should go for preserving it when (as in this case) it's easy and >>> without additional costs. Your point about "this is HEAD, it can be >>> broken at any time" makes relatively little sense to me. Note that in >>> the worst case such KPI/KBI breakages are annoying for $VENDORS who >>> maintain out-of-tree code, which need to rebuild/change their code, >>> or, if they get pissed off, drop FreeBSD support. >>> In your case, it's just a matter of "code cleaness" about few lines, >>> which, IMHO and always IMHO, doesn't justify the breakage. >> >> >> Preserving the API but having to recompile is always fair game in HEAD. >> In fact it happens all the time and the only supported way to track HEAD >> is to recompile kernel and modules together. >> >> For removing (crufty) functionality I agree that it shouldn't be done >> just for the sake of it and also shouldn't be done often. Sometimes it >> is necessary in the name of progress. Having to support old, crufty or >> broken ways of doing something is a waste of developer time too. >> >> It's always a judgement call. In this case there is a perfectly valid >> alternative way of doing that also is less dangerous to leak mbufs. >> >> -- >> Andre >> > > I don't see in any way how flags reordering might be in any way > connected to mbufs leaks, alas. > There's a similar recent('ish) discussion and it was decided to not > compact/reorder flags. See r253662/r253775 for references. > So, I'm not sure what's the de-facto policy, but still, as a community > FreeBSD should decide one strategy and be stuck with that. It's a > matter of being consistent, which, IMHO, is something that should not > be undervaluated. I fail to see what problem you have with the flag reordering. Recompile and done. That's why we work with #defines instead of magic 0x1234 values. If someone outside the tree was using the spare bits for their own private purposes, yes, they would quickly have to check and possibly adjust them. That's trivial however and should be expected when tracking an OpenSource operating system. If you want total ABI stability then build on Windows but even they made a big break somewhere around NIDS5 or NDIS6. We can't get stuck on every bit because there may be someone somewhere out there we don't know about using it. On any x-stable such a reorder wouldn't be possible obviously because of the ABI preservation guarantee. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 16:29:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D2C6B966; Wed, 21 Aug 2013 16:29:06 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x233.google.com (mail-vc0-x233.google.com [IPv6:2607:f8b0:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4730E27D4; Wed, 21 Aug 2013 16:29:06 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id ht10so410494vcb.38 for ; Wed, 21 Aug 2013 09:29:05 -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:message-id:subject :from:to:cc:content-type; bh=OATyy2cIS3/B4wcHvEJwr60gyz+5YW/KDz4u9yeDLP8=; b=bQXvG2DEpaAGz/PoJMrWmLNFLkibltPQCEiwdsRyHGM2sGHCDEGuKHJjSSjVfw1pFV U3OdnqfY+2BW/lEeAdFBJIW+Tt3lkpyTzxrxPopzMr8htD2XicKBFYRqqsuEV+Jyzlbj YlusCvUhb8Vtl0Y545+0So3KiRmPgiBpr5x7DkVgwOfDJb9oJSfU6GI9z7uaed1wdM1q Nvfip8x0NIXhkAZHfpjH7LYP7mSsgpkQUEt96QIBT70sLgdnTQxhgJnWMO7g57/DDgMH qPFK+bEUb3QRdcmnmg6QMz1XLj31q0JjeiJtbmZucdQYD813t9PA1cpJSt8xbdnQQ0MS ZAfg== MIME-Version: 1.0 X-Received: by 10.220.173.134 with SMTP id p6mr639664vcz.36.1377102544958; Wed, 21 Aug 2013 09:29:04 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Wed, 21 Aug 2013 09:29:04 -0700 (PDT) In-Reply-To: <5214E86F.1060102@freebsd.org> References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> <5213AAA1.6020700@freebsd.org> <5214DD31.6010205@freebsd.org> <5214E86F.1060102@freebsd.org> Date: Wed, 21 Aug 2013 18:29:04 +0200 X-Google-Sender-Auth: TakbU2n9F97yv7dnQ3cwH6EfMLY Message-ID: Subject: Re: svn commit: r254524 - head/sys/sys From: Davide Italiano To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 16:29:06 -0000 On Wed, Aug 21, 2013 at 6:18 PM, Andre Oppermann wrote: > On 21.08.2013 17:59, Davide Italiano wrote: >> >> On Wed, Aug 21, 2013 at 5:30 PM, Andre Oppermann >> wrote: >>> >>> On 20.08.2013 20:13, Davide Italiano wrote: >>>> >>>> >>>> On Tue, Aug 20, 2013 at 7:42 PM, Andre Oppermann >>>> wrote: >>>>> >>>>> >>>>> On 19.08.2013 19:37, Navdeep Parhar wrote: >>>>>> >>>>>> >>>>>> Why reuse the freed up bits so soon (at least one of which I think was >>>>>> prematurely GC'ed -- see my other email on M_NOFREE). There was room >>>>>> beyond M_HASHTYPEBITS, no? >>>>> >>>>> >>>>> >>>>> This is HEAD where kernel and modules have to be (re)compiled together >>>>> at any point in time. On stable this reuse would not have been >>>>> possible. >>>>> >>>>> In a subsequent commit I compacted and ordered the flags. There's a >>>>> couple >>>>> of free ones remaining. >>>>> >>>>> I have some additional mbuf changes coming up to be posted for possible >>>>> objections later today. The close HEAD freeze deadline has got me >>>>> rushed >>>>> a bit to allow 10.x backporting of the checksum/offload overhaul. >>>>> >>>>> -- >>>>> Andre >>>>> >>>> >>>> In my opinion the possibility we have about breaking KPI/KBI should >>>> not be abused, even if it's allowed in HEAD. In other words,people >>>> should go for preserving it when (as in this case) it's easy and >>>> without additional costs. Your point about "this is HEAD, it can be >>>> broken at any time" makes relatively little sense to me. Note that in >>>> the worst case such KPI/KBI breakages are annoying for $VENDORS who >>>> maintain out-of-tree code, which need to rebuild/change their code, >>>> or, if they get pissed off, drop FreeBSD support. >>>> In your case, it's just a matter of "code cleaness" about few lines, >>>> which, IMHO and always IMHO, doesn't justify the breakage. >>> >>> >>> >>> Preserving the API but having to recompile is always fair game in HEAD. >>> In fact it happens all the time and the only supported way to track HEAD >>> is to recompile kernel and modules together. >>> >>> For removing (crufty) functionality I agree that it shouldn't be done >>> just for the sake of it and also shouldn't be done often. Sometimes it >>> is necessary in the name of progress. Having to support old, crufty or >>> broken ways of doing something is a waste of developer time too. >>> >>> It's always a judgement call. In this case there is a perfectly valid >>> alternative way of doing that also is less dangerous to leak mbufs. >>> >>> -- >>> Andre >>> >> >> I don't see in any way how flags reordering might be in any way >> connected to mbufs leaks, alas. >> There's a similar recent('ish) discussion and it was decided to not >> compact/reorder flags. See r253662/r253775 for references. >> So, I'm not sure what's the de-facto policy, but still, as a community >> FreeBSD should decide one strategy and be stuck with that. It's a >> matter of being consistent, which, IMHO, is something that should not >> be undervaluated. > > > I fail to see what problem you have with the flag reordering. Recompile That it broke KBI. Without any advantage, other than "compacting" things and making code a bit more readable. And without any real reason, as there's still room for new flags. I think Navdeep pointed out this as well. But I won't object anymore. Go for it. The reason why I replied is that I find silly doing something like this without real advantage. > and done. That's why we work with #defines instead of magic 0x1234 values. > If someone outside the tree was using the spare bits for their own private > purposes, yes, they would quickly have to check and possibly adjust them. > That's trivial however and should be expected when tracking an OpenSource > operating system. If you want total ABI stability then build on Windows > but even they made a big break somewhere around NIDS5 or NDIS6. We can't > get stuck on every bit because there may be someone somewhere out there > we don't know about using it. On any x-stable such a reorder wouldn't > be possible obviously because of the ABI preservation guarantee. > > -- > Andre > Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 16:46:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26CA6D5; Wed, 21 Aug 2013 16:46:07 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1494E28E4; Wed, 21 Aug 2013 16:46:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LGk6LH051216; Wed, 21 Aug 2013 16:46:06 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LGk6eV051215; Wed, 21 Aug 2013 16:46:06 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201308211646.r7LGk6eV051215@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 21 Aug 2013 16:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254600 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 16:46:07 -0000 Author: pluknet Date: Wed Aug 21 16:46:06 2013 New Revision: 254600 URL: http://svnweb.freebsd.org/changeset/base/254600 Log: Check strtoumax(3) for ERANGE in case of non-prefixed string. OK'd by: silence on current@ MFC after: 1 week Modified: head/lib/libutil/expand_number.c Modified: head/lib/libutil/expand_number.c ============================================================================== --- head/lib/libutil/expand_number.c Wed Aug 21 15:31:43 2013 (r254599) +++ head/lib/libutil/expand_number.c Wed Aug 21 16:46:06 2013 (r254600) @@ -55,6 +55,10 @@ expand_number(const char *buf, uint64_t number = strtoumax(buf, &endptr, 0); + if (number == UINTMAX_MAX && errno == ERANGE) { + return (-1); + } + if (endptr == buf) { /* No valid digits. */ errno = EINVAL; From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 17:21:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B766C345 for ; Wed, 21 Aug 2013 17:21:57 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1E42B58 for ; Wed, 21 Aug 2013 17:21:56 +0000 (UTC) Received: by mail-ea0-f174.google.com with SMTP id z15so418125ead.5 for ; Wed, 21 Aug 2013 10:21:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding; bh=CLtk3dJZ2ZFtIbX/Ci55xMIMcmhgl0jyYmyiVX0BSL8=; b=lPMUBp1hiSaXaP18cYwCg1leoNOh8EOLGz1SeWOY3WY1QPQsjyuoMlnh3k2dydFcbb ZyI+AVpFf8J+O53mK/O4annJrHQtcDgQEOq7P85GqguvVochzRNVedPDVsf/rmcxTn5m JhCQwpKuTxPd8C5Jl05q3yBOuLOCPnQ/IaKKg635phx7BMbG2uPv1CWzjygLqUHUOV4g yers7KQ0BEoMk5t2ov/eqWPHndgARJQb+NdAJNulOu0F1ckRwi1Jdq09wD5R1tYstDCl B7BnaekQcqZ7OTnhy7mS7z7YGf72PIeKbKeOhq5Q+c5m9w0hVYP2OUhi+RtGmdCusQkX 2TiQ== X-Gm-Message-State: ALoCoQkiSU4nqXgu0fNNLwICs5kQe7O31+w8YuQAYCk2/FVuEFDh2xpwI8xV1SR0j+SzIJe7piXJ X-Received: by 10.15.43.13 with SMTP id w13mr11887326eev.37.1377105709628; Wed, 21 Aug 2013 10:21:49 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id a1sm11309096eem.1.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 10:21:49 -0700 (PDT) Message-ID: <5214F72B.7070006@freebsd.org> Date: Wed, 21 Aug 2013 21:21:47 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: svn commit: r254600 - head/lib/libutil References: <201308211646.r7LGk6eV051215@svn.freebsd.org> In-Reply-To: <201308211646.r7LGk6eV051215@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 17:21:57 -0000 On 21.08.2013 20:46, Sergey Kandaurov wrote: > number = strtoumax(buf, &endptr, 0); > > + if (number == UINTMAX_MAX && errno == ERANGE) { > + return (-1); > + } You need to reset errno before strtoumax() call (errno = 0), because any of previous functions may left it as ERANGE. -- http://ache.vniz.net/ bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 17:23:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 94E334BE; Wed, 21 Aug 2013 17:23:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 740AD2B68; Wed, 21 Aug 2013 17:23:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LHNPO2072369; Wed, 21 Aug 2013 17:23:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LHNO2n072366; Wed, 21 Aug 2013 17:23:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308211723.r7LHNO2n072366@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Aug 2013 17:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254601 - in head/sys: fs/tmpfs kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 17:23:25 -0000 Author: kib Date: Wed Aug 21 17:23:24 2013 New Revision: 254601 URL: http://svnweb.freebsd.org/changeset/base/254601 Log: Extract the general-purpose code from tmpfs to perform uiomove from the page queue of some vm object. Discussed with: alc Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/uipc_shm.c head/sys/sys/uio.h Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 21 16:46:06 2013 (r254600) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 21 17:23:24 2013 (r254601) @@ -439,225 +439,51 @@ tmpfs_setattr(struct vop_setattr_args *v } static int -tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, - vm_offset_t offset, size_t tlen, struct uio *uio) -{ - vm_page_t m; - int error, rv; - - VM_OBJECT_WLOCK(tobj); - - /* - * Parallel reads of the page content from disk are prevented - * by exclusive busy. - * - * Although the tmpfs vnode lock is held here, it is - * nonetheless safe to sleep waiting for a free page. The - * pageout daemon does not need to acquire the tmpfs vnode - * lock to page out tobj's pages because tobj is a OBJT_SWAP - * type object. - */ - m = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if (m->valid != VM_PAGE_BITS_ALL) { - if (vm_pager_has_page(tobj, idx, NULL, NULL)) { - rv = vm_pager_get_pages(tobj, &m, 1, 0); - m = vm_page_lookup(tobj, idx); - if (m == NULL) { - printf( - "tmpfs: vm_obj %p idx %jd null lookup rv %d\n", - tobj, idx, rv); - VM_OBJECT_WUNLOCK(tobj); - return (EIO); - } - if (rv != VM_PAGER_OK) { - printf( - "tmpfs: vm_obj %p idx %jd valid %x pager error %d\n", - tobj, idx, m->valid, rv); - vm_page_lock(m); - vm_page_free(m); - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(tobj); - return (EIO); - } - } else - vm_page_zero_invalid(m, TRUE); - } - vm_page_xunbusy(m); - vm_page_lock(m); - vm_page_hold(m); - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(tobj); - error = uiomove_fromphys(&m, offset, tlen, uio); - vm_page_lock(m); - vm_page_unhold(m); - if (m->queue == PQ_NONE) { - vm_page_deactivate(m); - } else { - /* Requeue to maintain LRU ordering. */ - vm_page_requeue(m); - } - vm_page_unlock(m); - - return (error); -} - -static int tmpfs_read(struct vop_read_args *v) { - struct vnode *vp = v->a_vp; - struct uio *uio = v->a_uio; + struct vnode *vp; + struct uio *uio; struct tmpfs_node *node; - vm_object_t uobj; - size_t len; - int resid; - int error = 0; - vm_pindex_t idx; - vm_offset_t offset; - off_t addr; - size_t tlen; + vp = v->a_vp; + if (vp->v_type != VREG) + return (EISDIR); + uio = v->a_uio; + if (uio->uio_offset < 0) + return (EINVAL); node = VP_TO_TMPFS_NODE(vp); - - if (vp->v_type != VREG) { - error = EISDIR; - goto out; - } - - if (uio->uio_offset < 0) { - error = EINVAL; - goto out; - } - node->tn_status |= TMPFS_NODE_ACCESSED; - - uobj = node->tn_reg.tn_aobj; - while ((resid = uio->uio_resid) > 0) { - error = 0; - if (node->tn_size <= uio->uio_offset) - break; - len = MIN(node->tn_size - uio->uio_offset, resid); - if (len == 0) - break; - addr = uio->uio_offset; - idx = OFF_TO_IDX(addr); - offset = addr & PAGE_MASK; - tlen = MIN(PAGE_SIZE - offset, len); - error = tmpfs_nocacheread(uobj, idx, offset, tlen, uio); - if ((error != 0) || (resid == uio->uio_resid)) - break; - } - -out: - - return error; -} - -/* --------------------------------------------------------------------- */ - -static int -tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio) -{ - vm_pindex_t idx; - vm_page_t tpg; - vm_offset_t offset; - off_t addr; - size_t tlen; - int error, rv; - - error = 0; - - addr = uio->uio_offset; - idx = OFF_TO_IDX(addr); - offset = addr & PAGE_MASK; - tlen = MIN(PAGE_SIZE - offset, len); - - VM_OBJECT_WLOCK(tobj); - tpg = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if (tpg->valid != VM_PAGE_BITS_ALL) { - if (vm_pager_has_page(tobj, idx, NULL, NULL)) { - rv = vm_pager_get_pages(tobj, &tpg, 1, 0); - tpg = vm_page_lookup(tobj, idx); - if (tpg == NULL) { - printf( - "tmpfs: vm_obj %p idx %jd null lookup rv %d\n", - tobj, idx, rv); - VM_OBJECT_WUNLOCK(tobj); - return (EIO); - } - if (rv != VM_PAGER_OK) { - printf( - "tmpfs: vm_obj %p idx %jd valid %x pager error %d\n", - tobj, idx, tpg->valid, rv); - vm_page_lock(tpg); - vm_page_free(tpg); - vm_page_unlock(tpg); - VM_OBJECT_WUNLOCK(tobj); - return (EIO); - } - } else - vm_page_zero_invalid(tpg, TRUE); - } - vm_page_xunbusy(tpg); - vm_page_lock(tpg); - vm_page_hold(tpg); - vm_page_unlock(tpg); - VM_OBJECT_WUNLOCK(tobj); - error = uiomove_fromphys(&tpg, offset, tlen, uio); - VM_OBJECT_WLOCK(tobj); - if (error == 0) - vm_page_dirty(tpg); - vm_page_lock(tpg); - vm_page_unhold(tpg); - if (tpg->queue == PQ_NONE) { - vm_page_deactivate(tpg); - } else { - /* Requeue to maintain LRU ordering. */ - vm_page_requeue(tpg); - } - vm_page_unlock(tpg); - VM_OBJECT_WUNLOCK(tobj); - - return (error); + return (uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio)); } static int tmpfs_write(struct vop_write_args *v) { - struct vnode *vp = v->a_vp; - struct uio *uio = v->a_uio; - int ioflag = v->a_ioflag; - - boolean_t extended; - int error = 0; - off_t oldsize; + struct vnode *vp; + struct uio *uio; struct tmpfs_node *node; - vm_object_t uobj; - size_t len; - int resid; + off_t oldsize; + int error, ioflag; + boolean_t extended; + vp = v->a_vp; + uio = v->a_uio; + ioflag = v->a_ioflag; + error = 0; node = VP_TO_TMPFS_NODE(vp); oldsize = node->tn_size; - if (uio->uio_offset < 0 || vp->v_type != VREG) { - error = EINVAL; - goto out; - } - - if (uio->uio_resid == 0) { - error = 0; - goto out; - } - + if (uio->uio_offset < 0 || vp->v_type != VREG) + return (EINVAL); + if (uio->uio_resid == 0) + return (0); if (ioflag & IO_APPEND) uio->uio_offset = node->tn_size; - if (uio->uio_offset + uio->uio_resid > VFS_TO_TMPFS(vp->v_mount)->tm_maxfilesize) return (EFBIG); - if (vn_rlimit_fsize(vp, uio, uio->uio_td)) return (EFBIG); - extended = uio->uio_offset + uio->uio_resid > node->tn_size; if (extended) { error = tmpfs_reg_resize(vp, uio->uio_offset + uio->uio_resid, @@ -666,26 +492,13 @@ tmpfs_write(struct vop_write_args *v) goto out; } - uobj = node->tn_reg.tn_aobj; - while ((resid = uio->uio_resid) > 0) { - if (node->tn_size <= uio->uio_offset) - break; - len = MIN(node->tn_size - uio->uio_offset, resid); - if (len == 0) - break; - error = tmpfs_mappedwrite(uobj, len, uio); - if ((error != 0) || (resid == uio->uio_resid)) - break; - } - + error = uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio); node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | (extended ? TMPFS_NODE_CHANGED : 0); - if (node->tn_mode & (S_ISUID | S_ISGID)) { if (priv_check_cred(v->a_cred, PRIV_VFS_RETAINSUGID, 0)) node->tn_mode &= ~(S_ISUID | S_ISGID); } - if (error != 0) (void)tmpfs_reg_resize(vp, oldsize, TRUE); @@ -693,7 +506,7 @@ out: MPASS(IMPLIES(error == 0, uio->uio_resid == 0)); MPASS(IMPLIES(error != 0, oldsize == node->tn_size)); - return error; + return (error); } /* --------------------------------------------------------------------- */ Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Aug 21 16:46:06 2013 (r254600) +++ head/sys/kern/uipc_shm.c Wed Aug 21 17:23:24 2013 (r254601) @@ -139,6 +139,100 @@ static struct fileops shm_ops = { FEATURE(posix_shm, "POSIX shared memory"); static int +uiomove_object_page(vm_object_t obj, size_t len, struct uio *uio) +{ + vm_page_t m; + vm_pindex_t idx; + size_t tlen; + int error, offset, rv; + + idx = OFF_TO_IDX(uio->uio_offset); + offset = uio->uio_offset & PAGE_MASK; + tlen = MIN(PAGE_SIZE - offset, len); + + VM_OBJECT_WLOCK(obj); + + /* + * Parallel reads of the page content from disk are prevented + * by exclusive busy. + * + * Although the tmpfs vnode lock is held here, it is + * nonetheless safe to sleep waiting for a free page. The + * pageout daemon does not need to acquire the tmpfs vnode + * lock to page out tobj's pages because tobj is a OBJT_SWAP + * type object. + */ + m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + if (m->valid != VM_PAGE_BITS_ALL) { + if (vm_pager_has_page(obj, idx, NULL, NULL)) { + rv = vm_pager_get_pages(obj, &m, 1, 0); + m = vm_page_lookup(obj, idx); + if (m == NULL) { + printf( + "uiomove_object: vm_obj %p idx %jd null lookup rv %d\n", + obj, idx, rv); + VM_OBJECT_WUNLOCK(obj); + return (EIO); + } + if (rv != VM_PAGER_OK) { + printf( + "uiomove_object: vm_obj %p idx %jd valid %x pager error %d\n", + obj, idx, m->valid, rv); + vm_page_lock(m); + vm_page_free(m); + vm_page_unlock(m); + VM_OBJECT_WUNLOCK(obj); + return (EIO); + } + } else + vm_page_zero_invalid(m, TRUE); + } + vm_page_xunbusy(m); + vm_page_lock(m); + vm_page_hold(m); + vm_page_unlock(m); + VM_OBJECT_WUNLOCK(obj); + error = uiomove_fromphys(&m, offset, tlen, uio); + if (uio->uio_rw == UIO_WRITE && error == 0) { + VM_OBJECT_WLOCK(obj); + vm_page_dirty(m); + VM_OBJECT_WUNLOCK(obj); + } + vm_page_lock(m); + vm_page_unhold(m); + if (m->queue == PQ_NONE) { + vm_page_deactivate(m); + } else { + /* Requeue to maintain LRU ordering. */ + vm_page_requeue(m); + } + vm_page_unlock(m); + + return (error); +} + +int +uiomove_object(vm_object_t obj, off_t obj_size, struct uio *uio) +{ + ssize_t resid; + size_t len; + int error; + + error = 0; + while ((resid = uio->uio_resid) > 0) { + if (obj_size <= uio->uio_offset) + break; + len = MIN(obj_size - uio->uio_offset, resid); + if (len == 0) + break; + error = uiomove_object_page(obj, len, uio); + if (error != 0 || resid == uio->uio_resid) + break; + } + return (error); +} + +static int shm_read(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) { Modified: head/sys/sys/uio.h ============================================================================== --- head/sys/sys/uio.h Wed Aug 21 16:46:06 2013 (r254600) +++ head/sys/sys/uio.h Wed Aug 21 17:23:24 2013 (r254601) @@ -103,6 +103,7 @@ int uiomove_frombuf(void *buf, int bufle int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n, struct uio *uio); int uiomove_nofault(void *cp, int n, struct uio *uio); +int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio); int uiomoveco(void *cp, int n, struct uio *uio, int disposable); #else /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 17:36:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1776B925; Wed, 21 Aug 2013 17:36:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02A352C35; Wed, 21 Aug 2013 17:36:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LHa2QT078862; Wed, 21 Aug 2013 17:36:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LHa2qD078858; Wed, 21 Aug 2013 17:36:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308211736.r7LHa2qD078858@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Aug 2013 17:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254602 - in head/sys: fs/devfs kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 17:36:03 -0000 Author: kib Date: Wed Aug 21 17:36:01 2013 New Revision: 254602 URL: http://svnweb.freebsd.org/changeset/base/254602 Log: Make the seek a method of the struct fileops. Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/sys/file.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Aug 21 17:23:24 2013 (r254601) +++ head/sys/fs/devfs/devfs_vnops.c Wed Aug 21 17:36:01 2013 (r254602) @@ -1697,6 +1697,7 @@ static struct fileops devfs_ops_f = { .fo_chmod = vn_chmod, .fo_chown = vn_chown, .fo_sendfile = vn_sendfile, + .fo_seek = vn_seek, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Aug 21 17:23:24 2013 (r254601) +++ head/sys/kern/vfs_syscalls.c Wed Aug 21 17:36:01 2013 (r254602) @@ -1879,77 +1879,15 @@ sys_lseek(td, uap) int whence; } */ *uap; { - struct ucred *cred = td->td_ucred; struct file *fp; - struct vnode *vp; - struct vattr vattr; - off_t foffset, offset, size; - int error, noneg; + int error; AUDIT_ARG_FD(uap->fd); if ((error = fget(td, uap->fd, CAP_SEEK, &fp)) != 0) return (error); - if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE)) { - fdrop(fp, td); - return (ESPIPE); - } - vp = fp->f_vnode; - foffset = foffset_lock(fp, 0); - noneg = (vp->v_type != VCHR); - offset = uap->offset; - switch (uap->whence) { - case L_INCR: - if (noneg && - (foffset < 0 || - (offset > 0 && foffset > OFF_MAX - offset))) { - error = EOVERFLOW; - break; - } - offset += foffset; - break; - case L_XTND: - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &vattr, cred); - VOP_UNLOCK(vp, 0); - if (error) - break; - - /* - * If the file references a disk device, then fetch - * the media size and use that to determine the ending - * offset. - */ - if (vattr.va_size == 0 && vp->v_type == VCHR && - fo_ioctl(fp, DIOCGMEDIASIZE, &size, cred, td) == 0) - vattr.va_size = size; - if (noneg && - (vattr.va_size > OFF_MAX || - (offset > 0 && vattr.va_size > OFF_MAX - offset))) { - error = EOVERFLOW; - break; - } - offset += vattr.va_size; - break; - case L_SET: - break; - case SEEK_DATA: - error = fo_ioctl(fp, FIOSEEKDATA, &offset, cred, td); - break; - case SEEK_HOLE: - error = fo_ioctl(fp, FIOSEEKHOLE, &offset, cred, td); - break; - default: - error = EINVAL; - } - if (error == 0 && noneg && offset < 0) - error = EINVAL; - if (error != 0) - goto drop; - VFS_KNOTE_UNLOCKED(vp, 0); - *(off_t *)(td->td_retval) = offset; -drop: + error = (fp->f_ops->fo_flags & DFLAG_SEEKABLE) != 0 ? + fo_seek(fp, uap->offset, uap->whence, td) : ESPIPE; fdrop(fp, td); - foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Wed Aug 21 17:23:24 2013 (r254601) +++ head/sys/kern/vfs_vnops.c Wed Aug 21 17:36:01 2013 (r254602) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -101,6 +102,7 @@ struct fileops vnops = { .fo_chmod = vn_chmod, .fo_chown = vn_chown, .fo_sendfile = vn_sendfile, + .fo_seek = vn_seek, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -2010,3 +2012,72 @@ unlock: *off = noff; return (error); } + +int +vn_seek(struct file *fp, off_t offset, int whence, struct thread *td) +{ + struct ucred *cred; + struct vnode *vp; + struct vattr vattr; + off_t foffset, size; + int error, noneg; + + cred = td->td_ucred; + vp = fp->f_vnode; + foffset = foffset_lock(fp, 0); + noneg = (vp->v_type != VCHR); + error = 0; + switch (whence) { + case L_INCR: + if (noneg && + (foffset < 0 || + (offset > 0 && foffset > OFF_MAX - offset))) { + error = EOVERFLOW; + break; + } + offset += foffset; + break; + case L_XTND: + vn_lock(vp, LK_SHARED | LK_RETRY); + error = VOP_GETATTR(vp, &vattr, cred); + VOP_UNLOCK(vp, 0); + if (error) + break; + + /* + * If the file references a disk device, then fetch + * the media size and use that to determine the ending + * offset. + */ + if (vattr.va_size == 0 && vp->v_type == VCHR && + fo_ioctl(fp, DIOCGMEDIASIZE, &size, cred, td) == 0) + vattr.va_size = size; + if (noneg && + (vattr.va_size > OFF_MAX || + (offset > 0 && vattr.va_size > OFF_MAX - offset))) { + error = EOVERFLOW; + break; + } + offset += vattr.va_size; + break; + case L_SET: + break; + case SEEK_DATA: + error = fo_ioctl(fp, FIOSEEKDATA, &offset, cred, td); + break; + case SEEK_HOLE: + error = fo_ioctl(fp, FIOSEEKHOLE, &offset, cred, td); + break; + default: + error = EINVAL; + } + if (error == 0 && noneg && offset < 0) + error = EINVAL; + if (error != 0) + goto drop; + VFS_KNOTE_UNLOCKED(vp, 0); + *(off_t *)(td->td_retval) = offset; +drop: + foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); + return (error); +} Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Wed Aug 21 17:23:24 2013 (r254601) +++ head/sys/sys/file.h Wed Aug 21 17:36:01 2013 (r254602) @@ -108,6 +108,8 @@ typedef int fo_chown_t(struct file *fp, typedef int fo_sendfile_t(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, int kflags, struct thread *td); +typedef int fo_seek_t(struct file *fp, off_t offset, int whence, + struct thread *td); typedef int fo_flags_t; struct fileops { @@ -122,6 +124,7 @@ struct fileops { fo_chmod_t *fo_chmod; fo_chown_t *fo_chown; fo_sendfile_t *fo_sendfile; + fo_seek_t *fo_seek; fo_flags_t fo_flags; /* DFLAG_* below */ }; @@ -242,6 +245,7 @@ fo_chown_t invfo_chown; fo_sendfile_t invfo_sendfile; fo_sendfile_t vn_sendfile; +fo_seek_t vn_seek; void finit(struct file *, u_int, short, void *, struct fileops *); int fgetvp(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp); @@ -370,6 +374,13 @@ fo_sendfile(struct file *fp, int sockfd, nbytes, sent, flags, kflags, td)); } +static __inline int +fo_seek(struct file *fp, off_t offset, int whence, struct thread *td) +{ + + return ((*fp->f_ops->fo_seek)(fp, offset, whence, td)); +} + #endif /* _KERNEL */ #endif /* !SYS_FILE_H */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 17:45:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4EAF6D5F; Wed, 21 Aug 2013 17:45:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A87B2CD1; Wed, 21 Aug 2013 17:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LHj2vC085550; Wed, 21 Aug 2013 17:45:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LHj0o5085520; Wed, 21 Aug 2013 17:45:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308211745.r7LHj0o5085520@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Aug 2013 17:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254603 - in head/sys: kern security/mac security/mac_biba security/mac_mls security/mac_stub security/mac_test sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 17:45:02 -0000 Author: kib Date: Wed Aug 21 17:45:00 2013 New Revision: 254603 URL: http://svnweb.freebsd.org/changeset/base/254603 Log: Implement read(2)/write(2) and neccessary lseek(2) for posix shmfd. Add MAC framework entries for posix shm read and write. Do not allow implicit extension of the underlying memory segment past the limit set by ftruncate(2) by either of the syscalls. Read and write returns short i/o, lseek(2) fails with EINVAL when resulting offset does not fit into the limit. Discussed with: alc Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_shm.c head/sys/security/mac/mac_framework.h head/sys/security/mac/mac_policy.h head/sys/security/mac/mac_posix_shm.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_stub/mac_stub.c head/sys/security/mac_test/mac_test.c head/sys/sys/mman.h Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/kern/uipc_shm.c Wed Aug 21 17:45:00 2013 (r254603) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -119,6 +120,7 @@ static fo_stat_t shm_stat; static fo_close_t shm_close; static fo_chmod_t shm_chmod; static fo_chown_t shm_chown; +static fo_seek_t shm_seek; /* File descriptor operations. */ static struct fileops shm_ops = { @@ -133,7 +135,8 @@ static struct fileops shm_ops = { .fo_chmod = shm_chmod, .fo_chown = shm_chown, .fo_sendfile = invfo_sendfile, - .fo_flags = DFLAG_PASSABLE + .fo_seek = shm_seek, + .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; FEATURE(posix_shm, "POSIX shared memory"); @@ -233,19 +236,96 @@ uiomove_object(vm_object_t obj, off_t ob } static int +shm_seek(struct file *fp, off_t offset, int whence, struct thread *td) +{ + struct shmfd *shmfd; + off_t foffset; + int error; + + shmfd = fp->f_data; + foffset = foffset_lock(fp, 0); + error = 0; + switch (whence) { + case L_INCR: + if (foffset < 0 || + (offset > 0 && foffset > OFF_MAX - offset)) { + error = EOVERFLOW; + break; + } + offset += foffset; + break; + case L_XTND: + if (offset > 0 && shmfd->shm_size > OFF_MAX - offset) { + error = EOVERFLOW; + break; + } + offset += shmfd->shm_size; + break; + case L_SET: + break; + default: + error = EINVAL; + } + if (error == 0) { + if (offset < 0 || offset > shmfd->shm_size) + error = EINVAL; + else + *(off_t *)(td->td_retval) = offset; + } + foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); + return (error); +} + +static int shm_read(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) { + struct shmfd *shmfd; + void *rl_cookie; + int error; - return (EOPNOTSUPP); + shmfd = fp->f_data; + foffset_lock_uio(fp, uio, flags); + rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, + uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); +#ifdef MAC + error = mac_posixshm_check_read(active_cred, fp->f_cred, shmfd); + if (error) + return (error); +#endif + error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + foffset_unlock_uio(fp, uio, flags); + return (error); } static int shm_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) { + struct shmfd *shmfd; + void *rl_cookie; + int error; - return (EOPNOTSUPP); + shmfd = fp->f_data; +#ifdef MAC + error = mac_posixshm_check_write(active_cred, fp->f_cred, shmfd); + if (error) + return (error); +#endif + foffset_lock_uio(fp, uio, flags); + if ((flags & FOF_OFFSET) == 0) { + rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + } else { + rl_cookie = rangelock_wlock(&shmfd->shm_rl, uio->uio_offset, + uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); + } + + error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + foffset_unlock_uio(fp, uio, flags); + return (error); } static int @@ -471,6 +551,8 @@ shm_alloc(struct ucred *ucred, mode_t mo shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime; refcount_init(&shmfd->shm_refs, 1); + mtx_init(&shmfd->shm_mtx, "shmrl", NULL, MTX_DEF); + rangelock_init(&shmfd->shm_rl); #ifdef MAC mac_posixshm_init(shmfd); mac_posixshm_create(ucred, shmfd); @@ -495,6 +577,8 @@ shm_drop(struct shmfd *shmfd) #ifdef MAC mac_posixshm_destroy(shmfd); #endif + rangelock_destroy(&shmfd->shm_rl); + mtx_destroy(&shmfd->shm_mtx); vm_object_deallocate(shmfd->shm_object); free(shmfd, M_SHMFD); } Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac/mac_framework.h Wed Aug 21 17:45:00 2013 (r254603) @@ -243,6 +243,8 @@ int mac_posixshm_check_mmap(struct ucred int prot, int flags); int mac_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, accmode_t accmode); +int mac_posixshm_check_read(struct ucred *active_cred, + struct ucred *file_cred, struct shmfd *shmfd); int mac_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, mode_t mode); int mac_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, @@ -252,6 +254,8 @@ int mac_posixshm_check_stat(struct ucred int mac_posixshm_check_truncate(struct ucred *active_cred, struct ucred *file_cred, struct shmfd *shmfd); int mac_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd); +int mac_posixshm_check_write(struct ucred *active_cred, + struct ucred *file_cred, struct shmfd *shmfd); void mac_posixshm_create(struct ucred *cred, struct shmfd *shmfd); void mac_posixshm_destroy(struct shmfd *); void mac_posixshm_init(struct shmfd *); Modified: head/sys/security/mac/mac_policy.h ============================================================================== --- head/sys/security/mac/mac_policy.h Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac/mac_policy.h Wed Aug 21 17:45:00 2013 (r254603) @@ -363,6 +363,9 @@ typedef int (*mpo_posixshm_check_mmap_t) typedef int (*mpo_posixshm_check_open_t)(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel, accmode_t accmode); +typedef int (*mpo_posixshm_check_read_t)(struct ucred *active_cred, + struct ucred *file_cred, struct shmfd *shmfd, + struct label *shmlabel); typedef int (*mpo_posixshm_check_setmode_t)(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel, mode_t mode); @@ -377,6 +380,9 @@ typedef int (*mpo_posixshm_check_truncat struct label *shmlabel); typedef int (*mpo_posixshm_check_unlink_t)(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel); +typedef int (*mpo_posixshm_check_write_t)(struct ucred *active_cred, + struct ucred *file_cred, struct shmfd *shmfd, + struct label *shmlabel); typedef void (*mpo_posixshm_create_t)(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel); typedef void (*mpo_posixshm_destroy_label_t)(struct label *label); @@ -818,11 +824,13 @@ struct mac_policy_ops { mpo_posixshm_check_create_t mpo_posixshm_check_create; mpo_posixshm_check_mmap_t mpo_posixshm_check_mmap; mpo_posixshm_check_open_t mpo_posixshm_check_open; + mpo_posixshm_check_read_t mpo_posixshm_check_read; mpo_posixshm_check_setmode_t mpo_posixshm_check_setmode; mpo_posixshm_check_setowner_t mpo_posixshm_check_setowner; mpo_posixshm_check_stat_t mpo_posixshm_check_stat; mpo_posixshm_check_truncate_t mpo_posixshm_check_truncate; mpo_posixshm_check_unlink_t mpo_posixshm_check_unlink; + mpo_posixshm_check_write_t mpo_posixshm_check_write; mpo_posixshm_create_t mpo_posixshm_create; mpo_posixshm_destroy_label_t mpo_posixshm_destroy_label; mpo_posixshm_init_label_t mpo_posixshm_init_label; Modified: head/sys/security/mac/mac_posix_shm.c ============================================================================== --- head/sys/security/mac/mac_posix_shm.c Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac/mac_posix_shm.c Wed Aug 21 17:45:00 2013 (r254603) @@ -228,3 +228,37 @@ mac_posixshm_check_setowner(struct ucred return (error); } + +MAC_CHECK_PROBE_DEFINE3(posixshm_check_read, "struct ucred *", + "struct ucred *", "struct shmfd *"); + +int +mac_posixshm_check_read(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *shmfd) +{ + int error; + + MAC_POLICY_CHECK_NOSLEEP(posixshm_check_read, active_cred, + file_cred, shmfd, shmfd->shm_label); + MAC_CHECK_PROBE3(posixshm_check_read, error, active_cred, + file_cred, shmfd); + + return (error); +} + +MAC_CHECK_PROBE_DEFINE3(posixshm_check_write, "struct ucred *", + "struct ucred *", "struct shmfd *"); + +int +mac_posixshm_check_write(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *shmfd) +{ + int error; + + MAC_POLICY_CHECK_NOSLEEP(posixshm_check_write, active_cred, + file_cred, shmfd, shmfd->shm_label); + MAC_CHECK_PROBE3(posixshm_check_write, error, active_cred, + file_cred, shmfd); + + return (error); +} Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac_biba/mac_biba.c Wed Aug 21 17:45:00 2013 (r254603) @@ -1759,6 +1759,24 @@ biba_posixshm_check_open(struct ucred *c } static int +biba_posixshm_check_read(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *vp, struct label *shmlabel) +{ + struct mac_biba *subj, *obj; + + if (!biba_enabled || !revocation_enabled) + return (0); + + subj = SLOT(active_cred->cr_label); + obj = SLOT(shmlabel); + + if (!biba_dominate_effective(obj, subj)) + return (EACCES); + + return (0); +} + +static int biba_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel, mode_t mode) { @@ -1848,6 +1866,24 @@ biba_posixshm_check_unlink(struct ucred return (0); } +static int +biba_posixshm_check_write(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *vp, struct label *shmlabel) +{ + struct mac_biba *subj, *obj; + + if (!biba_enabled || !revocation_enabled) + return (0); + + subj = SLOT(active_cred->cr_label); + obj = SLOT(shmlabel); + + if (!biba_dominate_effective(obj, subj)) + return (EACCES); + + return (0); +} + static void biba_posixshm_create(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel) @@ -3657,11 +3693,13 @@ static struct mac_policy_ops mac_biba_op .mpo_posixshm_check_mmap = biba_posixshm_check_mmap, .mpo_posixshm_check_open = biba_posixshm_check_open, + .mpo_posixshm_check_read = biba_posixshm_check_read, .mpo_posixshm_check_setmode = biba_posixshm_check_setmode, .mpo_posixshm_check_setowner = biba_posixshm_check_setowner, .mpo_posixshm_check_stat = biba_posixshm_check_stat, .mpo_posixshm_check_truncate = biba_posixshm_check_truncate, .mpo_posixshm_check_unlink = biba_posixshm_check_unlink, + .mpo_posixshm_check_write = biba_posixshm_check_write, .mpo_posixshm_create = biba_posixshm_create, .mpo_posixshm_destroy_label = biba_destroy_label, .mpo_posixshm_init_label = biba_init_label, Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac_mls/mac_mls.c Wed Aug 21 17:45:00 2013 (r254603) @@ -1651,6 +1651,24 @@ mls_posixshm_check_open(struct ucred *cr } static int +mls_posixshm_check_read(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *shm, struct label *shmlabel) +{ + struct mac_mls *subj, *obj; + + if (!mls_enabled || !revocation_enabled) + return (0); + + subj = SLOT(active_cred->cr_label); + obj = SLOT(shmlabel); + + if (!mls_dominate_effective(subj, obj)) + return (EACCES); + + return (0); +} + +static int mls_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel, mode_t mode) { @@ -1740,6 +1758,24 @@ mls_posixshm_check_unlink(struct ucred * return (0); } +static int +mls_posixshm_check_write(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *shm, struct label *shmlabel) +{ + struct mac_mls *subj, *obj; + + if (!mls_enabled || !revocation_enabled) + return (0); + + subj = SLOT(active_cred->cr_label); + obj = SLOT(shmlabel); + + if (!mls_dominate_effective(subj, obj)) + return (EACCES); + + return (0); +} + static void mls_posixshm_create(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel) @@ -3280,11 +3316,13 @@ static struct mac_policy_ops mls_ops = .mpo_posixshm_check_mmap = mls_posixshm_check_mmap, .mpo_posixshm_check_open = mls_posixshm_check_open, + .mpo_posixshm_check_read = mls_posixshm_check_read, .mpo_posixshm_check_setmode = mls_posixshm_check_setmode, .mpo_posixshm_check_setowner = mls_posixshm_check_setowner, .mpo_posixshm_check_stat = mls_posixshm_check_stat, .mpo_posixshm_check_truncate = mls_posixshm_check_truncate, .mpo_posixshm_check_unlink = mls_posixshm_check_unlink, + .mpo_posixshm_check_write = mls_posixshm_check_write, .mpo_posixshm_create = mls_posixshm_create, .mpo_posixshm_destroy_label = mls_destroy_label, .mpo_posixshm_init_label = mls_init_label, Modified: head/sys/security/mac_stub/mac_stub.c ============================================================================== --- head/sys/security/mac_stub/mac_stub.c Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac_stub/mac_stub.c Wed Aug 21 17:45:00 2013 (r254603) @@ -757,6 +757,14 @@ stub_posixshm_check_open(struct ucred *c } static int +stub_posixshm_check_read(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *shm, struct label *shmlabel) +{ + + return (0); +} + +static int stub_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel, mode_t mode) { @@ -796,6 +804,14 @@ stub_posixshm_check_unlink(struct ucred return (0); } +static int +stub_posixshm_check_write(struct ucred *active_cred, struct ucred *file_cred, + struct shmfd *shm, struct label *shmlabel) +{ + + return (0); +} + static void stub_posixshm_create(struct ucred *cred, struct shmfd *shmfd, struct label *shmlabel) @@ -1782,11 +1798,13 @@ static struct mac_policy_ops stub_ops = .mpo_posixshm_check_create = stub_posixshm_check_create, .mpo_posixshm_check_mmap = stub_posixshm_check_mmap, .mpo_posixshm_check_open = stub_posixshm_check_open, + .mpo_posixshm_check_read = stub_posixshm_check_read, .mpo_posixshm_check_setmode = stub_posixshm_check_setmode, .mpo_posixshm_check_setowner = stub_posixshm_check_setowner, .mpo_posixshm_check_stat = stub_posixshm_check_stat, .mpo_posixshm_check_truncate = stub_posixshm_check_truncate, .mpo_posixshm_check_unlink = stub_posixshm_check_unlink, + .mpo_posixshm_check_write = stub_posixshm_check_write, .mpo_posixshm_create = stub_posixshm_create, .mpo_posixshm_destroy_label = stub_destroy_label, .mpo_posixshm_init_label = stub_init_label, Modified: head/sys/security/mac_test/mac_test.c ============================================================================== --- head/sys/security/mac_test/mac_test.c Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/security/mac_test/mac_test.c Wed Aug 21 17:45:00 2013 (r254603) @@ -1423,6 +1423,21 @@ test_posixshm_check_open(struct ucred *c return (0); } +COUNTER_DECL(posixshm_check_read); +static int +test_posixshm_check_read(struct ucred *active_cred, + struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel) +{ + + LABEL_CHECK(active_cred->cr_label, MAGIC_CRED); + if (file_cred != NULL) + LABEL_CHECK(file_cred->cr_label, MAGIC_CRED); + LABEL_CHECK(shmlabel, MAGIC_POSIX_SHM); + COUNTER_INC(posixshm_check_read); + + return (0); +} + COUNTER_DECL(posixshm_check_setmode); static int test_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, @@ -1485,6 +1500,21 @@ test_posixshm_check_unlink(struct ucred return (0); } +COUNTER_DECL(posixshm_check_write); +static int +test_posixshm_check_write(struct ucred *active_cred, + struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel) +{ + + LABEL_CHECK(active_cred->cr_label, MAGIC_CRED); + if (file_cred != NULL) + LABEL_CHECK(file_cred->cr_label, MAGIC_CRED); + LABEL_CHECK(shmlabel, MAGIC_POSIX_SHM); + COUNTER_INC(posixshm_check_write); + + return (0); +} + COUNTER_DECL(posixshm_create); static void test_posixshm_create(struct ucred *cred, struct shmfd *shmfd, @@ -3114,11 +3144,13 @@ static struct mac_policy_ops test_ops = .mpo_posixshm_check_create = test_posixshm_check_create, .mpo_posixshm_check_mmap = test_posixshm_check_mmap, .mpo_posixshm_check_open = test_posixshm_check_open, + .mpo_posixshm_check_read = test_posixshm_check_read, .mpo_posixshm_check_setmode = test_posixshm_check_setmode, .mpo_posixshm_check_setowner = test_posixshm_check_setowner, .mpo_posixshm_check_stat = test_posixshm_check_stat, .mpo_posixshm_check_truncate = test_posixshm_check_truncate, .mpo_posixshm_check_unlink = test_posixshm_check_unlink, + .mpo_posixshm_check_write = test_posixshm_check_write, .mpo_posixshm_create = test_posixshm_create, .mpo_posixshm_destroy_label = test_posixshm_destroy_label, .mpo_posixshm_init_label = test_posixshm_init_label, Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Wed Aug 21 17:36:01 2013 (r254602) +++ head/sys/sys/mman.h Wed Aug 21 17:45:00 2013 (r254603) @@ -190,6 +190,10 @@ typedef __size_t size_t; #endif #if defined(_KERNEL) || defined(_WANT_FILE) +#include +#include +#include +#include #include struct file; @@ -214,6 +218,9 @@ struct shmfd { struct label *shm_label; /* MAC label */ const char *shm_path; + + struct rangelock shm_rl; + struct mtx shm_mtx; }; #endif From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 17:47:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F34FEEE0; Wed, 21 Aug 2013 17:47:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0EF42CED; Wed, 21 Aug 2013 17:47:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LHlBUU086305; Wed, 21 Aug 2013 17:47:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LHlBeq086304; Wed, 21 Aug 2013 17:47:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308211747.r7LHlBeq086304@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Aug 2013 17:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254604 - head/tools/test/posixshm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 17:47:12 -0000 Author: kib Date: Wed Aug 21 17:47:11 2013 New Revision: 254604 URL: http://svnweb.freebsd.org/changeset/base/254604 Log: Add simple test for the read/write/lseek on posix shm filedescriptor. Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/tools/test/posixshm/shm_test.c Modified: head/tools/test/posixshm/shm_test.c ============================================================================== --- head/tools/test/posixshm/shm_test.c Wed Aug 21 17:45:00 2013 (r254603) +++ head/tools/test/posixshm/shm_test.c Wed Aug 21 17:47:11 2013 (r254604) @@ -21,7 +21,7 @@ * Signal handler which does nothing. */ static void -ignoreit(int sig) +ignoreit(int sig __unused) { ; } @@ -29,13 +29,13 @@ ignoreit(int sig) int main(int argc, char **argv) { - char buf[1024], *cp; - int desc, rv; + char buf[1024], *cp, c; + int error, desc, rv; long scval; sigset_t ss; struct sigaction sa; void *region; - size_t psize; + size_t i, psize; #ifndef _POSIX_SHARED_MEMORY_OBJECTS printf("_POSIX_SHARED_MEMORY_OBJECTS is undefined\n"); @@ -118,14 +118,29 @@ main(int argc, char **argv) sigemptyset(&ss); sigsuspend(&ss); - for (cp = region; cp < (char *)region + psize; cp++) + for (cp = region; cp < (char *)region + psize; cp++) { if (*cp != '\151') _exit(1); + } + if (lseek(desc, 0, SEEK_SET) == -1) + _exit(1); + for (i = 0; i < psize; i++) { + error = read(desc, &c, 1); + if (c != '\151') + _exit(1); + } _exit(0); } else { int status; - memset(region, '\151', psize); + memset(region, '\151', psize - 2); + error = pwrite(desc, region, 2, psize - 2); + if (error != 2) { + if (error >= 0) + errx(1, "short write %d", error); + else + err(1, "shmfd write"); + } kill(rv, SIGUSR1); waitpid(rv, &status, 0); From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 18:12:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 88C6C9B0; Wed, 21 Aug 2013 18:12:05 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5E12ECE; Wed, 21 Aug 2013 18:12:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LIC5sF000903; Wed, 21 Aug 2013 18:12:05 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LIC4xv000900; Wed, 21 Aug 2013 18:12:04 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308211812.r7LIC4xv000900@svn.freebsd.org> From: Andre Oppermann Date: Wed, 21 Aug 2013 18:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254605 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 18:12:05 -0000 Author: andre Date: Wed Aug 21 18:12:04 2013 New Revision: 254605 URL: http://svnweb.freebsd.org/changeset/base/254605 Log: Revert r254520 and resurrect the M_NOFREE mbuf flag and functionality. Requested by: np, grehan Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Aug 21 17:47:11 2013 (r254604) +++ head/sys/kern/kern_mbuf.c Wed Aug 21 18:12:04 2013 (r254605) @@ -474,6 +474,7 @@ mb_dtor_mbuf(void *mem, int size, void * if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0) m_tag_delete_chain(m, NULL); KASSERT((m->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__)); + KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); #ifdef INVARIANTS trash_dtor(mem, size, arg); #endif Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Wed Aug 21 17:47:11 2013 (r254604) +++ head/sys/kern/uipc_mbuf.c Wed Aug 21 18:12:04 2013 (r254605) @@ -278,10 +278,16 @@ m_extadd(struct mbuf *mb, caddr_t buf, u void mb_free_ext(struct mbuf *m) { + int skipmbuf; KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__)); KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__)); + /* + * check if the header is embedded in the cluster + */ + skipmbuf = (m->m_flags & M_NOFREE); + /* Free attached storage if this mbuf is the only reference to it. */ if (*(m->m_ext.ref_cnt) == 1 || atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) { @@ -322,6 +328,8 @@ mb_free_ext(struct mbuf *m) ("%s: unknown ext_type", __func__)); } } + if (skipmbuf) + return; /* * Free this mbuf back to the mbuf zone with all m_ext @@ -386,7 +394,7 @@ m_demote(struct mbuf *m0, int all) m_freem(m->m_nextpkt); m->m_nextpkt = NULL; } - m->m_flags = m->m_flags & (M_EXT|M_RDONLY); + m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE); } } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Aug 21 17:47:11 2013 (r254604) +++ head/sys/sys/mbuf.h Wed Aug 21 18:12:04 2013 (r254605) @@ -191,6 +191,7 @@ struct mbuf { #define M_PROMISC 0x00000040 /* packet was not for us */ #define M_VLANTAG 0x00000080 /* ether_vtag is valid */ #define M_FLOWID 0x00000100 /* deprecated: flowid is valid */ +#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ #define M_PROTO1 0x00001000 /* protocol-specific */ #define M_PROTO2 0x00002000 /* protocol-specific */ @@ -526,7 +527,7 @@ m_free(struct mbuf *m) if (m->m_flags & M_EXT) mb_free_ext(m); - else + else if ((m->m_flags & M_NOFREE) == 0) uma_zfree(zone_mbuf, m); return (n); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 18:22:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9EA2A166; Wed, 21 Aug 2013 18:22:53 +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 5FB2F2FB3; Wed, 21 Aug 2013 18:22:53 +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 BBC1E12266; Thu, 22 Aug 2013 04:22:51 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local ([64.245.0.210]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BOC76732 (AUTH peterg@ptree32.com.au); Thu, 22 Aug 2013 04:22:50 +1000 Message-ID: <52150578.6040906@freebsd.org> Date: Wed, 21 Aug 2013 11:22:48 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254605 - in head/sys: kern sys References: <201308211812.r7LIC4xv000900@svn.freebsd.org> In-Reply-To: <201308211812.r7LIC4xv000900@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 18:22:53 -0000 > Log: > Revert r254520 and resurrect the M_NOFREE mbuf flag and functionality. > > Requested by: np, grehan Thanks Andre. later, Peter. From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 19:02:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1D338CA5; Wed, 21 Aug 2013 19:02:35 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09EE12280; Wed, 21 Aug 2013 19:02:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LJ2YpS027046; Wed, 21 Aug 2013 19:02:34 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LJ2YwC027044; Wed, 21 Aug 2013 19:02:34 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201308211902.r7LJ2YwC027044@svn.freebsd.org> From: Tijl Coosemans Date: Wed, 21 Aug 2013 19:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254606 - in stable/9: include sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 19:02:35 -0000 Author: tijl Date: Wed Aug 21 19:02:34 2013 New Revision: 254606 URL: http://svnweb.freebsd.org/changeset/base/254606 Log: MFC r241077: - Simplify the implementation of atomic_compare_exchange_strong_explicit. - Evaluate the memory order argument in atomic_fetch_*_explicit macros. - Implement atomic_store_explicit using atomic_exchange_explicit instead of a plain assignment. MFC r241190: Define clang feature test macro __has_extension. It's used in stdatomic.h. MFC r254497: Change the return type of the fallback implementation of the atomic_compare_exchange_* macros in stdatomic.h to _Bool. Modified: stable/9/include/stdatomic.h stable/9/sys/sys/cdefs.h Directory Properties: stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/include/stdatomic.h ============================================================================== --- stable/9/include/stdatomic.h Wed Aug 21 18:12:04 2013 (r254605) +++ stable/9/include/stdatomic.h Wed Aug 21 19:02:34 2013 (r254606) @@ -234,19 +234,12 @@ typedef _Atomic(__uintmax_t) atomic_uin #else #define atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) __extension__ ({ \ - __typeof__((object)->__val) __v; \ - __typeof__(expected) __e; \ - _Bool __r; \ - __e = (expected); \ - (void)(success); \ - (void)(failure); \ - __v = __sync_val_compare_and_swap(&(object)->__val, \ - *__e, (desired)); \ - __r = (*__e == __v); \ - *__e = __v; \ - __r; \ + __typeof__(expected) __ep = (expected); \ + __typeof__(*__ep) __e = *__ep; \ + (void)(success); (void)(failure); \ + (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \ + __e, desired)) == __e); \ }) - #define atomic_compare_exchange_weak_explicit(object, expected, \ desired, success, failure) \ atomic_compare_exchange_strong_explicit(object, expected, \ @@ -271,25 +264,19 @@ __extension__ ({ \ }) #endif #define atomic_fetch_add_explicit(object, operand, order) \ - __sync_fetch_and_add(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_add(&(object)->__val, operand)) #define atomic_fetch_and_explicit(object, operand, order) \ - __sync_fetch_and_and(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) #define atomic_fetch_or_explicit(object, operand, order) \ - __sync_fetch_and_or(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) #define atomic_fetch_sub_explicit(object, operand, order) \ - __sync_fetch_and_sub(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_sub(&(object)->__val, operand)) #define atomic_fetch_xor_explicit(object, operand, order) \ - __sync_fetch_and_xor(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) #define atomic_load_explicit(object, order) \ - __sync_fetch_and_add(&(object)->__val, 0) -#define atomic_store_explicit(object, desired, order) __extension__ ({ \ - __typeof__(object) __o = (object); \ - __typeof__(desired) __d = (desired); \ - (void)(order); \ - __sync_synchronize(); \ - __o->__val = __d; \ - __sync_synchronize(); \ -}) + ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) +#define atomic_store_explicit(object, desired, order) \ + ((void)atomic_exchange_explicit(object, desired, order)) #endif /* Modified: stable/9/sys/sys/cdefs.h ============================================================================== --- stable/9/sys/sys/cdefs.h Wed Aug 21 18:12:04 2013 (r254605) +++ stable/9/sys/sys/cdefs.h Wed Aug 21 19:02:34 2013 (r254606) @@ -676,6 +676,9 @@ #endif #endif +#ifndef __has_extension +#define __has_extension __has_feature +#endif #ifndef __has_feature #define __has_feature(x) 0 #endif From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 19:03:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 15078DEF; Wed, 21 Aug 2013 19:03:16 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F14512289; Wed, 21 Aug 2013 19:03:14 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id ev20so656022lab.25 for ; Wed, 21 Aug 2013 12:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=RseY/6z+mFIyqCOt2Z5rKNCi+pYkdRkPy++rVrz8d94=; b=hvL3knPzvRGXpk/YL+I2u56OnC41K0Zy0QEeMEo/QjW2j7qbgTx637LqT7yOi0K5hP IvjRpUoKaL1z6U97RuaOetkC2sJZ+xKbbNGX+5FhkRBQnNP0PHbkCc/k4H8H3WhvwVQI WV/8XYV82F78JKkY3BbcpWEYiDWdLaw9PG92eEMXeA8Tehb44Xy/TY3bEXzMAelSM77R sqg0T3Y8EtesPpN7HRXNTEu4ow6dtV8mHjbvR/Pp/vgyWDncpmxKUzh/4eRK2PQnk2Y7 +IG+CCTPKIvxdl3jRaqb9cibQq4kLMxFqWSwiuHRedCDGWu0u0C2TYVG+jtkOdlaA699 Lh3g== X-Received: by 10.152.115.176 with SMTP id jp16mr7167829lab.17.1377111792981; Wed, 21 Aug 2013 12:03:12 -0700 (PDT) Received: from omg ([77.87.117.72]) by mx.google.com with ESMTPSA id qa1sm3677525lbb.1.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 21 Aug 2013 12:03:12 -0700 (PDT) Sender: Sergey Kandaurov Date: Wed, 21 Aug 2013 23:03:10 +0400 From: Sergey Kandaurov To: Andrey Chernov Subject: Re: svn commit: r254600 - head/lib/libutil Message-ID: <20130821190309.GB52908@omg> References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JwB53PgKC5A7+0Ej" Content-Disposition: inline In-Reply-To: <5214F72B.7070006@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 19:03:16 -0000 --JwB53PgKC5A7+0Ej Content-Type: multipart/mixed; boundary="KN5l+BnMqAQyZLvT" Content-Disposition: inline --KN5l+BnMqAQyZLvT Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 21, 2013 at 09:21:47PM +0400, Andrey Chernov wrote: > On 21.08.2013 20:46, Sergey Kandaurov wrote: > > number =3D strtoumax(buf, &endptr, 0); > > =20 > > + if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { > > + return (-1); > > + } >=20 > You need to reset errno before strtoumax() call (errno =3D 0), because any > of previous functions may left it as ERANGE. >=20 Thanks for pointing out. Does the patch look good? Index: expand_number.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 --- expand_number.c (revision 254600) +++ expand_number.c (working copy) @@ -53,6 +53,8 @@ unsigned shift; char *endptr; =20 + errno =3D 0; + number =3D strtoumax(buf, &endptr, 0); =20 if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { --KN5l+BnMqAQyZLvT Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="expand_number.diff" Content-Transfer-Encoding: quoted-printable Index: expand_number.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 --- expand_number.c (revision 254600) +++ expand_number.c (working copy) @@ -53,6 +53,8 @@ unsigned shift; char *endptr; =20 + errno =3D 0; + number =3D strtoumax(buf, &endptr, 0); =20 if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { --KN5l+BnMqAQyZLvT-- --JwB53PgKC5A7+0Ej Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBAgAGBQJSFQ7tAAoJED9Ol7oQYHQZzHIIAKD7AtePf4E8EH1Km53AnZMt XPW5WxbmZleWNnLOWs+8+fd9if5zCDaa2//UlwTEO61KpeGJXIW9iGbPNAv79rWt 4zBfM1Q5lbZqaXEwNf+0+pENMTu6D5nhnPb5pEbdXm3nxT4K+ug93xy+dP11a/7A MiCXWerPz1ic3cqaDxjdoQiWfToTf8lQlhy64lEJ5D6W1oJ4r3pUdg7cYP0mUTG9 4WQIbvbP7rv8DAH4j72fIoHjrYFtYYYIsFAMucwbGEiiqsX8y8C27KWeAAw4XrPW 0V1GerfANCN4kcyHQtNa9WQd2cFqJ7LADHO5hfPbqD5YGaIu1pv9H+Uerdf8ia8= =F5Vq -----END PGP SIGNATURE----- --JwB53PgKC5A7+0Ej-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 19:40:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D8AADB9; Wed, 21 Aug 2013 19:40:44 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B57F257A; Wed, 21 Aug 2013 19:40:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LJei0s048487; Wed, 21 Aug 2013 19:40:44 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LJehIe048484; Wed, 21 Aug 2013 19:40:43 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201308211940.r7LJehIe048484@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 21 Aug 2013 19:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254608 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 19:40:44 -0000 Author: gibbs Date: Wed Aug 21 19:40:43 2013 New Revision: 254608 URL: http://svnweb.freebsd.org/changeset/base/254608 Log: Add kstat entries for ZFS compression statistics. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c: Add module lifetime functions to allocate and teardown state data. Report: - Compression attempts. - Buffers found to be empty. - Compression calls that are skipped because the data length is already less than or equal to the minimum block length. - Compression attempts that fail to yield a 12.5% compression ratio. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c: Add calls to the zio_compress.c module's init and fini functions. Sponosred by: Spectra Logic Corporation MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Aug 21 19:30:07 2013 (r254607) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Aug 21 19:40:43 2013 (r254608) @@ -1832,6 +1832,7 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); + zio_compress_init(); l2arc_init(); arc_init(); } @@ -1842,6 +1843,7 @@ dmu_fini(void) arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); + zio_compress_fini(); dbuf_fini(); dnode_fini(); dmu_objset_fini(); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Wed Aug 21 19:30:07 2013 (r254607) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Wed Aug 21 19:40:43 2013 (r254608) @@ -83,6 +83,12 @@ extern size_t zio_compress_data(enum zio extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); +/* + * Module lifetime management. + */ +extern void zio_compress_init(void); +extern void zio_compress_fini(void); + #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Wed Aug 21 19:30:07 2013 (r254607) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Wed Aug 21 19:40:43 2013 (r254608) @@ -33,10 +33,32 @@ #include #include +#include #include #include #include +typedef struct zcomp_stats { + kstat_named_t zcompstat_attempts; + kstat_named_t zcompstat_empty; + kstat_named_t zcompstat_skipped_minblocksize; + kstat_named_t zcompstat_skipped_insufficient_gain; +} zcomp_stats_t; + +static zcomp_stats_t zcomp_stats = { + { "attempts", KSTAT_DATA_UINT64 }, + { "empty", KSTAT_DATA_UINT64 }, + { "skipped_minblocksize", KSTAT_DATA_UINT64 }, + { "skipped_insufficient_gain", KSTAT_DATA_UINT64 } +}; + +#define ZCOMPSTAT_INCR(stat, val) \ + atomic_add_64(&zcomp_stats.stat.value.ui64, (val)); + +#define ZCOMPSTAT_BUMP(stat) ZCOMPSTAT_INCR(stat, 1); + +kstat_t *zcomp_ksp; + /* * Compression vectors. */ @@ -87,6 +109,8 @@ zio_compress_data(enum zio_compress c, v ASSERT((uint_t)c < ZIO_COMPRESS_FUNCTIONS); ASSERT((uint_t)c == ZIO_COMPRESS_EMPTY || ci->ci_compress != NULL); + ZCOMPSTAT_BUMP(zcompstat_attempts); + /* * If the data is all zeroes, we don't even need to allocate * a block for it. We indicate this by returning zero size. @@ -96,21 +120,27 @@ zio_compress_data(enum zio_compress c, v if (*word != 0) break; - if (word == word_end) - return (0); + if (word == word_end) { + ZCOMPSTAT_BUMP(zcompstat_empty); + return (0); + } if (c == ZIO_COMPRESS_EMPTY) return (s_len); /* Compress at least 12.5% */ d_len = P2ALIGN(s_len - (s_len >> 3), minblocksize); - if (d_len == 0) + if (d_len == 0) { + ZCOMPSTAT_BUMP(zcompstat_skipped_minblocksize); return (s_len); + } c_len = ci->ci_compress(src, dst, s_len, d_len, ci->ci_level); - if (c_len > d_len) + if (c_len > d_len) { + ZCOMPSTAT_BUMP(zcompstat_skipped_insufficient_gain); return (s_len); + } /* * Cool. We compressed at least as much as we were hoping to. @@ -139,3 +169,26 @@ zio_decompress_data(enum zio_compress c, return (ci->ci_decompress(src, dst, s_len, d_len, ci->ci_level)); } + +void +zio_compress_init(void) +{ + + zcomp_ksp = kstat_create("zfs", 0, "zcompstats", "misc", + KSTAT_TYPE_NAMED, sizeof (zcomp_stats) / sizeof (kstat_named_t), + KSTAT_FLAG_VIRTUAL); + + if (zcomp_ksp != NULL) { + zcomp_ksp->ks_data = &zcomp_stats; + kstat_install(zcomp_ksp); + } +} + +void +zio_compress_fini(void) +{ + if (zcomp_ksp != NULL) { + kstat_delete(zcomp_ksp); + zcomp_ksp = NULL; + } +} From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 19:41:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 678CEF57 for ; Wed, 21 Aug 2013 19:41:42 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm23-vm5.bullet.mail.ne1.yahoo.com (nm23-vm5.bullet.mail.ne1.yahoo.com [98.138.91.245]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25C13258E for ; Wed, 21 Aug 2013 19:41:42 +0000 (UTC) Received: from [98.138.226.179] by nm23.bullet.mail.ne1.yahoo.com with NNFMP; 21 Aug 2013 19:41:34 -0000 Received: from [98.138.84.39] by tm14.bullet.mail.ne1.yahoo.com with NNFMP; 21 Aug 2013 19:41:34 -0000 Received: from [127.0.0.1] by smtp107.mail.ne1.yahoo.com with NNFMP; 21 Aug 2013 19:41:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1377114093; bh=IC+U8ZNZGDdDDlgdE4rtcRWDAd0N/W+ZfDEhv0z9zoQ=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=SyWmql0X9IQH9O6YdKYcYx0bptzUs3jFunIo6AgLhTbEtPsmjXn70jahmFETRLQyQ/ZcC0a5sa/LjDbENpjSSYJ6WjZWgzYl9cdjahPh2kynFRtyQ4M4/rejhGV2nWhwZ24tgNMepGtfIMf61VNn6xMDrY/33aGbrTH+GKx9TEI= X-Yahoo-Newman-Id: 978900.93516.bm@smtp107.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: XCKIae4VM1nAQfclg6rerxlHGn94L8CmNs2haylBjpdrdDI g0fjJJc_o3nSQRIKXZ.lzpsE_RFtrgsDPiLtVkOoMh2J5yVd41Hgg0yXWuaN 4gKwZuMrRCQJdvSiWK29sokRpg9GACPeZQKF_tzC07LDMP3q4pRaWjCcs9sS nqd1swOK2hSEgBVkds6G2cq.s2Flv3LwUyO17.7atq.tme7x.dEqdYsf7Mxk FdEx69brbpEK.q0KOePZY6ajG8jUow0X_XY9._LjtjGilU3fcZIqqHMtZlqW upyotTConB9wyjUUuxV.LNna07X7YDN1lDiY3xS8HZA06gNwkjxjwl4SUtGK scR1GQHOnhnIzRNTRsxIb8j7MRPIpNOlk2E_zBkvHKVTnQsBCv9JvNL5FmE5 EuxJ4JfYZ5LFmcVyDR8Kh1jSjdRW8eBag0tAyDalNyfpxOJe8nPP2C1mOUsn HWRQSX8vLuDLP7zNdnDMGEIcHKI8hKx_CPBg_lUhtfB3wKE0KNoHnVyU5ist Ao7ZiBkqeNjRSv6KHxIwv8iO_3HQ3OHxJuiiMXJoJC5B53Cs5XvVU0OWKqDK ECw-- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from [10.2.176.206] (scott4long@69.53.237.66 with ) by smtp107.mail.ne1.yahoo.com with SMTP; 21 Aug 2013 12:41:33 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r254520 - in head/sys: kern sys From: Scott Long In-Reply-To: <5214D5E0.9040002@freebsd.org> Date: Wed, 21 Aug 2013 13:41:32 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> <5214D5E0.9040002@freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 19:41:42 -0000 On Aug 21, 2013, at 8:59 AM, Andre Oppermann wrote: > On 19.08.2013 23:45, Navdeep Parhar wrote: >> On 08/19/13 13:58, Andre Oppermann wrote: >>> On 19.08.2013 19:33, Navdeep Parhar wrote: >>>> On 08/19/13 04:16, Andre Oppermann wrote: >>>>> Author: andre >>>>> Date: Mon Aug 19 11:16:53 2013 >>>>> New Revision: 254520 >>>>> URL: http://svnweb.freebsd.org/changeset/base/254520 >>>>>=20 >>>>> Log: >>>>> Remove the unused M_NOFREE mbuf flag. It didn't have any = in-tree >>>>> users >>>>> for a very long time, if ever. >>>>>=20 >>>>> Should such a functionality ever be needed again the = appropriate and >>>>> much better way to do it is through a custom EXT_SOMETHING >>>>> external mbuf >>>>> type together with a dedicated *ext_free function. >>>>>=20 >>>>> Discussed with: trociny, glebius >>>>>=20 >>>>> Modified: >>>>> head/sys/kern/kern_mbuf.c >>>>> head/sys/kern/uipc_mbuf.c >>>>> head/sys/sys/mbuf.h >>>>>=20 >>>>=20 >>>> Hello Andre, >>>>=20 >>>> Is this just garbage collection or is there some other reason for = this? >>>=20 >>> This is garbage collection and removal of not quite right, rotten, >>> functionality. >>>=20 >>>> I recently tried some experiments to reduce the number of mbuf and >>>> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF = proved >>>> very useful and the code changes to the kernel were minimal. See >>>> user/np/cxl_tuning. The experiment was quite successful and I was >>>> planning to bring in most of those changes to HEAD. I was hoping = to get >>>> some runtime mileage on the approach in general before tweaking the >>>> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >>>> within the cluster. But now M_NOFREE has vanished without a = warning... >>>=20 >>> I'm looking through your experimental code and that is some really = good >>> numbers you're achieving there! >>>=20 >>> However a couple things don't feel quite right, hackish even, and = not >>> fit for HEAD. This is a bit the same situation we had with some of = the >>> first 1GigE cards quite a number of years back (mostly ti(4)). = There >>> we ended up with a couple of just good enough hacks to make it fast. >>> Most of the remains I've collected today. >>=20 >> If M_NOFREE and EXT_EXTREF are properly supported in the tree (and = I'm >> arguing that they were, before r254520) then the changes are = perfectly >> legitimate. The only hackish part was that I was getting the cluster >> from the jumbop zone while bypassing its normal refcnt mechanism. = This >> I did so as to use the same zone as m_uiotombuf to keep it "hot" for = all >> consumers (driver + network stack). >=20 > If you insist I'll revert the commit removing M_NOFREE. EXT_EXTREF = isn't > touched yet, but should get better support. >=20 > The hackish part for me is that the driver again manages its own = memory > pool. Windows works that way, NetBSD is moving towards it while = FreeBSD > has and remains at a central network memory pool. The latter (our = current) > way of doing it seems more efficient overall especially on heavily = loaded > networked machines. There may be significant queues building (think = app > blocked having many sockets buffer fill up) up delaying the freeing = and > returning of network memory resources. Together with fragmentation = this > can lead to bad very outcomes. Router applications with many = interfaces > also greatly benefit from central memory pools. >=20 > So I'm really not sure that we should move back in the driver owned = pool > direction with lots of code duplication and copy-pasting (see NetBSD). > Also it is kinda weird to have a kernel based pool for data going down > the stack and another one in each driver for those going up. >=20 > Actually I'm of the opinion that we should stay with the central = memory > pool and fix so that it works just as well for those cases a driver = pool > currently performs better. The central memory pool approach is too slow, unfortunately. There's a reason that other OS's are moving to them. At Netflix we are currently working on some approaches to private memory pools in order to achieve better efficiency, and we're closely watching and anticipating = Navdeep's work. Scott From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 19:59:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16EB055D; Wed, 21 Aug 2013 19:59:39 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD8C5268A; Wed, 21 Aug 2013 19:59:38 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id y10so866196pdj.36 for ; Wed, 21 Aug 2013 12:59:37 -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=dUhDtbQj8rYwY6jJnCBEZtJP0sKeIE2zsjljRkj081M=; b=heXS7HxUyTF+l0aeW2FvrXHCfG/cImhEwc+54cldFT1JaEV352FZMrTQoayqnrpzTt A7JbMQTAD4+ihLyvb2TjA2VGx65qwcA8Cg5VCpWmRZq/eWKbiEzbRIYlo+G4qL0pxwXC 2kwpvjOdlu3GHx2WXRdX78QCnwnpKUUCIfrYxXzfi5EoMnrjpweADZyuuTD97suUUxce NiwcgbdXvYuKE4ZkeguGpEnAs+65zW6X4y1Bybu8qUA67hlvXza6Ms2g4tHTci5OjEp4 JuC9cfhStMNjgcz49nkTKXFUJABdbfYAUNdTZzhOrojEqm42wNjH0Efh1NeCIhFfxRIJ +GgA== X-Received: by 10.68.252.194 with SMTP id zu2mr9356621pbc.58.1377115177723; Wed, 21 Aug 2013 12:59:37 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id ys4sm10131543pbb.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 12:59:36 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <52151C26.10004@FreeBSD.org> Date: Wed, 21 Aug 2013 12:59:34 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Scott Long Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> <5214D5E0.9040002@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 19:59:39 -0000 On 08/21/13 12:41, Scott Long wrote: > > On Aug 21, 2013, at 8:59 AM, Andre Oppermann wrote: > >> On 19.08.2013 23:45, Navdeep Parhar wrote: >>> On 08/19/13 13:58, Andre Oppermann wrote: >>>> On 19.08.2013 19:33, Navdeep Parhar wrote: >>>>> On 08/19/13 04:16, Andre Oppermann wrote: >>>>>> Author: andre >>>>>> Date: Mon Aug 19 11:16:53 2013 >>>>>> New Revision: 254520 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/254520 >>>>>> >>>>>> Log: >>>>>> Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree >>>>>> users >>>>>> for a very long time, if ever. >>>>>> >>>>>> Should such a functionality ever be needed again the appropriate and >>>>>> much better way to do it is through a custom EXT_SOMETHING >>>>>> external mbuf >>>>>> type together with a dedicated *ext_free function. >>>>>> >>>>>> Discussed with: trociny, glebius >>>>>> >>>>>> Modified: >>>>>> head/sys/kern/kern_mbuf.c >>>>>> head/sys/kern/uipc_mbuf.c >>>>>> head/sys/sys/mbuf.h >>>>>> >>>>> >>>>> Hello Andre, >>>>> >>>>> Is this just garbage collection or is there some other reason for this? >>>> >>>> This is garbage collection and removal of not quite right, rotten, >>>> functionality. >>>> >>>>> I recently tried some experiments to reduce the number of mbuf and >>>>> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >>>>> very useful and the code changes to the kernel were minimal. See >>>>> user/np/cxl_tuning. The experiment was quite successful and I was >>>>> planning to bring in most of those changes to HEAD. I was hoping to get >>>>> some runtime mileage on the approach in general before tweaking the >>>>> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >>>>> within the cluster. But now M_NOFREE has vanished without a warning... >>>> >>>> I'm looking through your experimental code and that is some really good >>>> numbers you're achieving there! >>>> >>>> However a couple things don't feel quite right, hackish even, and not >>>> fit for HEAD. This is a bit the same situation we had with some of the >>>> first 1GigE cards quite a number of years back (mostly ti(4)). There >>>> we ended up with a couple of just good enough hacks to make it fast. >>>> Most of the remains I've collected today. >>> >>> If M_NOFREE and EXT_EXTREF are properly supported in the tree (and I'm >>> arguing that they were, before r254520) then the changes are perfectly >>> legitimate. The only hackish part was that I was getting the cluster >>> from the jumbop zone while bypassing its normal refcnt mechanism. This >>> I did so as to use the same zone as m_uiotombuf to keep it "hot" for all >>> consumers (driver + network stack). >> >> If you insist I'll revert the commit removing M_NOFREE. EXT_EXTREF isn't >> touched yet, but should get better support. >> >> The hackish part for me is that the driver again manages its own memory >> pool. Windows works that way, NetBSD is moving towards it while FreeBSD >> has and remains at a central network memory pool. The latter (our current) >> way of doing it seems more efficient overall especially on heavily loaded >> networked machines. There may be significant queues building (think app >> blocked having many sockets buffer fill up) up delaying the freeing and >> returning of network memory resources. Together with fragmentation this >> can lead to bad very outcomes. Router applications with many interfaces >> also greatly benefit from central memory pools. >> >> So I'm really not sure that we should move back in the driver owned pool >> direction with lots of code duplication and copy-pasting (see NetBSD). >> Also it is kinda weird to have a kernel based pool for data going down >> the stack and another one in each driver for those going up. >> >> Actually I'm of the opinion that we should stay with the central memory >> pool and fix so that it works just as well for those cases a driver pool >> currently performs better. > > The central memory pool approach is too slow, unfortunately. There's a > reason that other OS's are moving to them. At Netflix we are > currently working on some approaches to private memory pools in order to > achieve better efficiency, and we're closely watching and anticipating Navdeep's > work. I should point out that I went to great lengths to use the jumbop zone in my experiments, and not create my own pool of memory for the rx buffers. The hope was to share cache warmth (sounds very cosy :-) with the likes of m_uiotombuf (which uses jumbop too) etc. So I'm actually in the camp that prefers central pools. I'm just trying out ways to reduce the trips we have to make to the pool(s) involved. Laying down mbufs within clusters, and packing multiple frames per cluster clearly helps. Careful cluster recycling within the NIC seems to work too. Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 20:27:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 42BE5C1C; Wed, 21 Aug 2013 20:27:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0BB2870; Wed, 21 Aug 2013 20:27:30 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id E6792358C60; Wed, 21 Aug 2013 22:27:25 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id CD97C28494; Wed, 21 Aug 2013 22:27:25 +0200 (CEST) Date: Wed, 21 Aug 2013 22:27:25 +0200 From: Jilles Tjoelker To: Sergey Kandaurov Subject: Re: svn commit: r254600 - head/lib/libutil Message-ID: <20130821202725.GA4991@stack.nl> References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> <20130821190309.GB52908@omg> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130821190309.GB52908@omg> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 20:27:31 -0000 On Wed, Aug 21, 2013 at 11:03:10PM +0400, Sergey Kandaurov wrote: > On Wed, Aug 21, 2013 at 09:21:47PM +0400, Andrey Chernov wrote: > > On 21.08.2013 20:46, Sergey Kandaurov wrote: > > > number = strtoumax(buf, &endptr, 0); > > > > > > + if (number == UINTMAX_MAX && errno == ERANGE) { > > > + return (-1); > > > + } > > You need to reset errno before strtoumax() call (errno = 0), because any > > of previous functions may left it as ERANGE. > Thanks for pointing out. > Does the patch look good? > Index: expand_number.c > =================================================================== > --- expand_number.c (revision 254600) > +++ expand_number.c (working copy) > @@ -53,6 +53,8 @@ > unsigned shift; > char *endptr; > > + errno = 0; > + > number = strtoumax(buf, &endptr, 0); > > if (number == UINTMAX_MAX && errno == ERANGE) { > This may cause the function to set errno=0 if it is successful, which is not allowed for standard library functions from C and POSIX. There may be a problem not only if expand_number() is standardized but also if it is used in the implementation of a standard library function. The best solution is to save and restore errno around this (if [ERANGE] is detected, that is a valid errno value to keep). In an application it is acceptable to set errno=0 without further ado. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 20:39:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 62E86191 for ; Wed, 21 Aug 2013 20:39:41 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D5602957 for ; Wed, 21 Aug 2013 20:39:39 +0000 (UTC) Received: (qmail 74257 invoked from network); 21 Aug 2013 21:22:41 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 21 Aug 2013 21:22:41 -0000 Message-ID: <52152584.50309@freebsd.org> Date: Wed, 21 Aug 2013 22:39:32 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r254520 - in head/sys: kern sys References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212870A.50105@freebsd.org> <521291F1.8060500@FreeBSD.org> <5214D5E0.9040002@freebsd.org> <52151C26.10004@FreeBSD.org> In-Reply-To: <52151C26.10004@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 20:39:41 -0000 On 21.08.2013 21:59, Navdeep Parhar wrote: > On 08/21/13 12:41, Scott Long wrote: >> >> On Aug 21, 2013, at 8:59 AM, Andre Oppermann wrote: >> >>> On 19.08.2013 23:45, Navdeep Parhar wrote: >>>> On 08/19/13 13:58, Andre Oppermann wrote: >>>>> On 19.08.2013 19:33, Navdeep Parhar wrote: >>>>>> On 08/19/13 04:16, Andre Oppermann wrote: >>>>>>> Author: andre >>>>>>> Date: Mon Aug 19 11:16:53 2013 >>>>>>> New Revision: 254520 >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/254520 >>>>>>> >>>>>>> Log: >>>>>>> Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree >>>>>>> users >>>>>>> for a very long time, if ever. >>>>>>> >>>>>>> Should such a functionality ever be needed again the appropriate and >>>>>>> much better way to do it is through a custom EXT_SOMETHING >>>>>>> external mbuf >>>>>>> type together with a dedicated *ext_free function. >>>>>>> >>>>>>> Discussed with: trociny, glebius >>>>>>> >>>>>>> Modified: >>>>>>> head/sys/kern/kern_mbuf.c >>>>>>> head/sys/kern/uipc_mbuf.c >>>>>>> head/sys/sys/mbuf.h >>>>>>> >>>>>> >>>>>> Hello Andre, >>>>>> >>>>>> Is this just garbage collection or is there some other reason for this? >>>>> >>>>> This is garbage collection and removal of not quite right, rotten, >>>>> functionality. >>>>> >>>>>> I recently tried some experiments to reduce the number of mbuf and >>>>>> cluster allocations in a 40G NIC driver. M_NOFREE and EXT_EXTREF proved >>>>>> very useful and the code changes to the kernel were minimal. See >>>>>> user/np/cxl_tuning. The experiment was quite successful and I was >>>>>> planning to bring in most of those changes to HEAD. I was hoping to get >>>>>> some runtime mileage on the approach in general before tweaking the >>>>>> ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt >>>>>> within the cluster. But now M_NOFREE has vanished without a warning... >>>>> >>>>> I'm looking through your experimental code and that is some really good >>>>> numbers you're achieving there! >>>>> >>>>> However a couple things don't feel quite right, hackish even, and not >>>>> fit for HEAD. This is a bit the same situation we had with some of the >>>>> first 1GigE cards quite a number of years back (mostly ti(4)). There >>>>> we ended up with a couple of just good enough hacks to make it fast. >>>>> Most of the remains I've collected today. >>>> >>>> If M_NOFREE and EXT_EXTREF are properly supported in the tree (and I'm >>>> arguing that they were, before r254520) then the changes are perfectly >>>> legitimate. The only hackish part was that I was getting the cluster >>>> from the jumbop zone while bypassing its normal refcnt mechanism. This >>>> I did so as to use the same zone as m_uiotombuf to keep it "hot" for all >>>> consumers (driver + network stack). >>> >>> If you insist I'll revert the commit removing M_NOFREE. EXT_EXTREF isn't >>> touched yet, but should get better support. >>> >>> The hackish part for me is that the driver again manages its own memory >>> pool. Windows works that way, NetBSD is moving towards it while FreeBSD >>> has and remains at a central network memory pool. The latter (our current) >>> way of doing it seems more efficient overall especially on heavily loaded >>> networked machines. There may be significant queues building (think app >>> blocked having many sockets buffer fill up) up delaying the freeing and >>> returning of network memory resources. Together with fragmentation this >>> can lead to bad very outcomes. Router applications with many interfaces >>> also greatly benefit from central memory pools. >>> >>> So I'm really not sure that we should move back in the driver owned pool >>> direction with lots of code duplication and copy-pasting (see NetBSD). >>> Also it is kinda weird to have a kernel based pool for data going down >>> the stack and another one in each driver for those going up. >>> >>> Actually I'm of the opinion that we should stay with the central memory >>> pool and fix so that it works just as well for those cases a driver pool >>> currently performs better. >> >> The central memory pool approach is too slow, unfortunately. There's a >> reason that other OS's are moving to them. At Netflix we are >> currently working on some approaches to private memory pools in order to >> achieve better efficiency, and we're closely watching and anticipating Navdeep's >> work. > > I should point out that I went to great lengths to use the jumbop zone > in my experiments, and not create my own pool of memory for the rx > buffers. The hope was to share cache warmth (sounds very cosy :-) with > the likes of m_uiotombuf (which uses jumbop too) etc. So I'm actually > in the camp that prefers central pools. I'm just trying out ways to > reduce the trips we have to make to the pool(s) involved. Laying down > mbufs within clusters, and packing multiple frames per cluster clearly > helps. Careful cluster recycling within the NIC seems to work too. What you describe does make a lot of sense. Jumbop is the optimal size for the VM. We should really look at and pushing forward to have a nicer M_NOFREE+M_EXTREF API for 10 and new HEAD going forward. As always it seems to depend on the use case and what is being measured too. Is it single stream performance? Concurrent streams? Both ways or only one way, in or out? Each makes very different use of many parts of the stack and driver leading to different bottlenecks. The Netflix case is a bit special obviously by being heavily send oriented on a great many concurrent connections. Here re-use of mbufs moving down the stack seems limited to non-existent because the clusters stay in the socket send buffer until acknowledged which is many milliseconds later. Only re-use of the mbuf header would be possible. Additionally with the use of sendfile there are no mbuf clusters to be captured anyway. On the way up the Netflix usage seems to be almost ACK only, that is small packets. If the NIC is capable of splatting a number of them into the same jumbop cluster back to back together without wasting a full cluster for each that looks to be quite a win as well. Then one only has to attach the mbuf headers to it and send it up the stack. There used to be some Syskonnect/Marvell GigE chips that were able to take different sized mbufs on their RX rings. One could be configured to splat the packet right into the small data portion of a header mbuf. Larger packets would into normal 2K clusters. Such an approach, if the NIC is capable of doing that, probably would be beneficial as well doing away with all M_EXT handling for small (ack) packets. However for the Netflix case I believe two things may provide additional immediate gains: a) moving the routing and arp tables to rmlocks with de-pointering them at the same time (see my other recent email to net@); b) analyzing and tuning the interaction between LRO, tcp ack compression, and tcp abc to reduce the chance of small TSO chains from getting emitted. -- Andre From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 20:43:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 21AF537B; Wed, 21 Aug 2013 20:43:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD4629AA; Wed, 21 Aug 2013 20:43:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LKho2t082709; Wed, 21 Aug 2013 20:43:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LKholk082707; Wed, 21 Aug 2013 20:43:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212043.r7LKholk082707@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 20:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254610 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 20:43:51 -0000 Author: jkim Date: Wed Aug 21 20:43:50 2013 New Revision: 254610 URL: http://svnweb.freebsd.org/changeset/base/254610 Log: Use consistent style. No functional change. Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Wed Aug 21 20:38:19 2013 (r254609) +++ head/sys/amd64/include/atomic.h Wed Aug 21 20:43:50 2013 (r254610) @@ -183,9 +183,9 @@ atomic_fetchadd_int(volatile u_int *p, u __asm __volatile( " " MPLOCKED " " - " xaddl %0, %1 ; " + " xaddl %0,%1 ; " "# atomic_fetchadd_int" - : "+r" (v), /* 0 (result) */ + : "+r" (v), /* 0 */ "=m" (*p) /* 1 */ : "m" (*p) /* 2 */ : "cc"); @@ -202,9 +202,9 @@ atomic_fetchadd_long(volatile u_long *p, __asm __volatile( " " MPLOCKED " " - " xaddq %0, %1 ; " + " xaddq %0,%1 ; " "# atomic_fetchadd_long" - : "+r" (v), /* 0 (result) */ + : "+r" (v), /* 0 */ "=m" (*p) /* 1 */ : "m" (*p) /* 2 */ : "cc"); @@ -307,7 +307,7 @@ ATOMIC_STORE(long); #ifdef __GNUCLIKE_ASM static __inline u_int -atomic_readandclear_int(volatile u_int *addr) +atomic_readandclear_int(volatile u_int *p) { u_int res; @@ -316,14 +316,14 @@ atomic_readandclear_int(volatile u_int * " xchgl %1,%0 ; " "# atomic_readandclear_int" : "+r" (res), /* 0 */ - "=m" (*addr) /* 1 */ - : "m" (*addr)); + "=m" (*p) /* 1 */ + : "m" (*p)); return (res); } static __inline u_long -atomic_readandclear_long(volatile u_long *addr) +atomic_readandclear_long(volatile u_long *p) { u_long res; @@ -332,16 +332,16 @@ atomic_readandclear_long(volatile u_long " xchgq %1,%0 ; " "# atomic_readandclear_long" : "+r" (res), /* 0 */ - "=m" (*addr) /* 1 */ - : "m" (*addr)); + "=m" (*p) /* 1 */ + : "m" (*p)); return (res); } #else /* !__GNUCLIKE_ASM */ -u_int atomic_readandclear_int(volatile u_int *addr); -u_long atomic_readandclear_long(volatile u_long *addr); +u_int atomic_readandclear_int(volatile u_int *p); +u_long atomic_readandclear_long(volatile u_long *p); #endif /* __GNUCLIKE_ASM */ Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 20:38:19 2013 (r254609) +++ head/sys/i386/include/atomic.h Wed Aug 21 20:43:50 2013 (r254610) @@ -272,9 +272,9 @@ atomic_fetchadd_int(volatile u_int *p, u __asm __volatile( " " MPLOCKED " " - " xaddl %0, %1 ; " + " xaddl %0,%1 ; " "# atomic_fetchadd_int" - : "+r" (v), /* 0 (result) */ + : "+r" (v), /* 0 */ "=m" (*p) /* 1 */ : "m" (*p) /* 2 */ : "cc"); @@ -397,7 +397,7 @@ atomic_fetchadd_long(volatile u_long *p, #ifdef __GNUCLIKE_ASM static __inline u_int -atomic_readandclear_int(volatile u_int *addr) +atomic_readandclear_int(volatile u_int *p) { u_int res; @@ -406,14 +406,14 @@ atomic_readandclear_int(volatile u_int * " xchgl %1,%0 ; " "# atomic_readandclear_int" : "+r" (res), /* 0 */ - "=m" (*addr) /* 1 */ - : "m" (*addr)); + "=m" (*p) /* 1 */ + : "m" (*p)); return (res); } static __inline u_long -atomic_readandclear_long(volatile u_long *addr) +atomic_readandclear_long(volatile u_long *p) { u_long res; @@ -422,16 +422,16 @@ atomic_readandclear_long(volatile u_long " xchgl %1,%0 ; " "# atomic_readandclear_long" : "+r" (res), /* 0 */ - "=m" (*addr) /* 1 */ - : "m" (*addr)); + "=m" (*p) /* 1 */ + : "m" (*p)); return (res); } #else /* !__GNUCLIKE_ASM */ -u_int atomic_readandclear_int(volatile u_int *addr); -u_long atomic_readandclear_long(volatile u_long *addr); +u_int atomic_readandclear_int(volatile u_int *p); +u_long atomic_readandclear_long(volatile u_long *p); #endif /* __GNUCLIKE_ASM */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 20:49:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E01A5E1; Wed, 21 Aug 2013 20:49:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE8F29FA; Wed, 21 Aug 2013 20:49:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LKnlNQ084631; Wed, 21 Aug 2013 20:49:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LKnkNF084614; Wed, 21 Aug 2013 20:49:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212049.r7LKnkNF084614@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 20:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254611 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 20:49:47 -0000 Author: jkim Date: Wed Aug 21 20:49:46 2013 New Revision: 254611 URL: http://svnweb.freebsd.org/changeset/base/254611 Log: Remove bogus labels. No functional change. Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Wed Aug 21 20:43:50 2013 (r254610) +++ head/sys/amd64/include/atomic.h Wed Aug 21 20:49:46 2013 (r254611) @@ -140,7 +140,6 @@ atomic_cmpset_int(volatile u_int *dst, u " " MPLOCKED " " " cmpxchgl %2,%1 ; " " sete %0 ; " - "1: " "# atomic_cmpset_int" : "=a" (res), /* 0 */ "=m" (*dst) /* 1 */ @@ -161,7 +160,6 @@ atomic_cmpset_long(volatile u_long *dst, " " MPLOCKED " " " cmpxchgq %2,%1 ; " " sete %0 ; " - "1: " "# atomic_cmpset_long" : "=a" (res), /* 0 */ "=m" (*dst) /* 1 */ Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 20:43:50 2013 (r254610) +++ head/sys/i386/include/atomic.h Wed Aug 21 20:49:46 2013 (r254611) @@ -248,7 +248,6 @@ atomic_cmpset_int(volatile u_int *dst, u " " MPLOCKED " " " cmpxchgl %2,%1 ; " " sete %0 ; " - "1: " "# atomic_cmpset_int" : "=a" (res), /* 0 */ "=m" (*dst) /* 1 */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:14:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4FCA1CE1; Wed, 21 Aug 2013 21:14:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C7B92B7A; Wed, 21 Aug 2013 21:14:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LLEHAl099476; Wed, 21 Aug 2013 21:14:17 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LLEGrW099474; Wed, 21 Aug 2013 21:14:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212114.r7LLEGrW099474@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 21:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254612 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:14:17 -0000 Author: jkim Date: Wed Aug 21 21:14:16 2013 New Revision: 254612 URL: http://svnweb.freebsd.org/changeset/base/254612 Log: Use '+' modifier for a memory operand that is both an input and an output. It was actually done in r86301 but reverted in r150182 because GCC 3.x was not able to handle it for a memory operand. Apparently, this problem was fixed in GCC 4.1+ and several contrib sources already rely on this feature. Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Wed Aug 21 20:49:46 2013 (r254611) +++ head/sys/amd64/include/atomic.h Wed Aug 21 21:14:16 2013 (r254612) @@ -108,8 +108,8 @@ static __inline void \ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*p) \ - : CONS (V), "m" (*p) \ + : "+m" (*p) \ + : CONS (V) \ : "cc"); \ } \ \ @@ -117,8 +117,8 @@ static __inline void \ atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*p) \ - : CONS (V), "m" (*p) \ + : "+m" (*p) \ + : CONS (V) \ : "memory", "cc"); \ } \ struct __hack @@ -142,10 +142,9 @@ atomic_cmpset_int(volatile u_int *dst, u " sete %0 ; " "# atomic_cmpset_int" : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ + "+m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "a" (expect), /* 3 */ - "m" (*dst) /* 4 */ + "a" (expect) /* 3 */ : "memory", "cc"); return (res); @@ -162,10 +161,9 @@ atomic_cmpset_long(volatile u_long *dst, " sete %0 ; " "# atomic_cmpset_long" : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ + "+m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "a" (expect), /* 3 */ - "m" (*dst) /* 4 */ + "a" (expect) /* 3 */ : "memory", "cc"); return (res); @@ -184,9 +182,8 @@ atomic_fetchadd_int(volatile u_int *p, u " xaddl %0,%1 ; " "# atomic_fetchadd_int" : "+r" (v), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p) /* 2 */ - : "cc"); + "+m" (*p) /* 1 */ + : : "cc"); return (v); } @@ -203,9 +200,8 @@ atomic_fetchadd_long(volatile u_long *p, " xaddq %0,%1 ; " "# atomic_fetchadd_long" : "+r" (v), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p) /* 2 */ - : "cc"); + "+m" (*p) /* 1 */ + : : "cc"); return (v); } @@ -253,9 +249,8 @@ atomic_load_acq_##TYPE(volatile u_##TYPE \ __asm __volatile(MPLOCKED LOP \ : "=a" (res), /* 0 */ \ - "=m" (*p) /* 1 */ \ - : "m" (*p) /* 2 */ \ - : "memory", "cc"); \ + "+m" (*p) /* 1 */ \ + : : "memory", "cc"); \ \ return (res); \ } \ @@ -314,8 +309,7 @@ atomic_readandclear_int(volatile u_int * " xchgl %1,%0 ; " "# atomic_readandclear_int" : "+r" (res), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p)); + "+m" (*p)); /* 1 */ return (res); } @@ -330,8 +324,7 @@ atomic_readandclear_long(volatile u_long " xchgq %1,%0 ; " "# atomic_readandclear_long" : "+r" (res), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p)); + "+m" (*p)); /* 1 */ return (res); } Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 20:49:46 2013 (r254611) +++ head/sys/i386/include/atomic.h Wed Aug 21 21:14:16 2013 (r254612) @@ -106,8 +106,8 @@ static __inline void \ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*p) \ - : CONS (V), "m" (*p) \ + : "+m" (*p) \ + : CONS (V) \ : "cc"); \ } \ \ @@ -115,8 +115,8 @@ static __inline void \ atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ __asm __volatile(MPLOCKED OP \ - : "=m" (*p) \ - : CONS (V), "m" (*p) \ + : "+m" (*p) \ + : CONS (V) \ : "memory", "cc"); \ } \ struct __hack @@ -174,11 +174,10 @@ atomic_load_acq_64_i586(volatile uint64_ " movl %%ebx,%%eax ; " " movl %%ecx,%%edx ; " " " MPLOCKED " " - " cmpxchg8b %2" + " cmpxchg8b %1" : "=&A" (res), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p) /* 2 */ - : "memory", "cc"); + "+m" (*p) /* 1 */ + : : "memory", "cc"); return (res); } @@ -192,12 +191,11 @@ atomic_store_rel_64_i586(volatile uint64 " movl %%edx,%%ecx ; " "1: " " " MPLOCKED " " - " cmpxchg8b %2 ; " + " cmpxchg8b %0 ; " " jne 1b" - : "=m" (*p), /* 0 */ + : "+m" (*p), /* 0 */ "+A" (v) /* 1 */ - : "m" (*p) /* 2 */ - : "ebx", "ecx", "memory", "cc"); + : : "ebx", "ecx", "memory", "cc"); } #endif /* _KERNEL && !WANT_FUNCTIONS */ @@ -220,7 +218,7 @@ atomic_cmpset_int(volatile u_int *dst, u __asm __volatile( " pushfl ; " " cli ; " - " cmpl %3,%4 ; " + " cmpl %3,%1 ; " " jne 1f ; " " movl %2,%1 ; " "1: " @@ -228,10 +226,9 @@ atomic_cmpset_int(volatile u_int *dst, u " popfl ; " "# atomic_cmpset_int" : "=q" (res), /* 0 */ - "=m" (*dst) /* 1 */ + "+m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "r" (expect), /* 3 */ - "m" (*dst) /* 4 */ + "r" (expect) /* 3 */ : "memory"); return (res); @@ -250,10 +247,9 @@ atomic_cmpset_int(volatile u_int *dst, u " sete %0 ; " "# atomic_cmpset_int" : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ + "+m" (*dst) /* 1 */ : "r" (src), /* 2 */ - "a" (expect), /* 3 */ - "m" (*dst) /* 4 */ + "a" (expect) /* 3 */ : "memory", "cc"); return (res); @@ -274,9 +270,8 @@ atomic_fetchadd_int(volatile u_int *p, u " xaddl %0,%1 ; " "# atomic_fetchadd_int" : "+r" (v), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p) /* 2 */ - : "cc"); + "+m" (*p) /* 1 */ + : : "cc"); return (v); } @@ -324,9 +319,8 @@ atomic_load_acq_##TYPE(volatile u_##TYPE \ __asm __volatile(MPLOCKED LOP \ : "=a" (res), /* 0 */ \ - "=m" (*p) /* 1 */ \ - : "m" (*p) /* 2 */ \ - : "memory", "cc"); \ + "+m" (*p) /* 1 */ \ + : : "memory", "cc"); \ \ return (res); \ } \ @@ -405,8 +399,7 @@ atomic_readandclear_int(volatile u_int * " xchgl %1,%0 ; " "# atomic_readandclear_int" : "+r" (res), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p)); + "+m" (*p)); /* 1 */ return (res); } @@ -421,8 +414,7 @@ atomic_readandclear_long(volatile u_long " xchgl %1,%0 ; " "# atomic_readandclear_long" : "+r" (res), /* 0 */ - "=m" (*p) /* 1 */ - : "m" (*p)); + "+m" (*p)); /* 1 */ return (res); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:24:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9A3AB5E5; Wed, 21 Aug 2013 21:24:21 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 682F82C4C; Wed, 21 Aug 2013 21:24:20 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id ep20so798622lab.30 for ; Wed, 21 Aug 2013 14:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=RTF0p2ExA/cub0jEgItXHm1xgns4n1lwfgVw3HtrnG4=; b=W/UUYyLeDmk+chBj8y0BJIiPVS648BgCwB2OWty+oQfzukPa1I5vqKNslUa0rr/PaS awdYkPeFm5YwgvT9Digs2hbMW5SoF0IO74ny0JldSgw2IYp3YBKDmsApXAJSnRLMCuGk RKCrSZKxhdacaGSlEa5j5gdMAz0Ed1GdgQVp3m1yrlRSlckOP58szlYIfLCvESnZOwX0 4HMA+3VfKA+96vmQoTy13DLYGGgRK2UUu3stiV4cYXvsXO1MHKgjvj1Nsm5jE24tOK1O TORL4rLmo4eRf1WcuesUwHFTTr/DLCrgSfFrda406RXVRKxBqtrCl8yvrkaML2upz2bM bZUQ== X-Received: by 10.112.77.134 with SMTP id s6mr2877451lbw.38.1377120256689; Wed, 21 Aug 2013 14:24:16 -0700 (PDT) Received: from omg ([77.87.117.72]) by mx.google.com with ESMTPSA id o1sm3587273lah.8.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 21 Aug 2013 14:24:16 -0700 (PDT) Sender: Sergey Kandaurov Date: Thu, 22 Aug 2013 01:24:13 +0400 From: Sergey Kandaurov To: Jilles Tjoelker Subject: Re: svn commit: r254600 - head/lib/libutil Message-ID: <20130821212413.GC52908@omg> References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> <20130821190309.GB52908@omg> <20130821202725.GA4991@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8TaQrIeukR7mmbKf" Content-Disposition: inline In-Reply-To: <20130821202725.GA4991@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:24:21 -0000 --8TaQrIeukR7mmbKf Content-Type: multipart/mixed; boundary="Yb+qhiCg54lqZFXW" Content-Disposition: inline --Yb+qhiCg54lqZFXW Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 21, 2013 at 10:27:25PM +0200, Jilles Tjoelker wrote: > On Wed, Aug 21, 2013 at 11:03:10PM +0400, Sergey Kandaurov wrote: > > On Wed, Aug 21, 2013 at 09:21:47PM +0400, Andrey Chernov wrote: > > > On 21.08.2013 20:46, Sergey Kandaurov wrote: > > > > number =3D strtoumax(buf, &endptr, 0); > > > > =20 > > > > + if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { > > > > + return (-1); > > > > + } >=20 > > > You need to reset errno before strtoumax() call (errno =3D 0), becaus= e any > > > of previous functions may left it as ERANGE. >=20 > > Thanks for pointing out. > > Does the patch look good? >=20 > > Index: expand_number.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 > > --- expand_number.c (revision 254600) > > +++ expand_number.c (working copy) > > @@ -53,6 +53,8 @@ > > unsigned shift; > > char *endptr; > > =20 > > + errno =3D 0; > > + > > number =3D strtoumax(buf, &endptr, 0); > > =20 > > if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { > >=20 >=20 > This may cause the function to set errno=3D0 if it is successful, which is > not allowed for standard library functions from C and POSIX. There may > be a problem not only if expand_number() is standardized but also if it > is used in the implementation of a standard library function. The best > solution is to save and restore errno around this (if [ERANGE] is > detected, that is a valid errno value to keep). >=20 > In an application it is acceptable to set errno=3D0 without further ado. >=20 What about this change? It changes errno only if it was modified from zero in strtoumax(). Unconditionally restoring errno after strtoumax() unless ERANGE is probably not good as strtoumax() might set different errno (e.g. EINVAL) and we might want to keep it as well. Please correct me, if I'm wrong. Index: lib/libutil/expand_number.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 --- lib/libutil/expand_number.c (revision 254600) +++ lib/libutil/expand_number.c (working copy) @@ -50,15 +50,22 @@ expand_number(const char *buf, uint64_t *num) { uint64_t number; + int saved_errno; unsigned shift; char *endptr; =20 + saved_errno =3D errno; + errno =3D 0; + number =3D strtoumax(buf, &endptr, 0); =20 if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { return (-1); } =20 + if (errno =3D=3D 0) + errno =3D saved_errno; + if (endptr =3D=3D buf) { /* No valid digits. */ errno =3D EINVAL; --Yb+qhiCg54lqZFXW Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="expand_number.2.diff" Content-Transfer-Encoding: quoted-printable Index: lib/libutil/expand_number.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 --- lib/libutil/expand_number.c (revision 254600) +++ lib/libutil/expand_number.c (working copy) @@ -50,15 +50,22 @@ expand_number(const char *buf, uint64_t *num) { uint64_t number; + int saved_errno; unsigned shift; char *endptr; =20 + saved_errno =3D errno; + errno =3D 0; + number =3D strtoumax(buf, &endptr, 0); =20 if (number =3D=3D UINTMAX_MAX && errno =3D=3D ERANGE) { return (-1); } =20 + if (errno =3D=3D 0) + errno =3D saved_errno; + if (endptr =3D=3D buf) { /* No valid digits. */ errno =3D EINVAL; --Yb+qhiCg54lqZFXW-- --8TaQrIeukR7mmbKf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBAgAGBQJSFS/9AAoJED9Ol7oQYHQZ0pkIAIYQRN1biQO+lAAir+EFeF0m RmU8Q7LE9G+5AAoAkUN+xJW53blML7aBi7RLlpEHvPrPszPWPaR3KJ/TxUGiX1f4 wrRdPsHdqA0od8yI46EN3LixLjxwxIHlWW/FK2DW6Dp2tZuaYjsal6t8R+9OSlvX HL834c2Yz5U2652AnFsm3sNNIVcFHCPCrue1ygZITE4boCTI0SJaFdRVic2PrxYI z4tEbhavm77ecxomS82hO6wR2OUVAMXaSsKdVtkpdlmHJllssDMADlKBCFRQPJDG vwHIxWeSNoxlNxt5QCWvn9eVx4SSMYT8wOi5XzmrzeXIUKpB6Wx3tHbuULXEnYo= =uKp9 -----END PGP SIGNATURE----- --8TaQrIeukR7mmbKf-- From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:30:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6017D9DE; Wed, 21 Aug 2013 21:30:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33E762D07; Wed, 21 Aug 2013 21:30:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LLU7IL008360; Wed, 21 Aug 2013 21:30:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LLU6X8008358; Wed, 21 Aug 2013 21:30:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212130.r7LLU6X8008358@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 21:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254614 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:30:07 -0000 Author: jkim Date: Wed Aug 21 21:30:06 2013 New Revision: 254614 URL: http://svnweb.freebsd.org/changeset/base/254614 Log: - Remove the "a" constraint from main output operand for atomic_cmpset(). - Use "+" modifier for the "expect" because it is also an output (unused). Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Wed Aug 21 21:20:16 2013 (r254613) +++ head/sys/amd64/include/atomic.h Wed Aug 21 21:30:06 2013 (r254614) @@ -138,13 +138,13 @@ atomic_cmpset_int(volatile u_int *dst, u __asm __volatile( " " MPLOCKED " " - " cmpxchgl %2,%1 ; " + " cmpxchgl %3,%1 ; " " sete %0 ; " "# atomic_cmpset_int" - : "=a" (res), /* 0 */ - "+m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (expect) /* 3 */ + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+a" (expect) /* 2 */ + : "r" (src) /* 3 */ : "memory", "cc"); return (res); @@ -157,13 +157,13 @@ atomic_cmpset_long(volatile u_long *dst, __asm __volatile( " " MPLOCKED " " - " cmpxchgq %2,%1 ; " + " cmpxchgq %3,%1 ; " " sete %0 ; " "# atomic_cmpset_long" - : "=a" (res), /* 0 */ - "+m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (expect) /* 3 */ + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+a" (expect) /* 2 */ + : "r" (src) /* 3 */ : "memory", "cc"); return (res); Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 21:20:16 2013 (r254613) +++ head/sys/i386/include/atomic.h Wed Aug 21 21:30:06 2013 (r254614) @@ -243,13 +243,13 @@ atomic_cmpset_int(volatile u_int *dst, u __asm __volatile( " " MPLOCKED " " - " cmpxchgl %2,%1 ; " + " cmpxchgl %3,%1 ; " " sete %0 ; " "# atomic_cmpset_int" - : "=a" (res), /* 0 */ - "+m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (expect) /* 3 */ + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+a" (expect) /* 2 */ + : "r" (src) /* 3 */ : "memory", "cc"); return (res); From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:30:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56A7AB45; Wed, 21 Aug 2013 21:30:57 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A55F2D3C; Wed, 21 Aug 2013 21:30:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LLUvpW008992; Wed, 21 Aug 2013 21:30:57 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LLUvO5008991; Wed, 21 Aug 2013 21:30:57 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201308212130.r7LLUvO5008991@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 21 Aug 2013 21:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254615 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:30:57 -0000 Author: ken Date: Wed Aug 21 21:30:56 2013 New Revision: 254615 URL: http://svnweb.freebsd.org/changeset/base/254615 Log: Fix mps(4) driver breakage that came in in change 253550 that manifested itself in out of chain frame conditions. When the driver ran out of chain frames, the request in question would get completed early, and go through mpssas_scsiio_complete(). In mpssas_scsiio_complete(), the negation of the CAM status values (CAM_STATUS_MASK | CAM_SIM_QUEUED) was ORed in instead of being ANDed in. This resulted in a bogus CAM CCB status value. This didn't show up in the non-error case, because the status was reset to something valid (e.g. CAM_REQ_CMP) later on in the function. But in the error case, such as when the driver ran out of chain frames, the CAM_REQUEUE_REQ status was ORed in to the bogus status value. This led to the CAM transport layer repeatedly releasing the SIM queue, because it though that the CAM_RELEASE_SIMQ flag had been set. The symptom was messages like this on the console when INVARIANTS were enabled: xpt_release_simq: requested 1 > present 0 xpt_release_simq: requested 1 > present 0 xpt_release_simq: requested 1 > present 0 mps_sas.c: In mpssas_scsiio_complete(), use &= to take status bits out. |= adds them in. In the error case in mpssas_scsiio_complete(), set the status to CAM_REQUEUE_REQ, don't OR it in. MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Wed Aug 21 21:30:06 2013 (r254614) +++ head/sys/dev/mps/mps_sas.c Wed Aug 21 21:30:56 2013 (r254615) @@ -2103,7 +2103,7 @@ mpssas_scsiio_complete(struct mps_softc cm->cm_targ->completed++; cm->cm_targ->outstanding--; TAILQ_REMOVE(&cm->cm_targ->commands, cm, cm_link); - ccb->ccb_h.status |= ~(CAM_STATUS_MASK | CAM_SIM_QUEUED); + ccb->ccb_h.status &= ~(CAM_STATUS_MASK | CAM_SIM_QUEUED); if (cm->cm_state == MPS_CM_STATE_TIMEDOUT) { TAILQ_REMOVE(&cm->cm_targ->timedout_commands, cm, cm_recovery); @@ -2145,7 +2145,7 @@ mpssas_scsiio_complete(struct mps_softc * because there can be no reply when we haven't actually * gone out to the hardware. */ - ccb->ccb_h.status |= CAM_REQUEUE_REQ; + ccb->ccb_h.status = CAM_REQUEUE_REQ; /* * Currently the only error included in the mask is From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:37:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EE618F6D; Wed, 21 Aug 2013 21:37:57 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99D102E4E; Wed, 21 Aug 2013 21:37:57 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 85697358C60; Wed, 21 Aug 2013 23:37:55 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 6C01028494; Wed, 21 Aug 2013 23:37:55 +0200 (CEST) Date: Wed, 21 Aug 2013 23:37:55 +0200 From: Jilles Tjoelker To: Sergey Kandaurov Subject: Re: svn commit: r254600 - head/lib/libutil Message-ID: <20130821213755.GA8052@stack.nl> References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> <20130821190309.GB52908@omg> <20130821202725.GA4991@stack.nl> <20130821212413.GC52908@omg> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130821212413.GC52908@omg> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:37:58 -0000 On Thu, Aug 22, 2013 at 01:24:13AM +0400, Sergey Kandaurov wrote: > On Wed, Aug 21, 2013 at 10:27:25PM +0200, Jilles Tjoelker wrote: > > On Wed, Aug 21, 2013 at 11:03:10PM +0400, Sergey Kandaurov wrote: > > > On Wed, Aug 21, 2013 at 09:21:47PM +0400, Andrey Chernov wrote: > > > > On 21.08.2013 20:46, Sergey Kandaurov wrote: > > > > > number = strtoumax(buf, &endptr, 0); > > > > > > > > > > + if (number == UINTMAX_MAX && errno == ERANGE) { > > > > > + return (-1); > > > > > + } > > > > You need to reset errno before strtoumax() call (errno = 0), because any > > > > of previous functions may left it as ERANGE. > > > Thanks for pointing out. > > > Does the patch look good? > > > Index: expand_number.c > > > =================================================================== > > > --- expand_number.c (revision 254600) > > > +++ expand_number.c (working copy) > > > @@ -53,6 +53,8 @@ > > > unsigned shift; > > > char *endptr; > > > > > > + errno = 0; > > > + > > > number = strtoumax(buf, &endptr, 0); > > > > > > if (number == UINTMAX_MAX && errno == ERANGE) { > > This may cause the function to set errno=0 if it is successful, which is > > not allowed for standard library functions from C and POSIX. There may > > be a problem not only if expand_number() is standardized but also if it > > is used in the implementation of a standard library function. The best > > solution is to save and restore errno around this (if [ERANGE] is > > detected, that is a valid errno value to keep). > > In an application it is acceptable to set errno=0 without further ado. > What about this change? > It changes errno only if it was modified from zero in strtoumax(). > Unconditionally restoring errno after strtoumax() unless ERANGE is > probably not good as strtoumax() might set different errno (e.g. EINVAL) > and we might want to keep it as well. Please correct me, if I'm wrong. > Index: lib/libutil/expand_number.c > =================================================================== > --- lib/libutil/expand_number.c (revision 254600) > +++ lib/libutil/expand_number.c (working copy) > @@ -50,15 +50,22 @@ > expand_number(const char *buf, uint64_t *num) > { > uint64_t number; > + int saved_errno; > unsigned shift; > char *endptr; > > + saved_errno = errno; > + errno = 0; > + > number = strtoumax(buf, &endptr, 0); > > if (number == UINTMAX_MAX && errno == ERANGE) { > return (-1); > } > > + if (errno == 0) > + errno = saved_errno; > + > if (endptr == buf) { > /* No valid digits. */ > errno = EINVAL; > This looks good to me. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:47:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C1E28415; Wed, 21 Aug 2013 21:47:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF2252EE8; Wed, 21 Aug 2013 21:47:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LLluVA016808; Wed, 21 Aug 2013 21:47:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LLlu6V016807; Wed, 21 Aug 2013 21:47:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201308212147.r7LLlu6V016807@svn.freebsd.org> From: Adrian Chadd Date: Wed, 21 Aug 2013 21:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254616 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:47:56 -0000 Author: adrian Date: Wed Aug 21 21:47:56 2013 New Revision: 254616 URL: http://svnweb.freebsd.org/changeset/base/254616 Log: Change the name of this particular event to reflect the name used in Linux and Intel examples. Sourced: * https://github.com/andikleen/pmu-tools/blob/master/snb-client.csv * http://software.intel.com/en-us/comment/1747932#comment-1747932 Note: * It's not currently in the Intel SDM; I need to chase down what's going on. Tested: * Sandy Bridge Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:30:56 2013 (r254615) +++ head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:47:56 2013 (r254616) @@ -3304,7 +3304,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE IAP_EVENT_D2H_04H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \ IAP_EVENT_D2H_08H) \ -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ IAP_EVENT_D4H_02H) \ __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \ __PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \ @@ -3538,7 +3538,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE IAP_EVENT_D2H_08H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", \ IAP_EVENT_D2H_0FH) \ -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ IAP_EVENT_D4H_02H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \ IAP_EVENT_D3H_01H) \ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:52:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C9D4B5BA; Wed, 21 Aug 2013 21:52:10 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-x232.google.com (mail-vb0-x232.google.com [IPv6:2607:f8b0:400c:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53AB42F35; Wed, 21 Aug 2013 21:52:10 +0000 (UTC) Received: by mail-vb0-f50.google.com with SMTP id x14so739190vbb.9 for ; Wed, 21 Aug 2013 14:52:09 -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:message-id:subject :from:to:cc:content-type; bh=dcnqNaKeEPYGwyjF5XT7efDFPNIvB5Pv1ixVawUekS0=; b=scpDyKMVhdA1YOE+L7e2YJ1yUhTdKwwvdyk2shRfpEO/XbOwC1iaSMCGDUOOuDrwT/ B/DDUz8mSqS64fL/DXTrTC2rddg9WkFb+Sx1od/59mEpukj9rqxhJ61Yi3y/+4c9PoQt eZz0m0SxHtvuzLbyQOx36yDOWem2mg+yOpeDhp89A5oBfCkmV3JFjkcjHcfuoqpwk4iC 7Pl4y+Wx8Hm1E1LO3VAv4DLhut0GfYMysssrRyDm4gOUkVT7Cpfj0CjavueTOPz6V0Qo DHfwUKiIpQyuDQO6h/BrAoVGM7v9CFJnACfNMqFg2KI/Cf1OgPpm9YMXqp7/BQtMJmxN ZMdA== MIME-Version: 1.0 X-Received: by 10.220.76.10 with SMTP id a10mr197679vck.31.1377121929359; Wed, 21 Aug 2013 14:52:09 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Wed, 21 Aug 2013 14:52:09 -0700 (PDT) In-Reply-To: <201308212147.r7LLlu6V016807@svn.freebsd.org> References: <201308212147.r7LLlu6V016807@svn.freebsd.org> Date: Wed, 21 Aug 2013 14:52:09 -0700 X-Google-Sender-Auth: yTv-ciPlOz_hgPKRudAAgApihvs Message-ID: Subject: Re: svn commit: r254616 - head/sys/dev/hwpmc From: Davide Italiano To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:52:11 -0000 On Wed, Aug 21, 2013 at 2:47 PM, Adrian Chadd wrote: > Author: adrian > Date: Wed Aug 21 21:47:56 2013 > New Revision: 254616 > URL: http://svnweb.freebsd.org/changeset/base/254616 > > Log: > Change the name of this particular event to reflect the name used in > Linux and Intel examples. > > Sourced: > > * https://github.com/andikleen/pmu-tools/blob/master/snb-client.csv > * http://software.intel.com/en-us/comment/1747932#comment-1747932 > > Note: > > * It's not currently in the Intel SDM; I need to chase down what's > going on. > > Tested: > > * Sandy Bridge > > Modified: > head/sys/dev/hwpmc/pmc_events.h > > Modified: head/sys/dev/hwpmc/pmc_events.h > ============================================================================== > --- head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:30:56 2013 (r254615) > +++ head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:47:56 2013 (r254616) > @@ -3304,7 +3304,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE > IAP_EVENT_D2H_04H) \ > __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \ > IAP_EVENT_D2H_08H) \ > -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ > +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ > IAP_EVENT_D4H_02H) \ > __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \ > __PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \ > @@ -3538,7 +3538,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE > IAP_EVENT_D2H_08H) \ > __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", \ > IAP_EVENT_D2H_0FH) \ > -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ > +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ > IAP_EVENT_D4H_02H) \ > __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \ > IAP_EVENT_D3H_01H) \ Can you update the manpage as well? -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 21:59:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C4F52879; Wed, 21 Aug 2013 21:59:12 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [IPv6:2607:f8b0:400c:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8CB2F81; Wed, 21 Aug 2013 21:59:12 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id cz11so871643veb.36 for ; Wed, 21 Aug 2013 14:59:11 -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:message-id:subject :from:to:cc:content-type; bh=qchRlJvo5j6oi0Cyagj5nqRB/tlNCtaQQ6mCkB+lDLY=; b=RYFPxO8M70hEEIAQLDxEbxEVfTMpfk5f17yJY9usI/xKkNda6EvvVci6/e7tjbni7h otFgvcvi84ZpdrrV1XB019koS67AqXNK2SSXR3vQLrxSChIJFYvUdtbYAVAEAX+I1wwr g8Wp10L1LikUmp4rrGjyxkIK5FSRFGzD5GSqZOcUZYTdWAPsJJTHEI+qwIVo2cQ+7n5a ObA4+TJ6cpUgCKxp70ykohFM3/YGBCNOxphC/1lWX+ZAEXitubtDQ7QGqzSr7tfz7b70 0D48gLo4PTrjtTmQSosTMHvQTgCrjEmgamzXAhjYPyiFKa2ycT4abvI8W7/8SZq9qytS KvBQ== MIME-Version: 1.0 X-Received: by 10.220.145.75 with SMTP id c11mr2220501vcv.30.1377122351400; Wed, 21 Aug 2013 14:59:11 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Wed, 21 Aug 2013 14:59:11 -0700 (PDT) In-Reply-To: References: <201308212147.r7LLlu6V016807@svn.freebsd.org> Date: Wed, 21 Aug 2013 14:59:11 -0700 X-Google-Sender-Auth: q5P3Fr4eeoEQUgfr4KyjYWlh5o8 Message-ID: Subject: Re: svn commit: r254616 - head/sys/dev/hwpmc From: Davide Italiano To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 21:59:13 -0000 On Wed, Aug 21, 2013 at 2:52 PM, Davide Italiano wrote: > On Wed, Aug 21, 2013 at 2:47 PM, Adrian Chadd wrote: >> Author: adrian >> Date: Wed Aug 21 21:47:56 2013 >> New Revision: 254616 >> URL: http://svnweb.freebsd.org/changeset/base/254616 >> >> Log: >> Change the name of this particular event to reflect the name used in >> Linux and Intel examples. >> >> Sourced: >> >> * https://github.com/andikleen/pmu-tools/blob/master/snb-client.csv >> * http://software.intel.com/en-us/comment/1747932#comment-1747932 >> >> Note: >> >> * It's not currently in the Intel SDM; I need to chase down what's >> going on. >> >> Tested: >> >> * Sandy Bridge >> >> Modified: >> head/sys/dev/hwpmc/pmc_events.h >> >> Modified: head/sys/dev/hwpmc/pmc_events.h >> ============================================================================== >> --- head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:30:56 2013 (r254615) >> +++ head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:47:56 2013 (r254616) >> @@ -3304,7 +3304,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE >> IAP_EVENT_D2H_04H) \ >> __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \ >> IAP_EVENT_D2H_08H) \ >> -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ >> +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ >> IAP_EVENT_D4H_02H) \ >> __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \ >> __PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \ >> @@ -3538,7 +3538,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE >> IAP_EVENT_D2H_08H) \ >> __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", \ >> IAP_EVENT_D2H_0FH) \ >> -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", \ >> +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ >> IAP_EVENT_D4H_02H) \ >> __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \ >> IAP_EVENT_D3H_01H) \ > > Can you update the manpage as well? > > -- > Davide > > "There are no solved problems; there are only problems that are more > or less solved" -- Henri Poincare Also for r254476, as already requested by Hiren, because everyone looks at the manpage to understand what metrice the event measures before running pmcstat, so having manpages update when new events are added is almost necessary. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:02:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3CF689DA; Wed, 21 Aug 2013 22:02:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D95F2FC0; Wed, 21 Aug 2013 22:02:41 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id hi8so1024829wib.9 for ; Wed, 21 Aug 2013 15:02:39 -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:message-id:subject :from:to:cc:content-type; bh=M+cbVNOB1/ZFmrquzueSBVeE20/rMYY1HouxmkdEMeQ=; b=yFSDS+HDsXi7K5mjAB/Vtc4Reg62uyKNJRx0HkCY7qDEV6ndXdRoIt9H2aSwvxdoAA E2MGvnqyn8+cW1sy0a5yIQsnqvc3z2P2ACy4fwnAi9hmBc9exjt4MMyHxZHGAikGJV1J WR4oj9NIQEMzSojuJ9YhuZnhLvoHtFWbi+84Y+VJVugjYLwTfCMvRDTuKR5O5W0tdIAY oJ3+vM/RyGDmkjvdbDuUrIpvoivMige5o09Yw4cxRAgL+K3A4geWgtMKtrXHMOAOcFI7 DXcPzKkmQkhEFE8wsTEDIwTZmUg3Td0BKcecpJC46mFj/l97W6RgtusJtY2kNdv7ayDa wt4g== MIME-Version: 1.0 X-Received: by 10.180.211.206 with SMTP id ne14mr7148439wic.30.1377122559348; Wed, 21 Aug 2013 15:02:39 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.116.136 with HTTP; Wed, 21 Aug 2013 15:02:39 -0700 (PDT) In-Reply-To: References: <201308212147.r7LLlu6V016807@svn.freebsd.org> Date: Wed, 21 Aug 2013 15:02:39 -0700 X-Google-Sender-Auth: gbnu2QAkSFN4dkZ0pezUrIHJTIQ Message-ID: Subject: Re: svn commit: r254616 - head/sys/dev/hwpmc From: Adrian Chadd To: Davide Italiano Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:02:42 -0000 i'll talk with you/hiren/{MANPAGE_PEOPLE} once my current run of "figuring out what the hell" is done. That way the updates can be done in one big hit. Thanks -adrian On 21 August 2013 14:59, Davide Italiano wrote: > On Wed, Aug 21, 2013 at 2:52 PM, Davide Italiano > wrote: > > On Wed, Aug 21, 2013 at 2:47 PM, Adrian Chadd > wrote: > >> Author: adrian > >> Date: Wed Aug 21 21:47:56 2013 > >> New Revision: 254616 > >> URL: http://svnweb.freebsd.org/changeset/base/254616 > >> > >> Log: > >> Change the name of this particular event to reflect the name used in > >> Linux and Intel examples. > >> > >> Sourced: > >> > >> * https://github.com/andikleen/pmu-tools/blob/master/snb-client.csv > >> * http://software.intel.com/en-us/comment/1747932#comment-1747932 > >> > >> Note: > >> > >> * It's not currently in the Intel SDM; I need to chase down what's > >> going on. > >> > >> Tested: > >> > >> * Sandy Bridge > >> > >> Modified: > >> head/sys/dev/hwpmc/pmc_events.h > >> > >> Modified: head/sys/dev/hwpmc/pmc_events.h > >> > ============================================================================== > >> --- head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:30:56 2013 > (r254615) > >> +++ head/sys/dev/hwpmc/pmc_events.h Wed Aug 21 21:47:56 2013 > (r254616) > >> @@ -3304,7 +3304,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE > >> IAP_EVENT_D2H_04H) > \ > >> __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", > \ > >> IAP_EVENT_D2H_08H) > \ > >> -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", > \ > >> +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", > \ > >> IAP_EVENT_D4H_02H) > \ > >> __PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) > \ > >> __PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) > \ > >> @@ -3538,7 +3538,7 @@ __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RE > >> IAP_EVENT_D2H_08H) > \ > >> __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.ALL", > \ > >> IAP_EVENT_D2H_0FH) > \ > >> -__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.LLC_MISS", > \ > >> +__PMC_EV_ALIAS("MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS", \ > >> IAP_EVENT_D4H_02H) > \ > >> __PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", > \ > >> IAP_EVENT_D3H_01H) > \ > > > > Can you update the manpage as well? > > > > -- > > Davide > > > > "There are no solved problems; there are only problems that are more > > or less solved" -- Henri Poincare > > Also for r254476, as already requested by Hiren, because everyone > looks at the manpage to understand what metrice the event measures > before running pmcstat, so having manpages update when new events are > added is almost necessary. > > Thanks, > > -- > Davide > > "There are no solved problems; there are only problems that are more > or less solved" -- Henri Poincare > From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:03:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B09A0B26; Wed, 21 Aug 2013 22:03:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC1F2FC6; Wed, 21 Aug 2013 22:03:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LM37Z5025903; Wed, 21 Aug 2013 22:03:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LM37kd025900; Wed, 21 Aug 2013 22:03:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212203.r7LM37kd025900@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 22:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254617 - in head: share/man/man9 sys/amd64/include sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:03:07 -0000 Author: jkim Date: Wed Aug 21 22:03:06 2013 New Revision: 254617 URL: http://svnweb.freebsd.org/changeset/base/254617 Log: Implement atomic_swap() and atomic_testandset(). Reviewed by: arch, bde, jilles, kib Modified: head/share/man/man9/atomic.9 head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Wed Aug 21 21:47:56 2013 (r254616) +++ head/share/man/man9/atomic.9 Wed Aug 21 22:03:06 2013 (r254617) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2005 +.Dd August 20, 2013 .Dt ATOMIC 9 .Os .Sh NAME @@ -62,6 +62,10 @@ .Fn atomic_subtract_[acq_|rel_] "volatile *p" " v" .Ft void .Fn atomic_store_rel_ "volatile *p" " v" +.Ft +.Fn atomic_swap_ "volatile *p" " v" +.Ft int +.Fn atomic_testandset_ "volatile *p" "u_int v" .Sh DESCRIPTION Each of the atomic operations is guaranteed to be atomic in the presence of interrupts. @@ -184,9 +188,9 @@ This section describes the semantics of .Bd -literal -compact if (*dst == old) { *dst = new; - return 1; + return (1); } else - return 0; + return (0); .Ed .El .Pp @@ -203,7 +207,7 @@ and .Bd -literal -compact tmp = *p; *p += v; -return tmp; +return (tmp); .Ed .El .Pp @@ -216,9 +220,9 @@ and .Dq Li 32 and do not have any variants with memory barriers at this time. .Bl -hang -.It Fn atomic_load addr +.It Fn atomic_load p .Bd -literal -compact -return (*addr) +return (*p); .Ed .El .Pp @@ -226,11 +230,11 @@ The .Fn atomic_load functions are only provided with acquire memory barriers. .Bl -hang -.It Fn atomic_readandclear addr +.It Fn atomic_readandclear p .Bd -literal -compact -temp = *addr; -*addr = 0; -return (temp); +tmp = *p; +*p = 0; +return (tmp); .Ed .El .Pp @@ -243,8 +247,7 @@ functions are not implemented for the ty .Dq Li 8 , and .Dq Li 16 -and do -not have any variants with memory barriers at this time. +and do not have any variants with memory barriers at this time. .Bl -hang .It Fn atomic_set p v .Bd -literal -compact @@ -264,6 +267,44 @@ The .Fn atomic_store functions are only provided with release memory barriers. .Pp +.Bl -hang +.It Fn atomic_swap p v +.Bd -literal -compact +tmp = *p; +*p = v; +return (tmp); +.Ed +.El +.Pp +The +.Fn atomic_swap +functions are not implemented for the types +.Dq Li char , +.Dq Li short , +.Dq Li ptr , +.Dq Li 8 , +and +.Dq Li 16 +and do not have any variants with memory barriers at this time. +.Bl -hang +.It Fn atomic_testandset p v +.Bd -literal -compact +bit = 1 << (v % (sizeof(*p) * NBBY)); +tmp = (*p & bit) != 0; +*p |= bit; +return (tmp); +.Ed +.El +.Pp +The +.Fn atomic_testandset +functions are only implemented for the types +.Dq Li int , +.Dq Li long +and +.Dq Li 32 +and do not have any variants with memory barriers at this time. +.Pp The type .Dq Li 64 is currently not implemented for any of the atomic operations on the @@ -275,15 +316,17 @@ architectures. .Sh RETURN VALUES The .Fn atomic_cmpset -function -returns the result of the compare operation. +function returns the result of the compare operation. The .Fn atomic_fetchadd , .Fn atomic_load , +.Fn atomic_readandclear , and -.Fn atomic_readandclear -functions -return the value at the specified address. +.Fn atomic_swap +functions return the value at the specified address. +The +.Fn atomic_testandset +function returns the result of the test operation. .Sh EXAMPLES This example uses the .Fn atomic_cmpset_acq_ptr @@ -354,3 +397,9 @@ The .Fn atomic_fetchadd operations were added in .Fx 6.0 . +The +.Fn atomic_swap +and +.Fn atomic_testandset +operations were added in +.Fx 10.0 . Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Wed Aug 21 21:47:56 2013 (r254616) +++ head/sys/amd64/include/atomic.h Wed Aug 21 22:03:06 2013 (r254617) @@ -54,12 +54,14 @@ * atomic_clear_int(P, V) (*(u_int *)(P) &= ~(V)) * atomic_add_int(P, V) (*(u_int *)(P) += (V)) * atomic_subtract_int(P, V) (*(u_int *)(P) -= (V)) + * atomic_swap_int(P, V) (return (*(u_int *)(P)); *(u_int *)(P) = (V);) * atomic_readandclear_int(P) (return (*(u_int *)(P)); *(u_int *)(P) = 0;) * * atomic_set_long(P, V) (*(u_long *)(P) |= (V)) * atomic_clear_long(P, V) (*(u_long *)(P) &= ~(V)) * atomic_add_long(P, V) (*(u_long *)(P) += (V)) * atomic_subtract_long(P, V) (*(u_long *)(P) -= (V)) + * atomic_swap_long(P, V) (return (*(u_long *)(P)); *(u_long *)(P) = (V);) * atomic_readandclear_long(P) (return (*(u_long *)(P)); *(u_long *)(P) = 0;) */ @@ -80,6 +82,8 @@ int atomic_cmpset_int(volatile u_int *ds int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); u_long atomic_fetchadd_long(volatile u_long *p, u_long v); +int atomic_testandset_int(volatile u_int *p, u_int v); +int atomic_testandset_long(volatile u_long *p, u_int v); #define ATOMIC_LOAD(TYPE, LOP) \ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) @@ -205,6 +209,40 @@ atomic_fetchadd_long(volatile u_long *p, return (v); } +static __inline int +atomic_testandset_int(volatile u_int *p, u_int v) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " btsl %2,%1 ; " + " setc %0 ; " + "# atomic_testandset_int" + : "=q" (res), /* 0 */ + "+m" (*p) /* 1 */ + : "Ir" (v & 0x1f) /* 2 */ + : "cc"); + return (res); +} + +static __inline int +atomic_testandset_long(volatile u_long *p, u_int v) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " btsq %2,%1 ; " + " setc %0 ; " + "# atomic_testandset_long" + : "=q" (res), /* 0 */ + "+m" (*p) /* 1 */ + : "Jr" ((u_long)(v & 0x3f)) /* 2 */ + : "cc"); + return (res); +} + /* * We assume that a = b will do atomic loads and stores. Due to the * IA32 memory model, a simple store guarantees release semantics. @@ -296,43 +334,39 @@ ATOMIC_STORE(long); #ifndef WANT_FUNCTIONS -/* Read the current value and store a zero in the destination. */ +/* Read the current value and store a new value in the destination. */ #ifdef __GNUCLIKE_ASM static __inline u_int -atomic_readandclear_int(volatile u_int *p) +atomic_swap_int(volatile u_int *p, u_int v) { - u_int res; - res = 0; __asm __volatile( " xchgl %1,%0 ; " - "# atomic_readandclear_int" - : "+r" (res), /* 0 */ + "# atomic_swap_int" + : "+r" (v), /* 0 */ "+m" (*p)); /* 1 */ - return (res); + return (v); } static __inline u_long -atomic_readandclear_long(volatile u_long *p) +atomic_swap_long(volatile u_long *p, u_long v) { - u_long res; - res = 0; __asm __volatile( " xchgq %1,%0 ; " - "# atomic_readandclear_long" - : "+r" (res), /* 0 */ + "# atomic_swap_long" + : "+r" (v), /* 0 */ "+m" (*p)); /* 1 */ - return (res); + return (v); } #else /* !__GNUCLIKE_ASM */ -u_int atomic_readandclear_int(volatile u_int *p); -u_long atomic_readandclear_long(volatile u_long *p); +u_int atomic_swap_int(volatile u_int *p, u_int v); +u_long atomic_swap_long(volatile u_long *p, u_long v); #endif /* __GNUCLIKE_ASM */ @@ -376,6 +410,9 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_acq_long atomic_cmpset_long #define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_readandclear_int(p) atomic_swap_int(p, 0) +#define atomic_readandclear_long(p) atomic_swap_long(p, 0) + /* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char #define atomic_set_acq_8 atomic_set_acq_char @@ -426,8 +463,10 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_32 atomic_cmpset_int #define atomic_cmpset_acq_32 atomic_cmpset_acq_int #define atomic_cmpset_rel_32 atomic_cmpset_rel_int +#define atomic_swap_32 atomic_swap_int #define atomic_readandclear_32 atomic_readandclear_int #define atomic_fetchadd_32 atomic_fetchadd_int +#define atomic_testandset_32 atomic_testandset_int /* Operations on 64-bit quad words. */ #define atomic_set_64 atomic_set_long @@ -447,7 +486,9 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_64 atomic_cmpset_long #define atomic_cmpset_acq_64 atomic_cmpset_acq_long #define atomic_cmpset_rel_64 atomic_cmpset_rel_long +#define atomic_swap_64 atomic_swap_long #define atomic_readandclear_64 atomic_readandclear_long +#define atomic_testandset_64 atomic_testandset_long /* Operations on pointers. */ #define atomic_set_ptr atomic_set_long @@ -467,6 +508,7 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_ptr atomic_cmpset_long #define atomic_cmpset_acq_ptr atomic_cmpset_acq_long #define atomic_cmpset_rel_ptr atomic_cmpset_rel_long +#define atomic_swap_ptr atomic_swap_long #define atomic_readandclear_ptr atomic_readandclear_long #endif /* !WANT_FUNCTIONS */ Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 21:47:56 2013 (r254616) +++ head/sys/i386/include/atomic.h Wed Aug 21 22:03:06 2013 (r254617) @@ -54,12 +54,14 @@ * atomic_clear_int(P, V) (*(u_int *)(P) &= ~(V)) * atomic_add_int(P, V) (*(u_int *)(P) += (V)) * atomic_subtract_int(P, V) (*(u_int *)(P) -= (V)) + * atomic_swap_int(P, V) (return (*(u_int *)(P)); *(u_int *)(P) = (V);) * atomic_readandclear_int(P) (return (*(u_int *)(P)); *(u_int *)(P) = 0;) * * atomic_set_long(P, V) (*(u_long *)(P) |= (V)) * atomic_clear_long(P, V) (*(u_long *)(P) &= ~(V)) * atomic_add_long(P, V) (*(u_long *)(P) += (V)) * atomic_subtract_long(P, V) (*(u_long *)(P) -= (V)) + * atomic_swap_long(P, V) (return (*(u_long *)(P)); *(u_long *)(P) = (V);) * atomic_readandclear_long(P) (return (*(u_long *)(P)); *(u_long *)(P) = 0;) */ @@ -78,6 +80,7 @@ void atomic_##NAME##_barr_##TYPE(volatil int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); +int atomic_testandset_int(volatile u_int *p, u_int v); #define ATOMIC_LOAD(TYPE, LOP) \ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) @@ -275,6 +278,23 @@ atomic_fetchadd_int(volatile u_int *p, u return (v); } +static __inline int +atomic_testandset_int(volatile u_int *p, u_int v) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " btsl %2,%1 ; " + " setc %0 ; " + "# atomic_testandset_int" + : "=q" (res), /* 0 */ + "+m" (*p) /* 1 */ + : "Ir" (v & 0x1f) /* 2 */ + : "cc"); + return (res); +} + /* * We assume that a = b will do atomic loads and stores. Due to the * IA32 memory model, a simple store guarantees release semantics. @@ -386,43 +406,40 @@ atomic_fetchadd_long(volatile u_long *p, return (atomic_fetchadd_int((volatile u_int *)p, (u_int)v)); } -/* Read the current value and store a zero in the destination. */ +static __inline int +atomic_testandset_long(volatile u_long *p, u_int v) +{ + + return (atomic_testandset_int((volatile u_int *)p, v)); +} + +/* Read the current value and store a new value in the destination. */ #ifdef __GNUCLIKE_ASM static __inline u_int -atomic_readandclear_int(volatile u_int *p) +atomic_swap_int(volatile u_int *p, u_int v) { - u_int res; - res = 0; __asm __volatile( " xchgl %1,%0 ; " - "# atomic_readandclear_int" - : "+r" (res), /* 0 */ + "# atomic_swap_int" + : "+r" (v), /* 0 */ "+m" (*p)); /* 1 */ - return (res); + return (v); } static __inline u_long -atomic_readandclear_long(volatile u_long *p) +atomic_swap_long(volatile u_long *p, u_long v) { - u_long res; - res = 0; - __asm __volatile( - " xchgl %1,%0 ; " - "# atomic_readandclear_long" - : "+r" (res), /* 0 */ - "+m" (*p)); /* 1 */ - - return (res); + return (atomic_swap_int((volatile u_int *)p, (u_int)v)); } #else /* !__GNUCLIKE_ASM */ -u_int atomic_readandclear_int(volatile u_int *p); -u_long atomic_readandclear_long(volatile u_long *p); +u_int atomic_swap_int(volatile u_int *p, u_int v); +u_long atomic_swap_long(volatile u_long *p, u_long v); #endif /* __GNUCLIKE_ASM */ @@ -466,6 +483,9 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_acq_long atomic_cmpset_long #define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_readandclear_int(p) atomic_swap_int(p, 0) +#define atomic_readandclear_long(p) atomic_swap_long(p, 0) + /* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char #define atomic_set_acq_8 atomic_set_acq_char @@ -516,8 +536,10 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_32 atomic_cmpset_int #define atomic_cmpset_acq_32 atomic_cmpset_acq_int #define atomic_cmpset_rel_32 atomic_cmpset_rel_int +#define atomic_swap_32 atomic_swap_int #define atomic_readandclear_32 atomic_readandclear_int #define atomic_fetchadd_32 atomic_fetchadd_int +#define atomic_testandset_32 atomic_testandset_int /* Operations on pointers. */ #define atomic_set_ptr(p, v) \ @@ -556,6 +578,8 @@ u_long atomic_readandclear_long(volatile #define atomic_cmpset_rel_ptr(dst, old, new) \ atomic_cmpset_rel_int((volatile u_int *)(dst), (u_int)(old), \ (u_int)(new)) +#define atomic_swap_ptr(p, v) \ + atomic_swap_int((volatile u_int *)(p), (u_int)(v)) #define atomic_readandclear_ptr(p) \ atomic_readandclear_int((volatile u_int *)(p)) From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:05:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7398DD40; Wed, 21 Aug 2013 22:05:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4590B2FF3; Wed, 21 Aug 2013 22:05:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LM5xof026923; Wed, 21 Aug 2013 22:05:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LM5wXj026921; Wed, 21 Aug 2013 22:05:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212205.r7LM5wXj026921@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 22:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254618 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:05:59 -0000 Author: jkim Date: Wed Aug 21 22:05:58 2013 New Revision: 254618 URL: http://svnweb.freebsd.org/changeset/base/254618 Log: Remove empty lines before return statements for style consistency. Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Wed Aug 21 22:03:06 2013 (r254617) +++ head/sys/amd64/include/atomic.h Wed Aug 21 22:05:58 2013 (r254618) @@ -150,7 +150,6 @@ atomic_cmpset_int(volatile u_int *dst, u "+a" (expect) /* 2 */ : "r" (src) /* 3 */ : "memory", "cc"); - return (res); } @@ -169,7 +168,6 @@ atomic_cmpset_long(volatile u_long *dst, "+a" (expect) /* 2 */ : "r" (src) /* 3 */ : "memory", "cc"); - return (res); } @@ -289,7 +287,6 @@ atomic_load_acq_##TYPE(volatile u_##TYPE : "=a" (res), /* 0 */ \ "+m" (*p) /* 1 */ \ : : "memory", "cc"); \ - \ return (res); \ } \ struct __hack @@ -346,7 +343,6 @@ atomic_swap_int(volatile u_int *p, u_int "# atomic_swap_int" : "+r" (v), /* 0 */ "+m" (*p)); /* 1 */ - return (v); } @@ -359,7 +355,6 @@ atomic_swap_long(volatile u_long *p, u_l "# atomic_swap_long" : "+r" (v), /* 0 */ "+m" (*p)); /* 1 */ - return (v); } Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 22:03:06 2013 (r254617) +++ head/sys/i386/include/atomic.h Wed Aug 21 22:05:58 2013 (r254618) @@ -145,7 +145,6 @@ atomic_load_acq_64_i386(volatile uint64_ : "m" (*low), /* 1 */ "m" (*high) /* 2 */ : "memory"); - return (res); } @@ -181,7 +180,6 @@ atomic_load_acq_64_i586(volatile uint64_ : "=&A" (res), /* 0 */ "+m" (*p) /* 1 */ : : "memory", "cc"); - return (res); } @@ -233,7 +231,6 @@ atomic_cmpset_int(volatile u_int *dst, u : "r" (src), /* 2 */ "r" (expect) /* 3 */ : "memory"); - return (res); } @@ -254,7 +251,6 @@ atomic_cmpset_int(volatile u_int *dst, u "+a" (expect) /* 2 */ : "r" (src) /* 3 */ : "memory", "cc"); - return (res); } @@ -341,7 +337,6 @@ atomic_load_acq_##TYPE(volatile u_##TYPE : "=a" (res), /* 0 */ \ "+m" (*p) /* 1 */ \ : : "memory", "cc"); \ - \ return (res); \ } \ struct __hack @@ -425,7 +420,6 @@ atomic_swap_int(volatile u_int *p, u_int "# atomic_swap_int" : "+r" (v), /* 0 */ "+m" (*p)); /* 1 */ - return (v); } From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:27:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 062CA2F1; Wed, 21 Aug 2013 22:27:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E59DE2142; Wed, 21 Aug 2013 22:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMRgTp038180; Wed, 21 Aug 2013 22:27:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMRg1A038178; Wed, 21 Aug 2013 22:27:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212227.r7LMRg1A038178@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 22:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254619 - in head/sys/i386: i386 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:27:43 -0000 Author: jkim Date: Wed Aug 21 22:27:42 2013 New Revision: 254619 URL: http://svnweb.freebsd.org/changeset/base/254619 Log: Reimplement atomic_load_acq_64() and atomic_store_rel_64() for i386. These functions are now real functions rather than function pointers. Supposedly, it is faster for modern processors. Suggested by: bde Modified: head/sys/i386/i386/machdep.c head/sys/i386/include/atomic.h Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Aug 21 22:05:58 2013 (r254618) +++ head/sys/i386/i386/machdep.c Wed Aug 21 22:27:42 2013 (r254619) @@ -1548,21 +1548,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); -uint64_t (*atomic_load_acq_64)(volatile uint64_t *) = - atomic_load_acq_64_i386; -void (*atomic_store_rel_64)(volatile uint64_t *, uint64_t) = - atomic_store_rel_64_i386; - -static void -cpu_probe_cmpxchg8b(void) -{ - - if ((cpu_feature & CPUID_CX8) != 0) { - atomic_load_acq_64 = atomic_load_acq_64_i586; - atomic_store_rel_64 = atomic_store_rel_64_i586; - } -} - /* * Reset registers to default values on exec. */ @@ -2824,7 +2809,6 @@ init386(first) thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; cpu_probe_amdc1e(); - cpu_probe_cmpxchg8b(); } #else @@ -3115,7 +3099,6 @@ init386(first) thread0.td_frame = &proc0_tf; cpu_probe_amdc1e(); - cpu_probe_cmpxchg8b(); #ifdef FDT x86_init_fdt(); Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 22:05:58 2013 (r254618) +++ head/sys/i386/include/atomic.h Wed Aug 21 22:27:42 2013 (r254619) @@ -32,6 +32,11 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#ifdef _KERNEL +#include +#include +#endif + #define mb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory", "cc") #define wmb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory", "cc") #define rmb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory", "cc") @@ -87,6 +92,9 @@ u_##TYPE atomic_load_acq_##TYPE(volatile #define ATOMIC_STORE(TYPE) \ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) +uint64_t atomic_load_acq_64(volatile uint64_t *); +void atomic_store_rel_64(volatile uint64_t *, uint64_t); + #else /* !KLD_MODULE && __GNUCLIKE_ASM */ /* @@ -124,83 +132,6 @@ atomic_##NAME##_barr_##TYPE(volatile u_# } \ struct __hack -#if defined(_KERNEL) && !defined(WANT_FUNCTIONS) - -/* I486 does not support SMP or CMPXCHG8B. */ -static __inline uint64_t -atomic_load_acq_64_i386(volatile uint64_t *p) -{ - volatile uint32_t *high, *low; - uint64_t res; - - low = (volatile uint32_t *)p; - high = (volatile uint32_t *)p + 1; - __asm __volatile( - " pushfl ; " - " cli ; " - " movl %1,%%eax ; " - " movl %2,%%edx ; " - " popfl" - : "=&A" (res) /* 0 */ - : "m" (*low), /* 1 */ - "m" (*high) /* 2 */ - : "memory"); - return (res); -} - -static __inline void -atomic_store_rel_64_i386(volatile uint64_t *p, uint64_t v) -{ - volatile uint32_t *high, *low; - - low = (volatile uint32_t *)p; - high = (volatile uint32_t *)p + 1; - __asm __volatile( - " pushfl ; " - " cli ; " - " movl %%eax,%0 ; " - " movl %%edx,%1 ; " - " popfl" - : "=m" (*low), /* 0 */ - "=m" (*high) /* 1 */ - : "A" (v) /* 2 */ - : "memory"); -} - -static __inline uint64_t -atomic_load_acq_64_i586(volatile uint64_t *p) -{ - uint64_t res; - - __asm __volatile( - " movl %%ebx,%%eax ; " - " movl %%ecx,%%edx ; " - " " MPLOCKED " " - " cmpxchg8b %1" - : "=&A" (res), /* 0 */ - "+m" (*p) /* 1 */ - : : "memory", "cc"); - return (res); -} - -static __inline void -atomic_store_rel_64_i586(volatile uint64_t *p, uint64_t v) -{ - - __asm __volatile( - " movl %%eax,%%ebx ; " - " movl %%edx,%%ecx ; " - "1: " - " " MPLOCKED " " - " cmpxchg8b %0 ; " - " jne 1b" - : "+m" (*p), /* 0 */ - "+A" (v) /* 1 */ - : : "ebx", "ecx", "memory", "cc"); -} - -#endif /* _KERNEL && !WANT_FUNCTIONS */ - /* * Atomic compare and set, used by the mutex functions * @@ -343,6 +274,108 @@ struct __hack #endif /* _KERNEL && !SMP */ +#ifdef _KERNEL + +#ifdef WANT_FUNCTIONS +uint64_t atomic_load_acq_64_i386(volatile uint64_t *); +uint64_t atomic_load_acq_64_i586(volatile uint64_t *); +void atomic_store_rel_64_i386(volatile uint64_t *, uint64_t); +void atomic_store_rel_64_i586(volatile uint64_t *, uint64_t); +#endif + +/* I486 does not support SMP or CMPXCHG8B. */ +static __inline uint64_t +atomic_load_acq_64_i386(volatile uint64_t *p) +{ + volatile uint32_t *q; + uint64_t res; + + q = (volatile uint32_t *)p; + __asm __volatile( + " pushfl ; " + " cli ; " + " movl %1,%%eax ; " + " movl %2,%%edx ; " + " popfl" + : "=&A" (res) /* 0 */ + : "m" (*q), /* 1 */ + "m" (*(q + 1)) /* 2 */ + : "memory"); + return (res); +} + +static __inline void +atomic_store_rel_64_i386(volatile uint64_t *p, uint64_t v) +{ + volatile uint32_t *q; + + q = (volatile uint32_t *)p; + __asm __volatile( + " pushfl ; " + " cli ; " + " movl %%eax,%0 ; " + " movl %%edx,%1 ; " + " popfl" + : "=m" (*q), /* 0 */ + "=m" (*(q + 1)) /* 1 */ + : "A" (v) /* 2 */ + : "memory"); +} + +static __inline uint64_t +atomic_load_acq_64_i586(volatile uint64_t *p) +{ + uint64_t res; + + __asm __volatile( + " movl %%ebx,%%eax ; " + " movl %%ecx,%%edx ; " + " " MPLOCKED " " + " cmpxchg8b %1" + : "=&A" (res), /* 0 */ + "+m" (*p) /* 1 */ + : : "memory", "cc"); + return (res); +} + +static __inline void +atomic_store_rel_64_i586(volatile uint64_t *p, uint64_t v) +{ + + __asm __volatile( + " movl %%eax,%%ebx ; " + " movl %%edx,%%ecx ; " + "1: " + " " MPLOCKED " " + " cmpxchg8b %0 ; " + " jne 1b" + : "+m" (*p), /* 0 */ + "+A" (v) /* 1 */ + : : "ebx", "ecx", "memory", "cc"); +} + +static __inline uint64_t +atomic_load_acq_64(volatile uint64_t *p) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + return (atomic_load_acq_64_i386(p)); + else + return (atomic_load_acq_64_i586(p)); +} + +static __inline void +atomic_store_rel_64(volatile uint64_t *p, uint64_t v) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + atomic_store_rel_64_i386(p, v); + else + atomic_store_rel_64_i586(p, v); +} + +#endif /* _KERNEL */ + #endif /* KLD_MODULE || !__GNUCLIKE_ASM */ ATOMIC_ASM(set, char, "orb %b1,%0", "iq", v); @@ -381,11 +414,6 @@ ATOMIC_STORE(long); #ifndef WANT_FUNCTIONS -#ifdef _KERNEL -extern uint64_t (*atomic_load_acq_64)(volatile uint64_t *); -extern void (*atomic_store_rel_64)(volatile uint64_t *, uint64_t); -#endif - static __inline int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src) { From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:30:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B6D767AA; Wed, 21 Aug 2013 22:30:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A42A12318; Wed, 21 Aug 2013 22:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMUBi7039084; Wed, 21 Aug 2013 22:30:11 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMUBxc039083; Wed, 21 Aug 2013 22:30:11 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212230.r7LMUBxc039083@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 22:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254620 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:30:11 -0000 Author: jkim Date: Wed Aug 21 22:30:11 2013 New Revision: 254620 URL: http://svnweb.freebsd.org/changeset/base/254620 Log: Implement atomic_cmpset_64() and atomic_swap_64() for i386. Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Wed Aug 21 22:27:42 2013 (r254619) +++ head/sys/i386/include/atomic.h Wed Aug 21 22:30:11 2013 (r254620) @@ -92,8 +92,10 @@ u_##TYPE atomic_load_acq_##TYPE(volatile #define ATOMIC_STORE(TYPE) \ void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) +int atomic_cmpset_64(volatile uint64_t *, uint64_t, uint64_t); uint64_t atomic_load_acq_64(volatile uint64_t *); void atomic_store_rel_64(volatile uint64_t *, uint64_t); +uint64_t atomic_swap_64(volatile uint64_t *, uint64_t); #else /* !KLD_MODULE && __GNUCLIKE_ASM */ @@ -277,13 +279,46 @@ struct __hack #ifdef _KERNEL #ifdef WANT_FUNCTIONS +int atomic_cmpset_64_i386(volatile uint64_t *, uint64_t, uint64_t); +int atomic_cmpset_64_i586(volatile uint64_t *, uint64_t, uint64_t); uint64_t atomic_load_acq_64_i386(volatile uint64_t *); uint64_t atomic_load_acq_64_i586(volatile uint64_t *); void atomic_store_rel_64_i386(volatile uint64_t *, uint64_t); void atomic_store_rel_64_i586(volatile uint64_t *, uint64_t); +uint64_t atomic_swap_64_i386(volatile uint64_t *, uint64_t); +uint64_t atomic_swap_64_i586(volatile uint64_t *, uint64_t); #endif /* I486 does not support SMP or CMPXCHG8B. */ +static __inline int +atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t expect, uint64_t src) +{ + volatile uint32_t *p; + u_char res; + + p = (volatile uint32_t *)dst; + __asm __volatile( + " pushfl ; " + " cli ; " + " xorl %1,%%eax ; " + " xorl %2,%%edx ; " + " orl %%edx,%%eax ; " + " jne 1f ; " + " movl %4,%1 ; " + " movl %5,%2 ; " + "1: " + " sete %3 ; " + " popfl" + : "+A" (expect), /* 0 */ + "+m" (*p), /* 1 */ + "+m" (*(p + 1)), /* 2 */ + "=q" (res) /* 3 */ + : "r" ((uint32_t)src), /* 4 */ + "r" ((uint32_t)(src >> 32)) /* 5 */ + : "memory", "cc"); + return (res); +} + static __inline uint64_t atomic_load_acq_64_i386(volatile uint64_t *p) { @@ -323,6 +358,47 @@ atomic_store_rel_64_i386(volatile uint64 } static __inline uint64_t +atomic_swap_64_i386(volatile uint64_t *p, uint64_t v) +{ + volatile uint32_t *q; + uint64_t res; + + q = (volatile uint32_t *)p; + __asm __volatile( + " pushfl ; " + " cli ; " + " movl %1,%%eax ; " + " movl %2,%%edx ; " + " movl %4,%2 ; " + " movl %3,%1 ; " + " popfl" + : "=&A" (res), /* 0 */ + "+m" (*q), /* 1 */ + "+m" (*(q + 1)) /* 2 */ + : "r" ((uint32_t)v), /* 3 */ + "r" ((uint32_t)(v >> 32))); /* 4 */ + return (res); +} + +static __inline int +atomic_cmpset_64_i586(volatile uint64_t *dst, uint64_t expect, uint64_t src) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " cmpxchg8b %1 ; " + " sete %0" + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+A" (expect) /* 2 */ + : "b" ((uint32_t)src), /* 3 */ + "c" ((uint32_t)(src >> 32)) /* 4 */ + : "memory", "cc"); + return (res); +} + +static __inline uint64_t atomic_load_acq_64_i586(volatile uint64_t *p) { uint64_t res; @@ -355,6 +431,33 @@ atomic_store_rel_64_i586(volatile uint64 } static __inline uint64_t +atomic_swap_64_i586(volatile uint64_t *p, uint64_t v) +{ + + __asm __volatile( + " movl %%eax,%%ebx ; " + " movl %%edx,%%ecx ; " + "1: " + " " MPLOCKED " " + " cmpxchg8b %0 ; " + " jne 1b" + : "+m" (*p), /* 0 */ + "+A" (v) /* 1 */ + : : "ebx", "ecx", "memory", "cc"); + return (v); +} + +static __inline int +atomic_cmpset_64(volatile uint64_t *dst, uint64_t expect, uint64_t src) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + return (atomic_cmpset_64_i386(dst, expect, src)); + else + return (atomic_cmpset_64_i586(dst, expect, src)); +} + +static __inline uint64_t atomic_load_acq_64(volatile uint64_t *p) { @@ -374,6 +477,16 @@ atomic_store_rel_64(volatile uint64_t *p atomic_store_rel_64_i586(p, v); } +static __inline uint64_t +atomic_swap_64(volatile uint64_t *p, uint64_t v) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + return (atomic_swap_64_i386(p, v)); + else + return (atomic_swap_64_i586(p, v)); +} + #endif /* _KERNEL */ #endif /* KLD_MODULE || !__GNUCLIKE_ASM */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:37:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 83A8097F; Wed, 21 Aug 2013 22:37:16 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70AAB237A; Wed, 21 Aug 2013 22:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMbGvo043083; Wed, 21 Aug 2013 22:37:16 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMbG8W043082; Wed, 21 Aug 2013 22:37:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201308212237.r7LMbG8W043082@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 21 Aug 2013 22:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254621 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:37:16 -0000 Author: pluknet Date: Wed Aug 21 22:37:15 2013 New Revision: 254621 URL: http://svnweb.freebsd.org/changeset/base/254621 Log: Reset errno before strtoumax() call to properly detect ERANGE. Restore saved errno if strtoumax() call is successful. Reported by: ache Reviewed by: jilles MFC after: 1 week Modified: head/lib/libutil/expand_number.c Modified: head/lib/libutil/expand_number.c ============================================================================== --- head/lib/libutil/expand_number.c Wed Aug 21 22:30:11 2013 (r254620) +++ head/lib/libutil/expand_number.c Wed Aug 21 22:37:15 2013 (r254621) @@ -50,15 +50,22 @@ int expand_number(const char *buf, uint64_t *num) { uint64_t number; + int saved_errno; unsigned shift; char *endptr; + saved_errno = errno; + errno = 0; + number = strtoumax(buf, &endptr, 0); if (number == UINTMAX_MAX && errno == ERANGE) { return (-1); } + if (errno == 0) + errno = saved_errno; + if (endptr == buf) { /* No valid digits. */ errno = EINVAL; From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:39:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 996E5BA1; Wed, 21 Aug 2013 22:39:20 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C0E2239C; Wed, 21 Aug 2013 22:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMdKqo043769; Wed, 21 Aug 2013 22:39:20 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMdK96043768; Wed, 21 Aug 2013 22:39:20 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201308212239.r7LMdK96043768@svn.freebsd.org> From: Jeff Roberson Date: Wed, 21 Aug 2013 22:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254622 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:39:20 -0000 Author: jeff Date: Wed Aug 21 22:39:19 2013 New Revision: 254622 URL: http://svnweb.freebsd.org/changeset/base/254622 Log: - Eliminate the vm object lock from the active queue scan. It is not necessary since we do not free or cache the page from active anymore. Document the one possible race that is harmless. Sponsored by: EMC / Isilon Storage Division Discussed with: alc Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Aug 21 22:37:15 2013 (r254621) +++ head/sys/vm/vm_pageout.c Wed Aug 21 22:39:19 2013 (r254622) @@ -1333,25 +1333,6 @@ relock_queues: m = next; continue; } - object = m->object; - if (!VM_OBJECT_TRYWLOCK(object) && - !vm_pageout_fallback_object_lock(m, &next)) { - VM_OBJECT_WUNLOCK(object); - vm_page_unlock(m); - m = next; - continue; - } - - /* - * Don't deactivate pages that are busy. - */ - if (vm_page_busied(m) || m->hold_count != 0) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); - vm_page_requeue_locked(m); - m = next; - continue; - } /* * The count for pagedaemon pages is done after checking the @@ -1367,7 +1348,15 @@ relock_queues: vm_page_aflag_clear(m, PGA_REFERENCED); act_delta += 1; } - if (object->ref_count != 0) + /* + * Unlocked object ref count check. Two races are possible. + * 1) The ref was transitioning to zero and we saw non-zero, + * the pmap bits will be checked unnecessarily. + * 2) The ref was transitioning to one and we saw zero. + * The page lock prevents a new reference to this page so + * we need not check the reference bits. + */ + if (m->object->ref_count != 0) act_delta += pmap_ts_referenced(m); /* @@ -1387,9 +1376,6 @@ relock_queues: * queue depending on usage. */ if (act_delta == 0) { - KASSERT(object->ref_count != 0 || - !pmap_page_is_mapped(m), - ("vm_pageout_scan: page %p is mapped", m)); /* Dequeue to avoid later lock recursion. */ vm_page_dequeue_locked(m); vm_page_deactivate(m); @@ -1397,7 +1383,6 @@ relock_queues: } else vm_page_requeue_locked(m); vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); m = next; } vm_pagequeue_unlock(pq); From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:40:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5800ADB2; Wed, 21 Aug 2013 22:40:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 44C1823E1; Wed, 21 Aug 2013 22:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMeUvh044125; Wed, 21 Aug 2013 22:40:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMeT19044122; Wed, 21 Aug 2013 22:40:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308212240.r7LMeT19044122@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 21 Aug 2013 22:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254623 - in head/sys: amd64/include i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:40:30 -0000 Author: jkim Date: Wed Aug 21 22:40:29 2013 New Revision: 254623 URL: http://svnweb.freebsd.org/changeset/base/254623 Log: Reimplement atomic operations on PDEs and PTEs in pmap.h. This change significantly reduces duplicate code and make it easier to read. Reviewed by: alc, bde Modified: head/sys/amd64/include/pmap.h head/sys/i386/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Wed Aug 21 22:39:19 2013 (r254622) +++ head/sys/amd64/include/pmap.h Wed Aug 21 22:40:29 2013 (r254623) @@ -206,41 +206,14 @@ extern u_int64_t KPML4phys; /* physical pt_entry_t *vtopte(vm_offset_t); #define vtophys(va) pmap_kextract(((vm_offset_t) (va))) -static __inline pt_entry_t -pte_load(pt_entry_t *ptep) -{ - pt_entry_t r; - - r = *ptep; - return (r); -} - -static __inline pt_entry_t -pte_load_store(pt_entry_t *ptep, pt_entry_t pte) -{ - pt_entry_t r; - - __asm __volatile( - "xchgq %0,%1" - : "=m" (*ptep), - "=r" (r) - : "1" (pte), - "m" (*ptep)); - return (r); -} - -#define pte_load_clear(pte) atomic_readandclear_long(pte) - -static __inline void -pte_store(pt_entry_t *ptep, pt_entry_t pte) -{ +#define pte_load_store(ptep, pte) atomic_swap_long(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_long(ptep, 0) +#define pte_store(ptep, pte) do { \ + *(u_long *)(ptep) = (u_long)(pte); \ +} while (0) +#define pte_clear(ptep) pte_store(ptep, 0) - *ptep = pte; -} - -#define pte_clear(ptep) pte_store((ptep), (pt_entry_t)0ULL) - -#define pde_store(pdep, pde) pte_store((pdep), (pde)) +#define pde_store(pdep, pde) pte_store(pdep, pde) extern pt_entry_t pg_nx; Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Wed Aug 21 22:39:19 2013 (r254622) +++ head/sys/i386/include/pmap.h Wed Aug 21 22:40:29 2013 (r254623) @@ -326,98 +326,27 @@ pmap_kextract(vm_offset_t va) #if defined(PAE) && !defined(XEN) -#define pde_cmpset(pdep, old, new) \ - atomic_cmpset_64((pdep), (old), (new)) - -static __inline pt_entry_t -pte_load(pt_entry_t *ptep) -{ - pt_entry_t r; - - __asm __volatile( - "lock; cmpxchg8b %1" - : "=A" (r) - : "m" (*ptep), "a" (0), "d" (0), "b" (0), "c" (0)); - return (r); -} - -static __inline pt_entry_t -pte_load_store(pt_entry_t *ptep, pt_entry_t v) -{ - pt_entry_t r; - - r = *ptep; - __asm __volatile( - "1:\n" - "\tlock; cmpxchg8b %1\n" - "\tjnz 1b" - : "+A" (r) - : "m" (*ptep), "b" ((uint32_t)v), "c" ((uint32_t)(v >> 32))); - return (r); -} - -/* XXXRU move to atomic.h? */ -static __inline int -atomic_cmpset_64(volatile uint64_t *dst, uint64_t exp, uint64_t src) -{ - int64_t res = exp; - - __asm __volatile ( - " lock ; " - " cmpxchg8b %2 ; " - " setz %%al ; " - " movzbl %%al,%0 ; " - "# atomic_cmpset_64" - : "+A" (res), /* 0 (result) */ - "=m" (*dst) /* 1 */ - : "m" (*dst), /* 2 */ - "b" ((uint32_t)src), - "c" ((uint32_t)(src >> 32))); - - return (res); -} - -#define pte_load_clear(ptep) pte_load_store((ptep), (pt_entry_t)0ULL) - -#define pte_store(ptep, pte) pte_load_store((ptep), (pt_entry_t)pte) +#define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new) +#define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_64_i586(ptep, 0) +#define pte_store(ptep, pte) atomic_store_rel_64_i586(ptep, pte) extern pt_entry_t pg_nx; -#elif !defined(PAE) && !defined (XEN) - -#define pde_cmpset(pdep, old, new) \ - atomic_cmpset_int((pdep), (old), (new)) - -static __inline pt_entry_t -pte_load(pt_entry_t *ptep) -{ - pt_entry_t r; - - r = *ptep; - return (r); -} - -static __inline pt_entry_t -pte_load_store(pt_entry_t *ptep, pt_entry_t pte) -{ - __asm volatile("xchgl %0, %1" : "+m" (*ptep), "+r" (pte)); - return (pte); -} - -#define pte_load_clear(pte) atomic_readandclear_int(pte) - -static __inline void -pte_store(pt_entry_t *ptep, pt_entry_t pte) -{ +#elif !defined(PAE) && !defined(XEN) - *ptep = pte; -} +#define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new) +#define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_int(ptep, 0) +#define pte_store(ptep, pte) do { \ + *(u_int *)(ptep) = (u_int)(pte); \ +} while (0) #endif /* PAE */ -#define pte_clear(ptep) pte_store((ptep), (pt_entry_t)0ULL) +#define pte_clear(ptep) pte_store(ptep, 0) -#define pde_store(pdep, pde) pte_store((pdep), (pde)) +#define pde_store(pdep, pde) pte_store(pdep, pde) #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:43:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9B8D3F31; Wed, 21 Aug 2013 22:43:31 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7833823FF; Wed, 21 Aug 2013 22:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMhV3f046913; Wed, 21 Aug 2013 22:43:31 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMhUx8046903; Wed, 21 Aug 2013 22:43:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201308212243.r7LMhUx8046903@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 21 Aug 2013 22:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254624 - in head: . sys/amd64/conf sys/conf sys/i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:43:31 -0000 Author: obrien Date: Wed Aug 21 22:43:29 2013 New Revision: 254624 URL: http://svnweb.freebsd.org/changeset/base/254624 Log: The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. Thus "device padlock_rng" and "device rdrand_rng" should be used instead of "options PADLOCK_RNG" & "options RDRAND_RNG". Requested by: so@ (des) Submitted by: obrien, arthurmesh@gmail.com Obtained from: Juniper Networks Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 21 22:40:29 2013 (r254623) +++ head/UPDATING Wed Aug 21 22:43:29 2013 (r254624) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130821: + The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. + Thus "device padlock_rng" and "device rdrand_rng" should be + used instead of "options PADLOCK_RNG" & "options RDRAND_RNG". + 20130813: WITH_ICONV has been split into two feature sets. WITH_ICONV now enables just the iconv* functionality and is now on by default. @@ -340,9 +345,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 20120913: The random(4) support for the VIA hardware random number generator (`PADLOCK') is no longer enabled unconditionally. - Add the PADLOCK_RNG option in the custom kernel config if + Add the padlock_rng device in the custom kernel config if needed. The GENERIC kernels on i386 and amd64 do include the - option, so the change only affects the custom kernel + device, so the change only affects the custom kernel configurations. 20120908: Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Aug 21 22:40:29 2013 (r254623) +++ head/sys/amd64/conf/GENERIC Wed Aug 21 22:43:29 2013 (r254624) @@ -293,8 +293,8 @@ device wpi # Intel 3945ABG wireless NI # Pseudo devices. device loop # Network loopback device random # Entropy device -options PADLOCK_RNG # VIA Padlock RNG -options RDRAND_RNG # Intel Bull Mountain RNG +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Aug 21 22:40:29 2013 (r254623) +++ head/sys/amd64/conf/NOTES Wed Aug 21 22:43:29 2013 (r254624) @@ -496,6 +496,8 @@ device vpd device asmc #device si device tpm +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG # # Laptop/Notebook options: Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Wed Aug 21 22:40:29 2013 (r254623) +++ head/sys/conf/options.amd64 Wed Aug 21 22:43:29 2013 (r254624) @@ -68,7 +68,3 @@ XENHVM opt_global.h # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h - -# hw random number generators for random(4) -PADLOCK_RNG opt_cpu.h -RDRAND_RNG opt_cpu.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Wed Aug 21 22:40:29 2013 (r254623) +++ head/sys/conf/options.i386 Wed Aug 21 22:43:29 2013 (r254624) @@ -123,7 +123,3 @@ XENHVM opt_global.h # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h - -# hw random number generators for random(4) -PADLOCK_RNG opt_cpu.h -RDRAND_RNG opt_cpu.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Aug 21 22:40:29 2013 (r254623) +++ head/sys/i386/conf/GENERIC Wed Aug 21 22:43:29 2013 (r254624) @@ -307,8 +307,8 @@ device wpi # Intel 3945ABG wireless NI # Pseudo devices. device loop # Network loopback device random # Entropy device -options PADLOCK_RNG # VIA Padlock RNG -options RDRAND_RNG # Intel Bull Mountain RNG +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support device tun # Packet tunnel. Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Aug 21 22:40:29 2013 (r254623) +++ head/sys/i386/conf/NOTES Wed Aug 21 22:43:29 2013 (r254624) @@ -850,6 +850,8 @@ hint.spic.0.port="0x10a0" device asmc #device si device tpm +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG # # Laptop/Notebook options: From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 22:57:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 79F3142D; Wed, 21 Aug 2013 22:57:30 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6693324B6; Wed, 21 Aug 2013 22:57:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMvU7b053609; Wed, 21 Aug 2013 22:57:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMvUmY053608; Wed, 21 Aug 2013 22:57:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201308212257.r7LMvUmY053608@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 21 Aug 2013 22:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254626 - stable/9/usr.bin/yacc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 22:57:30 -0000 Author: obrien Date: Wed Aug 21 22:57:29 2013 New Revision: 254626 URL: http://svnweb.freebsd.org/changeset/base/254626 Log: Provide a prototype for yyparse() so that "-Werror" along with stringent -W* warnings can be used on byacc's output. Modified: stable/9/usr.bin/yacc/skeleton.c Modified: stable/9/usr.bin/yacc/skeleton.c ============================================================================== --- stable/9/usr.bin/yacc/skeleton.c Wed Aug 21 22:55:10 2013 (r254625) +++ stable/9/usr.bin/yacc/skeleton.c Wed Aug 21 22:57:29 2013 (r254626) @@ -196,6 +196,10 @@ const char *body[] = "#endif /* ANSI-C/C++ */", "#endif /* ! YYPARSE_PARAM */", "", + "#if defined(__cplusplus) || __STDC__", + "extern int yyparse (YYPARSE_PARAM_ARG);", + "#endif /* ANSI-C/C++ */", + "", "int", "yyparse (YYPARSE_PARAM_ARG)", " YYPARSE_PARAM_DECL", From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 23:04:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6C8636C4; Wed, 21 Aug 2013 23:04:51 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 567352513; Wed, 21 Aug 2013 23:04:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LN4pa1058464; Wed, 21 Aug 2013 23:04:51 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LN4mr6058450; Wed, 21 Aug 2013 23:04:48 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201308212304.r7LN4mr6058450@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 21 Aug 2013 23:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs sys/fs/smbfs sys/sys sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 23:04:51 -0000 Author: ken Date: Wed Aug 21 23:04:48 2013 New Revision: 254627 URL: http://svnweb.freebsd.org/changeset/base/254627 Log: Expand the use of stat(2) flags to allow storing some Windows/DOS and CIFS file attributes as BSD stat(2) flags. This work is intended to be compatible with ZFS, the Solaris CIFS server's interaction with ZFS, somewhat compatible with MacOS X, and of course compatible with Windows. The Windows attributes that are implemented were chosen based on the attributes that ZFS already supports. The summary of the flags is as follows: UF_SYSTEM: Command line name: "system" or "usystem" ZFS name: XAT_SYSTEM, ZFS_SYSTEM Windows: FILE_ATTRIBUTE_SYSTEM This flag means that the file is used by the operating system. FreeBSD does not enforce any special handling when this flag is set. UF_SPARSE: Command line name: "sparse" or "usparse" ZFS name: XAT_SPARSE, ZFS_SPARSE Windows: FILE_ATTRIBUTE_SPARSE_FILE This flag means that the file is sparse. Although ZFS may modify this in some situations, there is not generally any special handling for this flag. UF_OFFLINE: Command line name: "offline" or "uoffline" ZFS name: XAT_OFFLINE, ZFS_OFFLINE Windows: FILE_ATTRIBUTE_OFFLINE This flag means that the file has been moved to offline storage. FreeBSD does not have any special handling for this flag. UF_REPARSE: Command line name: "reparse" or "ureparse" ZFS name: XAT_REPARSE, ZFS_REPARSE Windows: FILE_ATTRIBUTE_REPARSE_POINT This flag means that the file is a Windows reparse point. ZFS has special handling code for reparse points, but we don't currently have the other supporting infrastructure for them. UF_HIDDEN: Command line name: "hidden" or "uhidden" ZFS name: XAT_HIDDEN, ZFS_HIDDEN Windows: FILE_ATTRIBUTE_HIDDEN This flag means that the file may be excluded from a directory listing if the application honors it. FreeBSD has no special handling for this flag. The name and bit definition for UF_HIDDEN are identical to the definition in MacOS X. UF_READONLY: Command line name: "urdonly", "rdonly", "readonly" ZFS name: XAT_READONLY, ZFS_READONLY Windows: FILE_ATTRIBUTE_READONLY This flag means that the file may not written or appended, but its attributes may be changed. ZFS currently enforces this flag, but Illumos developers have discussed disabling enforcement. The behavior of this flag is different than MacOS X. MacOS X uses UF_IMMUTABLE to represent the DOS readonly permission, but that flag has a stronger meaning than the semantics of DOS readonly permissions. UF_ARCHIVE: Command line name: "uarch", "uarchive" ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE Windows name: FILE_ATTRIBUTE_ARCHIVE The UF_ARCHIVED flag means that the file has changed and needs to be archived. The meaning is same as the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute. msdosfs and ZFS have special handling for this flag. i.e. they will set it when the file changes. sys/param.h: Bump __FreeBSD_version to 1000047 for the addition of new stat(2) flags. chflags.1: Document the new command line flag names (e.g. "system", "hidden") available to the user. ls.1: Reference chflags(1) for a list of file flags and their meanings. strtofflags.c: Implement the mapping between the new command line flag names and new stat(2) flags. chflags.2: Document all of the new stat(2) flags, and explain the intended behavior in a little more detail. Explain how they map to Windows file attributes. Different filesystems behave differently with respect to flags, so warn the application developer to take care when using them. zfs_vnops.c: Add support for getting and setting the UF_ARCHIVE, UF_READONLY, UF_SYSTEM, UF_HIDDEN, UF_REPARSE, UF_OFFLINE, and UF_SPARSE flags. All of these flags are implemented using attributes that ZFS already supports, so the on-disk format has not changed. ZFS currently doesn't allow setting the UF_REPARSE flag, and we don't really have the other infrastructure to support reparse points. msdosfs_denode.c, msdosfs_vnops.c: Add support for getting and setting UF_HIDDEN, UF_SYSTEM and UF_READONLY in MSDOSFS. It supported SF_ARCHIVED, but this has been changed to be UF_ARCHIVE, which has the same semantics as the DOS archive attribute instead of inverse semantics like SF_ARCHIVED. After discussion with Bruce Evans, change several things in the msdosfs behavior: Use UF_READONLY to indicate whether a file is writeable instead of file permissions, but don't actually enforce it. Refuse to change attributes on the root directory, because it is special in FAT filesystems, but allow most other attribute changes on directories. Don't set the archive attribute on a directory when its modification time is updated. Windows and DOS don't set the archive attribute in that scenario, so we are now bug-for-bug compatible. smbfs_node.c, smbfs_vnops.c: Add support for UF_HIDDEN, UF_SYSTEM, UF_READONLY and UF_ARCHIVE in SMBFS. This is similar to changes that Apple has made in their version of SMBFS (as of smb-583.8, posted on opensource.apple.com), but not quite the same. We map SMB_FA_READONLY to UF_READONLY, because UF_READONLY is intended to match the semantics of the DOS readonly flag. The MacOS X code maps both UF_IMMUTABLE and SF_IMMUTABLE to SMB_FA_READONLY, but the immutable flags have stronger meaning than the DOS readonly bit. stat.h: Add definitions for UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY and UF_HIDDEN. The definition of UF_HIDDEN is the same as the MacOS X definition. Add commented-out definitions of UF_COMPRESSED and UF_TRACKED. They are defined in MacOS X (as of 10.8.2), but we do not implement them (yet). ufs_vnops.c: Add support for getting and setting UF_ARCHIVE, UF_HIDDEN, UF_OFFLINE, UF_READONLY, UF_REPARSE, UF_SPARSE, and UF_SYSTEM in UFS. Alphabetize the flags that are supported. These new flags are only stored, UFS does not take any action if the flag is set. Sponsored by: Spectra Logic Reviewed by: bde (earlier version) Modified: head/bin/chflags/chflags.1 head/bin/ls/ls.1 head/lib/libc/gen/strtofflags.c head/lib/libc/sys/chflags.2 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/sys/param.h head/sys/sys/stat.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/bin/chflags/chflags.1 ============================================================================== --- head/bin/chflags/chflags.1 Wed Aug 21 22:57:29 2013 (r254626) +++ head/bin/chflags/chflags.1 Wed Aug 21 23:04:48 2013 (r254627) @@ -32,7 +32,7 @@ .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 3, 2006 +.Dd April 8, 2013 .Dt CHFLAGS 1 .Os .Sh NAME @@ -101,20 +101,36 @@ The following keywords are currently def .Bl -tag -offset indent -width ".Cm opaque" .It Cm arch , archived set the archived flag (super-user only) -.It Cm opaque -set the opaque flag (owner or super-user only) .It Cm nodump set the nodump flag (owner or super-user only) +.It Cm opaque +set the opaque flag (owner or super-user only) .It Cm sappnd , sappend set the system append-only flag (super-user only) .It Cm schg , schange , simmutable set the system immutable flag (super-user only) +.It Cm snapshot +set the snapshot flag (filesystems do not allow changing this flag) .It Cm sunlnk , sunlink set the system undeletable flag (super-user only) .It Cm uappnd , uappend set the user append-only flag (owner or super-user only) +.It Cm uarch , uarchive +set the archive flag (owner or super-user only) .It Cm uchg , uchange , uimmutable set the user immutable flag (owner or super-user only) +.It Cm uhidden , hidden +set the hidden file attribute (owner or super-user only) +.It Cm uoffline , offline +set the offline file attribute (owner or super-user only) +.It Cm urdonly , rdonly , readonly +set the DOS, Windows and CIFS readonly flag (owner or super-user only) +.It Cm usparse , sparse +set the sparse file attribute (owner or super-user only) +.It Cm usystem , system +set the DOS, Windows and CIFS system flag (owner or super-user only) +.It Cm ureparse , reparse +set the Windows reparse point file attribute (owner or super-user only) .It Cm uunlnk , uunlink set the user undeletable flag (owner or super-user only) .El Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Wed Aug 21 22:57:29 2013 (r254626) +++ head/bin/ls/ls.1 Wed Aug 21 23:04:48 2013 (r254627) @@ -232,6 +232,9 @@ output. Include the file flags in a long .Pq Fl l output. +See +.Xr chflags 1 +for a list of file flags and their meanings. .It Fl p Write a slash .Pq Ql / Modified: head/lib/libc/gen/strtofflags.c ============================================================================== --- head/lib/libc/gen/strtofflags.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/lib/libc/gen/strtofflags.c Wed Aug 21 23:04:48 2013 (r254627) @@ -62,13 +62,29 @@ static struct { #endif { "nouappnd", 0, UF_APPEND }, { "nouappend", 0, UF_APPEND }, + { "nouarch", 0, UF_ARCHIVE }, + { "nouarchive", 0, UF_ARCHIVE }, + { "nohidden", 0, UF_HIDDEN }, + { "nouhidden", 0, UF_HIDDEN }, { "nouchg", 0, UF_IMMUTABLE }, { "nouchange", 0, UF_IMMUTABLE }, { "nouimmutable", 0, UF_IMMUTABLE }, { "nodump", 1, UF_NODUMP }, - { "noopaque", 0, UF_OPAQUE }, { "nouunlnk", 0, UF_NOUNLINK }, - { "nouunlink", 0, UF_NOUNLINK } + { "nouunlink", 0, UF_NOUNLINK }, + { "nooffline", 0, UF_OFFLINE }, + { "nouoffline", 0, UF_OFFLINE }, + { "noopaque", 0, UF_OPAQUE }, + { "nordonly", 0, UF_READONLY }, + { "nourdonly", 0, UF_READONLY }, + { "noreadonly", 0, UF_READONLY }, + { "noureadonly", 0, UF_READONLY }, + { "noreparse", 0, UF_REPARSE }, + { "noureparse", 0, UF_REPARSE }, + { "nosparse", 0, UF_SPARSE }, + { "nousparse", 0, UF_SPARSE }, + { "nosystem", 0, UF_SYSTEM }, + { "nousystem", 0, UF_SYSTEM } }; #define nmappings (sizeof(mapping) / sizeof(mapping[0])) Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Wed Aug 21 22:57:29 2013 (r254626) +++ head/lib/libc/sys/chflags.2 Wed Aug 21 23:04:48 2013 (r254627) @@ -112,26 +112,61 @@ The flags specified are formed by the following values .Pp .Bl -tag -width ".Dv SF_IMMUTABLE" -compact -offset indent -.It Dv UF_NODUMP -Do not dump the file. -.It Dv UF_IMMUTABLE -The file may not be changed. -.It Dv UF_APPEND +.It Dv SF_APPEND The file may only be appended to. -.It Dv UF_NOUNLINK -The file may not be renamed or deleted. -.It Dv UF_OPAQUE -The directory is opaque when viewed through a union stack. .It Dv SF_ARCHIVED -The file may be archived. +The file has been archived. +This flag means the opposite of the DOS, Windows and CIFS +FILE_ATTRIBUTE_ARCHIVE attribute. +This flag has been deprecated, and may be removed in a future release. .It Dv SF_IMMUTABLE The file may not be changed. -.It Dv SF_APPEND -The file may only be appended to. .It Dv SF_NOUNLINK The file may not be renamed or deleted. .It Dv SF_SNAPSHOT The file is a snapshot file. +.It Dv UF_APPEND +The file may only be appended to. +.It Dv UF_ARCHIVE +The file needs to be archived. +This flag has the same meaning as the DOS, Windows and CIFS +FILE_ATTRIBUTE_ARCHIVE attribute. +Filesystems in FreeBSD may or may not have special handling for this flag. +For instance, ZFS tracks changes to files and will set this bit when a +file is updated. +UFS only stores the flag, and relies on the application to change it when +needed. +.It Dv UF_HIDDEN +The file may be hidden from directory listings at the application's +discretion. +The file has the DOS, Windows and CIFS FILE_ATTRIBUTE_HIDDEN attribute. +.It Dv UF_IMMUTABLE +The file may not be changed. +.It Dv UF_NODUMP +Do not dump the file. +.It Dv UF_NOUNLINK +The file may not be renamed or deleted. +.It Dv UF_OFFLINE +The file is offline, or has the Windows and CIFS FILE_ATTRIBUTE_OFFLINE +attribute. +Filesystems in FreeBSD store and display this flag, but do not provide any +special handling when it is set. +.It Dv UF_OPAQUE +The directory is opaque when viewed through a union stack. +.It Dv UF_READONLY +The file is read only, and may not be written or appended. +Filesystems may use this flag to maintain compatibility with the DOS, Windows +and CIFS FILE_ATTRIBUTE_READONLY attribute. +.It Dv UF_REPARSE +The file contains a Windows reparse point and has the Windows and CIFS +FILE_ATTRIBUTE_REPARSE_POINT attribute. +.It Dv UF_SPARSE +The file has the Windows FILE_ATTRIBUTE_SPARSE_FILE attribute. +This may also be used by a filesystem to indicate a sparse file. +.It Dv UF_SYSTEM +The file has the DOS, Windows and CIFS FILE_ATTRIBUTE_SYSTEM attribute. +Filesystems in FreeBSD may store and display this flag, but do not provide +any special handling when it is set. .El .Pp If one of @@ -162,6 +197,13 @@ the system is in single-user mode. .Xr init 8 for details.) .Pp +The implementation of all flags is filesystem-dependent. +See the description of the +.Dv UF_ARCHIVE +flag above for one example of the differences in behavior. +Care should be exercised when writing applications to account for +support or lack of support of these flags in various filesystems. +.Pp The .Dv SF_SNAPSHOT flag is maintained by the system and cannot be toggled. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 21 23:04:48 2013 (r254627) @@ -6071,6 +6071,14 @@ zfs_freebsd_getattr(ap) XVA_SET_REQ(&xvap, XAT_APPENDONLY); XVA_SET_REQ(&xvap, XAT_NOUNLINK); XVA_SET_REQ(&xvap, XAT_NODUMP); + XVA_SET_REQ(&xvap, XAT_READONLY); + XVA_SET_REQ(&xvap, XAT_ARCHIVE); + XVA_SET_REQ(&xvap, XAT_SYSTEM); + XVA_SET_REQ(&xvap, XAT_HIDDEN); + XVA_SET_REQ(&xvap, XAT_REPARSE); + XVA_SET_REQ(&xvap, XAT_OFFLINE); + XVA_SET_REQ(&xvap, XAT_SPARSE); + error = zfs_getattr(ap->a_vp, (vattr_t *)&xvap, 0, ap->a_cred, NULL); if (error != 0) return (error); @@ -6086,8 +6094,23 @@ zfs_freebsd_getattr(ap) xvap.xva_xoptattrs.xoa_appendonly); FLAG_CHECK(SF_NOUNLINK, XAT_NOUNLINK, xvap.xva_xoptattrs.xoa_nounlink); + FLAG_CHECK(UF_ARCHIVE, XAT_ARCHIVE, + xvap.xva_xoptattrs.xoa_archive); FLAG_CHECK(UF_NODUMP, XAT_NODUMP, xvap.xva_xoptattrs.xoa_nodump); + FLAG_CHECK(UF_READONLY, XAT_READONLY, + xvap.xva_xoptattrs.xoa_readonly); + FLAG_CHECK(UF_SYSTEM, XAT_SYSTEM, + xvap.xva_xoptattrs.xoa_system); + FLAG_CHECK(UF_HIDDEN, XAT_HIDDEN, + xvap.xva_xoptattrs.xoa_hidden); + FLAG_CHECK(UF_REPARSE, XAT_REPARSE, + xvap.xva_xoptattrs.xoa_reparse); + FLAG_CHECK(UF_OFFLINE, XAT_OFFLINE, + xvap.xva_xoptattrs.xoa_offline); + FLAG_CHECK(UF_SPARSE, XAT_SPARSE, + xvap.xva_xoptattrs.xoa_sparse); + #undef FLAG_CHECK *vap = xvap.xva_vattr; vap->va_flags = fflags; @@ -6125,7 +6148,16 @@ zfs_freebsd_setattr(ap) return (EOPNOTSUPP); fflags = vap->va_flags; - if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_NODUMP)) != 0) + /* + * XXX KDM + * We need to figure out whether it makes sense to allow + * UF_REPARSE through, since we don't really have other + * facilities to handle reparse points and zfs_setattr() + * doesn't currently allow setting that attribute anyway. + */ + if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_ARCHIVE| + UF_NODUMP|UF_SYSTEM|UF_HIDDEN|UF_READONLY|UF_REPARSE| + UF_OFFLINE|UF_SPARSE)) != 0) return (EOPNOTSUPP); /* * Unprivileged processes are not permitted to unset system @@ -6177,8 +6209,22 @@ zfs_freebsd_setattr(ap) xvap.xva_xoptattrs.xoa_appendonly); FLAG_CHANGE(SF_NOUNLINK, ZFS_NOUNLINK, XAT_NOUNLINK, xvap.xva_xoptattrs.xoa_nounlink); + FLAG_CHANGE(UF_ARCHIVE, ZFS_ARCHIVE, XAT_ARCHIVE, + xvap.xva_xoptattrs.xoa_archive); FLAG_CHANGE(UF_NODUMP, ZFS_NODUMP, XAT_NODUMP, xvap.xva_xoptattrs.xoa_nodump); + FLAG_CHANGE(UF_READONLY, ZFS_READONLY, XAT_READONLY, + xvap.xva_xoptattrs.xoa_readonly); + FLAG_CHANGE(UF_SYSTEM, ZFS_SYSTEM, XAT_SYSTEM, + xvap.xva_xoptattrs.xoa_system); + FLAG_CHANGE(UF_HIDDEN, ZFS_HIDDEN, XAT_HIDDEN, + xvap.xva_xoptattrs.xoa_hidden); + FLAG_CHANGE(UF_REPARSE, ZFS_REPARSE, XAT_REPARSE, + xvap.xva_xoptattrs.xoa_hidden); + FLAG_CHANGE(UF_OFFLINE, ZFS_OFFLINE, XAT_OFFLINE, + xvap.xva_xoptattrs.xoa_offline); + FLAG_CHANGE(UF_SPARSE, ZFS_SPARSE, XAT_SPARSE, + xvap.xva_xoptattrs.xoa_sparse); #undef FLAG_CHANGE } return (zfs_setattr(vp, (vattr_t *)&xvap, 0, cred, NULL)); Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/fs/msdosfs/msdosfs_denode.c Wed Aug 21 23:04:48 2013 (r254627) @@ -304,8 +304,8 @@ deupdat(dep, waitfor) if ((dep->de_flag & DE_MODIFIED) == 0 && waitfor == 0) return (0); dep->de_flag &= ~DE_MODIFIED; - if (dep->de_Attributes & ATTR_DIRECTORY) - return (0); + if (DETOV(dep)->v_vflag & VV_ROOT) + return (EINVAL); if (dep->de_refcnt <= 0) return (0); error = readde(dep, &bp, &dirp); Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Wed Aug 21 23:04:48 2013 (r254627) @@ -172,8 +172,7 @@ msdosfs_create(ap) if (error) goto bad; - ndirent.de_Attributes = (ap->a_vap->va_mode & VWRITE) ? - ATTR_ARCHIVE : ATTR_ARCHIVE | ATTR_READONLY; + ndirent.de_Attributes = ATTR_ARCHIVE; ndirent.de_LowerCase = 0; ndirent.de_StartCluster = 0; ndirent.de_FileSize = 0; @@ -256,8 +255,7 @@ msdosfs_access(ap) mode_t file_mode; accmode_t accmode = ap->a_accmode; - file_mode = (S_IXUSR|S_IXGRP|S_IXOTH) | (S_IRUSR|S_IRGRP|S_IROTH) | - ((dep->de_Attributes & ATTR_READONLY) ? 0 : (S_IWUSR|S_IWGRP|S_IWOTH)); + file_mode = S_IRWXU|S_IRWXG|S_IRWXO; file_mode &= (vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); /* @@ -266,8 +264,8 @@ msdosfs_access(ap) */ if (accmode & VWRITE) { switch (vp->v_type) { - case VDIR: case VREG: + case VDIR: if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); break; @@ -322,10 +320,7 @@ msdosfs_getattr(ap) else vap->va_fileid = (long)fileid; - if ((dep->de_Attributes & ATTR_READONLY) == 0) - mode = S_IRWXU|S_IRWXG|S_IRWXO; - else - mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; + mode = S_IRWXU|S_IRWXG|S_IRWXO; vap->va_mode = mode & (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); vap->va_uid = pmp->pm_uid; @@ -345,8 +340,14 @@ msdosfs_getattr(ap) vap->va_birthtime.tv_nsec = 0; } vap->va_flags = 0; - if ((dep->de_Attributes & ATTR_ARCHIVE) == 0) - vap->va_flags |= SF_ARCHIVED; + if (dep->de_Attributes & ATTR_ARCHIVE) + vap->va_flags |= UF_ARCHIVE; + if (dep->de_Attributes & ATTR_HIDDEN) + vap->va_flags |= UF_HIDDEN; + if (dep->de_Attributes & ATTR_READONLY) + vap->va_flags |= UF_READONLY; + if (dep->de_Attributes & ATTR_SYSTEM) + vap->va_flags |= UF_SYSTEM; vap->va_gen = 0; vap->va_blocksize = pmp->pm_bpcluster; vap->va_bytes = @@ -395,6 +396,18 @@ msdosfs_setattr(ap) #endif return (EINVAL); } + + /* + * We don't allow setting attributes on the root directory. + * The special case for the root directory is because before + * FAT32, the root directory didn't have an entry for itself + * (and was otherwise special). With FAT32, the root + * directory is not so special, but still doesn't have an + * entry for itself. + */ + if (vp->v_vflag & VV_ROOT) + return (EINVAL); + if (vap->va_flags != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); @@ -408,24 +421,29 @@ msdosfs_setattr(ap) * attributes. We ignored the access time and the * read and execute bits. We were strict for the other * attributes. - * - * Here we are strict, stricter than ufs in not allowing - * users to attempt to set SF_SETTABLE bits or anyone to - * set unsupported bits. However, we ignore attempts to - * set ATTR_ARCHIVE for directories `cp -pr' from a more - * sensible filesystem attempts it a lot. */ - if (vap->va_flags & SF_SETTABLE) { - error = priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0); - if (error) - return (error); - } - if (vap->va_flags & ~SF_ARCHIVED) + if (vap->va_flags & ~(UF_ARCHIVE | UF_HIDDEN | UF_READONLY | + UF_SYSTEM)) return EOPNOTSUPP; - if (vap->va_flags & SF_ARCHIVED) - dep->de_Attributes &= ~ATTR_ARCHIVE; - else if (!(dep->de_Attributes & ATTR_DIRECTORY)) + if (vap->va_flags & UF_ARCHIVE) dep->de_Attributes |= ATTR_ARCHIVE; + else + dep->de_Attributes &= ~ATTR_ARCHIVE; + if (vap->va_flags & UF_HIDDEN) + dep->de_Attributes |= ATTR_HIDDEN; + else + dep->de_Attributes &= ~ATTR_HIDDEN; + /* We don't allow changing the readonly bit on directories. */ + if (vp->v_type != VDIR) { + if (vap->va_flags & UF_READONLY) + dep->de_Attributes |= ATTR_READONLY; + else + dep->de_Attributes &= ~ATTR_READONLY; + } + if (vap->va_flags & UF_SYSTEM) + dep->de_Attributes |= ATTR_SYSTEM; + else + dep->de_Attributes &= ~ATTR_SYSTEM; dep->de_flag |= DE_MODIFIED; } @@ -489,21 +507,24 @@ msdosfs_setattr(ap) error = VOP_ACCESS(vp, VWRITE, cred, td); } else error = VOP_ACCESS(vp, VADMIN, cred, td); - if (vp->v_type != VDIR) { - if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && - vap->va_atime.tv_sec != VNOVAL) { - dep->de_flag &= ~DE_ACCESS; - timespec2fattime(&vap->va_atime, 0, - &dep->de_ADate, NULL, NULL); - } - if (vap->va_mtime.tv_sec != VNOVAL) { - dep->de_flag &= ~DE_UPDATE; - timespec2fattime(&vap->va_mtime, 0, - &dep->de_MDate, &dep->de_MTime, NULL); - } - dep->de_Attributes |= ATTR_ARCHIVE; - dep->de_flag |= DE_MODIFIED; + if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && + vap->va_atime.tv_sec != VNOVAL) { + dep->de_flag &= ~DE_ACCESS; + timespec2fattime(&vap->va_atime, 0, + &dep->de_ADate, NULL, NULL); + } + if (vap->va_mtime.tv_sec != VNOVAL) { + dep->de_flag &= ~DE_UPDATE; + timespec2fattime(&vap->va_mtime, 0, + &dep->de_MDate, &dep->de_MTime, NULL); } + /* + * We don't set the archive bit when modifying the time of + * a directory to emulate the Windows/DOS behavior. + */ + if (vp->v_type != VDIR) + dep->de_Attributes |= ATTR_ARCHIVE; + dep->de_flag |= DE_MODIFIED; } /* * DOS files only have the ability to have their writability Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/fs/smbfs/smbfs_node.c Wed Aug 21 23:04:48 2013 (r254627) @@ -370,10 +370,13 @@ smbfs_attr_cachelookup(struct vnode *vp, if (diff > 2) /* XXX should be configurable */ return ENOENT; va->va_type = vp->v_type; /* vnode type (for create) */ + va->va_flags = 0; /* flags defined for file */ if (vp->v_type == VREG) { va->va_mode = smp->sm_file_mode; /* files access mode and type */ - if (np->n_dosattr & SMB_FA_RDONLY) + if (np->n_dosattr & SMB_FA_RDONLY) { va->va_mode &= ~(S_IWUSR|S_IWGRP|S_IWOTH); + va->va_flags |= UF_READONLY; + } } else if (vp->v_type == VDIR) { va->va_mode = smp->sm_dir_mode; /* files access mode and type */ } else @@ -390,7 +393,15 @@ smbfs_attr_cachelookup(struct vnode *vp, va->va_mtime = np->n_mtime; va->va_atime = va->va_ctime = va->va_mtime; /* time file changed */ va->va_gen = VNOVAL; /* generation number of file */ - va->va_flags = 0; /* flags defined for file */ + if (np->n_dosattr & SMB_FA_HIDDEN) + va->va_flags |= UF_HIDDEN; + if (np->n_dosattr & SMB_FA_SYSTEM) + va->va_flags |= UF_SYSTEM; + /* + * We don't set the archive bit for directories. + */ + if ((vp->v_type != VDIR) && (np->n_dosattr & SMB_FA_ARCHIVE)) + va->va_flags |= UF_ARCHIVE; va->va_rdev = NODEV; /* device the special file represents */ va->va_bytes = va->va_size; /* bytes of disk space held by file */ va->va_filerev = 0; /* file modification number */ Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Aug 21 23:04:48 2013 (r254627) @@ -305,16 +305,30 @@ smbfs_setattr(ap) int old_n_dosattr; SMBVDEBUG("\n"); - if (vap->va_flags != VNOVAL) - return EOPNOTSUPP; isreadonly = (vp->v_mount->mnt_flag & MNT_RDONLY); /* * Disallow write attempts if the filesystem is mounted read-only. */ if ((vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL || - vap->va_mode != (mode_t)VNOVAL) && isreadonly) + vap->va_mode != (mode_t)VNOVAL || vap->va_flags != VNOVAL) && + isreadonly) return EROFS; + + /* + * We only support setting four flags. Don't allow setting others. + * + * We map UF_READONLY to SMB_FA_RDONLY, unlike the MacOS X version + * of this code, which maps both UF_IMMUTABLE AND SF_IMMUTABLE to + * SMB_FA_RDONLY. The immutable flags have different semantics + * than readonly, which is the reason for the difference. + */ + if (vap->va_flags != VNOVAL) { + if (vap->va_flags & ~(UF_HIDDEN|UF_SYSTEM|UF_ARCHIVE| + UF_READONLY)) + return EINVAL; + } + scred = smbfs_malloc_scred(); smb_makescred(scred, td, ap->a_cred); if (vap->va_size != VNOVAL) { @@ -353,12 +367,47 @@ smbfs_setattr(ap) goto out; } } - if (vap->va_mode != (mode_t)VNOVAL) { + if ((vap->va_flags != VNOVAL) || (vap->va_mode != (mode_t)VNOVAL)) { old_n_dosattr = np->n_dosattr; - if (vap->va_mode & S_IWUSR) - np->n_dosattr &= ~SMB_FA_RDONLY; - else - np->n_dosattr |= SMB_FA_RDONLY; + + if (vap->va_mode != (mode_t)VNOVAL) { + if (vap->va_mode & S_IWUSR) + np->n_dosattr &= ~SMB_FA_RDONLY; + else + np->n_dosattr |= SMB_FA_RDONLY; + } + + if (vap->va_flags != VNOVAL) { + if (vap->va_flags & UF_HIDDEN) + np->n_dosattr |= SMB_FA_HIDDEN; + else + np->n_dosattr &= ~SMB_FA_HIDDEN; + + if (vap->va_flags & UF_SYSTEM) + np->n_dosattr |= SMB_FA_SYSTEM; + else + np->n_dosattr &= ~SMB_FA_SYSTEM; + + if (vap->va_flags & UF_ARCHIVE) + np->n_dosattr |= SMB_FA_ARCHIVE; + else + np->n_dosattr &= ~SMB_FA_ARCHIVE; + + /* + * We only support setting the immutable / readonly + * bit for regular files. According to comments in + * the MacOS X version of this code, supporting the + * readonly bit on directories doesn't do the same + * thing in Windows as in Unix. + */ + if (vp->v_type == VREG) { + if (vap->va_flags & UF_READONLY) + np->n_dosattr |= SMB_FA_RDONLY; + else + np->n_dosattr &= ~SMB_FA_RDONLY; + } + } + if (np->n_dosattr != old_n_dosattr) { error = smbfs_smb_setpattr(np, np->n_dosattr, NULL, scred); if (error) Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/sys/param.h Wed Aug 21 23:04:48 2013 (r254627) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000046 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000047 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/stat.h ============================================================================== --- head/sys/sys/stat.h Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/sys/stat.h Wed Aug 21 23:04:48 2013 (r254627) @@ -265,8 +265,26 @@ struct nstat { #define UF_NODUMP 0x00000001 /* do not dump file */ #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ #define UF_APPEND 0x00000004 /* writes to file may only append */ -#define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ -#define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */ +#define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ +#define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */ +/* + * These two bits are defined in MacOS X. They are not currently used in + * FreeBSD. + */ +#if 0 +#define UF_COMPRESSED 0x00000020 /* file is compressed */ +#define UF_TRACKED 0x00000040 /* renames and deletes are tracked */ +#endif + +#define UF_SYSTEM 0x00000080 /* Windows system file bit */ +#define UF_SPARSE 0x00000100 /* sparse file */ +#define UF_OFFLINE 0x00000200 /* file is offline */ +#define UF_REPARSE 0x00000400 /* Windows reparse point file bit */ +#define UF_ARCHIVE 0x00000800 /* file needs to be archived */ +#define UF_READONLY 0x00001000 /* Windows readonly file bit */ +/* This is the same as the MacOS X definition of UF_HIDDEN. */ +#define UF_HIDDEN 0x00008000 /* file is hidden */ + /* * Super-user changeable flags. */ Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Aug 21 22:57:29 2013 (r254626) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Aug 21 23:04:48 2013 (r254627) @@ -528,9 +528,11 @@ ufs_setattr(ap) return (EINVAL); } if (vap->va_flags != VNOVAL) { - if ((vap->va_flags & ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND | - UF_OPAQUE | UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE | - SF_APPEND | SF_NOUNLINK | SF_SNAPSHOT)) != 0) + if ((vap->va_flags & ~(SF_APPEND | SF_ARCHIVED | SF_IMMUTABLE | + SF_NOUNLINK | SF_SNAPSHOT | UF_APPEND | UF_ARCHIVE | + UF_HIDDEN | UF_IMMUTABLE | UF_NODUMP | UF_NOUNLINK | + UF_OFFLINE | UF_OPAQUE | UF_READONLY | UF_REPARSE | + UF_SPARSE | UF_SYSTEM)) != 0) return (EOPNOTSUPP); if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 00:51:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D51FD326; Thu, 22 Aug 2013 00:51:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A70E62A8E; Thu, 22 Aug 2013 00:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M0pcTt012607; Thu, 22 Aug 2013 00:51:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M0pcwF012605; Thu, 22 Aug 2013 00:51:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308220051.r7M0pcwF012605@svn.freebsd.org> From: Xin LI Date: Thu, 22 Aug 2013 00:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254629 - head/sys/netinet head/sys/netinet6 stable/8/sys/netinet stable/8/sys/netinet6 stable/9/sys/netinet stable/9/sys/netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 00:51:38 -0000 Author: delphij Date: Thu Aug 22 00:51:37 2013 New Revision: 254629 URL: http://svnweb.freebsd.org/changeset/base/254629 Log: Fix an integer overflow in computing the size of a temporary buffer can result in a buffer which is too small for the requested operation. Security: CVE-2013-3077 Security: FreeBSD-SA-13:09.ip_multicast Modified: stable/9/sys/netinet/in_mcast.c stable/9/sys/netinet6/in6_mcast.c Changes in other areas also in this revision: Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c stable/8/sys/netinet/in_mcast.c stable/8/sys/netinet6/in6_mcast.c Modified: stable/9/sys/netinet/in_mcast.c ============================================================================== --- stable/9/sys/netinet/in_mcast.c Wed Aug 21 23:22:36 2013 (r254628) +++ stable/9/sys/netinet/in_mcast.c Thu Aug 22 00:51:37 2013 (r254629) @@ -1614,6 +1614,8 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + msfr.msfr_nsrcs = in_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: stable/9/sys/netinet6/in6_mcast.c ============================================================================== --- stable/9/sys/netinet6/in6_mcast.c Wed Aug 21 23:22:36 2013 (r254628) +++ stable/9/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:37 2013 (r254629) @@ -1625,6 +1625,8 @@ in6p_get_source_filters(struct inpcb *in * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + msfr.msfr_nsrcs = in6_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 00:51:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3E22D327; Thu, 22 Aug 2013 00:51:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5D22A8F; Thu, 22 Aug 2013 00:51:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M0pdrX012614; Thu, 22 Aug 2013 00:51:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M0pc9W012612; Thu, 22 Aug 2013 00:51:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308220051.r7M0pc9W012612@svn.freebsd.org> From: Xin LI Date: Thu, 22 Aug 2013 00:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254629 - head/sys/netinet head/sys/netinet6 stable/8/sys/netinet stable/8/sys/netinet6 stable/9/sys/netinet stable/9/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 00:51:39 -0000 Author: delphij Date: Thu Aug 22 00:51:37 2013 New Revision: 254629 URL: http://svnweb.freebsd.org/changeset/base/254629 Log: Fix an integer overflow in computing the size of a temporary buffer can result in a buffer which is too small for the requested operation. Security: CVE-2013-3077 Security: FreeBSD-SA-13:09.ip_multicast Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Changes in other areas also in this revision: Modified: stable/8/sys/netinet/in_mcast.c stable/8/sys/netinet6/in6_mcast.c stable/9/sys/netinet/in_mcast.c stable/9/sys/netinet6/in6_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Wed Aug 21 23:22:36 2013 (r254628) +++ head/sys/netinet/in_mcast.c Thu Aug 22 00:51:37 2013 (r254629) @@ -1648,6 +1648,8 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + msfr.msfr_nsrcs = in_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Wed Aug 21 23:22:36 2013 (r254628) +++ head/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:37 2013 (r254629) @@ -1625,6 +1625,8 @@ in6p_get_source_filters(struct inpcb *in * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + msfr.msfr_nsrcs = in6_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 00:51:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE9B0328; Thu, 22 Aug 2013 00:51:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0B5D2A90; Thu, 22 Aug 2013 00:51:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M0pdeD012621; Thu, 22 Aug 2013 00:51:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M0pdvh012619; Thu, 22 Aug 2013 00:51:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308220051.r7M0pdvh012619@svn.freebsd.org> From: Xin LI Date: Thu, 22 Aug 2013 00:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254629 - head/sys/netinet head/sys/netinet6 stable/8/sys/netinet stable/8/sys/netinet6 stable/9/sys/netinet stable/9/sys/netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 00:51:40 -0000 Author: delphij Date: Thu Aug 22 00:51:37 2013 New Revision: 254629 URL: http://svnweb.freebsd.org/changeset/base/254629 Log: Fix an integer overflow in computing the size of a temporary buffer can result in a buffer which is too small for the requested operation. Security: CVE-2013-3077 Security: FreeBSD-SA-13:09.ip_multicast Modified: stable/8/sys/netinet/in_mcast.c stable/8/sys/netinet6/in6_mcast.c Changes in other areas also in this revision: Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c stable/9/sys/netinet/in_mcast.c stable/9/sys/netinet6/in6_mcast.c Modified: stable/8/sys/netinet/in_mcast.c ============================================================================== --- stable/8/sys/netinet/in_mcast.c Wed Aug 21 23:22:36 2013 (r254628) +++ stable/8/sys/netinet/in_mcast.c Thu Aug 22 00:51:37 2013 (r254629) @@ -1613,6 +1613,8 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + msfr.msfr_nsrcs = in_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: stable/8/sys/netinet6/in6_mcast.c ============================================================================== --- stable/8/sys/netinet6/in6_mcast.c Wed Aug 21 23:22:36 2013 (r254628) +++ stable/8/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:37 2013 (r254629) @@ -1624,6 +1624,8 @@ in6p_get_source_filters(struct inpcb *in * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + msfr.msfr_nsrcs = in6_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 00:51:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6403D329; Thu, 22 Aug 2013 00:51:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50DC32A91; Thu, 22 Aug 2013 00:51:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M0pi3Y012688; Thu, 22 Aug 2013 00:51:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M0phQ5012686; Thu, 22 Aug 2013 00:51:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308220051.r7M0phQ5012686@svn.freebsd.org> From: Xin LI Date: Thu, 22 Aug 2013 00:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254630 - in releng/9.2/sys: netinet netinet6 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 00:51:44 -0000 Author: delphij Date: Thu Aug 22 00:51:43 2013 New Revision: 254630 URL: http://svnweb.freebsd.org/changeset/base/254630 Log: Fix an integer overflow in computing the size of a temporary buffer can result in a buffer which is too small for the requested operation. Security: CVE-2013-3077 Security: FreeBSD-SA-13:09.ip_multicast Approved by: re (kib) Modified: releng/9.2/sys/netinet/in_mcast.c releng/9.2/sys/netinet6/in6_mcast.c Modified: releng/9.2/sys/netinet/in_mcast.c ============================================================================== --- releng/9.2/sys/netinet/in_mcast.c Thu Aug 22 00:51:37 2013 (r254629) +++ releng/9.2/sys/netinet/in_mcast.c Thu Aug 22 00:51:43 2013 (r254630) @@ -1614,6 +1614,8 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + msfr.msfr_nsrcs = in_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: releng/9.2/sys/netinet6/in6_mcast.c ============================================================================== --- releng/9.2/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:37 2013 (r254629) +++ releng/9.2/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:43 2013 (r254630) @@ -1625,6 +1625,8 @@ in6p_get_source_filters(struct inpcb *in * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + msfr.msfr_nsrcs = in6_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 00:51:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6A0E74B0; Thu, 22 Aug 2013 00:51:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40D7C2A92; Thu, 22 Aug 2013 00:51:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M0po3B012804; Thu, 22 Aug 2013 00:51:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M0pmlo012762; Thu, 22 Aug 2013 00:51:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308220051.r7M0pmlo012762@svn.freebsd.org> From: Xin LI Date: Thu, 22 Aug 2013 00:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254631 - in releng/9.1: . sys/conf sys/dev/mfi sys/netinet sys/netinet6 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 00:51:50 -0000 Author: delphij Date: Thu Aug 22 00:51:48 2013 New Revision: 254631 URL: http://svnweb.freebsd.org/changeset/base/254631 Log: Fix an integer overflow in computing the size of a temporary buffer can result in a buffer which is too small for the requested operation. [13:09] Fix a bug that could lead to kernel memory disclosure with SCTP state cookie. [13:10] Fix a data corruption problem with mfi(4) operating on > 2TB disks in a JBOD. [EN-13:03] Security: CVE-2013-3077 Security: FreeBSD-SA-13:09.ip_multicast Security: CVE-2013-5209 Security: FreeBSD-SA-13:10.sctp Approved by: so Modified: releng/9.1/UPDATING releng/9.1/sys/conf/newvers.sh releng/9.1/sys/dev/mfi/mfi.c releng/9.1/sys/dev/mfi/mfi_cam.c releng/9.1/sys/dev/mfi/mfi_disk.c releng/9.1/sys/dev/mfi/mfi_syspd.c releng/9.1/sys/dev/mfi/mfi_tbolt.c releng/9.1/sys/dev/mfi/mfivar.h releng/9.1/sys/netinet/in_mcast.c releng/9.1/sys/netinet/sctp_output.c releng/9.1/sys/netinet6/in6_mcast.c Modified: releng/9.1/UPDATING ============================================================================== --- releng/9.1/UPDATING Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/UPDATING Thu Aug 22 00:51:48 2013 (r254631) @@ -9,6 +9,19 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130822: p6 FreeBSD-SA-13:09.ip_multicast + FreeBSD-SA-13:10.sctp + FreeBSD-EN-13:03.mfi + Fix an integer overflow in computing the size of a temporary buffer + can result in a buffer which is too small for the requested + operation. [13:09] + + Fix a bug that could lead to kernel memory disclosure with + SCTP state cookie. [13:10] + + Fix a data corruption problem with mfi(4) operating on > 2TB + disks in a JBOD. [EN-13:03] + 20130726: p5 FreeBSD-SA-13:07.bind FreeBSD-SA-13:08.nfsserver Fix Denial of Service vulnerability in named(8). [13:07] Modified: releng/9.1/sys/conf/newvers.sh ============================================================================== --- releng/9.1/sys/conf/newvers.sh Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/conf/newvers.sh Thu Aug 22 00:51:48 2013 (r254631) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.1/sys/dev/mfi/mfi.c ============================================================================== --- releng/9.1/sys/dev/mfi/mfi.c Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/dev/mfi/mfi.c Thu Aug 22 00:51:48 2013 (r254631) @@ -107,7 +107,7 @@ static void mfi_bio_complete(struct mfi_ static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); -static int mfi_abort(struct mfi_softc *, struct mfi_command *); +static int mfi_abort(struct mfi_softc *, struct mfi_command **); static int mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, struct thread *); static void mfi_timeout(void *); static int mfi_user_command(struct mfi_softc *, @@ -373,6 +373,8 @@ mfi_attach(struct mfi_softc *sc) sx_init(&sc->mfi_config_lock, "MFI config"); TAILQ_INIT(&sc->mfi_ld_tqh); TAILQ_INIT(&sc->mfi_syspd_tqh); + TAILQ_INIT(&sc->mfi_ld_pend_tqh); + TAILQ_INIT(&sc->mfi_syspd_pend_tqh); TAILQ_INIT(&sc->mfi_evt_queue); TASK_INIT(&sc->mfi_evt_task, 0, mfi_handle_evt, sc); TASK_INIT(&sc->mfi_map_sync_task, 0, mfi_handle_map_sync, sc); @@ -694,6 +696,7 @@ mfi_attach(struct mfi_softc *sc) device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } + sc->mfi_intr_ptr = mfi_intr_tbolt; sc->mfi_enable_intr(sc); } else { if ((error = mfi_comms_init(sc)) != 0) @@ -704,6 +707,7 @@ mfi_attach(struct mfi_softc *sc) device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); return (EINVAL); } + sc->mfi_intr_ptr = mfi_intr; sc->mfi_enable_intr(sc); } if ((error = mfi_get_controller_info(sc)) != 0) @@ -1278,6 +1282,17 @@ mfi_shutdown(struct mfi_softc *sc) struct mfi_command *cm; int error; + + if (sc->mfi_aen_cm) + sc->cm_aen_abort = 1; + if (sc->mfi_aen_cm != NULL) + mfi_abort(sc, &sc->mfi_aen_cm); + + if (sc->mfi_map_sync_cm) + sc->cm_map_abort = 1; + if (sc->mfi_map_sync_cm != NULL) + mfi_abort(sc, &sc->mfi_map_sync_cm); + mtx_lock(&sc->mfi_io_lock); error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_SHUTDOWN, NULL, 0); if (error) { @@ -1285,12 +1300,6 @@ mfi_shutdown(struct mfi_softc *sc) return (error); } - if (sc->mfi_aen_cm != NULL) - mfi_abort(sc, sc->mfi_aen_cm); - - if (sc->mfi_map_sync_cm != NULL) - mfi_abort(sc, sc->mfi_map_sync_cm); - dcmd = &cm->cm_frame->dcmd; dcmd->header.flags = MFI_FRAME_DIR_NONE; cm->cm_flags = MFI_CMD_POLLED; @@ -1312,6 +1321,7 @@ mfi_syspdprobe(struct mfi_softc *sc) struct mfi_command *cm = NULL; struct mfi_pd_list *pdlist = NULL; struct mfi_system_pd *syspd, *tmp; + struct mfi_system_pending *syspd_pend; int error, i, found; sx_assert(&sc->mfi_config_lock, SA_XLOCKED); @@ -1352,6 +1362,10 @@ mfi_syspdprobe(struct mfi_softc *sc) if (syspd->pd_id == pdlist->addr[i].device_id) found = 1; } + TAILQ_FOREACH(syspd_pend, &sc->mfi_syspd_pend_tqh, pd_link) { + if (syspd_pend->pd_id == pdlist->addr[i].device_id) + found = 1; + } if (found == 0) mfi_add_sys_pd(sc, pdlist->addr[i].device_id); } @@ -1387,6 +1401,7 @@ mfi_ldprobe(struct mfi_softc *sc) struct mfi_command *cm = NULL; struct mfi_ld_list *list = NULL; struct mfi_disk *ld; + struct mfi_disk_pending *ld_pend; int error, i; sx_assert(&sc->mfi_config_lock, SA_XLOCKED); @@ -1415,6 +1430,10 @@ mfi_ldprobe(struct mfi_softc *sc) if (ld->ld_id == list->ld_list[i].ld.v.target_id) goto skip_add; } + TAILQ_FOREACH(ld_pend, &sc->mfi_ld_pend_tqh, ld_link) { + if (ld_pend->ld_id == list->ld_list[i].ld.v.target_id) + goto skip_add; + } mfi_add_ld(sc, list->ld_list[i].ld.v.target_id); skip_add:; } @@ -1617,9 +1636,7 @@ mfi_aen_register(struct mfi_softc *sc, i < current_aen.members.evt_class) current_aen.members.evt_class = prior_aen.members.evt_class; - mtx_lock(&sc->mfi_io_lock); - mfi_abort(sc, sc->mfi_aen_cm); - mtx_unlock(&sc->mfi_io_lock); + mfi_abort(sc, &sc->mfi_aen_cm); } } @@ -1811,10 +1828,17 @@ mfi_add_ld(struct mfi_softc *sc, int id) struct mfi_command *cm; struct mfi_dcmd_frame *dcmd = NULL; struct mfi_ld_info *ld_info = NULL; + struct mfi_disk_pending *ld_pend; int error; mtx_assert(&sc->mfi_io_lock, MA_OWNED); + ld_pend = malloc(sizeof(*ld_pend), M_MFIBUF, M_NOWAIT | M_ZERO); + if (ld_pend != NULL) { + ld_pend->ld_id = id; + TAILQ_INSERT_TAIL(&sc->mfi_ld_pend_tqh, ld_pend, ld_link); + } + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); if (error) { @@ -1855,11 +1879,13 @@ mfi_add_ld_complete(struct mfi_command * hdr = &cm->cm_frame->header; ld_info = cm->cm_private; - if (hdr->cmd_status != MFI_STAT_OK) { + if (sc->cm_map_abort || hdr->cmd_status != MFI_STAT_OK) { free(ld_info, M_MFIBUF); + wakeup(&sc->mfi_map_sync_cm); mfi_release_command(cm); return; } + wakeup(&sc->mfi_map_sync_cm); mfi_release_command(cm); mtx_unlock(&sc->mfi_io_lock); @@ -1884,10 +1910,17 @@ static int mfi_add_sys_pd(struct mfi_sof struct mfi_command *cm; struct mfi_dcmd_frame *dcmd = NULL; struct mfi_pd_info *pd_info = NULL; + struct mfi_system_pending *syspd_pend; int error; mtx_assert(&sc->mfi_io_lock, MA_OWNED); + syspd_pend = malloc(sizeof(*syspd_pend), M_MFIBUF, M_NOWAIT | M_ZERO); + if (syspd_pend != NULL) { + syspd_pend->pd_id = id; + TAILQ_INSERT_TAIL(&sc->mfi_syspd_pend_tqh, syspd_pend, pd_link); + } + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_GET_INFO, (void **)&pd_info, sizeof(*pd_info)); if (error) { @@ -1981,19 +2014,87 @@ mfi_bio_command(struct mfi_softc *sc) mfi_enqueue_bio(sc, bio); return cm; } + +/* + * mostly copied from cam/scsi/scsi_all.c:scsi_read_write + */ + +int +mfi_build_cdb(int readop, uint8_t byte2, u_int64_t lba, u_int32_t block_count, uint8_t *cdb) +{ + int cdb_len; + + if (((lba & 0x1fffff) == lba) + && ((block_count & 0xff) == block_count) + && (byte2 == 0)) { + /* We can fit in a 6 byte cdb */ + struct scsi_rw_6 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_6 *)cdb; + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; + scsi_ulto3b(lba, scsi_cmd->addr); + scsi_cmd->length = block_count & 0xff; + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else if (((block_count & 0xffff) == block_count) && ((lba & 0xffffffff) == lba)) { + /* Need a 10 byte CDB */ + struct scsi_rw_10 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_10 *)cdb; + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto2b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else if (((block_count & 0xffffffff) == block_count) && + ((lba & 0xffffffff) == lba)) { + /* Block count is too big for 10 byte CDB use a 12 byte CDB */ + struct scsi_rw_12 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_12 *)cdb; + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else { + /* + * 16 byte CDB. We'll only get here if the LBA is larger + * than 2^32 + */ + struct scsi_rw_16 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_16 *)cdb; + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; + scsi_cmd->byte2 = byte2; + scsi_u64to8b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } + + return cdb_len; +} + static struct mfi_command * mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) { struct mfi_command *cm; struct mfi_pass_frame *pass; - int flags = 0, blkcount = 0; uint32_t context = 0; + int flags = 0, blkcount = 0, readop; + uint8_t cdb_len; if ((cm = mfi_dequeue_free(sc)) == NULL) return (NULL); /* Zero out the MFI frame */ - context = cm->cm_frame->header.context; + context = cm->cm_frame->header.context; bzero(cm->cm_frame, sizeof(union mfi_frame)); cm->cm_frame->header.context = context; pass = &cm->cm_frame->pass; @@ -2001,35 +2102,31 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->header.cmd = MFI_CMD_PD_SCSI_IO; switch (bio->bio_cmd & 0x03) { case BIO_READ: -#define SCSI_READ 0x28 - pass->cdb[0] = SCSI_READ; flags = MFI_CMD_DATAIN; + readop = 1; break; case BIO_WRITE: -#define SCSI_WRITE 0x2a - pass->cdb[0] = SCSI_WRITE; flags = MFI_CMD_DATAOUT; + readop = 0; break; default: - panic("Invalid bio command"); + /* TODO: what about BIO_DELETE??? */ + panic("Unsupported bio command %x\n", bio->bio_cmd); } /* Cheat with the sector length to avoid a non-constant division */ blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; /* Fill the LBA and Transfer length in CDB */ - pass->cdb[2] = (bio->bio_pblkno & 0xff000000) >> 24; - pass->cdb[3] = (bio->bio_pblkno & 0x00ff0000) >> 16; - pass->cdb[4] = (bio->bio_pblkno & 0x0000ff00) >> 8; - pass->cdb[5] = bio->bio_pblkno & 0x000000ff; - pass->cdb[7] = (blkcount & 0xff00) >> 8; - pass->cdb[8] = (blkcount & 0x00ff); + cdb_len = mfi_build_cdb(readop, 0, bio->bio_pblkno, blkcount, + pass->cdb); pass->header.target_id = (uintptr_t)bio->bio_driver1; + pass->header.lun_id = 0; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = bio->bio_bcount; - pass->header.cdb_len = 10; + pass->header.cdb_len = cdb_len; pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_complete = mfi_bio_complete; @@ -2047,7 +2144,8 @@ mfi_build_ldio(struct mfi_softc *sc, str { struct mfi_io_frame *io; struct mfi_command *cm; - int flags, blkcount; + int flags; + uint32_t blkcount; uint32_t context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) @@ -2068,7 +2166,8 @@ mfi_build_ldio(struct mfi_softc *sc, str flags = MFI_CMD_DATAOUT; break; default: - panic("Invalid bio command"); + /* TODO: what about BIO_DELETE??? */ + panic("Unsupported bio command %x\n", bio->bio_cmd); } /* Cheat with the sector length to avoid a non-constant division */ @@ -2358,15 +2457,14 @@ mfi_complete(struct mfi_softc *sc, struc } static int -mfi_abort(struct mfi_softc *sc, struct mfi_command *cm_abort) +mfi_abort(struct mfi_softc *sc, struct mfi_command **cm_abort) { struct mfi_command *cm; struct mfi_abort_frame *abort; int i = 0; uint32_t context = 0; - mtx_assert(&sc->mfi_io_lock, MA_OWNED); - + mtx_lock(&sc->mfi_io_lock); if ((cm = mfi_dequeue_free(sc)) == NULL) { return (EBUSY); } @@ -2380,29 +2478,27 @@ mfi_abort(struct mfi_softc *sc, struct m abort->header.cmd = MFI_CMD_ABORT; abort->header.flags = 0; abort->header.scsi_status = 0; - abort->abort_context = cm_abort->cm_frame->header.context; - abort->abort_mfi_addr_lo = (uint32_t)cm_abort->cm_frame_busaddr; + abort->abort_context = (*cm_abort)->cm_frame->header.context; + abort->abort_mfi_addr_lo = (uint32_t)(*cm_abort)->cm_frame_busaddr; abort->abort_mfi_addr_hi = - (uint32_t)((uint64_t)cm_abort->cm_frame_busaddr >> 32); + (uint32_t)((uint64_t)(*cm_abort)->cm_frame_busaddr >> 32); cm->cm_data = NULL; cm->cm_flags = MFI_CMD_POLLED; - if (sc->mfi_aen_cm) - sc->cm_aen_abort = 1; - if (sc->mfi_map_sync_cm) - sc->cm_map_abort = 1; mfi_mapcmd(sc, cm); mfi_release_command(cm); - while (i < 5 && sc->mfi_aen_cm != NULL) { - msleep(&sc->mfi_aen_cm, &sc->mfi_io_lock, 0, "mfiabort", + mtx_unlock(&sc->mfi_io_lock); + while (i < 5 && *cm_abort != NULL) { + tsleep(cm_abort, 0, "mfiabort", 5 * hz); i++; } - while (i < 5 && sc->mfi_map_sync_cm != NULL) { - msleep(&sc->mfi_map_sync_cm, &sc->mfi_io_lock, 0, "mfiabort", - 5 * hz); - i++; + if (*cm_abort != NULL) { + /* Force a complete if command didn't abort */ + mtx_lock(&sc->mfi_io_lock); + (*cm_abort)->cm_complete(*cm_abort); + mtx_unlock(&sc->mfi_io_lock); } return (0); @@ -2458,8 +2554,8 @@ mfi_dump_syspd_blocks(struct mfi_softc * { struct mfi_command *cm; struct mfi_pass_frame *pass; - int error; - int blkcount = 0; + int error, readop, cdb_len; + uint32_t blkcount; if ((cm = mfi_dequeue_free(sc)) == NULL) return (EBUSY); @@ -2467,28 +2563,24 @@ mfi_dump_syspd_blocks(struct mfi_softc * pass = &cm->cm_frame->pass; bzero(pass->cdb, 16); pass->header.cmd = MFI_CMD_PD_SCSI_IO; - pass->cdb[0] = SCSI_WRITE; - pass->cdb[2] = (lba & 0xff000000) >> 24; - pass->cdb[3] = (lba & 0x00ff0000) >> 16; - pass->cdb[4] = (lba & 0x0000ff00) >> 8; - pass->cdb[5] = (lba & 0x000000ff); + + readop = 0; blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; - pass->cdb[7] = (blkcount & 0xff00) >> 8; - pass->cdb[8] = (blkcount & 0x00ff); + cdb_len = mfi_build_cdb(readop, 0, lba, blkcount, pass->cdb); pass->header.target_id = id; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = len; - pass->header.cdb_len = 10; + pass->header.cdb_len = cdb_len; pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_data = virt; cm->cm_len = len; cm->cm_sg = &pass->sgl; cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE; - cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT; + cm->cm_flags = MFI_CMD_POLLED | MFI_CMD_DATAOUT | MFI_CMD_SCSI; error = mfi_mapcmd(sc, cm); bus_dmamap_sync(sc->mfi_buffer_dmat, cm->cm_dmamap, @@ -2687,16 +2779,24 @@ mfi_check_command_post(struct mfi_softc } } -static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm) +static int +mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm) { - struct mfi_config_data *conf_data=(struct mfi_config_data *)cm->cm_data; + struct mfi_config_data *conf_data; struct mfi_command *ld_cm = NULL; struct mfi_ld_info *ld_info = NULL; + struct mfi_ld_config *ld; + char *p; int error = 0; - if ((cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) && - (conf_data->ld[0].params.isSSCD == 1)) { - error = 1; + conf_data = (struct mfi_config_data *)cm->cm_data; + + if (cm->cm_frame->dcmd.opcode == MFI_DCMD_CFG_ADD) { + p = (char *)conf_data->array; + p += conf_data->array_size * conf_data->array_count; + ld = (struct mfi_ld_config *)p; + if (ld->params.isSSCD == 1) + error = 1; } else if (cm->cm_frame->dcmd.opcode == MFI_DCMD_LD_DELETE) { error = mfi_dcmd_command (sc, &ld_cm, MFI_DCMD_LD_GET_INFO, (void **)&ld_info, sizeof(*ld_info)); Modified: releng/9.1/sys/dev/mfi/mfi_cam.c ============================================================================== --- releng/9.1/sys/dev/mfi/mfi_cam.c Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/dev/mfi/mfi_cam.c Thu Aug 22 00:51:48 2013 (r254631) @@ -79,6 +79,11 @@ static void mfip_cam_poll(struct cam_sim static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); +static int mfi_allow_disks = 0; +TUNABLE_INT("hw.mfi.allow_cam_disk_passthrough", &mfi_allow_disks); +SYSCTL_INT(_hw_mfi, OID_AUTO, allow_cam_disk_passthrough, CTLFLAG_RD, + &mfi_allow_disks, 0, "event message locale"); + static devclass_t mfip_devclass; static device_method_t mfip_methods[] = { DEVMETHOD(device_probe, mfip_probe), @@ -349,7 +354,8 @@ mfip_done(struct mfi_command *cm) command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { device = csio->data_ptr[0] & 0x1f; - if ((device == T_DIRECT) || (device == T_PROCESSOR)) + if ((!mfi_allow_disks && device == T_DIRECT) || + (device == T_PROCESSOR)) csio->data_ptr[0] = (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } @@ -392,6 +398,9 @@ mfip_done(struct mfi_command *cm) static void mfip_cam_poll(struct cam_sim *sim) { - return; + struct mfip_softc *sc = cam_sim_softc(sim); + struct mfi_softc *mfisc = sc->mfi_sc; + + mfisc->mfi_intr_ptr(mfisc); } Modified: releng/9.1/sys/dev/mfi/mfi_disk.c ============================================================================== --- releng/9.1/sys/dev/mfi/mfi_disk.c Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/dev/mfi/mfi_disk.c Thu Aug 22 00:51:48 2013 (r254631) @@ -93,6 +93,7 @@ mfi_disk_attach(device_t dev) { struct mfi_disk *sc; struct mfi_ld_info *ld_info; + struct mfi_disk_pending *ld_pend; uint64_t sectors; uint32_t secsize; char *state; @@ -111,6 +112,13 @@ mfi_disk_attach(device_t dev) secsize = MFI_SECTOR_LEN; mtx_lock(&sc->ld_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->ld_controller->mfi_ld_tqh, sc, ld_link); + TAILQ_FOREACH(ld_pend, &sc->ld_controller->mfi_ld_pend_tqh, + ld_link) { + TAILQ_REMOVE(&sc->ld_controller->mfi_ld_pend_tqh, + ld_pend, ld_link); + free(ld_pend, M_MFIBUF); + break; + } mtx_unlock(&sc->ld_controller->mfi_io_lock); switch (ld_info->ld_config.params.state) { @@ -131,16 +139,16 @@ mfi_disk_attach(device_t dev) break; } - if ( strlen(ld_info->ld_config.properties.name) == 0 ) { - device_printf(dev, - "%juMB (%ju sectors) RAID volume (no label) is %s\n", - sectors / (1024 * 1024 / secsize), sectors, state); - } else { - device_printf(dev, - "%juMB (%ju sectors) RAID volume '%s' is %s\n", - sectors / (1024 * 1024 / secsize), sectors, - ld_info->ld_config.properties.name, state); - } + if ( strlen(ld_info->ld_config.properties.name) == 0 ) { + device_printf(dev, + "%juMB (%ju sectors) RAID volume (no label) is %s\n", + sectors / (1024 * 1024 / secsize), sectors, state); + } else { + device_printf(dev, + "%juMB (%ju sectors) RAID volume '%s' is %s\n", + sectors / (1024 * 1024 / secsize), sectors, + ld_info->ld_config.properties.name, state); + } sc->ld_disk = disk_alloc(); sc->ld_disk->d_drv1 = sc; Modified: releng/9.1/sys/dev/mfi/mfi_syspd.c ============================================================================== --- releng/9.1/sys/dev/mfi/mfi_syspd.c Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/dev/mfi/mfi_syspd.c Thu Aug 22 00:51:48 2013 (r254631) @@ -89,7 +89,6 @@ DRIVER_MODULE(mfisyspd, mfi, mfi_syspd_d static int mfi_syspd_probe(device_t dev) { - return (0); } @@ -98,12 +97,12 @@ mfi_syspd_attach(device_t dev) { struct mfi_system_pd *sc; struct mfi_pd_info *pd_info; + struct mfi_system_pending *syspd_pend; uint64_t sectors; uint32_t secsize; sc = device_get_softc(dev); pd_info = device_get_ivars(dev); - sc->pd_dev = dev; sc->pd_id = pd_info->ref.v.device_id; sc->pd_unit = device_get_unit(dev); @@ -115,6 +114,13 @@ mfi_syspd_attach(device_t dev) secsize = MFI_SECTOR_LEN; mtx_lock(&sc->pd_controller->mfi_io_lock); TAILQ_INSERT_TAIL(&sc->pd_controller->mfi_syspd_tqh, sc, pd_link); + TAILQ_FOREACH(syspd_pend, &sc->pd_controller->mfi_syspd_pend_tqh, + pd_link) { + TAILQ_REMOVE(&sc->pd_controller->mfi_syspd_pend_tqh, + syspd_pend, pd_link); + free(syspd_pend, M_MFIBUF); + break; + } mtx_unlock(&sc->pd_controller->mfi_io_lock); device_printf(dev, "%juMB (%ju sectors) SYSPD volume\n", sectors / (1024 * 1024 / secsize), sectors); @@ -139,6 +145,7 @@ mfi_syspd_attach(device_t dev) disk_create(sc->pd_disk, DISK_VERSION); device_printf(dev, " SYSPD volume attached\n"); + return (0); } Modified: releng/9.1/sys/dev/mfi/mfi_tbolt.c ============================================================================== --- releng/9.1/sys/dev/mfi/mfi_tbolt.c Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/dev/mfi/mfi_tbolt.c Thu Aug 22 00:51:48 2013 (r254631) @@ -69,13 +69,10 @@ uint8_t mfi_build_mpt_pass_thru(struct mfi_softc *sc, struct mfi_command *mfi_cmd); union mfi_mpi2_request_descriptor *mfi_build_and_issue_cmd(struct mfi_softc *sc, struct mfi_command *mfi_cmd); -int mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd); void mfi_tbolt_build_ldio(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd); static int mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd, pMpi25IeeeSgeChain64_t sgl_ptr, struct mfi_cmd_tbolt *cmd); -static int mfi_tbolt_build_cdb(struct mfi_softc *sc, struct mfi_command - *mfi_cmd, uint8_t *cdb); void map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status, uint8_t ext_status); @@ -502,6 +499,7 @@ mfi_tbolt_alloc_cmd(struct mfi_softc *sc + i * MEGASAS_MAX_SZ_CHAIN_FRAME); cmd->sg_frame_phys_addr = sc->sg_frame_busaddr + i * MEGASAS_MAX_SZ_CHAIN_FRAME; + cmd->sync_cmd_idx = sc->mfi_max_fw_cmds; TAILQ_INSERT_TAIL(&(sc->mfi_cmd_tbolt_tqh), cmd, next); } @@ -574,11 +572,11 @@ void map_tbolt_cmd_status(struct mfi_command *mfi_cmd, uint8_t status, uint8_t ext_status) { - switch (status) { case MFI_STAT_OK: - mfi_cmd->cm_frame->header.cmd_status = 0; - mfi_cmd->cm_frame->dcmd.header.cmd_status = 0; + mfi_cmd->cm_frame->header.cmd_status = MFI_STAT_OK; + mfi_cmd->cm_frame->dcmd.header.cmd_status = MFI_STAT_OK; + mfi_cmd->cm_error = MFI_STAT_OK; break; case MFI_STAT_SCSI_IO_FAILED: @@ -618,6 +616,7 @@ mfi_tbolt_return_cmd(struct mfi_softc *s { mtx_assert(&sc->mfi_io_lock, MA_OWNED); + cmd->sync_cmd_idx = sc->mfi_max_fw_cmds; TAILQ_INSERT_TAIL(&sc->mfi_cmd_tbolt_tqh, cmd, next); } @@ -667,16 +666,26 @@ mfi_tbolt_complete_cmd(struct mfi_softc extStatus = cmd_mfi->cm_frame->dcmd.header.scsi_status; map_tbolt_cmd_status(cmd_mfi, status, extStatus); - /* remove command from busy queue if not polled */ - TAILQ_FOREACH(cmd_mfi_check, &sc->mfi_busy, cm_link) { - if (cmd_mfi_check == cmd_mfi) { - mfi_remove_busy(cmd_mfi); - break; + if (cmd_mfi->cm_flags & MFI_CMD_SCSI && + (cmd_mfi->cm_flags & MFI_CMD_POLLED) != 0) { + /* polled LD/SYSPD IO command */ + mfi_tbolt_return_cmd(sc, cmd_tbolt); + /* XXX mark okay for now DJA */ + cmd_mfi->cm_frame->header.cmd_status = MFI_STAT_OK; + } else { + + /* remove command from busy queue if not polled */ + TAILQ_FOREACH(cmd_mfi_check, &sc->mfi_busy, cm_link) { + if (cmd_mfi_check == cmd_mfi) { + mfi_remove_busy(cmd_mfi); + break; + } } + + /* complete the command */ + mfi_complete(sc, cmd_mfi); + mfi_tbolt_return_cmd(sc, cmd_tbolt); } - cmd_mfi->cm_error = 0; - mfi_complete(sc, cmd_mfi); - mfi_tbolt_return_cmd(sc, cmd_tbolt); sc->last_reply_idx++; if (sc->last_reply_idx >= sc->mfi_max_fw_cmds) { @@ -811,13 +820,13 @@ mfi_tbolt_build_ldio(struct mfi_softc *s MFI_FRAME_DIR_READ) io_info.isRead = 1; - io_request->RaidContext.timeoutValue - = MFI_FUSION_FP_DEFAULT_TIMEOUT; - io_request->Function = MPI2_FUNCTION_LD_IO_REQUEST; - io_request->DevHandle = device_id; - cmd->request_desc->header.RequestFlags - = (MFI_REQ_DESCRIPT_FLAGS_LD_IO - << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + io_request->RaidContext.timeoutValue + = MFI_FUSION_FP_DEFAULT_TIMEOUT; + io_request->Function = MPI2_FUNCTION_LD_IO_REQUEST; + io_request->DevHandle = device_id; + cmd->request_desc->header.RequestFlags + = (MFI_REQ_DESCRIPT_FLAGS_LD_IO + << MFI_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if ((io_request->IoFlags == 6) && (io_info.numBlocks == 0)) io_request->RaidContext.RegLockLength = 0x100; io_request->DataLength = mfi_cmd->cm_frame->io.header.data_len @@ -825,40 +834,36 @@ mfi_tbolt_build_ldio(struct mfi_softc *s } int -mfi_tbolt_is_ldio(struct mfi_command *mfi_cmd) -{ - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ - || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - return 1; - else - return 0; -} - -int mfi_tbolt_build_io(struct mfi_softc *sc, struct mfi_command *mfi_cmd, struct mfi_cmd_tbolt *cmd) { - uint32_t device_id; + struct mfi_mpi2_request_raid_scsi_io *io_request; uint32_t sge_count; - uint8_t cdb[32], cdb_len; - - memset(cdb, 0, 32); - struct mfi_mpi2_request_raid_scsi_io *io_request = cmd->io_request; - - device_id = mfi_cmd->cm_frame->header.target_id; + uint8_t cdb_len; + int readop; + u_int64_t lba; - /* Have to build CDB here for TB as BSD don't have a scsi layer */ - if ((cdb_len = mfi_tbolt_build_cdb(sc, mfi_cmd, cdb)) == 1) + io_request = cmd->io_request; + if (!(mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_READ + || mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE)) return 1; - /* Just the CDB length,rest of the Flags are zero */ - io_request->IoFlags = cdb_len; - memcpy(io_request->CDB.CDB32, cdb, 32); + mfi_tbolt_build_ldio(sc, mfi_cmd, cmd); - if (mfi_tbolt_is_ldio(mfi_cmd)) - mfi_tbolt_build_ldio(sc, mfi_cmd , cmd); + /* Convert to SCSI command CDB */ + bzero(io_request->CDB.CDB32, sizeof(io_request->CDB.CDB32)); + if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) + readop = 0; else - return 1; + readop = 1; + + lba = mfi_cmd->cm_frame->io.lba_hi; + lba = (lba << 32) + mfi_cmd->cm_frame->io.lba_lo; + cdb_len = mfi_build_cdb(readop, 0, lba, + mfi_cmd->cm_frame->io.header.data_len, io_request->CDB.CDB32); + + /* Just the CDB length, rest of the Flags are zero */ + io_request->IoFlags = cdb_len; /* * Construct SGL @@ -883,84 +888,12 @@ mfi_tbolt_build_io(struct mfi_softc *sc, io_request->SenseBufferLowAddress = mfi_cmd->cm_sense_busaddr; io_request->SenseBufferLength = MFI_SENSE_LEN; + io_request->RaidContext.Status = MFI_STAT_INVALID_STATUS; + io_request->RaidContext.exStatus = MFI_STAT_INVALID_STATUS; + return 0; } -static int -mfi_tbolt_build_cdb(struct mfi_softc *sc, struct mfi_command *mfi_cmd, - uint8_t *cdb) -{ - uint32_t lba_lo, lba_hi, num_lba; - uint8_t cdb_len; - - if (mfi_cmd == NULL || cdb == NULL) - return 1; - num_lba = mfi_cmd->cm_frame->io.header.data_len; - lba_lo = mfi_cmd->cm_frame->io.lba_lo; - lba_hi = mfi_cmd->cm_frame->io.lba_hi; - - if (lba_hi == 0 && (num_lba <= 0xFF) && (lba_lo <= 0x1FFFFF)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 6 or Write 6 */ - cdb[0] = (uint8_t) (0x0A); - else - cdb[0] = (uint8_t) (0x08); - - cdb[4] = (uint8_t) num_lba; - cdb[3] = (uint8_t) (lba_lo & 0xFF); - cdb[2] = (uint8_t) (lba_lo >> 8); - cdb[1] = (uint8_t) ((lba_lo >> 16) & 0x1F); - cdb_len = 6; - } - else if (lba_hi == 0 && (num_lba <= 0xFFFF) && (lba_lo <= 0xFFFFFFFF)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 10 or Write 10 */ - cdb[0] = (uint8_t) (0x2A); - else - cdb[0] = (uint8_t) (0x28); - cdb[8] = (uint8_t) (num_lba & 0xFF); - cdb[7] = (uint8_t) (num_lba >> 8); - cdb[5] = (uint8_t) (lba_lo & 0xFF); - cdb[4] = (uint8_t) (lba_lo >> 8); - cdb[3] = (uint8_t) (lba_lo >> 16); - cdb[2] = (uint8_t) (lba_lo >> 24); - cdb_len = 10; - } else if ((num_lba > 0xFFFF) && (lba_hi == 0)) { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - /* Read 12 or Write 12 */ - cdb[0] = (uint8_t) (0xAA); - else - cdb[0] = (uint8_t) (0xA8); - cdb[9] = (uint8_t) (num_lba & 0xFF); - cdb[8] = (uint8_t) (num_lba >> 8); - cdb[7] = (uint8_t) (num_lba >> 16); - cdb[6] = (uint8_t) (num_lba >> 24); - cdb[5] = (uint8_t) (lba_lo & 0xFF); - cdb[4] = (uint8_t) (lba_lo >> 8); - cdb[3] = (uint8_t) (lba_lo >> 16); - cdb[2] = (uint8_t) (lba_lo >> 24); - cdb_len = 12; - } else { - if (mfi_cmd->cm_frame->header.cmd == MFI_CMD_LD_WRITE) - cdb[0] = (uint8_t) (0x8A); - else - cdb[0] = (uint8_t) (0x88); - cdb[13] = (uint8_t) (num_lba & 0xFF); - cdb[12] = (uint8_t) (num_lba >> 8); - cdb[11] = (uint8_t) (num_lba >> 16); - cdb[10] = (uint8_t) (num_lba >> 24); - cdb[9] = (uint8_t) (lba_lo & 0xFF); - cdb[8] = (uint8_t) (lba_lo >> 8); - cdb[7] = (uint8_t) (lba_lo >> 16); - cdb[6] = (uint8_t) (lba_lo >> 24); - cdb[5] = (uint8_t) (lba_hi & 0xFF); - cdb[4] = (uint8_t) (lba_hi >> 8); - cdb[3] = (uint8_t) (lba_hi >> 16); - cdb[2] = (uint8_t) (lba_hi >> 24); - cdb_len = 16; - } - return cdb_len; -} static int mfi_tbolt_make_sgl(struct mfi_softc *sc, struct mfi_command *mfi_cmd, @@ -1100,8 +1033,7 @@ mfi_tbolt_send_frame(struct mfi_softc *s if ((cm->cm_flags & MFI_CMD_POLLED) == 0) { cm->cm_timestamp = time_uptime; mfi_enqueue_busy(cm); - } - else { /* still get interrupts for it */ + } else { /* still get interrupts for it */ hdr->cmd_status = MFI_STAT_INVALID_STATUS; hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; } @@ -1118,31 +1050,49 @@ mfi_tbolt_send_frame(struct mfi_softc *s } else device_printf(sc->mfi_dev, "DJA NA XXX SYSPDIO\n"); - } - else if (hdr->cmd == MFI_CMD_LD_SCSI_IO || + } else if (hdr->cmd == MFI_CMD_LD_SCSI_IO || hdr->cmd == MFI_CMD_LD_READ || hdr->cmd == MFI_CMD_LD_WRITE) { + cm->cm_flags |= MFI_CMD_SCSI; if ((req_desc = mfi_build_and_issue_cmd(sc, cm)) == NULL) { device_printf(sc->mfi_dev, "LDIO Failed \n"); return 1; } - } else - if ((req_desc = mfi_tbolt_build_mpt_cmd(sc, cm)) == NULL) { + } else if ((req_desc = mfi_tbolt_build_mpt_cmd(sc, cm)) == NULL) { device_printf(sc->mfi_dev, "Mapping from MFI to MPT " "Failed\n"); return 1; - } + } + + if (cm->cm_flags & MFI_CMD_SCSI) { + /* + * LD IO needs to be posted since it doesn't get + * acknowledged via a status update so have the + * controller reply via mfi_tbolt_complete_cmd. + */ + hdr->flags &= ~MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + } + MFI_WRITE4(sc, MFI_ILQP, (req_desc->words & 0xFFFFFFFF)); MFI_WRITE4(sc, MFI_IHQP, (req_desc->words >>0x20)); if ((cm->cm_flags & MFI_CMD_POLLED) == 0) return 0; + if (cm->cm_flags & MFI_CMD_SCSI) { + /* check reply queue */ + mfi_tbolt_complete_cmd(sc); + } + /* This is a polled command, so busy-wait for it to complete. */ while (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { DELAY(1000); tm -= 1; if (tm <= 0) - break; + break; + if (cm->cm_flags & MFI_CMD_SCSI) { + /* check reply queue */ + mfi_tbolt_complete_cmd(sc); + } } if (hdr->cmd_status == MFI_STAT_INVALID_STATUS) { @@ -1375,7 +1325,7 @@ mfi_tbolt_sync_map_info(struct mfi_softc free(ld_sync, M_MFIBUF); goto out; } - + context = cmd->cm_frame->header.context; bzero(cmd->cm_frame, sizeof(union mfi_frame)); cmd->cm_frame->header.context = context; Modified: releng/9.1/sys/dev/mfi/mfivar.h ============================================================================== --- releng/9.1/sys/dev/mfi/mfivar.h Thu Aug 22 00:51:43 2013 (r254630) +++ releng/9.1/sys/dev/mfi/mfivar.h Thu Aug 22 00:51:48 2013 (r254631) @@ -105,6 +105,7 @@ struct mfi_command { #define MFI_ON_MFIQ_READY (1<<6) #define MFI_ON_MFIQ_BUSY (1<<7) #define MFI_ON_MFIQ_MASK ((1<<5)|(1<<6)|(1<<7)) +#define MFI_CMD_SCSI (1<<8) uint8_t retry_for_fw_reset; void (* cm_complete)(struct mfi_command *cm); void *cm_private; @@ -125,6 +126,11 @@ struct mfi_disk { #define MFI_DISK_FLAGS_DISABLED 0x02 }; +struct mfi_disk_pending { + TAILQ_ENTRY(mfi_disk_pending) ld_link; + int ld_id; +}; + struct mfi_system_pd { TAILQ_ENTRY(mfi_system_pd) pd_link; device_t pd_dev; @@ -136,6 +142,11 @@ struct mfi_system_pd { int pd_flags; }; +struct mfi_system_pending { + TAILQ_ENTRY(mfi_system_pending) pd_link; + int pd_id; +}; + struct mfi_evt_queue_elm { TAILQ_ENTRY(mfi_evt_queue_elm) link; struct mfi_evt_detail detail; @@ -284,6 +295,8 @@ struct mfi_softc { TAILQ_HEAD(,mfi_disk) mfi_ld_tqh; TAILQ_HEAD(,mfi_system_pd) mfi_syspd_tqh; + TAILQ_HEAD(,mfi_disk_pending) mfi_ld_pend_tqh; + TAILQ_HEAD(,mfi_system_pending) mfi_syspd_pend_tqh; eventhandler_tag mfi_eh; struct cdev *mfi_cdev; @@ -302,6 +315,7 @@ struct mfi_softc { uint32_t frame_cnt); int (*mfi_adp_reset)(struct mfi_softc *sc); int (*mfi_adp_check_reset)(struct mfi_softc *sc); + void (*mfi_intr_ptr)(void *sc); /* ThunderBolt */ uint32_t mfi_tbolt; @@ -420,7 +434,8 @@ extern int mfi_tbolt_reset(struct mfi_so *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 00:51:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 598895F1; Thu, 22 Aug 2013 00:51:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3829C2A95; Thu, 22 Aug 2013 00:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M0pxh8012906; Thu, 22 Aug 2013 00:51:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M0pvxU012892; Thu, 22 Aug 2013 00:51:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308220051.r7M0pvxU012892@svn.freebsd.org> From: Xin LI Date: Thu, 22 Aug 2013 00:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254632 - in releng: 8.3 8.3/sys/conf 8.3/sys/netinet 8.3/sys/netinet6 8.4 8.4/sys/conf 8.4/sys/netinet 8.4/sys/netinet6 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 00:51:59 -0000 Author: delphij Date: Thu Aug 22 00:51:56 2013 New Revision: 254632 URL: http://svnweb.freebsd.org/changeset/base/254632 Log: Fix an integer overflow in computing the size of a temporary buffer can result in a buffer which is too small for the requested operation. [13:09] Fix a bug that could lead to kernel memory disclosure with SCTP state cookie. [13:10] Security: CVE-2013-3077 Security: FreeBSD-SA-13:09.ip_multicast Security: CVE-2013-5209 Security: FreeBSD-SA-13:10.sctp Approved by: so Modified: releng/8.3/UPDATING releng/8.3/sys/conf/newvers.sh releng/8.3/sys/netinet/in_mcast.c releng/8.3/sys/netinet/sctp_output.c releng/8.3/sys/netinet6/in6_mcast.c releng/8.4/UPDATING releng/8.4/sys/conf/newvers.sh releng/8.4/sys/netinet/in_mcast.c releng/8.4/sys/netinet/sctp_output.c releng/8.4/sys/netinet6/in6_mcast.c Modified: releng/8.3/UPDATING ============================================================================== --- releng/8.3/UPDATING Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.3/UPDATING Thu Aug 22 00:51:56 2013 (r254632) @@ -15,6 +15,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130822: p10 FreeBSD-SA-13:09.ip_multicast + FreeBSD-SA-13:10.sctp + Fix an integer overflow in computing the size of a temporary buffer + can result in a buffer which is too small for the requested + operation. [13:09] + + Fix a bug that could lead to kernel memory disclosure with + SCTP state cookie. [13:10] + 20130429: p9 FreeBSD-SA-13:08.nfsserver Fix a bug that allows remote client bypass the normal access checks when when -network or -host restrictions are Modified: releng/8.3/sys/conf/newvers.sh ============================================================================== --- releng/8.3/sys/conf/newvers.sh Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.3/sys/conf/newvers.sh Thu Aug 22 00:51:56 2013 (r254632) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.3" -BRANCH="RELEASE-p9" +BRANCH="RELEASE-p10" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.3/sys/netinet/in_mcast.c ============================================================================== --- releng/8.3/sys/netinet/in_mcast.c Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.3/sys/netinet/in_mcast.c Thu Aug 22 00:51:56 2013 (r254632) @@ -1613,6 +1613,8 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + msfr.msfr_nsrcs = in_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: releng/8.3/sys/netinet/sctp_output.c ============================================================================== --- releng/8.3/sys/netinet/sctp_output.c Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.3/sys/netinet/sctp_output.c Thu Aug 22 00:51:56 2013 (r254632) @@ -5456,6 +5456,14 @@ do_a_abort: } SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + /* + * We might not overwrite the identification[] completely and on + * some platforms time_entered will contain some padding. Therefore + * zero out the cookie to avoid putting uninitialized memory on the + * wire. + */ + memset(&stc, 0, sizeof(struct sctp_state_cookie)); + /* the time I built cookie */ (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); Modified: releng/8.3/sys/netinet6/in6_mcast.c ============================================================================== --- releng/8.3/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.3/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:56 2013 (r254632) @@ -1624,6 +1624,8 @@ in6p_get_source_filters(struct inpcb *in * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + msfr.msfr_nsrcs = in6_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: releng/8.4/UPDATING ============================================================================== --- releng/8.4/UPDATING Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.4/UPDATING Thu Aug 22 00:51:56 2013 (r254632) @@ -15,6 +15,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130822: p3 FreeBSD-SA-13:09.ip_multicast + FreeBSD-SA-13:10.sctp + Fix an integer overflow in computing the size of a temporary buffer + can result in a buffer which is too small for the requested + operation. [13:09] + + Fix a bug that could lead to kernel memory disclosure with + SCTP state cookie. [13:10] + 20130726: p2 FreeBSD-SA-13:07.bind Fix Denial of Service vulnerability in named(8). Modified: releng/8.4/sys/conf/newvers.sh ============================================================================== --- releng/8.4/sys/conf/newvers.sh Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.4/sys/conf/newvers.sh Thu Aug 22 00:51:56 2013 (r254632) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.4/sys/netinet/in_mcast.c ============================================================================== --- releng/8.4/sys/netinet/in_mcast.c Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.4/sys/netinet/in_mcast.c Thu Aug 22 00:51:56 2013 (r254632) @@ -1613,6 +1613,8 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in_mcast_maxsocksrc) + msfr.msfr_nsrcs = in_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, Modified: releng/8.4/sys/netinet/sctp_output.c ============================================================================== --- releng/8.4/sys/netinet/sctp_output.c Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.4/sys/netinet/sctp_output.c Thu Aug 22 00:51:56 2013 (r254632) @@ -5414,6 +5414,14 @@ do_a_abort: } SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + /* + * We might not overwrite the identification[] completely and on + * some platforms time_entered will contain some padding. Therefore + * zero out the cookie to avoid putting uninitialized memory on the + * wire. + */ + memset(&stc, 0, sizeof(struct sctp_state_cookie)); + /* the time I built cookie */ (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); Modified: releng/8.4/sys/netinet6/in6_mcast.c ============================================================================== --- releng/8.4/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:48 2013 (r254631) +++ releng/8.4/sys/netinet6/in6_mcast.c Thu Aug 22 00:51:56 2013 (r254632) @@ -1624,6 +1624,8 @@ in6p_get_source_filters(struct inpcb *in * has asked for, but we always tell userland how big the * buffer really needs to be. */ + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + msfr.msfr_nsrcs = in6_mcast_maxsocksrc; tss = NULL; if (msfr.msfr_srcs != NULL && msfr.msfr_nsrcs > 0) { tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 02:54:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F1DF807; Thu, 22 Aug 2013 02:54:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD822781; Thu, 22 Aug 2013 02:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M2sL17079996; Thu, 22 Aug 2013 02:54:21 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M2sLLs079994; Thu, 22 Aug 2013 02:54:21 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201308220254.r7M2sLLs079994@svn.freebsd.org> From: Justin Hibbits Date: Thu, 22 Aug 2013 02:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254634 - head/sys/cddl/dev/dtrace/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 02:54:21 -0000 Author: jhibbits Date: Thu Aug 22 02:54:20 2013 New Revision: 254634 URL: http://svnweb.freebsd.org/changeset/base/254634 Log: Make dtrace_copy() actually work on PowerPC. Although unused currently, it may be used in the future by dtrace. Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Thu Aug 22 01:54:52 2013 (r254633) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Thu Aug 22 02:54:20 2013 (r254634) @@ -125,13 +125,13 @@ void dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) */ ASENTRY_NOPROF(dtrace_copy) - addme %r7,%r3 - addme %r8,%r4 + subi %r7,%r3,1 + subi %r8,%r4,1 + mtctr %r5 1: lbzu %r3,1(%r7) stbu %r3,1(%r8) - addme %r5,%r5 - beq 2f + bdnz 1b 2: blr END(dtrace_copy) From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 04:47:07 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CE25A9DC; Thu, 22 Aug 2013 04:47:07 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1BC2C84; Thu, 22 Aug 2013 04:47:06 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id F0B4F7E81E; Thu, 22 Aug 2013 14:46:57 +1000 (EST) Message-ID: <521597C1.6070805@freebsd.org> Date: Thu, 22 Aug 2013 14:46:57 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130817 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254524 - head/sys/sys References: <201308191356.r7JDuELE075073@svn.freebsd.org> <521257E2.4020502@FreeBSD.org> <5213AAA1.6020700@freebsd.org> <5214DD31.6010205@freebsd.org> <5214E86F.1060102@freebsd.org> In-Reply-To: <5214E86F.1060102@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: Davide Italiano , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Navdeep Parhar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 04:47:08 -0000 On 08/22/13 02:18, Andre Oppermann wrote: > On 21.08.2013 17:59, Davide Italiano wrote: >> On Wed, Aug 21, 2013 at 5:30 PM, Andre Oppermann >> wrote: >>> On 20.08.2013 20:13, Davide Italiano wrote: >>>> >>>> On Tue, Aug 20, 2013 at 7:42 PM, Andre Oppermann >>>> wrote: >>>>> >>>>> On 19.08.2013 19:37, Navdeep Parhar wrote: >>>>>> >>>>>> Why reuse the freed up bits so soon (at least one of which >>>>>> I think was prematurely GC'ed -- see my other email on >>>>>> M_NOFREE). There was room beyond M_HASHTYPEBITS, no? >>>>> >>>>> >>>>> This is HEAD where kernel and modules have to be (re)compiled >>>>> together at any point in time. On stable this reuse would >>>>> not have been possible. >>>>> >>>>> In a subsequent commit I compacted and ordered the flags. >>>>> There's a couple of free ones remaining. >>>>> >>>>> I have some additional mbuf changes coming up to be posted >>>>> for possible objections later today. The close HEAD freeze >>>>> deadline has got me rushed a bit to allow 10.x backporting of >>>>> the checksum/offload overhaul. >>>>> >>>>> -- Andre >>>>> >>>> >>>> In my opinion the possibility we have about breaking KPI/KBI >>>> should not be abused, even if it's allowed in HEAD. In other >>>> words,people should go for preserving it when (as in this >>>> case) it's easy and without additional costs. Your point about >>>> "this is HEAD, it can be broken at any time" makes relatively >>>> little sense to me. Note that in the worst case such KPI/KBI >>>> breakages are annoying for $VENDORS who maintain out-of-tree >>>> code, which need to rebuild/change their code, or, if they get >>>> pissed off, drop FreeBSD support. In your case, it's just a >>>> matter of "code cleaness" about few lines, which, IMHO and >>>> always IMHO, doesn't justify the breakage. >>> >>> >>> Preserving the API but having to recompile is always fair game in >>> HEAD. In fact it happens all the time and the only supported way >>> to track HEAD is to recompile kernel and modules together. >>> >>> For removing (crufty) functionality I agree that it shouldn't be >>> done just for the sake of it and also shouldn't be done often. >>> Sometimes it is necessary in the name of progress. Having to >>> support old, crufty or broken ways of doing something is a waste >>> of developer time too. >>> >>> It's always a judgement call. In this case there is a perfectly >>> valid alternative way of doing that also is less dangerous to >>> leak mbufs. >>> >>> -- Andre >>> >> >> I don't see in any way how flags reordering might be in any way >> connected to mbufs leaks, alas. There's a similar recent('ish) >> discussion and it was decided to not compact/reorder flags. See >> r253662/r253775 for references. So, I'm not sure what's the >> de-facto policy, but still, as a community FreeBSD should decide >> one strategy and be stuck with that. It's a matter of being >> consistent, which, IMHO, is something that should not be >> undervaluated. > > I fail to see what problem you have with the flag reordering. > Recompile and done. That's why we work with #defines instead of > magic 0x1234 values. On a general note, Navdeep's and Davide's objections are fair and in line with defacto policy and established practice. Breaking the KBI because we allow ourselves to on head doesn't mean we should, especially when there is an alternative approach that preserves it, achieves the same outcome and would be an equivalent amount of effort. As noted by Navdeep, there are 4 bits beyond M_HASHTYPEBITS which could have been used. We want to allow as much time to elapse as possible between deprecating a bit's use/meaning and reusing it for something new. As an aside, embedding the date a bit became "free" in the comment next to the bit would be useful to ensure eventual bit reuse reclaims the oldest free bit(s) first. > If someone outside the tree was using the spare bits for their own > private purposes, yes, they would quickly have to check and possibly > adjust them. That's trivial however and should be expected when > tracking an OpenSource operating system. To be expected, sure, but we should only inflict the pain when it is truly necessary. Determining necessity should be straight forward in this instance: Are there other changes on the immediate horizon for 10.0 that require new bits? If yes, how many bits? If the answer is no, the recently deprecated bits should be reinstated as they were and M_PROTOFLAGS[9-12] should be moved to after M_HASHTYPEBITS. If yes, moving M_PROTOFLAGS[9-12] to after M_HASHTYPEBITS is probably a waste of time/effort (depending on how many bits are needed) as the new functionality will have to recycle some of the free bits anyway. In addition to this, the reordering done in r254527 is also a POLA and KBI issue for no gain. The flags easily fit on a single screen of text so it's not like they couldn't all be seen together easily. Changing bit definitions in such an important subsystem for purely cosmetic gain is a bad idea and I would argue in favour of reverting the reordering done in r254527 (which should have been committed as a separate commit anyway - lumping everything in one commit was unfortunate). The fact these patches don't have a "Reviewed by" line is of concern. "Discussed with" != "Reviewed by". I appreciate some of us (myself included) got a bit caught off guard by the proposed 10.0 timeline, but rushing changes, especially to critical infrastructure, without review is not a good idea. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 05:07:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ACAC8E2B; Thu, 22 Aug 2013 05:07:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 992A22D37; Thu, 22 Aug 2013 05:07:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M57ohh046350; Thu, 22 Aug 2013 05:07:50 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M57oRa046349; Thu, 22 Aug 2013 05:07:50 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201308220507.r7M57oRa046349@svn.freebsd.org> From: Justin Hibbits Date: Thu, 22 Aug 2013 05:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254639 - head/sys/powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 05:07:50 -0000 Author: jhibbits Date: Thu Aug 22 05:07:50 2013 New Revision: 254639 URL: http://svnweb.freebsd.org/changeset/base/254639 Log: Enable DTrace hooks in ppc64. Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Aug 22 05:03:41 2013 (r254638) +++ head/sys/powerpc/conf/GENERIC64 Thu Aug 22 05:07:50 2013 (r254639) @@ -24,6 +24,7 @@ ident GENERIC machine powerpc powerpc64 makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Platform support options POWERMAC #NewWorld Apple PowerMacs @@ -67,6 +68,8 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 05:25:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0FB1A2B0; Thu, 22 Aug 2013 05:25:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD7C62E0E; Thu, 22 Aug 2013 05:25:26 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:dce7:64f5:fb91:d8dd]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id DC2CF85AE; Thu, 22 Aug 2013 05:25:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us DC2CF85AE Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 22 Aug 2013 01:25:22 -0400 From: Glen Barber To: "David E. O'Brien" Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc Message-ID: <20130822052522.GA2285@glenbarber.us> References: <201308212257.r7LMvUmY053608@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <201308212257.r7LMvUmY053608@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 05:25:27 -0000 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 21, 2013 at 10:57:30PM +0000, David E. O'Brien wrote: > Author: obrien > Date: Wed Aug 21 22:57:29 2013 > New Revision: 254626 > URL: http://svnweb.freebsd.org/changeset/base/254626 >=20 > Log: > Provide a prototype for yyparse() so that "-Werror" along with stringent > -W* warnings can be used on byacc's output. >=20 > Modified: > stable/9/usr.bin/yacc/skeleton.c >=20 > Modified: stable/9/usr.bin/yacc/skeleton.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 > --- stable/9/usr.bin/yacc/skeleton.c Wed Aug 21 22:55:10 2013 (r254625) > +++ stable/9/usr.bin/yacc/skeleton.c Wed Aug 21 22:57:29 2013 (r254626) > @@ -196,6 +196,10 @@ const char *body[] =3D > "#endif /* ANSI-C/C++ */", > "#endif /* ! YYPARSE_PARAM */", > "", > + "#if defined(__cplusplus) || __STDC__", > + "extern int yyparse (YYPARSE_PARAM_ARG);", > + "#endif /* ANSI-C/C++ */", > + "", > "int", > "yyparse (YYPARSE_PARAM_ARG)", > " YYPARSE_PARAM_DECL", =3D=3D=3D> bin/expr (all) cc -O -pipe -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c expr.c cc1: warnings being treated as errors expr.c:812: warning: redundant redeclaration of 'yyparse' /src/bin/expr/expr.y:77: warning: previous declaration of 'yyparse' was here *** Error code 1 Stop in /src/bin/expr. *** Error code 1 Stop in /src/bin. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2013-08-22 05:18:18 - WARNING: /usr/bin/make returned exit code 1 TB --- 2013-08-22 05:18:18 - ERROR: failed to build world TB --- 2013-08-22 05:18:18 - 1691.60 user 375.84 system 2575.39 real http://tinderbox.freebsd.org/tinderbox-freebsd9-build-RELENG_9-arm-arm.full Glen --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJSFaDCAAoJEFJPDDeguUajt1cH/0mqJ6zbatHjd8pVGHU8sN3O 2VravtYFxoTj3vlYNqNcg215N4dsHROvdimCliv0kZs+h8NuKaZKwYR/KMqSrpxV s+2lTJk8k0Ga3/OxySy/F+KUIVfGnqjDze0mqphFTHESN0MG6H/FfTRTWSBnnj9m EDc81wtpcyVzePJiMbqnECBnghe98N0wQ9wSbuR1uWPELnBFkC2Q0Z8N6S1tAUgB pGZed7VZysCqwV6/83uSIWRFQ/FpsPog++0dyvjWTd6Tndx5kssgh+rdgGM45Z+u pEg1noeH+mB6kLItPfQjw5O5jNuLVNfFhIXy6SauUI9b8juo1sehpBr6ciVhqtU= =91kR -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/-- From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 05:53:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D0CC9FC; Thu, 22 Aug 2013 05:53:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 263E72F69; Thu, 22 Aug 2013 05:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M5rm3E069419; Thu, 22 Aug 2013 05:53:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M5rlbG069416; Thu, 22 Aug 2013 05:53:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201308220553.r7M5rlbG069416@svn.freebsd.org> From: Adrian Chadd Date: Thu, 22 Aug 2013 05:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254640 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 05:53:48 -0000 Author: adrian Date: Thu Aug 22 05:53:47 2013 New Revision: 254640 URL: http://svnweb.freebsd.org/changeset/base/254640 Log: Add in some backwards compatability hacks to make -HEAD net80211 compile on -9. Modified: head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Aug 22 05:07:50 2013 (r254639) +++ head/sys/net80211/ieee80211_freebsd.h Thu Aug 22 05:53:47 2013 (r254640) @@ -234,9 +234,22 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_FF M_PROTO6 /* fast frame */ #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ + +/* + * FreeBSD-HEAD from 1000046 retired M_*FRAG* flags and turned them + * into header flags instead. So, we use the new protocol-specific + * flags. + * + * Earlier FreeBSD versions overload M_FRAG, M_FIRSTFRAG and M_LASTFRAG. + * + * XXX TODO: rename these fields so there are no namespace clashes! + */ +#if __FreeBSD_version >= 1000046 #define M_FRAG M_PROTO9 /* frame fragmentation */ #define M_FIRSTFRAG M_PROTO10 /* first frame fragment */ #define M_LASTFRAG M_PROTO11 /* last frame fragment */ +#endif + #define M_80211_TX \ (M_ENCAP|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB| \ M_AMPDU_MPDU|M_FRAG|M_FIRSTFRAG|M_LASTFRAG) @@ -249,10 +262,18 @@ struct mbuf *ieee80211_getmgtframe(uint8 #endif #define M_80211_RX (M_AMPDU|M_WEP|M_AMPDU_MPDU) +#if __FreeBSD_version >= 1000046 #define IEEE80211_MBUF_TX_FLAG_BITS \ M_FLAG_BITS \ "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \ "\24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG" +#else +/* There aren't any flag bits available for versions before this */ +/* XXX TODO: implement M_FLAG_BITS for this! */ +#define IEEE80211_MBUF_TX_FLAG_BITS \ + "\15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB" \ + "\24M_AMPDU_MPDU" +#endif #define IEEE80211_MBUF_RX_FLAG_BITS \ M_FLAG_BITS \ Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Thu Aug 22 05:07:50 2013 (r254639) +++ head/sys/net80211/ieee80211_hostap.c Thu Aug 22 05:53:47 2013 (r254640) @@ -355,8 +355,12 @@ hostap_deliver_data(struct ieee80211vap struct ifnet *ifp = vap->iv_ifp; /* clear driver/net80211 flags before passing up */ +#if __FreeBSD_version >= 1000046 m->m_flags &= ~(M_MCAST | M_BCAST); m_clrprotoflags(m); +#else + m->m_flags &= ~(M_80211_RX | M_MCAST | M_BCAST); +#endif KASSERT(vap->iv_opmode == IEEE80211_M_HOSTAP, ("gack, opmode %d", vap->iv_opmode)); Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Thu Aug 22 05:07:50 2013 (r254639) +++ head/sys/net80211/ieee80211_input.c Thu Aug 22 05:53:47 2013 (r254640) @@ -251,7 +251,9 @@ ieee80211_deliver_data(struct ieee80211v /* clear driver/net80211 flags before passing up */ m->m_flags &= ~(M_MCAST | M_BCAST); +#if __FreeBSD_version >= 1000046 m_clrprotoflags(m); +#endif /* NB: see hostap_deliver_data, this path doesn't handle hostap */ KASSERT(vap->iv_opmode != IEEE80211_M_HOSTAP, ("gack, hostap")); From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 06:20:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2877E2A5; Thu, 22 Aug 2013 06:20:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1605A212A; Thu, 22 Aug 2013 06:20:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M6KPwk081832; Thu, 22 Aug 2013 06:20:25 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M6KPs2081831; Thu, 22 Aug 2013 06:20:25 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201308220620.r7M6KPs2081831@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Aug 2013 06:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254641 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 06:20:26 -0000 Author: ae Date: Thu Aug 22 06:20:25 2013 New Revision: 254641 URL: http://svnweb.freebsd.org/changeset/base/254641 Log: MFC r254095: gpt_entries is used as limit for the number of partition entries in the GEOM_PART. Instead of just using number of entries from the GPT header, calculate this limit based on the reserved space between GPT header and first available LBA. Modified: stable/9/sys/geom/part/g_part_gpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/9/sys/geom/part/g_part_gpt.c Thu Aug 22 05:53:47 2013 (r254640) +++ stable/9/sys/geom/part/g_part_gpt.c Thu Aug 22 06:20:25 2013 (r254641) @@ -903,9 +903,10 @@ g_part_gpt_read(struct g_part_table *bas basetable->gpt_first = table->hdr->hdr_lba_start; basetable->gpt_last = table->hdr->hdr_lba_end; - basetable->gpt_entries = table->hdr->hdr_entries; + basetable->gpt_entries = (table->hdr->hdr_lba_start - 2) * + pp->sectorsize / table->hdr->hdr_entsz; - for (index = basetable->gpt_entries - 1; index >= 0; index--) { + for (index = table->hdr->hdr_entries - 1; index >= 0; index--) { if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused)) continue; entry = (struct g_part_gpt_entry *)g_part_new_entry( From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 06:24:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 795CA40E; Thu, 22 Aug 2013 06:24:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66F42213F; Thu, 22 Aug 2013 06:24:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M6O3aX084657; Thu, 22 Aug 2013 06:24:03 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M6O3UC084656; Thu, 22 Aug 2013 06:24:03 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201308220624.r7M6O3UC084656@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Aug 2013 06:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254642 - stable/8/sys/geom/part X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 06:24:03 -0000 Author: ae Date: Thu Aug 22 06:24:02 2013 New Revision: 254642 URL: http://svnweb.freebsd.org/changeset/base/254642 Log: MFC r254095: gpt_entries is used as limit for the number of partition entries in the GEOM_PART. Instead of just using number of entries from the GPT header, calculate this limit based on the reserved space between GPT header and first available LBA. Modified: stable/8/sys/geom/part/g_part_gpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Thu Aug 22 06:20:25 2013 (r254641) +++ stable/8/sys/geom/part/g_part_gpt.c Thu Aug 22 06:24:02 2013 (r254642) @@ -793,9 +793,10 @@ g_part_gpt_read(struct g_part_table *bas basetable->gpt_first = table->hdr->hdr_lba_start; basetable->gpt_last = table->hdr->hdr_lba_end; - basetable->gpt_entries = table->hdr->hdr_entries; + basetable->gpt_entries = (table->hdr->hdr_lba_start - 2) * + pp->sectorsize / table->hdr->hdr_entsz; - for (index = basetable->gpt_entries - 1; index >= 0; index--) { + for (index = table->hdr->hdr_entries - 1; index >= 0; index--) { if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused)) continue; entry = (struct g_part_gpt_entry *)g_part_new_entry( From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 07:39:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EF62FD97; Thu, 22 Aug 2013 07:39:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE2732571; Thu, 22 Aug 2013 07:39:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M7dvxF021883; Thu, 22 Aug 2013 07:39:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M7dsHX021841; Thu, 22 Aug 2013 07:39:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308220739.r7M7dsHX021841@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 07:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254649 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/agp dev/drm2/i915 dev/drm2/ttm dev/md kern sparc64/sparc64 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 07:39:58 -0000 Author: kib Date: Thu Aug 22 07:39:53 2013 New Revision: 254649 URL: http://svnweb.freebsd.org/changeset/base/254649 Log: Remove the deprecated VM_ALLOC_RETRY flag for the vm_page_grab(9). The flag was mandatory since r209792, where vm_page_grab(9) was changed to only support the alloc retry semantic. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_tt.c head/sys/dev/md/md.c head/sys/kern/kern_exec.c head/sys/kern/kern_sharedpage.c head/sys/kern/uipc_shm.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_bio.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/swap_pager.c head/sys/vm/vm_glue.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 22 07:39:53 2013 (r254649) @@ -539,7 +539,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u int bytes = MIN(PAGESIZE, len); pp = vm_page_grab(obj, OFF_TO_IDX(start), VM_ALLOC_SBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY); + VM_ALLOC_NORMAL | VM_ALLOC_IGN_SBUSY); if (pp->valid == 0) { zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/dev/agp/agp.c Thu Aug 22 07:39:53 2013 (r254649) @@ -555,7 +555,7 @@ agp_generic_bind_memory(device_t dev, st * the pages will be allocated and zeroed. */ m = vm_page_grab(mem->am_obj, OFF_TO_IDX(i), - VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); + VM_ALLOC_WIRED | VM_ALLOC_ZERO); AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m)); } VM_OBJECT_WUNLOCK(mem->am_obj); Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/dev/agp/agp_i810.c Thu Aug 22 07:39:53 2013 (r254649) @@ -1970,7 +1970,7 @@ agp_i810_alloc_memory(device_t dev, int */ VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); + VM_ALLOC_WIRED | VM_ALLOC_ZERO); VM_OBJECT_WUNLOCK(mem->am_obj); mem->am_physical = VM_PAGE_TO_PHYS(m); } else { Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Aug 22 07:39:53 2013 (r254649) @@ -2099,9 +2099,7 @@ i915_gem_object_bind_to_gtt(struct drm_i obj->gtt_space = NULL; /* * i915_gem_object_get_pages_gtt() cannot return - * ENOMEM, since we use vm_page_grab(VM_ALLOC_RETRY) - * (which does not support operation without a flag - * anyway). + * ENOMEM, since we use vm_page_grab(). */ return (ret); } @@ -2516,7 +2514,7 @@ i915_gem_wire_page(vm_object_t object, v int rv; VM_OBJECT_ASSERT_WLOCKED(object); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(object, pindex, NULL, NULL)) { rv = vm_pager_get_pages(object, &m, 1, 0); Modified: head/sys/dev/drm2/ttm/ttm_tt.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_tt.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/dev/drm2/ttm/ttm_tt.c Thu Aug 22 07:39:53 2013 (r254649) @@ -288,7 +288,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) VM_OBJECT_WLOCK(obj); vm_object_pip_add(obj, 1); for (i = 0; i < ttm->num_pages; ++i) { - from_page = vm_page_grab(obj, i, VM_ALLOC_RETRY); + from_page = vm_page_grab(obj, i, VM_ALLOC_NORMAL); if (from_page->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(obj, i, NULL, NULL)) { rv = vm_pager_get_pages(obj, &from_page, 1, 0); @@ -351,7 +351,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, v from_page = ttm->pages[i]; if (unlikely(from_page == NULL)) continue; - to_page = vm_page_grab(obj, i, VM_ALLOC_RETRY); + to_page = vm_page_grab(obj, i, VM_ALLOC_NORMAL); pmap_copy_page(from_page, to_page); vm_page_dirty(to_page); to_page->valid = VM_PAGE_BITS_ALL; Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/dev/md/md.c Thu Aug 22 07:39:53 2013 (r254649) @@ -826,8 +826,7 @@ mdstart_swap(struct md_s *sc, struct bio vm_object_pip_add(sc->object, 1); for (i = bp->bio_offset / PAGE_SIZE; i <= lastp; i++) { len = ((i == lastp) ? lastend : PAGE_SIZE) - offs; - m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL | - VM_ALLOC_RETRY); + m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL); if (bp->bio_cmd == BIO_READ) { if (m->valid == VM_PAGE_BITS_ALL) rv = VM_PAGER_OK; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/kern/kern_exec.c Thu Aug 22 07:39:53 2013 (r254649) @@ -934,7 +934,7 @@ exec_map_first_page(imgp) object->pg_color = 0; } #endif - ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL); if (ma[0]->valid != VM_PAGE_BITS_ALL) { initial_pagein = VM_INITIAL_PAGEIN; if (initial_pagein > object->size) Modified: head/sys/kern/kern_sharedpage.c ============================================================================== --- head/sys/kern/kern_sharedpage.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/kern/kern_sharedpage.c Thu Aug 22 07:39:53 2013 (r254649) @@ -108,8 +108,7 @@ shared_page_init(void *dummy __unused) shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE, VM_PROT_DEFAULT, 0, NULL); VM_OBJECT_WLOCK(shared_page_obj); - m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_RETRY | VM_ALLOC_NOBUSY | - VM_ALLOC_ZERO); + m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO); m->valid = VM_PAGE_BITS_ALL; VM_OBJECT_WUNLOCK(shared_page_obj); addr = kva_alloc(PAGE_SIZE); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/kern/uipc_shm.c Thu Aug 22 07:39:53 2013 (r254649) @@ -165,7 +165,7 @@ uiomove_object_page(vm_object_t obj, siz * lock to page out tobj's pages because tobj is a OBJT_SWAP * type object. */ - m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(obj, idx, NULL, NULL)) { rv = vm_pager_get_pages(obj, &m, 1, 0); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/kern/uipc_syscalls.c Thu Aug 22 07:39:53 2013 (r254649) @@ -2230,7 +2230,7 @@ retry_space: pindex = OFF_TO_IDX(off); VM_OBJECT_WLOCK(obj); pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY); + VM_ALLOC_NORMAL | VM_ALLOC_WIRED); /* * Check if page is valid for what we need, Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/kern/vfs_bio.c Thu Aug 22 07:39:53 2013 (r254649) @@ -3490,7 +3490,7 @@ allocbuf(struct buf *bp, int size) m = vm_page_grab(obj, OFF_TO_IDX(bp->b_offset) + bp->b_npages, VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED | - VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY | + VM_ALLOC_IGN_SBUSY | VM_ALLOC_COUNT(desiredpages - bp->b_npages)); if (m->valid == 0) bp->b_flags &= ~B_CACHE; Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/sparc64/sparc64/pmap.c Thu Aug 22 07:39:53 2013 (r254649) @@ -1230,7 +1230,7 @@ pmap_pinit(pmap_t pm) VM_OBJECT_WLOCK(pm->pm_tsb_obj); for (i = 0; i < TSB_PAGES; i++) { m = vm_page_grab(pm->pm_tsb_obj, i, VM_ALLOC_NOBUSY | - VM_ALLOC_RETRY | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + VM_ALLOC_WIRED | VM_ALLOC_ZERO); m->valid = VM_PAGE_BITS_ALL; m->md.pmap = pm; ma[i] = m; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/vm/swap_pager.c Thu Aug 22 07:39:53 2013 (r254649) @@ -1711,7 +1711,7 @@ swp_pager_force_pagein(vm_object_t objec vm_page_t m; vm_object_pip_add(object, 1); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_subtract(object, 1); vm_page_dirty(m); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/vm/vm_glue.c Thu Aug 22 07:39:53 2013 (r254649) @@ -233,7 +233,7 @@ vm_imgact_hold_page(vm_object_t object, VM_OBJECT_WLOCK(object); pindex = OFF_TO_IDX(offset); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid != VM_PAGE_BITS_ALL) { ma[0] = m; rv = vm_pager_get_pages(object, ma, 1, 0); @@ -395,7 +395,7 @@ vm_thread_new(struct thread *td, int pag * Get a kernel stack page. */ m = vm_page_grab(ksobj, i, VM_ALLOC_NOBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); + VM_ALLOC_NORMAL | VM_ALLOC_WIRED); ma[i] = m; m->valid = VM_PAGE_BITS_ALL; } @@ -527,7 +527,7 @@ vm_thread_swapin(struct thread *td) ksobj = td->td_kstack_obj; VM_OBJECT_WLOCK(ksobj); for (i = 0; i < pages; i++) - ma[i] = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + ma[i] = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_WIRED); for (i = 0; i < pages; i++) { if (ma[i]->valid != VM_PAGE_BITS_ALL) { Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/vm/vm_object.c Thu Aug 22 07:39:53 2013 (r254649) @@ -2034,8 +2034,7 @@ vm_object_populate(vm_object_t object, v VM_OBJECT_ASSERT_WLOCKED(object); for (pindex = start; pindex < end; pindex++) { - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | - VM_ALLOC_RETRY); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid != VM_PAGE_BITS_ALL) { ma[0] = m; rv = vm_pager_get_pages(object, ma, 1, 0); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/vm/vm_page.c Thu Aug 22 07:39:53 2013 (r254649) @@ -2685,9 +2685,6 @@ vm_page_advise(vm_page_t m, int advice) * to be in the object. If the page doesn't exist, first allocate it * and then conditionally zero it. * - * The caller must always specify the VM_ALLOC_RETRY flag. This is intended - * to facilitate its eventual removal. - * * This routine may sleep. * * The object must be locked on entry. The lock will, however, be released @@ -2700,8 +2697,6 @@ vm_page_grab(vm_object_t object, vm_pind int sleep; VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT((allocflags & VM_ALLOC_RETRY) != 0, - ("vm_page_grab: VM_ALLOC_RETRY is required")); KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || (allocflags & VM_ALLOC_IGN_SBUSY) != 0, ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch")); @@ -2735,8 +2730,7 @@ retrylookup: return (m); } } - m = vm_page_alloc(object, pindex, allocflags & ~(VM_ALLOC_RETRY | - VM_ALLOC_IGN_SBUSY)); + m = vm_page_alloc(object, pindex, allocflags & ~VM_ALLOC_IGN_SBUSY); if (m == NULL) { VM_OBJECT_WUNLOCK(object); VM_WAIT; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Aug 22 07:10:18 2013 (r254648) +++ head/sys/vm/vm_page.h Thu Aug 22 07:39:53 2013 (r254649) @@ -389,7 +389,6 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa) /* page allocation flags: */ #define VM_ALLOC_WIRED 0x0020 /* non pageable */ #define VM_ALLOC_ZERO 0x0040 /* Try to obtain a zeroed page */ -#define VM_ALLOC_RETRY 0x0080 /* Mandatory with vm_page_grab() */ #define VM_ALLOC_NOOBJ 0x0100 /* No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* Do not busy the page */ #define VM_ALLOC_IFCACHED 0x0400 /* Fail if the page is not cached */ From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 07:43:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 15C11D4; Thu, 22 Aug 2013 07:43:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 036B625B9; Thu, 22 Aug 2013 07:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M7haot024935; Thu, 22 Aug 2013 07:43:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M7haKx024934; Thu, 22 Aug 2013 07:43:36 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201308220743.r7M7haKx024934@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 22 Aug 2013 07:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254650 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 07:43:37 -0000 Author: des Date: Thu Aug 22 07:43:36 2013 New Revision: 254650 URL: http://svnweb.freebsd.org/changeset/base/254650 Log: Even though it doesn't really make sense in the context of a CONNECT request, RFC 2616 14.23 mandates the presence of the Host: header in all HTTP 1.1 requests. PR: kern/181445 Submitted by: Kimo MFC after: 3 days Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Aug 22 07:39:53 2013 (r254649) +++ head/lib/libfetch/http.c Thu Aug 22 07:43:36 2013 (r254650) @@ -1400,6 +1400,8 @@ http_connect(struct url *URL, struct url if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { http_cmd(conn, "CONNECT %s:%d HTTP/1.1", URL->host, URL->port); + http_cmd(conn, "Host: %s:%d", + URL->host, URL->port); http_cmd(conn, ""); if (http_get_reply(conn) != HTTP_OK) { fetch_close(conn); From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 08:12:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D4AD383C; Thu, 22 Aug 2013 08:12:58 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9769B279D; Thu, 22 Aug 2013 08:12:58 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id E0BAA4B95; Thu, 22 Aug 2013 08:12:56 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id EE4CF2FB7D; Thu, 22 Aug 2013 10:12:48 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "David E. O'Brien" Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc References: <201308212257.r7LMvUmY053608@svn.freebsd.org> Date: Thu, 22 Aug 2013 10:12:39 +0200 In-Reply-To: <201308212257.r7LMvUmY053608@svn.freebsd.org> (David E. O'Brien's message of "Wed, 21 Aug 2013 22:57:30 +0000 (UTC)") Message-ID: <8638q2i1oo.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 08:12:58 -0000 "David E. O'Brien" writes: > Log: > Provide a prototype for yyparse() so that "-Werror" along with stringent > -W* warnings can be used on byacc's output. This breaks the build in usr.bin/expr because expr.y already provides a prototype, and gcc does not accept multiple prototypes, even if they're identical. That is arguably a bug in gcc, but in the meantime, it should be fixed either by reverting this commit or removing the extra prototype in expr.y. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 08:15:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6FDD89FB; Thu, 22 Aug 2013 08:15:04 +0000 (UTC) (envelope-from erwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59EC027BB; Thu, 22 Aug 2013 08:15:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7M8F4o6040878; Thu, 22 Aug 2013 08:15:04 GMT (envelope-from erwin@svn.freebsd.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7M8F4SN040876; Thu, 22 Aug 2013 08:15:04 GMT (envelope-from erwin@svn.freebsd.org) Message-Id: <201308220815.r7M8F4SN040876@svn.freebsd.org> From: Erwin Lansing Date: Thu, 22 Aug 2013 08:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254651 - in head: contrib/bind9 contrib/bind9/bin contrib/bind9/bin/check contrib/bind9/bin/confgen contrib/bind9/bin/dig contrib/bind9/bin/dig/include/dig contrib/bind9/bin/dnssec con... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 08:15:04 -0000 Author: erwin Date: Thu Aug 22 08:15:03 2013 New Revision: 254651 URL: http://svnweb.freebsd.org/changeset/base/254651 Log: Update Bind to 9.9.3-P2 Notable new features: * Elliptic Curve Digital Signature Algorithm keys and signatures in DNSSEC are now supported per RFC 6605. [RT #21918] * Introduces a new tool "dnssec-verify" that validates a signed zone, checking for the correctness of signatures and NSEC/NSEC3 chains. [RT #23673] * BIND now recognizes the TLSA resource record type, created to support IETF DANE (DNS-based Authentication of Named Entities) [RT #28989] * The new "inline-signing" option, in combination with the "auto-dnssec" option that was introduced in BIND 9.7, allows named to sign zones completely transparently. Approved by: delphij (mentor) MFC after: 3 days Sponsored by: DK Hostmaster A/S Added: head/contrib/bind9/bin/dnssec/dnssec-verify.8 - copied unchanged from r254322, vendor/bind9/dist/bin/dnssec/dnssec-verify.8 head/contrib/bind9/bin/dnssec/dnssec-verify.c - copied unchanged from r254322, vendor/bind9/dist/bin/dnssec/dnssec-verify.c head/contrib/bind9/bin/dnssec/dnssec-verify.docbook - copied unchanged from r254322, vendor/bind9/dist/bin/dnssec/dnssec-verify.docbook head/contrib/bind9/bin/dnssec/dnssec-verify.html - copied unchanged from r254322, vendor/bind9/dist/bin/dnssec/dnssec-verify.html head/contrib/bind9/bin/named/bind9.ver3.xsl - copied unchanged from r254322, vendor/bind9/dist/bin/named/bind9.ver3.xsl head/contrib/bind9/bin/named/bind9.ver3.xsl.h - copied unchanged from r254322, vendor/bind9/dist/bin/named/bind9.ver3.xsl.h head/contrib/bind9/doc/arm/man.dnssec-verify.html - copied unchanged from r254322, vendor/bind9/dist/doc/arm/man.dnssec-verify.html head/contrib/bind9/lib/dns/clientinfo.c - copied unchanged from r254322, vendor/bind9/dist/lib/dns/clientinfo.c head/contrib/bind9/lib/dns/include/dns/clientinfo.h - copied unchanged from r254322, vendor/bind9/dist/lib/dns/include/dns/clientinfo.h head/contrib/bind9/lib/dns/include/dns/update.h - copied unchanged from r254322, vendor/bind9/dist/lib/dns/include/dns/update.h head/contrib/bind9/lib/dns/rdata/generic/naptr_35.c - copied unchanged from r254322, vendor/bind9/dist/lib/dns/rdata/generic/naptr_35.c head/contrib/bind9/lib/dns/rdata/generic/naptr_35.h - copied unchanged from r254322, vendor/bind9/dist/lib/dns/rdata/generic/naptr_35.h head/contrib/bind9/lib/dns/update.c - copied unchanged from r254322, vendor/bind9/dist/lib/dns/update.c head/contrib/bind9/lib/isc/include/isc/pool.h - copied unchanged from r254322, vendor/bind9/dist/lib/isc/include/isc/pool.h head/contrib/bind9/lib/isc/include/isc/queue.h - copied unchanged from r254322, vendor/bind9/dist/lib/isc/include/isc/queue.h head/contrib/bind9/lib/isc/pool.c - copied unchanged from r254322, vendor/bind9/dist/lib/isc/pool.c head/usr.sbin/dnssec-verify/ head/usr.sbin/dnssec-verify/Makefile (contents, props changed) Deleted: head/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c head/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h Modified: head/contrib/bind9/CHANGES head/contrib/bind9/COPYRIGHT head/contrib/bind9/HISTORY head/contrib/bind9/Makefile.in head/contrib/bind9/README head/contrib/bind9/bin/Makefile.in head/contrib/bind9/bin/check/check-tool.c head/contrib/bind9/bin/check/check-tool.h head/contrib/bind9/bin/check/named-checkconf.c head/contrib/bind9/bin/check/named-checkzone.8 head/contrib/bind9/bin/check/named-checkzone.c head/contrib/bind9/bin/check/named-checkzone.docbook head/contrib/bind9/bin/check/named-checkzone.html head/contrib/bind9/bin/confgen/ddns-confgen.c head/contrib/bind9/bin/confgen/rndc-confgen.c head/contrib/bind9/bin/dig/Makefile.in head/contrib/bind9/bin/dig/dig.1 head/contrib/bind9/bin/dig/dig.c head/contrib/bind9/bin/dig/dig.docbook head/contrib/bind9/bin/dig/dig.html head/contrib/bind9/bin/dig/dighost.c head/contrib/bind9/bin/dig/host.c head/contrib/bind9/bin/dig/include/dig/dig.h head/contrib/bind9/bin/dig/nslookup.c head/contrib/bind9/bin/dnssec/Makefile.in head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.8 head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook head/contrib/bind9/bin/dnssec/dnssec-dsfromkey.html head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8 head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook head/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.html head/contrib/bind9/bin/dnssec/dnssec-keygen.8 head/contrib/bind9/bin/dnssec/dnssec-keygen.c head/contrib/bind9/bin/dnssec/dnssec-keygen.docbook head/contrib/bind9/bin/dnssec/dnssec-keygen.html head/contrib/bind9/bin/dnssec/dnssec-revoke.c head/contrib/bind9/bin/dnssec/dnssec-revoke.docbook head/contrib/bind9/bin/dnssec/dnssec-settime.8 head/contrib/bind9/bin/dnssec/dnssec-settime.c head/contrib/bind9/bin/dnssec/dnssec-settime.docbook head/contrib/bind9/bin/dnssec/dnssec-settime.html head/contrib/bind9/bin/dnssec/dnssec-signzone.8 head/contrib/bind9/bin/dnssec/dnssec-signzone.c head/contrib/bind9/bin/dnssec/dnssec-signzone.docbook head/contrib/bind9/bin/dnssec/dnssec-signzone.html head/contrib/bind9/bin/dnssec/dnssectool.c head/contrib/bind9/bin/dnssec/dnssectool.h head/contrib/bind9/bin/named/Makefile.in head/contrib/bind9/bin/named/builtin.c head/contrib/bind9/bin/named/client.c head/contrib/bind9/bin/named/config.c head/contrib/bind9/bin/named/control.c head/contrib/bind9/bin/named/controlconf.c head/contrib/bind9/bin/named/include/dlz/dlz_dlopen_driver.h head/contrib/bind9/bin/named/include/named/client.h head/contrib/bind9/bin/named/include/named/control.h head/contrib/bind9/bin/named/include/named/globals.h head/contrib/bind9/bin/named/include/named/interfacemgr.h head/contrib/bind9/bin/named/include/named/server.h head/contrib/bind9/bin/named/include/named/zoneconf.h head/contrib/bind9/bin/named/interfacemgr.c head/contrib/bind9/bin/named/logconf.c head/contrib/bind9/bin/named/main.c head/contrib/bind9/bin/named/named.8 head/contrib/bind9/bin/named/named.conf.5 head/contrib/bind9/bin/named/named.conf.docbook head/contrib/bind9/bin/named/named.conf.html head/contrib/bind9/bin/named/named.docbook head/contrib/bind9/bin/named/named.html head/contrib/bind9/bin/named/query.c head/contrib/bind9/bin/named/server.c head/contrib/bind9/bin/named/statschannel.c head/contrib/bind9/bin/named/unix/Makefile.in head/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c head/contrib/bind9/bin/named/unix/os.c head/contrib/bind9/bin/named/update.c head/contrib/bind9/bin/named/xfrout.c head/contrib/bind9/bin/named/zoneconf.c head/contrib/bind9/bin/nsupdate/Makefile.in head/contrib/bind9/bin/nsupdate/nsupdate.1 head/contrib/bind9/bin/nsupdate/nsupdate.c head/contrib/bind9/bin/nsupdate/nsupdate.docbook head/contrib/bind9/bin/nsupdate/nsupdate.html head/contrib/bind9/bin/rndc/rndc.c head/contrib/bind9/bin/tools/genrandom.8 head/contrib/bind9/bin/tools/genrandom.docbook head/contrib/bind9/bin/tools/genrandom.html head/contrib/bind9/bin/tools/nsec3hash.c head/contrib/bind9/config.h.in head/contrib/bind9/config.threads.in head/contrib/bind9/configure.in head/contrib/bind9/doc/arm/Bv9ARM-book.xml head/contrib/bind9/doc/arm/Bv9ARM.ch01.html head/contrib/bind9/doc/arm/Bv9ARM.ch03.html head/contrib/bind9/doc/arm/Bv9ARM.ch04.html head/contrib/bind9/doc/arm/Bv9ARM.ch05.html head/contrib/bind9/doc/arm/Bv9ARM.ch06.html head/contrib/bind9/doc/arm/Bv9ARM.ch07.html head/contrib/bind9/doc/arm/Bv9ARM.ch08.html head/contrib/bind9/doc/arm/Bv9ARM.ch09.html head/contrib/bind9/doc/arm/Bv9ARM.ch10.html head/contrib/bind9/doc/arm/Bv9ARM.html head/contrib/bind9/doc/arm/Bv9ARM.pdf head/contrib/bind9/doc/arm/dnssec.xml head/contrib/bind9/doc/arm/man.arpaname.html head/contrib/bind9/doc/arm/man.ddns-confgen.html head/contrib/bind9/doc/arm/man.dig.html head/contrib/bind9/doc/arm/man.dnssec-dsfromkey.html head/contrib/bind9/doc/arm/man.dnssec-keyfromlabel.html head/contrib/bind9/doc/arm/man.dnssec-keygen.html head/contrib/bind9/doc/arm/man.dnssec-revoke.html head/contrib/bind9/doc/arm/man.dnssec-settime.html head/contrib/bind9/doc/arm/man.dnssec-signzone.html head/contrib/bind9/doc/arm/man.genrandom.html head/contrib/bind9/doc/arm/man.host.html head/contrib/bind9/doc/arm/man.isc-hmac-fixup.html head/contrib/bind9/doc/arm/man.named-checkconf.html head/contrib/bind9/doc/arm/man.named-checkzone.html head/contrib/bind9/doc/arm/man.named-journalprint.html head/contrib/bind9/doc/arm/man.named.html head/contrib/bind9/doc/arm/man.nsec3hash.html head/contrib/bind9/doc/arm/man.nsupdate.html head/contrib/bind9/doc/arm/man.rndc-confgen.html head/contrib/bind9/doc/arm/man.rndc.conf.html head/contrib/bind9/doc/arm/man.rndc.html head/contrib/bind9/doc/arm/pkcs11.xml head/contrib/bind9/doc/misc/options head/contrib/bind9/lib/bind9/api head/contrib/bind9/lib/bind9/check.c head/contrib/bind9/lib/dns/Makefile.in head/contrib/bind9/lib/dns/acache.c head/contrib/bind9/lib/dns/acl.c head/contrib/bind9/lib/dns/adb.c head/contrib/bind9/lib/dns/api head/contrib/bind9/lib/dns/byaddr.c head/contrib/bind9/lib/dns/cache.c head/contrib/bind9/lib/dns/callbacks.c head/contrib/bind9/lib/dns/client.c head/contrib/bind9/lib/dns/db.c head/contrib/bind9/lib/dns/dbtable.c head/contrib/bind9/lib/dns/diff.c head/contrib/bind9/lib/dns/dispatch.c head/contrib/bind9/lib/dns/dns64.c head/contrib/bind9/lib/dns/dnssec.c head/contrib/bind9/lib/dns/dst_api.c head/contrib/bind9/lib/dns/dst_internal.h head/contrib/bind9/lib/dns/dst_openssl.h head/contrib/bind9/lib/dns/dst_parse.c head/contrib/bind9/lib/dns/ecdb.c head/contrib/bind9/lib/dns/gssapi_link.c head/contrib/bind9/lib/dns/gssapictx.c head/contrib/bind9/lib/dns/hmac_link.c head/contrib/bind9/lib/dns/include/dns/Makefile.in head/contrib/bind9/lib/dns/include/dns/acache.h head/contrib/bind9/lib/dns/include/dns/acl.h head/contrib/bind9/lib/dns/include/dns/adb.h head/contrib/bind9/lib/dns/include/dns/cache.h head/contrib/bind9/lib/dns/include/dns/callbacks.h head/contrib/bind9/lib/dns/include/dns/db.h head/contrib/bind9/lib/dns/include/dns/dispatch.h head/contrib/bind9/lib/dns/include/dns/dlz_dlopen.h head/contrib/bind9/lib/dns/include/dns/dnssec.h head/contrib/bind9/lib/dns/include/dns/events.h head/contrib/bind9/lib/dns/include/dns/journal.h head/contrib/bind9/lib/dns/include/dns/log.h head/contrib/bind9/lib/dns/include/dns/master.h head/contrib/bind9/lib/dns/include/dns/masterdump.h head/contrib/bind9/lib/dns/include/dns/nsec.h head/contrib/bind9/lib/dns/include/dns/nsec3.h head/contrib/bind9/lib/dns/include/dns/private.h head/contrib/bind9/lib/dns/include/dns/rdata.h head/contrib/bind9/lib/dns/include/dns/rdataset.h head/contrib/bind9/lib/dns/include/dns/resolver.h head/contrib/bind9/lib/dns/include/dns/result.h head/contrib/bind9/lib/dns/include/dns/rpz.h head/contrib/bind9/lib/dns/include/dns/rriterator.h head/contrib/bind9/lib/dns/include/dns/sdb.h head/contrib/bind9/lib/dns/include/dns/sdlz.h head/contrib/bind9/lib/dns/include/dns/time.h head/contrib/bind9/lib/dns/include/dns/types.h head/contrib/bind9/lib/dns/include/dns/view.h head/contrib/bind9/lib/dns/include/dns/zone.h head/contrib/bind9/lib/dns/include/dns/zt.h head/contrib/bind9/lib/dns/include/dst/dst.h head/contrib/bind9/lib/dns/iptable.c head/contrib/bind9/lib/dns/journal.c head/contrib/bind9/lib/dns/key.c head/contrib/bind9/lib/dns/keytable.c head/contrib/bind9/lib/dns/log.c head/contrib/bind9/lib/dns/lookup.c head/contrib/bind9/lib/dns/master.c head/contrib/bind9/lib/dns/masterdump.c head/contrib/bind9/lib/dns/message.c head/contrib/bind9/lib/dns/nsec.c head/contrib/bind9/lib/dns/nsec3.c head/contrib/bind9/lib/dns/openssldh_link.c head/contrib/bind9/lib/dns/openssldsa_link.c head/contrib/bind9/lib/dns/opensslecdsa_link.c head/contrib/bind9/lib/dns/opensslgost_link.c head/contrib/bind9/lib/dns/opensslrsa_link.c head/contrib/bind9/lib/dns/private.c head/contrib/bind9/lib/dns/rbt.c head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/lib/dns/rdata.c head/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c head/contrib/bind9/lib/dns/rdata/generic/cert_37.c head/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c head/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c head/contrib/bind9/lib/dns/rdata/generic/ds_43.c head/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.c head/contrib/bind9/lib/dns/rdata/generic/key_25.c head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c head/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c head/contrib/bind9/lib/dns/rdata/generic/nsec3_50.h head/contrib/bind9/lib/dns/rdata/generic/opt_41.c head/contrib/bind9/lib/dns/rdata/generic/rrsig_46.c head/contrib/bind9/lib/dns/rdata/generic/sig_24.c head/contrib/bind9/lib/dns/rdata/generic/soa_6.c head/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c head/contrib/bind9/lib/dns/rdata/generic/tkey_249.c head/contrib/bind9/lib/dns/rdata/generic/uri_256.c head/contrib/bind9/lib/dns/rdata/generic/uri_256.h head/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c head/contrib/bind9/lib/dns/resolver.c head/contrib/bind9/lib/dns/sdb.c head/contrib/bind9/lib/dns/sdlz.c head/contrib/bind9/lib/dns/validator.c head/contrib/bind9/lib/dns/view.c head/contrib/bind9/lib/dns/xfrin.c head/contrib/bind9/lib/dns/zone.c head/contrib/bind9/lib/dns/zt.c head/contrib/bind9/lib/irs/api head/contrib/bind9/lib/isc/Makefile.in head/contrib/bind9/lib/isc/api head/contrib/bind9/lib/isc/include/isc/heap.h head/contrib/bind9/lib/isc/include/isc/list.h head/contrib/bind9/lib/isc/include/isc/mem.h head/contrib/bind9/lib/isc/include/isc/namespace.h head/contrib/bind9/lib/isc/include/isc/radix.h head/contrib/bind9/lib/isc/include/isc/socket.h head/contrib/bind9/lib/isc/include/isc/task.h head/contrib/bind9/lib/isc/include/isc/taskpool.h head/contrib/bind9/lib/isc/log.c head/contrib/bind9/lib/isc/radix.c head/contrib/bind9/lib/isc/socket_api.c head/contrib/bind9/lib/isc/task.c head/contrib/bind9/lib/isc/task_api.c head/contrib/bind9/lib/isc/task_p.h head/contrib/bind9/lib/isc/taskpool.c head/contrib/bind9/lib/isc/unix/socket.c head/contrib/bind9/lib/isccc/api head/contrib/bind9/lib/isccfg/api head/contrib/bind9/lib/isccfg/namedconf.c head/contrib/bind9/lib/lwres/api head/contrib/bind9/lib/lwres/man/lwres_config.3 head/contrib/bind9/lib/lwres/man/lwres_config.docbook head/contrib/bind9/lib/lwres/man/lwres_config.html head/contrib/bind9/lib/lwres/man/lwres_context.3 head/contrib/bind9/lib/lwres/man/lwres_context.docbook head/contrib/bind9/lib/lwres/man/lwres_context.html head/contrib/bind9/lib/lwres/man/lwres_gabn.3 head/contrib/bind9/lib/lwres/man/lwres_gabn.docbook head/contrib/bind9/lib/lwres/man/lwres_gabn.html head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3 head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook head/contrib/bind9/lib/lwres/man/lwres_gai_strerror.html head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3 head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook head/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.html head/contrib/bind9/lib/lwres/man/lwres_gethostent.3 head/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook head/contrib/bind9/lib/lwres/man/lwres_gethostent.html head/contrib/bind9/lib/lwres/man/lwres_getipnode.3 head/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook head/contrib/bind9/lib/lwres/man/lwres_getipnode.html head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3 head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook head/contrib/bind9/lib/lwres/man/lwres_getnameinfo.html head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3 head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook head/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.html head/contrib/bind9/lib/lwres/man/lwres_gnba.3 head/contrib/bind9/lib/lwres/man/lwres_gnba.docbook head/contrib/bind9/lib/lwres/man/lwres_gnba.html head/contrib/bind9/lib/lwres/man/lwres_hstrerror.3 head/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook head/contrib/bind9/lib/lwres/man/lwres_hstrerror.html head/contrib/bind9/lib/lwres/man/lwres_inetntop.3 head/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook head/contrib/bind9/lib/lwres/man/lwres_inetntop.html head/contrib/bind9/lib/lwres/man/lwres_noop.3 head/contrib/bind9/lib/lwres/man/lwres_noop.docbook head/contrib/bind9/lib/lwres/man/lwres_noop.html head/contrib/bind9/lib/lwres/man/lwres_packet.3 head/contrib/bind9/lib/lwres/man/lwres_packet.docbook head/contrib/bind9/lib/lwres/man/lwres_packet.html head/contrib/bind9/lib/lwres/man/lwres_resutil.3 head/contrib/bind9/lib/lwres/man/lwres_resutil.docbook head/contrib/bind9/lib/lwres/man/lwres_resutil.html head/contrib/bind9/lib/lwres/print_p.h head/contrib/bind9/lib/lwres/strtoul.c head/contrib/bind9/lib/lwres/unix/Makefile.in head/contrib/bind9/lib/lwres/unix/include/Makefile.in head/contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in head/contrib/bind9/lib/lwres/unix/include/lwres/net.h head/contrib/bind9/lib/lwres/version.c head/contrib/bind9/make/Makefile.in head/contrib/bind9/make/includes.in head/contrib/bind9/make/rules.in head/contrib/bind9/mkinstalldirs head/contrib/bind9/version head/lib/bind/config.h head/lib/bind/dns/Makefile head/lib/bind/dns/code.h head/lib/bind/dns/dns/rdatastruct.h head/lib/bind/isc/Makefile head/share/doc/bind9/Makefile head/usr.bin/nslookup/Makefile head/usr.bin/nsupdate/Makefile head/usr.sbin/Makefile Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Thu Aug 22 07:43:36 2013 (r254650) +++ head/contrib/bind9/CHANGES Thu Aug 22 08:15:03 2013 (r254651) @@ -1,15 +1,15 @@ - --- 9.8.5-P2 released --- + --- 9.9.3-P2 released --- 3621. [security] Incorrect bounds checking on private type 'keydata' can lead to a remotely triggerable REQUIRE failure (CVE-2013-4854). [RT #34238] - --- 9.8.5-P1 released --- + --- 9.9.3-P1 released --- 3584. [security] Caching data from an incompletely signed zone could trigger an assertion failure in resolver.c [RT #33690] - --- 9.8.5 released --- + --- 9.9.3 released --- 3568. [cleanup] Add a product description line to the version file, to be reported by named -v/-V. [RT #33366] @@ -21,7 +21,7 @@ 3561. [bug] dig: issue a warning if an EDNS query returns FORMERR or NOTIMP. Adjust usage message. [RT #33363] - --- 9.8.5rc1 released --- + --- 9.9.3rc2 released --- 3560. [bug] isc-config.sh did not honor includedir and libdir when set via configure. [RT #33345] @@ -31,6 +31,8 @@ 3558. [bug] IXFR of a DLZ stored zone was broken. [RT #33331] +3557. [bug] Reloading redirect zones was broken. [RT #33292] + 3556. [maint] Added AAAA for D.ROOT-SERVERS.NET. 3555. [bug] Address theoretical race conditions in acache.c @@ -51,9 +53,7 @@ 3547. [bug] Some malformed unknown rdata records were not properly detected and rejected. [RT #33129] -3056. [func] Added support for URI resource record. [RT #23386] - - --- 9.8.5rc1 released --- + --- 9.9.3rc1 released --- 3546. [func] Add EUI48 and EUI64 types. [RT #33082] @@ -64,8 +64,6 @@ 3543. [bug] Update socket structure before attaching to socket manager after accept. [RT #33084] -3542. [bug] masterformat system test was broken. [RT #33086] - 3541. [bug] Parts of libdns were not properly initialized when built in libexport mode. [RT #33028] @@ -94,6 +92,17 @@ 3530. [contrib] Better RTT tracking in queryperf. [RT #30128] +3528. [func] New "dnssec-coverage" command scans the timing + metadata for a set of DNSSEC keys and reports if a + lapse in signing coverage has been scheduled + inadvertently. (Note: This tool depends on python; + it will not be built or installed on systems that + do not have a python interpreter.) [RT #28098] + +3527. [compat] Add a URI to allow applications to explicitly + request a particular XML schema from the statistics + channel, returning 404 if not supported. [RT #32481] + 3526. [cleanup] Set up dependencies for unit tests correctly during build. [RT #32803] @@ -102,7 +111,7 @@ 3520. [bug] 'mctx' was not being referenced counted in some places where it should have been. [RT #32794] - --- 9.8.5b2 released --- + --- 9.9.3b2 released --- 3517. [bug] Reorder destruction to avoid shutdown race. [RT #32777] @@ -114,6 +123,8 @@ to 1024 bits for hmac-sha384 and hmac-sha512. [RT #32753] +3511. [doc] Improve documentation of redirect zones. [RT #32756] + 3509. [cleanup] Added a product line to version file to allow for easy naming of different products (BIND vs BIND ESV, for example). [RT #32755] @@ -121,8 +132,24 @@ 3508. [contrib] queryperf was incorrectly rejecting the -T option. [RT #32338] +3507. [bug] Statistics channel XSL (when built with + --enable-newstats) had a glitch when attempting + to chart query data before any queries had been + received. [RT #32620] + +3505. [bug] When setting "max-cache-size" and "max-acache-size", + larger values than 4 gigabytes could not be set + explicitly, though larger sizes were available + when setting cache size to 0. This has been + corrected; the full range is now available. + [RT #32358] + 3503. [doc] Clarify size_spec syntax. [RT #32449] +3501. [func] zone-statistics now takes three options: full, + terse, and none. "yes" and "no" are retained as + synonyms for full and terse, respectively. [RT #29165] + 3500. [security] Support NAPTR regular expression validation on all platforms without using libregex, which can be vulnerable to memory exhaustion attack @@ -141,6 +168,15 @@ NSIP and NSDNAME checking. --enable-rpz-nsip and --enable-rpz-nsdname are now the default. [RT #32251] +3493. [contrib] Added BDBHPT dynamically-lodable DLZ module, + contributed by Mark Goldfinch. [RT #32549] + +3492. [bug] Fixed a regression in zone loading performance + due to lock contention. [RT #30399] + +3491. [bug] Slave zones using inline-signing must specify a + file name. [RT #31946] + 3489. [bug] --enable-developer now turns on ISC_LIST_CHECKINIT. When cloning a rdataset do not copy the link contents. [RT #32651] @@ -156,8 +192,14 @@ 3485. [cleanup] Only compile openssl_gostlink.c if we support GOST. +3483. [bug] Corrected XSL code in use with --enable-newstats. + [RT #32587] + 3481. [cleanup] Removed use of const const in atf. +3480. [bug] Silence logging noise when setting up zone + statistics. [RT #32525] + 3479. [bug] Address potential memory leaks in gssapi support code. [RT #32405] @@ -167,10 +209,18 @@ 3474. [bug] nsupdate could assert when the local and remote address families didn't match. [RT #22897] +3473. [bug] dnssec-signzone/verify could incorrectly report + an error condition due to an empty node above an + opt-out delegation lacking an NSEC3. [RT #32072] + +3471. [bug] The number of UDP dispatches now defaults to + the number of CPUs even if -n has been set to + a higher value. [RT #30964] + 3470. [bug] Slave zones could fail to dump when successfully refreshing after an initial failure. [RT #31276] - --- 9.8.5b1 released --- + --- 9.9.3b1 released --- 3468. [security] RPZ rules to generate A records (but not AAAA records) could trigger an assertion failure when used in @@ -179,6 +229,9 @@ 3467. [bug] Added checks in dnssec-keygen and dnssec-settime to check for delete date < inactive date. [RT #31719] +3466. [contrib] Corrected the DNS_CLIENTINFOMETHODS_VERSION check + in DLZ example driver. [RT #32275] + 3465. [bug] Handle isolated reserved ports. [RT #31778] 3464. [maint] Updates to PKCS#11 openssl patches, supporting @@ -192,6 +245,8 @@ 3461. [bug] Negative responses could incorrectly have AD=1 set. [RT #32237] +3460. [bug] Only link against readline where needed. [RT #29810] + 3458. [bug] Return FORMERR when presented with a overly long domain named in a request. [RT #29682] @@ -203,6 +258,9 @@ 3454. [port] sparc64: improve atomic support. [RT #25182] +3453. [bug] 'rndc addzone' of a zone with 'inline-signing yes;' + failed. [RT #31960] + 3452. [bug] Accept duplicate singleton records. [RT #32329] 3451. [port] Increase per thread stack size from 64K to 1M. @@ -266,9 +324,19 @@ 3427. [bug] dig +trace incorrectly displayed name server addresses instead of names. [RT #31641] +3426. [bug] dnssec-checkds: Clearer output when records are not + found. [RT #31968] + 3425. [bug] "acacheentry" reference counting was broken resulting in use after free. [RT #31908] +3424. [func] dnssec-dsfromkey now emits the hash without spaces. + [RT #31951] + +3423. [bug] "rndc signing -nsec3param" didn't accept the full + range of possible values. Address portability issues. + [RT #31938] + 3422. [bug] Added a clear error message for when the SOA does not match the referral. [RT #31281] @@ -279,9 +347,22 @@ 3419. [bug] Memory leak on validation cancel. [RT #31869] +3417. [func] Optional new XML schema (version 3.0) for the + statistics channel adds query type statistics at the + zone level, and flattens the XML tree and uses + compressed format to optimize parsing. Includes new XSL + that permits charting via the Google Charts API on + browsers that support javascript in XSL. To enable, + build with "configure --enable-newstats". [RT #30023] + +3416. [bug] Named could die on shutdown if running with 128 UDP + dispatches per interface. [RT #31743] + 3415. [bug] named could die with a REQUIRE failure if a validation was canceled. [RT #31804] +3414. [bug] Address locking issues found by Coverity. [RT #31626] + 3412. [bug] Copy timeval structure from control message data. [RT #31548] @@ -295,6 +376,11 @@ (DNS-based Authentication of Named Entities). [RT #30513] +3408. [bug] Some DNSSEC-related options (update-check-ksk, + dnssec-loadkeys-interval, dnssec-dnskey-kskonly) + are now legal in slave zones as long as + inline-signing is in use. [RT #31078] + 3406. [bug] mem.c: Fix compilation errors when building with ISC_MEM_TRACKLINES or ISC_MEMPOOL_NAMES disabled. Also, ISC_MEM_DEBUG is no longer optional. [RT #31559] @@ -316,6 +402,13 @@ in the "srcid" file in the build tree and normally set to the most recent git hash. [RT #31494] +3399. [port] netbsd: rename 'bool' parameter to avoid namespace + clash. [RT #31515] + +3398. [bug] SOA parameters were not being updated with inline + signed zones if the zone was modified while the + server was offline. [RT #29272] + 3397. [bug] dig crashed when using +nssearch with +tcp. [RT #25298] 3396. [bug] OPT records were incorrectly removed from signed, @@ -348,11 +441,10 @@ 3386. [bug] Address locking violation when generating new NSEC / NSEC3 chains. [RT #31224] -3384. [bug] Improved logging of crypto errors. [RT #30963] +3385. [bug] named-checkconf didn't detect missing master lists + in also-notify clauses. [RT #30810] -3383. [security] A certain combination of records in the RBT could - cause named to hang while populating the additional - section of a response. [RT #31090] +3384. [bug] Improved logging of crypto errors. [RT #30963] 3382. [bug] SOA query from slave used use-v6-udp-ports range, if set, regardless of the address family in use. @@ -370,6 +462,9 @@ 3378. [bug] Handle missing 'managed-keys-directory' better. [RT #30625] +3377. [bug] Removed spurious newline from NSEC3 multiline + output. [RT #31044] + 3376. [bug] Lack of EDNS support was being recorded without a successful response. [RT #30811] @@ -386,19 +481,34 @@ add NS RRsets to the additional section or not. [RT #30479] - --- 9.8.4 released --- +3316. [tuning] Improved locking performance when recursing. + [RT #28836] + +3315. [tuning] Use multiple dispatch objects for sending upstream + queries; this can improve performance on busy + multiprocessor systems by reducing lock contention. + [RT #28605] + + --- 9.9.2 released --- + +3383. [security] A certain combination of records in the RBT could + cause named to hang while populating the additional + section of a response. [RT #31090] 3373. [bug] win32: open raw files in binary mode. [RT #30944] 3364. [security] Named could die on specially crafted record. [RT #30416] - --- 9.8.4rc1 released --- + --- 9.9.2rc1 released --- + +3370. [bug] Address use after free while shutting down. [RT #30241] 3369. [bug] nsupdate terminated unexpectedly in interactive mode if built with readline support. [RT #29550] -3368. [bug] and were not C++ safe. +3368. [bug] , and + were not C++ safe. 3367. [bug] dns_dnsseckey_create() result was not being checked. [RT #30685] @@ -417,6 +527,9 @@ could trigger an assertion failure on startup. [RT #27730] +3361. [bug] "rndc signing -nsec3param" didn't work correctly + when salt was set to '-' (no salt). [RT #30099] + 3360. [bug] 'host -w' could die. [RT #18723] 3359. [bug] An improperly-formed TSIG secret could cause a @@ -428,10 +541,12 @@ approaching their expiry, so they don't remain in caches after expiry. [RT #26429] - --- 9.8.4b1 released --- +3355. [port] Use more portable awk in verify system test. 3354. [func] Improve OpenSSL error logging. [RT #29932] + --- 9.9.2b1 released --- + 3353. [bug] Use a single task for task exclusive operations. [RT #29872] @@ -446,6 +561,8 @@ ISC_MEM_DEBUGCTX memory debugging flag is set. [RT #30240] +3349. [bug] Change #3345 was incomplete. [RT #30233] + 3348. [bug] Prevent RRSIG data from being cached if a negative record matching the covering type exists at a higher trust level. Such data already can't be retrieved from @@ -459,16 +576,42 @@ 3346. [security] Bad-cache data could be used before it was initialized, causing an assert. [RT #30025] +3345. [bug] Addressed race condition when removing the last item + or inserting the first item in an ISC_QUEUE. + [RT #29539] + +3344. [func] New "dnssec-checkds" command checks a zone to + determine which DS records should be published + in the parent zone, or which DLV records should be + published in a DLV zone, and queries the DNS to + ensure that it exists. (Note: This tool depends + on python; it will not be built or installed on + systems that do not have a python interpreter.) + [RT #28099] + 3342. [bug] Change #3314 broke saving of stub zones to disk resulting in excessive cpu usage in some cases. [RT #29952] +3341. [func] New "dnssec-verify" command checks a signed zone + to ensure correctness of signatures and of NSEC/NSEC3 + chains. [RT #23673] + +3339. [func] Allow the maximum supported rsa exponent size to be + specified: "max-rsa-exponent-size ;" [RT #29228] + +3338. [bug] Address race condition in units tests: asyncload_zone + and asyncload_zt. [RT #26100] + 3337. [bug] Change #3294 broke support for the multiple keys in controls. [RT #29694] 3335. [func] nslookup: return a nonzero exit code when unable to get an answer. [RT #29492] +3334. [bug] Hold a zone table reference while performing a + asynchronous load of a zone. [RT #28326] + 3333. [bug] Setting resolver-query-timeout too low can cause named to not recover if it loses connectivity. [RT #29623] @@ -504,7 +647,7 @@ 3317. [func] Add ECDSA support (RFC 6605). [RT #21918] - --- 9.8.3 released --- + --- 9.9.1 released --- 3318. [tuning] Reduce the amount of work performed while holding a bucket lock when finished with a fetch context. @@ -536,6 +679,8 @@ 3304. [bug] Use hmctx, not mctx when freeing rbtdb->heaps. [RT #28571] +3303. [bug] named could die when reloading. [RT #28606] + 3302. [bug] dns_dnssec_findmatchingkeys could fail to find keys if the zone name contained character that required special mappings. [RT #28600] @@ -549,22 +694,15 @@ 3299. [bug] Make SDB handle errors from database drivers better. [RT #28534] -3232. [bug] Zero zone->curmaster before return in - dns_zone_setmasterswithkeys(). [RT #26732] - -3183. [bug] Added RTLD_GLOBAL flag to dlopen call. [RT #26301] - -3197. [bug] Don't try to log the filename and line number when - the config parser can't open a file. [RT #22263] - - --- 9.8.2 released --- - 3298. [bug] Named could dereference a NULL pointer in zmgr_start_xfrin_ifquota if the zone was being removed. [RT #28419] 3297. [bug] Named could die on a malformed master file. [RT #28467] +3296. [bug] Named could die with a INSIST failure in + client.c:exit_check. [RT #28346] + 3295. [bug] Adjust isc_time_secondsastimet range check to be more portable. [RT # 26542] @@ -576,6 +714,16 @@ 3290. [bug] was not being installed. [RT #28169] +3273. [bug] AAAA responses could be returned in the additional + section even when filter-aaaa-on-v4 was in use. + [RT #27292] + + --- 9.9.0 released --- + + --- 9.9.0rc4 released --- + +3289. [bug] 'rndc retransfer' failed for inline zones. [RT #28036] + 3288. [bug] dlz_destroy() function wasn't correctly registered by the DLZ dlopen driver. [RT #28056] @@ -584,7 +732,7 @@ 3286. [bug] Managed key maintenance timer could fail to start after 'rndc reconfig'. [RT #26786] - --- 9.8.2rc2 released --- + --- 9.9.0rc3 released --- 3285. [bug] val-frdataset was incorrectly disassociated in proveunsecure after calling startfinddlvsep. @@ -607,24 +755,34 @@ 3280. [bug] Potential double free of a rdataset on out of memory with DNS64. [RT #27762] +3279. [bug] Hold a internal reference to the zone while performing + a asynchronous load. Address potential memory leak + if the asynchronous is cancelled. [RT #27750] + 3278. [bug] Make sure automatic key maintenance is started when "auto-dnssec maintain" is turned on during "rndc reconfig". [RT #26805] +3277. [bug] win32: isc_socket_dup is not implemented. [RT #27696] + 3276. [bug] win32: ns_os_openfile failed to return NULL on safe_open failure. [RT #27696] -3274. [bug] Log when a zone is not reusable. Only set loadtime - on successful loads. [RT #27650] - -3273. [bug] AAAA responses could be returned in the additional - section even when filter-aaaa-on-v4 was in use. - [RT #27292] +3275. [bug] Corrected rndc -h output; the 'rndc sync -clean' + option had been misspelled as '-clear'. (To avoid + future confusion, both options now work.) [RT #27173] 3271. [port] darwin: mksymtbl is not always stable, loop several times before giving up. mksymtbl was using non portable perl to covert 64 bit hex strings. [RT #27653] + --- 9.9.0rc2 released --- + +3270. [bug] "rndc reload" didn't reuse existing zones correctly + when inline-signing was in use. [RT #27650] + +3269. [port] darwin 11 and later now built threaded by default. + 3268. [bug] Convert RRSIG expiry times to 64 timestamps to work out the earliest expiry time. [RT #23311] @@ -636,14 +794,26 @@ DNSKEY RRset was not being properly computed. [RT #26543] +3265. [bug] Corrected a problem with lock ordering in the + inline-signing code. [RT #27557] + +3264. [bug] Automatic regeneration of signatures in an + inline-signing zone could stall when the server + was restarted. [RT #27344] + +3263. [bug] "rndc sync" did not affect the unsigned side of an + inline-signing zone. [RT #27337] + 3262. [bug] Signed responses were handled incorrectly by RPZ. [RT #27316] - --- 9.8.2rc1 released --- +3261. [func] RRset ordering now defaults to random. [RT #27174] 3260. [bug] "rrset-order cyclic" could appear not to rotate for some query patterns. [RT #27170/27185] + --- 9.9.0rc1 released --- + 3259. [bug] named-compilezone: Suppress "dump zone to " message when writing to stdout. [RT #27109] @@ -655,12 +825,21 @@ 3256. [bug] Disable empty zones for lwresd -C. [RT #27139] +3255. [func] No longer require that a empty zones be explicitly + enabled or that a empty zone is disabled for + RFC 1918 empty zones to be configured. [RT #27139] + 3254. [bug] Set isc_socket_ipv6only() on the IPv6 control channels. [RT #22249] 3253. [bug] Return DNS_R_SYNTAX when the input to a text field is too long. [RT #26956] +3252. [bug] When master zones using inline-signing were + updated while the server was offline, the source + zone could fall out of sync with the signed + copy. They can now resynchronize. [RT #26676] + 3251. [bug] Enforce a upper bound (65535 bytes) on the amount of memory dns_sdlz_putrr() can allocate per record to prevent run away memory consumption on ISC_R_NOSPACE. @@ -680,8 +859,34 @@ 3247. [bug] 'raw' format zones failed to preserve load order breaking 'fixed' sort order. [RT #27087] -3243. [port] netbsd,bsdi: the thread defaults were not being - properly set. +3246. [bug] Named failed to start with a empty also-notify list. + [RT #27087] + +3245. [bug] Don't report a error unchanged serials unless there + were other changes when thawing a zone with + ixfr-fromdifferences. [RT #26845] + +3244. [func] Added readline support to nslookup and nsupdate. + Also simplified nsupdate syntax to make "update" + and "prereq" optional. [RT #24659] + +3243. [port] freebsd,netbsd,bsdi: the thread defaults were not + being properly set. + +3242. [func] Extended the header of raw-format master files to + include the serial number of the zone from which + they were generated, if different (as in the case + of inline-signing zones). This is to be used in + inline-signing zones, to track changes between the + unsigned and signed versions of the zone, which may + have different serial numbers. + + (Note: raw zonefiles generated by this version of + BIND are no longer compatible with prior versions. + To generate a backward-compatible raw zonefile + using dnssec-signzone or named-compilezone, specify + output format "raw=0" instead of simply "raw".) + [RT #26587] 3241. [bug] Address race conditions in the resolver code. [RT #26889] @@ -696,10 +901,21 @@ 3237. [bug] dig -6 didn't work with +trace. [RT #26906] - --- 9.8.2b1 released --- +3236. [bug] Backed out changes #3182 and #3202, related to + EDNS(0) fallback behavior. [RT #26416] + +3235. [func] dns_db_diffx, a extended dns_db_diff which returns + the generated diff and optionally writes it to a + journal. [RT #26386] 3234. [bug] 'make depend' produced invalid makefiles. [RT #26830] +3233. [bug] 'rndc freeze/thaw' didn't work for inline zones. + [RT #26632] + +3232. [bug] Zero zone->curmaster before return in + dns_zone_setmasterswithkeys(). [RT #26732] + 3231. [bug] named could fail to send a incompressible zone. [RT #26796] @@ -717,14 +933,29 @@ 3226. [bug] Address minor resource leakages. [RT #26624] +3225. [bug] Silence spurious "setsockopt(517, IPV6_V6ONLY) failed" + messages. [RT #26507] + +3224. [bug] 'rndc signing' argument parsing was broken. [RT #26684] + +3223. [bug] 'task_test privilege_drop' generated false positives. + [RT #26766] + +3222. [cleanup] Replace dns_journal_{get,set}_bitws with + dns_journal_{get,set}_sourceserial. [RT #26634] + 3221. [bug] Fixed a potential core dump on shutdown due to referencing fetch context after it's been freed. [RT #26720] + --- 9.9.0b2 released --- + 3220. [bug] Change #3186 was incomplete; dns_db_rpz_findips() could fail to set the database version correctly, causing an assertion failure. [RT #26180] +3219. [bug] Disable NOEDNS caching following a timeout. + 3218. [security] Cache lookup could return RRSIG data associated with nonexistent records, leading to an assertion failure. [RT #26590] @@ -733,12 +964,24 @@ 3216. [bug] resolver.c:validated() was not thread-safe. [RT #26478] +3215. [bug] 'rndc recursing' could cause a core dump. [RT #26495] + +3214. [func] Add 'named -U' option to set the number of UDP + listener threads per interface. [RT #26485] + 3213. [doc] Clarify ixfr-from-differences behavior. [RT #25188] 3212. [bug] rbtdb.c: failed to remove a node from the deadnodes list prior to adding a reference to it leading a possible assertion failure. [RT #23219] +3211. [func] dnssec-signzone: "-f -" prints to stdout; "-O full" + option prints in single-line-per-record format. + [RT #20287] + +3210. [bug] Canceling the oldest query due to recursive-client + overload could trigger an assertion failure. [RT #26463] + 3209. [func] Add "dnssec-lookaside 'no'". [RT #24858] 3208. [bug] 'dig -y' handle unknown tsig algorithm better. @@ -748,6 +991,11 @@ 3206. [cleanup] Add ISC information to log at start time. [RT #25484] +3205. [func] Upgrade dig's defaults to better reflect modern + nameserver behavior. Enable "dig +adflag" and + "dig +edns=0" by default. Enable "+dnssec" when + running "dig +trace". [RT #23497] + 3204. [bug] When a master server that has been marked as unreachable sends a NOTIFY, mark it reachable again. [RT #25960] @@ -755,12 +1003,24 @@ 3203. [bug] Increase log level to 'info' for validation failures from expired or not-yet-valid RRSIGs. [RT #21796] +3202. [bug] NOEDNS caching on timeout was too aggressive. + [RT #26416] + +3201. [func] 'rndc querylog' can now be given an on/off parameter + instead of only being used as a toggle. [RT #18351] + 3200. [doc] Some rndc functions were undocumented or were missing from 'rndc -h' output. [RT #25555] +3199. [func] When logging client information, include the name + being queried. [RT #25944] + 3198. [doc] Clarified that dnssec-settime can alter keyfile permissions. [RT #24866] +3197. [bug] Don't try to log the filename and line number when + the config parser can't open a file. [RT #22263] + 3196. [bug] nsupdate: return nonzero exit code when target zone doesn't exist. [RT #25783] @@ -789,10 +1049,50 @@ 3187. [port] win32: support for Visual Studio 2008. [RT #26356] + --- 9.9.0b1 released --- + 3186. [bug] Version/db mis-match in rpz code. [RT #26180] +3185. [func] New 'rndc signing' option for auto-dnssec zones: + - 'rndc signing -list' displays the current + state of signing operations + - 'rndc signing -clear' clears the signing state + records for keys that have fully signed the zone + - 'rndc signing -nsec3param' sets the NSEC3 + parameters for the zone + The 'rndc keydone' syntax is removed. [RT #23729] + +3184. [bug] named had excessive cpu usage when a redirect zone was + configured. [RT #26013] + +3183. [bug] Added RTLD_GLOBAL flag to dlopen call. [RT #26301] + +3182. [bug] Auth servers behind firewalls which block packets + greater than 512 bytes may cause other servers to + perform poorly. Now, adb retains edns information + and caches noedns servers. [RT #23392/24964] + +3181. [func] Inline-signing is now supported for master zones. + [RT #26224] + +3180. [func] Local copies of slave zones are now saved in raw + format by default, to improve startup performance. + 'masterfile-format text;' can be used to override + the default, if desired. [RT #25867] + 3179. [port] kfreebsd: build issues. [RT #26273] +3178. [bug] A race condition introduced by change #3163 could + cause an assertion failure on shutdown. [RT #26271] + +3177. [func] 'rndc keydone', remove the indicator record that + named has finished signing the zone with the + corresponding key. [RT #26206] + +3176. [doc] Corrected example code and added a README to the + sample external DLZ module in contrib/dlz/example. + [RT #26215] + 3175. [bug] Fix how DNSSEC positive wildcard responses from a NSEC3 signed zone are validated. Stop sending a unnecessary NSEC3 record when generating such @@ -803,9 +1103,14 @@ 3173. [port] Correctly validate root DS responses. [RT #25726] +3172. [port] darwin 10.* and freebsd [89] are now built threaded by + default. + 3171. [bug] Exclusively lock the task when adding a zone using 'rndc addzone'. [RT #25600] + --- 9.9.0a3 released --- + 3170. [func] RPZ update: - fix precedence among competing rules - improve ARM text including documenting rule precedence @@ -820,10 +1125,28 @@ 3169. [func] Catch db/version mis-matches when calling dns_db_*(). [RT #26017] +3168. [bug] Nxdomain redirection could trigger an assert with + a ANY query. [RT #26017] + 3167. [bug] Negative answers from forwarders were not being correctly tagged making them appear to not be cached. [RT #25380] +3166. [bug] Upgrading a zone to support inline-signing failed. + [RT #26014] + +3165. [bug] dnssec-signzone could generate new signatures when + resigning, even when valid signatures were already + present. [RT #26025] + +3164. [func] Enable DLZ modules to retrieve client information, + so that responses can be changed depending on the + source address of the query. [RT #25768] + +3163. [bug] Use finer-grained locking in client.c to address + concurrency problems with large numbers of threads. + [RT #26044] + 3162. [test] start.pl: modified to allow for "named.args" in ns*/ subdirectory to override stock arguments to named. Largely from RT#26044, but no separate ticket. @@ -831,24 +1154,52 @@ 3161. [bug] zone.c:del_sigs failed to always reset rdata leading assertion failures. [RT #25880] +3160. [bug] When printing out a NSEC3 record in multiline form + the newline was not being printed causing type codes + to be run together. [RT #25873] + +3159. [bug] On some platforms, named could assert on startup + when running in a chrooted environment without + /proc. [RT #25863] + +3158. [bug] Recursive servers would prefer a particular UDP + socket instead of using all available sockets. + [RT #26038] + 3157. [tuning] Reduce the time spent in "rndc reconfig" by parsing the config file before pausing the server. [RT #21373] +3156. [placeholder] + + --- 9.9.0a2 released --- + 3155. [bug] Fixed a build failure when using contrib DLZ drivers (e.g., mysql, postgresql, etc). [RT #25710] 3154. [bug] Attempting to print an empty rdataset could trigger an assert. [RT #25452] +3153. [func] Extend request-ixfr to zone level and remove the + side effect of forcing an AXFR. [RT #25156] + 3152. [cleanup] Some versions of gcc and clang failed due to incorrect use of __builtin_expect. [RT #25183] 3151. [bug] Queries for type RRSIG or SIG could be handled incorrectly. [RT #21050] +3150. [func] Improved startup and reconfiguration time by + enabling zones to load in multiple threads. [RT #25333] + +3149. [placeholder] + 3148. [bug] Processing of normal queries could be stalled when forwarding a UPDATE message. [RT #24711] +3147. [func] Initial inline signing support. [RT #23657] + + --- 9.9.0a1 released --- + 3146. [test] Fixed gcc4.6.0 errors in ATF. [RT #25598] 3145. [test] Capture output of ATF unit tests in "./atf.out" if @@ -859,29 +1210,31 @@ 3143. [bug] Silence clang compiler warnings. [RT #25174] -3139. [test] Added tests from RFC 6234, RFC 2202, and RFC 1321 - for the hashing algorithms (md5, sha1 - sha512, and - their hmac counterparts). [RT #25067] - - --- 9.8.1 released --- - - --- 9.8.1rc1 released --- +3142. [bug] NAPTR is class agnostic. [RT #25429] 3141. [bug] Silence spurious "zone serial (0) unchanged" messages associated with empty zones. [RT #25079] +3140. [func] New command "rndc flushtree " clears the + specified name from the server cache along with + all names under it. [RT #19970] + +3139. [test] Added tests from RFC 6234, RFC 2202, and RFC 1321 + for the hashing algorithms (md5, sha1 - sha512, and + their hmac counterparts). [RT #25067] + 3138. [bug] Address memory leaks and out-of-order operations when shutting named down. [RT #25210] +3137. [func] Improve hardware scalability by allowing multiple + worker threads to process incoming UDP packets. + This can significantly increase query throughput + on some systems. [RT #22992] + 3136. [func] Add RFC 1918 reverse zones to the list of built-in empty zones switched on by the 'empty-zones-enable' option. [RT #24990] - Note: empty-zones-enable must be "yes;" or a empty - zone needs to be disabled in named.conf for RFC 1918 - zones to be activated. This requirement may be - removed in future releases. - 3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing. See http://www.freebsd.org/cgi/query-pr.cgi?pr=158307 [RT #24950] @@ -889,19 +1242,34 @@ 3134. [bug] Improve the accuracy of dnssec-signzone's signing statistics. [RT #16030] - --- 9.8.1b3 released --- - 3133. [bug] Change #3114 was incomplete. [RT #24577] +3132. [placeholder] + 3131. [tuning] Improve scalability by allocating one zone task per 100 zones at startup time, rather than using a fixed-size task table. [RT #24406] +3130. [func] Support alternate methods for managing a dynamic + zone's serial number. Two methods are currently + defined using serial-update-method, "increment" + (default) and "unixtime". [RT #23849] + 3129. [bug] Named could crash on 'rndc reconfig' when allow-new-zones was set to yes and named ACLs were used. [RT #22739] - --- 9.8.1b2 released --- +3128. [func] Inserting an NSEC3PARAM via dynamic update in an + auto-dnssec zone that has not been signed yet + will cause it to be signed with the specified NSEC3 + parameters when keys are activated. The + NSEC3PARAM record will not appear in the zone until + it is signed, but the parameters will be stored. + [RT #23684] + +3127. [bug] 'rndc thaw' will now remove a zone's journal file + if the zone serial number has been changed and + ixfr-from-differences is not in use. [RT #24687] 3126. [security] Using DNAME record to generate replacements caused RPZ to exit with a assertion failure. [RT #24766] @@ -941,6 +1309,12 @@ never-implemented 'auto-dnssec create' option. [RT #24533] +3116. [func] New 'dnssec-update-mode' option controls updates + of DNSSEC records in signed dynamic zones. Set to + 'no-resign' to disable automatic RRSIG regeneration + while retaining the ability to sign new or changed + data. [RT #24533] + 3115. [bug] Named could fail to return requested data when following a CNAME that points into the same zone. [RT #24455] @@ -951,8 +1325,6 @@ 3113. [doc] Document the relationship between serial-query-rate and NOTIFY messages. - --- 9.8.1b1 released --- - 3112. [doc] Add missing descriptions of the update policy name types "ms-self", "ms-subdomain", "krb5-self" and "krb5-subdomain", which allow machines to update @@ -965,9 +1337,23 @@ 3110. [bug] dnssec-signzone: Wrong error message could appear when attempting to sign with no KSK. [RT #24369] +3109. [func] The also-notify option now uses the same syntax + as a zone's masters clause. This means it is + now possible to specify a TSIG key to use when + sending notifies to a given server, or to include + an explicit named masters list in an also-notfiy + statement. [RT #23508] + +3108. [cleanup] dnssec-signzone: Clarified some error and + warning messages; removed #ifdef ALLOW_KSKLESS_ZONES + code (use -P instead). [RT #20852] + 3107. [bug] dnssec-signzone: Report the correct number of ZSKs when using -x. [RT #20852] +3106. [func] When logging client requests, include the name of + the TSIG key if any. [RT #23619] + 3105. [bug] GOST support can be suppressed by "configure --without-gost" [RT #24367] @@ -977,6 +1363,12 @@ instead of in the options statement could trigger an assertion failure in named-checkconf. [RT #24382] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 08:15:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D5FBB46; Thu, 22 Aug 2013 08:15:51 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5CFB427C4; Thu, 22 Aug 2013 08:15:50 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 3C3BA4BB2; Thu, 22 Aug 2013 08:15:50 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 43EDA2FB7F; Thu, 22 Aug 2013 10:15:12 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "David E. O'Brien" Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc References: <201308212257.r7LMvUmY053608@svn.freebsd.org> <8638q2i1oo.fsf@nine.des.no> Date: Thu, 22 Aug 2013 10:15:11 +0200 In-Reply-To: <8638q2i1oo.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Thu, 22 Aug 2013 10:12:39 +0200") Message-ID: <86y57ugn00.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 08:15:51 -0000 Dag-Erling Sm=C3=B8rgrav writes: > This breaks the build in usr.bin/expr because expr.y already provides a > prototype, and gcc does not accept multiple prototypes, even if they're > identical. That is arguably a bug in gcc, Oh, it's actually our own fault for including -Wredundant-decls in CFLAGS. Is there a good reason to keep it? -Wredundant-decls Warn if anything is declared more than once in the same scope, e= ven in cases where multiple declaration is valid and changes nothing. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 10:07:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 28FA4D6C for ; Thu, 22 Aug 2013 10:07:04 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B39C32ED0 for ; Thu, 22 Aug 2013 10:07:03 +0000 (UTC) Received: by mail-ee0-f44.google.com with SMTP id b47so803635eek.3 for ; Thu, 22 Aug 2013 03:06:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding; bh=qCMOGWCpLQLRSJlWy2A2M8oXc6/uZoesOaLH+Otb4bY=; b=d4r9HInK5x5kuJMu+IrOVtHHfycgeNmdysTs9Nj0wK9N2qe6R0WeeaKeTxJ32WsPxX k5idoKtILfSlqY7qxl/szTUdrcC97olDuklux1hCMR9pEaOws+BDlRedgMkQivLzx+dw spK4litogdwDgynube/f0mpL/wOTnLncpSDqcuJhtz0zVLTBnkZgBpfPk/VTdSymS4nN dyfCmUkvv7R9MmAkX7cRGoh1QBn9sZyjbDNzeDDP3yKGHJ+h0I0nh1X8EvLUFqiAauIG FYr6q3Q/NF0J2nONb9WeuuoVNINI8LSD9VzeGTQ1FOXI7Nme9uUaul+TvQkFM5ba111o tdtg== X-Gm-Message-State: ALoCoQlbOms8Z7ttImVymsw0hPvbDEtjgsEIAffERoFXLHjzR9oDu7YYt6fkWfFINepNGxb9sUvn X-Received: by 10.14.115.133 with SMTP id e5mr17642449eeh.27.1377166015729; Thu, 22 Aug 2013 03:06:55 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id b45sm16400984eef.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Aug 2013 03:06:55 -0700 (PDT) Message-ID: <5215E2BC.3070904@freebsd.org> Date: Thu, 22 Aug 2013 14:06:52 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r254600 - head/lib/libutil References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> <20130821190309.GB52908@omg> <20130821202725.GA4991@stack.nl> <20130821212413.GC52908@omg> <20130821213755.GA8052@stack.nl> <5215E16E.4080207@freebsd.org> In-Reply-To: <5215E16E.4080207@freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Sergey Kandaurov , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 10:07:04 -0000 On 22.08.2013 14:01, Andrey Chernov wrote: > On 22.08.2013 1:37, Jilles Tjoelker wrote: >>> if (number == UINTMAX_MAX && errno == ERANGE) { >>> return (-1); >>> } >>> >>> + if (errno == 0) >>> + errno = saved_errno; >>> + >> This looks good to me. >> > > Just being nitpicking) number == UINTMAX_MAX check is unneeded. > Sorry for misguiding, forget it. The check is needed, other functions inside strtoumax() (FIX_LOCALE, isspace) may set errno in theory. -- http://ache.vniz.net/ bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 10:07:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CF4B7EED for ; Thu, 22 Aug 2013 10:07:45 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67A382EE8 for ; Thu, 22 Aug 2013 10:07:45 +0000 (UTC) Received: by mail-ea0-f172.google.com with SMTP id r16so807412ead.3 for ; Thu, 22 Aug 2013 03:07:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding; bh=jPd64LOJ2LCRbl5L+RL17xcvyMBAaQelZ55wHWlPygU=; b=UBdY/5thG0jvMfBT0bo+ZQoq4jlwq2rs+YTA9nb12AlGXSIHzjxy9/yWQTaqKvPrfs ZkXT1akQW7PYqZ7ClcHAZbzMwphQgiDus1sC7d1YcMLC1TwSBfapTth1sVi0c+j1GXlE /G1frdOrqWeqN01mKdye+YPlNYJN3Ai4gJBCUrn1ketLxFfUrF+VvQ7zol+vj05fORLW GXKRxGPYjyqugahMu2+o9zWkoxQfhYsh5oiBtpJcgIw9UYUXuaGFrG25pZ7M9uffO0IU 7xpYriwpDA1Xy2J+HPKglufTxt0ADoWVqQNa8wiqsGo+YJWmD3+DNINAc8QagYSal5J9 JrOw== X-Gm-Message-State: ALoCoQllKdF7Xz+Sxyo72QHLAxWjjqHE43Vt5vhfC9YRnSmSKW5I5hL3aCHPguY438k/56QdKqNR X-Received: by 10.15.27.133 with SMTP id p5mr1868011eeu.65.1377165682149; Thu, 22 Aug 2013 03:01:22 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id b45sm16365250eef.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Aug 2013 03:01:21 -0700 (PDT) Message-ID: <5215E16E.4080207@freebsd.org> Date: Thu, 22 Aug 2013 14:01:18 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r254600 - head/lib/libutil References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> <20130821190309.GB52908@omg> <20130821202725.GA4991@stack.nl> <20130821212413.GC52908@omg> <20130821213755.GA8052@stack.nl> In-Reply-To: <20130821213755.GA8052@stack.nl> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Sergey Kandaurov , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 10:07:45 -0000 On 22.08.2013 1:37, Jilles Tjoelker wrote: >> if (number == UINTMAX_MAX && errno == ERANGE) { >> return (-1); >> } >> >> + if (errno == 0) >> + errno = saved_errno; >> + > This looks good to me. > Just being nitpicking) number == UINTMAX_MAX check is unneeded. -- http://ache.vniz.net/ bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 10:51:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FF6F9C8; Thu, 22 Aug 2013 10:51:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id A58DB21C9; Thu, 22 Aug 2013 10:51:30 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 0D4F44241AC; Thu, 22 Aug 2013 20:51:17 +1000 (EST) Date: Thu, 22 Aug 2013 20:51:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r254600 - head/lib/libutil In-Reply-To: <20130821213755.GA8052@stack.nl> Message-ID: <20130822185756.Y1297@besplex.bde.org> References: <201308211646.r7LGk6eV051215@svn.freebsd.org> <5214F72B.7070006@freebsd.org> <20130821190309.GB52908@omg> <20130821202725.GA4991@stack.nl> <20130821212413.GC52908@omg> <20130821213755.GA8052@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=aw4-S10CjX0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=H7VN2zDOXXgA:10 a=10tJtSuNjYdlZKnmVusA:9 a=nWxIxC1GMPgnsk2h:21 a=zFEI9HLo3Qmo5DcZ:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sergey Kandaurov , Andrey Chernov , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 10:51:31 -0000 On Wed, 21 Aug 2013, Jilles Tjoelker wrote: > On Thu, Aug 22, 2013 at 01:24:13AM +0400, Sergey Kandaurov wrote: >> On Wed, Aug 21, 2013 at 10:27:25PM +0200, Jilles Tjoelker wrote: >>> On Wed, Aug 21, 2013 at 11:03:10PM +0400, Sergey Kandaurov wrote: >>>> On Wed, Aug 21, 2013 at 09:21:47PM +0400, Andrey Chernov wrote: >>>>> On 21.08.2013 20:46, Sergey Kandaurov wrote: >>>>>> number = strtoumax(buf, &endptr, 0); >>>>>> >>>>>> + if (number == UINTMAX_MAX && errno == ERANGE) { >>>>>> + return (-1); >>>>>> + } > >>>>> You need to reset errno before strtoumax() call (errno = 0), because any >>>>> of previous functions may left it as ERANGE. This also has a bogus test for UINTMAX_MAX wheich prevents input of the number UINTMAX_MAX on systems where the limit for the function (UINT64_T_MAX) is the same as the limit for strtoumax(). This test is a wrong way of doing the errno thing. This also has a high density of style bugs: - excessive braces - extra blank line expand_number() remains a very badly designed and implemented function. Its design errors start with its name. It doesn't expand numbers. It converts strings to numbers. The strtoumax() family is missing this bug and others. Its design errors continue with it taking a uint64_t arg and not a uint64_t arg. Its implementation errors begin with broken range checking. The above is an incomplete fix for this. Unless uintmax_t is the same as uint64_t, there are still the following bugs: - the return value of strotumax() is assigned to a uint64_t. This may overflow. After overflow, the bogus (number == UINTMAX_MAX) check has no effect, since when overflow is possible 'number' cannot equal UINTMAX_MAX. - values that exceed the maximum supported (UINT64_MAX) are not detected. They are silently truncated to uint64_t. >>>> Thanks for pointing out. >>>> Does the patch look good? No. It adds many more style bugs... >>>> Index: expand_number.c >>>> =================================================================== >>>> --- expand_number.c (revision 254600) >>>> +++ expand_number.c (working copy) >>>> @@ -53,6 +53,8 @@ >>>> unsigned shift; >>>> char *endptr; >>>> >>>> + errno = 0; >>>> + Another extra blank line. It is worse than most, since it separates the initialization for calling stroumax() from the call. >>>> number = strtoumax(buf, &endptr, 0); >>>> This extra blank line separates the call from the error checking for the function. It was added in the commit that started this thread. The previous version had a bogus extra blank line to separate the result of the error checking from the call. >>>> if (number == UINTMAX_MAX && errno == ERANGE) { > >>> This may cause the function to set errno=0 if it is successful, which is >>> not allowed for standard library functions from C and POSIX. There may >>> be a problem not only if expand_number() is standardized but also if it >>> is used in the implementation of a standard library function. The best >>> solution is to save and restore errno around this (if [ERANGE] is >>> detected, that is a valid errno value to keep). This is painful, but seems to be necessary. >>> In an application it is acceptable to set errno=0 without further ado. > >> What about this change? >> It changes errno only if it was modified from zero in strtoumax(). >> Unconditionally restoring errno after strtoumax() unless ERANGE is >> probably not good as strtoumax() might set different errno (e.g. EINVAL) >> and we might want to keep it as well. Please correct me, if I'm wrong. > >> Index: lib/libutil/expand_number.c >> =================================================================== >> --- lib/libutil/expand_number.c (revision 254600) >> +++ lib/libutil/expand_number.c (working copy) >> @@ -50,15 +50,22 @@ >> expand_number(const char *buf, uint64_t *num) >> { >> uint64_t number; >> + int saved_errno; Style bugs: - declarations more unsorted than before. Previously, only endptr was unsorted. - the variable for this is normally names serrno. libutil mostly follows this convention -- it has several serrno's and no saved_errno's, but it does have some error's (error = errno; ...), mainly in pidfile.c. Only login_cap.c is notkkk careful about clobbering errno to 0. >> unsigned shift; >> char *endptr; >> >> + saved_errno = errno; >> + errno = 0; >> + >> number = strtoumax(buf, &endptr, 0); >> >> if (number == UINTMAX_MAX && errno == ERANGE) { >> return (-1); >> } Style bugs, as above. >> >> + if (errno == 0) >> + errno = saved_errno; >> + Yet another style bug. >> if (endptr == buf) { >> /* No valid digits. */ >> errno = EINVAL; >> Another style bug is the placement of the error checking. Normally the endptr check is done before the range check. > > This looks good to me. This looks not so good to me. Some of the other bugs in the old version: % /* % * Convert an expression of the following forms to a uint64_t. % * 1) A positive decimal number. % * 2) A positive decimal number followed by a 'b' or 'B' (mult by 1). % * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10). % * 4) A positive decimal number followed by a 'm' or 'M' (mult by 1 << 20). % * 5) A positive decimal number followed by a 'g' or 'G' (mult by 1 << 30). % * 6) A positive decimal number followed by a 't' or 'T' (mult by 1 << 40). % * 7) A positive decimal number followed by a 'p' or 'P' (mult by 1 << 50). % * 8) A positive decimal number followed by a 'e' or 'E' (mult by 1 << 60). This garbage was copied from a similar comment in dd/args.c. The number is actually neither positive nor decimal, especially in dd where there is a variant of this function that returns negative numbers. Another design error in this function is that it can't return negative numbers. % */ % This bogus blank line detaches the comment from the code that it describes, resulting in the comment describing null code. % int % expand_number(const char *buf, uint64_t *num) % { % uint64_t number; % unsigned shift; % char *endptr; % % number = strtoumax(buf, &endptr, 0); This supports non-positive non-decimal numbers. The support for non-decimal numbers is more intentional (it is given by the base 0 in the call). Negative numbers are only supported by strtoumax() allowing a minus sign and returning a nonnegative number equal to 1 larger than UINTMAX_MAX less the number without the minus sign. % % if (endptr == buf) { % /* No valid digits. */ % errno = EINVAL; % return (-1); % } Most of the bugs except ones in the comment are missing in dd/args.c: % static uintmax_t % get_num(const char *val) % { % uintmax_t num, mult, prevnum; By using variables of the same type that strtoumax() returns, it avoids overflow bugs in the overflow checking... % char *expr; % % errno = 0; This was fixed 14 years ago in dd. Perhaps earlier in my version. For variations on the bugs, see the 4.4Lite version. It was missing this errno setting. Since this is an application, it can clobber errno like this. % num = strtouq(val, &expr, 0); This is still broken. It unnecessarily assumes that uquad_t = uintmax_t. 4.4BSD-Lite uses strtoul() here, and using strtouq() is a wrong fix. % if (errno != 0) /* Overflow or underflow. */ % err(1, "%s", oper); The error handling is simpler since this is not a library function. The comment about underflow is wrong. Underflow can't happen. What the comment means by underflow is "overflow, with a negative sign". 4.4BSD-Lite was missing this bug. But 4.4BSD-Lite had a wrong range check (num == ULONG_MAX, essentially the same as expand_number() now). % 4.4BSD-Lite was missing this bug (extra blank line). % if (expr == val) /* No valid digits. */ % errx(1, "%s: illegal numeric value", oper); - this code, with its more specific error message, was broken by a POSIX bug. It is now unreachable (EINVAL is returned if no number is found, and for some other cases like an invalid base which can't happen for the above call). It is not bad to break it becauses its message is of low quality in a different way than the strerror(errno) message from err(). There are no lawyers here. strerror(EINVAL) is just too generic. % [...] dd's function is very careful to avoid overflow in shifts and multiplications. expand_number() just allows things to overflow. Since the variables are unsigned, overflow just causes garbage results. Not good enough for a library function. dd's function also supports multipliers. The overflow avoidance is more complication for multiplication than for shifting. Multipliers would be useful in a library function too. expand_number() doesn't support them. Another of its design errors is that it does less than dd's functions, so it cannot be used to replace them. % } % % /* % * Convert an expression of the following forms to an off_t. This is the % * same as get_num(), but it uses signed numbers. % * % * The major problem here is that an off_t may not necessarily be a intmax_t. % */ % static off_t % get_off_t(const char *val) % { % intmax_t num, mult, prevnum; % char *expr; % % errno = 0; % num = strtoq(val, &expr, 0); % if (errno != 0) /* Overflow or underflow. */ % err(1, "%s", oper); % % if (expr == val) /* No valid digits. */ % errx(1, "%s: illegal numeric value", oper); % ... % } dd also has this misimplemented function. It is supposed to fix the problem that get_num() only returns unsigned values. But it is misimplemented by making a copy of get_num() and changing some unsigned types to signed types. The result is mostly worse than casting the result of get_num(). The careful overflow checking no longer works, since it is actually not so careful and does things like checking for overflow after overflow has already occurred. Overflow already occurring gives underfined behaviour with signed types. So the duplicated function differs from just casting the result of get_num() as follows: - it gives undefined behaviour on overflow - strtoq() clamps to QUAD_MAX_/MIN where strtouq() clamps to UQUAD_MAX/MIN(). This mainly amplifies the bugs seeking to large offsets. The kernel supports 64-bit unsigned offsets for some defice files and these are needed for /dev/kmem. But QUAD_MAX is smaller than the necessary offsets, so oseek and iseek in bytes are broken. You have to trick dd into working by using non-byte offsets. Some tricks (bogus casts/conversions in various places) are needed anyway since signed 64-bit off_t can't hold the necessary offsets. The function is still missing checks that quad_t is not too large for offsets. My fix for get_off_t() is to just make it (off_t)get_num() with a check that the result is actually representable as an off_t. This only depends on 2's complement magic. To start fixing expand_number(): /* Fix comment here. */ int expand_number(const char *buf, uint64_t *num) { char *endptr; uintmax_t num; uint64_t number; unsigned shift; int serrno; serrno = errno; errno = 0; num = strtoumax(buf, &endptr, 0); if (num > UINT64_MAX) errno = ERANGE; if (errno != 0) return (-1); errno = serrno; number = num; ... } This depends on the POSIX bug for detecting the no-digits case. Fortunately, the early error handling of this function is simple and compatible with that of strtoumax(), so we don't need to translate strtoumax()'s errors except for adjusting its range error. Similarly in dd: /* Fix comment here. */ static uintmax_t get_num(const char *val) { char *expr; uintmax_t num, mult, prevnum; errno = 0; num = strtoumax(val, &expr, 0); if (errno != 0) err(1, "%s", oper); ... } /* * Convert an expression of the above form to an off_t. This version does * not handle negative numbers perfectly. It assumes 2's complement and * maybe nonnegative multipliers. I hope perfect handling is not necessary * for dd. */ static off_t get_off_t(const char *val) { uintmax_t num; num = get_num(val); if (num != (u_quad_t)(off_t)num) errx(1, "%s: offset too large", oper); return ((off_t)num); } Bruce From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 11:49:37 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E882D587; Thu, 22 Aug 2013 11:49:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 597682616; Thu, 22 Aug 2013 11:49:34 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 707643C408A; Thu, 22 Aug 2013 21:49:20 +1000 (EST) Date: Thu, 22 Aug 2013 21:49:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc In-Reply-To: <86y57ugn00.fsf@nine.des.no> Message-ID: <20130822213005.H1824@besplex.bde.org> References: <201308212257.r7LMvUmY053608@svn.freebsd.org> <8638q2i1oo.fsf@nine.des.no> <86y57ugn00.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-597222542-1377172158=:1824" X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=Tjuh2rCmyooA:10 a=JzwRw_2MAAAA:8 a=-2CbWcZpqT0A:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=QsAagnHujDszEWpeXfwA:9 a=45ClL6m2LaAA:10 Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org, "David E. O'Brien" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 11:49:38 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-597222542-1377172158=:1824 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 22 Aug 2013, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Dag-Erling Sm=C3=B8rgrav writes: >> This breaks the build in usr.bin/expr because expr.y already provides a >> prototype, and gcc does not accept multiple prototypes, even if they're >> identical. That is arguably a bug in gcc, ISTR that it took several rounds of changes to fix the same bug in -current in expr and many other places. > Oh, it's actually our own fault for including -Wredundant-decls in > CFLAGS. Is there a good reason to keep it? > > -Wredundant-decls > Warn if anything is declared more than once in the same scope, = even > in cases where multiple declaration is valid and changes nothin= g. How else would you detect bogus declarations of library functions? Almost all -W flags are for detecting bugs that are mostly style bugs like this one. This one only becomes more than a style bug if: - the declaration becomes wrong - the header with the correct declaration becomes not included. Another bug in the commit is that it auto-generates code with a style bug (redundant extern). yacc in -current seems to auto-generate a function prototype for just one function (the same one), and this has the style bug too. This may be needed for K&R1 version compilers from 1978, but not for the STDC case. Bruce --0-597222542-1377172158=:1824-- From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 11:56:18 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8C4A3A16; Thu, 22 Aug 2013 11:56:18 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 4CABD26A3; Thu, 22 Aug 2013 11:56:18 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 9107841A9; Thu, 22 Aug 2013 11:56:17 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 0A3BA2FBC3; Thu, 22 Aug 2013 13:56:09 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc References: <201308212257.r7LMvUmY053608@svn.freebsd.org> <8638q2i1oo.fsf@nine.des.no> <86y57ugn00.fsf@nine.des.no> <20130822213005.H1824@besplex.bde.org> Date: Thu, 22 Aug 2013 13:56:06 +0200 In-Reply-To: <20130822213005.H1824@besplex.bde.org> (Bruce Evans's message of "Thu, 22 Aug 2013 21:49:18 +1000 (EST)") Message-ID: <864naios6h.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org, "David E. O'Brien" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 11:56:18 -0000 Bruce Evans writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Oh, it's actually our own fault for including -Wredundant-decls in > > CFLAGS. Is there a good reason to keep it? > How else would you detect bogus declarations of library functions? Almost > all -W flags are for detecting bugs that are mostly style bugs like this > one. This one only becomes more than a style bug if: > - the declaration becomes wrong > - the header with the correct declaration becomes not included. OK, point taken. > Another bug in the commit is that it auto-generates code with a style > bug (redundant extern). yacc in -current seems to auto-generate a > function prototype for just one function (the same one), and this has > the style bug too. This may be needed for K&R1 version compilers from > 1978, but not for the STDC case. I noticed that as well. So what do you suggest? Revert David's change, or keep it (minus extern) and remove the prototype from expr.y? I favor the latter option, since yyparse() is auto-generated and expr.y can therefore (strictly speaking) not know what the correct prototype looks like. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 12:47:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5489BD9D; Thu, 22 Aug 2013 12:47:25 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CBE6B2A73; Thu, 22 Aug 2013 12:47:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r7MCgfrY010549; Thu, 22 Aug 2013 16:42:41 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 22 Aug 2013 16:42:41 +0400 (MSK) From: Dmitry Morozovsky To: "Kenneth D. Merry" Subject: Re: svn commit: r254615 - head/sys/dev/mps In-Reply-To: <201308212130.r7LLUvO5008991@svn.freebsd.org> Message-ID: References: <201308212130.r7LLUvO5008991@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Thu, 22 Aug 2013 16:42:41 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 12:47:25 -0000 Ken, On Wed, 21 Aug 2013, Kenneth D. Merry wrote: > Author: ken > Date: Wed Aug 21 21:30:56 2013 > New Revision: 254615 > URL: http://svnweb.freebsd.org/changeset/base/254615 > > Log: > Fix mps(4) driver breakage that came in in change 253550 that > manifested itself in out of chain frame conditions. > > When the driver ran out of chain frames, the request in question > would get completed early, and go through mpssas_scsiio_complete(). > > In mpssas_scsiio_complete(), the negation of the CAM status values > (CAM_STATUS_MASK | CAM_SIM_QUEUED) was ORed in instead of being > ANDed in. This resulted in a bogus CAM CCB status value. This > didn't show up in the non-error case, because the status was reset > to something valid (e.g. CAM_REQ_CMP) later on in the function. > > But in the error case, such as when the driver ran out of chain > frames, the CAM_REQUEUE_REQ status was ORed in to the bogus status > value. This led to the CAM transport layer repeatedly releasing > the SIM queue, because it though that the CAM_RELEASE_SIMQ flag had > been set. The symptom was messages like this on the console when > INVARIANTS were enabled: > > xpt_release_simq: requested 1 > present 0 > xpt_release_simq: requested 1 > present 0 > xpt_release_simq: requested 1 > present 0 what is real impact of the bug? > > mps_sas.c: In mpssas_scsiio_complete(), use &= to take status > bits out. |= adds them in. > > In the error case in mpssas_scsiio_complete(), set > the status to CAM_REQUEUE_REQ, don't OR it in. > > MFC after: 3 days This patch does not apply cleanly as r253550 had not been merged, and the first masking does not occur on contemporary stable/9. Comments? Thank you! > Sponsored by: Spectra Logic > > Modified: > head/sys/dev/mps/mps_sas.c > > Modified: head/sys/dev/mps/mps_sas.c > ============================================================================== > --- head/sys/dev/mps/mps_sas.c Wed Aug 21 21:30:06 2013 (r254614) > +++ head/sys/dev/mps/mps_sas.c Wed Aug 21 21:30:56 2013 (r254615) > @@ -2103,7 +2103,7 @@ mpssas_scsiio_complete(struct mps_softc > cm->cm_targ->completed++; > cm->cm_targ->outstanding--; > TAILQ_REMOVE(&cm->cm_targ->commands, cm, cm_link); > - ccb->ccb_h.status |= ~(CAM_STATUS_MASK | CAM_SIM_QUEUED); > + ccb->ccb_h.status &= ~(CAM_STATUS_MASK | CAM_SIM_QUEUED); > > if (cm->cm_state == MPS_CM_STATE_TIMEDOUT) { > TAILQ_REMOVE(&cm->cm_targ->timedout_commands, cm, cm_recovery); > @@ -2145,7 +2145,7 @@ mpssas_scsiio_complete(struct mps_softc > * because there can be no reply when we haven't actually > * gone out to the hardware. > */ > - ccb->ccb_h.status |= CAM_REQUEUE_REQ; > + ccb->ccb_h.status = CAM_REQUEUE_REQ; > > /* > * Currently the only error included in the mask is > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 12:47:40 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B711DED0; Thu, 22 Aug 2013 12:47:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 76BE42A78; Thu, 22 Aug 2013 12:47:40 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 6177742466B; Thu, 22 Aug 2013 22:47:32 +1000 (EST) Date: Thu, 22 Aug 2013 22:47:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc In-Reply-To: <864naios6h.fsf@nine.des.no> Message-ID: <20130822224100.X2060@besplex.bde.org> References: <201308212257.r7LMvUmY053608@svn.freebsd.org> <8638q2i1oo.fsf@nine.des.no> <86y57ugn00.fsf@nine.des.no> <20130822213005.H1824@besplex.bde.org> <864naios6h.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2098027519-1377175650=:2060" X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=Tjuh2rCmyooA:10 a=JzwRw_2MAAAA:8 a=-2CbWcZpqT0A:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=zNDP2BohpHpTM0P1bZ0A:9 a=45ClL6m2LaAA:10 Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-9@FreeBSD.org, "David E. O'Brien" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 12:47:40 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-2098027519-1377175650=:2060 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 22 Aug 2013, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: >> Dag-Erling Sm=C3=B8rgrav writes: >>> Oh, it's actually our own fault for including -Wredundant-decls in >>> CFLAGS. Is there a good reason to keep it? >> How else would you detect bogus declarations of library functions? Almo= st >> all -W flags are for detecting bugs that are mostly style bugs like this >> one. This one only becomes more than a style bug if: >> - the declaration becomes wrong >> - the header with the correct declaration becomes not included. > > OK, point taken. > ... > So what do you suggest? Revert David's change, or keep it (minus > extern) and remove the prototype from expr.y? > > I favor the latter option, since yyparse() is auto-generated and expr.y > can therefore (strictly speaking) not know what the correct prototype > looks like. Depends what the reason for merging the change is. Is it to cross-build old sources with a current yacc? Then changing the old sources is not so good. It makes them not-old, and missing the declaration going the other way with an old yacc. I now remember not really liking the change to expr.y in -current either for the same reason. It de-portabilizes the sources a little. Bruce --0-2098027519-1377175650=:2060-- From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 12:49:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5C80B9; Thu, 22 Aug 2013 12:49:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C37BA2A92; Thu, 22 Aug 2013 12:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MCnSRm077187; Thu, 22 Aug 2013 12:49:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MCnSZK077186; Thu, 22 Aug 2013 12:49:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201308221249.r7MCnSZK077186@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Aug 2013 12:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254654 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 12:49:28 -0000 Author: ae Date: Thu Aug 22 12:49:28 2013 New Revision: 254654 URL: http://svnweb.freebsd.org/changeset/base/254654 Log: Really disconnect pkg_install from the build. Reported by: Mikhail Timofeyev Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Aug 22 09:33:07 2013 (r254653) +++ head/share/mk/bsd.own.mk Thu Aug 22 12:49:28 2013 (r254654) @@ -332,7 +332,6 @@ __DEFAULT_YES_OPTIONS = \ PC_SYSINSTALL \ PF \ PKGBOOTSTRAP \ - PKGTOOLS \ PMC \ PORTSNAP \ PPP \ @@ -385,6 +384,7 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED \ OPENSSH_NONE_CIPHER \ + PKGTOOLS \ SHARED_TOOLCHAIN \ SVN \ USB_GADGET_EXAMPLES From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 14:02:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77A1DCD6; Thu, 22 Aug 2013 14:02:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 561012F62; Thu, 22 Aug 2013 14:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ME2c2u015780; Thu, 22 Aug 2013 14:02:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ME2Zh7015706; Thu, 22 Aug 2013 14:02:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201308221402.r7ME2Zh7015706@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 22 Aug 2013 14:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254657 - in head: sbin/iscontrol sys/conf sys/dev/iscsi/initiator sys/dev/iscsi_initiator sys/modules sys/modules/iscsi/initiator sys/modules/iscsi_initiator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 14:02:38 -0000 Author: trasz Date: Thu Aug 22 14:02:34 2013 New Revision: 254657 URL: http://svnweb.freebsd.org/changeset/base/254657 Log: Move the old iSCSI initiator source to a more appropriate place (sys/dev/iscsi_initiator/ instead of sys/dev/iscsi/initiator/), to make room for the new one. This is also more logical location (kernel module being named iscsi_initiator.ko, for example). There is no ongoing work on this I know of, so it shouldn't make life harder for anyone. There are no functional changes, apart from "svn mv" and adjusting paths. Added: head/sys/dev/iscsi_initiator/ - copied from r254596, head/sys/dev/iscsi/initiator/ head/sys/modules/iscsi_initiator/ - copied from r254596, head/sys/modules/iscsi/initiator/ Deleted: head/sys/dev/iscsi/initiator/ head/sys/modules/iscsi/initiator/ Modified: head/sbin/iscontrol/auth_subr.c head/sbin/iscontrol/config.c head/sbin/iscontrol/fsm.c head/sbin/iscontrol/iscontrol.c head/sbin/iscontrol/login.c head/sbin/iscontrol/misc.c head/sbin/iscontrol/pdu.c head/sys/conf/files head/sys/dev/iscsi_initiator/isc_cam.c head/sys/dev/iscsi_initiator/isc_sm.c head/sys/dev/iscsi_initiator/isc_soc.c head/sys/dev/iscsi_initiator/isc_subr.c head/sys/dev/iscsi_initiator/iscsi.c head/sys/dev/iscsi_initiator/iscsi_subr.c head/sys/modules/Makefile head/sys/modules/iscsi_initiator/Makefile Modified: head/sbin/iscontrol/auth_subr.c ============================================================================== --- head/sbin/iscontrol/auth_subr.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/auth_subr.c Thu Aug 22 14:02:34 2013 (r254657) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" static int Modified: head/sbin/iscontrol/config.c ============================================================================== --- head/sbin/iscontrol/config.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/config.c Thu Aug 22 14:02:34 2013 (r254657) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" /* Modified: head/sbin/iscontrol/fsm.c ============================================================================== --- head/sbin/iscontrol/fsm.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/fsm.c Thu Aug 22 14:02:34 2013 (r254657) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" typedef enum { Modified: head/sbin/iscontrol/iscontrol.c ============================================================================== --- head/sbin/iscontrol/iscontrol.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/iscontrol.c Thu Aug 22 14:02:34 2013 (r254657) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" static char version[] = "2.3.1"; // keep in sync with iscsi_initiator Modified: head/sbin/iscontrol/login.c ============================================================================== --- head/sbin/iscontrol/login.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/login.c Thu Aug 22 14:02:34 2013 (r254657) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" static char *status_class1[] = { Modified: head/sbin/iscontrol/misc.c ============================================================================== --- head/sbin/iscontrol/misc.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/misc.c Thu Aug 22 14:02:34 2013 (r254657) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" static inline char Modified: head/sbin/iscontrol/pdu.c ============================================================================== --- head/sbin/iscontrol/pdu.c Thu Aug 22 13:24:40 2013 (r254656) +++ head/sbin/iscontrol/pdu.c Thu Aug 22 14:02:34 2013 (r254657) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "iscontrol.h" static void pukeText(char *it, pdu_t *pp); Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 22 13:24:40 2013 (r254656) +++ head/sys/conf/files Thu Aug 22 14:02:34 2013 (r254657) @@ -1521,12 +1521,12 @@ ipw_monitor.fw optional ipwmonitorfw | compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" -dev/iscsi/initiator/iscsi.c optional iscsi_initiator scbus -dev/iscsi/initiator/iscsi_subr.c optional iscsi_initiator scbus -dev/iscsi/initiator/isc_cam.c optional iscsi_initiator scbus -dev/iscsi/initiator/isc_soc.c optional iscsi_initiator scbus -dev/iscsi/initiator/isc_sm.c optional iscsi_initiator scbus -dev/iscsi/initiator/isc_subr.c optional iscsi_initiator scbus +dev/iscsi_initiator/iscsi.c optional iscsi_initiator scbus +dev/iscsi_initiator/iscsi_subr.c optional iscsi_initiator scbus +dev/iscsi_initiator/isc_cam.c optional iscsi_initiator scbus +dev/iscsi_initiator/isc_soc.c optional iscsi_initiator scbus +dev/iscsi_initiator/isc_sm.c optional iscsi_initiator scbus +dev/iscsi_initiator/isc_subr.c optional iscsi_initiator scbus dev/isf/isf.c optional isf dev/isf/isf_fdt.c optional isf fdt dev/isf/isf_nexus.c optional isf Modified: head/sys/dev/iscsi_initiator/isc_cam.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_cam.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/iscsi_initiator/isc_cam.c Thu Aug 22 14:02:34 2013 (r254657) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include static void _inq(struct cam_sim *sim, union ccb *ccb) Modified: head/sys/dev/iscsi_initiator/isc_sm.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_sm.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/iscsi_initiator/isc_sm.c Thu Aug 22 14:02:34 2013 (r254657) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include static void _async(isc_session_t *sp, pduq_t *pq) Modified: head/sys/dev/iscsi_initiator/isc_soc.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_soc.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/iscsi_initiator/isc_soc.c Thu Aug 22 14:02:34 2013 (r254657) @@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #ifndef NO_USE_MBUF #define USE_MBUF Modified: head/sys/dev/iscsi_initiator/isc_subr.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_subr.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/iscsi_initiator/isc_subr.c Thu Aug 22 14:02:34 2013 (r254657) @@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include static MALLOC_DEFINE(M_ISC, "iSC", "iSCSI driver options"); Modified: head/sys/dev/iscsi_initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi/initiator/iscsi.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/iscsi_initiator/iscsi.c Thu Aug 22 14:02:34 2013 (r254657) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include static char *iscsi_driver_version = "2.3.1"; static struct isc_softc *isc; Modified: head/sys/dev/iscsi_initiator/iscsi_subr.c ============================================================================== --- head/sys/dev/iscsi/initiator/iscsi_subr.c Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/dev/iscsi_initiator/iscsi_subr.c Thu Aug 22 14:02:34 2013 (r254657) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include /* | Interface to the SCSI layer Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Aug 22 13:24:40 2013 (r254656) +++ head/sys/modules/Makefile Thu Aug 22 14:02:34 2013 (r254657) @@ -159,7 +159,7 @@ SUBDIR= \ ${_ipw} \ ${_ipwfw} \ ${_isci} \ - iscsi \ + iscsi_initiator \ isp \ ${_ispfw} \ ${_iwi} \ Modified: head/sys/modules/iscsi_initiator/Makefile ============================================================================== --- head/sys/modules/iscsi/initiator/Makefile Wed Aug 21 08:01:52 2013 (r254596) +++ head/sys/modules/iscsi_initiator/Makefile Thu Aug 22 14:02:34 2013 (r254657) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../dev/iscsi/initiator +.PATH: ${.CURDIR}/../../dev/iscsi_initiator KMOD=iscsi_initiator SRCS= iscsi.h iscsivar.h From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 14:21:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 25C9945E; Thu, 22 Aug 2013 14:21:09 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E88AE20F1; Thu, 22 Aug 2013 14:21:08 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r7MEL7pR050671; Thu, 22 Aug 2013 08:21:07 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r7MEL7qi050670; Thu, 22 Aug 2013 08:21:07 -0600 (MDT) (envelope-from ken) Date: Thu, 22 Aug 2013 08:21:07 -0600 From: "Kenneth D. Merry" To: Dmitry Morozovsky Subject: Re: svn commit: r254615 - head/sys/dev/mps Message-ID: <20130822142107.GA49996@nargothrond.kdm.org> References: <201308212130.r7LLUvO5008991@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 14:21:09 -0000 On Thu, Aug 22, 2013 at 16:42:41 +0400, Dmitry Morozovsky wrote: > Ken, > > On Wed, 21 Aug 2013, Kenneth D. Merry wrote: > > > Author: ken > > Date: Wed Aug 21 21:30:56 2013 > > New Revision: 254615 > > URL: http://svnweb.freebsd.org/changeset/base/254615 > > > > Log: > > Fix mps(4) driver breakage that came in in change 253550 that > > manifested itself in out of chain frame conditions. > > > > When the driver ran out of chain frames, the request in question > > would get completed early, and go through mpssas_scsiio_complete(). > > > > In mpssas_scsiio_complete(), the negation of the CAM status values > > (CAM_STATUS_MASK | CAM_SIM_QUEUED) was ORed in instead of being > > ANDed in. This resulted in a bogus CAM CCB status value. This > > didn't show up in the non-error case, because the status was reset > > to something valid (e.g. CAM_REQ_CMP) later on in the function. > > > > But in the error case, such as when the driver ran out of chain > > frames, the CAM_REQUEUE_REQ status was ORed in to the bogus status > > value. This led to the CAM transport layer repeatedly releasing > > the SIM queue, because it though that the CAM_RELEASE_SIMQ flag had > > been set. The symptom was messages like this on the console when > > INVARIANTS were enabled: > > > > xpt_release_simq: requested 1 > present 0 > > xpt_release_simq: requested 1 > present 0 > > xpt_release_simq: requested 1 > present 0 > > what is real impact of the bug? Your system will essentially hang, certainly as far as anything connected to the controller in question. > > > > mps_sas.c: In mpssas_scsiio_complete(), use &= to take status > > bits out. |= adds them in. > > > > In the error case in mpssas_scsiio_complete(), set > > the status to CAM_REQUEUE_REQ, don't OR it in. > > > > MFC after: 3 days > > This patch does not apply cleanly as r253550 had not been merged, and the first > masking does not occur on contemporary stable/9. Comments? As far as I know, this is not a problem on the version of the driver in stable/9. But then again, I have not tested the out of chain frames code since early 2011 when I last fixed it. If you want to verify the behavior is correct in stable/9, do this: 1. enable INVARIANTS 2. In /boot/loader.conf: hw.mps.max_chains=32 3. Use up most of your memory. If you're using ZFS, just do a sequential write to a file so that the ARC starts filling up with cached data. Look at the free memory in top to see how much you've used. This will cause enough fragmentation to lead to more scatter/gather segments getting used in the driver. 4. Do something like this: ((i=0)); while [ $i -lt 60 ]; do dd if=/dev/da0 of=/dev/null bs=1m & ((i++)); done 5. Look for an out of chain frames message on the console. To see how far you are towards using the chain frames, run 'sysctl dev.mps'. You can see how many chain frames you have free, and how many requests have failed. This change just needs to be merged along with the other changes to avoid having the regression in stable. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 14:58:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6198531F; Thu, 22 Aug 2013 14:58:07 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD3162352; Thu, 22 Aug 2013 14:58:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r7MEw0Xe014172; Thu, 22 Aug 2013 18:58:00 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 22 Aug 2013 18:58:00 +0400 (MSK) From: Dmitry Morozovsky To: "Kenneth D. Merry" Subject: Re: svn commit: r254615 - head/sys/dev/mps In-Reply-To: <20130822142107.GA49996@nargothrond.kdm.org> Message-ID: References: <201308212130.r7LLUvO5008991@svn.freebsd.org> <20130822142107.GA49996@nargothrond.kdm.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Thu, 22 Aug 2013 18:58:00 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 14:58:07 -0000 On Thu, 22 Aug 2013, Kenneth D. Merry wrote: > > > Fix mps(4) driver breakage that came in in change 253550 that > > > manifested itself in out of chain frame conditions. > > > > > > When the driver ran out of chain frames, the request in question > > > would get completed early, and go through mpssas_scsiio_complete(). > > what is real impact of the bug? > > Your system will essentially hang, certainly as far as anything connected > to the controller in question. [snip] > 5. Look for an out of chain frames message on the console. To see how far > you are towards using the chain frames, run 'sysctl dev.mps'. You can see > how many chain frames you have free, and how many requests have failed. > > This change just needs to be merged along with the other changes to avoid > having the regression in stable. Thank you very much for the explanation. We use a couple of servers with mps (and many spindles there), all on stable/9 from this summer, and you commit turns on an alarm light in my head ;) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 15:56:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56E49A40; Thu, 22 Aug 2013 15:56:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qe0-x234.google.com (mail-qe0-x234.google.com [IPv6:2607:f8b0:400d:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB3D02719; Thu, 22 Aug 2013 15:56:08 +0000 (UTC) Received: by mail-qe0-f52.google.com with SMTP id a11so1187211qen.25 for ; Thu, 22 Aug 2013 08:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Wj4XidgCkP7imiqxkPkwqynP0sfqn+E23hVbzo1dJkI=; b=JIi0Vz0NYP6Aa6bD/z1KU8d3Ok9HW7TlNYG0YUogoDdWxzaLUoVUKNm1bh7pwZyOxo dfsiZc2rgFLh6AOquHfHT3CclgOp/jMiJPwkdeyWlXS12M9QjfIp45KNctehu6BTObig Xm9LIQ9LhD2ihq8KZaVz621+14P8BxeCF5zmiP+tv+LUEAx9XjVdep+XLYKI2Bkerz4m Lcd8opmOZ0aLVHOcbpm3mj9r3VUvtRS067aRqTj38bPa5QlPTK6EOm9c3GVO9GRYtBJF O42mLWNF7PQZDQw9tzFzf8WFCShvLZ7Q+2Um77SgES15ObUHHQFaCzYaSzJ5QRoCz09Y qNHA== MIME-Version: 1.0 X-Received: by 10.229.47.71 with SMTP id m7mr1698633qcf.25.1377186967869; Thu, 22 Aug 2013 08:56:07 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.49.39.101 with HTTP; Thu, 22 Aug 2013 08:56:07 -0700 (PDT) In-Reply-To: <201308040636.r746aI5i038931@svn.freebsd.org> References: <201308040636.r746aI5i038931@svn.freebsd.org> Date: Thu, 22 Aug 2013 09:56:07 -0600 X-Google-Sender-Auth: ASc1PLWBeU55DnFyaihfDufSNJ0 Message-ID: Subject: Re: svn commit: r253924 - in head: etc etc/rc.d share/man/man5 From: Alan Somers To: Hiroki Sato Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 15:56:09 -0000 With this revision, I am unable to down an ipv4 interface using "/etc/rc.d/netif stop em1". When I try, ipv4_down cannot find the address to delete, because "$_inet" begins with a tab character and the therefore it matches the "*)" rule in the case statement. Presumably "$_inet" doesn't always begin with a tab, so this patch will match with or without the tab. Does it look good to you? --- /usr/home/alans/freebsd/head/etc/network.subr 2013-08-20 19:33:30.6712 28832 +0000 +++ /etc/network.subr 2013-08-22 15:49:53.000000000 +0000 @@ -661,16 +668,16 @@ for _inet in $inetList ; do # get rid of extraneous line case $_inet in - "") break ;; - inet\ *) ;; - *) continue ;; + "") break ;; + \ inet\ *|inet\ *) ;; + *) continue ;; esac [ -z "$_inet" ] && break On Sun, Aug 4, 2013 at 12:36 AM, Hiroki Sato wrote: > Author: hrs > Date: Sun Aug 4 06:36:17 2013 > New Revision: 253924 > URL: http://svnweb.freebsd.org/changeset/base/253924 > > Log: > - Reimplement $gif_interfaces as a variant of $cloned_interfaces. > Newly-configured systems should use $cloned_interfaces. > > - Call clone_{up,down}() and ifnet_rename() in rc.d/netif {start,stop}. > ifnet_rename() now accepts an interface name list as its argument. > > - Add rc.d/netif clear. The "clear" subcommand is basically equivalent > to > "stop" but it does not call clone_down(). > > - Add "ifname:sticky" keyword into $cloned_interfaces. If :sticky is > specified, the interface will not be destroyed in rc.d/netif stop. > > - Add cloned_interfaces_sticky={YES,NO}. This variable globally sets > :sticky keyword above for all interfaces. The default value is NO. > When cloned_interfaces_sticky=YES, :nosticky keyword can be used to > override it on per interface basis. > > Modified: > head/etc/network.subr > head/etc/rc.d/netif > head/share/man/man5/rc.conf.5 > > Modified: head/etc/network.subr > > ============================================================================== > --- head/etc/network.subr Sun Aug 4 02:37:05 2013 (r253923) > +++ head/etc/network.subr Sun Aug 4 06:36:17 2013 (r253924) > @@ -660,6 +660,11 @@ ipv4_down() > IFS="$_ifs" > for _inet in $inetList ; do > # get rid of extraneous line > + case $_inet in > + "") break ;; > + inet\ *) ;; > + *) continue ;; > + esac > [ -z "$_inet" ] && break > > _inet=`expr "$_inet" : '.*\(inet > \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'` > @@ -1192,18 +1197,62 @@ ifscript_down() > # > clone_up() > { > - local _prefix _list ifn > + local _prefix _list ifn ifopt _iflist _n tmpargs > _prefix= > _list= > + _iflist=$* > > # create_args_IF > for ifn in ${cloned_interfaces}; do > + # Parse ifn:ifopt. > + OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS > + case $_iflist in > + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; > + *) continue ;; > + esac > + # Skip if ifn already exists. > + if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then > + continue > + fi > ${IFCONFIG_CMD} ${ifn} create `get_if_var ${ifn} > create_args_IF` > if [ $? -eq 0 ]; then > _list="${_list}${_prefix}${ifn}" > [ -z "$_prefix" ] && _prefix=' ' > fi > done > + if [ -n "$gif_interfaces" ]; then > + warn "\$gif_interfaces is obsolete. Use > \$cloned_interfaces instead." > + fi > + for ifn in ${gif_interfaces}; do > + # Parse ifn:ifopt. > + OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS > + case $_iflist in > + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; > + *) continue ;; > + esac > + # Skip if ifn already exists. > + if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then > + continue > + fi > + case $ifn in > + gif[0-9]*) > + ${IFCONFIG_CMD} $ifn create > + ;; > + *) > + _n=$(${IFCONFIG_CMD} gif create) > + ${IFCONFIG_CMD} $_n name $ifn > + ;; > + esac > + if [ $? -eq 0 ]; then > + _list="${_list}${_prefix}${ifn}" > + [ -z "$_prefix" ] && _prefix=' ' > + fi > + tmpargs=$(get_if_var $ifn gifconfig_IF) > + eval ifconfig_${ifn}=\"tunnel \$tmpargs\" > + done > + if [ -n "${_list}" ]; then > + echo "Created clone interfaces: ${_list}." > + fi > debug "Cloned: ${_list}" > } > > @@ -1213,17 +1262,42 @@ clone_up() > # > clone_down() > { > - local _prefix _list ifn > + local _prefix _list ifn ifopt _iflist _sticky > _prefix= > _list= > + _iflist=$* > > - for ifn in ${cloned_interfaces}; do > + : ${cloned_interfaces_sticky:=NO} > + if checkyesno cloned_interfaces_sticky; then > + _sticky=1 > + else > + _sticky=0 > + fi > + for ifn in ${cloned_interfaces} ${gif_interfaces}; do > + # Parse ifn:ifopt. > + OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS > + case $ifopt:$_sticky in > + sticky:*) continue ;; # :sticky => not destroy > + nosticky:*) ;; # :nosticky => destroy > + *:1) continue ;; # global sticky knob == 1 > + esac > + case $_iflist in > + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; > + *) continue ;; > + esac > + # Skip if ifn does not exist. > + if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then > + continue > + fi > ${IFCONFIG_CMD} -n ${ifn} destroy > if [ $? -eq 0 ]; then > _list="${_list}${_prefix}${ifn}" > [ -z "$_prefix" ] && _prefix=' ' > fi > done > + if [ -n "${_list}" ]; then > + echo "Destroyed clone interfaces: ${_list}." > + fi > debug "Destroyed clones: ${_list}" > } > > @@ -1347,32 +1421,6 @@ ng_create_one() > done > } > > -# gif_up > -# Create gif(4) tunnel interfaces. > -gif_up() > -{ > - local i peers > - > - for i in ${gif_interfaces}; do > - peers=`get_if_var $i gifconfig_IF` > - case ${peers} in > - '') > - continue > - ;; > - *) > - if expr $i : 'gif[0-9][0-9]*$' >/dev/null 2>&1; > then > - ${IFCONFIG_CMD} $i create >/dev/null 2>&1 > - else > - gif=`${IFCONFIG_CMD} gif create` > - ${IFCONFIG_CMD} $gif name $i > - fi > - ${IFCONFIG_CMD} $i tunnel ${peers} > - ${IFCONFIG_CMD} $i up > - ;; > - esac > - done > -} > - > # ng_fec_create ifn > # Configure Fast EtherChannel for interface $ifn. Returns 0 if > # FEC arguments were found and configured; returns !0 otherwise. > @@ -1470,15 +1518,15 @@ ipx_down() > return $_ret > } > > -# ifnet_rename > -# Rename all requested interfaces. > +# ifnet_rename [ifname] > +# Rename interfaces if ifconfig_IF_name is defined. > # > ifnet_rename() > { > local _if _ifname > > # ifconfig_IF_name > - for _if in `${IFCONFIG_CMD} -l`; do > + for _if in ${*:-$(${IFCONFIG_CMD} -l)}; do > _ifname=`get_if_var $_if ifconfig_IF_name` > if [ ! -z "$_ifname" ]; then > ${IFCONFIG_CMD} $_if name $_ifname > > Modified: head/etc/rc.d/netif > > ============================================================================== > --- head/etc/rc.d/netif Sun Aug 4 02:37:05 2013 (r253923) > +++ head/etc/rc.d/netif Sun Aug 4 06:36:17 2013 (r253924) > @@ -38,7 +38,8 @@ start_cmd="network_start" > stop_cmd="network_stop" > cloneup_cmd="clone_up" > clonedown_cmd="clone_down" > -extra_commands="cloneup clonedown" > +clear_cmd="doclear" > +extra_commands="cloneup clonedown clear" > cmdifn= > > set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces > @@ -60,18 +61,15 @@ network_start() > # disable SIGINT (Ctrl-c) when running at startup > trap : 2 > > - # Create cloned interfaces > - clone_up > - > # Create Fast EtherChannel interfaces > fec_up > + fi > > - # Create IPv6<-->IPv4 tunnels > - gif_up > + # Create cloned interfaces > + clone_up $cmdifn > > - # Rename interfaces. > - ifnet_rename > - fi > + # Rename interfaces. > + ifnet_rename $cmdifn > > # Configure the interface(s). > network_common ifn_start > @@ -92,6 +90,18 @@ network_start() > > network_stop() > { > + _clone_down=1 > + network_stop0 $* > +} > + > +doclear() > +{ > + _clone_down= > + network_stop0 $* > +} > + > +network_stop0() > +{ > local _if > > # Set the list of interfaces to work on. > @@ -101,6 +111,11 @@ network_stop() > # Deconfigure the interface(s) > network_common ifn_stop > > + # Destroy cloned interfaces > + if [ -n "$_clone_down" ]; then > + clone_down $cmdifn > + fi > + > if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then > for _if in $cmdifn; do > /etc/rc.d/routing stop any $_if > @@ -142,6 +157,16 @@ network_common() > _fail= > _ok= > for ifn in ${_cooked_list}; do > + # Skip if ifn does not exist. > + case $_func in > + ifn_stop) > + if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then > + warn "$ifn does not exist. Skipped." > + _fail="${_fail} ${ifn}" > + continue > + fi > + ;; > + esac > if ${_func} ${ifn} $2; then > _ok="${_ok} ${ifn}" > if ipv6if ${ifn}; then > > Modified: head/share/man/man5/rc.conf.5 > > ============================================================================== > --- head/share/man/man5/rc.conf.5 Sun Aug 4 02:37:05 2013 > (r253923) > +++ head/share/man/man5/rc.conf.5 Sun Aug 4 06:36:17 2013 > (r253924) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 12, 2013 > +.Dd July 22, 2013 > .Dt RC.CONF 5 > .Os > .Sh NAME > @@ -1651,11 +1651,33 @@ Further cloning arguments may be passed > command for each interface by setting the > .Va create_args_ Ns Aq Ar interface > variable. > +If an interface name is specified with > +.Dq :sticky > +keyword, > +the interface will not be destroyed even when > +.Pa rc.d/netif > +script is invoked with > +.Dq stop > +argument. > +This is useful when reconfiguring the interface without destroying it. > Entries in > .Va cloned_interfaces > are automatically appended to > .Va network_interfaces > for configuration. > +.It Va cloned_interfaces_sticky > +.Pq Vt bool > +This variable is to globally enable functionality of > +.Dq :sticky > +keyword in > +.Va cloned_interfaces > +for all interfaces. > +The default value is > +.Dq NO . > +Even if this variable is specified to > +.Dq YES , > +.Dq :nosticky > +keyword can be used to override it on per interface basis. > .It Va fec_interfaces > .Pq Vt str > Set to the list of > @@ -1685,6 +1707,8 @@ ifconfig_fec0="DHCP" > .Ed > .It Va gif_interfaces > .Pq Vt str > +This variable is deprecated in favor of > +.Va cloned_interfaces . > Set to the list of > .Xr gif 4 > tunnel interfaces to configure on this host. > From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 15:58:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2ED2AC3B; Thu, 22 Aug 2013 15:58:50 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id A923F273F; Thu, 22 Aug 2013 15:58:49 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id D620BE3F07A; Thu, 22 Aug 2013 17:58:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JeZ+u40GYyZE; Thu, 22 Aug 2013 17:58:39 +0200 (CEST) Received: from devbox.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id BF970E3F079; Thu, 22 Aug 2013 17:58:37 +0200 (CEST) Date: Thu, 22 Aug 2013 17:58:35 +0200 From: Joel Dahl To: Peter Wemm Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk Message-ID: <20130822155835.GA52789@devbox.vnode.local> References: <201308130715.r7D7F1nu076335@svn.freebsd.org> <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> <20130818195304.GA81160@devbox.vnode.local> <20130818224244.GA59141@stack.nl> <52114FED.3010106@wemm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52114FED.3010106@wemm.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Jilles Tjoelker , Peter Wemm , svn-src-all@freebsd.org, Dimitry Andric , gabor@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 15:58:50 -0000 On Sun, Aug 18, 2013 at 03:51:25PM -0700, Peter Wemm wrote: > On 8/18/13 3:42 PM, Jilles Tjoelker wrote: > > On Sun, Aug 18, 2013 at 09:53:04PM +0200, Joel Dahl wrote: > >> On Sun, Aug 18, 2013 at 12:34:30AM +0200, Dimitry Andric wrote: > >>> On Aug 13, 2013, at 09:15, Peter Wemm wrote: > >>>> Author: peter > >>>> Date: Tue Aug 13 07:15:01 2013 > >>>> New Revision: 254273 > >>>> URL: http://svnweb.freebsd.org/changeset/base/254273 > > > >>>> Log: > >>>> The iconv in libc did two things - implement the standard APIs, the GNU > >>>> extensions and also tried to be link time compatible with ports libiconv. > >>>> This splits that functionality and enables the parts that shouldn't > >>>> interfere with the port by default. > > > >>>> WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. > >>>> WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker > >>>> symbols and even a stub libiconv.so.3 that are good enough to be able > >>>> to 'pkg delete -f libiconv' on a running system and reasonably expect it > >>>> to work. > > > >>>> I have tortured many machines over the last few days to try and reduce > >>>> the possibilities of foot-shooting as much as I can. I've successfully > >>>> recompiled to enable and disable the libiconv_compat modes, ports that use > >>>> libiconv alongside system iconv etc. If you don't enable the > >>>> WITH_LIBICONV_COMPAT switch, they don't share symbol space. > > > >>>> This is an extension of behavior on other system. iconv(3) is a standard > >>>> libc interface and libiconv port expects to be able to run alongside it on > >>>> systems that have it. > > > >>> Unfortunately I expect this will break many ports, when the libiconv > >>> port is installed. A simple example is the following: > >> > > > >> It also breaks installworld when /usr/src and /usr/obj are NFS exported > >> read-only. > > > > I think it has to do with share/i18n/csmapper and share/i18n/esdb using > > directories as make targets. This apparently causes these files to be > > rebuilt at 'make installworld' time, which is always bad but is only > > detected when /usr/obj is read-only. > > > > A hack that works is to enclose the four targets depending on ${SUBDIR} > > in .if !make(install) . > > > > Unfortunately, the Makefiles were written to depend on the directories > > as make targets fairly deeply, so a real fix is harder. > > I was looking at this yesterday, but was tied up with other things. I'll > take a look at it today after getting a few other things done. It should be > easy enough to replicate by changing /usr/obj to readonly on test systems. FWIW, this is still broken. -- Joel From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 16:00:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 31C24DCF; Thu, 22 Aug 2013 16:00:10 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2061A2777; Thu, 22 Aug 2013 16:00:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MG09U1073845; Thu, 22 Aug 2013 16:00:09 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MG09bu073844; Thu, 22 Aug 2013 16:00:09 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201308221600.r7MG09bu073844@svn.freebsd.org> From: Joel Dahl Date: Thu, 22 Aug 2013 16:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254658 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 16:00:10 -0000 Author: joel (doc committer) Date: Thu Aug 22 16:00:09 2013 New Revision: 254658 URL: http://svnweb.freebsd.org/changeset/base/254658 Log: Minor mdoc nit. Modified: head/share/man/man9/atomic.9 Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Thu Aug 22 14:02:34 2013 (r254657) +++ head/share/man/man9/atomic.9 Thu Aug 22 16:00:09 2013 (r254658) @@ -266,7 +266,6 @@ and do not have any variants with memory The .Fn atomic_store functions are only provided with release memory barriers. -.Pp .Bl -hang .It Fn atomic_swap p v .Bd -literal -compact From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 16:01:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 30B22F74; Thu, 22 Aug 2013 16:01:21 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EF0F2797; Thu, 22 Aug 2013 16:01:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MG1KWQ076075; Thu, 22 Aug 2013 16:01:20 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MG1K4L076074; Thu, 22 Aug 2013 16:01:20 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201308221601.r7MG1K4L076074@svn.freebsd.org> From: Joel Dahl Date: Thu, 22 Aug 2013 16:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254659 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 16:01:21 -0000 Author: joel (doc committer) Date: Thu Aug 22 16:01:20 2013 New Revision: 254659 URL: http://svnweb.freebsd.org/changeset/base/254659 Log: Remove EOL whitespace. Modified: head/usr.bin/dtc/dtc.1 Modified: head/usr.bin/dtc/dtc.1 ============================================================================== --- head/usr.bin/dtc/dtc.1 Thu Aug 22 16:00:09 2013 (r254658) +++ head/usr.bin/dtc/dtc.1 Thu Aug 22 16:01:20 2013 (r254659) @@ -141,11 +141,11 @@ or to be used for device tree source files that contain conditional components. This tool supports two extensions to the standard to support conditional compilation of device trees. -The first is an +The first is an .Ar /include/if [property]/ "file.dts" directive that is allowed at the start of a file and which will only include the specified file if it the specified property is passed with this flag. -The second is the +The second is the .Ar $NAME format for property values. These allow property value to be specified on the command line. From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 16:02:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 52D9E17C; Thu, 22 Aug 2013 16:02:21 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 412BC27A6; Thu, 22 Aug 2013 16:02:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MG2LUU076273; Thu, 22 Aug 2013 16:02:21 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MG2LxO076272; Thu, 22 Aug 2013 16:02:21 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201308221602.r7MG2LxO076272@svn.freebsd.org> From: Joel Dahl Date: Thu, 22 Aug 2013 16:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254660 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 16:02:21 -0000 Author: joel (doc committer) Date: Thu Aug 22 16:02:20 2013 New Revision: 254660 URL: http://svnweb.freebsd.org/changeset/base/254660 Log: Remove EOL whitespace. Modified: head/lib/libc/sys/chflags.2 Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Thu Aug 22 16:01:20 2013 (r254659) +++ head/lib/libc/sys/chflags.2 Thu Aug 22 16:02:20 2013 (r254660) @@ -198,7 +198,7 @@ the system is in single-user mode. for details.) .Pp The implementation of all flags is filesystem-dependent. -See the description of the +See the description of the .Dv UF_ARCHIVE flag above for one example of the differences in behavior. Care should be exercised when writing applications to account for From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 16:31:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7B3C6C28; Thu, 22 Aug 2013 16:31:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6810229B2; Thu, 22 Aug 2013 16:31:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MGVLEC091522; Thu, 22 Aug 2013 16:31:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MGVJmN091510; Thu, 22 Aug 2013 16:31:19 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308221631.r7MGVJmN091510@svn.freebsd.org> From: Ed Maste Date: Thu, 22 Aug 2013 16:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254661 - in vendor/NetBSD/libexecinfo: . dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 16:31:21 -0000 Author: emaste Date: Thu Aug 22 16:31:19 2013 New Revision: 254661 URL: http://svnweb.freebsd.org/changeset/base/254661 Log: Vendor import of NetBSD's libexecinfo at 2013-08-22 Added: vendor/NetBSD/libexecinfo/ vendor/NetBSD/libexecinfo/dist/ vendor/NetBSD/libexecinfo/dist/backtrace.3 vendor/NetBSD/libexecinfo/dist/backtrace.c vendor/NetBSD/libexecinfo/dist/builtin.c vendor/NetBSD/libexecinfo/dist/execinfo.h vendor/NetBSD/libexecinfo/dist/symtab.c vendor/NetBSD/libexecinfo/dist/symtab.h vendor/NetBSD/libexecinfo/dist/unwind.c vendor/NetBSD/libexecinfo/dist/unwind.h vendor/NetBSD/libexecinfo/dist/unwind_arm_ehabi_stub.c Added: vendor/NetBSD/libexecinfo/dist/backtrace.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/backtrace.3 Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,159 @@ +.\" $NetBSD: backtrace.3,v 1.4 2012/06/10 00:24:36 christos Exp $ +.\" +.\" Copyright (c) 2012 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Christos Zoulas +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd May 26, 2012 +.Dt BACKTRACE 3 +.Os +.Sh NAME +.Nm backtrace +.Nd fill in the backtrace of the currently executing thread +.Sh LIBRARY +.Lb libexecinfo +.Sh SYNOPSIS +.In execinfo.h +.Ft size_t +.Fn backtrace "void **addrlist" "size_t len" +.Ft "char **" +.Fn backtrace_symbols "void * const *addrlist" "size_t len" +.Ft int +.Fn backtrace_symbols_fd "void * const *addrlist" "size_t len" "int fd" +.Ft "char **" +.Fn backtrace_symbols_fmt "void * const *addrlist" "size_t len" "const char *fmt" +.Ft int +.Fn backtrace_symbols_fmt_fd "void * const *addrlist" "size_t len" "const char *fmt" "int fd" +.Sh DESCRIPTION +The +.Fn backtrace +function places into the array pointed by +.Fa addrlist +the array of the values of the program counter for each frame called up to +.Fa len +frames. +The number of frames found (which can be fewer than +.Fa len ) +is returned. +.Pp +The +.Fn backtrace_symbols_fmt +function takes an array of previously filled addresses from +.Fn backtrace +in +.Fa addrlist +of +.Fa len +elements, and uses +.Fa fmt +to format them. +The formatting characters available are: +.Bl -tag -width a -offset indent +.It Dv a +The numeric address of each element as would be printed using %p. +.It Dv n +The name of the nearest function symbol (smaller than the address element) +as determined by +.Xr dladdr 3 +if the symbol was dynamic, or looked up in the executable if static and +the /proc filesystem is available to determine the executable path. +.It Dv d +The difference of the symbol address and the address element printed +using 0x%tx. +.It Dv D +The difference of the symbol addresss and the address element printed using ++0x%tx if non-zero, or nothing if zero. +.It Dv f +The filename of the symbol as determined by +.Xr dladdr 3 . +.El +.Pp +The array of formatted strings is returned as a contiguous memory address which +can be freed by a single +.Xr free 3 . +.Pp +The +.Fn backtrace_symbols +function is equivalent of calling +.Fn backtrace_symbols_fmt +with a format argument of +.Dv "%a <%n%D> at %f" +.Pp +The +.Fn backtrace_symbols_fd +and +.Fn backtrace_symbols_fmt_fd +are similar to the non _fd named functions, only instead of returning +an array or strings, they print a new-line separated array of strings in +fd, and return +.Dv 0 +on success and +.Dv \-1 +on failure. +.Sh RETURN VALUES +The +.Fn backtrace +function returns the number of elements tht were filled in the backtrace. +The +.Fn backtrace_symbols +and +.Fn backtrace_symbols_fmt +return a string array on success, and +.Dv NULL +on failure, setting +.Va errno . +Diagnostic output may also be produced by the ELF symbol lookup functions. +.Sh SEE ALSO +.Xr dladdr 3 , +.Xr elf 3 +.Sh HISTORY +The +.Fn backtrace +library of functions first appeared in +.Nx 7.0 . +.Sh BUGS +.Bl -enum +.It +Errors should not be printed but communicated to the caller differently. +.It +Because these functions use +.Xr elf 3 +this is a separate library instead of being part of libc/libutil +so that no library dependencies are introduced. +.It +The Linux versions of the functions (there are no _fmt variants) use +.Ft int +instead of +.Ft size_t +arguments. +.It +Since +.Xr dladdr 3 +only deals with dynamic symbols, we need to find the symbols from the main +portion of the program. +For that we need to locate the executable, and we use procfs for +finding it, which is not portable. +.El Added: vendor/NetBSD/libexecinfo/dist/backtrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/backtrace.c Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,229 @@ +/* $NetBSD: backtrace.c,v 1.2 2012/07/09 03:11:59 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: backtrace.c,v 1.2 2012/07/09 03:11:59 christos Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "execinfo.h" +#include "symtab.h" + +#ifdef __linux__ +#define SELF "/proc/self/exe" +#else +#define SELF "/proc/curproc/file" +#endif + +static int __printflike(4, 5) +rasprintf(char **buf, size_t *bufsiz, size_t offs, const char *fmt, ...) +{ + for (;;) { + size_t nbufsiz; + char *nbuf; + + if (*buf && offs < *bufsiz) { + va_list ap; + int len; + + va_start(ap, fmt); + len = vsnprintf(*buf + offs, *bufsiz - offs, fmt, ap); + va_end(ap); + + if (len < 0 || (size_t)len < *bufsiz - offs) + return len; + nbufsiz = MAX(*bufsiz + 512, (size_t)len + 1); + } else + nbufsiz = MAX(offs, *bufsiz) + 512; + + nbuf = realloc(*buf, nbufsiz); + if (nbuf == NULL) + return -1; + *buf = nbuf; + *bufsiz = nbufsiz; + } +} + +/* + * format specifiers: + * %a = address + * %n = symbol_name + * %d = symbol_address - address + * %D = if symbol_address == address "" else +%d + * %f = filename + */ +static ssize_t +format_string(char **buf, size_t *bufsiz, size_t offs, const char *fmt, + Dl_info *dli, const void *addr) +{ + ptrdiff_t diff = (const char *)addr - (const char *)dli->dli_saddr; + size_t o = offs; + int len; + + for (; *fmt; fmt++) { + if (*fmt != '%') + goto printone; + switch (*++fmt) { + case 'a': + len = rasprintf(buf, bufsiz, o, "%p", addr); + break; + case 'n': + len = rasprintf(buf, bufsiz, o, "%s", dli->dli_sname); + break; + case 'D': + if (diff) + len = rasprintf(buf, bufsiz, o, "+0x%tx", diff); + else + len = 0; + break; + case 'd': + len = rasprintf(buf, bufsiz, o, "0x%tx", diff); + break; + case 'f': + len = rasprintf(buf, bufsiz, o, "%s", dli->dli_fname); + break; + default: + printone: + len = rasprintf(buf, bufsiz, o, "%c", *fmt); + break; + } + if (len == -1) + return -1; + o += len; + } + return o - offs; +} + +static ssize_t +format_address(symtab_t *st, char **buf, size_t *bufsiz, size_t offs, + const char *fmt, const void *addr) +{ + Dl_info dli; + + memset(&dli, 0, sizeof(dli)); + (void)dladdr(addr, &dli); + if (st) + symtab_find(st, addr, &dli); + + if (dli.dli_sname == NULL) + dli.dli_sname = "???"; + if (dli.dli_fname == NULL) + dli.dli_fname = "???"; + if (dli.dli_saddr == NULL) + dli.dli_saddr = (void *)(intptr_t)addr; + + return format_string(buf, bufsiz, offs, fmt, &dli, addr); +} + +char ** +backtrace_symbols_fmt(void *const *trace, size_t len, const char *fmt) +{ + + static const size_t slen = sizeof(char *) + 64; /* estimate */ + char *ptr; + symtab_t *st; + int fd; + + if ((fd = open(SELF, O_RDONLY)) != -1) + st = symtab_create(fd, -1, STT_FUNC); + else + st = NULL; + + if ((ptr = calloc(len, slen)) == NULL) + goto out; + + size_t psize = len * slen; + size_t offs = len * sizeof(char *); + + /* We store only offsets in the first pass because of realloc */ + for (size_t i = 0; i < len; i++) { + ssize_t x; + ((char **)(void *)ptr)[i] = (void *)offs; + x = format_address(st, &ptr, &psize, offs, fmt, trace[i]); + if (x == -1) { + free(ptr); + ptr = NULL; + goto out; + } + offs += x; + ptr[offs++] = '\0'; + assert(offs < psize); + } + + /* Change offsets to pointers */ + for (size_t j = 0; j < len; j++) + ((char **)(void *)ptr)[j] += (intptr_t)ptr; + +out: + symtab_destroy(st); + if (fd != -1) + (void)close(fd); + + return (void *)ptr; +} + +int +backtrace_symbols_fd_fmt(void *const *trace, size_t len, int fd, + const char *fmt) +{ + char **s = backtrace_symbols_fmt(trace, len, fmt); + if (s == NULL) + return -1; + for (size_t i = 0; i < len; i++) + if (dprintf(fd, "%s\n", s[i]) < 0) + break; + free(s); + return 0; +} + +static const char fmt[] = "%a <%n%D> at %f"; + +char ** +backtrace_symbols(void *const *trace, size_t len) +{ + return backtrace_symbols_fmt(trace, len, fmt); +} + +int +backtrace_symbols_fd(void *const *trace, size_t len, int fd) +{ + return backtrace_symbols_fd_fmt(trace, len, fd, fmt); +} Added: vendor/NetBSD/libexecinfo/dist/builtin.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/builtin.c Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,68 @@ +/* $NetBSD: builtin.c,v 1.1 2012/05/26 22:02:29 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: builtin.c,v 1.1 2012/05/26 22:02:29 christos Exp $"); + +#include +#include + +#include "execinfo.h" + +#ifdef __MACHINE_STACK_GROWS_UP +#define BELOW > +#else +#define BELOW < +#endif + +#ifdef __lint__ +#define __builtin_frame_address(a) ((void *)a) +#endif + +struct frameinfo { + struct frameinfo *next; + void *return_address; +}; + +size_t +backtrace(void **trace, size_t len) +{ + const struct frameinfo *frame = __builtin_frame_address(0); + void *stack = &stack; + + for (size_t i = 0; i < len; i++) { + if ((const void *)frame BELOW stack) + return i; + trace[i] = frame->return_address; + frame = frame->next; + } + + return len; +} Added: vendor/NetBSD/libexecinfo/dist/execinfo.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/execinfo.h Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,44 @@ +/* $NetBSD: execinfo.h,v 1.2 2012/06/09 21:22:17 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _EXECINFO_H_ +#define _EXECINFO_H_ + +#include + +__BEGIN_DECLS +size_t backtrace(void **, size_t); +char **backtrace_symbols(void *const *, size_t); +int backtrace_symbols_fd(void *const *, size_t, int); +char **backtrace_symbols_fmt(void *const *, size_t, const char *); +int backtrace_symbols_fd_fmt(void *const *, size_t, int, const char *); +__END_DECLS + +#endif /* _EXECINFO_H_ */ Added: vendor/NetBSD/libexecinfo/dist/symtab.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/symtab.c Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,192 @@ +/* $NetBSD: symtab.c,v 1.1 2012/05/26 22:02:29 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: symtab.c,v 1.1 2012/05/26 22:02:29 christos Exp $"); + +#include +#include +#include +#include +#include + +#include +#include +#ifndef ELF_ST_BIND +#define ELF_ST_BIND(x) ((x) >> 4) +#endif +#ifndef ELF_ST_TYPE +#define ELF_ST_TYPE(x) (((unsigned int)x) & 0xf) +#endif + + +#include "symtab.h" + +struct symbol { + char *st_name; + uintptr_t st_value; + uintptr_t st_info; +}; + +struct symtab { + size_t nsymbols; + struct symbol *symbols; +}; + +static int +address_compare(const void *a, const void *b) +{ + const struct symbol *sa = a; + const struct symbol *sb = b; + return (int)(intmax_t)(sa->st_value - sb->st_value); +} + +void +symtab_destroy(symtab_t *s) +{ + if (s == NULL) + return; + for (size_t i = 0; i < s->nsymbols; i++) + free(s->symbols[i].st_name); + free(s->symbols); + free(s); +} + +symtab_t * +symtab_create(int fd, int bind, int type) +{ + Elf *elf; + symtab_t *st; + Elf_Scn *scn = NULL; + + if (elf_version(EV_CURRENT) == EV_NONE) { + warnx("Elf Library is out of date."); + return NULL; + } + + elf = elf_begin(fd, ELF_C_READ, NULL); + if (elf == NULL) { + warnx("Error opening elf file: %s", elf_errmsg(elf_errno())); + return NULL; + } + st = calloc(1, sizeof(*st)); + if (st == NULL) { + warnx("Error allocating symbol table"); + elf_end(elf); + return NULL; + } + + while ((scn = elf_nextscn(elf, scn)) != NULL) { + GElf_Shdr shdr; + Elf_Data *edata; + size_t ns; + struct symbol *s; + + gelf_getshdr(scn, &shdr); + if(shdr.sh_type != SHT_SYMTAB) + continue; + + edata = elf_getdata(scn, NULL); + ns = shdr.sh_size / shdr.sh_entsize; + s = calloc(ns, sizeof(*s)); + if (s == NULL) { + warn("Cannot allocate %zu symbols", ns); + goto out; + } + st->symbols = s; + + for (size_t i = 0; i < ns; i++) { + GElf_Sym sym; + gelf_getsym(edata, (int)i, &sym); + + if (bind != -1 && + (unsigned)bind != ELF_ST_BIND(sym.st_info)) + continue; + + if (type != -1 && + (unsigned)type != ELF_ST_TYPE(sym.st_info)) + continue; + + s->st_value = sym.st_value; + s->st_info = sym.st_info; + s->st_name = strdup( + elf_strptr(elf, shdr.sh_link, sym.st_name)); + if (s->st_name == NULL) + goto out; + s++; + } + st->nsymbols = s - st->symbols; + if (st->nsymbols == 0) { + warnx("No symbols found"); + goto out; + } + qsort(st->symbols, st->nsymbols, sizeof(*st->symbols), + address_compare); + elf_end(elf); + return st; + } +out: + symtab_destroy(st); + elf_end(elf); + return NULL; +} + + +int +symtab_find(const symtab_t *st, const void *p, Dl_info *dli) +{ + struct symbol *s = st->symbols; + size_t ns = st->nsymbols; + size_t hi = ns; + size_t lo = 0; + size_t mid = ns / 2; + uintptr_t dd, sd, me = (uintptr_t)p; + + for (;;) { + if (s[mid].st_value < me) + lo = mid; + else if (s[mid].st_value > me) + hi = mid; + else + break; + if (hi - lo == 1) { + mid = lo; + break; + } + mid = (hi + lo) / 2; + } + dd = me - (uintptr_t)dli->dli_saddr; + sd = me - s[mid].st_value; + if (dd > sd) { + dli->dli_saddr = (void *)s[mid].st_value; + dli->dli_sname = s[mid].st_name; + } + return 1; +} Added: vendor/NetBSD/libexecinfo/dist/symtab.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/symtab.h Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,42 @@ +/* $NetBSD: symtab.h,v 1.1 2012/05/26 22:02:29 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SYMTAB_H_ +#define _SYMTAB_H_ + +__BEGIN_DECLS +typedef struct symtab symtab_t; + +void symtab_destroy(symtab_t *); +symtab_t * symtab_create(int, int, int); +int symtab_find(const symtab_t *, const void *, Dl_info *); +__END_DECLS + +#endif /* _SYMTAB_H_ */ Added: vendor/NetBSD/libexecinfo/dist/unwind.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/unwind.c Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,72 @@ +/* $NetBSD: unwind.c,v 1.1 2012/05/26 22:02:29 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include + +#include "unwind.h" +#include "execinfo.h" + +struct tracer_context { + void **arr; + size_t len; + size_t n; +}; + +static _Unwind_Reason_Code +tracer(struct _Unwind_Context *ctx, void *arg) +{ + struct tracer_context *t = arg; + if (t->n == (size_t)~0) { + /* Skip backtrace frame */ + t->n = 0; + return 0; + } + if (t->n < t->len) + t->arr[t->n++] = _Unwind_GetIP(ctx); + return 0; +} + +size_t +backtrace(void **arr, size_t len) +{ + struct tracer_context ctx; + + ctx.arr = arr; + ctx.len = len; + ctx.n = (size_t)~0; + + _Unwind_Backtrace(tracer, &ctx); + if (ctx.n != (size_t)~0 && ctx.n > 0) + ctx.arr[--ctx.n] = NULL; /* Skip frame below __start */ + + return ctx.n; +} Added: vendor/NetBSD/libexecinfo/dist/unwind.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/unwind.h Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,68 @@ +/* $NetBSD: unwind.h,v 1.1 2012/05/26 22:02:29 christos Exp $ */ + +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _UNWIND_H_ +#define _UNWIND_H_ + +__BEGIN_DECLS +struct _Unwind_Context; +struct _Unwind_Exception; +typedef int _Unwind_Reason_Code; +typedef void *_Unwind_Ptr; +typedef long _Unwind_Word; + +typedef _Unwind_Reason_Code + (*_Unwind_Trace_Fn)(struct _Unwind_Context *, void *); +#ifdef notyet +typedef _Unwind_Reason_Code + (*_Unwind_Stop_Fn)(struct _Unwind_Context *, void *); +#endif + +_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); +void _Unwind_DeleteException(struct _Unwind_Exception *); +void *_Unwind_FindEnclosingFunction(void *); +#ifdef notyet +_Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *, + _Unwind_Stop_fn, void *); +#endif +_Unwind_Word _Unwind_GetCFA(struct _Unwind_Context *); +_Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *); +_Unwind_Word _Unwind_GetGR(struct _Unwind_Context *, int); +_Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *); +_Unwind_Ptr _Unwind_GetIPInfo(struct _Unwind_Context *, int *); +void *_Unwind_GetLanguageSpecificData( + struct _Unwind_Context *); +_Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *); +_Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *); +_Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); +void _Unwind_Resume(struct _Unwind_Exception *); +_Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); +void _Unwind_SetGR(struct _Unwind_Context *, int, + _Unwind_Ptr); +void _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr); +__END_DECLS +#endif /* _UNWIND_H_ */ Added: vendor/NetBSD/libexecinfo/dist/unwind_arm_ehabi_stub.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libexecinfo/dist/unwind_arm_ehabi_stub.c Thu Aug 22 16:31:19 2013 (r254661) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include "unwind.h" + +void _Unwind_VRS_Get(struct _Unwind_Context *, int, _Unwind_Word, int, void *); +void _Unwind_VRS_Set(struct _Unwind_Context *, int, _Unwind_Word, int, void *); + +_Unwind_Word +_Unwind_GetGR(struct _Unwind_Context *context, int regno) +{ + _Unwind_Word val; + _Unwind_VRS_Get(context, 0 /*_UVRSC_CORE*/, regno, 0 /*_UVRSD_UINT32*/, + &val); + + return val; +} + +_Unwind_Ptr +_Unwind_GetIP(struct _Unwind_Context *context) +{ + return (_Unwind_Ptr)(_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1); +} + +_Unwind_Ptr +_Unwind_GetIPInfo(struct _Unwind_Context *context, int *p) +{ + *p = 0; + return _Unwind_GetIP(context); +} + +void +_Unwind_SetGR(struct _Unwind_Context *context, int reg, _Unwind_Ptr val) +{ + _Unwind_VRS_Set(context, 0 /*_UVRSC_CORE*/, reg, 0 /*_UVRSD_UINT32*/, + &val); +} From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 16:34:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE2ABD3F; Thu, 22 Aug 2013 16:34:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83FC529DB; Thu, 22 Aug 2013 16:34:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MGY3wO092382; Thu, 22 Aug 2013 16:34:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MGY3jq092381; Thu, 22 Aug 2013 16:34:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308221634.r7MGY3jq092381@svn.freebsd.org> From: Ed Maste Date: Thu, 22 Aug 2013 16:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254662 - vendor/NetBSD/libexecinfo/20130822 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 16:34:03 -0000 Author: emaste Date: Thu Aug 22 16:34:03 2013 New Revision: 254662 URL: http://svnweb.freebsd.org/changeset/base/254662 Log: Tag libexecinfo 2013-08-22 Added: vendor/NetBSD/libexecinfo/20130822/ - copied from r254661, vendor/NetBSD/libexecinfo/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 16:39:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8E937C3; Thu, 22 Aug 2013 16:39:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1962A22; Thu, 22 Aug 2013 16:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MGdxKn094109; Thu, 22 Aug 2013 16:39:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MGdxjN094108; Thu, 22 Aug 2013 16:39:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308221639.r7MGdxjN094108@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 22 Aug 2013 16:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254663 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 16:39:59 -0000 Author: jkim Date: Thu Aug 22 16:39:59 2013 New Revision: 254663 URL: http://svnweb.freebsd.org/changeset/base/254663 Log: MFi386: r254619 Reimplement atomic_load_acq_64() and atomic_store_rel_64() for i386. Noticed by: tinderbox Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Thu Aug 22 16:34:03 2013 (r254662) +++ head/sys/pc98/pc98/machdep.c Thu Aug 22 16:39:59 2013 (r254663) @@ -1359,21 +1359,6 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); -uint64_t (*atomic_load_acq_64)(volatile uint64_t *) = - atomic_load_acq_64_i386; -void (*atomic_store_rel_64)(volatile uint64_t *, uint64_t) = - atomic_store_rel_64_i386; - -static void -cpu_probe_cmpxchg8b(void) -{ - - if ((cpu_feature & CPUID_CX8) != 0) { - atomic_load_acq_64 = atomic_load_acq_64_i586; - atomic_store_rel_64 = atomic_store_rel_64_i586; - } -} - /* * Reset registers to default values on exec. */ @@ -2422,8 +2407,6 @@ init386(first) thread0.td_pcb->pcb_cr3 = (int)IdlePTD; thread0.td_pcb->pcb_ext = 0; thread0.td_frame = &proc0_tf; - - cpu_probe_cmpxchg8b(); } void From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 17:30:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F1EE69A1; Thu, 22 Aug 2013 17:30:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF9D52DD0; Thu, 22 Aug 2013 17:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MHU2pX020115; Thu, 22 Aug 2013 17:30:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MHU2WE020110; Thu, 22 Aug 2013 17:30:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308221730.r7MHU2WE020110@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 17:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254664 - in stable/9/sys: compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 17:30:03 -0000 Author: kib Date: Thu Aug 22 17:30:01 2013 New Revision: 254664 URL: http://svnweb.freebsd.org/changeset/base/254664 Log: MFC r253494: id_t is 64bit, provide the compat32 wrapper for clock_getcpuclockid2(2). Reminded by: Petr Salinger Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/compat/freebsd32/syscalls.master stable/9/sys/kern/kern_time.c stable/9/sys/sys/syscallsubr.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 22 16:39:59 2013 (r254663) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Aug 22 17:30:01 2013 (r254664) @@ -2384,6 +2384,20 @@ freebsd32_ktimer_gettime(struct thread * } int +freebsd32_clock_getcpuclockid2(struct thread *td, + struct freebsd32_clock_getcpuclockid2_args *uap) +{ + clockid_t clk_id; + int error; + + error = kern_clock_getcpuclockid2(td, PAIR32TO64(id_t, uap->id), + uap->which, &clk_id); + if (error == 0) + error = copyout(&clk_id, uap->clock_id, sizeof(clockid_t)); + return (error); +} + +int freebsd32_thr_new(struct thread *td, struct freebsd32_thr_new_args *uap) { Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Thu Aug 22 16:39:59 2013 (r254663) +++ stable/9/sys/compat/freebsd32/syscalls.master Thu Aug 22 17:30:01 2013 (r254664) @@ -461,8 +461,9 @@ 244 AUE_NULL UNIMPL nosys 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys -247 AUE_NULL NOPROTO { int clock_getcpuclockid2(id_t id,\ - int which, clockid_t *clock_id); } +247 AUE_NULL STD { int freebsd32_clock_getcpuclockid2(\ + uint32_t id1, uint32_t id2,\ + int which, clockid_t *clock_id); } 248 AUE_NULL UNIMPL ntp_gettime 249 AUE_NULL UNIMPL nosys ; syscall numbers initially used in OpenBSD Modified: stable/9/sys/kern/kern_time.c ============================================================================== --- stable/9/sys/kern/kern_time.c Thu Aug 22 16:39:59 2013 (r254663) +++ stable/9/sys/kern/kern_time.c Thu Aug 22 17:30:01 2013 (r254664) @@ -179,38 +179,46 @@ int sys_clock_getcpuclockid2(struct thread *td, struct clock_getcpuclockid2_args *uap) { clockid_t clk_id; + int error; + + error = kern_clock_getcpuclockid2(td, uap->id, uap->which, &clk_id); + if (error == 0) + error = copyout(&clk_id, uap->clock_id, sizeof(clockid_t)); + return (error); +} + +int +kern_clock_getcpuclockid2(struct thread *td, id_t id, int which, + clockid_t *clk_id) +{ struct proc *p; pid_t pid; lwpid_t tid; int error; - switch(uap->which) { + switch (which) { case CPUCLOCK_WHICH_PID: - if (uap->id != 0) { - p = pfind(uap->id); + if (id != 0) { + p = pfind(id); if (p == NULL) return (ESRCH); error = p_cansee(td, p); PROC_UNLOCK(p); - if (error) + if (error != 0) return (error); - pid = uap->id; + pid = id; } else { pid = td->td_proc->p_pid; } - clk_id = MAKE_PROCESS_CPUCLOCK(pid); - break; + *clk_id = MAKE_PROCESS_CPUCLOCK(pid); + return (0); case CPUCLOCK_WHICH_TID: - if (uap->id == 0) - tid = td->td_tid; - else - tid = uap->id; - clk_id = MAKE_THREAD_CPUCLOCK(tid); - break; + tid = id == 0 ? td->td_tid : id; + *clk_id = MAKE_THREAD_CPUCLOCK(tid); + return (0); default: return (EINVAL); } - return (copyout(&clk_id, uap->clock_id, sizeof(clockid_t))); } #ifndef _SYS_SYSPROTO_H_ Modified: stable/9/sys/sys/syscallsubr.h ============================================================================== --- stable/9/sys/sys/syscallsubr.h Thu Aug 22 16:39:59 2013 (r254663) +++ stable/9/sys/sys/syscallsubr.h Thu Aug 22 17:30:01 2013 (r254664) @@ -74,6 +74,8 @@ int kern_chmod(struct thread *td, char * int mode); int kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid, int gid); +int kern_clock_getcpuclockid2(struct thread *td, id_t id, int which, + clockid_t *clk_id); int kern_clock_getres(struct thread *td, clockid_t clock_id, struct timespec *ts); int kern_clock_gettime(struct thread *td, clockid_t clock_id, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 17:33:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 91E8AAED; Thu, 22 Aug 2013 17:33:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 710092E3A; Thu, 22 Aug 2013 17:33:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MHXpbL023265; Thu, 22 Aug 2013 17:33:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MHXodm023248; Thu, 22 Aug 2013 17:33:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308221733.r7MHXodm023248@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 17:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254665 - stable/9/sys/compat/freebsd32 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 17:33:51 -0000 Author: kib Date: Thu Aug 22 17:33:50 2013 New Revision: 254665 URL: http://svnweb.freebsd.org/changeset/base/254665 Log: Regenerate. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 22 17:30:01 2013 (r254664) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 22 17:33:50 2013 (r254665) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254398 2013-08-16 06:40:12Z davidxu + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254664 2013-08-22 17:30:01Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -226,6 +226,12 @@ struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_clock_getcpuclockid2_args { + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; + char clock_id_l_[PADL_(clockid_t *)]; clockid_t * clock_id; char clock_id_r_[PADR_(clockid_t *)]; +}; struct freebsd32_aio_read_args { char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; }; @@ -686,6 +692,7 @@ int freebsd32_ktimer_create(struct threa int freebsd32_ktimer_settime(struct thread *, struct freebsd32_ktimer_settime_args *); int freebsd32_ktimer_gettime(struct thread *, struct freebsd32_ktimer_gettime_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); +int freebsd32_clock_getcpuclockid2(struct thread *, struct freebsd32_clock_getcpuclockid2_args *); int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); int freebsd32_aio_write(struct thread *, struct freebsd32_aio_write_args *); int freebsd32_lio_listio(struct thread *, struct freebsd32_lio_listio_args *); @@ -1087,6 +1094,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_ktimer_settime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_ktimer_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2 AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_lio_listio AUE_NULL Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 22 17:30:01 2013 (r254664) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 22 17:33:50 2013 (r254665) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254398 2013-08-16 06:40:12Z davidxu + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254664 2013-08-22 17:30:01Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -212,7 +212,7 @@ #define FREEBSD32_SYS_freebsd32_ktimer_gettime 238 #define FREEBSD32_SYS_ktimer_getoverrun 239 #define FREEBSD32_SYS_freebsd32_nanosleep 240 -#define FREEBSD32_SYS_clock_getcpuclockid2 247 +#define FREEBSD32_SYS_freebsd32_clock_getcpuclockid2 247 #define FREEBSD32_SYS_minherit 250 #define FREEBSD32_SYS_rfork 251 #define FREEBSD32_SYS_openbsd_poll 252 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 22 17:30:01 2013 (r254664) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 22 17:33:50 2013 (r254665) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254398 2013-08-16 06:40:12Z davidxu + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254664 2013-08-22 17:30:01Z kib */ const char *freebsd32_syscallnames[] = { @@ -257,7 +257,7 @@ const char *freebsd32_syscallnames[] = { "#244", /* 244 = nosys */ "#245", /* 245 = nosys */ "#246", /* 246 = nosys */ - "clock_getcpuclockid2", /* 247 = clock_getcpuclockid2 */ + "freebsd32_clock_getcpuclockid2", /* 247 = freebsd32_clock_getcpuclockid2 */ "#248", /* 248 = ntp_gettime */ "#249", /* 249 = nosys */ "minherit", /* 250 = minherit */ Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 22 17:30:01 2013 (r254664) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 22 17:33:50 2013 (r254665) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254398 2013-08-16 06:40:12Z davidxu + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 254664 2013-08-22 17:30:01Z kib */ #include "opt_compat.h" @@ -294,7 +294,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 244 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ - { AS(clock_getcpuclockid2_args), (sy_call_t *)sys_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = clock_getcpuclockid2 */ + { AS(freebsd32_clock_getcpuclockid2_args), (sy_call_t *)freebsd32_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = freebsd32_clock_getcpuclockid2 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = ntp_gettime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = minherit */ Modified: stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 22 17:30:01 2013 (r254664) +++ stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 22 17:33:50 2013 (r254665) @@ -1244,13 +1244,14 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } - /* clock_getcpuclockid2 */ + /* freebsd32_clock_getcpuclockid2 */ case 247: { - struct clock_getcpuclockid2_args *p = params; - iarg[0] = p->id; /* id_t */ - iarg[1] = p->which; /* int */ - uarg[2] = (intptr_t) p->clock_id; /* clockid_t * */ - *n_args = 3; + struct freebsd32_clock_getcpuclockid2_args *p = params; + uarg[0] = p->id1; /* uint32_t */ + uarg[1] = p->id2; /* uint32_t */ + iarg[2] = p->which; /* int */ + uarg[3] = (intptr_t) p->clock_id; /* clockid_t * */ + *n_args = 4; break; } /* minherit */ @@ -5113,16 +5114,19 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* clock_getcpuclockid2 */ + /* freebsd32_clock_getcpuclockid2 */ case 247: switch(ndx) { case 0: - p = "id_t"; + p = "uint32_t"; break; case 1: - p = "int"; + p = "uint32_t"; break; case 2: + p = "int"; + break; + case 3: p = "clockid_t *"; break; default: From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 18:05:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B80AD87E; Thu, 22 Aug 2013 18:05:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C50A20B2; Thu, 22 Aug 2013 18:05:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MI5Vro039607; Thu, 22 Aug 2013 18:05:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MI5VvQ039606; Thu, 22 Aug 2013 18:05:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308221805.r7MI5VvQ039606@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 18:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254666 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 18:05:31 -0000 Author: kib Date: Thu Aug 22 18:05:31 2013 New Revision: 254666 URL: http://svnweb.freebsd.org/changeset/base/254666 Log: Use the generation count of the pv list to work around LOR between pmap lock and pv list lock, and use the shared locking on pvh_global_lock in pmap_remove_write(), same as it was done for pmap_ts_referenced(). Noted and reviewed by: alc (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Aug 22 17:33:50 2013 (r254665) +++ head/sys/amd64/amd64/pmap.c Thu Aug 22 18:05:31 2013 (r254666) @@ -4765,10 +4765,12 @@ pmap_remove_write(vm_page_t m) { struct md_page *pvh; pmap_t pmap; + struct rwlock *lock; pv_entry_t next_pv, pv; pd_entry_t *pde; pt_entry_t oldpte, *pte; vm_offset_t va; + int pvh_gen, md_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); @@ -4781,23 +4783,51 @@ pmap_remove_write(vm_page_t m) VM_OBJECT_ASSERT_WLOCKED(m->object); if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; - rw_wlock(&pvh_global_lock); + rw_rlock(&pvh_global_lock); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); +retry_pv_loop: + rw_wlock(lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + rw_wunlock(lock); + goto retry_pv_loop; + } + } va = pv->pv_va; pde = pmap_pde(pmap, va); if ((*pde & PG_RW) != 0) - (void)pmap_demote_pde(pmap, pde, va); + (void)pmap_demote_pde_locked(pmap, pde, va, &lock); + KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), + ("inconsistent pv lock %p %p for page %p", + lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); PMAP_UNLOCK(pmap); } small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + md_gen = m->md.pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen || + md_gen != m->md.pv_gen) { + PMAP_UNLOCK(pmap); + rw_wunlock(lock); + goto retry_pv_loop; + } + } pde = pmap_pde(pmap, pv->pv_va); KASSERT((*pde & PG_PS) == 0, ("pmap_remove_write: found a 2mpage in page %p's pv list", @@ -4815,8 +4845,9 @@ retry: } PMAP_UNLOCK(pmap); } + rw_wunlock(lock); vm_page_aflag_clear(m, PGA_WRITEABLE); - rw_wunlock(&pvh_global_lock); + rw_runlock(&pvh_global_lock); } /* From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 18:12:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8347EEC8; Thu, 22 Aug 2013 18:12:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7F221D3; Thu, 22 Aug 2013 18:12:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MICRHf044106; Thu, 22 Aug 2013 18:12:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MICOkj044092; Thu, 22 Aug 2013 18:12:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308221812.r7MICOkj044092@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 18:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254667 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 18:12:27 -0000 Author: kib Date: Thu Aug 22 18:12:24 2013 New Revision: 254667 URL: http://svnweb.freebsd.org/changeset/base/254667 Log: Revert r254501. Instead, reuse the type stability of the struct pmap which is the part of struct vmspace, allocated from UMA_ZONE_NOFREE zone. Initialize the pmap lock in the vmspace zone init function, and remove pmap lock initialization and destruction from pmap_pinit() and pmap_release(). Suggested and reviewed by: alc (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/vm_map.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/amd64/amd64/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1687,8 +1687,6 @@ pmap_pinit(pmap_t pmap) vm_page_t pml4pg; int i; - PMAP_LOCK_INIT(pmap); - /* * allocate the page directory page */ @@ -1959,9 +1957,6 @@ pmap_release(pmap_t pmap) KASSERT(vm_radix_is_empty(&pmap->pm_root), ("pmap_release: pmap has reserved page table page(s)")); - rw_wlock(&pvh_global_lock); - rw_wunlock(&pvh_global_lock); - m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I] & PG_FRAME); for (i = 0; i < NKPML4E; i++) /* KVA */ @@ -1973,7 +1968,6 @@ pmap_release(pmap_t pmap) m->wire_count--; atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(m); - PMAP_LOCK_DESTROY(pmap); } static int Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/arm/arm/pmap-v6.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1814,7 +1814,6 @@ pmap_release(pmap_t pmap) } pmap_free_l1(pmap); - PMAP_LOCK_DESTROY(pmap); dprintf("pmap_release()\n"); } @@ -3225,7 +3224,6 @@ pmap_pinit(pmap_t pmap) { PDEBUG(1, printf("pmap_pinit: pmap = %08x\n", (uint32_t) pmap)); - PMAP_LOCK_INIT(pmap); pmap_alloc_l1(pmap); bzero(pmap->pm_l2, sizeof(pmap->pm_l2)); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/arm/arm/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -2479,7 +2479,6 @@ pmap_release(pmap_t pmap) } pmap_free_l1(pmap); - PMAP_LOCK_DESTROY(pmap); dprintf("pmap_release()\n"); } @@ -3819,7 +3818,6 @@ pmap_pinit(pmap_t pmap) { PDEBUG(1, printf("pmap_pinit: pmap = %08x\n", (uint32_t) pmap)); - PMAP_LOCK_INIT(pmap); pmap_alloc_l1(pmap); bzero(pmap->pm_l2, sizeof(pmap->pm_l2)); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/i386/i386/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1738,8 +1738,6 @@ pmap_pinit(pmap_t pmap) vm_paddr_t pa; int i; - PMAP_LOCK_INIT(pmap); - /* * No need to allocate page table space yet but we do need a valid * page directory table. @@ -2051,7 +2049,6 @@ pmap_release(pmap_t pmap) atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(m); } - PMAP_LOCK_DESTROY(pmap); } static int Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/i386/xen/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1452,8 +1452,6 @@ pmap_pinit(pmap_t pmap) mtx_lock(&createdelete_lock); #endif - PMAP_LOCK_INIT(pmap); - /* * No need to allocate page table space yet but we do need a valid * page directory table. @@ -1821,7 +1819,6 @@ pmap_release(pmap_t pmap) #ifdef PAE pmap_qremove((vm_offset_t)pmap->pm_pdpt, 1); #endif - PMAP_LOCK_DESTROY(pmap); #ifdef HAMFISTED_LOCKING mtx_unlock(&createdelete_lock); Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/ia64/ia64/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -622,6 +622,8 @@ pmap_free_rid(uint32_t rid) void pmap_pinit0(struct pmap *pmap) { + + PMAP_LOCK_INIT(pmap); /* kernel_pmap is the same as any other pmap. */ pmap_pinit(pmap); } @@ -635,7 +637,6 @@ pmap_pinit(struct pmap *pmap) { int i; - PMAP_LOCK_INIT(pmap); for (i = 0; i < IA64_VM_MINKERN_REGION; i++) pmap->pm_rid[i] = pmap_allocate_rid(); TAILQ_INIT(&pmap->pm_pvchunk); @@ -660,7 +661,6 @@ pmap_release(pmap_t pmap) for (i = 0; i < IA64_VM_MINKERN_REGION; i++) if (pmap->pm_rid[i]) pmap_free_rid(pmap->pm_rid[i]); - PMAP_LOCK_DESTROY(pmap); } /* Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/mips/mips/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1070,8 +1070,6 @@ pmap_pinit(pmap_t pmap) vm_page_t ptdpg; int i; - PMAP_LOCK_INIT(pmap); - /* * allocate the page directory page */ @@ -1231,7 +1229,6 @@ pmap_release(pmap_t pmap) ptdpg->wire_count--; atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(ptdpg); - PMAP_LOCK_DESTROY(pmap); } /* Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/powerpc/aim/mmu_oea.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1655,7 +1655,6 @@ moea_pinit(mmu_t mmu, pmap_t pmap) u_int entropy; KASSERT((int)pmap < VM_MIN_KERNEL_ADDRESS, ("moea_pinit: virt pmap")); - PMAP_LOCK_INIT(pmap); RB_INIT(&pmap->pmap_pvo); entropy = 0; @@ -1719,6 +1718,7 @@ void moea_pinit0(mmu_t mmu, pmap_t pm) { + PMAP_LOCK_INIT(pm); moea_pinit(mmu, pm); bzero(&pm->pm_stats, sizeof(pm->pm_stats)); } @@ -1824,7 +1824,6 @@ moea_release(mmu_t mmu, pmap_t pmap) idx /= VSID_NBPW; moea_vsid_bitmap[idx] &= ~mask; mtx_unlock(&moea_vsid_mutex); - PMAP_LOCK_DESTROY(pmap); } /* Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1879,7 +1879,7 @@ moea64_get_unique_vsid(void) { void moea64_pinit(mmu_t mmu, pmap_t pmap) { - PMAP_LOCK_INIT(pmap); + RB_INIT(&pmap->pmap_pvo); pmap->pm_slb_tree_root = slb_alloc_tree(); @@ -1893,7 +1893,6 @@ moea64_pinit(mmu_t mmu, pmap_t pmap) int i; uint32_t hash; - PMAP_LOCK_INIT(pmap); RB_INIT(&pmap->pmap_pvo); if (pmap_bootstrapped) @@ -1920,6 +1919,8 @@ moea64_pinit(mmu_t mmu, pmap_t pmap) void moea64_pinit0(mmu_t mmu, pmap_t pm) { + + PMAP_LOCK_INIT(pm); moea64_pinit(mmu, pm); bzero(&pm->pm_stats, sizeof(pm->pm_stats)); } @@ -2074,8 +2075,6 @@ moea64_release(mmu_t mmu, pmap_t pmap) moea64_release_vsid(VSID_TO_HASH(pmap->pm_sr[0])); #endif - - PMAP_LOCK_DESTROY(pmap); } /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/powerpc/booke/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1477,6 +1477,7 @@ static void mmu_booke_pinit0(mmu_t mmu, pmap_t pmap) { + PMAP_LOCK_INIT(pmap); mmu_booke_pinit(mmu, pmap); PCPU_SET(curpmap, pmap); } @@ -1495,7 +1496,6 @@ mmu_booke_pinit(mmu_t mmu, pmap_t pmap) KASSERT((pmap != kernel_pmap), ("pmap_pinit: initializing kernel_pmap")); - PMAP_LOCK_INIT(pmap); for (i = 0; i < MAXCPU; i++) pmap->pm_tid[i] = TID_NONE; CPU_ZERO(&kernel_pmap->pm_active); @@ -1516,8 +1516,6 @@ mmu_booke_release(mmu_t mmu, pmap_t pmap KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); - - PMAP_LOCK_DESTROY(pmap); } /* Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/sparc64/sparc64/pmap.c Thu Aug 22 18:12:24 2013 (r254667) @@ -1204,8 +1204,6 @@ pmap_pinit(pmap_t pm) vm_page_t m; int i; - PMAP_LOCK_INIT(pm); - /* * Allocate KVA space for the TSB. */ @@ -1299,7 +1297,6 @@ pmap_release(pmap_t pm) vm_page_free_zero(m); } VM_OBJECT_WUNLOCK(obj); - PMAP_LOCK_DESTROY(pm); } /* Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Aug 22 18:05:31 2013 (r254666) +++ head/sys/vm/vm_map.c Thu Aug 22 18:12:24 2013 (r254667) @@ -226,6 +226,7 @@ vmspace_zinit(void *mem, int size, int f vm->vm_map.pmap = NULL; (void)vm_map_zinit(&vm->vm_map, sizeof(vm->vm_map), flags); + PMAP_LOCK_INIT(vmspace_pmap(vm)); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 18:26:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A00C57B9; Thu, 22 Aug 2013 18:26:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F9D92316; Thu, 22 Aug 2013 18:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MIQk09050805; Thu, 22 Aug 2013 18:26:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MIQjOS050794; Thu, 22 Aug 2013 18:26:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308221826.r7MIQjOS050794@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 18:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254668 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 18:26:46 -0000 Author: kib Date: Thu Aug 22 18:26:45 2013 New Revision: 254668 URL: http://svnweb.freebsd.org/changeset/base/254668 Log: Both cluster_rbuild() and cluster_wbuild() sometimes set the pages shared busy without first draining the hard busy state. Previously it went unnoticed since VPO_BUSY and m->busy fields were distinct, and vm_page_io_start() did not verified that the passed page has VPO_BUSY flag cleared, but such page state is wrong. New implementation is more strict and catched this case. Drain the busy state as needed, before calling vm_page_sbusy(). Tested by: pho, jkim Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Aug 22 18:12:24 2013 (r254667) +++ head/sys/kern/vfs_bio.c Thu Aug 22 18:26:45 2013 (r254668) @@ -108,7 +108,6 @@ static void vm_hold_load_pages(struct bu static void vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, vm_page_t m); static void vfs_page_set_validclean(struct buf *bp, vm_ooffset_t off, vm_page_t m); -static void vfs_drain_busy_pages(struct buf *bp); static void vfs_clean_pages_dirty_buf(struct buf *bp); static void vfs_setdirty_locked_object(struct buf *bp); static void vfs_vmio_release(struct buf *bp); @@ -3983,7 +3982,7 @@ vfs_page_set_validclean(struct buf *bp, * Ensure that all buffer pages are not exclusive busied. If any page is * exclusive busy, drain it. */ -static void +void vfs_drain_busy_pages(struct buf *bp) { vm_page_t m; Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Aug 22 18:12:24 2013 (r254667) +++ head/sys/kern/vfs_cluster.c Thu Aug 22 18:26:45 2013 (r254668) @@ -315,7 +315,7 @@ cluster_rbuild(struct vnode *vp, u_quad_ daddr_t bn; off_t off; long tinc, tsize; - int i, inc, j, toff; + int i, inc, j, k, toff; KASSERT(size == vp->v_mount->mnt_stat.f_iosize, ("cluster_rbuild: size %ld != f_iosize %jd\n", @@ -378,7 +378,15 @@ cluster_rbuild(struct vnode *vp, u_quad_ inc = btodb(size); bo = &vp->v_bufobj; for (bn = blkno, i = 0; i < run; ++i, bn += inc) { - if (i != 0) { + if (i == 0) { + VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); + vfs_drain_busy_pages(tbp); + vm_object_pip_add(tbp->b_bufobj->bo_object, + tbp->b_npages); + for (k = 0; k < tbp->b_npages; k++) + vm_page_sbusy(tbp->b_pages[k]); + VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); + } else { if ((bp->b_npages * PAGE_SIZE) + round_page(size) > vp->v_mount->mnt_iosize_max) { break; @@ -424,14 +432,23 @@ cluster_rbuild(struct vnode *vp, u_quad_ if ((tbp->b_pages[j]->valid & vm_page_bits(toff, tinc)) != 0) break; + if (vm_page_xbusied(tbp->b_pages[j])) + break; + vm_object_pip_add(tbp->b_bufobj->bo_object, 1); + vm_page_sbusy(tbp->b_pages[j]); off += tinc; tsize -= tinc; } - VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); if (tsize > 0) { +clean_sbusy: + vm_object_pip_add(tbp->b_bufobj->bo_object, -j); + for (k = 0; k < j; k++) + vm_page_sunbusy(tbp->b_pages[k]); + VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); bqrelse(tbp); break; } + VM_OBJECT_WUNLOCK(tbp->b_bufobj->bo_object); /* * Set a read-ahead mark as appropriate @@ -451,8 +468,8 @@ cluster_rbuild(struct vnode *vp, u_quad_ if (tbp->b_blkno == tbp->b_lblkno) { tbp->b_blkno = bn; } else if (tbp->b_blkno != bn) { - brelse(tbp); - break; + VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); + goto clean_sbusy; } } /* @@ -466,10 +483,8 @@ cluster_rbuild(struct vnode *vp, u_quad_ for (j = 0; j < tbp->b_npages; j += 1) { vm_page_t m; m = tbp->b_pages[j]; - vm_page_sbusy(m); - vm_object_pip_add(m->object, 1); if ((bp->b_npages == 0) || - (bp->b_pages[bp->b_npages-1] != m)) { + (bp->b_pages[bp->b_npages-1] != m)) { bp->b_pages[bp->b_npages] = m; bp->b_npages++; } @@ -944,7 +959,9 @@ cluster_wbuild(struct vnode *vp, long si vm_page_t m; VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); - if (i != 0) { /* if not first buffer */ + if (i == 0) { + vfs_drain_busy_pages(tbp); + } else { /* if not first buffer */ for (j = 0; j < tbp->b_npages; j += 1) { m = tbp->b_pages[j]; if (vm_page_xbusied(m)) { Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Thu Aug 22 18:12:24 2013 (r254667) +++ head/sys/sys/buf.h Thu Aug 22 18:26:45 2013 (r254668) @@ -501,6 +501,7 @@ void bufstrategy(struct bufobj *, struct void brelse(struct buf *); void bqrelse(struct buf *); int vfs_bio_awrite(struct buf *); +void vfs_drain_busy_pages(struct buf *bp); struct buf * getpbuf(int *); struct buf *incore(struct bufobj *, daddr_t); struct buf *gbincore(struct bufobj *, daddr_t); From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 18:32:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67C6FC63; Thu, 22 Aug 2013 18:32:46 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1-6.sentex.ca [IPv6:2607:f3e0:0:1::12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA38F23BD; Thu, 22 Aug 2013 18:32:45 +0000 (UTC) Received: from [192.168.43.26] (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.5/8.14.5) with ESMTP id r7MIWg5R074022; Thu, 22 Aug 2013 14:32:43 -0400 (EDT) (envelope-from mike@sentex.net) Message-ID: <52165936.60503@sentex.net> Date: Thu, 22 Aug 2013 14:32:22 -0400 From: Mike Tancsa Organization: Sentex Communications User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= Subject: Re: svn commit: r254626 - stable/9/usr.bin/yacc References: <201308212257.r7LMvUmY053608@svn.freebsd.org> <8638q2i1oo.fsf@nine.des.no> <86y57ugn00.fsf@nine.des.no> <20130822213005.H1824@besplex.bde.org> <864naios6h.fsf@nine.des.no> In-Reply-To: <864naios6h.fsf@nine.des.no> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.74 on 64.7.153.18 Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, "David E. O'Brien" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 18:32:46 -0000 On 8/22/2013 7:56 AM, Dag-Erling Smørgrav wrote: > > So what do you suggest? Revert David's change, or keep it (minus > extern) and remove the prototype from expr.y? > > I favor the latter option, since yyparse() is auto-generated and expr.y > can therefore (strictly speaking) not know what the correct prototype > looks like. Is it safe to buildworld with this change ? ---Mike -- ------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada http://www.tancsa.com/ From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 18:41:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9531AF27; Thu, 22 Aug 2013 18:41:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8292C2462; Thu, 22 Aug 2013 18:41:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MIfSAh059386; Thu, 22 Aug 2013 18:41:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MIfStR059385; Thu, 22 Aug 2013 18:41:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308221841.r7MIfStR059385@svn.freebsd.org> From: Glen Barber Date: Thu, 22 Aug 2013 18:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254669 - stable/9/usr.bin/yacc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 18:41:28 -0000 Author: gjb Date: Thu Aug 22 18:41:28 2013 New Revision: 254669 URL: http://svnweb.freebsd.org/changeset/base/254669 Log: Revert r254626 to fix the build. Modified: stable/9/usr.bin/yacc/skeleton.c Modified: stable/9/usr.bin/yacc/skeleton.c ============================================================================== --- stable/9/usr.bin/yacc/skeleton.c Thu Aug 22 18:26:45 2013 (r254668) +++ stable/9/usr.bin/yacc/skeleton.c Thu Aug 22 18:41:28 2013 (r254669) @@ -196,10 +196,6 @@ const char *body[] = "#endif /* ANSI-C/C++ */", "#endif /* ! YYPARSE_PARAM */", "", - "#if defined(__cplusplus) || __STDC__", - "extern int yyparse (YYPARSE_PARAM_ARG);", - "#endif /* ANSI-C/C++ */", - "", "int", "yyparse (YYPARSE_PARAM_ARG)", " YYPARSE_PARAM_DECL", From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 19:28:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6E94F26F; Thu, 22 Aug 2013 19:28:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CD4A2818; Thu, 22 Aug 2013 19:28:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MJSElv082840; Thu, 22 Aug 2013 19:28:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MJSE4r082838; Thu, 22 Aug 2013 19:28:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201308221928.r7MJSE4r082838@svn.freebsd.org> From: Michael Tuexen Date: Thu, 22 Aug 2013 19:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254670 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 19:28:14 -0000 Author: tuexen Date: Thu Aug 22 19:28:13 2013 New Revision: 254670 URL: http://svnweb.freebsd.org/changeset/base/254670 Log: Make also the features of the association 64-bit. When exporting to xinpcb, just export the lower 32-bit. Using there also 64-bits will break the ABI and will be committed separetly. MFC after: 2 weeks X-MFC with: 254248 Modified: head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Thu Aug 22 18:41:28 2013 (r254669) +++ head/sys/netinet/sctp_structs.h Thu Aug 22 19:28:13 2013 (r254670) @@ -1205,7 +1205,7 @@ struct sctp_association { /* JRS 5/21/07 - CMT PF variable */ uint8_t sctp_cmt_pf; uint8_t use_precise_time; - uint32_t sctp_features; + uint64_t sctp_features; uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Aug 22 18:41:28 2013 (r254669) +++ head/sys/netinet/sctp_sysctl.c Thu Aug 22 19:28:13 2013 (r254670) @@ -402,7 +402,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xinpcb.last = 0; xinpcb.local_port = ntohs(inp->sctp_lport); xinpcb.flags = inp->sctp_flags; - xinpcb.features = inp->sctp_features; + xinpcb.features = (uint32_t) inp->sctp_features; xinpcb.total_sends = inp->total_sends; xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 20:07:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1DE2028B; Thu, 22 Aug 2013 20:07:07 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BDA92B28; Thu, 22 Aug 2013 20:07:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MK76KN003472; Thu, 22 Aug 2013 20:07:06 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MK76N3003470; Thu, 22 Aug 2013 20:07:06 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201308222007.r7MK76N3003470@svn.freebsd.org> From: "Justin T. Gibbs" Date: Thu, 22 Aug 2013 20:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254671 - in head/sys/i386: i386 xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 20:07:07 -0000 Author: gibbs Date: Thu Aug 22 20:07:06 2013 New Revision: 254671 URL: http://svnweb.freebsd.org/changeset/base/254671 Log: Rename definition of HYPERVISOR_VIRT_START to avoid conflict with upstream Xen definition found in xen/interface/arch-x86/xen-x86_32.h. Submitted by: Roger Pau Monné Reviewed by: gibbs MFC after: 2 weeks Modified: head/sys/i386/i386/genassym.c head/sys/i386/xen/locore.s Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Thu Aug 22 19:28:13 2013 (r254670) +++ head/sys/i386/i386/genassym.c Thu Aug 22 20:07:06 2013 (r254671) @@ -246,9 +246,8 @@ ASSYM(BUS_SPACE_HANDLE_IAT, offsetof(str #endif #ifdef XEN -#include ASSYM(PC_CR3, offsetof(struct pcpu, pc_cr3)); -ASSYM(HYPERVISOR_VIRT_START, __HYPERVISOR_VIRT_START); +ASSYM(XEN_HYPERVISOR_VIRT_START, HYPERVISOR_VIRT_START); #endif #ifdef HWPMC_HOOKS Modified: head/sys/i386/xen/locore.s ============================================================================== --- head/sys/i386/xen/locore.s Thu Aug 22 19:28:13 2013 (r254670) +++ head/sys/i386/xen/locore.s Thu Aug 22 20:07:06 2013 (r254671) @@ -76,7 +76,7 @@ ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .long, KERNBASE) ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .long, btext) ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .long, hypercall_page) - ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, .long, HYPERVISOR_VIRT_START) + ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, .long, XEN_HYPERVISOR_VIRT_START) #if 0 ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz, "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel") #endif From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 20:29:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12786E86; Thu, 22 Aug 2013 20:29:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DAD062F2B; Thu, 22 Aug 2013 20:29:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MKTwVU014902; Thu, 22 Aug 2013 20:29:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MKTwWL014898; Thu, 22 Aug 2013 20:29:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201308222029.r7MKTwWL014898@svn.freebsd.org> From: Michael Tuexen Date: Thu, 22 Aug 2013 20:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254672 - in head/sys: netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 20:29:59 -0000 Author: tuexen Date: Thu Aug 22 20:29:57 2013 New Revision: 254672 URL: http://svnweb.freebsd.org/changeset/base/254672 Log: Export the inpcb features as a 64-bit entity. Bump __FreeBSD_version to 1000048 since the modified structure is user visible and used by netstat, for example. Modified: head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_uio.h head/sys/sys/param.h Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Aug 22 20:07:06 2013 (r254671) +++ head/sys/netinet/sctp_sysctl.c Thu Aug 22 20:29:57 2013 (r254672) @@ -402,7 +402,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xinpcb.last = 0; xinpcb.local_port = ntohs(inp->sctp_lport); xinpcb.flags = inp->sctp_flags; - xinpcb.features = (uint32_t) inp->sctp_features; + xinpcb.features = inp->sctp_features; xinpcb.total_sends = inp->total_sends; xinpcb.total_recvs = inp->total_recvs; xinpcb.total_nospaces = inp->total_nospaces; Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Aug 22 20:07:06 2013 (r254671) +++ head/sys/netinet/sctp_uio.h Thu Aug 22 20:29:57 2013 (r254672) @@ -1149,7 +1149,7 @@ union sctp_sockstore { struct xsctp_inpcb { uint32_t last; uint32_t flags; - uint32_t features; + uint64_t features; uint32_t total_sends; uint32_t total_recvs; uint32_t total_nospaces; @@ -1157,7 +1157,7 @@ struct xsctp_inpcb { uint16_t local_port; uint16_t qlen; uint16_t maxqlen; - uint32_t extra_padding[32]; /* future */ + uint32_t extra_padding[31]; /* future */ }; struct xsctp_tcb { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Aug 22 20:07:06 2013 (r254671) +++ head/sys/sys/param.h Thu Aug 22 20:29:57 2013 (r254672) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000047 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000048 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Aug 22 22:01:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 27296D66; Thu, 22 Aug 2013 22:01:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F09372788; Thu, 22 Aug 2013 22:01:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7MM1uJr067521; Thu, 22 Aug 2013 22:01:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7MM1upF067520; Thu, 22 Aug 2013 22:01:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308222201.r7MM1upF067520@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Aug 2013 22:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254673 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2013 22:01:57 -0000 Author: kib Date: Thu Aug 22 22:01:56 2013 New Revision: 254673 URL: http://svnweb.freebsd.org/changeset/base/254673 Log: Update the manual page for vm_page_grab(9). Reviewed and edited by: alc Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/vm_page_grab.9 Modified: head/share/man/man9/vm_page_grab.9 ============================================================================== --- head/share/man/man9/vm_page_grab.9 Thu Aug 22 20:29:57 2013 (r254672) +++ head/share/man/man9/vm_page_grab.9 Thu Aug 22 22:01:56 2013 (r254673) @@ -1,5 +1,9 @@ .\" .\" Copyright (C) 2001 Chad David . All rights reserved. +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Konstantin Belousov +.\" under sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -26,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2001 +.Dd August 23, 2013 .Dt VM_PAGE_GRAB 9 .Os .Sh NAME @@ -48,21 +52,31 @@ If the page exists and is busy, .Fn vm_page_grab will sleep while waiting for it. If the page does not exist, it is allocated. +The function sleeps until the allocation request can be satisfied. +.Pp +The function requires the +.Fa object +to be locked on entry, and returns with the object locked. +If the +.Fn vm_page_grab +function sleeps for any reason, the object lock is temporary dropped. .Pp -If -.Dv VM_ALLOC_RETRY -is not set in -.Fa allocflags -and the function sleeps, either getting the page from the object -or while allocating it, -.Dv NULL -is returned. +The +.Fn vm_page_grab +supports all of the flags supported by +.Xr vm_page_alloc . +In addition, +.Fn vm_page_grab +supports the following flags: +.Bl -tag -width ".Dv VM_ALLOC_IGN_SBUSY" +.It Dv VM_ALLOC_IGN_SBUSY +When waiting for the busy state of the existing page to drain, +only test for exclusive busy; ignore the shared busy counter. +.El .Sh RETURN VALUES -If successful, +The .Fn vm_page_grab -returns the page; otherwise, -.Dv NULL -is returned. +always returns the page. .Sh SEE ALSO .Xr vm_page_alloc 9 .Sh AUTHORS From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 10:57:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 17E6B208; Fri, 23 Aug 2013 10:57:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 051B72D9A; Fri, 23 Aug 2013 10:57:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NAv5Bi075680; Fri, 23 Aug 2013 10:57:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NAv5ip075679; Fri, 23 Aug 2013 10:57:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201308231057.r7NAv5ip075679@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 23 Aug 2013 10:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254684 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 10:57:06 -0000 Author: des Date: Fri Aug 23 10:57:05 2013 New Revision: 254684 URL: http://svnweb.freebsd.org/changeset/base/254684 Log: Set the back pointer from the prefix to the interface before adding the prefix to the interface's prefix list. This shouldn't make a difference, since rtadvd(8) is single-threaded, but I've seen it crash in delete_prefix() with pfx_rainfo == NULL, and this is the only place where a prefix can be added to the list with a NULL pfx_rainfo. MFC after: 3 days Modified: head/usr.sbin/rtadvd/config.c Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Fri Aug 23 08:26:52 2013 (r254683) +++ head/usr.sbin/rtadvd/config.c Fri Aug 23 10:57:05 2013 (r254684) @@ -1125,9 +1125,9 @@ add_prefix(struct rainfo *rai, struct in pfx->pfx_onlinkflg = ipr->ipr_raf_onlink; pfx->pfx_autoconfflg = ipr->ipr_raf_auto; pfx->pfx_origin = PREFIX_FROM_DYNAMIC; + pfx->pfx_rainfo = rai; TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next); - pfx->pfx_rainfo = rai; syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s", __func__, From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 12:28:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9DC89298; Fri, 23 Aug 2013 12:28:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71037238C; Fri, 23 Aug 2013 12:28:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NCSBHP023547; Fri, 23 Aug 2013 12:28:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NCSBMS023546; Fri, 23 Aug 2013 12:28:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231228.r7NCSBMS023546@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 12:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254686 - head/contrib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 12:28:11 -0000 Author: emaste Date: Fri Aug 23 12:28:10 2013 New Revision: 254686 URL: http://svnweb.freebsd.org/changeset/base/254686 Log: Import NetBSD libexecinfo 20130822 to contrib Added: head/contrib/libexecinfo/ - copied from r254685, vendor/NetBSD/libexecinfo/ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 12:35:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E19979C0; Fri, 23 Aug 2013 12:35:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B51302438; Fri, 23 Aug 2013 12:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NCZmui028196; Fri, 23 Aug 2013 12:35:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NCZmFO028195; Fri, 23 Aug 2013 12:35:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231235.r7NCZmFO028195@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 12:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254687 - head/contrib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 12:35:49 -0000 Author: emaste Date: Fri Aug 23 12:35:48 2013 New Revision: 254687 URL: http://svnweb.freebsd.org/changeset/base/254687 Log: Remove accidental import of libexecinfo at wrong directory level Deleted: head/contrib/libexecinfo/ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 12:38:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 887DFB10; Fri, 23 Aug 2013 12:38:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AE832449; Fri, 23 Aug 2013 12:38:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NCcqIv029127; Fri, 23 Aug 2013 12:38:52 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NCcqG4029126; Fri, 23 Aug 2013 12:38:52 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231238.r7NCcqG4029126@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 12:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254688 - head/contrib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 12:38:52 -0000 Author: emaste Date: Fri Aug 23 12:38:51 2013 New Revision: 254688 URL: http://svnweb.freebsd.org/changeset/base/254688 Log: Import NetBSD libexecinfo 20130822 to contrib Added: head/contrib/libexecinfo/ - copied from r254687, vendor/NetBSD/libexecinfo/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 12:42:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AFE85C6C; Fri, 23 Aug 2013 12:42:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D9562483; Fri, 23 Aug 2013 12:42:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NCgEko032214; Fri, 23 Aug 2013 12:42:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NCgEDU032212; Fri, 23 Aug 2013 12:42:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231242.r7NCgEDU032212@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 12:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254689 - head/contrib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 12:42:14 -0000 Author: emaste Date: Fri Aug 23 12:42:13 2013 New Revision: 254689 URL: http://svnweb.freebsd.org/changeset/base/254689 Log: FreeBSD compatibility for libexecinfo Modified: head/contrib/libexecinfo/backtrace.c head/contrib/libexecinfo/symtab.c Modified: head/contrib/libexecinfo/backtrace.c ============================================================================== --- head/contrib/libexecinfo/backtrace.c Fri Aug 23 12:38:51 2013 (r254688) +++ head/contrib/libexecinfo/backtrace.c Fri Aug 23 12:42:13 2013 (r254689) @@ -33,6 +33,7 @@ __RCSID("$NetBSD: backtrace.c,v 1.2 2012 #include #include +#define _WITH_DPRINTF #include #include #include Modified: head/contrib/libexecinfo/symtab.c ============================================================================== --- head/contrib/libexecinfo/symtab.c Fri Aug 23 12:38:51 2013 (r254688) +++ head/contrib/libexecinfo/symtab.c Fri Aug 23 12:42:13 2013 (r254689) @@ -33,6 +33,7 @@ __RCSID("$NetBSD: symtab.c,v 1.1 2012/05 #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:14:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C0E79AB; Fri, 23 Aug 2013 13:14:19 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B715266F; Fri, 23 Aug 2013 13:14:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDEJIl048843; Fri, 23 Aug 2013 13:14:19 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDEImx048841; Fri, 23 Aug 2013 13:14:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201308231314.r7NDEImx048841@svn.freebsd.org> From: Sean Bruno Date: Fri, 23 Aug 2013 13:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254690 - in head/sys/mips: atheros conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:14:19 -0000 Author: sbruno Date: Fri Aug 23 13:14:18 2013 New Revision: 254690 URL: http://svnweb.freebsd.org/changeset/base/254690 Log: Some vendors store the mac addresses of arge(4) as a literal sring in the form xx:xx:xx:xx:xx:xx complete with ":" characters taking of 18 bytes instead of 6 integers. Expose a "readascii" tuneable to handle this case. Remove restriction on eepromac assignement for the first dev instance only. Add eepromac address for DIR-825 to hints file. Add readascii hint for DIR-825 Reviewed by: adrian@ Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/conf/DIR-825.hints Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Aug 23 12:42:13 2013 (r254689) +++ head/sys/mips/atheros/if_arge.c Fri Aug 23 13:14:18 2013 (r254690) @@ -371,6 +371,7 @@ arge_attach(device_t dev) uint32_t hint; long eeprom_mac_addr = 0; int miicfg = 0; + int readascii = 0; sc = device_get_softc(dev); sc->arge_dev = dev; @@ -384,16 +385,28 @@ arge_attach(device_t dev) * Since multiple units seem to use this feature, include * a method of setting the MAC address based on an flash location * in CPU address space. + * + * Some vendors have decided to store the mac address as a literal + * string of 18 characters in xx:xx:xx:xx:xx:xx format instead of + * an array of numbers. Expose a hint to turn on this conversion + * feature via strtol() */ - if (sc->arge_mac_unit == 0 && - resource_long_value(device_get_name(dev), device_get_unit(dev), + if (resource_long_value(device_get_name(dev), device_get_unit(dev), "eeprommac", &eeprom_mac_addr) == 0) { int i; const char *mac = (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); device_printf(dev, "Overriding MAC from EEPROM\n"); - for (i = 0; i < 6; i++) { - ar711_base_mac[i] = mac[i]; + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "readascii", &readascii) == 0) { + device_printf(dev, "Vendor stores MAC in ASCII format\n"); + for (i = 0; i < 6; i++) { + ar711_base_mac[i] = strtol(&(mac[i*3]), NULL, 16); + } + } else { + for (i = 0; i < 6; i++) { + ar711_base_mac[i] = mac[i]; + } } } Modified: head/sys/mips/conf/DIR-825.hints ============================================================================== --- head/sys/mips/conf/DIR-825.hints Fri Aug 23 12:42:13 2013 (r254689) +++ head/sys/mips/conf/DIR-825.hints Fri Aug 23 13:14:18 2013 (r254690) @@ -6,13 +6,14 @@ hint.arge.0.phymask=0x0 hint.arge.0.media=1000 hint.arge.0.fduplex=1 - -# XXX grab these from uboot? -# hint.arge.0.eeprommac=0x1f01fc00 +hint.arge.0.eeprommac=0x1f66ffa0 +hint.arge.0.readascii=1 hint.arge.1.phymask=0x0 hint.arge.1.media=1000 hint.arge.1.fduplex=1 +hint.arge.1.eeprommac=0x1f66ffb4 +hint.arge.1.readascii=1 # ath0 - slot 17 hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1f661000 From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:19:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9BB90B33; Fri, 23 Aug 2013 13:19:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88F04269D; Fri, 23 Aug 2013 13:19:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDJCgo050407; Fri, 23 Aug 2013 13:19:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDJCqg050406; Fri, 23 Aug 2013 13:19:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231319.r7NDJCqg050406@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254691 - stable/8/share/mk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:19:12 -0000 Author: avg Date: Fri Aug 23 13:19:12 2013 New Revision: 254691 URL: http://svnweb.freebsd.org/changeset/base/254691 Log: MFC r198335,198365: remove dependency between NO_WARNS and CSTD There is no reason to have it. Reviewed by: dim MFC slackers: rdivacky, ru Modified: stable/8/share/mk/bsd.sys.mk Directory Properties: stable/8/share/mk/ (props changed) Modified: stable/8/share/mk/bsd.sys.mk ============================================================================== --- stable/8/share/mk/bsd.sys.mk Fri Aug 23 13:14:18 2013 (r254690) +++ stable/8/share/mk/bsd.sys.mk Fri Aug 23 13:19:12 2013 (r254691) @@ -11,7 +11,7 @@ # the default is gnu99 for now CSTD ?= gnu99 -.if !defined(NO_WARNS) && ${CC} != "icc" +.if ${CC} != "icc" . if ${CSTD} == "k&r" CFLAGS += -traditional . elif ${CSTD} == "c89" || ${CSTD} == "c90" @@ -23,6 +23,8 @@ CFLAGS += -std=iso9899:1999 . else CFLAGS += -std=${CSTD} . endif +.endif +.if !defined(NO_WARNS) && ${CC} != "icc" # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS += -pedantic . if defined(WARNS) From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:20:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E420FC5E; Fri, 23 Aug 2013 13:20:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C23C126A3; Fri, 23 Aug 2013 13:20:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDKD8Z052252; Fri, 23 Aug 2013 13:20:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDKB4U052243; Fri, 23 Aug 2013 13:20:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231320.r7NDKB4U052243@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254692 - in stable/9/sys: gdb kern ofed/include/linux sys vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:20:14 -0000 Author: avg Date: Fri Aug 23 13:20:11 2013 New Revision: 254692 URL: http://svnweb.freebsd.org/changeset/base/254692 Log: MFC r253604: rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST Modified: stable/9/sys/gdb/gdb_cons.c stable/9/sys/kern/init_main.c stable/9/sys/kern/kern_ntptime.c stable/9/sys/kern/sched_4bsd.c stable/9/sys/ofed/include/linux/module.h stable/9/sys/sys/kernel.h stable/9/sys/sys/sched.h stable/9/sys/vm/vm.h stable/9/sys/vm/vm_glue.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/gdb/gdb_cons.c ============================================================================== --- stable/9/sys/gdb/gdb_cons.c Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/gdb/gdb_cons.c Fri Aug 23 13:20:11 2013 (r254692) @@ -136,7 +136,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_LAST, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) Modified: stable/9/sys/kern/init_main.c ============================================================================== --- stable/9/sys/kern/init_main.c Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/kern/init_main.c Fri Aug 23 13:20:11 2013 (r254692) @@ -236,9 +236,6 @@ restart: /* * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. - * - * The last item on the list is expected to be the scheduler, - * which will not return. */ for (sipp = sysinit; sipp < sysinit_end; sipp++) { @@ -296,7 +293,13 @@ restart: } } - panic("Shouldn't get here!"); + mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); + mtx_unlock(&Giant); + + /* + * Now hand over this thread to swapper. + */ + swapper(); /* NOTREACHED*/ } @@ -339,7 +342,7 @@ static char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 1, +SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); #endif @@ -348,7 +351,7 @@ static char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); #endif Modified: stable/9/sys/kern/kern_ntptime.c ============================================================================== --- stable/9/sys/kern/kern_ntptime.c Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/kern/kern_ntptime.c Fri Aug 23 13:20:11 2013 (r254692) @@ -1040,5 +1040,5 @@ start_periodic_resettodr(void *arg __unu periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, +SYSINIT(periodic_resettodr, SI_SUB_LAST, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); Modified: stable/9/sys/kern/sched_4bsd.c ============================================================================== --- stable/9/sys/kern/sched_4bsd.c Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/kern/sched_4bsd.c Fri Aug 23 13:20:11 2013 (r254692) @@ -143,7 +143,7 @@ static struct kproc_desc sched_kp = { schedcpu_thread, NULL }; -SYSINIT(schedcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, kproc_start, +SYSINIT(schedcpu, SI_SUB_LAST, SI_ORDER_FIRST, kproc_start, &sched_kp); SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL); Modified: stable/9/sys/ofed/include/linux/module.h ============================================================================== --- stable/9/sys/ofed/include/linux/module.h Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/ofed/include/linux/module.h Fri Aug 23 13:20:11 2013 (r254692) @@ -68,17 +68,17 @@ _module_run(void *arg) } #define module_init(fn) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed to work around not having a module * load order resolver built in. */ #define module_init_order(fn, order) \ - SYSINIT(fn, SI_SUB_RUN_SCHEDULER, (order), _module_run, (fn)) + SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn)) #define module_exit(fn) \ - SYSUNINIT(fn, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, _module_run, (fn)) + SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) #define module_get(module) #define module_put(module) Modified: stable/9/sys/sys/kernel.h ============================================================================== --- stable/9/sys/sys/kernel.h Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/sys/kernel.h Fri Aug 23 13:20:11 2013 (r254692) @@ -79,7 +79,7 @@ extern volatile int ticks; * enumeration values are explicit rather than implicit to provide * for binary compatibility with inserted elements. * - * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value. + * The SI_SUB_LAST value must have the highest lexical value. * * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent @@ -165,7 +165,7 @@ enum sysinit_sub_id { SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ SI_SUB_SMP = 0xf000000, /* start the APs*/ SI_SUB_RACCTD = 0xf100000, /* start raccd*/ - SI_SUB_RUN_SCHEDULER = 0xfffffff /* scheduler*/ + SI_SUB_LAST = 0xfffffff /* final initialization */ }; Modified: stable/9/sys/sys/sched.h ============================================================================== --- stable/9/sys/sys/sched.h Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/sys/sched.h Fri Aug 23 13:20:11 2013 (r254692) @@ -180,7 +180,7 @@ static void name ## _add_proc(void *dumm #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \ ptr, 0, sysctl_dpcpu_long, "LU", descr); \ } \ -SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL); +SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL); #define SCHED_STAT_DEFINE(name, descr) \ DPCPU_DEFINE(unsigned long, name); \ Modified: stable/9/sys/vm/vm.h ============================================================================== --- stable/9/sys/vm/vm.h Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/vm/vm.h Fri Aug 23 13:20:11 2013 (r254692) @@ -151,6 +151,7 @@ int swap_reserve_by_cred(vm_ooffset_t in void swap_reserve_force(vm_ooffset_t incr); void swap_release(vm_ooffset_t decr); void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred); +void swapper(void); #endif /* VM_H */ Modified: stable/9/sys/vm/vm_glue.c ============================================================================== --- stable/9/sys/vm/vm_glue.c Fri Aug 23 13:19:12 2013 (r254691) +++ stable/9/sys/vm/vm_glue.c Fri Aug 23 13:20:11 2013 (r254692) @@ -95,16 +95,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * System initialization - * - * THIS MUST BE THE LAST INITIALIZATION ITEM!!! - * - * Note: run scheduling should be divorced from the vm system. - */ -static void scheduler(void *); -SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, scheduler, NULL); - #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); @@ -691,10 +681,8 @@ faultin(p) * * Giant is held on entry. */ -/* ARGSUSED*/ -static void -scheduler(dummy) - void *dummy; +void +swapper(void) { struct proc *p; struct thread *td; @@ -704,9 +692,6 @@ scheduler(dummy) int ppri; int pri; - mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); - mtx_unlock(&Giant); - loop: if (vm_page_count_min()) { VM_WAIT; @@ -757,7 +742,7 @@ loop: * Nothing to do, back to sleep. */ if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "sched", MAXSLP * hz / 2); + tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); goto loop; } PROC_LOCK(p); From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:22:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 88A7ED9A; Fri, 23 Aug 2013 13:22:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7536126D6; Fri, 23 Aug 2013 13:22:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDMG1B053641; Fri, 23 Aug 2013 13:22:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDMEkL053606; Fri, 23 Aug 2013 13:22:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231322.r7NDMEkL053606@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254693 - in stable/8/sys: gdb kern sys vm X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:22:16 -0000 Author: avg Date: Fri Aug 23 13:22:14 2013 New Revision: 254693 URL: http://svnweb.freebsd.org/changeset/base/254693 Log: MFC r253604: rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST Modified: stable/8/sys/gdb/gdb_cons.c stable/8/sys/kern/init_main.c stable/8/sys/kern/kern_ntptime.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/sys/kernel.h stable/8/sys/sys/sched.h stable/8/sys/vm/vm.h stable/8/sys/vm/vm_glue.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/gdb/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/vm/ (props changed) Modified: stable/8/sys/gdb/gdb_cons.c ============================================================================== --- stable/8/sys/gdb/gdb_cons.c Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/gdb/gdb_cons.c Fri Aug 23 13:22:14 2013 (r254693) @@ -126,7 +126,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_LAST, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) Modified: stable/8/sys/kern/init_main.c ============================================================================== --- stable/8/sys/kern/init_main.c Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/kern/init_main.c Fri Aug 23 13:22:14 2013 (r254693) @@ -214,9 +214,6 @@ restart: /* * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. - * - * The last item on the list is expected to be the scheduler, - * which will not return. */ for (sipp = sysinit; sipp < sysinit_end; sipp++) { @@ -273,7 +270,13 @@ restart: } } - panic("Shouldn't get here!"); + mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); + mtx_unlock(&Giant); + + /* + * Now hand over this thread to swapper. + */ + swapper(); /* NOTREACHED*/ } @@ -316,7 +319,7 @@ static char wit_warn[] = "WARNING: WITNESS option enabled, expect reduced performance.\n"; SYSINIT(witwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); -SYSINIT(witwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 1, +SYSINIT(witwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 1, print_caddr_t, wit_warn); #endif @@ -325,7 +328,7 @@ static char diag_warn[] = "WARNING: DIAGNOSTIC option enabled, expect reduced performance.\n"; SYSINIT(diagwarn, SI_SUB_COPYRIGHT, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); -SYSINIT(diagwarn2, SI_SUB_RUN_SCHEDULER, SI_ORDER_THIRD + 2, +SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_THIRD + 2, print_caddr_t, diag_warn); #endif Modified: stable/8/sys/kern/kern_ntptime.c ============================================================================== --- stable/8/sys/kern/kern_ntptime.c Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/kern/kern_ntptime.c Fri Aug 23 13:22:14 2013 (r254693) @@ -1035,5 +1035,5 @@ start_periodic_resettodr(void *arg __unu periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, +SYSINIT(periodic_resettodr, SI_SUB_LAST, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/kern/sched_4bsd.c Fri Aug 23 13:22:14 2013 (r254693) @@ -143,7 +143,7 @@ static struct kproc_desc sched_kp = { schedcpu_thread, NULL }; -SYSINIT(schedcpu, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, kproc_start, +SYSINIT(schedcpu, SI_SUB_LAST, SI_ORDER_FIRST, kproc_start, &sched_kp); SYSINIT(sched_setup, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, sched_setup, NULL); Modified: stable/8/sys/sys/kernel.h ============================================================================== --- stable/8/sys/sys/kernel.h Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/sys/kernel.h Fri Aug 23 13:22:14 2013 (r254693) @@ -79,7 +79,7 @@ extern volatile int ticks; * enumeration values are explicit rather than implicit to provide * for binary compatibility with inserted elements. * - * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value. + * The SI_SUB_LAST value must have the highest lexical value. * * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent @@ -169,7 +169,7 @@ enum sysinit_sub_id { SI_SUB_KTHREAD_UPDATE = 0xec00000, /* update daemon*/ SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ SI_SUB_SMP = 0xf000000, /* start the APs*/ - SI_SUB_RUN_SCHEDULER = 0xfffffff /* scheduler*/ + SI_SUB_LAST = 0xfffffff /* final initialization */ }; Modified: stable/8/sys/sys/sched.h ============================================================================== --- stable/8/sys/sys/sched.h Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/sys/sched.h Fri Aug 23 13:22:14 2013 (r254693) @@ -176,7 +176,7 @@ static void name ## _add_proc(void *dumm #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \ ptr, 0, sysctl_dpcpu_long, "LU", descr); \ } \ -SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL); +SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL); #define SCHED_STAT_DEFINE(name, descr) \ DPCPU_DEFINE(unsigned long, name); \ Modified: stable/8/sys/vm/vm.h ============================================================================== --- stable/8/sys/vm/vm.h Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/vm/vm.h Fri Aug 23 13:22:14 2013 (r254693) @@ -147,6 +147,7 @@ int swap_reserve_by_uid(vm_ooffset_t inc void swap_reserve_force(vm_ooffset_t incr); void swap_release(vm_ooffset_t decr); void swap_release_by_uid(vm_ooffset_t decr, struct uidinfo *uip); +void swapper(void); #endif /* VM_H */ Modified: stable/8/sys/vm/vm_glue.c ============================================================================== --- stable/8/sys/vm/vm_glue.c Fri Aug 23 13:20:11 2013 (r254692) +++ stable/8/sys/vm/vm_glue.c Fri Aug 23 13:22:14 2013 (r254693) @@ -104,14 +104,6 @@ extern int maxslp; static void vm_init_limits(void *); SYSINIT(vm_limits, SI_SUB_VM_CONF, SI_ORDER_FIRST, vm_init_limits, &proc0); -/* - * THIS MUST BE THE LAST INITIALIZATION ITEM!!! - * - * Note: run scheduling should be divorced from the vm system. - */ -static void scheduler(void *); -SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, scheduler, NULL); - #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); @@ -731,10 +723,8 @@ faultin(p) * * Giant is held on entry. */ -/* ARGSUSED*/ -static void -scheduler(dummy) - void *dummy; +void +swapper(void) { struct proc *p; struct thread *td; @@ -744,9 +734,6 @@ scheduler(dummy) int ppri; int pri; - mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); - mtx_unlock(&Giant); - loop: if (vm_page_count_min()) { VM_WAIT; @@ -797,7 +784,7 @@ loop: * Nothing to do, back to sleep. */ if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "sched", maxslp * hz / 2); + tsleep(&proc0, PVM, "swapin", maxslp * hz / 2); goto loop; } PROC_LOCK(p); From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:27:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBFBDF1E; Fri, 23 Aug 2013 13:27:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8F91270C; Fri, 23 Aug 2013 13:27:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDRDhk055255; Fri, 23 Aug 2013 13:27:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDRDF3055254; Fri, 23 Aug 2013 13:27:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231327.r7NDRDF3055254@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254694 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:27:13 -0000 Author: avg Date: Fri Aug 23 13:27:13 2013 New Revision: 254694 URL: http://svnweb.freebsd.org/changeset/base/254694 Log: MFC r253603: zfs: move vnode creation from zfs_znode_cache_constructor to zfs_znode_alloc Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Aug 23 13:22:14 2013 (r254693) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Aug 23 13:27:13 2013 (r254694) @@ -113,37 +113,12 @@ extern struct vop_vector zfs_vnodeops; extern struct vop_vector zfs_fifoops; extern struct vop_vector zfs_shareops; -/* - * XXX: We cannot use this function as a cache constructor, because - * there is one global cache for all file systems and we need - * to pass vfsp here, which is not possible, because argument - * 'cdrarg' is defined at kmem_cache_create() time. - */ -/*ARGSUSED*/ static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { znode_t *zp = buf; - vnode_t *vp; - vfs_t *vfsp = arg; - int error; POINTER_INVALIDATE(&zp->z_zfsvfs); - ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - - if (vfsp != NULL) { - error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); - if (error != 0 && (kmflags & KM_NOSLEEP)) - return (-1); - ASSERT(error == 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - zp->z_vnode = vp; - vp->v_data = (caddr_t)zp; - VN_LOCK_AREC(vp); - VN_LOCK_ASHARE(vp); - } else { - zp->z_vnode = NULL; - } list_link_init(&zp->z_link_node); @@ -158,6 +133,7 @@ zfs_znode_cache_constructor(void *buf, v zp->z_dirlocks = NULL; zp->z_acl_cached = NULL; + zp->z_vnode = NULL; zp->z_moved = 0; return (0); } @@ -377,7 +353,7 @@ zfs_znode_init(void) rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", - sizeof (znode_t), 0, /* zfs_znode_cache_constructor */ NULL, + sizeof (znode_t), 0, zfs_znode_cache_constructor, zfs_znode_cache_destructor, NULL, NULL, NULL, 0); kmem_cache_set_move(znode_cache, zfs_znode_move); } @@ -501,7 +477,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfs_acl_ids_t acl_ids; vattr_t vattr; znode_t *sharezp; - vnode_t *vp, vnode; znode_t *zp; int error; @@ -512,7 +487,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d vattr.va_gid = crgetgid(kcred); sharezp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(sharezp, zfsvfs->z_parent->z_vfs, 0); ASSERT(!POINTER_IS_VALID(sharezp->z_zfsvfs)); sharezp->z_moved = 0; sharezp->z_unlinked = 0; @@ -520,12 +494,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d sharezp->z_zfsvfs = zfsvfs; sharezp->z_is_sa = zfsvfs->z_use_sa; - sharezp->z_vnode = &vnode; - vnode.v_data = sharezp; - - vp = ZTOV(sharezp); - vp->v_type = VDIR; - VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, kcred, NULL, &acl_ids)); zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, &zp, &acl_ids); @@ -536,12 +504,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfsvfs->z_shares_dir = sharezp->z_id; zfs_acl_ids_free(&acl_ids); - ZTOV(sharezp)->v_data = NULL; - ZTOV(sharezp)->v_count = 0; - ZTOV(sharezp)->v_holdcnt = 0; - zp->z_vnode = NULL; sa_handle_destroy(sharezp->z_sa_hdl); - sharezp->z_vnode = NULL; kmem_cache_free(znode_cache, sharezp); return (error); @@ -657,9 +620,17 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu uint64_t parent; sa_bulk_attr_t bulk[9]; int count = 0; + int error; zp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(zp, zfsvfs->z_parent->z_vfs, 0); + + error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); + if (error != 0) { + kmem_cache_free(znode_cache, zp); + return (NULL); + } + zp->z_vnode = vp; + vp->v_data = zp; ASSERT(zp->z_dirlocks == NULL); ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); @@ -749,8 +720,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu break; #endif /* sun */ } - if (vp->v_type != VFIFO) - VN_LOCK_ASHARE(vp); mutex_enter(&zfsvfs->z_znodes_lock); list_insert_tail(&zfsvfs->z_all_znodes, zp); @@ -762,6 +731,14 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp->z_zfsvfs = zfsvfs; mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Acquire vnode lock before making it available to the world. + */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VN_LOCK_AREC(vp); + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + VFS_HOLD(zfsvfs->z_vfs); return (zp); } @@ -1830,7 +1807,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, int error; int i; znode_t *rootzp = NULL; - vnode_t vnode; vattr_t vattr; znode_t *zp; zfs_acl_ids_t acl_ids; @@ -1909,17 +1885,12 @@ zfs_create_fs(objset_t *os, cred_t *cr, bzero(&zfsvfs, sizeof (zfsvfs_t)); rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(rootzp, NULL, 0); ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_moved = 0; rootzp->z_unlinked = 0; rootzp->z_atime_dirty = 0; rootzp->z_is_sa = USE_SA(version, os); - vnode.v_type = VDIR; - vnode.v_data = rootzp; - rootzp->z_vnode = &vnode; - zfsvfs.z_os = os; zfsvfs.z_parent = &zfsvfs; zfsvfs.z_version = version; @@ -1957,7 +1928,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, POINTER_INVALIDATE(&rootzp->z_zfsvfs); sa_handle_destroy(rootzp->z_sa_hdl); - rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:27:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C20EDD5; Fri, 23 Aug 2013 13:27:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0C2D2711; Fri, 23 Aug 2013 13:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDRSbJ055345; Fri, 23 Aug 2013 13:27:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDRSc4055344; Fri, 23 Aug 2013 13:27:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231327.r7NDRSc4055344@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254695 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:27:28 -0000 Author: avg Date: Fri Aug 23 13:27:27 2013 New Revision: 254695 URL: http://svnweb.freebsd.org/changeset/base/254695 Log: MFC r253603: zfs: move vnode creation from zfs_znode_cache_constructor to zfs_znode_alloc Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Aug 23 13:27:13 2013 (r254694) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Aug 23 13:27:27 2013 (r254695) @@ -113,37 +113,12 @@ extern struct vop_vector zfs_vnodeops; extern struct vop_vector zfs_fifoops; extern struct vop_vector zfs_shareops; -/* - * XXX: We cannot use this function as a cache constructor, because - * there is one global cache for all file systems and we need - * to pass vfsp here, which is not possible, because argument - * 'cdrarg' is defined at kmem_cache_create() time. - */ -/*ARGSUSED*/ static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { znode_t *zp = buf; - vnode_t *vp; - vfs_t *vfsp = arg; - int error; POINTER_INVALIDATE(&zp->z_zfsvfs); - ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - - if (vfsp != NULL) { - error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); - if (error != 0 && (kmflags & KM_NOSLEEP)) - return (-1); - ASSERT(error == 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - zp->z_vnode = vp; - vp->v_data = (caddr_t)zp; - VN_LOCK_AREC(vp); - VN_LOCK_ASHARE(vp); - } else { - zp->z_vnode = NULL; - } list_link_init(&zp->z_link_node); @@ -158,6 +133,7 @@ zfs_znode_cache_constructor(void *buf, v zp->z_dirlocks = NULL; zp->z_acl_cached = NULL; + zp->z_vnode = NULL; zp->z_moved = 0; return (0); } @@ -377,7 +353,7 @@ zfs_znode_init(void) rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", - sizeof (znode_t), 0, /* zfs_znode_cache_constructor */ NULL, + sizeof (znode_t), 0, zfs_znode_cache_constructor, zfs_znode_cache_destructor, NULL, NULL, NULL, 0); kmem_cache_set_move(znode_cache, zfs_znode_move); } @@ -501,7 +477,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfs_acl_ids_t acl_ids; vattr_t vattr; znode_t *sharezp; - vnode_t *vp, vnode; znode_t *zp; int error; @@ -512,7 +487,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d vattr.va_gid = crgetgid(kcred); sharezp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(sharezp, zfsvfs->z_parent->z_vfs, 0); ASSERT(!POINTER_IS_VALID(sharezp->z_zfsvfs)); sharezp->z_moved = 0; sharezp->z_unlinked = 0; @@ -520,12 +494,6 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d sharezp->z_zfsvfs = zfsvfs; sharezp->z_is_sa = zfsvfs->z_use_sa; - sharezp->z_vnode = &vnode; - vnode.v_data = sharezp; - - vp = ZTOV(sharezp); - vp->v_type = VDIR; - VERIFY(0 == zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, kcred, NULL, &acl_ids)); zfs_mknode(sharezp, &vattr, tx, kcred, IS_ROOT_NODE, &zp, &acl_ids); @@ -536,12 +504,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, d zfsvfs->z_shares_dir = sharezp->z_id; zfs_acl_ids_free(&acl_ids); - ZTOV(sharezp)->v_data = NULL; - ZTOV(sharezp)->v_count = 0; - ZTOV(sharezp)->v_holdcnt = 0; - zp->z_vnode = NULL; sa_handle_destroy(sharezp->z_sa_hdl); - sharezp->z_vnode = NULL; kmem_cache_free(znode_cache, sharezp); return (error); @@ -657,9 +620,17 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu uint64_t parent; sa_bulk_attr_t bulk[9]; int count = 0; + int error; zp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(zp, zfsvfs->z_parent->z_vfs, 0); + + error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); + if (error != 0) { + kmem_cache_free(znode_cache, zp); + return (NULL); + } + zp->z_vnode = vp; + vp->v_data = zp; ASSERT(zp->z_dirlocks == NULL); ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); @@ -749,8 +720,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu break; #endif /* sun */ } - if (vp->v_type != VFIFO) - VN_LOCK_ASHARE(vp); mutex_enter(&zfsvfs->z_znodes_lock); list_insert_tail(&zfsvfs->z_all_znodes, zp); @@ -762,6 +731,14 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp->z_zfsvfs = zfsvfs; mutex_exit(&zfsvfs->z_znodes_lock); + /* + * Acquire vnode lock before making it available to the world. + */ + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + VN_LOCK_AREC(vp); + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + VFS_HOLD(zfsvfs->z_vfs); return (zp); } @@ -1830,7 +1807,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, int error; int i; znode_t *rootzp = NULL; - vnode_t vnode; vattr_t vattr; znode_t *zp; zfs_acl_ids_t acl_ids; @@ -1909,17 +1885,12 @@ zfs_create_fs(objset_t *os, cred_t *cr, bzero(&zfsvfs, sizeof (zfsvfs_t)); rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(rootzp, NULL, 0); ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_moved = 0; rootzp->z_unlinked = 0; rootzp->z_atime_dirty = 0; rootzp->z_is_sa = USE_SA(version, os); - vnode.v_type = VDIR; - vnode.v_data = rootzp; - rootzp->z_vnode = &vnode; - zfsvfs.z_os = os; zfsvfs.z_parent = &zfsvfs; zfsvfs.z_version = version; @@ -1957,7 +1928,6 @@ zfs_create_fs(objset_t *os, cred_t *cr, POINTER_INVALIDATE(&rootzp->z_zfsvfs); sa_handle_destroy(rootzp->z_sa_hdl); - rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:29:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40C45220; Fri, 23 Aug 2013 13:29:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6F0272A; Fri, 23 Aug 2013 13:29:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDTsTg056205; Fri, 23 Aug 2013 13:29:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDTsgo056203; Fri, 23 Aug 2013 13:29:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231329.r7NDTsgo056203@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254696 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:29:54 -0000 Author: avg Date: Fri Aug 23 13:29:53 2013 New Revision: 254696 URL: http://svnweb.freebsd.org/changeset/base/254696 Log: MFC r253606: zfs module: perform cleanup during shutdown in addition to module unload Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 23 13:27:27 2013 (r254695) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 23 13:29:53 2013 (r254696) @@ -6194,54 +6194,96 @@ _info(struct modinfo *modinfop) } #endif /* sun */ -static int -zfs_modevent(module_t mod, int type, void *unused __unused) +static int zfs__init(void); +static int zfs__fini(void); +static void zfs_shutdown(void *, int); + +static eventhandler_tag zfs_shutdown_event_tag; + +int +zfs__init(void) { - int error = 0; - switch (type) { - case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS"); + zfs_root_token = root_mount_hold("ZFS"); - mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - zfs_ioctl_init(); + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + zfs_ioctl_init(); - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, rrw_tsd_destroy); - tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, rrw_tsd_destroy); + tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); - printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); - root_mount_rel(zfs_root_token); + printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); + root_mount_rel(zfs_root_token); - zfsdev_init(); - break; - case MOD_UNLOAD: - if (spa_busy() || zfs_busy() || zvol_busy() || - zio_injection_enabled) { - error = EBUSY; - break; - } - - zfsdev_fini(); - zvol_fini(); - zfs_fini(); - spa_fini(); - - tsd_destroy(&zfs_fsyncer_key); - tsd_destroy(&rrw_tsd_key); - tsd_destroy(&zfs_allow_log_key); + zfsdev_init(); - mutex_destroy(&zfs_share_lock); - break; + return (0); +} + +int +zfs__fini(void) +{ + if (spa_busy() || zfs_busy() || zvol_busy() || + zio_injection_enabled) { + return (EBUSY); + } + + zfsdev_fini(); + zvol_fini(); + zfs_fini(); + spa_fini(); + + tsd_destroy(&zfs_fsyncer_key); + tsd_destroy(&rrw_tsd_key); + tsd_destroy(&zfs_allow_log_key); + + mutex_destroy(&zfs_share_lock); + + return (0); +} + +static void +zfs_shutdown(void *arg __unused, int howto __unused) +{ + + /* + * ZFS fini routines can not properly work in a panic-ed system. + */ + if (panicstr == NULL) + (void)zfs__fini(); +} + + +static int +zfs_modevent(module_t mod, int type, void *unused __unused) +{ + int err; + + switch (type) { + case MOD_LOAD: + err = zfs__init(); + if (err == 0) + zfs_shutdown_event_tag = EVENTHANDLER_REGISTER( + shutdown_post_sync, zfs_shutdown, NULL, + SHUTDOWN_PRI_FIRST); + return (err); + case MOD_UNLOAD: + err = zfs__fini(); + if (err == 0 && zfs_shutdown_event_tag != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, + zfs_shutdown_event_tag); + return (err); + case MOD_SHUTDOWN: + return (0); default: - error = EOPNOTSUPP; break; } - return (error); + return (EOPNOTSUPP); } static moduledata_t zfs_mod = { From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:30:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 00D67344; Fri, 23 Aug 2013 13:30:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E20D82733; Fri, 23 Aug 2013 13:30:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDU7Qx056397; Fri, 23 Aug 2013 13:30:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDU7Cf056396; Fri, 23 Aug 2013 13:30:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231330.r7NDU7Cf056396@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 13:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254697 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:30:08 -0000 Author: avg Date: Fri Aug 23 13:30:07 2013 New Revision: 254697 URL: http://svnweb.freebsd.org/changeset/base/254697 Log: MFC r253606: zfs module: perform cleanup during shutdown in addition to module unload Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 23 13:29:53 2013 (r254696) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 23 13:30:07 2013 (r254697) @@ -6194,54 +6194,96 @@ _info(struct modinfo *modinfop) } #endif /* sun */ -static int -zfs_modevent(module_t mod, int type, void *unused __unused) +static int zfs__init(void); +static int zfs__fini(void); +static void zfs_shutdown(void *, int); + +static eventhandler_tag zfs_shutdown_event_tag; + +int +zfs__init(void) { - int error = 0; - switch (type) { - case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS"); + zfs_root_token = root_mount_hold("ZFS"); - mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - zfs_ioctl_init(); + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + zfs_ioctl_init(); - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, rrw_tsd_destroy); - tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, rrw_tsd_destroy); + tsd_create(&zfs_allow_log_key, zfs_allow_log_destroy); - printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); - root_mount_rel(zfs_root_token); + printf("ZFS storage pool version: features support (" SPA_VERSION_STRING ")\n"); + root_mount_rel(zfs_root_token); - zfsdev_init(); - break; - case MOD_UNLOAD: - if (spa_busy() || zfs_busy() || zvol_busy() || - zio_injection_enabled) { - error = EBUSY; - break; - } - - zfsdev_fini(); - zvol_fini(); - zfs_fini(); - spa_fini(); - - tsd_destroy(&zfs_fsyncer_key); - tsd_destroy(&rrw_tsd_key); - tsd_destroy(&zfs_allow_log_key); + zfsdev_init(); - mutex_destroy(&zfs_share_lock); - break; + return (0); +} + +int +zfs__fini(void) +{ + if (spa_busy() || zfs_busy() || zvol_busy() || + zio_injection_enabled) { + return (EBUSY); + } + + zfsdev_fini(); + zvol_fini(); + zfs_fini(); + spa_fini(); + + tsd_destroy(&zfs_fsyncer_key); + tsd_destroy(&rrw_tsd_key); + tsd_destroy(&zfs_allow_log_key); + + mutex_destroy(&zfs_share_lock); + + return (0); +} + +static void +zfs_shutdown(void *arg __unused, int howto __unused) +{ + + /* + * ZFS fini routines can not properly work in a panic-ed system. + */ + if (panicstr == NULL) + (void)zfs__fini(); +} + + +static int +zfs_modevent(module_t mod, int type, void *unused __unused) +{ + int err; + + switch (type) { + case MOD_LOAD: + err = zfs__init(); + if (err == 0) + zfs_shutdown_event_tag = EVENTHANDLER_REGISTER( + shutdown_post_sync, zfs_shutdown, NULL, + SHUTDOWN_PRI_FIRST); + return (err); + case MOD_UNLOAD: + err = zfs__fini(); + if (err == 0 && zfs_shutdown_event_tag != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, + zfs_shutdown_event_tag); + return (err); + case MOD_SHUTDOWN: + return (0); default: - error = EOPNOTSUPP; break; } - return (error); + return (EOPNOTSUPP); } static moduledata_t zfs_mod = { From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:47:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D91CA20; Fri, 23 Aug 2013 13:47:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AD0E283F; Fri, 23 Aug 2013 13:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDlIU5066185; Fri, 23 Aug 2013 13:47:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDlIon066184; Fri, 23 Aug 2013 13:47:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231347.r7NDlIon066184@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 13:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254698 - head/contrib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:47:18 -0000 Author: emaste Date: Fri Aug 23 13:47:18 2013 New Revision: 254698 URL: http://svnweb.freebsd.org/changeset/base/254698 Log: Update libexecinfo man page for FreeBSD Sponsored by: DARPA, AFRL Modified: head/contrib/libexecinfo/backtrace.3 Modified: head/contrib/libexecinfo/backtrace.3 ============================================================================== --- head/contrib/libexecinfo/backtrace.3 Fri Aug 23 13:30:07 2013 (r254697) +++ head/contrib/libexecinfo/backtrace.3 Fri Aug 23 13:47:18 2013 (r254698) @@ -1,4 +1,5 @@ .\" $NetBSD: backtrace.3,v 1.4 2012/06/10 00:24:36 christos Exp $ +.\" $FreeBSD$ .\" .\" Copyright (c) 2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 26, 2012 +.Dd August 23, 2013 .Dt BACKTRACE 3 .Os .Sh NAME @@ -116,7 +117,7 @@ on failure. .Sh RETURN VALUES The .Fn backtrace -function returns the number of elements tht were filled in the backtrace. +function returns the number of elements that were filled in the backtrace. The .Fn backtrace_symbols and @@ -133,7 +134,9 @@ Diagnostic output may also be produced b The .Fn backtrace library of functions first appeared in -.Nx 7.0 . +.Nx 7.0 +and +.Fx 10.0 . .Sh BUGS .Bl -enum .It @@ -150,10 +153,9 @@ instead of .Ft size_t arguments. .It -Since -.Xr dladdr 3 -only deals with dynamic symbols, we need to find the symbols from the main -portion of the program. -For that we need to locate the executable, and we use procfs for -finding it, which is not portable. +The +.Fn backtrace_symbols +functions currently rely on +.Xr procfs 5 +to locate the executable. .El From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:47:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 82816C35; Fri, 23 Aug 2013 13:47:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 704852849; Fri, 23 Aug 2013 13:47:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDlglM066393; Fri, 23 Aug 2013 13:47:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDlgM2066392; Fri, 23 Aug 2013 13:47:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201308231347.r7NDlgM2066392@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Aug 2013 13:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254699 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:47:42 -0000 Author: jhb Date: Fri Aug 23 13:47:41 2013 New Revision: 254699 URL: http://svnweb.freebsd.org/changeset/base/254699 Log: Use tvtohz() to convert a socket buffer timeout to a tick value rather than using a home-rolled version. The home-rolled version could result in shorter-than-requested sleeps. Reported by: Vitja Makarov MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Aug 23 13:47:18 2013 (r254698) +++ head/sys/kern/uipc_socket.c Fri Aug 23 13:47:41 2013 (r254699) @@ -2699,21 +2699,16 @@ sosetopt(struct socket *so, struct socko if (error) goto bad; - /* assert(hz > 0); */ if (tv.tv_sec < 0 || tv.tv_sec > INT_MAX / hz || tv.tv_usec < 0 || tv.tv_usec >= 1000000) { error = EDOM; goto bad; } - /* assert(tick > 0); */ - /* assert(ULONG_MAX - INT_MAX >= 1000000); */ - val = (u_long)(tv.tv_sec * hz) + tv.tv_usec / tick; - if (val > INT_MAX) { + val = tvtohz(&tv); + if (val == INT_MAX) { error = EDOM; goto bad; } - if (val == 0 && tv.tv_usec != 0) - val = 1; switch (sopt->sopt_name) { case SO_SNDTIMEO: From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 13:59:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DCE75DC8; Fri, 23 Aug 2013 13:59:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C91F22965; Fri, 23 Aug 2013 13:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NDxopC072631; Fri, 23 Aug 2013 13:59:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NDxmF0072609; Fri, 23 Aug 2013 13:59:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308231359.r7NDxmF0072609@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 23 Aug 2013 13:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254700 - in head/lib/libc: net posix1e resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 13:59:51 -0000 Author: jilles Date: Fri Aug 23 13:59:47 2013 New Revision: 254700 URL: http://svnweb.freebsd.org/changeset/base/254700 Log: libc: Make various internal file descriptors from fopen() close-on-exec. Modified: head/lib/libc/net/ether_addr.c head/lib/libc/net/eui64.c head/lib/libc/net/getaddrinfo.c head/lib/libc/net/gethostbyht.c head/lib/libc/net/getnetbyht.c head/lib/libc/net/getprotoent.c head/lib/libc/net/getservent.c head/lib/libc/net/hesiod.c head/lib/libc/net/nsdispatch.c head/lib/libc/net/rcmd.c head/lib/libc/posix1e/mac.c head/lib/libc/resolv/res_init.c head/lib/libc/resolv/res_query.c Modified: head/lib/libc/net/ether_addr.c ============================================================================== --- head/lib/libc/net/ether_addr.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/ether_addr.c Fri Aug 23 13:59:47 2013 (r254700) @@ -148,7 +148,7 @@ ether_ntohost(char *hostname, const stru char *yp_domain; #endif - if ((fp = fopen(_PATH_ETHERS, "r")) == NULL) + if ((fp = fopen(_PATH_ETHERS, "re")) == NULL) return (1); while (fgets(buf,BUFSIZ,fp)) { if (buf[0] == '#') @@ -197,7 +197,7 @@ ether_hostton(const char *hostname, stru char *yp_domain; #endif - if ((fp = fopen(_PATH_ETHERS, "r")) == NULL) + if ((fp = fopen(_PATH_ETHERS, "re")) == NULL) return (1); while (fgets(buf,BUFSIZ,fp)) { if (buf[0] == '#') Modified: head/lib/libc/net/eui64.c ============================================================================== --- head/lib/libc/net/eui64.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/eui64.c Fri Aug 23 13:59:47 2013 (r254700) @@ -227,7 +227,7 @@ eui64_ntohost(char *hostname, size_t len char eui64_a[24]; char *yp_domain; #endif - if ((fp = fopen(_PATH_EUI64, "r")) == NULL) + if ((fp = fopen(_PATH_EUI64, "re")) == NULL) return (1); while (fgets(buf,BUFSIZ,fp)) { @@ -277,7 +277,7 @@ eui64_hostton(const char *hostname, stru int resultlen; char *yp_domain; #endif - if ((fp = fopen(_PATH_EUI64, "r")) == NULL) + if ((fp = fopen(_PATH_EUI64, "re")) == NULL) return (1); while (fgets(buf,BUFSIZ,fp)) { Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/getaddrinfo.c Fri Aug 23 13:59:47 2013 (r254700) @@ -2240,7 +2240,7 @@ static void _sethtent(FILE **hostf) { if (!*hostf) - *hostf = fopen(_PATH_HOSTS, "r"); + *hostf = fopen(_PATH_HOSTS, "re"); else rewind(*hostf); } @@ -2264,7 +2264,7 @@ _gethtent(FILE **hostf, const char *name const char *addr; char hostbuf[8*1024]; - if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "r"))) + if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "re"))) return (NULL); again: if (!(p = fgets(hostbuf, sizeof hostbuf, *hostf))) Modified: head/lib/libc/net/gethostbyht.c ============================================================================== --- head/lib/libc/net/gethostbyht.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/gethostbyht.c Fri Aug 23 13:59:47 2013 (r254700) @@ -72,7 +72,7 @@ void _sethosthtent(int f, struct hostent_data *hed) { if (!hed->hostf) - hed->hostf = fopen(_PATH_HOSTS, "r"); + hed->hostf = fopen(_PATH_HOSTS, "re"); else rewind(hed->hostf); hed->stayopen = f; @@ -96,7 +96,7 @@ gethostent_p(struct hostent *he, struct int af, len; char hostbuf[BUFSIZ + 1]; - if (!hed->hostf && !(hed->hostf = fopen(_PATH_HOSTS, "r"))) { + if (!hed->hostf && !(hed->hostf = fopen(_PATH_HOSTS, "re"))) { RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } Modified: head/lib/libc/net/getnetbyht.c ============================================================================== --- head/lib/libc/net/getnetbyht.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/getnetbyht.c Fri Aug 23 13:59:47 2013 (r254700) @@ -63,7 +63,7 @@ _setnethtent(int f, struct netent_data * { if (ned->netf == NULL) - ned->netf = fopen(_PATH_NETWORKS, "r"); + ned->netf = fopen(_PATH_NETWORKS, "re"); else rewind(ned->netf); ned->stayopen |= f; @@ -89,7 +89,7 @@ getnetent_p(struct netent *ne, struct ne char line[BUFSIZ + 1]; if (ned->netf == NULL && - (ned->netf = fopen(_PATH_NETWORKS, "r")) == NULL) + (ned->netf = fopen(_PATH_NETWORKS, "re")) == NULL) return (-1); again: p = fgets(line, sizeof line, ned->netf); Modified: head/lib/libc/net/getprotoent.c ============================================================================== --- head/lib/libc/net/getprotoent.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/getprotoent.c Fri Aug 23 13:59:47 2013 (r254700) @@ -342,7 +342,7 @@ void __setprotoent_p(int f, struct protoent_data *ped) { if (ped->fp == NULL) - ped->fp = fopen(_PATH_PROTOCOLS, "r"); + ped->fp = fopen(_PATH_PROTOCOLS, "re"); else rewind(ped->fp); ped->stayopen |= f; @@ -365,7 +365,7 @@ __getprotoent_p(struct protoent *pe, str char *cp, **q, *endp; long l; - if (ped->fp == NULL && (ped->fp = fopen(_PATH_PROTOCOLS, "r")) == NULL) + if (ped->fp == NULL && (ped->fp = fopen(_PATH_PROTOCOLS, "re")) == NULL) return (-1); again: if ((p = fgets(ped->line, sizeof ped->line, ped->fp)) == NULL) Modified: head/lib/libc/net/getservent.c ============================================================================== --- head/lib/libc/net/getservent.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/getservent.c Fri Aug 23 13:59:47 2013 (r254700) @@ -335,7 +335,7 @@ files_servent(void *retval, void *mdata, if (st->fp == NULL) st->compat_mode_active = 0; - if (st->fp == NULL && (st->fp = fopen(_PATH_SERVICES, "r")) == NULL) { + if (st->fp == NULL && (st->fp = fopen(_PATH_SERVICES, "re")) == NULL) { *errnop = errno; return (NS_UNAVAIL); } @@ -449,7 +449,7 @@ files_setservent(void *retval, void *mda case SETSERVENT: f = va_arg(ap,int); if (st->fp == NULL) - st->fp = fopen(_PATH_SERVICES, "r"); + st->fp = fopen(_PATH_SERVICES, "re"); else rewind(st->fp); st->stayopen |= f; Modified: head/lib/libc/net/hesiod.c ============================================================================== --- head/lib/libc/net/hesiod.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/hesiod.c Fri Aug 23 13:59:47 2013 (r254700) @@ -286,7 +286,7 @@ read_config_file(ctx, filename) ctx->classes[1] = C_HS; /* Try to open the configuration file. */ - fp = fopen(filename, "r"); + fp = fopen(filename, "re"); if (!fp) { /* Use compiled in default domain names. */ ctx->lhs = strdup(DEF_LHS); Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/nsdispatch.c Fri Aug 23 13:59:47 2013 (r254700) @@ -361,7 +361,7 @@ nss_configure(void) if (result != 0) goto fin2; } - _nsyyin = fopen(path, "r"); + _nsyyin = fopen(path, "re"); if (_nsyyin == NULL) goto fin; VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), Modified: head/lib/libc/net/rcmd.c ============================================================================== --- head/lib/libc/net/rcmd.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/net/rcmd.c Fri Aug 23 13:59:47 2013 (r254700) @@ -458,7 +458,7 @@ iruserok_sa(ra, rlen, superuser, ruser, raddr = (struct sockaddr *)&ss; first = 1; - hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r"); + hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "re"); again: if (hostf) { if (__ivaliduser_sa(hostf, raddr, rlen, luser, ruser) == 0) { @@ -481,7 +481,7 @@ again: */ uid = geteuid(); (void)seteuid(pwd->pw_uid); - hostf = fopen(pbuf, "r"); + hostf = fopen(pbuf, "re"); (void)seteuid(uid); if (hostf == NULL) Modified: head/lib/libc/posix1e/mac.c ============================================================================== --- head/lib/libc/posix1e/mac.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/posix1e/mac.c Fri Aug 23 13:59:47 2013 (r254700) @@ -179,7 +179,7 @@ mac_init_internal(int ignore_errors) filename = getenv("MAC_CONFFILE"); else filename = MAC_CONFFILE; - file = fopen(filename, "r"); + file = fopen(filename, "re"); if (file == NULL) return (0); Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/resolv/res_init.c Fri Aug 23 13:59:47 2013 (r254700) @@ -304,7 +304,7 @@ __res_vinit(res_state statp, int preinit line[sizeof(name) - 1] == '\t')) nserv = 0; - if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) { + if ((fp = fopen(_PATH_RESCONF, "re")) != NULL) { /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { /* skip comments */ Modified: head/lib/libc/resolv/res_query.c ============================================================================== --- head/lib/libc/resolv/res_query.c Fri Aug 23 13:47:41 2013 (r254699) +++ head/lib/libc/resolv/res_query.c Fri Aug 23 13:59:47 2013 (r254700) @@ -457,7 +457,7 @@ res_hostalias(const res_state statp, con if (issetugid()) return (NULL); file = getenv("HOSTALIASES"); - if (file == NULL || (fp = fopen(file, "r")) == NULL) + if (file == NULL || (fp = fopen(file, "re")) == NULL) return (NULL); setbuf(fp, NULL); buf[sizeof(buf) - 1] = '\0'; From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:03:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 36D95140; Fri, 23 Aug 2013 14:03:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2259429C0; Fri, 23 Aug 2013 14:03:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NE39UY076066; Fri, 23 Aug 2013 14:03:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NE39cM076064; Fri, 23 Aug 2013 14:03:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231403.r7NE39cM076064@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254701 - in stable/9/sys: cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 modules/dtrace/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:03:09 -0000 Author: avg Date: Fri Aug 23 14:03:08 2013 New Revision: 254701 URL: http://svnweb.freebsd.org/changeset/base/254701 Log: MFC r253772,253773,253989: dtrace disassembler: take the latest/last CDDL code from OpenSolaris Modified: stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.h stable/9/sys/cddl/dev/dtrace/i386/dis_tables.c stable/9/sys/cddl/dev/dtrace/i386/dis_tables.h stable/9/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Aug 23 13:59:47 2013 (r254700) +++ stable/9/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Aug 23 14:03:08 2013 (r254701) @@ -1,4 +1,5 @@ /* + * * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -17,21 +18,22 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +/* + * Copyright (c) 2010, Intel Corporation. + * All rights reserved. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ - -#if defined(sun) -#pragma ident "@(#)dis_tables.c 1.11 06/03/02 SMI" -#endif +/* + * $FreeBSD$ + */ #include "dis_tables.h" @@ -66,16 +68,16 @@ extern size_t strlcat(char *, const char #endif -#define TERM NULL /* used to indicate that the 'indirect' */ +#define TERM 0 /* used to indicate that the 'indirect' */ /* field terminates - no pointer. */ /* Used to decode instructions. */ typedef struct instable { - const struct instable *it_indirect; /* for decode op codes */ + struct instable *it_indirect; /* for decode op codes */ uchar_t it_adrmode; #ifdef DIS_TEXT char it_name[NCPS]; - uint_t it_suffix:1; /* mneu + "w", "l", or "d" */ + uint_t it_suffix:1; /* mnem + "w", "l", or "d" */ #endif #ifdef DIS_MEM uint_t it_size:16; @@ -106,6 +108,7 @@ enum { MO, /* memory only (no registers) */ PREF, SWAPGS, + MONITOR_MWAIT, R, RA, SEG, @@ -152,8 +155,10 @@ enum { CWD, /* so data16 can be evaluated for cwd and variants */ RET, /* single immediate 16-bit operand */ MOVZ, /* for movs and movz, with different size operands */ + CRC32, /* for crc32, with different size operands */ XADDB, /* for xaddb */ MOVSXZ, /* AMD64 mov sign extend 32 to 64 bit instruction */ + MOVBE, /* movbe instruction */ /* * MMX/SIMD addressing modes. @@ -166,6 +171,7 @@ enum { MMOS, /* Prefixable MMX/SIMD-Int mm -> mm/mem */ MMOMS, /* Prefixable MMX/SIMD-Int mm -> mem */ MMOPM, /* MMX/SIMD-Int mm/mem -> mm,imm8 */ + MMOPM_66o, /* MMX/SIMD-Int 0x66 optional mm/mem -> mm,imm8 */ MMOPRM, /* Prefixable MMX/SIMD-Int r32/mem -> mm,imm8 */ MMOSH, /* Prefixable MMX mm,imm8 */ MM, /* MMX/SIMD-Int mm/mem -> mm */ @@ -180,12 +186,19 @@ enum { XMMOM, /* Prefixable SIMD xmm -> mem */ XMMOMS, /* Prefixable SIMD mem -> xmm */ XMM, /* SIMD xmm/mem -> xmm */ + XMM_66r, /* SIMD 0x66 prefix required xmm/mem -> xmm */ + XMM_66o, /* SIMD 0x66 prefix optional xmm/mem -> xmm */ XMMXIMPL, /* SIMD xmm -> xmm (mem) */ XMM3P, /* SIMD xmm -> r32,imm8 */ + XMM3PM_66r, /* SIMD 0x66 prefix required xmm -> r32/mem,imm8 */ XMMP, /* SIMD xmm/mem w/to xmm,imm8 */ + XMMP_66o, /* SIMD 0x66 prefix optional xmm/mem w/to xmm,imm8 */ + XMMP_66r, /* SIMD 0x66 prefix required xmm/mem w/to xmm,imm8 */ XMMPRM, /* SIMD r32/mem -> xmm,imm8 */ + XMMPRM_66r, /* SIMD 0x66 prefix required r32/mem -> xmm,imm8 */ XMMS, /* SIMD xmm -> xmm/mem */ XMMM, /* SIMD mem -> xmm */ + XMMM_66r, /* SIMD 0x66 prefix required mem -> xmm */ XMMMS, /* SIMD xmm -> mem */ XMM3MX, /* SIMD r32/mem -> xmm */ XMM3MXS, /* SIMD xmm -> r32/mem */ @@ -195,10 +208,35 @@ enum { XMMXMM, /* SIMD xmm/mem -> mm */ XMMMX, /* SIMD mm -> xmm */ XMMXM, /* SIMD xmm -> mm */ + XMMX2I, /* SIMD xmm -> xmm, imm, imm */ + XMM2I, /* SIMD xmm, imm, imm */ XMMFENCE, /* SIMD lfence or mfence */ - XMMSFNC /* SIMD sfence (none or mem) */ + XMMSFNC, /* SIMD sfence (none or mem) */ + XGETBV_XSETBV, + VEX_NONE, /* VEX no operand */ + VEX_MO, /* VEX mod_rm -> implicit reg */ + VEX_RMrX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RRX, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMRX, /* VEX VEX.vvvv, mod_rm, imm8[7:4] -> mod_reg */ + VEX_MX, /* VEX mod_rm -> mod_reg */ + VEX_MXI, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_XXI, /* VEX mod_rm, imm8 -> VEX.vvvv */ + VEX_MR, /* VEX mod_rm -> mod_reg */ + VEX_RRI, /* VEX mod_reg, mod_rm -> implicit(eflags/r32) */ + VEX_RX, /* VEX mod_reg -> mod_rm */ + VEX_RR, /* VEX mod_rm -> mod_reg */ + VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_RM, /* VEX mod_reg -> mod_rm */ + VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ }; +/* + * VEX prefixes + */ +#define VEX_2bytes 0xC5 /* the first byte of two-byte form */ +#define VEX_3bytes 0xC4 /* the first byte of three-byte form */ + #define FILL 0x90 /* Fill byte used for alignment (nop) */ /* @@ -221,6 +259,7 @@ enum { #define MODE_SIGNED 2 /* sign extended immediate */ #define MODE_IMPLIED 3 /* constant value implied from opcode */ #define MODE_OFFSET 4 /* offset part of an address */ +#define MODE_RIPREL 5 /* like IPREL, but from %rip (amd64) */ /* * The letters used in these macros are: @@ -236,8 +275,8 @@ enum { */ #if defined(DIS_TEXT) && defined(DIS_MEM) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 0, 1, 0, 0, 0} @@ -254,8 +293,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_TEXT) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 1, 0, 0, 0} @@ -272,8 +311,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_MEM) -#define IND(table) {table, 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} @@ -290,8 +329,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, 0, 0, 0, 0, 0} #else -#define IND(table) {table[0], 0, 0, 0, 0, 0} -#define INDx(table) {table[0], 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 1, 0, 0} @@ -406,6 +445,11 @@ const char *const dis_XMMREG[16] = { "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" }; +const char *const dis_YMMREG[16] = { + "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7", + "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", "%ymm15" +}; + const char *const dis_SEGREG[16] = { "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", "", "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", "" @@ -418,13 +462,15 @@ const char *const dis_PREDSUFFIX[8] = { "eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord" }; - +const char *const dis_AVXvgrp7[3][8] = { + /*0 1 2 3 4 5 6 7*/ +/*71*/ {"", "", "vpsrlw", "", "vpsraw", "", "vpsllw", ""}, +/*72*/ {"", "", "vpsrld", "", "vpsrad", "", "vpslld", ""}, +/*73*/ {"", "", "vpsrlq", "vpsrldq", "", "", "vpsllq", "vpslldq"} +}; #endif /* DIS_TEXT */ - - - /* * "decode table" for 64 bit mode MOVSXD instruction (opcode 0x63) */ @@ -450,7 +496,7 @@ const instable_t dis_op0F00[8] = { */ const instable_t dis_op0F01[8] = { -/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MO,6), TNSZ("lgdt",MO,6), TNSZ("lidt",MO,6), +/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), /* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), }; @@ -468,7 +514,7 @@ const instable_t dis_op0F18[8] = { */ const instable_t dis_op0FAE[8] = { /* [0] */ TNSZ("fxsave",M,512), TNSZ("fxrstor",M,512), TNS("ldmxcsr",M), TNS("stmxcsr",M), -/* [4] */ INVALID, TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), +/* [4] */ TNSZ("xsave",M,512), TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), }; /* @@ -587,7 +633,7 @@ const instable_t dis_opSIMDdata16[256] = /* [70] */ TNSZ("pshufd",XMMP,16), INVALID, INVALID, INVALID, /* [74] */ TNSZ("pcmpeqb",XMM,16), TNSZ("pcmpeqw",XMM,16), TNSZ("pcmpeqd",XMM,16), INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("extrq",XMM2I,16), TNSZ("extrq",XMM,16), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), /* [80] */ INVALID, INVALID, INVALID, INVALID, @@ -631,6 +677,88 @@ const instable_t dis_opSIMDdata16[256] = /* [FC] */ TNSZ("paddb",XMM,16), TNSZ("paddw",XMM,16), TNSZ("paddd",XMM,16), INVALID, }; +const instable_t dis_opAVX660F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovupd",VEX_MX,16), TNSZ("vmovupd",VEX_RX,16), TNSZ("vmovlpd",VEX_RMrX,8), TNSZ("vmovlpd",VEX_RM,8), +/* [14] */ TNSZ("vunpcklpd",VEX_RMrX,16),TNSZ("vunpckhpd",VEX_RMrX,16),TNSZ("vmovhpd",VEX_RMrX,8), TNSZ("vmovhpd",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovapd",VEX_MX,16), TNSZ("vmovapd",VEX_RX,16), INVALID, TNSZ("vmovntpd",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomisd",VEX_MX,8),TNSZ("vcomisd",VEX_MX,8), + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ TNS("vmovmskpd",VEX_MR), TNSZ("vsqrtpd",VEX_MX,16), INVALID, INVALID, +/* [54] */ TNSZ("vandpd",VEX_RMrX,16), TNSZ("vandnpd",VEX_RMrX,16), TNSZ("vorpd",VEX_RMrX,16), TNSZ("vxorpd",VEX_RMrX,16), +/* [58] */ TNSZ("vaddpd",VEX_RMrX,16), TNSZ("vmulpd",VEX_RMrX,16), TNSZ("vcvtpd2ps",VEX_MX,16),TNSZ("vcvtps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubpd",VEX_RMrX,16), TNSZ("vminpd",VEX_RMrX,16), TNSZ("vdivpd",VEX_RMrX,16), TNSZ("vmaxpd",VEX_RMrX,16), + +/* [60] */ TNSZ("vpunpcklbw",VEX_RMrX,16),TNSZ("vpunpcklwd",VEX_RMrX,16),TNSZ("vpunpckldq",VEX_RMrX,16),TNSZ("vpacksswb",VEX_RMrX,16), +/* [64] */ TNSZ("vpcmpgtb",VEX_RMrX,16), TNSZ("vpcmpgtw",VEX_RMrX,16), TNSZ("vpcmpgtd",VEX_RMrX,16), TNSZ("vpackuswb",VEX_RMrX,16), +/* [68] */ TNSZ("vpunpckhbw",VEX_RMrX,16),TNSZ("vpunpckhwd",VEX_RMrX,16),TNSZ("vpunpckhdq",VEX_RMrX,16),TNSZ("vpackssdw",VEX_RMrX,16), +/* [6C] */ TNSZ("vpunpcklqdq",VEX_RMrX,16),TNSZ("vpunpckhqdq",VEX_RMrX,16),TNSZ("vmovd",VEX_MX,4),TNSZ("vmovdqa",VEX_MX,16), + +/* [70] */ TNSZ("vpshufd",VEX_MXI,16), TNSZ("vgrp71",VEX_XXI,16), TNSZ("vgrp72",VEX_XXI,16), TNSZ("vgrp73",VEX_XXI,16), +/* [74] */ TNSZ("vpcmpeqb",VEX_RMrX,16), TNSZ("vpcmpeqw",VEX_RMrX,16), TNSZ("vpcmpeqd",VEX_RMrX,16), INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddpd",VEX_RMrX,16), TNSZ("vhsubpd",VEX_RMrX,16), TNSZ("vmovd",VEX_RR,4), TNSZ("vmovdqa",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmppd",VEX_RMRX,16), INVALID, +/* [C4] */ TNSZ("vpinsrw",VEX_RMRX,2),TNS("vpextrw",VEX_MR), TNSZ("vshufpd",VEX_RMRX,16), INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubpd",VEX_RMrX,16),TNSZ("vpsrlw",VEX_RMrX,16), TNSZ("vpsrld",VEX_RMrX,16), TNSZ("vpsrlq",VEX_RMrX,16), +/* [D4] */ TNSZ("vpaddq",VEX_RMrX,16), TNSZ("vpmullw",VEX_RMrX,16), TNSZ("vmovq",VEX_RX,8), TNS("vpmovmskb",VEX_MR), +/* [D8] */ TNSZ("vpsubusb",VEX_RMrX,16), TNSZ("vpsubusw",VEX_RMrX,16), TNSZ("vpminub",VEX_RMrX,16), TNSZ("vpand",VEX_RMrX,16), +/* [DC] */ TNSZ("vpaddusb",VEX_RMrX,16), TNSZ("vpaddusw",VEX_RMrX,16), TNSZ("vpmaxub",VEX_RMrX,16), TNSZ("vpandn",VEX_RMrX,16), + +/* [E0] */ TNSZ("vpavgb",VEX_RMrX,16), TNSZ("vpsraw",VEX_RMrX,16), TNSZ("vpsrad",VEX_RMrX,16), TNSZ("vpavgw",VEX_RMrX,16), +/* [E4] */ TNSZ("vpmulhuw",VEX_RMrX,16), TNSZ("vpmulhw",VEX_RMrX,16), TNSZ("vcvttpd2dq",VEX_MX,16),TNSZ("vmovntdq",VEX_RM,16), +/* [E8] */ TNSZ("vpsubsb",VEX_RMrX,16), TNSZ("vpsubsw",VEX_RMrX,16), TNSZ("vpminsw",VEX_RMrX,16), TNSZ("vpor",VEX_RMrX,16), +/* [EC] */ TNSZ("vpaddsb",VEX_RMrX,16), TNSZ("vpaddsw",VEX_RMrX,16), TNSZ("vpmaxsw",VEX_RMrX,16), TNSZ("vpxor",VEX_RMrX,16), + +/* [F0] */ INVALID, TNSZ("vpsllw",VEX_RMrX,16), TNSZ("vpslld",VEX_RMrX,16), TNSZ("vpsllq",VEX_RMrX,16), +/* [F4] */ TNSZ("vpmuludq",VEX_RMrX,16), TNSZ("vpmaddwd",VEX_RMrX,16), TNSZ("vpsadbw",VEX_RMrX,16), TNS("vmaskmovdqu",VEX_MX), +/* [F8] */ TNSZ("vpsubb",VEX_RMrX,16), TNSZ("vpsubw",VEX_RMrX,16), TNSZ("vpsubd",VEX_RMrX,16), TNSZ("vpsubq",VEX_RMrX,16), +/* [FC] */ TNSZ("vpaddb",VEX_RMrX,16), TNSZ("vpaddw",VEX_RMrX,16), TNSZ("vpaddd",VEX_RMrX,16), INVALID, +}; + /* * Decode table for SIMD instructions with the repnz (0xf2) prefix. */ @@ -645,32 +773,538 @@ const instable_t dis_opSIMDrepnz[256] = /* [18] */ INVALID, INVALID, INVALID, INVALID, /* [1C] */ INVALID, INVALID, INVALID, INVALID, -/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),TNSZ("movntsd",XMMMS,8), +/* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("sqrtsd",XMM,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("addsd",XMM,8), TNSZ("mulsd",XMM,8), TNSZ("cvtsd2ss",XMM,8), INVALID, +/* [5C] */ TNSZ("subsd",XMM,8), TNSZ("minsd",XMM,8), TNSZ("divsd",XMM,8), TNSZ("maxsd",XMM,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("cmpsd",XMMP,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, TNS("movdq2q",XMMXM), INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("cvtpd2dq",XMM,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF20F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovsd",VEX_RMrX,8), TNSZ("vmovsd",VEX_RRX,8), TNSZ("vmovddup",VEX_MX,8), INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2sd",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttsd2si",VEX_MR,8),TNSZ("vcvtsd2si",VEX_MR,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtsd",VEX_RMrX,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddsd",VEX_RMrX,8), TNSZ("vmulsd",VEX_RMrX,8), TNSZ("vcvtsd2ss",VEX_RMrX,8), INVALID, +/* [5C] */ TNSZ("vsubsd",VEX_RMrX,8), TNSZ("vminsd",VEX_RMrX,8), TNSZ("vdivsd",VEX_RMrX,8), TNSZ("vmaxsd",VEX_RMrX,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("vpshuflw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddps",VEX_RMrX,8), TNSZ("vhsubps",VEX_RMrX,8), INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpsd",VEX_RMRX,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubps",VEX_RMrX,8), INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtpd2dq",VEX_MX,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ TNSZ("vlddqu",VEX_MX,16), INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +/* + * Decode table for SIMD instructions with the repz (0xf3) prefix. + */ +const instable_t dis_opSIMDrepz[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),TNSZ("movntss",XMMMS,4), +/* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("sqrtss",XMM,4), TNSZ("rsqrtss",XMM,4), TNSZ("rcpss",XMM,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("addss",XMM,4), TNSZ("mulss",XMM,4), TNSZ("cvtss2sd",XMM,4), TNSZ("cvttps2dq",XMM,16), +/* [5C] */ TNSZ("subss",XMM,4), TNSZ("minss",XMM,4), TNSZ("divss",XMM,4), TNSZ("maxss",XMM,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("movdqu",XMM,16), + +/* [70] */ TNSZ("pshufhw",XMMP,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("movq",XMM,8), TNSZ("movdqu",XMMS,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ TS("popcnt",MRw), INVALID, INVALID, INVALID, +/* [BC] */ INVALID, TS("lzcnt",MRw), INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("cmpss",XMMP,4), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, TNS("movq2dq",XMMMX), INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("cvtdq2pd",XMM,8), INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF30F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovss",VEX_RMrX,4), TNSZ("vmovss",VEX_RRX,4), TNSZ("vmovsldup",VEX_MX,4), INVALID, +/* [14] */ INVALID, INVALID, TNSZ("vmovshdup",VEX_MX,4), INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2ss",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttss2si",VEX_MR,4),TNSZ("vcvtss2si",VEX_MR,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtss",VEX_RMrX,4), TNSZ("vrsqrtss",VEX_RMrX,4), TNSZ("vrcpss",VEX_RMrX,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddss",VEX_RMrX,4), TNSZ("vmulss",VEX_RMrX,4), TNSZ("vcvtss2sd",VEX_RMrX,4), TNSZ("vcvttps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubss",VEX_RMrX,4), TNSZ("vminss",VEX_RMrX,4), TNSZ("vdivss",VEX_RMrX,4), TNSZ("vmaxss",VEX_RMrX,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("vmovdqu",VEX_MX,16), + +/* [70] */ TNSZ("vpshufhw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("vmovq",VEX_MX,8), TNSZ("vmovdqu",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpss",VEX_RMRX,4), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtdq2pd",VEX_MX,8), INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; +/* + * The following two tables are used to encode crc32 and movbe + * since they share the same opcodes. + */ +const instable_t dis_op0F38F0[2] = { +/* [00] */ TNS("crc32b",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38F1[2] = { +/* [00] */ TS("crc32",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38[256] = { +/* [00] */ TNSZ("pshufb",XMM_66o,16),TNSZ("phaddw",XMM_66o,16),TNSZ("phaddd",XMM_66o,16),TNSZ("phaddsw",XMM_66o,16), +/* [04] */ TNSZ("pmaddubsw",XMM_66o,16),TNSZ("phsubw",XMM_66o,16), TNSZ("phsubd",XMM_66o,16),TNSZ("phsubsw",XMM_66o,16), +/* [08] */ TNSZ("psignb",XMM_66o,16),TNSZ("psignw",XMM_66o,16),TNSZ("psignd",XMM_66o,16),TNSZ("pmulhrsw",XMM_66o,16), +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("pblendvb",XMM_66r,16),INVALID, INVALID, INVALID, +/* [14] */ TNSZ("blendvps",XMM_66r,16),TNSZ("blendvpd",XMM_66r,16),INVALID, TNSZ("ptest",XMM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ TNSZ("pabsb",XMM_66o,16),TNSZ("pabsw",XMM_66o,16),TNSZ("pabsd",XMM_66o,16),INVALID, + +/* [20] */ TNSZ("pmovsxbw",XMM_66r,16),TNSZ("pmovsxbd",XMM_66r,16),TNSZ("pmovsxbq",XMM_66r,16),TNSZ("pmovsxwd",XMM_66r,16), +/* [24] */ TNSZ("pmovsxwq",XMM_66r,16),TNSZ("pmovsxdq",XMM_66r,16),INVALID, INVALID, +/* [28] */ TNSZ("pmuldq",XMM_66r,16),TNSZ("pcmpeqq",XMM_66r,16),TNSZ("movntdqa",XMMM_66r,16),TNSZ("packusdw",XMM_66r,16), +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ TNSZ("pmovzxbw",XMM_66r,16),TNSZ("pmovzxbd",XMM_66r,16),TNSZ("pmovzxbq",XMM_66r,16),TNSZ("pmovzxwd",XMM_66r,16), +/* [34] */ TNSZ("pmovzxwq",XMM_66r,16),TNSZ("pmovzxdq",XMM_66r,16),INVALID, TNSZ("pcmpgtq",XMM_66r,16), +/* [38] */ TNSZ("pminsb",XMM_66r,16),TNSZ("pminsd",XMM_66r,16),TNSZ("pminuw",XMM_66r,16),TNSZ("pminud",XMM_66r,16), +/* [3C] */ TNSZ("pmaxsb",XMM_66r,16),TNSZ("pmaxsd",XMM_66r,16),TNSZ("pmaxuw",XMM_66r,16),TNSZ("pmaxud",XMM_66r,16), + +/* [40] */ TNSZ("pmulld",XMM_66r,16),TNSZ("phminposuw",XMM_66r,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("aesimc",XMM_66r,16), +/* [DC] */ TNSZ("aesenc",XMM_66r,16),TNSZ("aesenclast",XMM_66r,16),TNSZ("aesdec",XMM_66r,16),TNSZ("aesdeclast",XMM_66r,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVX660F38[256] = { +/* [00] */ TNSZ("vpshufb",VEX_RMrX,16),TNSZ("vphaddw",VEX_RMrX,16),TNSZ("vphaddd",VEX_RMrX,16),TNSZ("vphaddsw",VEX_RMrX,16), +/* [04] */ TNSZ("vpmaddubsw",VEX_RMrX,16),TNSZ("vphsubw",VEX_RMrX,16), TNSZ("vphsubd",VEX_RMrX,16),TNSZ("vphsubsw",VEX_RMrX,16), +/* [08] */ TNSZ("vpsignb",VEX_RMrX,16),TNSZ("vpsignw",VEX_RMrX,16),TNSZ("vpsignd",VEX_RMrX,16),TNSZ("vpmulhrsw",VEX_RMrX,16), +/* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), +/* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, +/* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, + +/* [20] */ TNSZ("vpmovsxbw",VEX_MX,16),TNSZ("vpmovsxbd",VEX_MX,16),TNSZ("vpmovsxbq",VEX_MX,16),TNSZ("vpmovsxwd",VEX_MX,16), +/* [24] */ TNSZ("vpmovsxwq",VEX_MX,16),TNSZ("vpmovsxdq",VEX_MX,16),INVALID, INVALID, +/* [28] */ TNSZ("vpmuldq",VEX_RMrX,16),TNSZ("vpcmpeqq",VEX_RMrX,16),TNSZ("vmovntdqa",VEX_MX,16),TNSZ("vpackusdw",VEX_RMrX,16), +/* [2C] */ TNSZ("vmaskmovps",VEX_RMrX,8),TNSZ("vmaskmovpd",VEX_RMrX,16),TNSZ("vmaskmovps",VEX_RRM,8),TNSZ("vmaskmovpd",VEX_RRM,16), + +/* [30] */ TNSZ("vpmovzxbw",VEX_MX,16),TNSZ("vpmovzxbd",VEX_MX,16),TNSZ("vpmovzxbq",VEX_MX,16),TNSZ("vpmovzxwd",VEX_MX,16), +/* [34] */ TNSZ("vpmovzxwq",VEX_MX,16),TNSZ("vpmovzxdq",VEX_MX,16),INVALID, TNSZ("vpcmpgtq",VEX_RMrX,16), +/* [38] */ TNSZ("vpminsb",VEX_RMrX,16),TNSZ("vpminsd",VEX_RMrX,16),TNSZ("vpminuw",VEX_RMrX,16),TNSZ("vpminud",VEX_RMrX,16), +/* [3C] */ TNSZ("vpmaxsb",VEX_RMrX,16),TNSZ("vpmaxsd",VEX_RMrX,16),TNSZ("vpmaxuw",VEX_RMrX,16),TNSZ("vpmaxud",VEX_RMrX,16), + +/* [40] */ TNSZ("vpmulld",VEX_RMrX,16),TNSZ("vphminposuw",VEX_MX,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("vaesimc",VEX_MX,16), +/* [DC] */ TNSZ("vaesenc",VEX_RMrX,16),TNSZ("vaesenclast",VEX_RMrX,16),TNSZ("vaesdec",VEX_RMrX,16),TNSZ("vaesdeclast",VEX_RMrX,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_op0F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ TNSZ("roundps",XMMP_66r,16),TNSZ("roundpd",XMMP_66r,16),TNSZ("roundss",XMMP_66r,16),TNSZ("roundsd",XMMP_66r,16), +/* [0C] */ TNSZ("blendps",XMMP_66r,16),TNSZ("blendpd",XMMP_66r,16),TNSZ("pblendw",XMMP_66r,16),TNSZ("palignr",XMMP_66o,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("pextrb",XMM3PM_66r,8),TNSZ("pextrw",XMM3PM_66r,16),TSZ("pextr",XMM3PM_66r,16),TNSZ("extractps",XMM3PM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ TNSZ("pinsrb",XMMPRM_66r,8),TNSZ("insertps",XMMP_66r,16),TSZ("pinsr",XMMPRM_66r,16),INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),INVALID, -/* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, /* [34] */ INVALID, INVALID, INVALID, INVALID, /* [38] */ INVALID, INVALID, INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, -/* [40] */ INVALID, INVALID, INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [40] */ TNSZ("dpps",XMMP_66r,16),TNSZ("dppd",XMMP_66r,16),TNSZ("mpsadbw",XMMP_66r,16),INVALID, +/* [44] */ TNSZ("pclmulqdq",XMMP_66r,16),INVALID, INVALID, INVALID, /* [48] */ INVALID, INVALID, INVALID, INVALID, /* [4C] */ INVALID, INVALID, INVALID, INVALID, -/* [50] */ INVALID, TNSZ("sqrtsd",XMM,8), INVALID, INVALID, +/* [50] */ INVALID, INVALID, INVALID, INVALID, /* [54] */ INVALID, INVALID, INVALID, INVALID, -/* [58] */ TNSZ("addsd",XMM,8), TNSZ("mulsd",XMM,8), TNSZ("cvtsd2ss",XMM,8), INVALID, -/* [5C] */ TNSZ("subsd",XMM,8), TNSZ("minsd",XMM,8), TNSZ("divsd",XMM,8), TNSZ("maxsd",XMM,8), +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, -/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [60] */ TNSZ("pcmpestrm",XMMP_66r,16),TNSZ("pcmpestri",XMMP_66r,16),TNSZ("pcmpistrm",XMMP_66r,16),TNSZ("pcmpistri",XMMP_66r,16), /* [64] */ INVALID, INVALID, INVALID, INVALID, /* [68] */ INVALID, INVALID, INVALID, INVALID, /* [6C] */ INVALID, INVALID, INVALID, INVALID, -/* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, +/* [70] */ INVALID, INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, @@ -678,7 +1312,7 @@ const instable_t dis_opSIMDrepnz[256] = /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, -/* [0C] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, /* [90] */ INVALID, INVALID, INVALID, INVALID, /* [94] */ INVALID, INVALID, INVALID, INVALID, @@ -695,18 +1329,18 @@ const instable_t dis_opSIMDrepnz[256] = /* [B8] */ INVALID, INVALID, INVALID, INVALID, /* [BC] */ INVALID, INVALID, INVALID, INVALID, -/* [C0] */ INVALID, INVALID, TNSZ("cmpsd",XMMP,8), INVALID, +/* [C0] */ INVALID, INVALID, INVALID, INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, /* [C8] */ INVALID, INVALID, INVALID, INVALID, /* [CC] */ INVALID, INVALID, INVALID, INVALID, /* [D0] */ INVALID, INVALID, INVALID, INVALID, -/* [D4] */ INVALID, INVALID, TNS("movdq2q",XMMXM), INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, /* [D8] */ INVALID, INVALID, INVALID, INVALID, -/* [DC] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, TNSZ("aeskeygenassist",XMMP_66r,16), /* [E0] */ INVALID, INVALID, INVALID, INVALID, -/* [E4] */ INVALID, INVALID, TNSZ("cvtpd2dq",XMM,16),INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, /* [E8] */ INVALID, INVALID, INVALID, INVALID, /* [EC] */ INVALID, INVALID, INVALID, INVALID, @@ -716,54 +1350,51 @@ const instable_t dis_opSIMDrepnz[256] = /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; -/* - * Decode table for SIMD instructions with the repz (0xf3) prefix. - */ -const instable_t dis_opSIMDrepz[256] = { +const instable_t dis_opAVX660F3A[256] = { /* [00] */ INVALID, INVALID, INVALID, INVALID, -/* [04] */ INVALID, INVALID, INVALID, INVALID, -/* [08] */ INVALID, INVALID, INVALID, INVALID, -/* [0C] */ INVALID, INVALID, INVALID, INVALID, - -/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), INVALID, INVALID, -/* [14] */ INVALID, INVALID, INVALID, INVALID, -/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ TNSZ("vpermilps",VEX_MXI,8),TNSZ("vpermilpd",VEX_MXI,16),TNSZ("vperm2f128",VEX_RMRX,16),INVALID, +/* [08] */ TNSZ("vroundps",VEX_MXI,16),TNSZ("vroundpd",VEX_MXI,16),TNSZ("vroundss",VEX_RMRX,16),TNSZ("vroundsd",VEX_RMRX,16), +/* [0C] */ TNSZ("vblendps",VEX_RMRX,16),TNSZ("vblendpd",VEX_RMRX,16),TNSZ("vpblendw",VEX_RMRX,16),TNSZ("vpalignr",VEX_RMRX,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("vpextrb",VEX_RRi,8),TNSZ("vpextrw",VEX_RRi,16),TNSZ("vpextrd",VEX_RRi,16),TNSZ("vextractps",VEX_RM,16), +/* [18] */ TNSZ("vinsertf128",VEX_RMRX,16),TNSZ("vextractf128",VEX_RX,16),INVALID, INVALID, /* [1C] */ INVALID, INVALID, INVALID, INVALID, -/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [20] */ TNSZ("vpinsrb",VEX_RMRX,8),TNSZ("vinsertps",VEX_RMRX,16),TNSZ("vpinsrd",VEX_RMRX,16),INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),INVALID, -/* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, /* [34] */ INVALID, INVALID, INVALID, INVALID, /* [38] */ INVALID, INVALID, INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, -/* [40] */ INVALID, INVALID, INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, -/* [48] */ INVALID, INVALID, INVALID, INVALID, -/* [4C] */ INVALID, INVALID, INVALID, INVALID, +/* [40] */ TNSZ("vdpps",VEX_RMRX,16),TNSZ("vdppd",VEX_RMRX,16),TNSZ("vmpsadbw",VEX_RMRX,16),INVALID, +/* [44] */ TNSZ("vpclmulqdq",VEX_RMRX,16),INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, TNSZ("vblendvps",VEX_RMRX,8), TNSZ("vblendvpd",VEX_RMRX,16), +/* [4C] */ TNSZ("vpblendvb",VEX_RMRX,16),INVALID, INVALID, INVALID, -/* [50] */ INVALID, TNSZ("sqrtss",XMM,4), TNSZ("rsqrtss",XMM,4), TNSZ("rcpss",XMM,4), +/* [50] */ INVALID, INVALID, INVALID, INVALID, /* [54] */ INVALID, INVALID, INVALID, INVALID, -/* [58] */ TNSZ("addss",XMM,4), TNSZ("mulss",XMM,4), TNSZ("cvtss2sd",XMM,4), TNSZ("cvttps2dq",XMM,16), -/* [5C] */ TNSZ("subss",XMM,4), TNSZ("minss",XMM,4), TNSZ("divss",XMM,4), TNSZ("maxss",XMM,4), +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, -/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [60] */ TNSZ("vpcmpestrm",VEX_MXI,16),TNSZ("vpcmpestri",VEX_MXI,16),TNSZ("vpcmpistrm",VEX_MXI,16),TNSZ("vpcmpistri",VEX_MXI,16), /* [64] */ INVALID, INVALID, INVALID, INVALID, /* [68] */ INVALID, INVALID, INVALID, INVALID, -/* [6C] */ INVALID, INVALID, INVALID, TNSZ("movdqu",XMM,16), +/* [6C] */ INVALID, INVALID, INVALID, INVALID, -/* [70] */ TNSZ("pshufhw",XMMP,16),INVALID, INVALID, INVALID, +/* [70] */ INVALID, INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, /* [78] */ INVALID, INVALID, INVALID, INVALID, -/* [7C] */ INVALID, INVALID, TNSZ("movq",XMM,8), TNSZ("movdqu",XMMS,16), +/* [7C] */ INVALID, INVALID, INVALID, INVALID, /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, -/* [0C] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:03:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 61B92291; Fri, 23 Aug 2013 14:03:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D95B29D4; Fri, 23 Aug 2013 14:03:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NE3n2u076201; Fri, 23 Aug 2013 14:03:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NE3nh1076199; Fri, 23 Aug 2013 14:03:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231403.r7NE3nh1076199@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254702 - in stable/8/sys: cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 modules/dtrace/dtrace X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:03:49 -0000 Author: avg Date: Fri Aug 23 14:03:48 2013 New Revision: 254702 URL: http://svnweb.freebsd.org/changeset/base/254702 Log: MFC r253772,253773,253989: dtrace disassembler: take the latest/last CDDL code from OpenSolaris Modified: stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.h stable/8/sys/cddl/dev/dtrace/i386/dis_tables.c stable/8/sys/cddl/dev/dtrace/i386/dis_tables.h stable/8/sys/modules/dtrace/dtrace/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Aug 23 14:03:08 2013 (r254701) +++ stable/8/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Aug 23 14:03:48 2013 (r254702) @@ -1,4 +1,5 @@ /* + * * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -17,21 +18,22 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * $FreeBSD$ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +/* + * Copyright (c) 2010, Intel Corporation. + * All rights reserved. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ - -#if defined(sun) -#pragma ident "@(#)dis_tables.c 1.11 06/03/02 SMI" -#endif +/* + * $FreeBSD$ + */ #include "dis_tables.h" @@ -66,16 +68,16 @@ extern size_t strlcat(char *, const char #endif -#define TERM NULL /* used to indicate that the 'indirect' */ +#define TERM 0 /* used to indicate that the 'indirect' */ /* field terminates - no pointer. */ /* Used to decode instructions. */ typedef struct instable { - const struct instable *it_indirect; /* for decode op codes */ + struct instable *it_indirect; /* for decode op codes */ uchar_t it_adrmode; #ifdef DIS_TEXT char it_name[NCPS]; - uint_t it_suffix:1; /* mneu + "w", "l", or "d" */ + uint_t it_suffix:1; /* mnem + "w", "l", or "d" */ #endif #ifdef DIS_MEM uint_t it_size:16; @@ -106,6 +108,7 @@ enum { MO, /* memory only (no registers) */ PREF, SWAPGS, + MONITOR_MWAIT, R, RA, SEG, @@ -152,8 +155,10 @@ enum { CWD, /* so data16 can be evaluated for cwd and variants */ RET, /* single immediate 16-bit operand */ MOVZ, /* for movs and movz, with different size operands */ + CRC32, /* for crc32, with different size operands */ XADDB, /* for xaddb */ MOVSXZ, /* AMD64 mov sign extend 32 to 64 bit instruction */ + MOVBE, /* movbe instruction */ /* * MMX/SIMD addressing modes. @@ -166,6 +171,7 @@ enum { MMOS, /* Prefixable MMX/SIMD-Int mm -> mm/mem */ MMOMS, /* Prefixable MMX/SIMD-Int mm -> mem */ MMOPM, /* MMX/SIMD-Int mm/mem -> mm,imm8 */ + MMOPM_66o, /* MMX/SIMD-Int 0x66 optional mm/mem -> mm,imm8 */ MMOPRM, /* Prefixable MMX/SIMD-Int r32/mem -> mm,imm8 */ MMOSH, /* Prefixable MMX mm,imm8 */ MM, /* MMX/SIMD-Int mm/mem -> mm */ @@ -180,12 +186,19 @@ enum { XMMOM, /* Prefixable SIMD xmm -> mem */ XMMOMS, /* Prefixable SIMD mem -> xmm */ XMM, /* SIMD xmm/mem -> xmm */ + XMM_66r, /* SIMD 0x66 prefix required xmm/mem -> xmm */ + XMM_66o, /* SIMD 0x66 prefix optional xmm/mem -> xmm */ XMMXIMPL, /* SIMD xmm -> xmm (mem) */ XMM3P, /* SIMD xmm -> r32,imm8 */ + XMM3PM_66r, /* SIMD 0x66 prefix required xmm -> r32/mem,imm8 */ XMMP, /* SIMD xmm/mem w/to xmm,imm8 */ + XMMP_66o, /* SIMD 0x66 prefix optional xmm/mem w/to xmm,imm8 */ + XMMP_66r, /* SIMD 0x66 prefix required xmm/mem w/to xmm,imm8 */ XMMPRM, /* SIMD r32/mem -> xmm,imm8 */ + XMMPRM_66r, /* SIMD 0x66 prefix required r32/mem -> xmm,imm8 */ XMMS, /* SIMD xmm -> xmm/mem */ XMMM, /* SIMD mem -> xmm */ + XMMM_66r, /* SIMD 0x66 prefix required mem -> xmm */ XMMMS, /* SIMD xmm -> mem */ XMM3MX, /* SIMD r32/mem -> xmm */ XMM3MXS, /* SIMD xmm -> r32/mem */ @@ -195,10 +208,35 @@ enum { XMMXMM, /* SIMD xmm/mem -> mm */ XMMMX, /* SIMD mm -> xmm */ XMMXM, /* SIMD xmm -> mm */ + XMMX2I, /* SIMD xmm -> xmm, imm, imm */ + XMM2I, /* SIMD xmm, imm, imm */ XMMFENCE, /* SIMD lfence or mfence */ - XMMSFNC /* SIMD sfence (none or mem) */ + XMMSFNC, /* SIMD sfence (none or mem) */ + XGETBV_XSETBV, + VEX_NONE, /* VEX no operand */ + VEX_MO, /* VEX mod_rm -> implicit reg */ + VEX_RMrX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RRX, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMRX, /* VEX VEX.vvvv, mod_rm, imm8[7:4] -> mod_reg */ + VEX_MX, /* VEX mod_rm -> mod_reg */ + VEX_MXI, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_XXI, /* VEX mod_rm, imm8 -> VEX.vvvv */ + VEX_MR, /* VEX mod_rm -> mod_reg */ + VEX_RRI, /* VEX mod_reg, mod_rm -> implicit(eflags/r32) */ + VEX_RX, /* VEX mod_reg -> mod_rm */ + VEX_RR, /* VEX mod_rm -> mod_reg */ + VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_RM, /* VEX mod_reg -> mod_rm */ + VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ }; +/* + * VEX prefixes + */ +#define VEX_2bytes 0xC5 /* the first byte of two-byte form */ +#define VEX_3bytes 0xC4 /* the first byte of three-byte form */ + #define FILL 0x90 /* Fill byte used for alignment (nop) */ /* @@ -221,6 +259,7 @@ enum { #define MODE_SIGNED 2 /* sign extended immediate */ #define MODE_IMPLIED 3 /* constant value implied from opcode */ #define MODE_OFFSET 4 /* offset part of an address */ +#define MODE_RIPREL 5 /* like IPREL, but from %rip (amd64) */ /* * The letters used in these macros are: @@ -236,8 +275,8 @@ enum { */ #if defined(DIS_TEXT) && defined(DIS_MEM) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 0, 1, 0, 0, 0} @@ -254,8 +293,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_TEXT) -#define IND(table) {table, 0, "", 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, "", 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0} #define TNSx(name, amode) {TERM, amode, name, 0, 1, 0, 0, 0} @@ -272,8 +311,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, name, 1, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} #elif defined(DIS_MEM) -#define IND(table) {table, 0, 0, 0, 0, 0, 0} -#define INDx(table) {table, 0, 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} @@ -290,8 +329,8 @@ enum { #define TSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} #define INVALID {TERM, UNKNOWN, 0, 0, 0, 0, 0} #else -#define IND(table) {table[0], 0, 0, 0, 0, 0} -#define INDx(table) {table[0], 0, 1, 0, 0, 0} +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 1, 0, 0, 0} #define TNS(name, amode) {TERM, amode, 0, 0, 0, 0} #define TNSu(name, amode) {TERM, amode, 0, 0, 1, 0} #define TNSy(name, amode) {TERM, amode, 0, 1, 0, 0} @@ -406,6 +445,11 @@ const char *const dis_XMMREG[16] = { "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" }; +const char *const dis_YMMREG[16] = { + "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7", + "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", "%ymm15" +}; + const char *const dis_SEGREG[16] = { "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", "", "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", "" @@ -418,13 +462,15 @@ const char *const dis_PREDSUFFIX[8] = { "eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord" }; - +const char *const dis_AVXvgrp7[3][8] = { + /*0 1 2 3 4 5 6 7*/ +/*71*/ {"", "", "vpsrlw", "", "vpsraw", "", "vpsllw", ""}, +/*72*/ {"", "", "vpsrld", "", "vpsrad", "", "vpslld", ""}, +/*73*/ {"", "", "vpsrlq", "vpsrldq", "", "", "vpsllq", "vpslldq"} +}; #endif /* DIS_TEXT */ - - - /* * "decode table" for 64 bit mode MOVSXD instruction (opcode 0x63) */ @@ -450,7 +496,7 @@ const instable_t dis_op0F00[8] = { */ const instable_t dis_op0F01[8] = { -/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MO,6), TNSZ("lgdt",MO,6), TNSZ("lidt",MO,6), +/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), /* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), }; @@ -468,7 +514,7 @@ const instable_t dis_op0F18[8] = { */ const instable_t dis_op0FAE[8] = { /* [0] */ TNSZ("fxsave",M,512), TNSZ("fxrstor",M,512), TNS("ldmxcsr",M), TNS("stmxcsr",M), -/* [4] */ INVALID, TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), +/* [4] */ TNSZ("xsave",M,512), TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), }; /* @@ -587,7 +633,7 @@ const instable_t dis_opSIMDdata16[256] = /* [70] */ TNSZ("pshufd",XMMP,16), INVALID, INVALID, INVALID, /* [74] */ TNSZ("pcmpeqb",XMM,16), TNSZ("pcmpeqw",XMM,16), TNSZ("pcmpeqd",XMM,16), INVALID, -/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("extrq",XMM2I,16), TNSZ("extrq",XMM,16), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), /* [80] */ INVALID, INVALID, INVALID, INVALID, @@ -631,6 +677,88 @@ const instable_t dis_opSIMDdata16[256] = /* [FC] */ TNSZ("paddb",XMM,16), TNSZ("paddw",XMM,16), TNSZ("paddd",XMM,16), INVALID, }; +const instable_t dis_opAVX660F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovupd",VEX_MX,16), TNSZ("vmovupd",VEX_RX,16), TNSZ("vmovlpd",VEX_RMrX,8), TNSZ("vmovlpd",VEX_RM,8), +/* [14] */ TNSZ("vunpcklpd",VEX_RMrX,16),TNSZ("vunpckhpd",VEX_RMrX,16),TNSZ("vmovhpd",VEX_RMrX,8), TNSZ("vmovhpd",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovapd",VEX_MX,16), TNSZ("vmovapd",VEX_RX,16), INVALID, TNSZ("vmovntpd",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomisd",VEX_MX,8),TNSZ("vcomisd",VEX_MX,8), + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ TNS("vmovmskpd",VEX_MR), TNSZ("vsqrtpd",VEX_MX,16), INVALID, INVALID, +/* [54] */ TNSZ("vandpd",VEX_RMrX,16), TNSZ("vandnpd",VEX_RMrX,16), TNSZ("vorpd",VEX_RMrX,16), TNSZ("vxorpd",VEX_RMrX,16), +/* [58] */ TNSZ("vaddpd",VEX_RMrX,16), TNSZ("vmulpd",VEX_RMrX,16), TNSZ("vcvtpd2ps",VEX_MX,16),TNSZ("vcvtps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubpd",VEX_RMrX,16), TNSZ("vminpd",VEX_RMrX,16), TNSZ("vdivpd",VEX_RMrX,16), TNSZ("vmaxpd",VEX_RMrX,16), + +/* [60] */ TNSZ("vpunpcklbw",VEX_RMrX,16),TNSZ("vpunpcklwd",VEX_RMrX,16),TNSZ("vpunpckldq",VEX_RMrX,16),TNSZ("vpacksswb",VEX_RMrX,16), +/* [64] */ TNSZ("vpcmpgtb",VEX_RMrX,16), TNSZ("vpcmpgtw",VEX_RMrX,16), TNSZ("vpcmpgtd",VEX_RMrX,16), TNSZ("vpackuswb",VEX_RMrX,16), +/* [68] */ TNSZ("vpunpckhbw",VEX_RMrX,16),TNSZ("vpunpckhwd",VEX_RMrX,16),TNSZ("vpunpckhdq",VEX_RMrX,16),TNSZ("vpackssdw",VEX_RMrX,16), +/* [6C] */ TNSZ("vpunpcklqdq",VEX_RMrX,16),TNSZ("vpunpckhqdq",VEX_RMrX,16),TNSZ("vmovd",VEX_MX,4),TNSZ("vmovdqa",VEX_MX,16), + +/* [70] */ TNSZ("vpshufd",VEX_MXI,16), TNSZ("vgrp71",VEX_XXI,16), TNSZ("vgrp72",VEX_XXI,16), TNSZ("vgrp73",VEX_XXI,16), +/* [74] */ TNSZ("vpcmpeqb",VEX_RMrX,16), TNSZ("vpcmpeqw",VEX_RMrX,16), TNSZ("vpcmpeqd",VEX_RMrX,16), INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddpd",VEX_RMrX,16), TNSZ("vhsubpd",VEX_RMrX,16), TNSZ("vmovd",VEX_RR,4), TNSZ("vmovdqa",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmppd",VEX_RMRX,16), INVALID, +/* [C4] */ TNSZ("vpinsrw",VEX_RMRX,2),TNS("vpextrw",VEX_MR), TNSZ("vshufpd",VEX_RMRX,16), INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubpd",VEX_RMrX,16),TNSZ("vpsrlw",VEX_RMrX,16), TNSZ("vpsrld",VEX_RMrX,16), TNSZ("vpsrlq",VEX_RMrX,16), +/* [D4] */ TNSZ("vpaddq",VEX_RMrX,16), TNSZ("vpmullw",VEX_RMrX,16), TNSZ("vmovq",VEX_RX,8), TNS("vpmovmskb",VEX_MR), +/* [D8] */ TNSZ("vpsubusb",VEX_RMrX,16), TNSZ("vpsubusw",VEX_RMrX,16), TNSZ("vpminub",VEX_RMrX,16), TNSZ("vpand",VEX_RMrX,16), +/* [DC] */ TNSZ("vpaddusb",VEX_RMrX,16), TNSZ("vpaddusw",VEX_RMrX,16), TNSZ("vpmaxub",VEX_RMrX,16), TNSZ("vpandn",VEX_RMrX,16), + +/* [E0] */ TNSZ("vpavgb",VEX_RMrX,16), TNSZ("vpsraw",VEX_RMrX,16), TNSZ("vpsrad",VEX_RMrX,16), TNSZ("vpavgw",VEX_RMrX,16), +/* [E4] */ TNSZ("vpmulhuw",VEX_RMrX,16), TNSZ("vpmulhw",VEX_RMrX,16), TNSZ("vcvttpd2dq",VEX_MX,16),TNSZ("vmovntdq",VEX_RM,16), +/* [E8] */ TNSZ("vpsubsb",VEX_RMrX,16), TNSZ("vpsubsw",VEX_RMrX,16), TNSZ("vpminsw",VEX_RMrX,16), TNSZ("vpor",VEX_RMrX,16), +/* [EC] */ TNSZ("vpaddsb",VEX_RMrX,16), TNSZ("vpaddsw",VEX_RMrX,16), TNSZ("vpmaxsw",VEX_RMrX,16), TNSZ("vpxor",VEX_RMrX,16), + +/* [F0] */ INVALID, TNSZ("vpsllw",VEX_RMrX,16), TNSZ("vpslld",VEX_RMrX,16), TNSZ("vpsllq",VEX_RMrX,16), +/* [F4] */ TNSZ("vpmuludq",VEX_RMrX,16), TNSZ("vpmaddwd",VEX_RMrX,16), TNSZ("vpsadbw",VEX_RMrX,16), TNS("vmaskmovdqu",VEX_MX), +/* [F8] */ TNSZ("vpsubb",VEX_RMrX,16), TNSZ("vpsubw",VEX_RMrX,16), TNSZ("vpsubd",VEX_RMrX,16), TNSZ("vpsubq",VEX_RMrX,16), +/* [FC] */ TNSZ("vpaddb",VEX_RMrX,16), TNSZ("vpaddw",VEX_RMrX,16), TNSZ("vpaddd",VEX_RMrX,16), INVALID, +}; + /* * Decode table for SIMD instructions with the repnz (0xf2) prefix. */ @@ -645,32 +773,538 @@ const instable_t dis_opSIMDrepnz[256] = /* [18] */ INVALID, INVALID, INVALID, INVALID, /* [1C] */ INVALID, INVALID, INVALID, INVALID, -/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),TNSZ("movntsd",XMMMS,8), +/* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("sqrtsd",XMM,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("addsd",XMM,8), TNSZ("mulsd",XMM,8), TNSZ("cvtsd2ss",XMM,8), INVALID, +/* [5C] */ TNSZ("subsd",XMM,8), TNSZ("minsd",XMM,8), TNSZ("divsd",XMM,8), TNSZ("maxsd",XMM,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("cmpsd",XMMP,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, TNS("movdq2q",XMMXM), INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("cvtpd2dq",XMM,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF20F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovsd",VEX_RMrX,8), TNSZ("vmovsd",VEX_RRX,8), TNSZ("vmovddup",VEX_MX,8), INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2sd",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttsd2si",VEX_MR,8),TNSZ("vcvtsd2si",VEX_MR,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtsd",VEX_RMrX,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddsd",VEX_RMrX,8), TNSZ("vmulsd",VEX_RMrX,8), TNSZ("vcvtsd2ss",VEX_RMrX,8), INVALID, +/* [5C] */ TNSZ("vsubsd",VEX_RMrX,8), TNSZ("vminsd",VEX_RMrX,8), TNSZ("vdivsd",VEX_RMrX,8), TNSZ("vmaxsd",VEX_RMrX,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("vpshuflw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddps",VEX_RMrX,8), TNSZ("vhsubps",VEX_RMrX,8), INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpsd",VEX_RMRX,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubps",VEX_RMrX,8), INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtpd2dq",VEX_MX,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ TNSZ("vlddqu",VEX_MX,16), INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +/* + * Decode table for SIMD instructions with the repz (0xf3) prefix. + */ +const instable_t dis_opSIMDrepz[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),TNSZ("movntss",XMMMS,4), +/* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("sqrtss",XMM,4), TNSZ("rsqrtss",XMM,4), TNSZ("rcpss",XMM,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("addss",XMM,4), TNSZ("mulss",XMM,4), TNSZ("cvtss2sd",XMM,4), TNSZ("cvttps2dq",XMM,16), +/* [5C] */ TNSZ("subss",XMM,4), TNSZ("minss",XMM,4), TNSZ("divss",XMM,4), TNSZ("maxss",XMM,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("movdqu",XMM,16), + +/* [70] */ TNSZ("pshufhw",XMMP,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("movq",XMM,8), TNSZ("movdqu",XMMS,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ TS("popcnt",MRw), INVALID, INVALID, INVALID, +/* [BC] */ INVALID, TS("lzcnt",MRw), INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("cmpss",XMMP,4), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, TNS("movq2dq",XMMMX), INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("cvtdq2pd",XMM,8), INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF30F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovss",VEX_RMrX,4), TNSZ("vmovss",VEX_RRX,4), TNSZ("vmovsldup",VEX_MX,4), INVALID, +/* [14] */ INVALID, INVALID, TNSZ("vmovshdup",VEX_MX,4), INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2ss",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttss2si",VEX_MR,4),TNSZ("vcvtss2si",VEX_MR,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtss",VEX_RMrX,4), TNSZ("vrsqrtss",VEX_RMrX,4), TNSZ("vrcpss",VEX_RMrX,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddss",VEX_RMrX,4), TNSZ("vmulss",VEX_RMrX,4), TNSZ("vcvtss2sd",VEX_RMrX,4), TNSZ("vcvttps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubss",VEX_RMrX,4), TNSZ("vminss",VEX_RMrX,4), TNSZ("vdivss",VEX_RMrX,4), TNSZ("vmaxss",VEX_RMrX,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("vmovdqu",VEX_MX,16), + +/* [70] */ TNSZ("vpshufhw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("vmovq",VEX_MX,8), TNSZ("vmovdqu",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpss",VEX_RMRX,4), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtdq2pd",VEX_MX,8), INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; +/* + * The following two tables are used to encode crc32 and movbe + * since they share the same opcodes. + */ +const instable_t dis_op0F38F0[2] = { +/* [00] */ TNS("crc32b",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38F1[2] = { +/* [00] */ TS("crc32",CRC32), + TS("movbe",MOVBE), +}; + +const instable_t dis_op0F38[256] = { +/* [00] */ TNSZ("pshufb",XMM_66o,16),TNSZ("phaddw",XMM_66o,16),TNSZ("phaddd",XMM_66o,16),TNSZ("phaddsw",XMM_66o,16), +/* [04] */ TNSZ("pmaddubsw",XMM_66o,16),TNSZ("phsubw",XMM_66o,16), TNSZ("phsubd",XMM_66o,16),TNSZ("phsubsw",XMM_66o,16), +/* [08] */ TNSZ("psignb",XMM_66o,16),TNSZ("psignw",XMM_66o,16),TNSZ("psignd",XMM_66o,16),TNSZ("pmulhrsw",XMM_66o,16), +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("pblendvb",XMM_66r,16),INVALID, INVALID, INVALID, +/* [14] */ TNSZ("blendvps",XMM_66r,16),TNSZ("blendvpd",XMM_66r,16),INVALID, TNSZ("ptest",XMM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ TNSZ("pabsb",XMM_66o,16),TNSZ("pabsw",XMM_66o,16),TNSZ("pabsd",XMM_66o,16),INVALID, + +/* [20] */ TNSZ("pmovsxbw",XMM_66r,16),TNSZ("pmovsxbd",XMM_66r,16),TNSZ("pmovsxbq",XMM_66r,16),TNSZ("pmovsxwd",XMM_66r,16), +/* [24] */ TNSZ("pmovsxwq",XMM_66r,16),TNSZ("pmovsxdq",XMM_66r,16),INVALID, INVALID, +/* [28] */ TNSZ("pmuldq",XMM_66r,16),TNSZ("pcmpeqq",XMM_66r,16),TNSZ("movntdqa",XMMM_66r,16),TNSZ("packusdw",XMM_66r,16), +/* [2C] */ INVALID, INVALID, INVALID, INVALID, + +/* [30] */ TNSZ("pmovzxbw",XMM_66r,16),TNSZ("pmovzxbd",XMM_66r,16),TNSZ("pmovzxbq",XMM_66r,16),TNSZ("pmovzxwd",XMM_66r,16), +/* [34] */ TNSZ("pmovzxwq",XMM_66r,16),TNSZ("pmovzxdq",XMM_66r,16),INVALID, TNSZ("pcmpgtq",XMM_66r,16), +/* [38] */ TNSZ("pminsb",XMM_66r,16),TNSZ("pminsd",XMM_66r,16),TNSZ("pminuw",XMM_66r,16),TNSZ("pminud",XMM_66r,16), +/* [3C] */ TNSZ("pmaxsb",XMM_66r,16),TNSZ("pmaxsd",XMM_66r,16),TNSZ("pmaxuw",XMM_66r,16),TNSZ("pmaxud",XMM_66r,16), + +/* [40] */ TNSZ("pmulld",XMM_66r,16),TNSZ("phminposuw",XMM_66r,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("aesimc",XMM_66r,16), +/* [DC] */ TNSZ("aesenc",XMM_66r,16),TNSZ("aesenclast",XMM_66r,16),TNSZ("aesdec",XMM_66r,16),TNSZ("aesdeclast",XMM_66r,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVX660F38[256] = { +/* [00] */ TNSZ("vpshufb",VEX_RMrX,16),TNSZ("vphaddw",VEX_RMrX,16),TNSZ("vphaddd",VEX_RMrX,16),TNSZ("vphaddsw",VEX_RMrX,16), +/* [04] */ TNSZ("vpmaddubsw",VEX_RMrX,16),TNSZ("vphsubw",VEX_RMrX,16), TNSZ("vphsubd",VEX_RMrX,16),TNSZ("vphsubsw",VEX_RMrX,16), +/* [08] */ TNSZ("vpsignb",VEX_RMrX,16),TNSZ("vpsignw",VEX_RMrX,16),TNSZ("vpsignd",VEX_RMrX,16),TNSZ("vpmulhrsw",VEX_RMrX,16), +/* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), +/* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, +/* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, + +/* [20] */ TNSZ("vpmovsxbw",VEX_MX,16),TNSZ("vpmovsxbd",VEX_MX,16),TNSZ("vpmovsxbq",VEX_MX,16),TNSZ("vpmovsxwd",VEX_MX,16), +/* [24] */ TNSZ("vpmovsxwq",VEX_MX,16),TNSZ("vpmovsxdq",VEX_MX,16),INVALID, INVALID, +/* [28] */ TNSZ("vpmuldq",VEX_RMrX,16),TNSZ("vpcmpeqq",VEX_RMrX,16),TNSZ("vmovntdqa",VEX_MX,16),TNSZ("vpackusdw",VEX_RMrX,16), +/* [2C] */ TNSZ("vmaskmovps",VEX_RMrX,8),TNSZ("vmaskmovpd",VEX_RMrX,16),TNSZ("vmaskmovps",VEX_RRM,8),TNSZ("vmaskmovpd",VEX_RRM,16), + +/* [30] */ TNSZ("vpmovzxbw",VEX_MX,16),TNSZ("vpmovzxbd",VEX_MX,16),TNSZ("vpmovzxbq",VEX_MX,16),TNSZ("vpmovzxwd",VEX_MX,16), +/* [34] */ TNSZ("vpmovzxwq",VEX_MX,16),TNSZ("vpmovzxdq",VEX_MX,16),INVALID, TNSZ("vpcmpgtq",VEX_RMrX,16), +/* [38] */ TNSZ("vpminsb",VEX_RMrX,16),TNSZ("vpminsd",VEX_RMrX,16),TNSZ("vpminuw",VEX_RMrX,16),TNSZ("vpminud",VEX_RMrX,16), +/* [3C] */ TNSZ("vpmaxsb",VEX_RMrX,16),TNSZ("vpmaxsd",VEX_RMrX,16),TNSZ("vpmaxuw",VEX_RMrX,16),TNSZ("vpmaxud",VEX_RMrX,16), + +/* [40] */ TNSZ("vpmulld",VEX_RMrX,16),TNSZ("vphminposuw",VEX_MX,16),INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, INVALID, INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ INVALID, INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, INVALID, INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, TNSZ("vaesimc",VEX_MX,16), +/* [DC] */ TNSZ("vaesenc",VEX_RMrX,16),TNSZ("vaesenclast",VEX_RMrX,16),TNSZ("vaesdec",VEX_RMrX,16),TNSZ("vaesdeclast",VEX_RMrX,16), + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, +/* [F0] */ IND(dis_op0F38F0), IND(dis_op0F38F1), INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_op0F3A[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ TNSZ("roundps",XMMP_66r,16),TNSZ("roundpd",XMMP_66r,16),TNSZ("roundss",XMMP_66r,16),TNSZ("roundsd",XMMP_66r,16), +/* [0C] */ TNSZ("blendps",XMMP_66r,16),TNSZ("blendpd",XMMP_66r,16),TNSZ("pblendw",XMMP_66r,16),TNSZ("palignr",XMMP_66o,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("pextrb",XMM3PM_66r,8),TNSZ("pextrw",XMM3PM_66r,16),TSZ("pextr",XMM3PM_66r,16),TNSZ("extractps",XMM3PM_66r,16), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ TNSZ("pinsrb",XMMPRM_66r,8),TNSZ("insertps",XMMP_66r,16),TSZ("pinsr",XMMPRM_66r,16),INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),INVALID, -/* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, /* [34] */ INVALID, INVALID, INVALID, INVALID, /* [38] */ INVALID, INVALID, INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, -/* [40] */ INVALID, INVALID, INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [40] */ TNSZ("dpps",XMMP_66r,16),TNSZ("dppd",XMMP_66r,16),TNSZ("mpsadbw",XMMP_66r,16),INVALID, +/* [44] */ TNSZ("pclmulqdq",XMMP_66r,16),INVALID, INVALID, INVALID, /* [48] */ INVALID, INVALID, INVALID, INVALID, /* [4C] */ INVALID, INVALID, INVALID, INVALID, -/* [50] */ INVALID, TNSZ("sqrtsd",XMM,8), INVALID, INVALID, +/* [50] */ INVALID, INVALID, INVALID, INVALID, /* [54] */ INVALID, INVALID, INVALID, INVALID, -/* [58] */ TNSZ("addsd",XMM,8), TNSZ("mulsd",XMM,8), TNSZ("cvtsd2ss",XMM,8), INVALID, -/* [5C] */ TNSZ("subsd",XMM,8), TNSZ("minsd",XMM,8), TNSZ("divsd",XMM,8), TNSZ("maxsd",XMM,8), +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, -/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [60] */ TNSZ("pcmpestrm",XMMP_66r,16),TNSZ("pcmpestri",XMMP_66r,16),TNSZ("pcmpistrm",XMMP_66r,16),TNSZ("pcmpistri",XMMP_66r,16), /* [64] */ INVALID, INVALID, INVALID, INVALID, /* [68] */ INVALID, INVALID, INVALID, INVALID, /* [6C] */ INVALID, INVALID, INVALID, INVALID, -/* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, +/* [70] */ INVALID, INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, @@ -678,7 +1312,7 @@ const instable_t dis_opSIMDrepnz[256] = /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, -/* [0C] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, /* [90] */ INVALID, INVALID, INVALID, INVALID, /* [94] */ INVALID, INVALID, INVALID, INVALID, @@ -695,18 +1329,18 @@ const instable_t dis_opSIMDrepnz[256] = /* [B8] */ INVALID, INVALID, INVALID, INVALID, /* [BC] */ INVALID, INVALID, INVALID, INVALID, -/* [C0] */ INVALID, INVALID, TNSZ("cmpsd",XMMP,8), INVALID, +/* [C0] */ INVALID, INVALID, INVALID, INVALID, /* [C4] */ INVALID, INVALID, INVALID, INVALID, /* [C8] */ INVALID, INVALID, INVALID, INVALID, /* [CC] */ INVALID, INVALID, INVALID, INVALID, /* [D0] */ INVALID, INVALID, INVALID, INVALID, -/* [D4] */ INVALID, INVALID, TNS("movdq2q",XMMXM), INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, /* [D8] */ INVALID, INVALID, INVALID, INVALID, -/* [DC] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, TNSZ("aeskeygenassist",XMMP_66r,16), /* [E0] */ INVALID, INVALID, INVALID, INVALID, -/* [E4] */ INVALID, INVALID, TNSZ("cvtpd2dq",XMM,16),INVALID, +/* [E4] */ INVALID, INVALID, INVALID, INVALID, /* [E8] */ INVALID, INVALID, INVALID, INVALID, /* [EC] */ INVALID, INVALID, INVALID, INVALID, @@ -716,54 +1350,51 @@ const instable_t dis_opSIMDrepnz[256] = /* [FC] */ INVALID, INVALID, INVALID, INVALID, }; -/* - * Decode table for SIMD instructions with the repz (0xf3) prefix. - */ -const instable_t dis_opSIMDrepz[256] = { +const instable_t dis_opAVX660F3A[256] = { /* [00] */ INVALID, INVALID, INVALID, INVALID, -/* [04] */ INVALID, INVALID, INVALID, INVALID, -/* [08] */ INVALID, INVALID, INVALID, INVALID, -/* [0C] */ INVALID, INVALID, INVALID, INVALID, - -/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), INVALID, INVALID, -/* [14] */ INVALID, INVALID, INVALID, INVALID, -/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ TNSZ("vpermilps",VEX_MXI,8),TNSZ("vpermilpd",VEX_MXI,16),TNSZ("vperm2f128",VEX_RMRX,16),INVALID, +/* [08] */ TNSZ("vroundps",VEX_MXI,16),TNSZ("vroundpd",VEX_MXI,16),TNSZ("vroundss",VEX_RMRX,16),TNSZ("vroundsd",VEX_RMRX,16), +/* [0C] */ TNSZ("vblendps",VEX_RMRX,16),TNSZ("vblendpd",VEX_RMRX,16),TNSZ("vpblendw",VEX_RMRX,16),TNSZ("vpalignr",VEX_RMRX,16), + +/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [14] */ TNSZ("vpextrb",VEX_RRi,8),TNSZ("vpextrw",VEX_RRi,16),TNSZ("vpextrd",VEX_RRi,16),TNSZ("vextractps",VEX_RM,16), +/* [18] */ TNSZ("vinsertf128",VEX_RMRX,16),TNSZ("vextractf128",VEX_RX,16),INVALID, INVALID, /* [1C] */ INVALID, INVALID, INVALID, INVALID, -/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [20] */ TNSZ("vpinsrb",VEX_RMRX,8),TNSZ("vinsertps",VEX_RMRX,16),TNSZ("vpinsrd",VEX_RMRX,16),INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, -/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),INVALID, -/* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, +/* [28] */ INVALID, INVALID, INVALID, INVALID, +/* [2C] */ INVALID, INVALID, INVALID, INVALID, /* [30] */ INVALID, INVALID, INVALID, INVALID, /* [34] */ INVALID, INVALID, INVALID, INVALID, /* [38] */ INVALID, INVALID, INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, -/* [40] */ INVALID, INVALID, INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, -/* [48] */ INVALID, INVALID, INVALID, INVALID, -/* [4C] */ INVALID, INVALID, INVALID, INVALID, +/* [40] */ TNSZ("vdpps",VEX_RMRX,16),TNSZ("vdppd",VEX_RMRX,16),TNSZ("vmpsadbw",VEX_RMRX,16),INVALID, +/* [44] */ TNSZ("vpclmulqdq",VEX_RMRX,16),INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, TNSZ("vblendvps",VEX_RMRX,8), TNSZ("vblendvpd",VEX_RMRX,16), +/* [4C] */ TNSZ("vpblendvb",VEX_RMRX,16),INVALID, INVALID, INVALID, -/* [50] */ INVALID, TNSZ("sqrtss",XMM,4), TNSZ("rsqrtss",XMM,4), TNSZ("rcpss",XMM,4), +/* [50] */ INVALID, INVALID, INVALID, INVALID, /* [54] */ INVALID, INVALID, INVALID, INVALID, -/* [58] */ TNSZ("addss",XMM,4), TNSZ("mulss",XMM,4), TNSZ("cvtss2sd",XMM,4), TNSZ("cvttps2dq",XMM,16), -/* [5C] */ TNSZ("subss",XMM,4), TNSZ("minss",XMM,4), TNSZ("divss",XMM,4), TNSZ("maxss",XMM,4), +/* [58] */ INVALID, INVALID, INVALID, INVALID, +/* [5C] */ INVALID, INVALID, INVALID, INVALID, -/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [60] */ TNSZ("vpcmpestrm",VEX_MXI,16),TNSZ("vpcmpestri",VEX_MXI,16),TNSZ("vpcmpistrm",VEX_MXI,16),TNSZ("vpcmpistri",VEX_MXI,16), /* [64] */ INVALID, INVALID, INVALID, INVALID, /* [68] */ INVALID, INVALID, INVALID, INVALID, -/* [6C] */ INVALID, INVALID, INVALID, TNSZ("movdqu",XMM,16), +/* [6C] */ INVALID, INVALID, INVALID, INVALID, -/* [70] */ TNSZ("pshufhw",XMMP,16),INVALID, INVALID, INVALID, +/* [70] */ INVALID, INVALID, INVALID, INVALID, /* [74] */ INVALID, INVALID, INVALID, INVALID, /* [78] */ INVALID, INVALID, INVALID, INVALID, -/* [7C] */ INVALID, INVALID, TNSZ("movq",XMM,8), TNSZ("movdqu",XMMS,16), +/* [7C] */ INVALID, INVALID, INVALID, INVALID, /* [80] */ INVALID, INVALID, INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, -/* [0C] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:12:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DC7DE5B1; Fri, 23 Aug 2013 14:12:39 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB0DF2A7C; Fri, 23 Aug 2013 14:12:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NECdI0081567; Fri, 23 Aug 2013 14:12:39 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NECdG7081565; Fri, 23 Aug 2013 14:12:39 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201308231412.r7NECdG7081565@svn.freebsd.org> From: Davide Italiano Date: Fri, 23 Aug 2013 14:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254703 - in head: share/man/man9 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:12:40 -0000 Author: davide Date: Fri Aug 23 14:12:39 2013 New Revision: 254703 URL: http://svnweb.freebsd.org/changeset/base/254703 Log: Introduce callout_init_rm() so that callouts can be used in conjunction with rmlocks. This works only with non-sleepable rm because handlers run in SWI context. While here, document the new KPI in the timeout(9) manpage. Requested by: adrian, scottl Reviewed by: mav, remko(manpage) Modified: head/share/man/man9/timeout.9 head/sys/sys/callout.h Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Fri Aug 23 14:03:48 2013 (r254702) +++ head/share/man/man9/timeout.9 Fri Aug 23 14:12:39 2013 (r254703) @@ -38,6 +38,7 @@ .Nm callout_handle_init , .Nm callout_init , .Nm callout_init_mtx , +.Nm callout_init_rm , .Nm callout_init_rw , .Nm callout_stop , .Nm callout_drain , @@ -73,6 +74,8 @@ struct callout_handle handle = CALLOUT_H .Fn callout_init "struct callout *c" "int mpsafe" .Ft void .Fn callout_init_mtx "struct callout *c" "struct mtx *mtx" "int flags" +.Fn void +.Fn callout_init_rm "struct callout *c" "struct rmlock *rm" "int flags" .Ft void .Fn callout_init_rw "struct callout *c" "struct rwlock *rw" "int flags" .Ft int @@ -203,6 +206,7 @@ Thus they are protected from re-entrancy The functions .Fn callout_init , .Fn callout_init_mtx , +.Fn callout_init_rm , .Fn callout_init_rw , .Fn callout_stop , .Fn callout_drain , @@ -252,15 +256,25 @@ after the callout function returns. .Pp The .Fn callout_init_rw -function serves the need of using rwlocks in conjunction with callouts. -The function does basically the same as -.Fn callout_init_mtx +and the +.Fn callout_init_rm +fuctions serve the need of using rwlocks and rmlocks in conjunction +with callouts. +The functions do the same as +.Fn callout_init with the possibility of specifying an extra .Fa rw +or +.Fa rm argument. -The usable lock classes are currently limited to mutexes and rwlocks, -because callout handlers run in softclock swi, so they cannot sleep nor -acquire sleepable locks like sx or lockmgr. +If an +.Fa rm +argument is specified, the lock should be created without passing the +.It Dv RM_SLEEPABLE +flag. +The usable lock classes are currently limited to mutexes, rwlocks and +non-sleepable rmlocks, because callout handlers run in softclock swi, +so they cannot sleep nor acquire sleepable locks like sx or lockmgr. The following .Fa flags may be specified: Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Fri Aug 23 14:03:48 2013 (r254702) +++ head/sys/sys/callout.h Fri Aug 23 14:12:39 2013 (r254703) @@ -71,6 +71,9 @@ void _callout_init_lock(struct callout * #define callout_init_mtx(c, mtx, flags) \ _callout_init_lock((c), ((mtx) != NULL) ? &(mtx)->lock_object : \ NULL, (flags)) +#define callout_init_rm(c, rm, flags) + _callout_init_lock((c), ((rm != NULL) ? &(rm)->lock_object : \ + NULL, (flags)) #define callout_init_rw(c, rw, flags) \ _callout_init_lock((c), ((rw) != NULL) ? &(rw)->lock_object : \ NULL, (flags)) From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:17:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 097D1764; Fri, 23 Aug 2013 14:17:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E863B2AB2; Fri, 23 Aug 2013 14:17:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEHoON083233; Fri, 23 Aug 2013 14:17:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEHj0W083173; Fri, 23 Aug 2013 14:17:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231417.r7NEHj0W083173@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254704 - in stable/9/sys: cddl/compat/opensolaris/sys cddl/dev/dtrace conf modules/cyclic modules/dtrace/dtio modules/dtrace/dtmalloc modules/dtrace/dtnfscl modules/dtrace/dtnfsclient ... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:17:51 -0000 Author: avg Date: Fri Aug 23 14:17:45 2013 New Revision: 254704 URL: http://svnweb.freebsd.org/changeset/base/254704 Log: MFC r253996,253997: opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG Please note that support for compiling ZFS into a kernel is not in this branch as of now. Added: stable/9/sys/cddl/compat/opensolaris/sys/debug_compat.h - copied unchanged from r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/cddl/compat/opensolaris/sys/mutex.h stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.c stable/9/sys/conf/options stable/9/sys/modules/cyclic/Makefile stable/9/sys/modules/dtrace/dtio/Makefile stable/9/sys/modules/dtrace/dtmalloc/Makefile stable/9/sys/modules/dtrace/dtnfscl/Makefile stable/9/sys/modules/dtrace/dtnfsclient/Makefile stable/9/sys/modules/dtrace/dtrace/Makefile stable/9/sys/modules/dtrace/dtrace_test/Makefile stable/9/sys/modules/dtrace/dtraceall/Makefile stable/9/sys/modules/dtrace/fasttrap/Makefile stable/9/sys/modules/dtrace/fbt/Makefile stable/9/sys/modules/dtrace/lockstat/Makefile stable/9/sys/modules/dtrace/profile/Makefile stable/9/sys/modules/dtrace/prototype/Makefile stable/9/sys/modules/dtrace/sdt/Makefile stable/9/sys/modules/dtrace/systrace/Makefile stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile stable/9/sys/modules/dtrace/systrace_linux32/Makefile stable/9/sys/modules/opensolaris/Makefile stable/9/sys/modules/zfs/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/ (props changed) Copied: stable/9/sys/cddl/compat/opensolaris/sys/debug_compat.h (from r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/cddl/compat/opensolaris/sys/debug_compat.h Fri Aug 23 14:17:45 2013 (r254704, copy of r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Andriy Gapon + * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This is a special file that SHOULD NOT be included using #include directive. + */ + +#if defined(INVARIANTS) +#ifndef DEBUG +#define DEBUG +#endif +#endif Modified: stable/9/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/mutex.h Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/cddl/compat/opensolaris/sys/mutex.h Fri Aug 23 14:17:45 2013 (r254704) @@ -46,7 +46,7 @@ typedef enum { typedef struct sx kmutex_t; -#ifndef DEBUG +#ifndef OPENSOLARIS_WITNESS #define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS) #else #define MUTEX_FLAGS (SX_DUPOK) Modified: stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h Fri Aug 23 14:17:45 2013 (r254704) @@ -47,7 +47,7 @@ typedef enum { typedef struct sx krwlock_t; -#ifndef DEBUG +#ifndef OPENSOLARIS_WITNESS #define RW_FLAGS (SX_DUPOK | SX_NOWITNESS) #else #define RW_FLAGS (SX_DUPOK) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Fri Aug 23 14:17:45 2013 (r254704) @@ -73,7 +73,9 @@ dtrace_load(void *dummy) mutex_init(&dtrace_lock,"dtrace probe state", MUTEX_DEFAULT, NULL); mutex_init(&dtrace_provider_lock,"dtrace provider state", MUTEX_DEFAULT, NULL); mutex_init(&dtrace_meta_lock,"dtrace meta-provider state", MUTEX_DEFAULT, NULL); +#ifdef DEBUG mutex_init(&dtrace_errlock,"dtrace error lock", MUTEX_DEFAULT, NULL); +#endif mutex_enter(&dtrace_provider_lock); mutex_enter(&dtrace_lock); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Fri Aug 23 14:17:45 2013 (r254704) @@ -121,7 +121,9 @@ dtrace_unload() mutex_destroy(&dtrace_meta_lock); mutex_destroy(&dtrace_provider_lock); mutex_destroy(&dtrace_lock); +#ifdef DEBUG mutex_destroy(&dtrace_errlock); +#endif /* XXX Hack */ mutex_destroy(&mod_lock); Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/conf/options Fri Aug 23 14:17:45 2013 (r254704) @@ -682,6 +682,7 @@ KTR_VERBOSE opt_ktr.h WITNESS opt_global.h WITNESS_KDB opt_witness.h WITNESS_SKIPSPIN opt_witness.h +OPENSOLARIS_WITNESS opt_global.h # options for ACPI support ACPI_DEBUG opt_acpi.h Modified: stable/9/sys/modules/cyclic/Makefile ============================================================================== --- stable/9/sys/modules/cyclic/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/cyclic/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -12,8 +12,8 @@ CFLAGS+= -I${.CURDIR}/../../cddl/compat/ -I${.CURDIR}/../.. \ -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH:S/amd64/i386/} -CFLAGS+= -DDEBUG=1 - IGNORE_PRAGMA= 1 .include + +CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/dtio/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtio/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtio/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/dtmalloc/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtmalloc/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtmalloc/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/dtnfscl/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtnfscl/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtnfscl/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/dtnfsclient/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtnfsclient/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtnfsclient/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtrace/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtrace/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -40,7 +40,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ -I${.CURDIR}/../../.. -DDIS_MEM -CFLAGS+= -DSMP -DDEBUG +CFLAGS+= -DSMP EXPORT_SYMS= dtrace_register \ dtrace_unregister \ @@ -50,6 +50,9 @@ dtrace_asm.o: assym.s .include +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h + CWARNFLAGS+= -Wno-parentheses CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-cast-qual +CWARNFLAGS+= -Wno-unused Modified: stable/9/sys/modules/dtrace/dtrace_test/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtrace_test/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtrace_test/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -12,3 +12,5 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -D_KERNEL .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/dtraceall/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/dtraceall/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/dtraceall/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -13,3 +13,5 @@ opt_compat.h: .endif .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/fasttrap/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/fasttrap/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -15,6 +15,9 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace .endif -CFLAGS+= -DSMP -DDEBUG +CFLAGS+= -DSMP .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= -Wno-unused Modified: stable/9/sys/modules/dtrace/fbt/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/fbt/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/fbt/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/lockstat/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/lockstat/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/lockstat/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -12,3 +12,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/profile/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/profile/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/profile/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/prototype/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/prototype/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/prototype/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/sdt/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/sdt/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/sdt/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/systrace/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/systrace/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/systrace/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. -DFREEBSD32_SYSTRACE .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/dtrace/systrace_linux32/Makefile ============================================================================== --- stable/9/sys/modules/dtrace/systrace_linux32/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/dtrace/systrace_linux32/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -16,3 +16,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. -DLINUX_SYSTRACE .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/opensolaris/Makefile ============================================================================== --- stable/9/sys/modules/opensolaris/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/opensolaris/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -27,3 +27,5 @@ CFLAGS+= -I${.CURDIR}/../../cddl/compat/ IGNORE_PRAGMA= 1 .include + +CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/9/sys/modules/zfs/Makefile ============================================================================== --- stable/9/sys/modules/zfs/Makefile Fri Aug 23 14:12:39 2013 (r254703) +++ stable/9/sys/modules/zfs/Makefile Fri Aug 23 14:17:45 2013 (r254704) @@ -95,6 +95,8 @@ CFLAGS+=-mminimal-toc .include +CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h + CWARNFLAGS+=-Wno-unknown-pragmas CWARNFLAGS+=-Wno-missing-prototypes CWARNFLAGS+=-Wno-undef From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:18:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9CC6F891; Fri, 23 Aug 2013 14:18:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6DACE2AB8; Fri, 23 Aug 2013 14:18:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEITdt083456; Fri, 23 Aug 2013 14:18:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEIOTY083401; Fri, 23 Aug 2013 14:18:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231418.r7NEIOTY083401@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254705 - in stable/8/sys: cddl/compat/opensolaris/sys cddl/dev/dtrace conf modules/cyclic modules/dtrace/dtmalloc modules/dtrace/dtnfsclient modules/dtrace/dtrace modules/dtrace/dtrace... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:18:29 -0000 Author: avg Date: Fri Aug 23 14:18:24 2013 New Revision: 254705 URL: http://svnweb.freebsd.org/changeset/base/254705 Log: MFC r253996,253997: opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG Please note that support for compiling ZFS into a kernel is not in this branch as of now. Also, not all modules from head are in this branch. Added: stable/8/sys/cddl/compat/opensolaris/sys/debug_compat.h - copied unchanged from r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/cddl/compat/opensolaris/sys/mutex.h stable/8/sys/cddl/compat/opensolaris/sys/rwlock.h stable/8/sys/cddl/dev/dtrace/dtrace_load.c stable/8/sys/cddl/dev/dtrace/dtrace_unload.c stable/8/sys/conf/options stable/8/sys/modules/cyclic/Makefile stable/8/sys/modules/dtrace/dtmalloc/Makefile stable/8/sys/modules/dtrace/dtnfsclient/Makefile stable/8/sys/modules/dtrace/dtrace/Makefile stable/8/sys/modules/dtrace/dtrace_test/Makefile stable/8/sys/modules/dtrace/dtraceall/Makefile stable/8/sys/modules/dtrace/fasttrap/Makefile stable/8/sys/modules/dtrace/fbt/Makefile stable/8/sys/modules/dtrace/lockstat/Makefile stable/8/sys/modules/dtrace/profile/Makefile stable/8/sys/modules/dtrace/prototype/Makefile stable/8/sys/modules/dtrace/sdt/Makefile stable/8/sys/modules/dtrace/systrace/Makefile stable/8/sys/modules/dtrace/systrace_freebsd32/Makefile stable/8/sys/modules/dtrace/systrace_linux32/Makefile stable/8/sys/modules/opensolaris/Makefile stable/8/sys/modules/zfs/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/conf/ (props changed) stable/8/sys/modules/ (props changed) Copied: stable/8/sys/cddl/compat/opensolaris/sys/debug_compat.h (from r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/compat/opensolaris/sys/debug_compat.h Fri Aug 23 14:18:24 2013 (r254705, copy of r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2013 Andriy Gapon + * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This is a special file that SHOULD NOT be included using #include directive. + */ + +#if defined(INVARIANTS) +#ifndef DEBUG +#define DEBUG +#endif +#endif Modified: stable/8/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/mutex.h Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/cddl/compat/opensolaris/sys/mutex.h Fri Aug 23 14:18:24 2013 (r254705) @@ -46,7 +46,7 @@ typedef enum { typedef struct sx kmutex_t; -#ifndef DEBUG +#ifndef OPENSOLARIS_WITNESS #define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS) #else #define MUTEX_FLAGS (SX_DUPOK) Modified: stable/8/sys/cddl/compat/opensolaris/sys/rwlock.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/rwlock.h Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/cddl/compat/opensolaris/sys/rwlock.h Fri Aug 23 14:18:24 2013 (r254705) @@ -47,7 +47,7 @@ typedef enum { typedef struct sx krwlock_t; -#ifndef DEBUG +#ifndef OPENSOLARIS_WITNESS #define RW_FLAGS (SX_DUPOK | SX_NOWITNESS) #else #define RW_FLAGS (SX_DUPOK) Modified: stable/8/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_load.c Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/cddl/dev/dtrace/dtrace_load.c Fri Aug 23 14:18:24 2013 (r254705) @@ -73,7 +73,9 @@ dtrace_load(void *dummy) mutex_init(&dtrace_lock,"dtrace probe state", MUTEX_DEFAULT, NULL); mutex_init(&dtrace_provider_lock,"dtrace provider state", MUTEX_DEFAULT, NULL); mutex_init(&dtrace_meta_lock,"dtrace meta-provider state", MUTEX_DEFAULT, NULL); +#ifdef DEBUG mutex_init(&dtrace_errlock,"dtrace error lock", MUTEX_DEFAULT, NULL); +#endif mutex_enter(&dtrace_provider_lock); mutex_enter(&dtrace_lock); Modified: stable/8/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/dtrace_unload.c Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/cddl/dev/dtrace/dtrace_unload.c Fri Aug 23 14:18:24 2013 (r254705) @@ -121,7 +121,9 @@ dtrace_unload() mutex_destroy(&dtrace_meta_lock); mutex_destroy(&dtrace_provider_lock); mutex_destroy(&dtrace_lock); +#ifdef DEBUG mutex_destroy(&dtrace_errlock); +#endif /* XXX Hack */ mutex_destroy(&mod_lock); Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/conf/options Fri Aug 23 14:18:24 2013 (r254705) @@ -671,6 +671,7 @@ KTR_VERBOSE opt_ktr.h WITNESS opt_global.h WITNESS_KDB opt_witness.h WITNESS_SKIPSPIN opt_witness.h +OPENSOLARIS_WITNESS opt_global.h # options for ACPI support ACPI_DEBUG opt_acpi.h Modified: stable/8/sys/modules/cyclic/Makefile ============================================================================== --- stable/8/sys/modules/cyclic/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/cyclic/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -12,8 +12,8 @@ CFLAGS+= -I${.CURDIR}/../../cddl/compat/ -I${.CURDIR}/../.. \ -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH:S/amd64/i386/} -CFLAGS+= -DDEBUG=1 - IGNORE_PRAGMA= 1 .include + +CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/dtmalloc/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/dtmalloc/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/dtmalloc/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/dtnfsclient/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/dtnfsclient/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/dtnfsclient/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/dtrace/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/dtrace/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -36,7 +36,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ -I${.CURDIR}/../../.. -DDIS_MEM -CFLAGS+= -DSMP -DDEBUG +CFLAGS+= -DSMP EXPORT_SYMS= dtrace_register \ dtrace_unregister \ @@ -46,6 +46,9 @@ dtrace_asm.o: assym.s .include +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h + CWARNFLAGS+= -Wno-parentheses CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-cast-qual +CWARNFLAGS+= -Wno-unused Modified: stable/8/sys/modules/dtrace/dtrace_test/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/dtrace_test/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/dtrace_test/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -12,3 +12,5 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -D_KERNEL .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/dtraceall/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/dtraceall/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/dtraceall/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -15,3 +15,5 @@ opt_compat.h: .endif .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/fasttrap/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/fasttrap/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -15,6 +15,9 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace .endif -CFLAGS+= -DSMP -DDEBUG +CFLAGS+= -DSMP .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CWARNFLAGS+= -Wno-unused Modified: stable/8/sys/modules/dtrace/fbt/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/fbt/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/fbt/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/lockstat/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/lockstat/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/lockstat/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -12,3 +12,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/profile/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/profile/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/profile/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/prototype/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/prototype/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/prototype/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/sdt/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/sdt/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/sdt/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/systrace/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/systrace/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/systrace/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/systrace_freebsd32/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/systrace_freebsd32/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/systrace_freebsd32/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -11,3 +11,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. -DFREEBSD32_SYSTRACE .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/dtrace/systrace_linux32/Makefile ============================================================================== --- stable/8/sys/modules/dtrace/systrace_linux32/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/dtrace/systrace_linux32/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -16,3 +16,5 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp -I${.CURDIR}/../../.. -DLINUX_SYSTRACE .include + +CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/opensolaris/Makefile ============================================================================== --- stable/8/sys/modules/opensolaris/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/opensolaris/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -24,3 +24,5 @@ CFLAGS+= -I${.CURDIR}/../../cddl/compat/ IGNORE_PRAGMA= 1 .include + +CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h Modified: stable/8/sys/modules/zfs/Makefile ============================================================================== --- stable/8/sys/modules/zfs/Makefile Fri Aug 23 14:17:45 2013 (r254704) +++ stable/8/sys/modules/zfs/Makefile Fri Aug 23 14:18:24 2013 (r254705) @@ -89,6 +89,8 @@ CFLAGS+=-DBUILDING_ZFS .include +CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h + CWARNFLAGS+=-Wno-unknown-pragmas CWARNFLAGS+=-Wno-missing-prototypes CWARNFLAGS+=-Wno-undef From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:23:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDBEFA01; Fri, 23 Aug 2013 14:23:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB6AD2B05; Fri, 23 Aug 2013 14:23:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NENsZP087118; Fri, 23 Aug 2013 14:23:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NENs5C087117; Fri, 23 Aug 2013 14:23:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308231423.r7NENs5C087117@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 23 Aug 2013 14:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254706 - head/lib/libc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:23:54 -0000 Author: jilles Date: Fri Aug 23 14:23:54 2013 New Revision: 254706 URL: http://svnweb.freebsd.org/changeset/base/254706 Log: libc: Access some unexported variables more efficiently (related to stdio). Modified: head/lib/libc/include/libc_private.h Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Fri Aug 23 14:18:24 2013 (r254705) +++ head/lib/libc/include/libc_private.h Fri Aug 23 14:23:54 2013 (r254706) @@ -83,7 +83,7 @@ void _rtld_error(const char *fmt, ...); #define FUNLOCKFILE(fp) if (__isthreaded) _funlockfile(fp) struct _spinlock; -extern struct _spinlock __stdio_thread_lock; +extern struct _spinlock __stdio_thread_lock __hidden; #define STDIO_THREAD_LOCK() \ do { \ if (__isthreaded) \ @@ -218,7 +218,7 @@ void _malloc_postfork(void); /* * Function to clean up streams, called from abort() and exit(). */ -extern void (*__cleanup)(void); +extern void (*__cleanup)(void) __hidden; /* * Get kern.osreldate to detect ABI revisions. Explicitly From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:24:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 94F51B3D; Fri, 23 Aug 2013 14:24:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 817792B0E; Fri, 23 Aug 2013 14:24:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEOlDU087273; Fri, 23 Aug 2013 14:24:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEOlMm087270; Fri, 23 Aug 2013 14:24:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231424.r7NEOlMm087270@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254707 - in stable/9: . sys/fs/devfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:24:47 -0000 Author: avg Date: Fri Aug 23 14:24:46 2013 New Revision: 254707 URL: http://svnweb.freebsd.org/changeset/base/254707 Log: MFC r253677,253679: make path matching in devfs rules consistent and sane (and safer) Modified: stable/9/UPDATING stable/9/sys/fs/devfs/devfs_rule.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Fri Aug 23 14:23:54 2013 (r254706) +++ stable/9/UPDATING Fri Aug 23 14:24:46 2013 (r254707) @@ -11,6 +11,13 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130823: + Behavior of devfs rules path matching has been changed. + Pattern is now always matched against fully qualified devfs + path and slash characters must be explicitly matched by + slashes in pattern (FNM_PATHNAME). Rulesets involving devfs + subdirectories must be reviewed. + 20130705: hastctl(8)'s `status' command output changed to terse one-liner format. Scripts using this should switch to `list' command or be rewritten. Modified: stable/9/sys/fs/devfs/devfs_rule.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_rule.c Fri Aug 23 14:23:54 2013 (r254706) +++ stable/9/sys/fs/devfs/devfs_rule.c Fri Aug 23 14:24:46 2013 (r254707) @@ -101,7 +101,7 @@ struct devfs_ruleset { static devfs_rid devfs_rid_input(devfs_rid rid, struct devfs_mount *dm); static void devfs_rule_applyde_recursive(struct devfs_krule *dk, - struct devfs_dirent *de); + struct devfs_mount *dm, struct devfs_dirent *de); static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm); static int devfs_rule_autonumber(struct devfs_ruleset *ds, devfs_rnum *rnp); static struct devfs_krule *devfs_rule_byid(devfs_rid rid); @@ -109,13 +109,16 @@ static int devfs_rule_delete(struct dev static struct cdev *devfs_rule_getdev(struct devfs_dirent *de); static int devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm); static int devfs_rule_insert(struct devfs_rule *dr); -static int devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de); -static int devfs_rule_matchpath(struct devfs_krule *dk, +static int devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de); +static int devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, struct devfs_dirent *de); -static void devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth); +static void devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth); static void devfs_ruleset_applyde(struct devfs_ruleset *ds, - struct devfs_dirent *de, unsigned depth); + struct devfs_mount *dm, struct devfs_dirent *de, + unsigned depth); static void devfs_ruleset_applydm(struct devfs_ruleset *ds, struct devfs_mount *dm); static struct devfs_ruleset *devfs_ruleset_bynum(devfs_rsnum rsnum); @@ -146,7 +149,7 @@ devfs_rules_apply(struct devfs_mount *dm sx_slock(&sx_rules); ds = devfs_ruleset_bynum(dm->dm_ruleset); KASSERT(ds != NULL, ("mount-point has NULL ruleset")); - devfs_ruleset_applyde(ds, de, devfs_rule_depth); + devfs_ruleset_applyde(ds, dm, de, devfs_rule_depth); sx_sunlock(&sx_rules); } @@ -337,13 +340,14 @@ devfs_rid_input(devfs_rid rid, struct de * XXX: a linear search could be done through the cdev list instead. */ static void -devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_dirent *de2; TAILQ_FOREACH(de2, &de->de_dlist, de_list) - devfs_rule_applyde_recursive(dk, de2); - devfs_rule_run(dk, de, devfs_rule_depth); + devfs_rule_applyde_recursive(dk, dm, de2); + devfs_rule_run(dk, dm, de, devfs_rule_depth); } /* @@ -353,7 +357,7 @@ static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm) { - devfs_rule_applyde_recursive(dk, dm->dm_rootdir); + devfs_rule_applyde_recursive(dk, dm, dm->dm_rootdir); } /* @@ -525,7 +529,8 @@ devfs_rule_insert(struct devfs_rule *dr) * de; 0, otherwise. */ static int -devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; struct cdev *dev; @@ -558,7 +563,7 @@ devfs_rule_match(struct devfs_krule *dk, dev_relthread(dev, ref); } if (dr->dr_icond & DRC_PATHPTRN) - if (!devfs_rule_matchpath(dk, de)) + if (!devfs_rule_matchpath(dk, dm, de)) return (0); return (1); @@ -568,35 +573,43 @@ devfs_rule_match(struct devfs_krule *dk, * Determine whether dk matches de on account of dr_pathptrn. */ static int -devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; - char *pname; struct cdev *dev; + int match; + char *pname, *specname; + specname = NULL; dev = devfs_rule_getdev(de); if (dev != NULL) pname = dev->si_name; else if (de->de_dirent->d_type == DT_LNK || - de->de_dirent->d_type == DT_DIR) - pname = de->de_dirent->d_name; - else + (de->de_dirent->d_type == DT_DIR && de != dm->dm_rootdir && + (de->de_flags & (DE_DOT | DE_DOTDOT)) == 0)) { + specname = malloc(SPECNAMELEN + 1, M_TEMP, M_WAITOK); + pname = devfs_fqpn(specname, dm, de, NULL); + } else return (0); - KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); - return (fnmatch(dr->dr_pathptrn, pname, 0) == 0); + KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); + match = fnmatch(dr->dr_pathptrn, pname, FNM_PATHNAME) == 0; + free(specname, M_TEMP); + return (match); } /* * Run dk on de. */ static void -devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth) +devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_rule *dr = &dk->dk_rule; struct devfs_ruleset *ds; - if (!devfs_rule_match(dk, de)) + if (!devfs_rule_match(dk, dm, de)) return; if (dr->dr_iacts & DRA_BACTS) { if (dr->dr_bacts & DRB_HIDE) @@ -623,7 +636,7 @@ devfs_rule_run(struct devfs_krule *dk, s if (depth > 0) { ds = devfs_ruleset_bynum(dk->dk_rule.dr_incset); KASSERT(ds != NULL, ("DRA_INCSET but bad dr_incset")); - devfs_ruleset_applyde(ds, de, depth - 1); + devfs_ruleset_applyde(ds, dm, de, depth - 1); } } } @@ -632,12 +645,13 @@ devfs_rule_run(struct devfs_krule *dk, s * Apply all the rules in ds to de. */ static void -devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_dirent *de, unsigned depth) +devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_krule *dk; TAILQ_FOREACH(dk, &ds->ds_rules, dk_list) - devfs_rule_run(dk, de, depth); + devfs_rule_run(dk, dm, de, depth); } /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:25:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DF6F7C67; Fri, 23 Aug 2013 14:25:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC61E2B14; Fri, 23 Aug 2013 14:25:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEP4h8087379; Fri, 23 Aug 2013 14:25:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEP43F087377; Fri, 23 Aug 2013 14:25:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231425.r7NEP43F087377@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254708 - in stable/8: . sys/fs/devfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:25:05 -0000 Author: avg Date: Fri Aug 23 14:25:04 2013 New Revision: 254708 URL: http://svnweb.freebsd.org/changeset/base/254708 Log: MFC r253677,253679: make path matching in devfs rules consistent and sane (and safer) Modified: stable/8/UPDATING stable/8/sys/fs/devfs/devfs_rule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Fri Aug 23 14:24:46 2013 (r254707) +++ stable/8/UPDATING Fri Aug 23 14:25:04 2013 (r254708) @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130823: + Behavior of devfs rules path matching has been changed. + Pattern is now always matched against fully qualified devfs + path and slash characters must be explicitly matched by + slashes in pattern (FNM_PATHNAME). Rulesets involving devfs + subdirectories must be reviewed. + 20130705: hastctl(8)'s `status' command output changed to terse one-liner format. Scripts using this should switch to `list' command or be rewritten. Modified: stable/8/sys/fs/devfs/devfs_rule.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_rule.c Fri Aug 23 14:24:46 2013 (r254707) +++ stable/8/sys/fs/devfs/devfs_rule.c Fri Aug 23 14:25:04 2013 (r254708) @@ -101,7 +101,7 @@ struct devfs_ruleset { static devfs_rid devfs_rid_input(devfs_rid rid, struct devfs_mount *dm); static void devfs_rule_applyde_recursive(struct devfs_krule *dk, - struct devfs_dirent *de); + struct devfs_mount *dm, struct devfs_dirent *de); static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm); static int devfs_rule_autonumber(struct devfs_ruleset *ds, devfs_rnum *rnp); static struct devfs_krule *devfs_rule_byid(devfs_rid rid); @@ -109,13 +109,16 @@ static int devfs_rule_delete(struct dev static struct cdev *devfs_rule_getdev(struct devfs_dirent *de); static int devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm); static int devfs_rule_insert(struct devfs_rule *dr); -static int devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de); -static int devfs_rule_matchpath(struct devfs_krule *dk, +static int devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de); +static int devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, struct devfs_dirent *de); -static void devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth); +static void devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth); static void devfs_ruleset_applyde(struct devfs_ruleset *ds, - struct devfs_dirent *de, unsigned depth); + struct devfs_mount *dm, struct devfs_dirent *de, + unsigned depth); static void devfs_ruleset_applydm(struct devfs_ruleset *ds, struct devfs_mount *dm); static struct devfs_ruleset *devfs_ruleset_bynum(devfs_rsnum rsnum); @@ -146,7 +149,7 @@ devfs_rules_apply(struct devfs_mount *dm sx_slock(&sx_rules); ds = devfs_ruleset_bynum(dm->dm_ruleset); KASSERT(ds != NULL, ("mount-point has NULL ruleset")); - devfs_ruleset_applyde(ds, de, devfs_rule_depth); + devfs_ruleset_applyde(ds, dm, de, devfs_rule_depth); sx_sunlock(&sx_rules); } @@ -337,13 +340,14 @@ devfs_rid_input(devfs_rid rid, struct de * XXX: a linear search could be done through the cdev list instead. */ static void -devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_dirent *de2; TAILQ_FOREACH(de2, &de->de_dlist, de_list) - devfs_rule_applyde_recursive(dk, de2); - devfs_rule_run(dk, de, devfs_rule_depth); + devfs_rule_applyde_recursive(dk, dm, de2); + devfs_rule_run(dk, dm, de, devfs_rule_depth); } /* @@ -353,7 +357,7 @@ static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm) { - devfs_rule_applyde_recursive(dk, dm->dm_rootdir); + devfs_rule_applyde_recursive(dk, dm, dm->dm_rootdir); } /* @@ -525,7 +529,8 @@ devfs_rule_insert(struct devfs_rule *dr) * de; 0, otherwise. */ static int -devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; struct cdev *dev; @@ -558,7 +563,7 @@ devfs_rule_match(struct devfs_krule *dk, dev_relthread(dev, ref); } if (dr->dr_icond & DRC_PATHPTRN) - if (!devfs_rule_matchpath(dk, de)) + if (!devfs_rule_matchpath(dk, dm, de)) return (0); return (1); @@ -568,35 +573,43 @@ devfs_rule_match(struct devfs_krule *dk, * Determine whether dk matches de on account of dr_pathptrn. */ static int -devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de) +devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; - char *pname; struct cdev *dev; + int match; + char *pname, *specname; + specname = NULL; dev = devfs_rule_getdev(de); if (dev != NULL) pname = dev->si_name; else if (de->de_dirent->d_type == DT_LNK || - de->de_dirent->d_type == DT_DIR) - pname = de->de_dirent->d_name; - else + (de->de_dirent->d_type == DT_DIR && de != dm->dm_rootdir && + (de->de_flags & (DE_DOT | DE_DOTDOT)) == 0)) { + specname = malloc(SPECNAMELEN + 1, M_TEMP, M_WAITOK); + pname = devfs_fqpn(specname, dm, de, NULL); + } else return (0); - KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); - return (fnmatch(dr->dr_pathptrn, pname, 0) == 0); + KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); + match = fnmatch(dr->dr_pathptrn, pname, FNM_PATHNAME) == 0; + free(specname, M_TEMP); + return (match); } /* * Run dk on de. */ static void -devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, unsigned depth) +devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_rule *dr = &dk->dk_rule; struct devfs_ruleset *ds; - if (!devfs_rule_match(dk, de)) + if (!devfs_rule_match(dk, dm, de)) return; if (dr->dr_iacts & DRA_BACTS) { if (dr->dr_bacts & DRB_HIDE) @@ -623,7 +636,7 @@ devfs_rule_run(struct devfs_krule *dk, s if (depth > 0) { ds = devfs_ruleset_bynum(dk->dk_rule.dr_incset); KASSERT(ds != NULL, ("DRA_INCSET but bad dr_incset")); - devfs_ruleset_applyde(ds, de, depth - 1); + devfs_ruleset_applyde(ds, dm, de, depth - 1); } } } @@ -632,12 +645,13 @@ devfs_rule_run(struct devfs_krule *dk, s * Apply all the rules in ds to de. */ static void -devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_dirent *de, unsigned depth) +devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_mount *dm, + struct devfs_dirent *de, unsigned depth) { struct devfs_krule *dk; TAILQ_FOREACH(dk, &ds->ds_rules, dk_list) - devfs_rule_run(dk, de, depth); + devfs_rule_run(dk, dm, de, depth); } /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:31:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 96313ECE; Fri, 23 Aug 2013 14:31:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83C0F2B76; Fri, 23 Aug 2013 14:31:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEV5I1091270; Fri, 23 Aug 2013 14:31:05 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEV5OU091269; Fri, 23 Aug 2013 14:31:05 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231431.r7NEV5OU091269@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 14:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254709 - head/lib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:31:05 -0000 Author: emaste Date: Fri Aug 23 14:31:05 2013 New Revision: 254709 URL: http://svnweb.freebsd.org/changeset/base/254709 Log: Add libexecinfo Makefile Sponsored by: DARPA, AFRL Added: head/lib/libexecinfo/ head/lib/libexecinfo/Makefile (contents, props changed) Added: head/lib/libexecinfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libexecinfo/Makefile Fri Aug 23 14:31:05 2013 (r254709) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +LIBEXECINFO= ${.CURDIR}/../../contrib/libexecinfo + +LIB= execinfo + +.PATH: ${LIBEXECINFO} + +INCS= execinfo.h symtab.h unwind.h +SRCS= backtrace.c symtab.c unwind.c + +MAN= backtrace.3 + +MLINKS+= backtrace.3 backtrace_symbols.3 +MLINKS+= backtrace.3 backtrace_symbols_fmt.3 +MLINKS+= backtrace.3 backtrace_symbols_fd.3 +MLINKS+= backtrace.3 backtrace_symbols_fd_fmt.3 + +.include From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:33:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 01153CB; Fri, 23 Aug 2013 14:33:56 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2C4B2B98; Fri, 23 Aug 2013 14:33:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEXuWR092071; Fri, 23 Aug 2013 14:33:56 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEXuxP092070; Fri, 23 Aug 2013 14:33:56 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201308231433.r7NEXuxP092070@svn.freebsd.org> From: Davide Italiano Date: Fri, 23 Aug 2013 14:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254710 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:33:57 -0000 Author: davide Date: Fri Aug 23 14:33:56 2013 New Revision: 254710 URL: http://svnweb.freebsd.org/changeset/base/254710 Log: - Bump date. - Small mdoc fix. Submitted by: pluknet Modified: head/share/man/man9/timeout.9 Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Fri Aug 23 14:31:05 2013 (r254709) +++ head/share/man/man9/timeout.9 Fri Aug 23 14:33:56 2013 (r254710) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2013 +.Dd August 23, 2013 .Dt TIMEOUT 9 .Os .Sh NAME @@ -270,7 +270,7 @@ argument. If an .Fa rm argument is specified, the lock should be created without passing the -.It Dv RM_SLEEPABLE +.Dv RM_SLEEPABLE flag. The usable lock classes are currently limited to mutexes, rwlocks and non-sleepable rmlocks, because callout handlers run in softclock swi, From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:40:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E49AB295; Fri, 23 Aug 2013 14:40:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0D1B2BD5; Fri, 23 Aug 2013 14:40:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEeATw095552; Fri, 23 Aug 2013 14:40:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEeArT095549; Fri, 23 Aug 2013 14:40:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231440.r7NEeArT095549@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254711 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:40:11 -0000 Author: avg Date: Fri Aug 23 14:40:09 2013 New Revision: 254711 URL: http://svnweb.freebsd.org/changeset/base/254711 Log: zfs: inline and remove zfs_vnode_lock It didn't serve any useful purpose, but obscured file and line information useful for debugging. MFC after: 5 days X-MFC with: r254445 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Aug 23 14:33:56 2013 (r254710) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Aug 23 14:40:09 2013 (r254711) @@ -156,7 +156,6 @@ extern int zfs_set_version(zfsvfs_t *zfs extern int zfsvfs_create(const char *name, zfsvfs_t **zfvp); extern void zfsvfs_free(zfsvfs_t *zfsvfs); extern int zfs_check_global_label(const char *dsname, const char *hexsl); -extern int zfs_vnode_lock(vnode_t *vp, int flags); #ifdef _KERNEL extern void zfsvfs_update_fromname(const char *oldname, const char *newname); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Aug 23 14:33:56 2013 (r254710) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Aug 23 14:40:09 2013 (r254711) @@ -1796,15 +1796,6 @@ zfs_statfs(vfs_t *vfsp, struct statfs *s return (0); } -int -zfs_vnode_lock(vnode_t *vp, int flags) -{ - - ASSERT(vp != NULL); - - return (vn_lock(vp, flags)); -} - static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp) { @@ -1821,7 +1812,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t ZFS_EXIT(zfsvfs); if (error == 0) { - error = zfs_vnode_lock(*vpp, flags); + error = vn_lock(*vpp, flags); if (error == 0) (*vpp)->v_vflag |= VV_ROOT; } @@ -2082,7 +2073,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla *vpp = ZTOV(zp); ZFS_EXIT(zfsvfs); if (err == 0) - err = zfs_vnode_lock(*vpp, flags); + err = vn_lock(*vpp, flags); if (err != 0) *vpp = NULL; else @@ -2181,7 +2172,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int VN_HOLD(*vpp); } ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, flags); + err = vn_lock(*vpp, flags); if (err != 0) *vpp = NULL; return (err); @@ -2208,7 +2199,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int *vpp = ZTOV(zp); ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, flags | LK_RETRY); + err = vn_lock(*vpp, flags | LK_RETRY); if (err == 0) vnode_create_vobject(*vpp, zp->z_size, curthread); else Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Aug 23 14:33:56 2013 (r254710) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Aug 23 14:40:09 2013 (r254711) @@ -1526,7 +1526,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode VOP_UNLOCK(dvp, 0); } ZFS_EXIT(zfsvfs); - error = zfs_vnode_lock(*vpp, cnp->cn_lkflags); + error = vn_lock(*vpp, cnp->cn_lkflags); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, ltype | LK_RETRY); if (error != 0) { From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:40:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9C46339D; Fri, 23 Aug 2013 14:40:17 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B07B2BD9; Fri, 23 Aug 2013 14:40:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEeHvd095742; Fri, 23 Aug 2013 14:40:17 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEeHMr095741; Fri, 23 Aug 2013 14:40:17 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201308231440.r7NEeHMr095741@svn.freebsd.org> From: Davide Italiano Date: Fri, 23 Aug 2013 14:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254712 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:40:17 -0000 Author: davide Date: Fri Aug 23 14:40:17 2013 New Revision: 254712 URL: http://svnweb.freebsd.org/changeset/base/254712 Log: Fix the build and fix style. Pointy-hat to: davide Modified: head/sys/sys/callout.h Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Fri Aug 23 14:40:09 2013 (r254711) +++ head/sys/sys/callout.h Fri Aug 23 14:40:17 2013 (r254712) @@ -71,8 +71,8 @@ void _callout_init_lock(struct callout * #define callout_init_mtx(c, mtx, flags) \ _callout_init_lock((c), ((mtx) != NULL) ? &(mtx)->lock_object : \ NULL, (flags)) -#define callout_init_rm(c, rm, flags) - _callout_init_lock((c), ((rm != NULL) ? &(rm)->lock_object : \ +#define callout_init_rm(c, rm, flags) \ + _callout_init_lock((c), ((rm != NULL) ? &(rm)->lock_object : \ NULL, (flags)) #define callout_init_rw(c, rw, flags) \ _callout_init_lock((c), ((rw) != NULL) ? &(rw)->lock_object : \ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:41:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 41400516; Fri, 23 Aug 2013 14:41:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2EBE32C08; Fri, 23 Aug 2013 14:41:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEfSb6096232; Fri, 23 Aug 2013 14:41:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEfSjs096231; Fri, 23 Aug 2013 14:41:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231441.r7NEfSjs096231@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254713 - head/sys/cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:41:28 -0000 Author: avg Date: Fri Aug 23 14:41:27 2013 New Revision: 254713 URL: http://svnweb.freebsd.org/changeset/base/254713 Log: fbt: drop a local write-only variable Discovered with: gcc46 MFC after: 4 days Modified: head/sys/cddl/dev/fbt/fbt.c Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Fri Aug 23 14:40:17 2013 (r254712) +++ head/sys/cddl/dev/fbt/fbt.c Fri Aug 23 14:41:27 2013 (r254713) @@ -574,7 +574,6 @@ static int fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc) { const Elf_Sym *symp = lc->symtab;; - const char *name; const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t); int i; @@ -606,11 +605,6 @@ fbt_ctfoff_init(modctl_t *lf, linker_ctf continue; } - if (symp->st_name < lc->strcnt) - name = lc->strtab + symp->st_name; - else - name = "(?)"; - switch (ELF_ST_TYPE(symp->st_info)) { case STT_OBJECT: if (objtoff >= hp->cth_funcoff || From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:43:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 074EE68A; Fri, 23 Aug 2013 14:43:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8E0D2C25; Fri, 23 Aug 2013 14:43:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEhWwe096930; Fri, 23 Aug 2013 14:43:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEhWw8096929; Fri, 23 Aug 2013 14:43:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231443.r7NEhWw8096929@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 14:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254714 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:43:33 -0000 Author: avg Date: Fri Aug 23 14:43:32 2013 New Revision: 254714 URL: http://svnweb.freebsd.org/changeset/base/254714 Log: zfs: do not reject any operations on a pool just because it's a boot pool Unlike the upstream FreeBSD supports booting to all kinds of pools. Requested by: many Tested by: sbruno MFC after: 12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 23 14:41:27 2013 (r254713) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 23 14:43:32 2013 (r254714) @@ -1828,6 +1828,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc) (void) nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_SPARES, &spares, &nspares); +#ifdef illumos /* * A root pool with concatenated devices is not supported. * Thus, can not add a device to a root pool. @@ -1843,6 +1844,7 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc) spa_close(spa, FTAG); return (SET_ERROR(EDOM)); } +#endif /* illumos */ if (error == 0) { error = spa_vdev_add(spa, config); From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:50:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8D99483D; Fri, 23 Aug 2013 14:50:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B74C2C63; Fri, 23 Aug 2013 14:50:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NEo46E098938; Fri, 23 Aug 2013 14:50:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NEo4iC098937; Fri, 23 Aug 2013 14:50:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201308231450.r7NEo4iC098937@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 23 Aug 2013 14:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254715 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:50:04 -0000 Author: kib Date: Fri Aug 23 14:50:03 2013 New Revision: 254715 URL: http://svnweb.freebsd.org/changeset/base/254715 Log: Since the 253927, which removed the soft busy call for the sf page, it does not make sense to wait for the soft busy state of the page to drain. The vm object lock is dropped immediately after, so the result of the wait is invalidated. It might make sense to not wait for the hard busy state as well, esp. for the fully valid page, but this is postponed for now. Reviewed by: alc Tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Aug 23 14:43:32 2013 (r254714) +++ head/sys/kern/uipc_syscalls.c Fri Aug 23 14:50:03 2013 (r254715) @@ -2230,7 +2230,8 @@ retry_space: pindex = OFF_TO_IDX(off); VM_OBJECT_WLOCK(obj); pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED); + VM_ALLOC_IGN_SBUSY | VM_ALLOC_NORMAL | + VM_ALLOC_WIRED); /* * Check if page is valid for what we need, From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:54:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BDF579E7; Fri, 23 Aug 2013 14:54:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94B0E2CB5; Fri, 23 Aug 2013 14:54:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C1A3EB924; Fri, 23 Aug 2013 10:54:01 -0400 (EDT) From: John Baldwin To: Davide Italiano Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys Date: Fri, 23 Aug 2013 10:51:08 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308231412.r7NECdG7081565@svn.freebsd.org> In-Reply-To: <201308231412.r7NECdG7081565@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201308231051.08997.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 Aug 2013 10:54:01 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:54:06 -0000 On Friday, August 23, 2013 10:12:39 am Davide Italiano wrote: > Author: davide > Date: Fri Aug 23 14:12:39 2013 > New Revision: 254703 > URL: http://svnweb.freebsd.org/changeset/base/254703 > > Log: > Introduce callout_init_rm() so that callouts can be used in conjunction > with rmlocks. This works only with non-sleepable rm because handlers run > in SWI context. While here, document the new KPI in the timeout(9) > manpage. It also only works with exclusive locks. (lc_unlock/lc_lock only handle write locks for rmlocks). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 14:54:15 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8ABE3AF9; Fri, 23 Aug 2013 14:54:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6044B2CB7; Fri, 23 Aug 2013 14:54:15 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VCskg-0006pr-4O; Fri, 23 Aug 2013 14:54:14 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r7NEsBGh047930; Fri, 23 Aug 2013 08:54:11 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/OzcZi8D3ikjFJO+F97r5I Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys From: Ian Lepore To: Davide Italiano In-Reply-To: <201308231412.r7NECdG7081565@svn.freebsd.org> References: <201308231412.r7NECdG7081565@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 23 Aug 2013 08:54:11 -0600 Message-ID: <1377269651.1111.64.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 14:54:15 -0000 On Fri, 2013-08-23 at 14:12 +0000, Davide Italiano wrote: > +#define callout_init_rm(c, rm, flags) A missing '\' at the end of this line is causing compilation failure. -- Ian From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 15:07:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D5F7E8F; Fri, 23 Aug 2013 15:07:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8962D62; Fri, 23 Aug 2013 15:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NF7sO9008516; Fri, 23 Aug 2013 15:07:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NF7spP008515; Fri, 23 Aug 2013 15:07:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201308231507.r7NF7spP008515@svn.freebsd.org> From: Ian Lepore Date: Fri, 23 Aug 2013 15:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254716 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 15:07:54 -0000 Author: ian Date: Fri Aug 23 15:07:54 2013 New Revision: 254716 URL: http://svnweb.freebsd.org/changeset/base/254716 Log: Don't give up so easily on failure of CMD55 to put the card into app-cmd mode. We don't know why it failed, so we can't know that a retry will also fail (the low-level driver might have reset the controller state machine or something similar that would allow a retry to work). Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Fri Aug 23 14:50:03 2013 (r254715) +++ head/sys/dev/mmc/mmc.c Fri Aug 23 15:07:54 2013 (r254716) @@ -106,7 +106,7 @@ struct mmc_ivars { #define CMD_RETRIES 3 -#define CARD_ID_FREQUENCY 400000 /* Spec requires 400KHz max during ID phase. */ +#define CARD_ID_FREQUENCY 400000 /* Spec requires 400kHz max during ID phase. */ static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); @@ -447,8 +447,8 @@ mmc_wait_for_app_cmd(struct mmc_softc *s err = appcmd.error; if (err == MMC_ERR_NONE) { if (!(appcmd.resp[0] & R1_APP_CMD)) - return MMC_ERR_FAILED; /* Retries won't help. */ - if (mmc_wait_for_cmd(sc, cmd, 0) != 0) + err = MMC_ERR_FAILED; + else if (mmc_wait_for_cmd(sc, cmd, 0) != 0) err = MMC_ERR_FAILED; else err = cmd->error; From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 15:29:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18C2EA4C; Fri, 23 Aug 2013 15:29:47 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x229.google.com (mail-vc0-x229.google.com [IPv6:2607:f8b0:400c:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 951562ED2; Fri, 23 Aug 2013 15:29:46 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id ib11so530825vcb.14 for ; Fri, 23 Aug 2013 08:29:45 -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:message-id:subject :from:to:cc:content-type; bh=KhQFOwx9xDErVqyz5jnCLJpVqZvLivfJoAbml3CBV8s=; b=G0lg5qXvppwtQ5ZmJ65PsOVCo7ldgMv7OZjl60OorA+UJodF/XylNXuXZ5VQY5Cvcs Ezy3/JrSxpdiZjQqq3UXqPQQZx99+LfZrZiAdUdJ3z0SVwxxPBg9+gG/ays8f564FxZG Wf6BCDGRlDzuwSXeIHB81f2PGnYhplCSzpJnEvEl++jcbGDDu1ZQzmyoctJpyonWNG3t SxzySlEaKtCe6so3zwnwu02o92LdKPsavDmvO85ZZQ/94//9MBqA9l9ReSpxBUM1U286 VCbAwwH0SxVT8b/87F9u2StQBsMjqkQewLRb6fdbSpaVFGYhRCD1ORC0Wc61JOiK2Rta m2MQ== MIME-Version: 1.0 X-Received: by 10.52.103.35 with SMTP id ft3mr108529vdb.5.1377271785679; Fri, 23 Aug 2013 08:29:45 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Fri, 23 Aug 2013 08:29:45 -0700 (PDT) In-Reply-To: <201308231051.08997.jhb@freebsd.org> References: <201308231412.r7NECdG7081565@svn.freebsd.org> <201308231051.08997.jhb@freebsd.org> Date: Fri, 23 Aug 2013 17:29:45 +0200 X-Google-Sender-Auth: _kF8COaHH59vE4w7VIdavWq-fVU Message-ID: Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys From: Davide Italiano To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 15:29:47 -0000 On Fri, Aug 23, 2013 at 4:51 PM, John Baldwin wrote: > On Friday, August 23, 2013 10:12:39 am Davide Italiano wrote: >> Author: davide >> Date: Fri Aug 23 14:12:39 2013 >> New Revision: 254703 >> URL: http://svnweb.freebsd.org/changeset/base/254703 >> >> Log: >> Introduce callout_init_rm() so that callouts can be used in conjunction >> with rmlocks. This works only with non-sleepable rm because handlers run >> in SWI context. While here, document the new KPI in the timeout(9) >> manpage. > > It also only works with exclusive locks. (lc_unlock/lc_lock only handle > write locks for rmlocks). > > -- > John Baldwin Thanks for pointing out this. I think it would be nice to have lc_lock/lc_unlock working both for shared and exclusive locks but I'm not 100% sure about all the implications/complications. From what I see for rwlocks asserting if a lock is held in read-mode is really cheap (check against a flag) while for rmlocks the assertion relies on traversing the tracker list for the rmlock so I'm worried this operation could be expensive. What's your opinion about? Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 16:54:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A6D86F48; Fri, 23 Aug 2013 16:54:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9354A23F3; Fri, 23 Aug 2013 16:54:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NGscdh061510; Fri, 23 Aug 2013 16:54:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NGscB7061509; Fri, 23 Aug 2013 16:54:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308231654.r7NGscB7061509@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 23 Aug 2013 16:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254717 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 16:54:38 -0000 Author: jkim Date: Fri Aug 23 16:54:38 2013 New Revision: 254717 URL: http://svnweb.freebsd.org/changeset/base/254717 Log: Fix a whitespace. Modified: head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Fri Aug 23 15:07:54 2013 (r254716) +++ head/sys/kern/vfs_cluster.c Fri Aug 23 16:54:38 2013 (r254717) @@ -961,7 +961,7 @@ cluster_wbuild(struct vnode *vp, long si VM_OBJECT_WLOCK(tbp->b_bufobj->bo_object); if (i == 0) { vfs_drain_busy_pages(tbp); - } else { /* if not first buffer */ + } else { /* if not first buffer */ for (j = 0; j < tbp->b_npages; j += 1) { m = tbp->b_pages[j]; if (vm_page_xbusied(m)) { From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 17:03:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 073C53BC; Fri, 23 Aug 2013 17:03:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D95832489; Fri, 23 Aug 2013 17:03:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NH3htH066468; Fri, 23 Aug 2013 17:03:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NH3hok066466; Fri, 23 Aug 2013 17:03:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201308231703.r7NH3hok066466@svn.freebsd.org> From: Andriy Gapon Date: Fri, 23 Aug 2013 17:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254718 - stable/8/sys/fs/devfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:03:44 -0000 Author: avg Date: Fri Aug 23 17:03:43 2013 New Revision: 254718 URL: http://svnweb.freebsd.org/changeset/base/254718 Log: MFC r212966: Modify devfs_fqpn() for future use in devfs path reference counting code This should fix build failure introduced in r254708. Pointyhat to: avg MFC slacker: jh Modified: stable/8/sys/fs/devfs/devfs.h stable/8/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/devfs/devfs.h ============================================================================== --- stable/8/sys/fs/devfs/devfs.h Fri Aug 23 16:54:38 2013 (r254717) +++ stable/8/sys/fs/devfs/devfs.h Fri Aug 23 17:03:43 2013 (r254718) @@ -122,6 +122,8 @@ struct devfs_rule { MALLOC_DECLARE(M_DEVFS); #endif +struct componentname; + struct devfs_dirent { struct cdev_priv *de_cdp; int de_inode; @@ -176,6 +178,8 @@ void devfs_ruleset_set(devfs_rsnum rsnum void devfs_ruleset_apply(struct devfs_mount *dm); int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, struct vnode **vpp); +char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, + struct componentname *); void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked); void devfs_dirent_free(struct devfs_dirent *de); void devfs_populate (struct devfs_mount *dm); Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Fri Aug 23 16:54:38 2013 (r254717) +++ stable/8/sys/fs/devfs/devfs_vnops.c Fri Aug 23 17:03:43 2013 (r254718) @@ -253,29 +253,34 @@ finished: } /* - * Construct the fully qualified path name relative to the mountpoint + * Construct the fully qualified path name relative to the mountpoint. + * If a NULL cnp is provided, no '/' is appended to the resulting path. */ -static char * -devfs_fqpn(char *buf, struct vnode *dvp, struct componentname *cnp) +char * +devfs_fqpn(char *buf, struct devfs_mount *dmp, struct devfs_dirent *dd, + struct componentname *cnp) { int i; - struct devfs_dirent *de, *dd; - struct devfs_mount *dmp; + struct devfs_dirent *de; + + sx_assert(&dmp->dm_lock, SA_LOCKED); - dmp = VFSTODEVFS(dvp->v_mount); - dd = dvp->v_data; i = SPECNAMELEN; buf[i] = '\0'; - i -= cnp->cn_namelen; + if (cnp != NULL) + i -= cnp->cn_namelen; if (i < 0) return (NULL); - bcopy(cnp->cn_nameptr, buf + i, cnp->cn_namelen); + if (cnp != NULL) + bcopy(cnp->cn_nameptr, buf + i, cnp->cn_namelen); de = dd; while (de != dmp->dm_rootdir) { - i--; - if (i < 0) - return (NULL); - buf[i] = '/'; + if (cnp != NULL || i < SPECNAMELEN) { + i--; + if (i < 0) + return (NULL); + buf[i] = '/'; + } i -= de->de_dirent->d_namlen; if (i < 0) return (NULL); @@ -838,7 +843,7 @@ devfs_lookupx(struct vop_lookup_args *ap * OK, we didn't have an entry for the name we were asked for * so we try to see if anybody can create it on demand. */ - pname = devfs_fqpn(specname, dvp, cnp); + pname = devfs_fqpn(specname, dmp, dd, cnp); if (pname == NULL) break; From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 17:27:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8687A53; Fri, 23 Aug 2013 17:27:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABF4D25C8; Fri, 23 Aug 2013 17:27:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NHRDHl077454; Fri, 23 Aug 2013 17:27:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NHRDUI077451; Fri, 23 Aug 2013 17:27:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201308231727.r7NHRDUI077451@svn.freebsd.org> From: Alan Cox Date: Fri, 23 Aug 2013 17:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254719 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:27:13 -0000 Author: alc Date: Fri Aug 23 17:27:12 2013 New Revision: 254719 URL: http://svnweb.freebsd.org/changeset/base/254719 Log: Addendum to r254141: The call to vm_radix_insert() in vm_page_cache() can reclaim the last preexisting cached page in the object, resulting in a call to vdrop(). Detect this scenario so that the vnode's hold count is correctly maintained. Otherwise, we panic. Reported by: scottl Tested by: pho Discussed with: attilio, jeff, kib Modified: head/sys/vm/vm_page.c head/sys/vm/vm_radix.c head/sys/vm/vm_radix.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Aug 23 17:03:43 2013 (r254718) +++ head/sys/vm/vm_page.c Fri Aug 23 17:27:12 2013 (r254719) @@ -2558,6 +2558,15 @@ vm_page_cache(vm_page_t m) vm_page_free(m); return; } + + /* + * The above call to vm_radix_insert() could reclaim the one pre- + * existing cached page from this object, resulting in a call to + * vdrop(). + */ + if (!cache_was_empty) + cache_was_empty = vm_radix_is_singleton(&object->cache); + m->flags |= PG_CACHED; cnt.v_cache_count++; PCPU_INC(cnt.v_tcached); Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Fri Aug 23 17:03:43 2013 (r254718) +++ head/sys/vm/vm_radix.c Fri Aug 23 17:27:12 2013 (r254719) @@ -432,6 +432,21 @@ restart: } /* + * Returns TRUE if the specified radix tree contains a single leaf and FALSE + * otherwise. + */ +boolean_t +vm_radix_is_singleton(struct vm_radix *rtree) +{ + struct vm_radix_node *rnode; + + rnode = vm_radix_getroot(rtree); + if (rnode == NULL) + return (FALSE); + return (vm_radix_isleaf(rnode)); +} + +/* * Returns the value stored at the index. If the index is not present, * NULL is returned. */ Modified: head/sys/vm/vm_radix.h ============================================================================== --- head/sys/vm/vm_radix.h Fri Aug 23 17:03:43 2013 (r254718) +++ head/sys/vm/vm_radix.h Fri Aug 23 17:27:12 2013 (r254719) @@ -37,6 +37,7 @@ void vm_radix_init(void); int vm_radix_insert(struct vm_radix *rtree, vm_page_t page); +boolean_t vm_radix_is_singleton(struct vm_radix *rtree); vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index); From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 17:38:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 65255E17; Fri, 23 Aug 2013 17:38:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A7CD2654; Fri, 23 Aug 2013 17:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NHcXZG082626; Fri, 23 Aug 2013 17:38:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NHcXUh082625; Fri, 23 Aug 2013 17:38:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231738.r7NHcXUh082625@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 17:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r254720 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:38:33 -0000 Author: emaste Date: Fri Aug 23 17:38:32 2013 New Revision: 254720 URL: http://svnweb.freebsd.org/changeset/base/254720 Log: Prepare to import lldb (about 13MB) Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Fri Aug 23 17:27:12 2013 (r254719) +++ svnadmin/conf/sizelimit.conf Fri Aug 23 17:38:32 2013 (r254720) @@ -23,6 +23,7 @@ brooks des dim ed +emaste 102400000 gnn gonzo imp From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 17:46:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7647C262; Fri, 23 Aug 2013 17:46:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F43F26F4; Fri, 23 Aug 2013 17:46:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NHkfjT087175; Fri, 23 Aug 2013 17:46:41 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NHkdg8087163; Fri, 23 Aug 2013 17:46:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231746.r7NHkdg8087163@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 17:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254721 - in vendor/lldb: . dist dist/include dist/include/lldb dist/include/lldb/API dist/include/lldb/Breakpoint dist/include/lldb/Core dist/include/lldb/DataFormatters dist/include/l... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:46:41 -0000 Author: emaste Date: Fri Aug 23 17:46:38 2013 New Revision: 254721 URL: http://svnweb.freebsd.org/changeset/base/254721 Log: Import lldb as of SVN r188801 (A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL Added: vendor/lldb/ vendor/lldb/dist/ vendor/lldb/dist/LICENSE.TXT vendor/lldb/dist/include/ vendor/lldb/dist/include/lldb/ vendor/lldb/dist/include/lldb/API/ vendor/lldb/dist/include/lldb/API/LLDB.h vendor/lldb/dist/include/lldb/API/SBAddress.h vendor/lldb/dist/include/lldb/API/SBBlock.h vendor/lldb/dist/include/lldb/API/SBBreakpoint.h vendor/lldb/dist/include/lldb/API/SBBreakpointLocation.h vendor/lldb/dist/include/lldb/API/SBBroadcaster.h vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h vendor/lldb/dist/include/lldb/API/SBCommandReturnObject.h vendor/lldb/dist/include/lldb/API/SBCommunication.h vendor/lldb/dist/include/lldb/API/SBCompileUnit.h vendor/lldb/dist/include/lldb/API/SBData.h vendor/lldb/dist/include/lldb/API/SBDebugger.h vendor/lldb/dist/include/lldb/API/SBDeclaration.h vendor/lldb/dist/include/lldb/API/SBDefines.h vendor/lldb/dist/include/lldb/API/SBError.h vendor/lldb/dist/include/lldb/API/SBEvent.h vendor/lldb/dist/include/lldb/API/SBExpressionOptions.h vendor/lldb/dist/include/lldb/API/SBFileSpec.h vendor/lldb/dist/include/lldb/API/SBFileSpecList.h vendor/lldb/dist/include/lldb/API/SBFrame.h vendor/lldb/dist/include/lldb/API/SBFunction.h vendor/lldb/dist/include/lldb/API/SBHostOS.h vendor/lldb/dist/include/lldb/API/SBInputReader.h vendor/lldb/dist/include/lldb/API/SBInstruction.h vendor/lldb/dist/include/lldb/API/SBInstructionList.h vendor/lldb/dist/include/lldb/API/SBLineEntry.h vendor/lldb/dist/include/lldb/API/SBListener.h vendor/lldb/dist/include/lldb/API/SBModule.h vendor/lldb/dist/include/lldb/API/SBModuleSpec.h vendor/lldb/dist/include/lldb/API/SBProcess.h vendor/lldb/dist/include/lldb/API/SBSection.h vendor/lldb/dist/include/lldb/API/SBSourceManager.h vendor/lldb/dist/include/lldb/API/SBStream.h vendor/lldb/dist/include/lldb/API/SBStringList.h vendor/lldb/dist/include/lldb/API/SBSymbol.h vendor/lldb/dist/include/lldb/API/SBSymbolContext.h vendor/lldb/dist/include/lldb/API/SBSymbolContextList.h vendor/lldb/dist/include/lldb/API/SBTarget.h vendor/lldb/dist/include/lldb/API/SBThread.h vendor/lldb/dist/include/lldb/API/SBType.h vendor/lldb/dist/include/lldb/API/SBTypeCategory.h vendor/lldb/dist/include/lldb/API/SBTypeFilter.h vendor/lldb/dist/include/lldb/API/SBTypeFormat.h vendor/lldb/dist/include/lldb/API/SBTypeNameSpecifier.h vendor/lldb/dist/include/lldb/API/SBTypeSummary.h vendor/lldb/dist/include/lldb/API/SBTypeSynthetic.h vendor/lldb/dist/include/lldb/API/SBValue.h vendor/lldb/dist/include/lldb/API/SBValueList.h vendor/lldb/dist/include/lldb/API/SBWatchpoint.h vendor/lldb/dist/include/lldb/Breakpoint/ vendor/lldb/dist/include/lldb/Breakpoint/Breakpoint.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointID.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointIDList.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointList.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocation.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocationCollection.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocationList.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointOptions.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointResolver.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointResolverAddress.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointResolverFileLine.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointResolverFileRegex.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointResolverName.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointSite.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointSiteList.h vendor/lldb/dist/include/lldb/Breakpoint/Stoppoint.h vendor/lldb/dist/include/lldb/Breakpoint/StoppointCallbackContext.h vendor/lldb/dist/include/lldb/Breakpoint/StoppointLocation.h vendor/lldb/dist/include/lldb/Breakpoint/Watchpoint.h vendor/lldb/dist/include/lldb/Breakpoint/WatchpointList.h vendor/lldb/dist/include/lldb/Breakpoint/WatchpointOptions.h vendor/lldb/dist/include/lldb/Core/ vendor/lldb/dist/include/lldb/Core/Address.h vendor/lldb/dist/include/lldb/Core/AddressRange.h vendor/lldb/dist/include/lldb/Core/AddressResolver.h vendor/lldb/dist/include/lldb/Core/AddressResolverFileLine.h vendor/lldb/dist/include/lldb/Core/AddressResolverName.h vendor/lldb/dist/include/lldb/Core/ArchSpec.h vendor/lldb/dist/include/lldb/Core/Baton.h vendor/lldb/dist/include/lldb/Core/Broadcaster.h vendor/lldb/dist/include/lldb/Core/ClangForward.h vendor/lldb/dist/include/lldb/Core/Communication.h vendor/lldb/dist/include/lldb/Core/Connection.h vendor/lldb/dist/include/lldb/Core/ConnectionFileDescriptor.h vendor/lldb/dist/include/lldb/Core/ConnectionMachPort.h vendor/lldb/dist/include/lldb/Core/ConnectionSharedMemory.h vendor/lldb/dist/include/lldb/Core/ConstString.h vendor/lldb/dist/include/lldb/Core/DataBuffer.h vendor/lldb/dist/include/lldb/Core/DataBufferHeap.h vendor/lldb/dist/include/lldb/Core/DataBufferMemoryMap.h vendor/lldb/dist/include/lldb/Core/DataEncoder.h vendor/lldb/dist/include/lldb/Core/DataExtractor.h vendor/lldb/dist/include/lldb/Core/Debugger.h vendor/lldb/dist/include/lldb/Core/Disassembler.h vendor/lldb/dist/include/lldb/Core/EmulateInstruction.h vendor/lldb/dist/include/lldb/Core/Error.h vendor/lldb/dist/include/lldb/Core/Event.h vendor/lldb/dist/include/lldb/Core/FileLineResolver.h vendor/lldb/dist/include/lldb/Core/FileSpecList.h vendor/lldb/dist/include/lldb/Core/Flags.h vendor/lldb/dist/include/lldb/Core/History.h vendor/lldb/dist/include/lldb/Core/IOStreamMacros.h vendor/lldb/dist/include/lldb/Core/InputReader.h vendor/lldb/dist/include/lldb/Core/InputReaderEZ.h vendor/lldb/dist/include/lldb/Core/InputReaderStack.h vendor/lldb/dist/include/lldb/Core/Language.h vendor/lldb/dist/include/lldb/Core/Listener.h vendor/lldb/dist/include/lldb/Core/Log.h vendor/lldb/dist/include/lldb/Core/Mangled.h vendor/lldb/dist/include/lldb/Core/MappedHash.h vendor/lldb/dist/include/lldb/Core/Module.h vendor/lldb/dist/include/lldb/Core/ModuleChild.h vendor/lldb/dist/include/lldb/Core/ModuleList.h vendor/lldb/dist/include/lldb/Core/ModuleSpec.h vendor/lldb/dist/include/lldb/Core/Opcode.h vendor/lldb/dist/include/lldb/Core/PluginInterface.h vendor/lldb/dist/include/lldb/Core/PluginManager.h vendor/lldb/dist/include/lldb/Core/RangeMap.h vendor/lldb/dist/include/lldb/Core/RegisterValue.h vendor/lldb/dist/include/lldb/Core/RegularExpression.h vendor/lldb/dist/include/lldb/Core/STLUtils.h vendor/lldb/dist/include/lldb/Core/Scalar.h vendor/lldb/dist/include/lldb/Core/SearchFilter.h vendor/lldb/dist/include/lldb/Core/Section.h vendor/lldb/dist/include/lldb/Core/SourceManager.h vendor/lldb/dist/include/lldb/Core/State.h vendor/lldb/dist/include/lldb/Core/Stream.h vendor/lldb/dist/include/lldb/Core/StreamAsynchronousIO.h vendor/lldb/dist/include/lldb/Core/StreamBuffer.h vendor/lldb/dist/include/lldb/Core/StreamCallback.h vendor/lldb/dist/include/lldb/Core/StreamFile.h vendor/lldb/dist/include/lldb/Core/StreamString.h vendor/lldb/dist/include/lldb/Core/StreamTee.h vendor/lldb/dist/include/lldb/Core/StringList.h vendor/lldb/dist/include/lldb/Core/ThreadSafeSTLMap.h vendor/lldb/dist/include/lldb/Core/ThreadSafeValue.h vendor/lldb/dist/include/lldb/Core/Timer.h vendor/lldb/dist/include/lldb/Core/UUID.h vendor/lldb/dist/include/lldb/Core/UniqueCStringMap.h vendor/lldb/dist/include/lldb/Core/UserID.h vendor/lldb/dist/include/lldb/Core/UserSettingsController.h vendor/lldb/dist/include/lldb/Core/VMRange.h vendor/lldb/dist/include/lldb/Core/Value.h vendor/lldb/dist/include/lldb/Core/ValueObject.h vendor/lldb/dist/include/lldb/Core/ValueObjectCast.h vendor/lldb/dist/include/lldb/Core/ValueObjectChild.h vendor/lldb/dist/include/lldb/Core/ValueObjectConstResult.h vendor/lldb/dist/include/lldb/Core/ValueObjectConstResultChild.h vendor/lldb/dist/include/lldb/Core/ValueObjectConstResultImpl.h vendor/lldb/dist/include/lldb/Core/ValueObjectDynamicValue.h vendor/lldb/dist/include/lldb/Core/ValueObjectList.h vendor/lldb/dist/include/lldb/Core/ValueObjectMemory.h vendor/lldb/dist/include/lldb/Core/ValueObjectRegister.h vendor/lldb/dist/include/lldb/Core/ValueObjectSyntheticFilter.h vendor/lldb/dist/include/lldb/Core/ValueObjectVariable.h vendor/lldb/dist/include/lldb/Core/dwarf.h vendor/lldb/dist/include/lldb/DataFormatters/ vendor/lldb/dist/include/lldb/DataFormatters/CXXFormatterFunctions.h vendor/lldb/dist/include/lldb/DataFormatters/DataVisualization.h vendor/lldb/dist/include/lldb/DataFormatters/FormatCache.h vendor/lldb/dist/include/lldb/DataFormatters/FormatClasses.h vendor/lldb/dist/include/lldb/DataFormatters/FormatManager.h vendor/lldb/dist/include/lldb/DataFormatters/FormatNavigator.h vendor/lldb/dist/include/lldb/DataFormatters/TypeCategory.h vendor/lldb/dist/include/lldb/DataFormatters/TypeCategoryMap.h vendor/lldb/dist/include/lldb/DataFormatters/TypeFormat.h vendor/lldb/dist/include/lldb/DataFormatters/TypeSummary.h vendor/lldb/dist/include/lldb/DataFormatters/TypeSynthetic.h vendor/lldb/dist/include/lldb/Expression/ vendor/lldb/dist/include/lldb/Expression/ASTDumper.h vendor/lldb/dist/include/lldb/Expression/ASTResultSynthesizer.h vendor/lldb/dist/include/lldb/Expression/ASTStructExtractor.h vendor/lldb/dist/include/lldb/Expression/ClangASTSource.h vendor/lldb/dist/include/lldb/Expression/ClangExpression.h vendor/lldb/dist/include/lldb/Expression/ClangExpressionDeclMap.h vendor/lldb/dist/include/lldb/Expression/ClangExpressionParser.h vendor/lldb/dist/include/lldb/Expression/ClangExpressionVariable.h vendor/lldb/dist/include/lldb/Expression/ClangFunction.h vendor/lldb/dist/include/lldb/Expression/ClangPersistentVariables.h vendor/lldb/dist/include/lldb/Expression/ClangUserExpression.h vendor/lldb/dist/include/lldb/Expression/ClangUtilityFunction.h vendor/lldb/dist/include/lldb/Expression/DWARFExpression.h vendor/lldb/dist/include/lldb/Expression/ExpressionSourceCode.h vendor/lldb/dist/include/lldb/Expression/IRDynamicChecks.h vendor/lldb/dist/include/lldb/Expression/IRExecutionUnit.h vendor/lldb/dist/include/lldb/Expression/IRForTarget.h vendor/lldb/dist/include/lldb/Expression/IRInterpreter.h vendor/lldb/dist/include/lldb/Expression/IRMemoryMap.h vendor/lldb/dist/include/lldb/Expression/IRToDWARF.h vendor/lldb/dist/include/lldb/Expression/Materializer.h vendor/lldb/dist/include/lldb/Host/ vendor/lldb/dist/include/lldb/Host/Condition.h vendor/lldb/dist/include/lldb/Host/Config.h vendor/lldb/dist/include/lldb/Host/DynamicLibrary.h vendor/lldb/dist/include/lldb/Host/Endian.h vendor/lldb/dist/include/lldb/Host/File.h vendor/lldb/dist/include/lldb/Host/FileSpec.h vendor/lldb/dist/include/lldb/Host/Host.h vendor/lldb/dist/include/lldb/Host/Mutex.h vendor/lldb/dist/include/lldb/Host/Predicate.h vendor/lldb/dist/include/lldb/Host/ProcessRunLock.h vendor/lldb/dist/include/lldb/Host/SocketAddress.h vendor/lldb/dist/include/lldb/Host/Symbols.h vendor/lldb/dist/include/lldb/Host/Terminal.h vendor/lldb/dist/include/lldb/Host/TimeValue.h vendor/lldb/dist/include/lldb/Host/freebsd/ vendor/lldb/dist/include/lldb/Host/freebsd/Config.h vendor/lldb/dist/include/lldb/Interpreter/ vendor/lldb/dist/include/lldb/Interpreter/Args.h vendor/lldb/dist/include/lldb/Interpreter/CommandCompletions.h vendor/lldb/dist/include/lldb/Interpreter/CommandHistory.h vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h vendor/lldb/dist/include/lldb/Interpreter/CommandObject.h vendor/lldb/dist/include/lldb/Interpreter/CommandObjectMultiword.h vendor/lldb/dist/include/lldb/Interpreter/CommandObjectRegexCommand.h vendor/lldb/dist/include/lldb/Interpreter/CommandReturnObject.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupArchitecture.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupBoolean.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupFile.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupFormat.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupOutputFile.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupPlatform.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupString.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupUInt64.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupUUID.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupVariable.h vendor/lldb/dist/include/lldb/Interpreter/OptionGroupWatchpoint.h vendor/lldb/dist/include/lldb/Interpreter/OptionValue.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueArch.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueArgs.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueArray.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueBoolean.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueDictionary.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueEnumeration.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueFileSpec.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueFileSpecList.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueFormat.h vendor/lldb/dist/include/lldb/Interpreter/OptionValuePathMappings.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueProperties.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueRegex.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueSInt64.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueString.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueUInt64.h vendor/lldb/dist/include/lldb/Interpreter/OptionValueUUID.h vendor/lldb/dist/include/lldb/Interpreter/OptionValues.h vendor/lldb/dist/include/lldb/Interpreter/Options.h vendor/lldb/dist/include/lldb/Interpreter/Property.h vendor/lldb/dist/include/lldb/Interpreter/PythonDataObjects.h vendor/lldb/dist/include/lldb/Interpreter/ScriptInterpreter.h vendor/lldb/dist/include/lldb/Interpreter/ScriptInterpreterNone.h vendor/lldb/dist/include/lldb/Interpreter/ScriptInterpreterPython.h vendor/lldb/dist/include/lldb/Symbol/ vendor/lldb/dist/include/lldb/Symbol/Block.h vendor/lldb/dist/include/lldb/Symbol/ClangASTContext.h vendor/lldb/dist/include/lldb/Symbol/ClangASTImporter.h vendor/lldb/dist/include/lldb/Symbol/ClangASTType.h vendor/lldb/dist/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h vendor/lldb/dist/include/lldb/Symbol/ClangExternalASTSourceCommon.h vendor/lldb/dist/include/lldb/Symbol/ClangNamespaceDecl.h vendor/lldb/dist/include/lldb/Symbol/CompileUnit.h vendor/lldb/dist/include/lldb/Symbol/DWARFCallFrameInfo.h vendor/lldb/dist/include/lldb/Symbol/Declaration.h vendor/lldb/dist/include/lldb/Symbol/FuncUnwinders.h vendor/lldb/dist/include/lldb/Symbol/Function.h vendor/lldb/dist/include/lldb/Symbol/LineEntry.h vendor/lldb/dist/include/lldb/Symbol/LineTable.h vendor/lldb/dist/include/lldb/Symbol/ObjectContainer.h vendor/lldb/dist/include/lldb/Symbol/ObjectFile.h vendor/lldb/dist/include/lldb/Symbol/Symbol.h vendor/lldb/dist/include/lldb/Symbol/SymbolContext.h vendor/lldb/dist/include/lldb/Symbol/SymbolContextScope.h vendor/lldb/dist/include/lldb/Symbol/SymbolFile.h vendor/lldb/dist/include/lldb/Symbol/SymbolVendor.h vendor/lldb/dist/include/lldb/Symbol/Symtab.h vendor/lldb/dist/include/lldb/Symbol/TaggedASTType.h vendor/lldb/dist/include/lldb/Symbol/Type.h vendor/lldb/dist/include/lldb/Symbol/TypeList.h vendor/lldb/dist/include/lldb/Symbol/TypeVendor.h vendor/lldb/dist/include/lldb/Symbol/UnwindPlan.h vendor/lldb/dist/include/lldb/Symbol/UnwindTable.h vendor/lldb/dist/include/lldb/Symbol/Variable.h vendor/lldb/dist/include/lldb/Symbol/VariableList.h vendor/lldb/dist/include/lldb/Symbol/VerifyDecl.h vendor/lldb/dist/include/lldb/Target/ vendor/lldb/dist/include/lldb/Target/ABI.h vendor/lldb/dist/include/lldb/Target/CPPLanguageRuntime.h vendor/lldb/dist/include/lldb/Target/DynamicLoader.h vendor/lldb/dist/include/lldb/Target/ExecutionContext.h vendor/lldb/dist/include/lldb/Target/ExecutionContextScope.h vendor/lldb/dist/include/lldb/Target/LanguageRuntime.h vendor/lldb/dist/include/lldb/Target/Memory.h vendor/lldb/dist/include/lldb/Target/ObjCLanguageRuntime.h vendor/lldb/dist/include/lldb/Target/OperatingSystem.h vendor/lldb/dist/include/lldb/Target/PathMappingList.h vendor/lldb/dist/include/lldb/Target/Platform.h vendor/lldb/dist/include/lldb/Target/Process.h vendor/lldb/dist/include/lldb/Target/RegisterContext.h vendor/lldb/dist/include/lldb/Target/SectionLoadList.h vendor/lldb/dist/include/lldb/Target/StackFrame.h vendor/lldb/dist/include/lldb/Target/StackFrameList.h vendor/lldb/dist/include/lldb/Target/StackID.h vendor/lldb/dist/include/lldb/Target/StopInfo.h vendor/lldb/dist/include/lldb/Target/Target.h vendor/lldb/dist/include/lldb/Target/TargetList.h vendor/lldb/dist/include/lldb/Target/Thread.h vendor/lldb/dist/include/lldb/Target/ThreadList.h vendor/lldb/dist/include/lldb/Target/ThreadPlan.h vendor/lldb/dist/include/lldb/Target/ThreadPlanBase.h vendor/lldb/dist/include/lldb/Target/ThreadPlanCallFunction.h vendor/lldb/dist/include/lldb/Target/ThreadPlanCallUserExpression.h vendor/lldb/dist/include/lldb/Target/ThreadPlanRunToAddress.h vendor/lldb/dist/include/lldb/Target/ThreadPlanShouldStopHere.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepInRange.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepInstruction.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepOut.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepOverBreakpoint.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepOverRange.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepRange.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepThrough.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepUntil.h vendor/lldb/dist/include/lldb/Target/ThreadPlanTracer.h vendor/lldb/dist/include/lldb/Target/ThreadSpec.h vendor/lldb/dist/include/lldb/Target/UnixSignals.h vendor/lldb/dist/include/lldb/Target/Unwind.h vendor/lldb/dist/include/lldb/Target/UnwindAssembly.h vendor/lldb/dist/include/lldb/Utility/ vendor/lldb/dist/include/lldb/Utility/AnsiTerminal.h vendor/lldb/dist/include/lldb/Utility/CleanUp.h vendor/lldb/dist/include/lldb/Utility/PriorityPointerPair.h vendor/lldb/dist/include/lldb/Utility/PseudoTerminal.h vendor/lldb/dist/include/lldb/Utility/PythonPointer.h vendor/lldb/dist/include/lldb/Utility/Range.h vendor/lldb/dist/include/lldb/Utility/RefCounter.h vendor/lldb/dist/include/lldb/Utility/SharedCluster.h vendor/lldb/dist/include/lldb/Utility/SharingPtr.h vendor/lldb/dist/include/lldb/Utility/Utils.h vendor/lldb/dist/include/lldb/lldb-defines.h vendor/lldb/dist/include/lldb/lldb-enumerations.h vendor/lldb/dist/include/lldb/lldb-forward.h vendor/lldb/dist/include/lldb/lldb-private-enumerations.h vendor/lldb/dist/include/lldb/lldb-private-interfaces.h vendor/lldb/dist/include/lldb/lldb-private-log.h vendor/lldb/dist/include/lldb/lldb-private-types.h vendor/lldb/dist/include/lldb/lldb-private.h vendor/lldb/dist/include/lldb/lldb-public.h vendor/lldb/dist/include/lldb/lldb-python.h vendor/lldb/dist/include/lldb/lldb-types.h vendor/lldb/dist/include/lldb/lldb-versioning.h vendor/lldb/dist/source/ vendor/lldb/dist/source/API/ vendor/lldb/dist/source/API/SBAddress.cpp vendor/lldb/dist/source/API/SBBlock.cpp vendor/lldb/dist/source/API/SBBreakpoint.cpp vendor/lldb/dist/source/API/SBBreakpointLocation.cpp vendor/lldb/dist/source/API/SBBroadcaster.cpp vendor/lldb/dist/source/API/SBCommandInterpreter.cpp vendor/lldb/dist/source/API/SBCommandReturnObject.cpp vendor/lldb/dist/source/API/SBCommunication.cpp vendor/lldb/dist/source/API/SBCompileUnit.cpp vendor/lldb/dist/source/API/SBData.cpp vendor/lldb/dist/source/API/SBDebugger.cpp vendor/lldb/dist/source/API/SBDeclaration.cpp vendor/lldb/dist/source/API/SBError.cpp vendor/lldb/dist/source/API/SBEvent.cpp vendor/lldb/dist/source/API/SBExpressionOptions.cpp vendor/lldb/dist/source/API/SBFileSpec.cpp vendor/lldb/dist/source/API/SBFileSpecList.cpp vendor/lldb/dist/source/API/SBFrame.cpp vendor/lldb/dist/source/API/SBFunction.cpp vendor/lldb/dist/source/API/SBHostOS.cpp vendor/lldb/dist/source/API/SBInputReader.cpp vendor/lldb/dist/source/API/SBInstruction.cpp vendor/lldb/dist/source/API/SBInstructionList.cpp vendor/lldb/dist/source/API/SBLineEntry.cpp vendor/lldb/dist/source/API/SBListener.cpp vendor/lldb/dist/source/API/SBModule.cpp vendor/lldb/dist/source/API/SBModuleSpec.cpp vendor/lldb/dist/source/API/SBProcess.cpp vendor/lldb/dist/source/API/SBSection.cpp vendor/lldb/dist/source/API/SBSourceManager.cpp vendor/lldb/dist/source/API/SBStream.cpp vendor/lldb/dist/source/API/SBStringList.cpp vendor/lldb/dist/source/API/SBSymbol.cpp vendor/lldb/dist/source/API/SBSymbolContext.cpp vendor/lldb/dist/source/API/SBSymbolContextList.cpp vendor/lldb/dist/source/API/SBTarget.cpp vendor/lldb/dist/source/API/SBThread.cpp vendor/lldb/dist/source/API/SBType.cpp vendor/lldb/dist/source/API/SBTypeCategory.cpp vendor/lldb/dist/source/API/SBTypeFilter.cpp vendor/lldb/dist/source/API/SBTypeFormat.cpp vendor/lldb/dist/source/API/SBTypeNameSpecifier.cpp vendor/lldb/dist/source/API/SBTypeSummary.cpp vendor/lldb/dist/source/API/SBTypeSynthetic.cpp vendor/lldb/dist/source/API/SBValue.cpp vendor/lldb/dist/source/API/SBValueList.cpp vendor/lldb/dist/source/API/SBWatchpoint.cpp vendor/lldb/dist/source/Breakpoint/ vendor/lldb/dist/source/Breakpoint/Breakpoint.cpp vendor/lldb/dist/source/Breakpoint/BreakpointID.cpp vendor/lldb/dist/source/Breakpoint/BreakpointIDList.cpp vendor/lldb/dist/source/Breakpoint/BreakpointList.cpp vendor/lldb/dist/source/Breakpoint/BreakpointLocation.cpp vendor/lldb/dist/source/Breakpoint/BreakpointLocationCollection.cpp vendor/lldb/dist/source/Breakpoint/BreakpointLocationList.cpp vendor/lldb/dist/source/Breakpoint/BreakpointOptions.cpp vendor/lldb/dist/source/Breakpoint/BreakpointResolver.cpp vendor/lldb/dist/source/Breakpoint/BreakpointResolverAddress.cpp vendor/lldb/dist/source/Breakpoint/BreakpointResolverFileLine.cpp vendor/lldb/dist/source/Breakpoint/BreakpointResolverFileRegex.cpp vendor/lldb/dist/source/Breakpoint/BreakpointResolverName.cpp vendor/lldb/dist/source/Breakpoint/BreakpointSite.cpp vendor/lldb/dist/source/Breakpoint/BreakpointSiteList.cpp vendor/lldb/dist/source/Breakpoint/Stoppoint.cpp vendor/lldb/dist/source/Breakpoint/StoppointCallbackContext.cpp vendor/lldb/dist/source/Breakpoint/StoppointLocation.cpp vendor/lldb/dist/source/Breakpoint/Watchpoint.cpp vendor/lldb/dist/source/Breakpoint/WatchpointList.cpp vendor/lldb/dist/source/Breakpoint/WatchpointOptions.cpp vendor/lldb/dist/source/Commands/ vendor/lldb/dist/source/Commands/CommandCompletions.cpp vendor/lldb/dist/source/Commands/CommandObjectApropos.cpp vendor/lldb/dist/source/Commands/CommandObjectApropos.h vendor/lldb/dist/source/Commands/CommandObjectArgs.cpp vendor/lldb/dist/source/Commands/CommandObjectArgs.h vendor/lldb/dist/source/Commands/CommandObjectBreakpoint.cpp vendor/lldb/dist/source/Commands/CommandObjectBreakpoint.h vendor/lldb/dist/source/Commands/CommandObjectBreakpointCommand.cpp vendor/lldb/dist/source/Commands/CommandObjectBreakpointCommand.h vendor/lldb/dist/source/Commands/CommandObjectCommands.cpp vendor/lldb/dist/source/Commands/CommandObjectCommands.h vendor/lldb/dist/source/Commands/CommandObjectDisassemble.cpp vendor/lldb/dist/source/Commands/CommandObjectDisassemble.h vendor/lldb/dist/source/Commands/CommandObjectExpression.cpp vendor/lldb/dist/source/Commands/CommandObjectExpression.h vendor/lldb/dist/source/Commands/CommandObjectFrame.cpp vendor/lldb/dist/source/Commands/CommandObjectFrame.h vendor/lldb/dist/source/Commands/CommandObjectHelp.cpp vendor/lldb/dist/source/Commands/CommandObjectHelp.h vendor/lldb/dist/source/Commands/CommandObjectLog.cpp vendor/lldb/dist/source/Commands/CommandObjectLog.h vendor/lldb/dist/source/Commands/CommandObjectMemory.cpp vendor/lldb/dist/source/Commands/CommandObjectMemory.h vendor/lldb/dist/source/Commands/CommandObjectMultiword.cpp vendor/lldb/dist/source/Commands/CommandObjectPlatform.cpp vendor/lldb/dist/source/Commands/CommandObjectPlatform.h vendor/lldb/dist/source/Commands/CommandObjectPlugin.cpp vendor/lldb/dist/source/Commands/CommandObjectPlugin.h vendor/lldb/dist/source/Commands/CommandObjectProcess.cpp vendor/lldb/dist/source/Commands/CommandObjectProcess.h vendor/lldb/dist/source/Commands/CommandObjectQuit.cpp vendor/lldb/dist/source/Commands/CommandObjectQuit.h vendor/lldb/dist/source/Commands/CommandObjectRegister.cpp vendor/lldb/dist/source/Commands/CommandObjectRegister.h vendor/lldb/dist/source/Commands/CommandObjectSettings.cpp vendor/lldb/dist/source/Commands/CommandObjectSettings.h vendor/lldb/dist/source/Commands/CommandObjectSource.cpp vendor/lldb/dist/source/Commands/CommandObjectSource.h vendor/lldb/dist/source/Commands/CommandObjectSyntax.cpp vendor/lldb/dist/source/Commands/CommandObjectSyntax.h vendor/lldb/dist/source/Commands/CommandObjectTarget.cpp vendor/lldb/dist/source/Commands/CommandObjectTarget.h vendor/lldb/dist/source/Commands/CommandObjectThread.cpp vendor/lldb/dist/source/Commands/CommandObjectThread.h vendor/lldb/dist/source/Commands/CommandObjectType.cpp vendor/lldb/dist/source/Commands/CommandObjectType.h vendor/lldb/dist/source/Commands/CommandObjectVersion.cpp vendor/lldb/dist/source/Commands/CommandObjectVersion.h vendor/lldb/dist/source/Commands/CommandObjectWatchpoint.cpp vendor/lldb/dist/source/Commands/CommandObjectWatchpoint.h vendor/lldb/dist/source/Commands/CommandObjectWatchpointCommand.cpp vendor/lldb/dist/source/Commands/CommandObjectWatchpointCommand.h vendor/lldb/dist/source/Core/ vendor/lldb/dist/source/Core/Address.cpp vendor/lldb/dist/source/Core/AddressRange.cpp vendor/lldb/dist/source/Core/AddressResolver.cpp vendor/lldb/dist/source/Core/AddressResolverFileLine.cpp vendor/lldb/dist/source/Core/AddressResolverName.cpp vendor/lldb/dist/source/Core/ArchSpec.cpp vendor/lldb/dist/source/Core/Baton.cpp vendor/lldb/dist/source/Core/Broadcaster.cpp vendor/lldb/dist/source/Core/Communication.cpp vendor/lldb/dist/source/Core/Connection.cpp vendor/lldb/dist/source/Core/ConnectionFileDescriptor.cpp vendor/lldb/dist/source/Core/ConnectionMachPort.cpp vendor/lldb/dist/source/Core/ConnectionSharedMemory.cpp vendor/lldb/dist/source/Core/ConstString.cpp vendor/lldb/dist/source/Core/DataBufferHeap.cpp vendor/lldb/dist/source/Core/DataBufferMemoryMap.cpp vendor/lldb/dist/source/Core/DataEncoder.cpp vendor/lldb/dist/source/Core/DataExtractor.cpp vendor/lldb/dist/source/Core/Debugger.cpp vendor/lldb/dist/source/Core/Disassembler.cpp vendor/lldb/dist/source/Core/DynamicLoader.cpp vendor/lldb/dist/source/Core/EmulateInstruction.cpp vendor/lldb/dist/source/Core/Error.cpp vendor/lldb/dist/source/Core/Event.cpp vendor/lldb/dist/source/Core/FileLineResolver.cpp vendor/lldb/dist/source/Core/FileSpecList.cpp vendor/lldb/dist/source/Core/History.cpp vendor/lldb/dist/source/Core/InputReader.cpp vendor/lldb/dist/source/Core/InputReaderEZ.cpp vendor/lldb/dist/source/Core/InputReaderStack.cpp vendor/lldb/dist/source/Core/Language.cpp vendor/lldb/dist/source/Core/Listener.cpp vendor/lldb/dist/source/Core/Log.cpp vendor/lldb/dist/source/Core/Mangled.cpp vendor/lldb/dist/source/Core/Module.cpp vendor/lldb/dist/source/Core/ModuleChild.cpp vendor/lldb/dist/source/Core/ModuleList.cpp vendor/lldb/dist/source/Core/Opcode.cpp vendor/lldb/dist/source/Core/PluginManager.cpp vendor/lldb/dist/source/Core/RegisterValue.cpp vendor/lldb/dist/source/Core/RegularExpression.cpp vendor/lldb/dist/source/Core/Scalar.cpp vendor/lldb/dist/source/Core/SearchFilter.cpp vendor/lldb/dist/source/Core/Section.cpp vendor/lldb/dist/source/Core/SourceManager.cpp vendor/lldb/dist/source/Core/State.cpp vendor/lldb/dist/source/Core/Stream.cpp vendor/lldb/dist/source/Core/StreamAsynchronousIO.cpp vendor/lldb/dist/source/Core/StreamCallback.cpp vendor/lldb/dist/source/Core/StreamFile.cpp vendor/lldb/dist/source/Core/StreamString.cpp vendor/lldb/dist/source/Core/StringList.cpp vendor/lldb/dist/source/Core/Timer.cpp vendor/lldb/dist/source/Core/UUID.cpp vendor/lldb/dist/source/Core/UserID.cpp vendor/lldb/dist/source/Core/UserSettingsController.cpp vendor/lldb/dist/source/Core/VMRange.cpp vendor/lldb/dist/source/Core/Value.cpp vendor/lldb/dist/source/Core/ValueObject.cpp vendor/lldb/dist/source/Core/ValueObjectCast.cpp vendor/lldb/dist/source/Core/ValueObjectChild.cpp vendor/lldb/dist/source/Core/ValueObjectConstResult.cpp vendor/lldb/dist/source/Core/ValueObjectConstResultChild.cpp vendor/lldb/dist/source/Core/ValueObjectConstResultImpl.cpp vendor/lldb/dist/source/Core/ValueObjectDynamicValue.cpp vendor/lldb/dist/source/Core/ValueObjectList.cpp vendor/lldb/dist/source/Core/ValueObjectMemory.cpp vendor/lldb/dist/source/Core/ValueObjectRegister.cpp vendor/lldb/dist/source/Core/ValueObjectSyntheticFilter.cpp vendor/lldb/dist/source/Core/ValueObjectVariable.cpp vendor/lldb/dist/source/DataFormatters/ vendor/lldb/dist/source/DataFormatters/CF.cpp vendor/lldb/dist/source/DataFormatters/CXXFormatterFunctions.cpp vendor/lldb/dist/source/DataFormatters/Cocoa.cpp vendor/lldb/dist/source/DataFormatters/DataVisualization.cpp vendor/lldb/dist/source/DataFormatters/FormatCache.cpp vendor/lldb/dist/source/DataFormatters/FormatClasses.cpp vendor/lldb/dist/source/DataFormatters/FormatManager.cpp vendor/lldb/dist/source/DataFormatters/LibCxx.cpp vendor/lldb/dist/source/DataFormatters/LibCxxList.cpp vendor/lldb/dist/source/DataFormatters/LibCxxMap.cpp vendor/lldb/dist/source/DataFormatters/LibStdcpp.cpp vendor/lldb/dist/source/DataFormatters/NSArray.cpp vendor/lldb/dist/source/DataFormatters/NSDictionary.cpp vendor/lldb/dist/source/DataFormatters/NSSet.cpp vendor/lldb/dist/source/DataFormatters/TypeCategory.cpp vendor/lldb/dist/source/DataFormatters/TypeCategoryMap.cpp vendor/lldb/dist/source/DataFormatters/TypeFormat.cpp vendor/lldb/dist/source/DataFormatters/TypeSummary.cpp vendor/lldb/dist/source/DataFormatters/TypeSynthetic.cpp vendor/lldb/dist/source/Expression/ vendor/lldb/dist/source/Expression/ASTDumper.cpp vendor/lldb/dist/source/Expression/ASTResultSynthesizer.cpp vendor/lldb/dist/source/Expression/ASTStructExtractor.cpp vendor/lldb/dist/source/Expression/ClangASTSource.cpp vendor/lldb/dist/source/Expression/ClangExpressionDeclMap.cpp vendor/lldb/dist/source/Expression/ClangExpressionParser.cpp vendor/lldb/dist/source/Expression/ClangExpressionVariable.cpp vendor/lldb/dist/source/Expression/ClangFunction.cpp vendor/lldb/dist/source/Expression/ClangPersistentVariables.cpp vendor/lldb/dist/source/Expression/ClangUserExpression.cpp vendor/lldb/dist/source/Expression/ClangUtilityFunction.cpp vendor/lldb/dist/source/Expression/DWARFExpression.cpp vendor/lldb/dist/source/Expression/ExpressionSourceCode.cpp vendor/lldb/dist/source/Expression/IRDynamicChecks.cpp vendor/lldb/dist/source/Expression/IRExecutionUnit.cpp vendor/lldb/dist/source/Expression/IRForTarget.cpp vendor/lldb/dist/source/Expression/IRInterpreter.cpp vendor/lldb/dist/source/Expression/IRMemoryMap.cpp vendor/lldb/dist/source/Expression/Materializer.cpp vendor/lldb/dist/source/Host/ vendor/lldb/dist/source/Host/common/ vendor/lldb/dist/source/Host/common/Condition.cpp vendor/lldb/dist/source/Host/common/DynamicLibrary.cpp vendor/lldb/dist/source/Host/common/File.cpp vendor/lldb/dist/source/Host/common/FileSpec.cpp vendor/lldb/dist/source/Host/common/Host.cpp vendor/lldb/dist/source/Host/common/Mutex.cpp vendor/lldb/dist/source/Host/common/SocketAddress.cpp vendor/lldb/dist/source/Host/common/Symbols.cpp vendor/lldb/dist/source/Host/common/Terminal.cpp vendor/lldb/dist/source/Host/common/TimeValue.cpp vendor/lldb/dist/source/Host/freebsd/ vendor/lldb/dist/source/Host/freebsd/Host.cpp vendor/lldb/dist/source/Interpreter/ vendor/lldb/dist/source/Interpreter/Args.cpp vendor/lldb/dist/source/Interpreter/CommandHistory.cpp vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp vendor/lldb/dist/source/Interpreter/CommandObject.cpp vendor/lldb/dist/source/Interpreter/CommandObjectRegexCommand.cpp vendor/lldb/dist/source/Interpreter/CommandObjectScript.cpp vendor/lldb/dist/source/Interpreter/CommandObjectScript.h vendor/lldb/dist/source/Interpreter/CommandReturnObject.cpp vendor/lldb/dist/source/Interpreter/OptionGroupArchitecture.cpp vendor/lldb/dist/source/Interpreter/OptionGroupBoolean.cpp vendor/lldb/dist/source/Interpreter/OptionGroupFile.cpp vendor/lldb/dist/source/Interpreter/OptionGroupFormat.cpp vendor/lldb/dist/source/Interpreter/OptionGroupOutputFile.cpp vendor/lldb/dist/source/Interpreter/OptionGroupPlatform.cpp vendor/lldb/dist/source/Interpreter/OptionGroupString.cpp vendor/lldb/dist/source/Interpreter/OptionGroupUInt64.cpp vendor/lldb/dist/source/Interpreter/OptionGroupUUID.cpp vendor/lldb/dist/source/Interpreter/OptionGroupValueObjectDisplay.cpp vendor/lldb/dist/source/Interpreter/OptionGroupVariable.cpp vendor/lldb/dist/source/Interpreter/OptionGroupWatchpoint.cpp vendor/lldb/dist/source/Interpreter/OptionValue.cpp vendor/lldb/dist/source/Interpreter/OptionValueArch.cpp vendor/lldb/dist/source/Interpreter/OptionValueArgs.cpp vendor/lldb/dist/source/Interpreter/OptionValueArray.cpp vendor/lldb/dist/source/Interpreter/OptionValueBoolean.cpp vendor/lldb/dist/source/Interpreter/OptionValueDictionary.cpp vendor/lldb/dist/source/Interpreter/OptionValueEnumeration.cpp vendor/lldb/dist/source/Interpreter/OptionValueFileSpec.cpp vendor/lldb/dist/source/Interpreter/OptionValueFileSpecLIst.cpp vendor/lldb/dist/source/Interpreter/OptionValueFormat.cpp vendor/lldb/dist/source/Interpreter/OptionValuePathMappings.cpp vendor/lldb/dist/source/Interpreter/OptionValueProperties.cpp vendor/lldb/dist/source/Interpreter/OptionValueRegex.cpp vendor/lldb/dist/source/Interpreter/OptionValueSInt64.cpp vendor/lldb/dist/source/Interpreter/OptionValueString.cpp vendor/lldb/dist/source/Interpreter/OptionValueUInt64.cpp vendor/lldb/dist/source/Interpreter/OptionValueUUID.cpp vendor/lldb/dist/source/Interpreter/Options.cpp vendor/lldb/dist/source/Interpreter/Property.cpp vendor/lldb/dist/source/Interpreter/PythonDataObjects.cpp vendor/lldb/dist/source/Interpreter/ScriptInterpreter.cpp vendor/lldb/dist/source/Interpreter/ScriptInterpreterNone.cpp vendor/lldb/dist/source/Interpreter/ScriptInterpreterPython.cpp vendor/lldb/dist/source/Interpreter/embedded_interpreter.py vendor/lldb/dist/source/Plugins/ vendor/lldb/dist/source/Plugins/ABI/ vendor/lldb/dist/source/Plugins/ABI/MacOSX-arm/ vendor/lldb/dist/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp vendor/lldb/dist/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h vendor/lldb/dist/source/Plugins/ABI/MacOSX-i386/ vendor/lldb/dist/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp vendor/lldb/dist/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h vendor/lldb/dist/source/Plugins/ABI/SysV-x86_64/ vendor/lldb/dist/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp vendor/lldb/dist/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h vendor/lldb/dist/source/Plugins/Disassembler/ vendor/lldb/dist/source/Plugins/Disassembler/llvm/ vendor/lldb/dist/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp vendor/lldb/dist/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h vendor/lldb/dist/source/Plugins/DynamicLoader/ vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/ vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h vendor/lldb/dist/source/Plugins/DynamicLoader/Static/ vendor/lldb/dist/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h vendor/lldb/dist/source/Plugins/Instruction/ vendor/lldb/dist/source/Plugins/Instruction/ARM/ vendor/lldb/dist/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp vendor/lldb/dist/source/Plugins/Instruction/ARM/EmulateInstructionARM.h vendor/lldb/dist/source/Plugins/Instruction/ARM/EmulationStateARM.cpp vendor/lldb/dist/source/Plugins/Instruction/ARM/EmulationStateARM.h vendor/lldb/dist/source/Plugins/LanguageRuntime/ vendor/lldb/dist/source/Plugins/LanguageRuntime/CPlusPlus/ vendor/lldb/dist/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ vendor/lldb/dist/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp vendor/lldb/dist/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h vendor/lldb/dist/source/Plugins/ObjectContainer/ vendor/lldb/dist/source/Plugins/ObjectContainer/BSD-Archive/ vendor/lldb/dist/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp vendor/lldb/dist/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h vendor/lldb/dist/source/Plugins/ObjectFile/ vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ELFHeader.cpp vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ELFHeader.h vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.h vendor/lldb/dist/source/Plugins/OperatingSystem/ vendor/lldb/dist/source/Plugins/OperatingSystem/Python/ vendor/lldb/dist/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp vendor/lldb/dist/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h vendor/lldb/dist/source/Plugins/Platform/ vendor/lldb/dist/source/Plugins/Platform/FreeBSD/ vendor/lldb/dist/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp vendor/lldb/dist/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h vendor/lldb/dist/source/Plugins/Platform/gdb-server/ vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h vendor/lldb/dist/source/Plugins/Process/ vendor/lldb/dist/source/Plugins/Process/FreeBSD/ vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessMonitor.h vendor/lldb/dist/source/Plugins/Process/POSIX/ vendor/lldb/dist/source/Plugins/Process/POSIX/POSIXStopInfo.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/POSIXStopInfo.h vendor/lldb/dist/source/Plugins/Process/POSIX/POSIXThread.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/POSIXThread.h vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessMessage.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessMessage.h vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessPOSIX.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessPOSIX.h vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessPOSIXLog.h vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.h vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContextLinux_x86_64.h vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContextPOSIX.h vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContext_i386.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContext_i386.h vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContext_x86.h vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/RegisterContext_x86_64.h vendor/lldb/dist/source/Plugins/Process/Utility/ vendor/lldb/dist/source/Plugins/Process/Utility/ARMDefines.h vendor/lldb/dist/source/Plugins/Process/Utility/ARMUtils.h vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.h vendor/lldb/dist/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp vendor/lldb/dist/source/Plugins/Process/Utility/InferiorCallPOSIX.h vendor/lldb/dist/source/Plugins/Process/Utility/InstructionUtils.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDummy.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDummy.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLLDB.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLLDB.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMach_arm.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMach_i386.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMach_x86_64.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMemory.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextMemory.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextThreadMemory.h vendor/lldb/dist/source/Plugins/Process/Utility/StopInfoMachException.cpp vendor/lldb/dist/source/Plugins/Process/Utility/StopInfoMachException.h vendor/lldb/dist/source/Plugins/Process/Utility/ThreadMemory.cpp vendor/lldb/dist/source/Plugins/Process/Utility/ThreadMemory.h vendor/lldb/dist/source/Plugins/Process/Utility/UnwindLLDB.cpp vendor/lldb/dist/source/Plugins/Process/Utility/UnwindLLDB.h vendor/lldb/dist/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp vendor/lldb/dist/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h vendor/lldb/dist/source/Plugins/Process/elf-core/ vendor/lldb/dist/source/Plugins/Process/elf-core/ProcessElfCore.cpp vendor/lldb/dist/source/Plugins/Process/elf-core/ProcessElfCore.h vendor/lldb/dist/source/Plugins/Process/elf-core/RegisterContextCoreFreeBSD_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/elf-core/RegisterContextCoreFreeBSD_x86_64.h vendor/lldb/dist/source/Plugins/Process/elf-core/RegisterContextCoreLinux_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/elf-core/RegisterContextCoreLinux_x86_64.h vendor/lldb/dist/source/Plugins/Process/elf-core/ThreadElfCore.cpp vendor/lldb/dist/source/Plugins/Process/elf-core/ThreadElfCore.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h vendor/lldb/dist/source/Plugins/SymbolFile/ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/ vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFDefines.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/NameToDIE.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h vendor/lldb/dist/source/Plugins/SymbolFile/Symtab/ vendor/lldb/dist/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp vendor/lldb/dist/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h vendor/lldb/dist/source/Plugins/SymbolVendor/ vendor/lldb/dist/source/Plugins/SymbolVendor/ELF/ vendor/lldb/dist/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp vendor/lldb/dist/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h vendor/lldb/dist/source/Plugins/UnwindAssembly/ vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/ vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp vendor/lldb/dist/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/ vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h vendor/lldb/dist/source/Symbol/ vendor/lldb/dist/source/Symbol/Block.cpp vendor/lldb/dist/source/Symbol/ClangASTContext.cpp vendor/lldb/dist/source/Symbol/ClangASTImporter.cpp vendor/lldb/dist/source/Symbol/ClangASTType.cpp vendor/lldb/dist/source/Symbol/ClangExternalASTSourceCallbacks.cpp vendor/lldb/dist/source/Symbol/ClangExternalASTSourceCommon.cpp vendor/lldb/dist/source/Symbol/ClangNamespaceDecl.cpp vendor/lldb/dist/source/Symbol/CompileUnit.cpp vendor/lldb/dist/source/Symbol/DWARFCallFrameInfo.cpp vendor/lldb/dist/source/Symbol/Declaration.cpp vendor/lldb/dist/source/Symbol/FuncUnwinders.cpp vendor/lldb/dist/source/Symbol/Function.cpp vendor/lldb/dist/source/Symbol/LineEntry.cpp vendor/lldb/dist/source/Symbol/LineTable.cpp vendor/lldb/dist/source/Symbol/ObjectFile.cpp vendor/lldb/dist/source/Symbol/Symbol.cpp vendor/lldb/dist/source/Symbol/SymbolContext.cpp vendor/lldb/dist/source/Symbol/SymbolFile.cpp vendor/lldb/dist/source/Symbol/SymbolVendor.cpp vendor/lldb/dist/source/Symbol/Symtab.cpp vendor/lldb/dist/source/Symbol/Type.cpp vendor/lldb/dist/source/Symbol/TypeList.cpp vendor/lldb/dist/source/Symbol/UnwindPlan.cpp vendor/lldb/dist/source/Symbol/UnwindTable.cpp vendor/lldb/dist/source/Symbol/Variable.cpp vendor/lldb/dist/source/Symbol/VariableList.cpp vendor/lldb/dist/source/Symbol/VerifyDecl.cpp vendor/lldb/dist/source/Target/ vendor/lldb/dist/source/Target/ABI.cpp vendor/lldb/dist/source/Target/CPPLanguageRuntime.cpp vendor/lldb/dist/source/Target/ExecutionContext.cpp vendor/lldb/dist/source/Target/LanguageRuntime.cpp vendor/lldb/dist/source/Target/Memory.cpp vendor/lldb/dist/source/Target/ObjCLanguageRuntime.cpp vendor/lldb/dist/source/Target/OperatingSystem.cpp vendor/lldb/dist/source/Target/PathMappingList.cpp vendor/lldb/dist/source/Target/Platform.cpp vendor/lldb/dist/source/Target/Process.cpp vendor/lldb/dist/source/Target/RegisterContext.cpp vendor/lldb/dist/source/Target/SectionLoadList.cpp vendor/lldb/dist/source/Target/StackFrame.cpp vendor/lldb/dist/source/Target/StackFrameList.cpp vendor/lldb/dist/source/Target/StackID.cpp vendor/lldb/dist/source/Target/StopInfo.cpp vendor/lldb/dist/source/Target/Target.cpp vendor/lldb/dist/source/Target/TargetList.cpp vendor/lldb/dist/source/Target/Thread.cpp vendor/lldb/dist/source/Target/ThreadList.cpp vendor/lldb/dist/source/Target/ThreadPlan.cpp vendor/lldb/dist/source/Target/ThreadPlanBase.cpp vendor/lldb/dist/source/Target/ThreadPlanCallFunction.cpp vendor/lldb/dist/source/Target/ThreadPlanCallUserExpression.cpp vendor/lldb/dist/source/Target/ThreadPlanRunToAddress.cpp vendor/lldb/dist/source/Target/ThreadPlanShouldStopHere.cpp vendor/lldb/dist/source/Target/ThreadPlanStepInRange.cpp vendor/lldb/dist/source/Target/ThreadPlanStepInstruction.cpp vendor/lldb/dist/source/Target/ThreadPlanStepOut.cpp vendor/lldb/dist/source/Target/ThreadPlanStepOverBreakpoint.cpp vendor/lldb/dist/source/Target/ThreadPlanStepOverRange.cpp vendor/lldb/dist/source/Target/ThreadPlanStepRange.cpp vendor/lldb/dist/source/Target/ThreadPlanStepThrough.cpp vendor/lldb/dist/source/Target/ThreadPlanStepUntil.cpp vendor/lldb/dist/source/Target/ThreadPlanTracer.cpp vendor/lldb/dist/source/Target/ThreadSpec.cpp vendor/lldb/dist/source/Target/UnixSignals.cpp vendor/lldb/dist/source/Target/UnwindAssembly.cpp vendor/lldb/dist/source/Utility/ vendor/lldb/dist/source/Utility/ARM_DWARF_Registers.cpp vendor/lldb/dist/source/Utility/ARM_DWARF_Registers.h vendor/lldb/dist/source/Utility/ARM_GCC_Registers.h vendor/lldb/dist/source/Utility/KQueue.cpp vendor/lldb/dist/source/Utility/KQueue.h vendor/lldb/dist/source/Utility/PseudoTerminal.cpp vendor/lldb/dist/source/Utility/Range.cpp vendor/lldb/dist/source/Utility/RefCounter.cpp vendor/lldb/dist/source/Utility/SharingPtr.cpp vendor/lldb/dist/source/Utility/StringExtractor.cpp vendor/lldb/dist/source/Utility/StringExtractor.h vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.cpp vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.h vendor/lldb/dist/source/Utility/TimeSpecTimeout.cpp vendor/lldb/dist/source/Utility/TimeSpecTimeout.h vendor/lldb/dist/source/Utility/UuidCompatibility.h vendor/lldb/dist/source/lldb-log.cpp vendor/lldb/dist/source/lldb.cpp vendor/lldb/dist/tools/ vendor/lldb/dist/tools/driver/ vendor/lldb/dist/tools/driver/Driver.cpp vendor/lldb/dist/tools/driver/Driver.h vendor/lldb/dist/tools/driver/IOChannel.cpp vendor/lldb/dist/tools/driver/IOChannel.h Added: vendor/lldb/dist/LICENSE.TXT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/LICENSE.TXT Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,38 @@ +University of Illinois/NCSA +Open Source License + +Copyright (c) 2010 Apple Inc. +All rights reserved. + +Developed by: + + LLDB Team + + http://lldb.llvm.org/ + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLDB Team, copyright holders, nor the names of + its contributors may be used to endorse or promote products derived from + this Software without specific prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + Added: vendor/lldb/dist/include/lldb/API/LLDB.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/LLDB.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,54 @@ +//===-- LLDB.h --------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_LLDB_h_ +#define LLDB_LLDB_h_ + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBAddress.h" +#include "lldb/API/SBBlock.h" +#include "lldb/API/SBBreakpoint.h" +#include "lldb/API/SBBreakpointLocation.h" +#include "lldb/API/SBBroadcaster.h" +#include "lldb/API/SBCommandInterpreter.h" +#include "lldb/API/SBCommandReturnObject.h" +#include "lldb/API/SBCommunication.h" +#include "lldb/API/SBCompileUnit.h" +#include "lldb/API/SBData.h" +#include "lldb/API/SBDebugger.h" +#include "lldb/API/SBDeclaration.h" +#include "lldb/API/SBError.h" +#include "lldb/API/SBEvent.h" +#include "lldb/API/SBFileSpec.h" +#include "lldb/API/SBFrame.h" +#include "lldb/API/SBFunction.h" +#include "lldb/API/SBHostOS.h" +#include "lldb/API/SBInputReader.h" +#include "lldb/API/SBInstruction.h" +#include "lldb/API/SBInstructionList.h" +#include "lldb/API/SBLineEntry.h" +#include "lldb/API/SBListener.h" +#include "lldb/API/SBModule.h" +#include "lldb/API/SBProcess.h" +#include "lldb/API/SBSourceManager.h" +#include "lldb/API/SBStream.h" +#include "lldb/API/SBStringList.h" +#include "lldb/API/SBSymbol.h" +#include "lldb/API/SBSymbolContext.h" +#include "lldb/API/SBTarget.h" +#include "lldb/API/SBThread.h" +#include "lldb/API/SBType.h" +#include "lldb/API/SBValue.h" +#include "lldb/API/SBValueList.h" + +#endif // LLDB_LLDB_h_ Added: vendor/lldb/dist/include/lldb/API/SBAddress.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBAddress.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,150 @@ +//===-- SBAddress.h ---------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBAddress_h_ +#define LLDB_SBAddress_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBModule.h" + +namespace lldb { + +class SBAddress +{ +public: + + SBAddress (); + + SBAddress (const lldb::SBAddress &rhs); + + SBAddress (lldb::SBSection section, lldb::addr_t offset); + + // Create an address by resolving a load address using the supplied target + SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target); + + ~SBAddress (); + + const lldb::SBAddress & + operator = (const lldb::SBAddress &rhs); + + bool + IsValid () const; + + void + Clear (); + + addr_t + GetFileAddress () const; + + addr_t + GetLoadAddress (const lldb::SBTarget &target) const; + + void + SetAddress (lldb::SBSection section, lldb::addr_t offset); + + void + SetLoadAddress (lldb::addr_t load_addr, + lldb::SBTarget &target); + bool + OffsetAddress (addr_t offset); + + bool + GetDescription (lldb::SBStream &description); + + // The following queries can lookup symbol information for a given address. + // An address might refer to code or data from an existing module, or it + // might refer to something on the stack or heap. The following functions + // will only return valid values if the address has been resolved to a code + // or data address using "void SBAddress::SetLoadAddress(...)" or + // "lldb::SBAddress SBTarget::ResolveLoadAddress (...)". + lldb::SBSymbolContext + GetSymbolContext (uint32_t resolve_scope); + + + // The following functions grab individual objects for a given address and + // are less efficient if you want more than one symbol related objects. + // Use one of the following when you want multiple debug symbol related + // objects for an address: + // lldb::SBSymbolContext SBAddress::GetSymbolContext (uint32_t resolve_scope); + // lldb::SBSymbolContext SBTarget::ResolveSymbolContextForAddress (const SBAddress &addr, uint32_t resolve_scope); + // One or more bits from the SymbolContextItem enumerations can be logically + // OR'ed together to more efficiently retrieve multiple symbol objects. + + lldb::SBSection + GetSection (); + + lldb::addr_t + GetOffset (); + + lldb::SBModule + GetModule (); + + lldb::SBCompileUnit + GetCompileUnit (); + + lldb::SBFunction + GetFunction (); + + lldb::SBBlock + GetBlock (); + + lldb::SBSymbol + GetSymbol (); + + lldb::SBLineEntry + GetLineEntry (); + + lldb::AddressClass + GetAddressClass (); + +protected: + + friend class SBBlock; + friend class SBBreakpointLocation; + friend class SBFrame; + friend class SBFunction; + friend class SBLineEntry; + friend class SBInstruction; + friend class SBModule; + friend class SBSection; + friend class SBSymbol; + friend class SBSymbolContext; + friend class SBTarget; + friend class SBThread; + friend class SBValue; + + lldb_private::Address * + operator->(); + + const lldb_private::Address * + operator->() const; + + lldb_private::Address * + get (); + + lldb_private::Address & + ref(); + + const lldb_private::Address & + ref() const; + + SBAddress (const lldb_private::Address *lldb_object_ptr); + + void + SetAddress (const lldb_private::Address *lldb_object_ptr); + +private: + + std::unique_ptr m_opaque_ap; +}; + + +} // namespace lldb + +#endif // LLDB_SBAddress_h_ Added: vendor/lldb/dist/include/lldb/API/SBBlock.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBBlock.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,123 @@ +//===-- SBBlock.h -----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBBlock_h_ +#define LLDB_SBBlock_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBFrame.h" +#include "lldb/API/SBTarget.h" +#include "lldb/API/SBValueList.h" + +namespace lldb { + +class SBBlock +{ +public: + + SBBlock (); + + SBBlock (const lldb::SBBlock &rhs); + + ~SBBlock (); + + const lldb::SBBlock & + operator = (const lldb::SBBlock &rhs); + + bool + IsInlined () const; + + bool + IsValid () const; + + const char * + GetInlinedName () const; + + lldb::SBFileSpec + GetInlinedCallSiteFile () const; + + uint32_t + GetInlinedCallSiteLine () const; + + uint32_t + GetInlinedCallSiteColumn () const; + + lldb::SBBlock + GetParent (); + + lldb::SBBlock + GetSibling (); + + lldb::SBBlock + GetFirstChild (); + + uint32_t + GetNumRanges (); + + lldb::SBAddress + GetRangeStartAddress (uint32_t idx); + + lldb::SBAddress + GetRangeEndAddress (uint32_t idx); + + uint32_t + GetRangeIndexForBlockAddress (lldb::SBAddress block_addr); + + lldb::SBValueList + GetVariables (lldb::SBFrame& frame, + bool arguments, + bool locals, + bool statics, + lldb::DynamicValueType use_dynamic); + + lldb::SBValueList + GetVariables (lldb::SBTarget& target, + bool arguments, + bool locals, + bool statics); + //------------------------------------------------------------------ + /// Get the inlined block that contains this block. + /// + /// @return + /// If this block is inlined, it will return this block, else + /// parent blocks will be searched to see if any contain this + /// block and are themselves inlined. An invalid SBBlock will + /// be returned if this block nor any parent blocks are inlined + /// function blocks. + //------------------------------------------------------------------ + lldb::SBBlock + GetContainingInlinedBlock (); + + bool + GetDescription (lldb::SBStream &description); + +private: + friend class SBAddress; + friend class SBFrame; + friend class SBFunction; + friend class SBSymbolContext; + + lldb_private::Block * + GetPtr (); + + void + SetPtr (lldb_private::Block *lldb_object_ptr); + + SBBlock (lldb_private::Block *lldb_object_ptr); + + void + AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list); + + lldb_private::Block *m_opaque_ptr; +}; + + +} // namespace lldb + +#endif // LLDB_SBBlock_h_ Added: vendor/lldb/dist/include/lldb/API/SBBreakpoint.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBBreakpoint.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,175 @@ +//===-- SBBreakpoint.h ------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBBreakpoint_h_ +#define LLDB_SBBreakpoint_h_ + +#include "lldb/API/SBDefines.h" + +namespace lldb { + +class SBBreakpoint +{ +public: + + typedef bool (*BreakpointHitCallback) (void *baton, + SBProcess &process, + SBThread &thread, + lldb::SBBreakpointLocation &location); + + SBBreakpoint (); + + SBBreakpoint (const lldb::SBBreakpoint& rhs); + + ~SBBreakpoint(); + + const lldb::SBBreakpoint & + operator = (const lldb::SBBreakpoint& rhs); + + // Tests to see if the opaque breakpoint object in this object matches the + // opaque breakpoint object in "rhs". + bool + operator == (const lldb::SBBreakpoint& rhs); + + bool + operator != (const lldb::SBBreakpoint& rhs); + + break_id_t + GetID () const; + + bool + IsValid() const; + + void + ClearAllBreakpointSites (); + + lldb::SBBreakpointLocation + FindLocationByAddress (lldb::addr_t vm_addr); + + lldb::break_id_t + FindLocationIDByAddress (lldb::addr_t vm_addr); + + lldb::SBBreakpointLocation + FindLocationByID (lldb::break_id_t bp_loc_id); + + lldb::SBBreakpointLocation + GetLocationAtIndex (uint32_t index); + + void + SetEnabled (bool enable); + + bool + IsEnabled (); + + void + SetOneShot (bool one_shot); + + bool + IsOneShot () const; + + bool + IsInternal (); + + uint32_t + GetHitCount () const; + + void + SetIgnoreCount (uint32_t count); + + uint32_t + GetIgnoreCount () const; + + void + SetCondition (const char *condition); + + const char * + GetCondition (); + + void + SetThreadID (lldb::tid_t sb_thread_id); + + lldb::tid_t + GetThreadID (); + + void + SetThreadIndex (uint32_t index); + + uint32_t + GetThreadIndex() const; + + void + SetThreadName (const char *thread_name); + + const char * + GetThreadName () const; + + void + SetQueueName (const char *queue_name); + + const char * + GetQueueName () const; + + void + SetCallback (BreakpointHitCallback callback, void *baton); + + size_t + GetNumResolvedLocations() const; + + size_t + GetNumLocations() const; + + bool + GetDescription (lldb::SBStream &description); + + static bool + EventIsBreakpointEvent (const lldb::SBEvent &event); + + static lldb::BreakpointEventType + GetBreakpointEventTypeFromEvent (const lldb::SBEvent& event); + + static lldb::SBBreakpoint + GetBreakpointFromEvent (const lldb::SBEvent& event); + + static lldb::SBBreakpointLocation + GetBreakpointLocationAtIndexFromEvent (const lldb::SBEvent& event, uint32_t loc_idx); + + static uint32_t + GetNumBreakpointLocationsFromEvent (const lldb::SBEvent &event_sp); + + +private: + friend class SBBreakpointLocation; + friend class SBTarget; + + SBBreakpoint (const lldb::BreakpointSP &bp_sp); + + lldb_private::Breakpoint * + operator->() const; + + lldb_private::Breakpoint * + get() const; + + lldb::BreakpointSP & + operator *(); + + const lldb::BreakpointSP & + operator *() const; + + static bool + PrivateBreakpointHitCallback (void *baton, + lldb_private::StoppointCallbackContext *context, + lldb::user_id_t break_id, + lldb::user_id_t break_loc_id); + + lldb::BreakpointSP m_opaque_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBBreakpoint_h_ Added: vendor/lldb/dist/include/lldb/API/SBBreakpointLocation.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBBreakpointLocation.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,110 @@ +//===-- SBBreakpointLocation.h ----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBBreakpointLocation_h_ +#define LLDB_SBBreakpointLocation_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBBreakpoint.h" + +namespace lldb { + +class SBBreakpointLocation +{ +public: + + SBBreakpointLocation (); + + SBBreakpointLocation (const lldb::SBBreakpointLocation &rhs); + + ~SBBreakpointLocation (); + + const lldb::SBBreakpointLocation & + operator = (const lldb::SBBreakpointLocation &rhs); + + break_id_t + GetID (); + + bool + IsValid() const; + + lldb::SBAddress + GetAddress (); + + lldb::addr_t + GetLoadAddress (); + + void + SetEnabled(bool enabled); + + bool + IsEnabled (); + + uint32_t + GetIgnoreCount (); + + void + SetIgnoreCount (uint32_t n); + + void + SetCondition (const char *condition); + + const char * + GetCondition (); + + void + SetThreadID (lldb::tid_t sb_thread_id); + + lldb::tid_t + GetThreadID (); + + void + SetThreadIndex (uint32_t index); + + uint32_t + GetThreadIndex() const; + + void + SetThreadName (const char *thread_name); + + const char * + GetThreadName () const; + + void + SetQueueName (const char *queue_name); + + const char * + GetQueueName () const; + + bool + IsResolved (); + + bool + GetDescription (lldb::SBStream &description, DescriptionLevel level); + + SBBreakpoint + GetBreakpoint (); + + SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp); + +private: + friend class SBBreakpoint; +#ifndef LLDB_DISABLE_PYTHON + friend class lldb_private::ScriptInterpreterPython; +#endif + void + SetLocation (const lldb::BreakpointLocationSP &break_loc_sp); + + lldb::BreakpointLocationSP m_opaque_sp; + +}; + +} // namespace lldb + +#endif // LLDB_SBBreakpointLocation_h_ Added: vendor/lldb/dist/include/lldb/API/SBBroadcaster.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBBroadcaster.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,97 @@ +//===-- SBBroadcaster.h -----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBBroadcaster_h_ +#define LLDB_SBBroadcaster_h_ + +#include "lldb/API/SBDefines.h" + +namespace lldb { + +class SBBroadcaster +{ +public: + SBBroadcaster (); + + SBBroadcaster (const char *name); + + SBBroadcaster (const SBBroadcaster &rhs); + + const SBBroadcaster & + operator = (const SBBroadcaster &rhs); + + ~SBBroadcaster(); + + bool + IsValid () const; + + void + Clear (); + + void + BroadcastEventByType (uint32_t event_type, bool unique = false); + + void + BroadcastEvent (const lldb::SBEvent &event, bool unique = false); + + void + AddInitialEventsToListener (const lldb::SBListener &listener, uint32_t requested_events); + + uint32_t + AddListener (const lldb::SBListener &listener, uint32_t event_mask); + + const char * + GetName () const; + + bool + EventTypeHasListeners (uint32_t event_type); + + bool + RemoveListener (const lldb::SBListener &listener, uint32_t event_mask = UINT32_MAX); + + // This comparison is checking if the internal opaque pointer value + // is equal to that in "rhs". + bool + operator == (const lldb::SBBroadcaster &rhs) const; + + // This comparison is checking if the internal opaque pointer value + // is not equal to that in "rhs". + bool + operator != (const lldb::SBBroadcaster &rhs) const; + + // This comparison is checking if the internal opaque pointer value + // is less than that in "rhs" so SBBroadcaster objects can be contained + // in ordered containers. + bool + operator < (const lldb::SBBroadcaster &rhs) const; + +protected: + friend class SBCommandInterpreter; + friend class SBCommunication; + friend class SBEvent; + friend class SBListener; + friend class SBProcess; + friend class SBTarget; + + SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns); + + lldb_private::Broadcaster * + get () const; + + void + reset (lldb_private::Broadcaster *broadcaster, bool owns); + +private: + lldb::BroadcasterSP m_opaque_sp; + lldb_private::Broadcaster *m_opaque_ptr; +}; + +} // namespace lldb + +#endif // LLDB_SBBroadcaster_h_ Added: vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,193 @@ +//===-- SBCommandInterpreter.h ----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBCommandInterpreter_h_ +#define LLDB_SBCommandInterpreter_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBDebugger.h" + +namespace lldb { + +class SBCommandInterpreter +{ +public: + enum + { + eBroadcastBitThreadShouldExit = (1 << 0), + eBroadcastBitResetPrompt = (1 << 1), + eBroadcastBitQuitCommandReceived = (1 << 2), // User entered quit + eBroadcastBitAsynchronousOutputData = (1 << 3), + eBroadcastBitAsynchronousErrorData = (1 << 4) + }; + + SBCommandInterpreter (const lldb::SBCommandInterpreter &rhs); + + const lldb::SBCommandInterpreter & + operator = (const lldb::SBCommandInterpreter &rhs); + + ~SBCommandInterpreter (); + + static const char * + GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type); + + static const char * + GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type); + + bool + IsValid() const; + + bool + CommandExists (const char *cmd); + + bool + AliasExists (const char *cmd); + + lldb::SBBroadcaster + GetBroadcaster (); + + static const char * + GetBroadcasterClass (); + + bool + HasCommands (); + + bool + HasAliases (); + + bool + HasAliasOptions (); + + lldb::SBProcess + GetProcess (); + + lldb::SBDebugger + GetDebugger (); + + lldb::SBCommand + AddMultiwordCommand (const char* name, const char* help); + + lldb::SBCommand + AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, const char* help); + + void + SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result); + + void + SourceInitFileInCurrentWorkingDirectory (lldb::SBCommandReturnObject &result); + + lldb::ReturnStatus + HandleCommand (const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history = false); + + // The pointer based interface is not useful in SWIG, since the cursor & last_char arguments are string pointers INTO current_line + // and you can't do that in a scripting language interface in general... + + // In either case, the way this works is that the you give it a line and cursor position in the line. The function + // will return the number of completions. The matches list will contain number_of_completions + 1 elements. The first + // element is the common substring after the cursor position for all the matches. The rest of the elements are the + // matches. The first element is useful if you are emulating the common shell behavior where the tab completes + // to the string that is common among all the matches, then you should first check if the first element is non-empty, + // and if so just insert it and move the cursor to the end of the insertion. The next tab will return an empty + // common substring, and a list of choices (if any), at which point you should display the choices and let the user + // type further to disambiguate. + + int + HandleCompletion (const char *current_line, + const char *cursor, + const char *last_char, + int match_start_point, + int max_return_elements, + lldb::SBStringList &matches); + + int + HandleCompletion (const char *current_line, + uint32_t cursor_pos, + int match_start_point, + int max_return_elements, + lldb::SBStringList &matches); + + // Catch commands before they execute by registering a callback that will + // get called when the command gets executed. This allows GUI or command + // line interfaces to intercept a command and stop it from happening + bool + SetCommandOverrideCallback (const char *command_name, + lldb::CommandOverrideCallback callback, + void *baton); + + SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr = NULL); // Access using SBDebugger::GetCommandInterpreter(); + +protected: + + lldb_private::CommandInterpreter & + ref (); + + lldb_private::CommandInterpreter * + get (); + + void + reset (lldb_private::CommandInterpreter *); +private: + friend class SBDebugger; + + static void + InitializeSWIG (); + + lldb_private::CommandInterpreter *m_opaque_ptr; +}; + +class SBCommandPluginInterface +{ +public: + virtual bool + DoExecute (lldb::SBDebugger debugger, + char** command, + lldb::SBCommandReturnObject &result) + { + return false; + } + + virtual + ~SBCommandPluginInterface () + {} +}; + +class SBCommand +{ +public: + + SBCommand (); + + bool + IsValid (); + + const char* + GetName (); + + const char* + GetHelp (); + + lldb::SBCommand + AddMultiwordCommand (const char* name, const char* help = NULL); + + lldb::SBCommand + AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help = NULL); + +private: + + friend class SBDebugger; + friend class SBCommandInterpreter; + + SBCommand (lldb::CommandObjectSP cmd_sp); + + lldb::CommandObjectSP m_opaque_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBCommandInterpreter_h_ Added: vendor/lldb/dist/include/lldb/API/SBCommandReturnObject.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBCommandReturnObject.h Fri Aug 23 17:46:38 2013 (r254721) @@ -0,0 +1,133 @@ +//===-- SBCommandReturnObject.h ---------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBCommandReturnObject_h_ +#define LLDB_SBCommandReturnObject_h_ + +#include + +#include "lldb/API/SBDefines.h" + +namespace lldb { + +class SBCommandReturnObject +{ +public: + + SBCommandReturnObject (); + + SBCommandReturnObject (const lldb::SBCommandReturnObject &rhs); + + const lldb::SBCommandReturnObject & + operator = (const lldb::SBCommandReturnObject &rhs); + + + SBCommandReturnObject (lldb_private::CommandReturnObject *ptr); + + lldb_private::CommandReturnObject * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 17:47:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CAB1334F; Fri, 23 Aug 2013 17:47:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E47726F9; Fri, 23 Aug 2013 17:47:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NHlLXm087498; Fri, 23 Aug 2013 17:47:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NHlLIY087497; Fri, 23 Aug 2013 17:47:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231747.r7NHlLIY087497@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 17:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r254722 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:47:21 -0000 Author: emaste Date: Fri Aug 23 17:47:21 2013 New Revision: 254722 URL: http://svnweb.freebsd.org/changeset/base/254722 Log: Back to normal limit Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Fri Aug 23 17:46:38 2013 (r254721) +++ svnadmin/conf/sizelimit.conf Fri Aug 23 17:47:21 2013 (r254722) @@ -23,7 +23,6 @@ brooks des dim ed -emaste 102400000 gnn gonzo imp From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 17:52:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 36BC5576; Fri, 23 Aug 2013 17:52:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A65C274A; Fri, 23 Aug 2013 17:52:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NHq1gr090789; Fri, 23 Aug 2013 17:52:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NHq14u090788; Fri, 23 Aug 2013 17:52:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231752.r7NHq14u090788@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 17:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254723 - vendor/lldb/lldb-r188801 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 17:52:02 -0000 Author: emaste Date: Fri Aug 23 17:52:01 2013 New Revision: 254723 URL: http://svnweb.freebsd.org/changeset/base/254723 Log: Tag (stripped) lldb r188801 Added: vendor/lldb/lldb-r188801/ - copied from r254722, vendor/lldb/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:02:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 06572775; Fri, 23 Aug 2013 18:02:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4BE827DB; Fri, 23 Aug 2013 18:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI22v4095859; Fri, 23 Aug 2013 18:02:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI1wPv095805; Fri, 23 Aug 2013 18:01:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308231801.r7NI1wPv095805@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 23 Aug 2013 18:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254724 - in vendor-sys/acpica/dist: . generate/unix/acpidump source/common source/compiler source/components/debugger source/components/events source/components/hardware source/compone... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:02:03 -0000 Author: jkim Date: Fri Aug 23 18:01:58 2013 New Revision: 254724 URL: http://svnweb.freebsd.org/changeset/base/254724 Log: Import ACPICA 20130823. Added: vendor-sys/acpica/dist/source/os_specific/service_layers/osunixmap.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/acpidump/Makefile vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbfileio.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/events/evgpeutil.c vendor-sys/acpica/dist/source/components/events/evmisc.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/events/evsci.c vendor-sys/acpica/dist/source/components/events/evxface.c vendor-sys/acpica/dist/source/components/hardware/hwxface.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbxfroot.c vendor-sys/acpica/dist/source/components/utilities/utdebug.c vendor-sys/acpica/dist/source/components/utilities/utglobal.c vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acevents.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acpiosxf.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/platform/aclinux.h vendor-sys/acpica/dist/source/os_specific/service_layers/osfreebsdtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/oslinuxtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixdir.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswintbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpibin/abmain.c vendor-sys/acpica/dist/source/tools/acpidump/acpidump.h vendor-sys/acpica/dist/source/tools/acpidump/apdump.c vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/source/tools/acpinames/anmain.c vendor-sys/acpica/dist/source/tools/acpinames/antables.c vendor-sys/acpica/dist/source/tools/acpisrc/asmain.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpixtract/axmain.c vendor-sys/acpica/dist/tests/misc/grammar.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/changes.txt Fri Aug 23 18:01:58 2013 (r254724) @@ -1,4 +1,88 @@ ---------------------------------------- +23 August 2013. Summary of changes for version 20130823: + +1) ACPICA kernel-resident subsystem: + +Implemented support for host-installed System Control Interrupt (SCI) +handlers. Certain ACPI functionality requires the host to handle raw +SCIs. For example, the "SCI Doorbell" that is defined for memory power +state support requires the host device driver to handle SCIs to examine +if the doorbell has been activated. Multiple SCI handlers can be +installed to allow for future expansion. New external interfaces are +AcpiInstallSciHandler, AcpiRemoveSciHandler; see the ACPICA reference for +details. Lv Zheng, Bob Moore. ACPICA BZ 1032. + +Operation region support: Never locally free the handler "context" +pointer. This change removes some dangerous code that attempts to free +the handler context pointer in some (rare) circumstances. The owner of +the handler owns this pointer and the ACPICA code should never touch it. +Although not seen to be an issue in any kernel, it did show up as a +problem (fault) under AcpiExec. Also, set the internal storage field for +the context pointer to zero when the region is deactivated, simply for +sanity. David Box. ACPICA BZ 1039. + +AcpiRead: On error, do not modify the return value target location. If an +error happens in the middle of a split 32/32 64-bit I/O operation, do not +modify the target of the return value pointer. Makes the code consistent +with the rest of ACPICA. Bjorn Helgaas. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.7K Code, 27.1K Data, 123.9K Total + Debug Version: 184.4K Code, 76.8K Data, 261.2K Total + Previous Release: + Non-Debug Version: 96.2K Code, 27.1K Data, 123.3K Total + Debug Version: 185.4K Code, 77.1K Data, 262.5K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiDump: Implemented several new features and fixed some problems: +1) Added support to dump the RSDP, RSDT, and XSDT tables. +2) Added support for multiple table instances (SSDT, UEFI). +3) Added option to dump "customized" (overridden) tables (-c). +4) Fixed a problem where some table filenames were improperly +constructed. +5) Improved some error messages, removed some unnecessary messages. + +iASL: Implemented additional support for disassembly of ACPI tables that +contain invocations of external control methods. The -fe option +allows the import of a file that specifies the external methods along +with the required number of arguments for each -- allowing for the +correct disassembly of the table. This is a workaround for a limitation +of AML code where the disassembler often cannot determine the number of +arguments required for an external control method and generates incorrect +ASL code. See the iASL reference for details. ACPICA BZ 1030. + +Debugger: Implemented a new command (paths) that displays the full +pathnames (namepaths) and object types of all objects in the namespace. +This is an alternative to the namespace command. + +Debugger: Implemented a new command (sci) that invokes the SCI dispatch +mechanism and any installed handlers. + +iASL: Fixed a possible segfault for "too many parent prefixes" condition. +This can occur if there are too many parent prefixes in a namepath (for +example, ^^^^^^PCI0.ECRD). ACPICA BZ 1035. + +Application OSLs: Set the return value for the PCI read functions. These +functions simply return AE_OK, but should set the return value to zero +also. This change implements this. ACPICA BZ 1038. + +Debugger: Prevent possible command line buffer overflow. Increase the +size of a couple of the debugger line buffers, and ensure that overflow +cannot happen. ACPICA BZ 1037. + +iASL: Changed to abort immediately on serious errors during the parsing +phase. Due to the nature of ASL, there is no point in attempting to +compile these types of errors, and they typically end up causing a +cascade of hundreds of errors which obscure the original problem. + +---------------------------------------- 25 July 2013. Summary of changes for version 20130725: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/acpidump/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpidump/Makefile Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/generate/unix/acpidump/Makefile Fri Aug 23 18:01:58 2013 (r254724) @@ -31,6 +31,8 @@ OBJECTS = \ $(OBJDIR)/apdump.o\ $(OBJDIR)/apfiles.o\ $(OBJDIR)/apmain.o\ + $(OBJDIR)/osunixdir.o\ + $(OBJDIR)/osunixmap.o\ $(OBJDIR)/tbprint.o\ $(OBJDIR)/tbxfroot.o\ $(OBJDIR)/utbuffer.o\ Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/common/adisasm.c Fri Aug 23 18:01:58 2013 (r254724) @@ -341,6 +341,10 @@ AdAmlDisassemble ( { AcpiDmClearExternalList (); } + + /* Load any externals defined in the optional external ref file */ + + AcpiDmGetExternalsFromFile (); } else { Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/common/adwalk.c Fri Aug 23 18:01:58 2013 (r254724) @@ -373,10 +373,18 @@ AcpiDmDumpDescending ( switch (Op->Common.AmlOpcode) { case AML_BYTE_OP: + + AcpiOsPrintf ("%2.2X", (UINT32) Op->Common.Value.Integer); + break; + case AML_WORD_OP: + + AcpiOsPrintf ("%4.4X", (UINT32) Op->Common.Value.Integer); + break; + case AML_DWORD_OP: - AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer); + AcpiOsPrintf ("%8.8X", (UINT32) Op->Common.Value.Integer); break; case AML_QWORD_OP: Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/common/dmextern.c Fri Aug 23 18:01:58 2013 (r254724) @@ -46,7 +46,9 @@ #include "amlcode.h" #include "acnamesp.h" #include "acdisasm.h" +#include "aslcompiler.h" #include +#include /* @@ -87,6 +89,8 @@ static const char *AcpiGbl_DmT /* 19 */ ", FieldUnitObj" }; +#define METHOD_SEPARATORS " \t,()\n" + /* Local prototypes */ @@ -99,6 +103,12 @@ AcpiDmNormalizeParentPrefix ( ACPI_PARSE_OBJECT *Op, char *Path); +static void +AcpiDmAddToExternalListFromFile ( + char *Path, + UINT8 Type, + UINT32 Value); + /******************************************************************************* * @@ -444,7 +454,7 @@ AcpiDmAddToExternalList ( (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, - "Argument count mismatch for method %s %u %u", + "External method arg count mismatch %s: Current %u, attempted %u", NextExternal->Path, NextExternal->Value, Value)); } @@ -536,6 +546,275 @@ AcpiDmAddToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmGetExternalsFromFile + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Process the optional external reference file. + * + * Each line in the file should be of the form: + * External (, MethodObj, ) + * + * Example: + * External (_SB_.PCI0.XHC_.PS0X, MethodObj, 4) + * + ******************************************************************************/ + +void +AcpiDmGetExternalsFromFile ( + void) +{ + FILE *ExternalRefFile; + char *Token; + char *MethodName; + UINT32 ArgCount; + UINT32 ImportCount = 0; + + + if (!Gbl_ExternalRefFilename) + { + return; + } + + /* Open the file */ + + ExternalRefFile = fopen (Gbl_ExternalRefFilename, "r"); + if (!ExternalRefFile) + { + fprintf (stderr, "Could not open external reference file \"%s\"\n", + Gbl_ExternalRefFilename); + return; + } + + /* Each line defines a method */ + + while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile)) + { + Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */ + if (!Token) continue; + if (strcmp (Token, "External")) continue; + + MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */ + if (!MethodName) continue; + + Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */ + if (!Token) continue; + if (strcmp (Token, "MethodObj")) continue; + + Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */ + if (!Token) continue; + + /* Convert arg count string to an integer */ + + errno = 0; + ArgCount = strtoul (Token, NULL, 0); + if (errno) + { + fprintf (stderr, "Invalid argument count (%s)\n", Token); + continue; + } + if (ArgCount > 7) + { + fprintf (stderr, "Invalid argument count (%u)\n", ArgCount); + continue; + } + + /* Add this external to the global list */ + + AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n", + Gbl_ExternalRefFilename, ArgCount, MethodName); + + AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80); + ImportCount++; + } + + if (!ImportCount) + { + fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n", + Gbl_ExternalRefFilename); + } + else + { + /* Add the external(s) to the namespace */ + + AcpiDmAddExternalsToNamespace (); + + AcpiOsPrintf ("%s: Imported %u external method definitions\n", + Gbl_ExternalRefFilename, ImportCount); + } + + fclose (ExternalRefFile); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddToExternalListFromFile + * + * PARAMETERS: Path - Internal (AML) path to the object + * Type - ACPI object type to be added + * Value - Arg count if adding a Method object + * + * RETURN: None + * + * DESCRIPTION: Insert a new name into the global list of Externals which + * will in turn be later emitted as an External() declaration + * in the disassembled output. + * + ******************************************************************************/ + +static void +AcpiDmAddToExternalListFromFile ( + char *Path, + UINT8 Type, + UINT32 Value) +{ + char *InternalPath; + char *ExternalPath; + ACPI_EXTERNAL_LIST *NewExternal; + ACPI_EXTERNAL_LIST *NextExternal; + ACPI_EXTERNAL_LIST *PrevExternal = NULL; + ACPI_STATUS Status; + BOOLEAN Resolved = FALSE; + + + if (!Path) + { + return; + } + + /* TBD: Add a flags parameter */ + + if (Type == ACPI_TYPE_METHOD) + { + if (Value & 0x80) + { + Resolved = TRUE; + } + Value &= 0x07; + } + + /* + * We don't want External() statements to contain a leading '\'. + * This prevents duplicate external statements of the form: + * + * External (\ABCD) + * External (ABCD) + * + * This would cause a compile time error when the disassembled + * output file is recompiled. + */ + if ((*Path == AML_ROOT_PREFIX) && (Path[1])) + { + Path++; + } + + /* Check all existing externals to ensure no duplicates */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (!ACPI_STRCMP (Path, NextExternal->Path)) + { + /* Duplicate method, check that the Value (ArgCount) is the same */ + + if ((NextExternal->Type == ACPI_TYPE_METHOD) && + (NextExternal->Value != Value)) + { + ACPI_ERROR ((AE_INFO, + "(File) External method arg count mismatch %s: Current %u, override to %u", + NextExternal->Path, NextExternal->Value, Value)); + + /* Override, since new value came from external reference file */ + + NextExternal->Value = Value; + } + + /* Allow upgrade of type from ANY */ + + else if (NextExternal->Type == ACPI_TYPE_ANY) + { + NextExternal->Type = Type; + NextExternal->Value = Value; + } + + return; + } + + NextExternal = NextExternal->Next; + } + + /* Get the internal pathname (AML format) */ + + Status = AcpiNsInternalizeName (Path, &InternalPath); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Allocate and init a new External() descriptor */ + + NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); + if (!NewExternal) + { + ACPI_FREE (InternalPath); + return; + } + + /* Must copy and normalize the input path */ + + AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath); + + NewExternal->Path = ExternalPath; + NewExternal->Type = Type; + NewExternal->Value = Value; + NewExternal->Resolved = Resolved; + NewExternal->Length = (UINT16) ACPI_STRLEN (Path); + NewExternal->InternalPath = InternalPath; + + /* Set flag to indicate External->InternalPath needs to be freed */ + + NewExternal->Flags |= ACPI_IPATH_ALLOCATED | ACPI_FROM_REFERENCE_FILE; + + /* Link the new descriptor into the global list, alphabetically ordered */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0) + { + if (PrevExternal) + { + PrevExternal->Next = NewExternal; + } + else + { + AcpiGbl_ExternalList = NewExternal; + } + + NewExternal->Next = NextExternal; + return; + } + + PrevExternal = NextExternal; + NextExternal = NextExternal->Next; + } + + if (PrevExternal) + { + PrevExternal->Next = NewExternal; + } + else + { + AcpiGbl_ExternalList = NewExternal; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddExternalsToNamespace * * PARAMETERS: None @@ -563,7 +842,7 @@ AcpiDmAddExternalsToNamespace ( Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, ACPI_IMODE_LOAD_PASS1, - ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (ACPI_FAILURE (Status)) @@ -731,7 +1010,8 @@ AcpiDmEmitExternals ( NextExternal->Path, AcpiDmGetObjectTypeName (NextExternal->Type)); - AcpiOsPrintf (") // Warning: Unresolved Method, " + AcpiOsPrintf ( + ") // Warning: Unresolved Method, " "guessing %u arguments (may be incorrect, see warning above)\n", NextExternal->Value); @@ -743,9 +1023,45 @@ AcpiDmEmitExternals ( AcpiOsPrintf ("\n"); + + /* Emit externals that were imported from a file */ + + if (Gbl_ExternalRefFilename) + { + AcpiOsPrintf ( + " /*\n * External declarations that were imported from\n" + " * the reference file [%s]\n */\n", + Gbl_ExternalRefFilename); + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (!NextExternal->Emitted && (NextExternal->Flags & ACPI_FROM_REFERENCE_FILE)) + { + AcpiOsPrintf (" External (%s%s", + NextExternal->Path, + AcpiDmGetObjectTypeName (NextExternal->Type)); + + if (NextExternal->Type == ACPI_TYPE_METHOD) + { + AcpiOsPrintf (") // %u Arguments\n", + NextExternal->Value); + } + else + { + AcpiOsPrintf (")\n"); + } + NextExternal->Emitted = TRUE; + } + + NextExternal = NextExternal->Next; + } + + AcpiOsPrintf ("\n"); + } + /* - * Walk the list of externals (unresolved references) - * found during the AML parsing + * Walk the list of externals found during the AML parsing */ while (AcpiGbl_ExternalList) { Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/common/dmtable.c Fri Aug 23 18:01:58 2013 (r254724) @@ -446,7 +446,7 @@ AcpiDmDumpDataTable ( Length = Table->Length; AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); } - else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_RSDP)) + else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) { Length = AcpiDmDumpRsdp (Table); } Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Fri Aug 23 18:01:58 2013 (r254724) @@ -593,10 +593,15 @@ CmDoCompile ( AslCompilerparse(); UtEndEvent (Event); - /* Flush out any remaining source after parse tree is complete */ + /* Check for parse errors */ - Event = UtBeginEvent ("Flush source input"); - CmFlushSourceCode (); + Status = AslCheckForErrorExit (); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n"); + LsDumpParseTree (); + goto ErrorExit; + } /* Did the parse tree get successfully constructed? */ @@ -606,16 +611,18 @@ CmDoCompile ( * If there are no errors, then we have some sort of * internal problem. */ - Status = AslCheckForErrorExit (); - if (Status == AE_OK) - { - AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, - NULL, "- Could not resolve parse tree root node"); - } + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, + NULL, "- Could not resolve parse tree root node"); goto ErrorExit; } + + /* Flush out any remaining source after parse tree is complete */ + + Event = UtBeginEvent ("Flush source input"); + CmFlushSourceCode (); + /* Optional parse tree dump, compiler debug output only */ LsDumpParseTree (); Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Fri Aug 23 18:01:58 2013 (r254724) @@ -186,6 +186,7 @@ ASL_EXTERN char ASL_ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); ASL_EXTERN char *Gbl_CurrentInputFilename; +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalRefFilename, NULL); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE); Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Fri Aug 23 18:01:58 2013 (r254724) @@ -487,6 +487,10 @@ LdNamespace1Begin ( ACPI_TYPE_LOCAL_SCOPE, ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &(Node)); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } /* * However, this is an error -- primarily because the MS Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Fri Aug 23 18:01:58 2013 (r254724) @@ -138,6 +138,7 @@ Usage ( ACPI_OPTION ("-dc ", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-e ", "Include ACPI table(s) for external symbol resolution"); + ACPI_OPTION ("-fe ", "Specify external symbol declaration file"); ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloptions.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/compiler/asloptions.c Fri Aug 23 18:01:58 2013 (r254724) @@ -68,7 +68,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" /******************************************************************************* @@ -136,8 +136,7 @@ AslCommandLine ( if (BadCommandLine) { - printf ("\n"); - Usage (); + printf ("Use -h option for help information\n"); exit (1); } @@ -276,9 +275,30 @@ AslDoOptions ( } break; - case 'f': /* Ignore errors and force creation of aml file */ + case 'f': + + switch (AcpiGbl_Optarg[0]) + { + case '^': /* Ignore errors and force creation of aml file */ + + Gbl_IgnoreErrors = TRUE; + break; + + case 'e': /* Disassembler: Get external declaration file */ + + if (AcpiGetoptArgument (argc, argv)) + { + return (-1); + } + + Gbl_ExternalRefFilename = AcpiGbl_Optarg; + break; - Gbl_IgnoreErrors = TRUE; + default: + + printf ("Unknown option: -f%s\n", AcpiGbl_Optarg); + return (-1); + } break; case 'G': Modified: vendor-sys/acpica/dist/source/compiler/dtcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtcompile.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/compiler/dtcompile.c Fri Aug 23 18:01:58 2013 (r254724) @@ -317,7 +317,7 @@ DtCompileDataTable ( DtSetTableLength (); return (Status); } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_RSDP)) + else if (ACPI_VALIDATE_RSDP_SIG (Signature)) { Status = DtCompileRsdp (FieldList); return (Status); Modified: vendor-sys/acpica/dist/source/components/debugger/dbcmds.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbcmds.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/debugger/dbcmds.c Fri Aug 23 18:01:58 2013 (r254724) @@ -1211,6 +1211,14 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } + +void +AcpiDbGenerateSci ( + void) +{ + AcpiEvSciDispatch (); +} + #endif /* !ACPI_REDUCED_HARDWARE */ #endif /* ACPI_DEBUGGER */ Modified: vendor-sys/acpica/dist/source/components/debugger/dbfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbfileio.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/debugger/dbfileio.c Fri Aug 23 18:01:58 2013 (r254724) @@ -142,7 +142,8 @@ AcpiDbOpenDebugFile ( } AcpiOsPrintf ("Debug output file %s opened\n", Name); - ACPI_STRCPY (AcpiGbl_DbDebugFilename, Name); + ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name, + sizeof (AcpiGbl_DbDebugFilename)); AcpiGbl_DbOutputToFile = TRUE; #endif @@ -274,11 +275,9 @@ AcpiDbReadTable ( fseek (fp, 0, SEEK_SET); - /* The RSDT, FACS and S3PT tables do not have standard ACPI headers */ + /* The RSDP table does not have standard ACPI header */ - if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ") || - ACPI_COMPARE_NAME (TableHeader.Signature, "FACS") || - ACPI_COMPARE_NAME (TableHeader.Signature, "S3PT")) + if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ")) { *TableLength = FileSize; StandardHeader = FALSE; Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Aug 23 18:01:58 2013 (r254724) @@ -132,12 +132,14 @@ enum AcpiExDebuggerCommands CMD_OPEN, CMD_OSI, CMD_OWNER, + CMD_PATHS, CMD_PREDEFINED, CMD_PREFIX, CMD_QUIT, CMD_REFERENCES, CMD_RESOURCES, CMD_RESULTS, + CMD_SCI, CMD_SET, CMD_SLEEP, CMD_STATS, @@ -203,12 +205,14 @@ static const ACPI_DB_COMMAND_INFO Acpi {"OPEN", 1}, {"OSI", 0}, {"OWNER", 1}, + {"PATHS", 0}, {"PREDEFINED", 0}, {"PREFIX", 0}, {"QUIT", 0}, {"REFERENCES", 1}, {"RESOURCES", 0}, {"RESULTS", 0}, + {"SCI", 0}, {"SET", 3}, {"SLEEP", 0}, {"STATS", 1}, @@ -259,22 +263,19 @@ static const ACPI_DB_COMMAND_HELP Acpi {0, "\nNamespace Access Commands:", "\n"}, {1, " Businfo", "Display system bus info\n"}, {1, " Disassemble ", "Disassemble a control method\n"}, - {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, - {1, " Gpe ", "Simulate a GPE\n"}, - {1, " Gpes", "Display info on all GPEs\n"}, {1, " Integrity", "Validate namespace integrity\n"}, {1, " Methods", "Display list of loaded control methods\n"}, {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, {1, " Notify ", "Send a notification on Object\n"}, {1, " Objects ", "Display all objects of the given type\n"}, {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, + {1, " Paths", "Display full pathnames of namespace objects\n"}, {1, " Predefined", "Check all predefined names\n"}, {1, " Prefix []", "Set or Get current execution prefix\n"}, {1, " References ", "Find all references to object at addr\n"}, {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, {1, " Set N ", "Set value for named integer\n"}, - {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, {1, " Terminate", "Delete namespace and all internal objects\n"}, {1, " Type ", "Display object type\n"}, @@ -288,7 +289,7 @@ static const ACPI_DB_COMMAND_HELP Acpi {5, " Execute [Arguments]", "Execute control method\n"}, {1, " Hex Integer", "Integer method argument\n"}, {1, " \"Ascii String\"", "String method argument\n"}, - {1, " (Byte List)", "Buffer method argument\n"}, + {1, " (Hex Byte List)", "Buffer method argument\n"}, {1, " [Package Element List]", "Package method argument\n"}, {1, " Go", "Allow method to run to completion\n"}, {1, " Information", "Display info about the current method\n"}, @@ -303,6 +304,13 @@ static const ACPI_DB_COMMAND_HELP Acpi {1, " Tree", "Display control method calling tree\n"}, {1, " ", "Single step next AML opcode (over calls)\n"}, + {0, "\nHardware Related Commands:", "\n"}, + {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, + {1, " Gpe ", "Simulate a GPE\n"}, + {1, " Gpes", "Display info on all GPEs\n"}, + {1, " Sci", "Generate an SCI\n"}, + {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, + {0, "\nFile I/O Commands:", "\n"}, {1, " Close", "Close debug output file\n"}, {1, " Load ", "Load ACPI table from a file\n"}, @@ -1002,6 +1010,11 @@ AcpiDbCommandDispatch ( AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; + case CMD_PATHS: + + AcpiDbDumpNamespacePaths (); + break; + case CMD_PREDEFINED: AcpiDbCheckPredefinedNames (); @@ -1027,6 +1040,11 @@ AcpiDbCommandDispatch ( AcpiDbDisplayResults (); break; + case CMD_SCI: + + AcpiDbGenerateSci (); + break; + case CMD_SET: AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], Modified: vendor-sys/acpica/dist/source/components/debugger/dbnames.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Aug 23 18:01:58 2013 (r254724) @@ -256,6 +256,37 @@ AcpiDbDumpNamespace ( /******************************************************************************* * + * FUNCTION: AcpiDbDumpNamespacePaths + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Dump entire namespace with full object pathnames and object + * type information. Alternative to "namespace" command. + * + ******************************************************************************/ + +void +AcpiDbDumpNamespacePaths ( + void) +{ + + AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); + AcpiOsPrintf ("ACPI Namespace (from root):\n"); + + /* Display the entire namespace */ + + AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); + AcpiNsDumpObjectPaths (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, + ACPI_UINT32_MAX, ACPI_OWNER_ID_MAX, AcpiGbl_RootNode); + + AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbDumpNamespaceByOwner * * PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed Modified: vendor-sys/acpica/dist/source/components/events/evgpeutil.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evgpeutil.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/events/evgpeutil.c Fri Aug 23 18:01:58 2013 (r254724) @@ -216,7 +216,7 @@ AcpiEvGetGpeDevice ( * * FUNCTION: AcpiEvGetGpeXruptBlock * - * PARAMETERS: InterruptNumber - Interrupt for a GPE block + * PARAMETERS: InterruptNumber - Interrupt for a GPE block * * RETURN: A GPE interrupt block * Modified: vendor-sys/acpica/dist/source/components/events/evmisc.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evmisc.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/events/evmisc.c Fri Aug 23 18:01:58 2013 (r254724) @@ -292,15 +292,6 @@ AcpiEvTerminate ( Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); - /* Remove SCI handler */ - - Status = AcpiEvRemoveSciHandler (); - if (ACPI_FAILURE(Status)) - { - ACPI_ERROR ((AE_INFO, - "Could not remove SCI handler")); - } - Status = AcpiEvRemoveGlobalLockHandler (); if (ACPI_FAILURE(Status)) { @@ -311,6 +302,15 @@ AcpiEvTerminate ( AcpiGbl_EventsInitialized = FALSE; } + /* Remove SCI handlers */ + + Status = AcpiEvRemoveAllSciHandlers (); + if (ACPI_FAILURE(Status)) + { + ACPI_ERROR ((AE_INFO, + "Could not remove SCI handler")); + } + /* Deallocate all handler objects installed within GPE info structs */ Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL); Modified: vendor-sys/acpica/dist/source/components/events/evregion.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evregion.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/events/evregion.c Fri Aug 23 18:01:58 2013 (r254724) @@ -234,18 +234,12 @@ AcpiEvAddressSpaceDispatch ( { RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; - if (RegionObj2->Extra.RegionContext) - { - /* The handler for this region was already installed */ - - ACPI_FREE (RegionContext); - } - else + /* + * Save the returned context for use in all accesses to + * the handler for this particular region + */ + if (!(RegionObj2->Extra.RegionContext)) { - /* - * Save the returned context for use in all accesses to - * this particular region - */ RegionObj2->Extra.RegionContext = RegionContext; } } @@ -261,7 +255,6 @@ AcpiEvAddressSpaceDispatch ( ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); - /* * Special handling for GenericSerialBus and GeneralPurposeIo: * There are three extra parameters that must be passed to the @@ -424,6 +417,15 @@ AcpiEvDetachRegion( Status = RegionSetup (RegionObj, ACPI_REGION_DEACTIVATE, HandlerObj->AddressSpace.Context, RegionContext); + /* + * RegionContext should have been released by the deactivate + * operation. We don't need access to it anymore here. + */ + if (RegionContext) + { + *RegionContext = NULL; + } + /* Init routine may fail, Just ignore errors */ if (ACPI_FAILURE (Status)) Modified: vendor-sys/acpica/dist/source/components/events/evsci.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evsci.c Fri Aug 23 17:52:01 2013 (r254723) +++ vendor-sys/acpica/dist/source/components/events/evsci.c Fri Aug 23 18:01:58 2013 (r254724) @@ -61,6 +61,57 @@ AcpiEvSciXruptHandler ( /******************************************************************************* * + * FUNCTION: AcpiEvSciDispatch + * + * PARAMETERS: None + * + * RETURN: Status code indicates whether interrupt was handled. + * + * DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers. + * + ******************************************************************************/ + +UINT32 +AcpiEvSciDispatch ( + void) +{ + ACPI_SCI_HANDLER_INFO *SciHandler; + ACPI_CPU_FLAGS Flags; + UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; + + + ACPI_FUNCTION_NAME (EvSciDispatch); + + + /* Are there any host-installed SCI handlers? */ + + if (!AcpiGbl_SciHandlerList) + { + return (IntStatus); + } + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + + /* Invoke all host-installed SCI handlers */ + + SciHandler = AcpiGbl_SciHandlerList; + while (SciHandler) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:02:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1AB738A2; Fri, 23 Aug 2013 18:02:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0725427E4; Fri, 23 Aug 2013 18:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI2bHt096034; Fri, 23 Aug 2013 18:02:37 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI2btZ096033; Fri, 23 Aug 2013 18:02:37 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201308231802.r7NI2btZ096033@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Aug 2013 18:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254725 - stable/9/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:02:38 -0000 Author: dim Date: Fri Aug 23 18:02:37 2013 New Revision: 254725 URL: http://svnweb.freebsd.org/changeset/base/254725 Log: MFC r254581: Pull in r188716 from upstream clang trunk: PR16727: don't try to evaluate a potentially value-dependent expression when checking for missing parens in &&/|| expressions. This fixes an assertion encountered when building the lang/sdcc port. Reported by: kwm Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Fri Aug 23 18:01:58 2013 (r254724) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Fri Aug 23 18:02:37 2013 (r254725) @@ -8884,14 +8884,16 @@ EmitDiagnosticForLogicalAndInLogicalOr(S /// 'true'. static bool EvaluatesAsTrue(Sema &S, Expr *E) { bool Res; - return E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && Res; + return !E->isValueDependent() && + E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && Res; } /// \brief Returns true if the given expression can be evaluated as a constant /// 'false'. static bool EvaluatesAsFalse(Sema &S, Expr *E) { bool Res; - return E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && !Res; + return !E->isValueDependent() && + E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && !Res; } /// \brief Look for '&&' in the left hand of a '||' expr. From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:02:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8FCEF8A3; Fri, 23 Aug 2013 18:02:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 639C727E5; Fri, 23 Aug 2013 18:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI2eY5096073; Fri, 23 Aug 2013 18:02:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI2eHl096072; Fri, 23 Aug 2013 18:02:40 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308231802.r7NI2eHl096072@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 23 Aug 2013 18:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254726 - vendor-sys/acpica/20130823 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:02:40 -0000 Author: jkim Date: Fri Aug 23 18:02:39 2013 New Revision: 254726 URL: http://svnweb.freebsd.org/changeset/base/254726 Log: Tag ACPICA 20130823. Added: vendor-sys/acpica/20130823/ - copied from r254724, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:03:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CD3FBAFA; Fri, 23 Aug 2013 18:03:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAF0127F1; Fri, 23 Aug 2013 18:03:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI3Ieb096430; Fri, 23 Aug 2013 18:03:18 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI3I6a096429; Fri, 23 Aug 2013 18:03:18 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201308231803.r7NI3I6a096429@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 23 Aug 2013 18:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254727 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:03:18 -0000 Author: np Date: Fri Aug 23 18:03:18 2013 New Revision: 254727 URL: http://svnweb.freebsd.org/changeset/base/254727 Log: There is no need to hold the freelist lock around alloc/free of software descriptors. This also silences WITNESS warnings when the software descriptors are allocated with M_WAITOK. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Aug 23 18:02:39 2013 (r254726) +++ head/sys/dev/cxgbe/t4_sge.c Fri Aug 23 18:03:18 2013 (r254727) @@ -1802,9 +1802,7 @@ alloc_iq_fl(struct port_info *pi, struct /* Allocate space for one software descriptor per buffer. */ fl->cap = (fl->qsize - spg_len / RX_FL_ESIZE) * 8; - FL_LOCK(fl); rc = alloc_fl_sdesc(fl); - FL_UNLOCK(fl); if (rc != 0) { device_printf(sc->dev, "failed to setup fl software descriptors: %d\n", @@ -1937,11 +1935,8 @@ free_iq_fl(struct port_info *pi, struct free_ring(sc, fl->desc_tag, fl->desc_map, fl->ba, fl->desc); - if (fl->sdesc) { - FL_LOCK(fl); + if (fl->sdesc) free_fl_sdesc(fl); - FL_UNLOCK(fl); - } if (mtx_initialized(&fl->fl_lock)) mtx_destroy(&fl->fl_lock); @@ -2788,8 +2783,6 @@ alloc_fl_sdesc(struct sge_fl *fl) bus_dma_tag_t tag; int i, rc; - FL_LOCK_ASSERT_OWNED(fl); - fl->sdesc = malloc(fl->cap * sizeof(struct fl_sdesc), M_CXGBE, M_ZERO | M_WAITOK); @@ -2828,8 +2821,6 @@ free_fl_sdesc(struct sge_fl *fl) struct fl_sdesc *sd; int i; - FL_LOCK_ASSERT_OWNED(fl); - sd = fl->sdesc; for (i = 0; i < fl->cap; i++, sd++) { From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:04:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55A12C4C; Fri, 23 Aug 2013 18:04:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 287482804; Fri, 23 Aug 2013 18:04:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI4EYL096748; Fri, 23 Aug 2013 18:04:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI4Ew2096747; Fri, 23 Aug 2013 18:04:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201308231804.r7NI4Ew2096747@svn.freebsd.org> From: Dimitry Andric Date: Fri, 23 Aug 2013 18:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254728 - stable/9/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:04:14 -0000 Author: dim Date: Fri Aug 23 18:04:13 2013 New Revision: 254728 URL: http://svnweb.freebsd.org/changeset/base/254728 Log: MFC r254582: Pull in r182983 from upstream clang trunk: Fix handling of braced-init-list as reference initializer within aggregate initialization. Previously we would incorrectly require an extra set of braces around such initializers. Pull in r188718 from upstream clang trunk: Handle init lists and _Atomic fields. Fixes PR16931. These fixes are needed for the atomic_flag type to work correctly in our stdatomic.h. Requested by: theraven Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Fri Aug 23 18:03:18 2013 (r254727) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Fri Aug 23 18:04:13 2013 (r254728) @@ -774,6 +774,11 @@ void InitListChecker::CheckSubElementTyp InitListExpr *StructuredList, unsigned &StructuredIndex) { Expr *expr = IList->getInit(Index); + + if (ElemType->isReferenceType()) + return CheckReferenceType(Entity, IList, ElemType, Index, + StructuredList, StructuredIndex); + if (InitListExpr *SubInitList = dyn_cast(expr)) { if (!ElemType->isRecordType() || ElemType->isAggregateType()) { unsigned newIndex = 0; @@ -793,13 +798,13 @@ void InitListChecker::CheckSubElementTyp // C++ initialization is handled later. } - if (ElemType->isScalarType()) { + // FIXME: Need to handle atomic aggregate types with implicit init lists. + if (ElemType->isScalarType() || ElemType->isAtomicType()) return CheckScalarType(Entity, IList, ElemType, Index, StructuredList, StructuredIndex); - } else if (ElemType->isReferenceType()) { - return CheckReferenceType(Entity, IList, ElemType, Index, - StructuredList, StructuredIndex); - } + + assert((ElemType->isRecordType() || ElemType->isVectorType() || + ElemType->isArrayType()) && "Unexpected type"); if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) { // arrayType can be incomplete if we're initializing a flexible From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:06:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BC769DD; Fri, 23 Aug 2013 18:06:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F24B2858; Fri, 23 Aug 2013 18:06:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NI6gMs097584; Fri, 23 Aug 2013 18:06:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NI6gJS097583; Fri, 23 Aug 2013 18:06:42 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308231806.r7NI6gJS097583@svn.freebsd.org> From: Ed Maste Date: Fri, 23 Aug 2013 18:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254729 - head/contrib/llvm/tools/lldb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:06:42 -0000 Author: emaste Date: Fri Aug 23 18:06:42 2013 New Revision: 254729 URL: http://svnweb.freebsd.org/changeset/base/254729 Log: Merge lldb r188801 to contrib/llvm/tools/lldb/ Added: head/contrib/llvm/tools/lldb/ - copied from r254727, vendor/lldb/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:45:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E49ED39; Fri, 23 Aug 2013 18:45:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8D12B18; Fri, 23 Aug 2013 18:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NIjewi017737; Fri, 23 Aug 2013 18:45:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NIjeJP017736; Fri, 23 Aug 2013 18:45:40 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201308231845.r7NIjeJP017736@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 23 Aug 2013 18:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254731 - head/sys/dev/cxgb/ulp/iw_cxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:45:40 -0000 Author: np Date: Fri Aug 23 18:45:39 2013 New Revision: 254731 URL: http://svnweb.freebsd.org/changeset/base/254731 Log: Whitespace cleanup. Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Fri Aug 23 18:38:43 2013 (r254730) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Fri Aug 23 18:45:39 2013 (r254731) @@ -1097,9 +1097,8 @@ out: * If free is 1, then we've disassociated the EP from the QP * and we need to dereference the EP. */ - if (free) + if (free) put_ep(&ep->com); - CTR2(KTR_IW_CXGB, "%s exit state %d", __FUNCTION__, qhp->attr.state); return ret; From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:52:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 44523136; Fri, 23 Aug 2013 18:52:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3252B2B95; Fri, 23 Aug 2013 18:52:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NIqb5l021828; Fri, 23 Aug 2013 18:52:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NIqbY6021827; Fri, 23 Aug 2013 18:52:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308231852.r7NIqbY6021827@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 23 Aug 2013 18:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254733 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:52:37 -0000 Author: jkim Date: Fri Aug 23 18:52:36 2013 New Revision: 254733 URL: http://svnweb.freebsd.org/changeset/base/254733 Log: Set the hint for physical address of RSDP in hexadecimal as before r223262. Modified: head/sys/boot/i386/libi386/biosacpi.c Modified: head/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- head/sys/boot/i386/libi386/biosacpi.c Fri Aug 23 18:50:47 2013 (r254732) +++ head/sys/boot/i386/libi386/biosacpi.c Fri Aug 23 18:52:36 2013 (r254733) @@ -61,7 +61,7 @@ biosacpi_detect(void) return; /* export values from the RSDP */ - sprintf(buf, "%u", VTOP(rsdp)); + sprintf(buf, "0x%08x", VTOP(rsdp)); setenv("hint.acpi.0.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:54:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 548153CA; Fri, 23 Aug 2013 18:54:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4234C2BC6; Fri, 23 Aug 2013 18:54:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NIsSw6022381; Fri, 23 Aug 2013 18:54:28 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NIsSvA022380; Fri, 23 Aug 2013 18:54:28 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201308231854.r7NIsSvA022380@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 23 Aug 2013 18:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254734 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:54:28 -0000 Author: np Date: Fri Aug 23 18:54:27 2013 New Revision: 254734 URL: http://svnweb.freebsd.org/changeset/base/254734 Log: Fix implementation of sock_getname. MFC after: 1 week Modified: head/sys/ofed/include/linux/net.h Modified: head/sys/ofed/include/linux/net.h ============================================================================== --- head/sys/ofed/include/linux/net.h Fri Aug 23 18:52:36 2013 (r254733) +++ head/sys/ofed/include/linux/net.h Fri Aug 23 18:54:27 2013 (r254734) @@ -44,7 +44,7 @@ static inline int sock_getname(struct socket *so, struct sockaddr *addr, int *sockaddr_len, int peer) { - struct sockaddr **nam; + struct sockaddr *nam; int error; nam = NULL; @@ -52,15 +52,15 @@ sock_getname(struct socket *so, struct s if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) return (-ENOTCONN); - error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, nam); + error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, &nam); } else - error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, nam); + error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, &nam); if (error) return (-error); - *addr = **nam; + *addr = *nam; *sockaddr_len = addr->sa_len; - free(*nam, M_SONAME); + free(nam, M_SONAME); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 18:55:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 30AAA508; Fri, 23 Aug 2013 18:55:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2FE42BD0; Fri, 23 Aug 2013 18:55:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 57E75B98A; Fri, 23 Aug 2013 14:55:10 -0400 (EDT) From: John Baldwin To: Davide Italiano Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys Date: Fri, 23 Aug 2013 12:58:50 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308231412.r7NECdG7081565@svn.freebsd.org> <201308231051.08997.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308231258.50969.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 Aug 2013 14:55:10 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:55:12 -0000 On Friday, August 23, 2013 11:29:45 am Davide Italiano wrote: > On Fri, Aug 23, 2013 at 4:51 PM, John Baldwin wrote: > > On Friday, August 23, 2013 10:12:39 am Davide Italiano wrote: > >> Author: davide > >> Date: Fri Aug 23 14:12:39 2013 > >> New Revision: 254703 > >> URL: http://svnweb.freebsd.org/changeset/base/254703 > >> > >> Log: > >> Introduce callout_init_rm() so that callouts can be used in conjunction > >> with rmlocks. This works only with non-sleepable rm because handlers run > >> in SWI context. While here, document the new KPI in the timeout(9) > >> manpage. > > > > It also only works with exclusive locks. (lc_unlock/lc_lock only handle > > write locks for rmlocks). > > > > -- > > John Baldwin > > Thanks for pointing out this. > I think it would be nice to have lc_lock/lc_unlock working both for > shared and exclusive locks but I'm not 100% sure about all the > implications/complications. From what I see for rwlocks asserting if a > lock is held in read-mode is really cheap (check against a flag) while > for rmlocks the assertion relies on traversing the tracker list for > the rmlock so I'm worried this operation could be expensive. What's > your opinion about? The much bigger problem is you need an rmtracker object to pass to the lock/unlock routines. You could make this work hackishly in the callout case by special casing rm locks that use read locking and using a tracker on softclock's stack, but it is much harder to fix this for the rm_sleep() case where the sequence is lc_unlock/lc_lock. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 19:12:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5F840C82; Fri, 23 Aug 2013 19:12:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3152D22; Fri, 23 Aug 2013 19:12:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NJCUVn032462; Fri, 23 Aug 2013 19:12:30 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NJCTR6032458; Fri, 23 Aug 2013 19:12:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201308231912.r7NJCTR6032458@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 23 Aug 2013 19:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254735 - in head/sys: contrib/rdma/krping modules/rdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 19:12:30 -0000 Author: np Date: Fri Aug 23 19:12:29 2013 New Revision: 254735 URL: http://svnweb.freebsd.org/changeset/base/254735 Log: Assorted fixes to krping. Disconnect the rest of sys/contrib/rdma from the build while here. sys/ofed has more recent RDMA code and should be used instead. We should probably move krping out of sys/contrib/rdma and get rid of the rest of it. Obtained from: Chelsio Modified: head/sys/contrib/rdma/krping/krping.c head/sys/contrib/rdma/krping/krping.h head/sys/contrib/rdma/krping/krping_dev.c head/sys/modules/rdma/Makefile Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Fri Aug 23 18:54:27 2013 (r254734) +++ head/sys/contrib/rdma/krping/krping.c Fri Aug 23 19:12:29 2013 (r254735) @@ -119,7 +119,7 @@ static void krping_wait(struct krping_cb int rc; mtx_lock(&cb->lock); while (cb->state < state) { - rc = msleep(cb, &cb->lock, 0, "krping", 0); + rc = msleep(cb, &cb->lock, PCATCH, "krping", 0); if (rc && rc != ERESTART) { cb->state = ERROR; break; @@ -188,7 +188,12 @@ static int krping_cma_event_handler(stru case RDMA_CM_EVENT_DEVICE_REMOVAL: DEBUG_LOG(PFX "cma detected device removal!!!!\n"); - break; + cb->state = ERROR; + wakeup(cb); + mtx_unlock(&cb->lock); + krping_wait(cb, CLEANUP); + tsleep(cb, 0, "krping", 5000); + return 0; default: log(LOG_ERR, "oof bad type!\n"); @@ -603,6 +608,8 @@ static int krping_setup_qp(struct krping } DEBUG_LOG(PFX "created pd %p\n", cb->pd); + strlcpy(cb->name, cb->pd->device->name, sizeof(cb->name)); + cb->cq = ib_create_cq(cm_id->device, krping_cq_event_handler, NULL, cb, cb->txdepth * 2, 0); if (IS_ERR(cb->cq)) { @@ -1164,7 +1171,7 @@ static void krping_wlat_test_server(stru } wlat_test(cb); - + krping_wait(cb, ERROR); } static void krping_bw_test_server(struct krping_cb *cb) @@ -1776,6 +1783,12 @@ int krping_doit(char *cmd) else krping_run_client(cb); DEBUG_LOG(PFX "destroy cm_id %p\n", cb->cm_id); + + mtx_lock(&cb->lock); + cb->state = CLEANUP; + wakeup(cb); + mtx_unlock(&cb->lock); + rdma_destroy_id(cb->cm_id); out: mtx_lock(&krping_mutex); Modified: head/sys/contrib/rdma/krping/krping.h ============================================================================== --- head/sys/contrib/rdma/krping/krping.h Fri Aug 23 18:54:27 2013 (r254734) +++ head/sys/contrib/rdma/krping/krping.h Fri Aug 23 19:12:29 2013 (r254735) @@ -37,7 +37,8 @@ enum test_state { RDMA_READ_COMPLETE, RDMA_WRITE_ADV, RDMA_WRITE_COMPLETE, - ERROR + ERROR, + CLEANUP }; struct krping_rdma_info { @@ -100,13 +101,15 @@ struct krping_cb { /* listener on service side. */ struct rdma_cm_id *child_cm_id; /* connection on server side */ TAILQ_ENTRY(krping_cb) list; - + int rlat; /* run read latency test */ int wlat; /* run write latency test */ int bw; /* run write bw test */ int duplex; /* run write bw full duplex test */ int poll; /* poll vs block in rlat */ int txdepth; + + char name[16]; }; static __inline uint64_t Modified: head/sys/contrib/rdma/krping/krping_dev.c ============================================================================== --- head/sys/contrib/rdma/krping/krping_dev.c Fri Aug 23 18:54:27 2013 (r254734) +++ head/sys/contrib/rdma/krping/krping_dev.c Fri Aug 23 19:12:29 2013 (r254735) @@ -112,12 +112,11 @@ krping_read(struct cdev *dev, struct uio mtx_unlock(&krping_mutex); while (!TAILQ_EMPTY(©_cbs)) { - cb = TAILQ_FIRST(©_cbs); TAILQ_REMOVE(©_cbs, cb, list); if (cb->pd) { uprintf("krping: %4d %10s %10u %10u %10u %10u %10u %10u %10u %10u\n", - num++, cb->pd->device->name, cb->stats.send_bytes, + num++, cb->name, cb->stats.send_bytes, cb->stats.send_msgs, cb->stats.recv_bytes, cb->stats.recv_msgs, cb->stats.write_bytes, cb->stats.write_msgs, Modified: head/sys/modules/rdma/Makefile ============================================================================== --- head/sys/modules/rdma/Makefile Fri Aug 23 18:54:27 2013 (r254734) +++ head/sys/modules/rdma/Makefile Fri Aug 23 19:12:29 2013 (r254735) @@ -1,9 +1,9 @@ # $FreeBSD$ -SUBDIR= addr -SUBDIR+= cma -SUBDIR+= iwcm -SUBDIR+= core +#SUBDIR= addr +#SUBDIR+= cma +#SUBDIR+= iwcm +#SUBDIR+= core SUBDIR+= krping .include From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 20:12:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2EA68D26 for ; Fri, 23 Aug 2013 20:12:07 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm5-vm0.bullet.mail.bf1.yahoo.com (nm5-vm0.bullet.mail.bf1.yahoo.com [98.139.213.150]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D09B02140 for ; Fri, 23 Aug 2013 20:12:06 +0000 (UTC) Received: from [98.139.212.152] by nm5.bullet.mail.bf1.yahoo.com with NNFMP; 23 Aug 2013 20:12:04 -0000 Received: from [98.139.213.11] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 23 Aug 2013 20:12:04 -0000 Received: from [127.0.0.1] by smtp111.mail.bf1.yahoo.com with NNFMP; 23 Aug 2013 20:12:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1377288724; bh=bFkuJy0ApGy9taqJTauzjLKWKQgT7MP20OvHIBhv33w=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=iGuzL34vO7hno0SNUjtbeXOZlX/Qztql+qNCV+Wqzy51knlouYC3qysV2vEP9HKPahfiZggIZJSuLJmZTpSsTAS99Y8dQ4dnyVlspb8G5aLq3Mph+sAvJY0ynYMsXseXytpTh7QZrYni1SmRKKG2HjQVAbA+JGiiBMs2nm+NvJY= X-Yahoo-Newman-Id: 735067.71430.bm@smtp111.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: cftSODcVM1kGWBHWA6BwLWUru5EkPenx_aH6owiGJ3WUOXk 9TZ2S9d1QsvPHIyuFQIWFZR4woR4aVDhEHEHBOjRR2DhdEv7jYJTKsIE9lRw Vnm2XyqADyQFg8bzbOeCIzyKAxe0_grFyEOnpZYO0bvKxiIQ3iKNkSOtOr62 UtmHs.Vrxuq5uPHA2trCRf3XowMjlJGHOgrcw0OmRSlSiRCv8uWK5Dy64aHP dtUDPQWrKR3QAxpNzTVRHPNt293ZkOH2zK.HsKugI7FPsBY5lzj7StOoeOCb s3bMXq0.5t1vH6EQeBo3hpQEnQQPnNaG.EuyOGmt2qDVsfaao2WSTfk1SzX1 UbQyxvXconWA8GM.io673OE457v4kmMZ7kios4gOq93lvq5hDw_u80VKsPj1 hxUxuZ5rdbk139SHXyRnvJYKjo7.k6MGyN28M1SLwv77fHcPv1Zp.8_h7E28 Rvz2kdlP_uYicLUBHFlcEYMD5j2f5P43Muw0yTRO83iHk9knLYqHa1adM2P3 prhb.NYLjsWjmLK.uJpC5IDAInkNKP62xYJkfZ4.5qGmdm8rCoFDMhYT2 X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from phobos.samsco.home (scott4long@168.103.85.57 with ) by smtp111.mail.bf1.yahoo.com with SMTP; 23 Aug 2013 13:12:04 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r254615 - head/sys/dev/mps From: Scott Long In-Reply-To: Date: Fri, 23 Aug 2013 10:00:59 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <74108713-986A-4CBD-A441-395C7B54456A@yahoo.com> References: <201308212130.r7LLUvO5008991@svn.freebsd.org> <20130822142107.GA49996@nargothrond.kdm.org> To: Dmitry Morozovsky X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Kenneth D. Merry" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 20:12:07 -0000 On Aug 22, 2013, at 7:58 AM, Dmitry Morozovsky wrote: > On Thu, 22 Aug 2013, Kenneth D. Merry wrote: >=20 >>>> Fix mps(4) driver breakage that came in in change 253550 that >>>> manifested itself in out of chain frame conditions. >>>>=20 >>>> When the driver ran out of chain frames, the request in question >>>> would get completed early, and go through = mpssas_scsiio_complete(). >=20 >>> what is real impact of the bug? >>=20 >> Your system will essentially hang, certainly as far as anything = connected >> to the controller in question. >=20 > [snip] >=20 >> 5. Look for an out of chain frames message on the console. To see = how far >> you are towards using the chain frames, run 'sysctl dev.mps'. You = can see >> how many chain frames you have free, and how many requests have = failed. >>=20 >> This change just needs to be merged along with the other changes to = avoid >> having the regression in stable. >=20 > Thank you very much for the explanation. We use a couple of servers = with mps=20 > (and many spindles there), all on stable/9 from this summer, and you = commit=20 > turns on an alarm light in my head ;) I'll confirm with my netflix hat on that this isn't a problem in 9. Scott From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 20:39:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9275C4CC; Fri, 23 Aug 2013 20:39:41 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 800B22282; Fri, 23 Aug 2013 20:39:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NKdfWB075161; Fri, 23 Aug 2013 20:39:41 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NKdfpL075160; Fri, 23 Aug 2013 20:39:41 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201308232039.r7NKdfpL075160@svn.freebsd.org> From: Andreas Tobler Date: Fri, 23 Aug 2013 20:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254737 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 20:39:41 -0000 Author: andreast Date: Fri Aug 23 20:39:41 2013 New Revision: 254737 URL: http://svnweb.freebsd.org/changeset/base/254737 Log: Return EIO iso -1, the kiic_transfer has an signed return. Submitted by: Luiz Otavio O Souza Modified: head/sys/powerpc/powermac/kiic.c Modified: head/sys/powerpc/powermac/kiic.c ============================================================================== --- head/sys/powerpc/powermac/kiic.c Fri Aug 23 20:37:44 2013 (r254736) +++ head/sys/powerpc/powermac/kiic.c Fri Aug 23 20:39:41 2013 (r254737) @@ -420,7 +420,7 @@ kiic_transfer(device_t dev, struct iic_m device_printf(sc->sc_dev, "I2C error\n"); sc->sc_flags = 0; mtx_unlock(&sc->sc_mutex); - return (-1); + return (EIO); } } From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 20:47:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E256686; Fri, 23 Aug 2013 20:47:18 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38E992309; Fri, 23 Aug 2013 20:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NKlIxR079491; Fri, 23 Aug 2013 20:47:18 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NKlHHD079485; Fri, 23 Aug 2013 20:47:17 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201308232047.r7NKlHHD079485@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 23 Aug 2013 20:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254738 - in head: share/man/man4 sys/conf sys/dev/vmware sys/dev/vmware/vmxnet3 sys/modules sys/modules/vmware sys/modules/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 20:47:18 -0000 Author: bryanv Date: Fri Aug 23 20:47:16 2013 New Revision: 254738 URL: http://svnweb.freebsd.org/changeset/base/254738 Log: Add vmx(4), a VMware VMXNET3 ethernet driver ported from OpenBSD Added: head/share/man/man4/vmx.4 (contents, props changed) head/sys/dev/vmware/ head/sys/dev/vmware/vmxnet3/ head/sys/dev/vmware/vmxnet3/if_vmx.c (contents, props changed) head/sys/dev/vmware/vmxnet3/if_vmxreg.h (contents, props changed) head/sys/dev/vmware/vmxnet3/if_vmxvar.h (contents, props changed) head/sys/modules/vmware/ head/sys/modules/vmware/Makefile (contents, props changed) head/sys/modules/vmware/vmxnet3/ head/sys/modules/vmware/vmxnet3/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 23 20:39:41 2013 (r254737) +++ head/share/man/man4/Makefile Fri Aug 23 20:47:16 2013 (r254738) @@ -539,6 +539,7 @@ MAN= aac.4 \ ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ + ${_vmx.4} \ vpo.4 \ vr.4 \ vte.4 \ @@ -706,6 +707,7 @@ MLINKS+=ural.4 if_ural.4 MLINKS+=${_urtw.4} ${_if_urtw.4} MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 +MLINKS+=${_vmx.4} ${_if_vmx.4} MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 @@ -758,6 +760,7 @@ _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_urtw.4= if_urtw.4 +_if_vmx.4= if_vmx.4 _if_vtnet.4= if_vtnet.4 _if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 @@ -777,6 +780,7 @@ _virtio.4= virtio.4 _virtio_balloon.4=virtio_balloon.4 _virtio_blk.4= virtio_blk.4 _virtio_scsi.4= virtio_scsi.4 +_vmx.4= vmx.4 _vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 Added: head/share/man/man4/vmx.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/vmx.4 Fri Aug 23 20:47:16 2013 (r254738) @@ -0,0 +1,224 @@ +.\" +.\" Copyright (c) 2006,2013 Reyk Floeter +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $OpenBSD: src/share/man/man4/vmx.4,v 1.1 2013/05/31 20:18:44 reyk Exp $ +.\" +.\" $FreeBSD$ +.\" +.Dd August 4, 2013 +.Dt VMX 4 +.Os +.Sh NAME +.Nm vmx +.Nd VMware VMXNET3 Virtual Interface Controller device +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device vmx" +.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 +if_vmx_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the VMXNET3 virtual NIC available in virtual +machines by VMware. +It appears as a simple Ethernet device but is actually a virtual network +interface to the underlying host operating system. +.Pp +This driver supports the +.Ic VMXNET3 +driver protocol, as an alternative to the emulated +.Xr pcn 4 , +.Xr em 4 +interfaces also available in the VMware environment. +The +.Nm +driver is optimized for the virtual machine, it can provide advanced +capabilities depending on the underlying host operating system and +the physical network interface controller of the host. +The +.Nm +driver supports features like multiqueue support, IPv6 +checksum offloading, MSI/MSI-X support and hardware VLAN tagging in +VMware's VLAN Guest Tagging (VGT) mode. +.Pp +The +.Nm +driver supports VMXNET3 VMware virtual NICs provided by the virtual +machine hardware version 7 or newer, as provided by the following +products: +.Pp +.Bl -bullet -compact -offset indent +.It +VMware ESX/ESXi 4.0 and newer +.It +VMware Server 2.0 and newer +.It +VMware Workstation 6.5 and newer +.It +VMware Fusion 2.0 and newer +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh EXAMPLES +The following entry must be added to the VMware configuration file +to provide the +.Nm +device: +.Bd -literal -offset indent +ethernet0.virtualDev = "vmxnet3" +.Ed +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr em 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr pcn 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was ported from +.Ox +by +.An Bryan Venteicher Aq bryanv@freebsd.org . +The +.Ox +driver was written by +.An Tsubai Masanari . +.\" +.\" Copyright (c) 2006,2013 Reyk Floeter +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $OpenBSD: src/share/man/man4/vmx.4,v 1.1 2013/05/31 20:18:44 reyk Exp $ +.\" +.\" $FreeBSD$ +.\" +.Dd August 4, 2013 +.Dt VMX 4 +.Os +.Sh NAME +.Nm vmx +.Nd VMware VMXNET3 Virtual Interface Controller device +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device vmx" +.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 +if_vmx_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the VMXNET3 virtual NIC available in virtual +machines by VMware. +It appears as a simple Ethernet device but is actually a virtual network +interface to the underlying host operating system. +.Pp +This driver supports the +.Ic VMXNET3 +driver protocol, as an alternative to the emulated +.Xr pcn 4 , +.Xr em 4 +interfaces also available in the VMware environment. +The +.Nm +driver is optimized for the virtual machine, it can provide advanced +capabilities depending on the underlying host operating system and +the physical network interface controller of the host. +The +.Nm +driver supports features like multiqueue support, IPv6 +checksum offloading, MSI/MSI-X support and hardware VLAN tagging in +VMware's VLAN Guest Tagging (VGT) mode. +.Pp +The +.Nm +driver supports VMXNET3 VMware virtual NICs provided by the virtual +machine hardware version 7 or newer, as provided by the following +products: +.Pp +.Bl -bullet -compact -offset indent +.It +VMware ESX/ESXi 4.0 and newer +.It +VMware Server 2.0 and newer +.It +VMware Workstation 6.5 and newer +.It +VMware Fusion 2.0 and newer +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh EXAMPLES +The following entry must be added to the VMware configuration file +to provide the +.Nm +device: +.Bd -literal -offset indent +ethernet0.virtualDev = "vmxnet3" +.Ed +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr em 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr pcn 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was ported from +.Ox +by +.An Bryan Venteicher Aq bryanv@freebsd.org . +The +.Ox +driver was written by +.An Tsubai Masanari . Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Aug 23 20:39:41 2013 (r254737) +++ head/sys/conf/files.amd64 Fri Aug 23 20:47:16 2013 (r254738) @@ -304,6 +304,7 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd +dev/vmware/vmxnet3/if_vmx.c optional vmx dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi dev/isci/isci.c optional isci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Aug 23 20:39:41 2013 (r254737) +++ head/sys/conf/files.i386 Fri Aug 23 20:47:16 2013 (r254738) @@ -267,6 +267,7 @@ dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd +dev/vmware/vmxnet3/if_vmx.c optional vmx dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wbwd/wbwd.c optional wbwd Added: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Aug 23 20:47:16 2013 (r254738) @@ -0,0 +1,3305 @@ +/*- + * Copyright (c) 2013 Tsubai Masanari + * Copyright (c) 2013 Bryan Venteicher + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $OpenBSD: src/sys/dev/pci/if_vmx.c,v 1.11 2013/06/22 00:28:10 uebayasi Exp $ + */ + +/* Driver for VMware vmxnet3 virtual ethernet devices. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "if_vmxreg.h" +#include "if_vmxvar.h" + +#include "opt_inet.h" +#include "opt_inet6.h" + +/* Always enable for now - useful for queue hangs. */ +#define VMXNET3_DEBUG_SYSCTL + +#ifdef VMXNET3_FAILPOINTS +#include +static SYSCTL_NODE(DEBUG_FP, OID_AUTO, vmxnet3, CTLFLAG_RW, 0, + "vmxnet3 fail points"); +#define VMXNET3_FP _debug_fail_point_vmxnet3 +#endif + +static int vmxnet3_probe(device_t); +static int vmxnet3_attach(device_t); +static int vmxnet3_detach(device_t); +static int vmxnet3_shutdown(device_t); + +static int vmxnet3_alloc_resources(struct vmxnet3_softc *); +static void vmxnet3_free_resources(struct vmxnet3_softc *); +static int vmxnet3_check_version(struct vmxnet3_softc *); +static void vmxnet3_initial_config(struct vmxnet3_softc *); + +static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *); +static int vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *); +static int vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *); +static int vmxnet3_alloc_interrupt(struct vmxnet3_softc *, int, int, + struct vmxnet3_interrupt *); +static int vmxnet3_alloc_intr_resources(struct vmxnet3_softc *); +static int vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *); +static int vmxnet3_setup_legacy_interrupt(struct vmxnet3_softc *); +static int vmxnet3_setup_interrupts(struct vmxnet3_softc *); +static int vmxnet3_alloc_interrupts(struct vmxnet3_softc *); + +static void vmxnet3_free_interrupt(struct vmxnet3_softc *, + struct vmxnet3_interrupt *); +static void vmxnet3_free_interrupts(struct vmxnet3_softc *); + +static int vmxnet3_init_rxq(struct vmxnet3_softc *, int); +static int vmxnet3_init_txq(struct vmxnet3_softc *, int); +static int vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *); +static void vmxnet3_destroy_rxq(struct vmxnet3_rxqueue *); +static void vmxnet3_destroy_txq(struct vmxnet3_txqueue *); +static void vmxnet3_free_rxtx_queues(struct vmxnet3_softc *); + +static int vmxnet3_alloc_shared_data(struct vmxnet3_softc *); +static void vmxnet3_free_shared_data(struct vmxnet3_softc *); +static int vmxnet3_alloc_txq_data(struct vmxnet3_softc *); +static void vmxnet3_free_txq_data(struct vmxnet3_softc *); +static int vmxnet3_alloc_rxq_data(struct vmxnet3_softc *); +static void vmxnet3_free_rxq_data(struct vmxnet3_softc *); +static int vmxnet3_alloc_queue_data(struct vmxnet3_softc *); +static void vmxnet3_free_queue_data(struct vmxnet3_softc *); +static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *); +static void vmxnet3_init_shared_data(struct vmxnet3_softc *); +static void vmxnet3_reinit_interface(struct vmxnet3_softc *); +static void vmxnet3_reinit_shared_data(struct vmxnet3_softc *); +static int vmxnet3_alloc_data(struct vmxnet3_softc *); +static void vmxnet3_free_data(struct vmxnet3_softc *); +static int vmxnet3_setup_interface(struct vmxnet3_softc *); + +static void vmxnet3_evintr(struct vmxnet3_softc *); +static void vmxnet3_txq_eof(struct vmxnet3_txqueue *); +static void vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *, struct mbuf *); +static int vmxnet3_newbuf(struct vmxnet3_softc *, struct vmxnet3_rxring *); +static void vmxnet3_rxq_eof_discard(struct vmxnet3_rxqueue *, + struct vmxnet3_rxring *, int); +static void vmxnet3_rxq_eof(struct vmxnet3_rxqueue *); +static void vmxnet3_legacy_intr(void *); +static void vmxnet3_txq_intr(void *); +static void vmxnet3_rxq_intr(void *); +static void vmxnet3_event_intr(void *); + +static void vmxnet3_txstop(struct vmxnet3_softc *, struct vmxnet3_txqueue *); +static void vmxnet3_rxstop(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); +static void vmxnet3_stop(struct vmxnet3_softc *); + +static void vmxnet3_txinit(struct vmxnet3_softc *, struct vmxnet3_txqueue *); +static int vmxnet3_rxinit(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); +static int vmxnet3_reinit_queues(struct vmxnet3_softc *); +static int vmxnet3_enable_device(struct vmxnet3_softc *); +static void vmxnet3_reinit_rxfilters(struct vmxnet3_softc *); +static int vmxnet3_reinit(struct vmxnet3_softc *); +static void vmxnet3_init_locked(struct vmxnet3_softc *); +static void vmxnet3_init(void *); + +static int vmxnet3_txq_offload_ctx(struct mbuf *, int *, int *, int *); +static int vmxnet3_txq_load_mbuf(struct vmxnet3_txqueue *, struct mbuf **, + bus_dmamap_t, bus_dma_segment_t [], int *); +static void vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t); +static int vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **); +static void vmxnet3_start_locked(struct ifnet *); +static void vmxnet3_start(struct ifnet *); + +static void vmxnet3_update_vlan_filter(struct vmxnet3_softc *, int, + uint16_t); +static void vmxnet3_register_vlan(void *, struct ifnet *, uint16_t); +static void vmxnet3_unregister_vlan(void *, struct ifnet *, uint16_t); +static void vmxnet3_set_rxfilter(struct vmxnet3_softc *); +static int vmxnet3_change_mtu(struct vmxnet3_softc *, int); +static int vmxnet3_ioctl(struct ifnet *, u_long, caddr_t); + +static int vmxnet3_watchdog(struct vmxnet3_txqueue *); +static void vmxnet3_tick(void *); +static void vmxnet3_link_status(struct vmxnet3_softc *); +static void vmxnet3_media_status(struct ifnet *, struct ifmediareq *); +static int vmxnet3_media_change(struct ifnet *); +static void vmxnet3_set_lladdr(struct vmxnet3_softc *); +static void vmxnet3_get_lladdr(struct vmxnet3_softc *); + +static void vmxnet3_setup_txq_sysctl(struct vmxnet3_txqueue *, + struct sysctl_ctx_list *, struct sysctl_oid_list *); +static void vmxnet3_setup_rxq_sysctl(struct vmxnet3_rxqueue *, + struct sysctl_ctx_list *, struct sysctl_oid_list *); +static void vmxnet3_setup_queue_sysctl(struct vmxnet3_softc *, + struct sysctl_ctx_list *, struct sysctl_oid_list *); +static void vmxnet3_setup_sysctl(struct vmxnet3_softc *); + +static void vmxnet3_write_bar0(struct vmxnet3_softc *, bus_size_t, + uint32_t); +static uint32_t vmxnet3_read_bar1(struct vmxnet3_softc *, bus_size_t); +static void vmxnet3_write_bar1(struct vmxnet3_softc *, bus_size_t, + uint32_t); +static void vmxnet3_write_cmd(struct vmxnet3_softc *, uint32_t); +static uint32_t vmxnet3_read_cmd(struct vmxnet3_softc *, uint32_t); + +static void vmxnet3_enable_intr(struct vmxnet3_softc *, int); +static void vmxnet3_disable_intr(struct vmxnet3_softc *, int); +static void vmxnet3_enable_all_intrs(struct vmxnet3_softc *); +static void vmxnet3_disable_all_intrs(struct vmxnet3_softc *); + +static int vmxnet3_dma_malloc(struct vmxnet3_softc *, bus_size_t, + bus_size_t, struct vmxnet3_dma_alloc *); +static void vmxnet3_dma_free(struct vmxnet3_softc *, + struct vmxnet3_dma_alloc *); + +typedef enum { + VMXNET3_BARRIER_RD, + VMXNET3_BARRIER_WR, + VMXNET3_BARRIER_RDWR, +} vmxnet3_barrier_t; + +static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); + +static device_method_t vmxnet3_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, vmxnet3_probe), + DEVMETHOD(device_attach, vmxnet3_attach), + DEVMETHOD(device_detach, vmxnet3_detach), + DEVMETHOD(device_shutdown, vmxnet3_shutdown), + + DEVMETHOD_END +}; + +static driver_t vmxnet3_driver = { + "vmx", vmxnet3_methods, sizeof(struct vmxnet3_softc) +}; + +static devclass_t vmxnet3_devclass; +DRIVER_MODULE(vmx, pci, vmxnet3_driver, vmxnet3_devclass, 0, 0); + +MODULE_DEPEND(vmx, pci, 1, 1, 1); +MODULE_DEPEND(vmx, ether, 1, 1, 1); + +#define VMXNET3_VMWARE_VENDOR_ID 0x15AD +#define VMXNET3_VMWARE_DEVICE_ID 0x07B0 + +static int +vmxnet3_probe(device_t dev) +{ + + if (pci_get_vendor(dev) == VMXNET3_VMWARE_VENDOR_ID && + pci_get_device(dev) == VMXNET3_VMWARE_DEVICE_ID) { + device_set_desc(dev, "VMware VMXNET3 Ethernet Adapter"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +vmxnet3_attach(device_t dev) +{ + struct vmxnet3_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->vmx_dev = dev; + + pci_enable_busmaster(dev); + + VMXNET3_CORE_LOCK_INIT(sc, device_get_nameunit(dev)); + callout_init_mtx(&sc->vmx_tick, &sc->vmx_mtx, 0); + + vmxnet3_initial_config(sc); + + error = vmxnet3_alloc_resources(sc); + if (error) + goto fail; + + error = vmxnet3_check_version(sc); + if (error) + goto fail; + + error = vmxnet3_alloc_rxtx_queues(sc); + if (error) + goto fail; + + error = vmxnet3_alloc_interrupts(sc); + if (error) + goto fail; + + error = vmxnet3_alloc_data(sc); + if (error) + goto fail; + + error = vmxnet3_setup_interface(sc); + if (error) + goto fail; + + error = vmxnet3_setup_interrupts(sc); + if (error) { + ether_ifdetach(sc->vmx_ifp); + device_printf(dev, "could not set up interrupt\n"); + goto fail; + } + + vmxnet3_setup_sysctl(sc); + vmxnet3_link_status(sc); + +fail: + if (error) + vmxnet3_detach(dev); + + return (error); +} + +static int +vmxnet3_detach(device_t dev) +{ + struct vmxnet3_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + ifp = sc->vmx_ifp; + + if (device_is_attached(dev)) { + ether_ifdetach(ifp); + VMXNET3_CORE_LOCK(sc); + vmxnet3_stop(sc); + VMXNET3_CORE_UNLOCK(sc); + callout_drain(&sc->vmx_tick); + } + + if (sc->vmx_vlan_attach != NULL) { + EVENTHANDLER_DEREGISTER(vlan_config, sc->vmx_vlan_attach); + sc->vmx_vlan_attach = NULL; + } + if (sc->vmx_vlan_detach != NULL) { + EVENTHANDLER_DEREGISTER(vlan_config, sc->vmx_vlan_detach); + sc->vmx_vlan_detach = NULL; + } + + vmxnet3_free_interrupts(sc); + + if (ifp != NULL) { + if_free(ifp); + sc->vmx_ifp = NULL; + } + + ifmedia_removeall(&sc->vmx_media); + + vmxnet3_free_data(sc); + vmxnet3_free_resources(sc); + vmxnet3_free_rxtx_queues(sc); + + VMXNET3_CORE_LOCK_DESTROY(sc); + + return (0); +} + +static int +vmxnet3_shutdown(device_t dev) +{ + + return (0); +} + +static int +vmxnet3_alloc_resources(struct vmxnet3_softc *sc) +{ + device_t dev; + int rid; + + dev = sc->vmx_dev; + + rid = PCIR_BAR(0); + sc->vmx_res0 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->vmx_res0 == NULL) { + device_printf(dev, + "could not map BAR0 memory\n"); + return (ENXIO); + } + + sc->vmx_iot0 = rman_get_bustag(sc->vmx_res0); + sc->vmx_ioh0 = rman_get_bushandle(sc->vmx_res0); + + rid = PCIR_BAR(1); + sc->vmx_res1 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->vmx_res1 == NULL) { + device_printf(dev, + "could not map BAR1 memory\n"); + return (ENXIO); + } + + sc->vmx_iot1 = rman_get_bustag(sc->vmx_res1); + sc->vmx_ioh1 = rman_get_bushandle(sc->vmx_res1); + + if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) { + rid = PCIR_BAR(2); + sc->vmx_msix_res = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE); + } + + if (sc->vmx_msix_res == NULL) + sc->vmx_flags |= VMXNET3_FLAG_NO_MSIX; + + return (0); +} + +static void +vmxnet3_free_resources(struct vmxnet3_softc *sc) +{ + device_t dev; + int rid; + + dev = sc->vmx_dev; + + if (sc->vmx_res0 != NULL) { + rid = PCIR_BAR(0); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->vmx_res0); + sc->vmx_res0 = NULL; + } + + if (sc->vmx_res1 != NULL) { + rid = PCIR_BAR(1); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->vmx_res1); + sc->vmx_res1 = NULL; + } + + if (sc->vmx_msix_res != NULL) { + rid = PCIR_BAR(2); + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->vmx_msix_res); + sc->vmx_msix_res = NULL; + } +} + +static int +vmxnet3_check_version(struct vmxnet3_softc *sc) +{ + device_t dev; + uint32_t version; + + dev = sc->vmx_dev; + + version = vmxnet3_read_bar1(sc, VMXNET3_BAR1_VRRS); + if ((version & 0x01) == 0) { + device_printf(dev, "unsupported hardware version %#x\n", + version); + return (ENOTSUP); + } else + vmxnet3_write_bar1(sc, VMXNET3_BAR1_VRRS, 1); + + version = vmxnet3_read_bar1(sc, VMXNET3_BAR1_UVRS); + if ((version & 0x01) == 0) { + device_printf(dev, "unsupported UPT version %#x\n", version); + return (ENOTSUP); + } else + vmxnet3_write_bar1(sc, VMXNET3_BAR1_UVRS, 1); + + return (0); +} + +static void +vmxnet3_initial_config(struct vmxnet3_softc *sc) +{ + + sc->vmx_ntxqueues = 1; + sc->vmx_nrxqueues = 1; + sc->vmx_ntxdescs = VMXNET3_MAX_TX_NDESC; + sc->vmx_nrxdescs = VMXNET3_MAX_RX_NDESC; + sc->vmx_max_rxsegs = VMXNET3_MAX_RX_SEGS; +} + +static int +vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *sc) +{ + device_t dev; + int nmsix, cnt, required; + + dev = sc->vmx_dev; + + if (sc->vmx_flags & VMXNET3_FLAG_NO_MSIX) + return (1); + + /* Allocate an additional vector for the events interrupt. */ + required = sc->vmx_nrxqueues + sc->vmx_ntxqueues + 1; + + nmsix = pci_msix_count(dev); + if (nmsix < required) + return (1); + + cnt = required; + if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { + sc->vmx_nintrs = required; + return (0); + } else + pci_release_msi(dev); + + return (1); +} + +static int +vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *sc) +{ + device_t dev; + int nmsi, cnt, required; + + dev = sc->vmx_dev; + required = 1; + + nmsi = pci_msi_count(dev); + if (nmsi < required) + return (1); + + cnt = required; + if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { + sc->vmx_nintrs = 1; + return (0); + } else + pci_release_msi(dev); + + return (1); +} + +static int +vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *sc) +{ + + sc->vmx_nintrs = 1; + return (0); +} + +static int +vmxnet3_alloc_interrupt(struct vmxnet3_softc *sc, int rid, int flags, + struct vmxnet3_interrupt *intr) +{ + struct resource *irq; + + irq = bus_alloc_resource_any(sc->vmx_dev, SYS_RES_IRQ, &rid, flags); + if (irq == NULL) + return (ENXIO); + + intr->vmxi_irq = irq; + intr->vmxi_rid = rid; + + return (0); +} + +static int +vmxnet3_alloc_intr_resources(struct vmxnet3_softc *sc) +{ + int i, rid, flags, error; + + rid = 0; + flags = RF_ACTIVE; + + if (sc->vmx_intr_type == VMXNET3_IT_LEGACY) + flags |= RF_SHAREABLE; + else + rid = 1; + + for (i = 0; i < sc->vmx_nintrs; i++, rid++) { + error = vmxnet3_alloc_interrupt(sc, rid, flags, + &sc->vmx_intrs[i]); + if (error) + return (error); + } + + return (0); +} + +/* + * NOTE: We only support the simple case of each Rx and Tx queue on its + * own MSIX vector. This is good enough until we support mulitqueue. + */ +static int +vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *sc) +{ + device_t dev; + struct vmxnet3_txqueue *txq; + struct vmxnet3_rxqueue *rxq; + struct vmxnet3_interrupt *intr; + enum intr_type type; + int i, error; + + dev = sc->vmx_dev; + intr = &sc->vmx_intrs[0]; + type = INTR_TYPE_NET | INTR_MPSAFE; + + for (i = 0; i < sc->vmx_ntxqueues; i++, intr++) { + txq = &sc->vmx_txq[i]; + error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, + vmxnet3_txq_intr, txq, &intr->vmxi_handler); + if (error) + return (error); + txq->vxtxq_intr_idx = intr->vmxi_rid - 1; + } + + for (i = 0; i < sc->vmx_nrxqueues; i++, intr++) { + rxq = &sc->vmx_rxq[i]; + error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, + vmxnet3_rxq_intr, rxq, &intr->vmxi_handler); + if (error) + return (error); + rxq->vxrxq_intr_idx = intr->vmxi_rid - 1; + } + + error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, + vmxnet3_event_intr, sc, &intr->vmxi_handler); + if (error) + return (error); + sc->vmx_event_intr_idx = intr->vmxi_rid - 1; + + return (0); +} + +static int +vmxnet3_setup_legacy_interrupt(struct vmxnet3_softc *sc) +{ + struct vmxnet3_interrupt *intr; + int i, error; + + intr = &sc->vmx_intrs[0]; + error = bus_setup_intr(sc->vmx_dev, intr->vmxi_irq, + INTR_TYPE_NET | INTR_MPSAFE, NULL, vmxnet3_legacy_intr, sc, + &intr->vmxi_handler); + + for (i = 0; i < sc->vmx_ntxqueues; i++) + sc->vmx_txq[i].vxtxq_intr_idx = 0; + for (i = 0; i < sc->vmx_nrxqueues; i++) + sc->vmx_rxq[i].vxrxq_intr_idx = 0; + sc->vmx_event_intr_idx = 0; + + return (error); +} + +/* + * XXX BMV Should probably reorganize the attach and just do + * this in vmxnet3_init_shared_data(). + */ +static void +vmxnet3_set_interrupt_idx(struct vmxnet3_softc *sc) +{ + struct vmxnet3_txqueue *txq; + struct vmxnet3_txq_shared *txs; + struct vmxnet3_rxqueue *rxq; + struct vmxnet3_rxq_shared *rxs; + int i; + + sc->vmx_ds->evintr = sc->vmx_event_intr_idx; + + for (i = 0; i < sc->vmx_ntxqueues; i++) { + txq = &sc->vmx_txq[i]; + txs = txq->vxtxq_ts; + txs->intr_idx = txq->vxtxq_intr_idx; + } + + for (i = 0; i < sc->vmx_nrxqueues; i++) { + rxq = &sc->vmx_rxq[i]; + rxs = rxq->vxrxq_rs; + rxs->intr_idx = rxq->vxrxq_intr_idx; + } +} + +static int +vmxnet3_setup_interrupts(struct vmxnet3_softc *sc) +{ + int error; + + error = vmxnet3_alloc_intr_resources(sc); + if (error) + return (error); + + switch (sc->vmx_intr_type) { + case VMXNET3_IT_MSIX: + error = vmxnet3_setup_msix_interrupts(sc); + break; + case VMXNET3_IT_MSI: + case VMXNET3_IT_LEGACY: + error = vmxnet3_setup_legacy_interrupt(sc); + break; + default: + panic("%s: invalid interrupt type %d", __func__, + sc->vmx_intr_type); + } + + if (error == 0) + vmxnet3_set_interrupt_idx(sc); + + return (error); +} + +static int +vmxnet3_alloc_interrupts(struct vmxnet3_softc *sc) +{ + device_t dev; + uint32_t config; + int error; + + dev = sc->vmx_dev; + config = vmxnet3_read_cmd(sc, VMXNET3_CMD_GET_INTRCFG); + + sc->vmx_intr_type = config & 0x03; + sc->vmx_intr_mask_mode = (config >> 2) & 0x03; + + switch (sc->vmx_intr_type) { + case VMXNET3_IT_AUTO: + sc->vmx_intr_type = VMXNET3_IT_MSIX; + /* FALLTHROUGH */ + case VMXNET3_IT_MSIX: + error = vmxnet3_alloc_msix_interrupts(sc); + if (error == 0) + break; + sc->vmx_intr_type = VMXNET3_IT_MSI; + /* FALLTHROUGH */ + case VMXNET3_IT_MSI: + error = vmxnet3_alloc_msi_interrupts(sc); + if (error == 0) + break; + sc->vmx_intr_type = VMXNET3_IT_LEGACY; + /* FALLTHROUGH */ + case VMXNET3_IT_LEGACY: + error = vmxnet3_alloc_legacy_interrupts(sc); + if (error == 0) + break; + /* FALLTHROUGH */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 20:56:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 93EE0D94; Fri, 23 Aug 2013 20:56:17 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F35D23B1; Fri, 23 Aug 2013 20:56:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NKuH0T084202; Fri, 23 Aug 2013 20:56:17 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NKuH32084201; Fri, 23 Aug 2013 20:56:17 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201308232056.r7NKuH32084201@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 23 Aug 2013 20:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254739 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 20:56:17 -0000 Author: bryanv Date: Fri Aug 23 20:56:17 2013 New Revision: 254739 URL: http://svnweb.freebsd.org/changeset/base/254739 Log: Remove duplicate copy of the man page Pointed out by: jmallett Modified: head/share/man/man4/vmx.4 Modified: head/share/man/man4/vmx.4 ============================================================================== --- head/share/man/man4/vmx.4 Fri Aug 23 20:47:16 2013 (r254738) +++ head/share/man/man4/vmx.4 Fri Aug 23 20:56:17 2013 (r254739) @@ -110,115 +110,3 @@ The .Ox driver was written by .An Tsubai Masanari . -.\" -.\" Copyright (c) 2006,2013 Reyk Floeter -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.\" $OpenBSD: src/share/man/man4/vmx.4,v 1.1 2013/05/31 20:18:44 reyk Exp $ -.\" -.\" $FreeBSD$ -.\" -.Dd August 4, 2013 -.Dt VMX 4 -.Os -.Sh NAME -.Nm vmx -.Nd VMware VMXNET3 Virtual Interface Controller device -.Sh SYNOPSIS -To compile this driver into the kernel, -place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device vmx" -.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 -if_vmx_load="YES" -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for the VMXNET3 virtual NIC available in virtual -machines by VMware. -It appears as a simple Ethernet device but is actually a virtual network -interface to the underlying host operating system. -.Pp -This driver supports the -.Ic VMXNET3 -driver protocol, as an alternative to the emulated -.Xr pcn 4 , -.Xr em 4 -interfaces also available in the VMware environment. -The -.Nm -driver is optimized for the virtual machine, it can provide advanced -capabilities depending on the underlying host operating system and -the physical network interface controller of the host. -The -.Nm -driver supports features like multiqueue support, IPv6 -checksum offloading, MSI/MSI-X support and hardware VLAN tagging in -VMware's VLAN Guest Tagging (VGT) mode. -.Pp -The -.Nm -driver supports VMXNET3 VMware virtual NICs provided by the virtual -machine hardware version 7 or newer, as provided by the following -products: -.Pp -.Bl -bullet -compact -offset indent -.It -VMware ESX/ESXi 4.0 and newer -.It -VMware Server 2.0 and newer -.It -VMware Workstation 6.5 and newer -.It -VMware Fusion 2.0 and newer -.El -.Pp -For more information on configuring this device, see -.Xr ifconfig 8 . -.Sh EXAMPLES -The following entry must be added to the VMware configuration file -to provide the -.Nm -device: -.Bd -literal -offset indent -ethernet0.virtualDev = "vmxnet3" -.Ed -.Sh SEE ALSO -.Xr altq 4 , -.Xr arp 4 , -.Xr em 4 , -.Xr netintro 4 , -.Xr ng_ether 4 , -.Xr pcn 4 , -.Xr vlan 4 , -.Xr ifconfig 8 -.Sh AUTHORS -.An -nosplit -The -.Nm -driver was ported from -.Ox -by -.An Bryan Venteicher Aq bryanv@freebsd.org . -The -.Ox -driver was written by -.An Tsubai Masanari . From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 22:52:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5EABD963; Fri, 23 Aug 2013 22:52:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49C582A11; Fri, 23 Aug 2013 22:52:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NMqLke045339; Fri, 23 Aug 2013 22:52:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NMqKWQ045334; Fri, 23 Aug 2013 22:52:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232252.r7NMqKWQ045334@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 22:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254741 - in head: sys/fs/tmpfs sys/kern sys/sys usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 22:52:21 -0000 Author: delphij Date: Fri Aug 23 22:52:20 2013 New Revision: 254741 URL: http://svnweb.freebsd.org/changeset/base/254741 Log: Allow tmpfs be mounted inside jail. Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Aug 23 21:46:11 2013 (r254740) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Aug 23 22:52:20 2013 (r254741) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -138,6 +140,7 @@ tmpfs_mount(struct mount *mp) sizeof(struct tmpfs_dirent) + sizeof(struct tmpfs_node)); struct tmpfs_mount *tmp; struct tmpfs_node *root; + struct thread *td = curthread; int error; /* Size counters. */ u_quad_t pages; @@ -150,6 +153,9 @@ tmpfs_mount(struct mount *mp) struct vattr va; + if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_TMPFS)) + return (EPERM); + if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts)) return (EINVAL); @@ -420,4 +426,4 @@ struct vfsops tmpfs_vfsops = { .vfs_statfs = tmpfs_statfs, .vfs_fhtovp = tmpfs_fhtovp, }; -VFS_SET(tmpfs_vfsops, tmpfs, 0); +VFS_SET(tmpfs_vfsops, tmpfs, VFCF_JAIL); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Aug 23 21:46:11 2013 (r254740) +++ head/sys/kern/kern_jail.c Fri Aug 23 22:52:20 2013 (r254741) @@ -206,6 +206,7 @@ static char *pr_allow_names[] = { "allow.mount.nullfs", "allow.mount.zfs", "allow.mount.procfs", + "allow.mount.tmpfs", }; const size_t pr_allow_names_size = sizeof(pr_allow_names); @@ -221,6 +222,7 @@ static char *pr_allow_nonames[] = { "allow.mount.nonullfs", "allow.mount.nozfs", "allow.mount.noprocfs", + "allow.mount.notmpfs", }; const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); @@ -4228,6 +4230,10 @@ SYSCTL_PROC(_security_jail, OID_AUTO, mo CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, "I", "Processes in jail can mount the procfs file system"); +SYSCTL_PROC(_security_jail, OID_AUTO, mount_tmpfs_allowed, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, PR_ALLOW_MOUNT_TMPFS, sysctl_jail_default_allow, "I", + "Processes in jail can mount the tmpfs file system"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_zfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_ZFS, sysctl_jail_default_allow, "I", @@ -4380,6 +4386,8 @@ SYSCTL_JAIL_PARAM(_allow_mount, nullfs, "B", "Jail may mount the nullfs file system"); SYSCTL_JAIL_PARAM(_allow_mount, procfs, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may mount the procfs file system"); +SYSCTL_JAIL_PARAM(_allow_mount, tmpfs, CTLTYPE_INT | CTLFLAG_RW, + "B", "Jail may mount the tmpfs file system"); SYSCTL_JAIL_PARAM(_allow_mount, zfs, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may mount the zfs file system"); Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Fri Aug 23 21:46:11 2013 (r254740) +++ head/sys/sys/jail.h Fri Aug 23 22:52:20 2013 (r254741) @@ -227,7 +227,8 @@ struct prison_racct { #define PR_ALLOW_MOUNT_NULLFS 0x0100 #define PR_ALLOW_MOUNT_ZFS 0x0200 #define PR_ALLOW_MOUNT_PROCFS 0x0400 -#define PR_ALLOW_ALL 0x07ff +#define PR_ALLOW_MOUNT_TMPFS 0x0800 +#define PR_ALLOW_ALL 0x0fff /* * OSD methods Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Fri Aug 23 21:46:11 2013 (r254740) +++ head/usr.sbin/jail/jail.8 Fri Aug 23 22:52:20 2013 (r254741) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2012 +.Dd August 23, 2013 .Dt JAIL 8 .Os .Sh NAME @@ -545,6 +545,14 @@ This permission is effective only togeth and if .Va enforce_statfs is set to a value lower than 2. +.It Va allow.mount.tmpfs +privileged users inside the jail will be able to mount and unmount the +tmpfs file system. +This permission is effective only together with +.Va allow.mount +and if +.Va enforce_statfs +is set to a value lower than 2. .It Va allow.mount.zfs privileged users inside the jail will be able to mount and unmount the ZFS file system. From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 22:55:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E69C1B3F; Fri, 23 Aug 2013 22:55:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3DF82A33; Fri, 23 Aug 2013 22:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NMtqIX046460; Fri, 23 Aug 2013 22:55:52 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NMtq84046459; Fri, 23 Aug 2013 22:55:52 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201308232255.r7NMtq84046459@svn.freebsd.org> From: Mark Johnston Date: Fri, 23 Aug 2013 22:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254742 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 22:55:53 -0000 Author: markj Date: Fri Aug 23 22:55:52 2013 New Revision: 254742 URL: http://svnweb.freebsd.org/changeset/base/254742 Log: Hold mfi_io_lock across calls to xpt_rescan() and xpt_alloc_ccb_nowait(). xpt_rescan() expects the SIM lock to be held, and we trip a mtx_assert if the driver initiates multiple rescans in quick succession. Reported by: sbruno Tested by: sbruno MFC after: 1 week Modified: head/sys/dev/mfi/mfi_cam.c Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Fri Aug 23 22:52:20 2013 (r254741) +++ head/sys/dev/mfi/mfi_cam.c Fri Aug 23 22:55:52 2013 (r254742) @@ -308,17 +308,16 @@ mfip_cam_rescan(struct mfi_softc *sc, ui return; } camsc->state = MFIP_STATE_RESCAN; - mtx_unlock(&sc->mfi_io_lock); ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { + mtx_unlock(&sc->mfi_io_lock); device_printf(sc->mfi_dev, "Cannot allocate ccb for bus rescan.\n"); return; } sim = camsc->sim; - mtx_lock(&sc->mfi_io_lock); if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -327,11 +326,8 @@ mfip_cam_rescan(struct mfi_softc *sc, ui "Cannot create path for bus rescan.\n"); return; } - mtx_unlock(&sc->mfi_io_lock); - xpt_rescan(ccb); - mtx_lock(&sc->mfi_io_lock); camsc->state = MFIP_STATE_NONE; mtx_unlock(&sc->mfi_io_lock); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:12:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FCECE80; Fri, 23 Aug 2013 23:12:17 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D0F02B25; Fri, 23 Aug 2013 23:12:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNCGpo056593; Fri, 23 Aug 2013 23:12:16 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNCGMU056592; Fri, 23 Aug 2013 23:12:16 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201308232312.r7NNCGMU056592@svn.freebsd.org> From: Alan Somers Date: Fri, 23 Aug 2013 23:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254743 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:12:17 -0000 Author: asomers Date: Fri Aug 23 23:12:16 2013 New Revision: 254743 URL: http://svnweb.freebsd.org/changeset/base/254743 Log: Correctly remove an interface's ipv4 address when the user calls "/etc/rc.d/netif stop XXX". The old globbing pattern failed to account for the possibility of a tab occuring before "inet". Reviewed by: will Approved by: ken (mentor, implicit) MFC after: Never (bug affects head only) Sponsored by: Spectra Logic Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Aug 23 22:55:52 2013 (r254742) +++ head/etc/network.subr Fri Aug 23 23:12:16 2013 (r254743) @@ -661,9 +661,9 @@ ipv4_down() for _inet in $inetList ; do # get rid of extraneous line case $_inet in - "") break ;; - inet\ *) ;; - *) continue ;; + "") break ;; + \ inet\ *|inet\ *) ;; + *) continue ;; esac [ -z "$_inet" ] && break From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:21:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C9BF21FC; Fri, 23 Aug 2013 23:21:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B50D32B9B; Fri, 23 Aug 2013 23:21:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNLPnt061304; Fri, 23 Aug 2013 23:21:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNLOf8061299; Fri, 23 Aug 2013 23:21:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232321.r7NNLOf8061299@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254744 - in head: cddl/contrib/opensolaris/common/ctf sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:21:26 -0000 Author: delphij Date: Fri Aug 23 23:21:24 2013 New Revision: 254744 URL: http://svnweb.freebsd.org/changeset/base/254744 Log: MFV r254422: Illumos DTrace issues: 3089 want ::typedef 3094 libctf should support removing a dynamic type 3095 libctf does not validate arrays correctly 3096 libctf does not validate function types correctly Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c head/cddl/contrib/opensolaris/common/ctf/ctf_error.c head/cddl/contrib/opensolaris/common/ctf/ctf_impl.h head/cddl/contrib/opensolaris/common/ctf/ctf_open.c head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Fri Aug 23 23:12:16 2013 (r254743) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Fri Aug 23 23:21:24 2013 (r254744) @@ -24,13 +24,15 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ #include #include #include #include +#include /* * This static string is used as the template for initially populating a @@ -167,6 +169,51 @@ ctf_copy_membnames(ctf_dtdef_t *dtd, uch } /* + * Only types of dyanmic CTF containers contain reference counts. These + * containers are marked RD/WR. Because of that we basically make this a no-op + * for compatability with non-dynamic CTF sections. This is also a no-op for + * types which are not dynamic types. It is the responsibility of the caller to + * make sure it is a valid type. We help that caller out on debug builds. + * + * Note that the reference counts are not maintained for types that are not + * within this container. In other words if we have a type in a parent, that + * will not have its reference count increased. On the flip side, the parent + * will not be allowed to remove dynamic types if it has children. + */ +static void +ctf_ref_inc(ctf_file_t *fp, ctf_id_t tid) +{ + ctf_dtdef_t *dtd = ctf_dtd_lookup(fp, tid); + + if (dtd == NULL) + return; + + if (!(fp->ctf_flags & LCTF_RDWR)) + return; + + dtd->dtd_ref++; +} + +/* + * Just as with ctf_ref_inc, this is a no-op on non-writeable containers and the + * caller should ensure that this is already a valid type. + */ +static void +ctf_ref_dec(ctf_file_t *fp, ctf_id_t tid) +{ + ctf_dtdef_t *dtd = ctf_dtd_lookup(fp, tid); + + if (dtd == NULL) + return; + + if (!(fp->ctf_flags & LCTF_RDWR)) + return; + + ASSERT(dtd->dtd_ref >= 1); + dtd->dtd_ref--; +} + +/* * If the specified CTF container is writable and has been modified, reload * this container with the updated type definitions. In order to make this * code and the rest of libctf as simple as possible, we perform updates by @@ -180,6 +227,10 @@ ctf_copy_membnames(ctf_dtdef_t *dtd, uch * ctf_bufopen() will return a new ctf_file_t, but we want to keep the fp * constant for the caller, so after ctf_bufopen() returns, we use bcopy to * swap the interior of the old and new ctf_file_t's, and then free the old. + * + * Note that the lists of dynamic types stays around and the resulting container + * is still writeable. Furthermore, the reference counts that are on the dtd's + * are still valid. */ int ctf_update(ctf_file_t *fp) @@ -432,6 +483,7 @@ ctf_dtd_delete(ctf_file_t *fp, ctf_dtdef ctf_dtdef_t *p, **q = &fp->ctf_dthash[h]; ctf_dmdef_t *dmd, *nmd; size_t len; + int kind, i; for (p = *q; p != NULL; p = p->dtd_hash) { if (p != dtd) @@ -443,7 +495,8 @@ ctf_dtd_delete(ctf_file_t *fp, ctf_dtdef if (p != NULL) *q = p->dtd_hash; - switch (CTF_INFO_KIND(dtd->dtd_data.ctt_info)) { + kind = CTF_INFO_KIND(dtd->dtd_data.ctt_info); + switch (kind) { case CTF_K_STRUCT: case CTF_K_UNION: case CTF_K_ENUM: @@ -454,14 +507,33 @@ ctf_dtd_delete(ctf_file_t *fp, ctf_dtdef ctf_free(dmd->dmd_name, len); fp->ctf_dtstrlen -= len; } + if (kind != CTF_K_ENUM) + ctf_ref_dec(fp, dmd->dmd_type); nmd = ctf_list_next(dmd); ctf_free(dmd, sizeof (ctf_dmdef_t)); } break; case CTF_K_FUNCTION: + ctf_ref_dec(fp, dtd->dtd_data.ctt_type); + for (i = 0; i < CTF_INFO_VLEN(dtd->dtd_data.ctt_info); i++) + if (dtd->dtd_u.dtu_argv[i] != 0) + ctf_ref_dec(fp, dtd->dtd_u.dtu_argv[i]); ctf_free(dtd->dtd_u.dtu_argv, sizeof (ctf_id_t) * CTF_INFO_VLEN(dtd->dtd_data.ctt_info)); break; + case CTF_K_ARRAY: + ctf_ref_dec(fp, dtd->dtd_u.dtu_arr.ctr_contents); + ctf_ref_dec(fp, dtd->dtd_u.dtu_arr.ctr_index); + break; + case CTF_K_TYPEDEF: + ctf_ref_dec(fp, dtd->dtd_data.ctt_type); + break; + case CTF_K_POINTER: + case CTF_K_VOLATILE: + case CTF_K_CONST: + case CTF_K_RESTRICT: + ctf_ref_dec(fp, dtd->dtd_data.ctt_type); + break; } if (dtd->dtd_name) { @@ -495,7 +567,9 @@ ctf_dtd_lookup(ctf_file_t *fp, ctf_id_t * Discard all of the dynamic type definitions that have been added to the * container since the last call to ctf_update(). We locate such types by * scanning the list and deleting elements that have type IDs greater than - * ctf_dtoldid, which is set by ctf_update(), above. + * ctf_dtoldid, which is set by ctf_update(), above. Note that to work properly + * with our reference counting schemes, we must delete the dynamic list in + * reverse. */ int ctf_discard(ctf_file_t *fp) @@ -508,11 +582,11 @@ ctf_discard(ctf_file_t *fp) if (!(fp->ctf_flags & LCTF_DIRTY)) return (0); /* no update required */ - for (dtd = ctf_list_next(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { + for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { if (dtd->dtd_type <= fp->ctf_dtoldid) continue; /* skip types that have been committed */ - ntd = ctf_list_next(dtd); + ntd = ctf_list_prev(dtd); ctf_dtd_delete(fp, dtd); } @@ -614,6 +688,8 @@ ctf_add_reftype(ctf_file_t *fp, uint_t f if ((type = ctf_add_generic(fp, flag, NULL, &dtd)) == CTF_ERR) return (CTF_ERR); /* errno is set for us */ + ctf_ref_inc(fp, ref); + dtd->dtd_data.ctt_info = CTF_TYPE_INFO(kind, flag, 0); dtd->dtd_data.ctt_type = (ushort_t)ref; @@ -645,16 +721,29 @@ ctf_add_array(ctf_file_t *fp, uint_t fla { ctf_dtdef_t *dtd; ctf_id_t type; + ctf_file_t *fpd; if (arp == NULL) return (ctf_set_errno(fp, EINVAL)); + fpd = fp; + if (ctf_lookup_by_id(&fpd, arp->ctr_contents) == NULL && + ctf_dtd_lookup(fp, arp->ctr_contents) == NULL) + return (ctf_set_errno(fp, ECTF_BADID)); + + fpd = fp; + if (ctf_lookup_by_id(&fpd, arp->ctr_index) == NULL && + ctf_dtd_lookup(fp, arp->ctr_index) == NULL) + return (ctf_set_errno(fp, ECTF_BADID)); + if ((type = ctf_add_generic(fp, flag, NULL, &dtd)) == CTF_ERR) return (CTF_ERR); /* errno is set for us */ dtd->dtd_data.ctt_info = CTF_TYPE_INFO(CTF_K_ARRAY, flag, 0); dtd->dtd_data.ctt_size = 0; dtd->dtd_u.dtu_arr = *arp; + ctf_ref_inc(fp, arp->ctr_contents); + ctf_ref_inc(fp, arp->ctr_index); return (type); } @@ -662,6 +751,7 @@ ctf_add_array(ctf_file_t *fp, uint_t fla int ctf_set_array(ctf_file_t *fp, ctf_id_t type, const ctf_arinfo_t *arp) { + ctf_file_t *fpd; ctf_dtdef_t *dtd = ctf_dtd_lookup(fp, type); if (!(fp->ctf_flags & LCTF_RDWR)) @@ -670,8 +760,22 @@ ctf_set_array(ctf_file_t *fp, ctf_id_t t if (dtd == NULL || CTF_INFO_KIND(dtd->dtd_data.ctt_info) != CTF_K_ARRAY) return (ctf_set_errno(fp, ECTF_BADID)); + fpd = fp; + if (ctf_lookup_by_id(&fpd, arp->ctr_contents) == NULL && + ctf_dtd_lookup(fp, arp->ctr_contents) == NULL) + return (ctf_set_errno(fp, ECTF_BADID)); + + fpd = fp; + if (ctf_lookup_by_id(&fpd, arp->ctr_index) == NULL && + ctf_dtd_lookup(fp, arp->ctr_index) == NULL) + return (ctf_set_errno(fp, ECTF_BADID)); + + ctf_ref_dec(fp, dtd->dtd_u.dtu_arr.ctr_contents); + ctf_ref_dec(fp, dtd->dtd_u.dtu_arr.ctr_index); fp->ctf_flags |= LCTF_DIRTY; dtd->dtd_u.dtu_arr = *arp; + ctf_ref_inc(fp, arp->ctr_contents); + ctf_ref_inc(fp, arp->ctr_index); return (0); } @@ -683,7 +787,9 @@ ctf_add_function(ctf_file_t *fp, uint_t ctf_dtdef_t *dtd; ctf_id_t type; uint_t vlen; + int i; ctf_id_t *vdat = NULL; + ctf_file_t *fpd; if (ctc == NULL || (ctc->ctc_flags & ~CTF_FUNC_VARARG) != 0 || (ctc->ctc_argc != 0 && argv == NULL)) @@ -696,6 +802,18 @@ ctf_add_function(ctf_file_t *fp, uint_t if (vlen > CTF_MAX_VLEN) return (ctf_set_errno(fp, EOVERFLOW)); + fpd = fp; + if (ctf_lookup_by_id(&fpd, ctc->ctc_return) == NULL && + ctf_dtd_lookup(fp, ctc->ctc_return) == NULL) + return (ctf_set_errno(fp, ECTF_BADID)); + + for (i = 0; i < ctc->ctc_argc; i++) { + fpd = fp; + if (ctf_lookup_by_id(&fpd, argv[i]) == NULL && + ctf_dtd_lookup(fp, argv[i]) == NULL) + return (ctf_set_errno(fp, ECTF_BADID)); + } + if (vlen != 0 && (vdat = ctf_alloc(sizeof (ctf_id_t) * vlen)) == NULL) return (ctf_set_errno(fp, EAGAIN)); @@ -707,6 +825,10 @@ ctf_add_function(ctf_file_t *fp, uint_t dtd->dtd_data.ctt_info = CTF_TYPE_INFO(CTF_K_FUNCTION, flag, vlen); dtd->dtd_data.ctt_type = (ushort_t)ctc->ctc_return; + ctf_ref_inc(fp, ctc->ctc_return); + for (i = 0; i < ctc->ctc_argc; i++) + ctf_ref_inc(fp, argv[i]); + bcopy(argv, vdat, sizeof (ctf_id_t) * ctc->ctc_argc); if (ctc->ctc_flags & CTF_FUNC_VARARG) vdat[vlen - 1] = 0; /* add trailing zero to indicate varargs */ @@ -825,8 +947,11 @@ ctf_add_typedef(ctf_file_t *fp, uint_t f { ctf_dtdef_t *dtd; ctf_id_t type; + ctf_file_t *fpd; - if (ref == CTF_ERR || ref < 0 || ref > CTF_MAX_TYPE) + fpd = fp; + if (ref == CTF_ERR || (ctf_lookup_by_id(&fpd, ref) == NULL && + ctf_dtd_lookup(fp, ref) == NULL)) return (ctf_set_errno(fp, EINVAL)); if ((type = ctf_add_generic(fp, flag, name, &dtd)) == CTF_ERR) @@ -834,6 +959,7 @@ ctf_add_typedef(ctf_file_t *fp, uint_t f dtd->dtd_data.ctt_info = CTF_TYPE_INFO(CTF_K_TYPEDEF, flag, 0); dtd->dtd_data.ctt_type = (ushort_t)ref; + ctf_ref_inc(fp, ref); return (type); } @@ -1008,6 +1134,45 @@ ctf_add_member(ctf_file_t *fp, ctf_id_t if (s != NULL) fp->ctf_dtstrlen += strlen(s) + 1; + ctf_ref_inc(fp, type); + fp->ctf_flags |= LCTF_DIRTY; + return (0); +} + +/* + * This removes a type from the dynamic section. This will fail if the type is + * referenced by another type. Note that the CTF ID is never reused currently by + * CTF. Note that if this container is a parent container then we just outright + * refuse to remove the type. There currently is no notion of searching for the + * ctf_dtdef_t in parent containers. If there is, then this constraint could + * become finer grained. + */ +int +ctf_delete_type(ctf_file_t *fp, ctf_id_t type) +{ + ctf_file_t *fpd; + ctf_dtdef_t *dtd = ctf_dtd_lookup(fp, type); + + if (!(fp->ctf_flags & LCTF_RDWR)) + return (ctf_set_errno(fp, ECTF_RDONLY)); + + /* + * We want to give as useful an errno as possible. That means that we + * want to distinguish between a type which does not exist and one for + * which the type is not dynamic. + */ + fpd = fp; + if (ctf_lookup_by_id(&fpd, type) == NULL && + ctf_dtd_lookup(fp, type) == NULL) + return (CTF_ERR); /* errno is set for us */ + + if (dtd == NULL) + return (ctf_set_errno(fp, ECTF_NOTDYN)); + + if (dtd->dtd_ref != 0 || fp->ctf_refcnt > 1) + return (ctf_set_errno(fp, ECTF_REFERENCED)); + + ctf_dtd_delete(fp, dtd); fp->ctf_flags |= LCTF_DIRTY; return (0); } @@ -1103,6 +1268,9 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil ctf_hash_t *hp; ctf_helem_t *hep; + if (dst_fp == src_fp) + return (src_type); + if (!(dst_fp->ctf_flags & LCTF_RDWR)) return (ctf_set_errno(dst_fp, ECTF_RDONLY)); @@ -1313,6 +1481,14 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil if (errs) return (CTF_ERR); /* errno is set for us */ + + /* + * Now that we know that we can't fail, we go through and bump + * all the reference counts on the member types. + */ + for (dmd = ctf_list_next(&dtd->dtd_u.dtu_members); + dmd != NULL; dmd = ctf_list_next(dmd)) + ctf_ref_inc(dst_fp, dmd->dmd_type); break; } Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_error.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_error.c Fri Aug 23 23:12:16 2013 (r254743) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_error.c Fri Aug 23 23:21:24 2013 (r254744) @@ -23,8 +23,9 @@ * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012, Joyent, Inc. + */ #include @@ -73,6 +74,8 @@ static const char *const _ctf_errlist[] "Limit on number of dynamic types reached", /* ECTF_FULL */ "Duplicate member name definition", /* ECTF_DUPMEMBER */ "Conflicting type is already defined", /* ECTF_CONFLICT */ + "Type has outstanding references", /* ECTF_REFERENCED */ + "Type is not a dynamic type" /* ECTF_NOTDYN */ }; static const int _ctf_nerr = sizeof (_ctf_errlist) / sizeof (_ctf_errlist[0]); Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_impl.h Fri Aug 23 23:12:16 2013 (r254743) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_impl.h Fri Aug 23 23:21:24 2013 (r254744) @@ -24,12 +24,13 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + */ #ifndef _CTF_IMPL_H #define _CTF_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -149,6 +150,7 @@ typedef struct ctf_dtdef { char *dtd_name; /* name associated with definition (if any) */ ctf_id_t dtd_type; /* type identifier for this definition */ ctf_type_t dtd_data; /* type node (see ) */ + int dtd_ref; /* recfount for dyanmic types */ union { ctf_list_t dtu_members; /* struct, union, or enum */ ctf_arinfo_t dtu_arr; /* array */ @@ -269,7 +271,9 @@ enum { ECTF_DTFULL, /* CTF type is full (no more members allowed) */ ECTF_FULL, /* CTF container is full */ ECTF_DUPMEMBER, /* duplicate member name definition */ - ECTF_CONFLICT /* conflicting type definition present */ + ECTF_CONFLICT, /* conflicting type definition present */ + ECTF_REFERENCED, /* type has outstanding references */ + ECTF_NOTDYN /* type is not a dynamic type */ }; extern ssize_t ctf_get_ctt_size(const ctf_file_t *, const ctf_type_t *, Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_open.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_open.c Fri Aug 23 23:12:16 2013 (r254743) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_open.c Fri Aug 23 23:21:24 2013 (r254744) @@ -24,8 +24,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + */ #include #include @@ -810,8 +811,12 @@ ctf_close(ctf_file_t *fp) if (fp->ctf_parent != NULL) ctf_close(fp->ctf_parent); - for (dtd = ctf_list_next(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { - ntd = ctf_list_next(dtd); + /* + * Note, to work properly with reference counting on the dynamic + * section, we must delete the list in reverse. + */ + for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { + ntd = ctf_list_prev(dtd); ctf_dtd_delete(fp, dtd); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Fri Aug 23 23:12:16 2013 (r254743) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Fri Aug 23 23:21:24 2013 (r254744) @@ -23,6 +23,9 @@ * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + */ /* * This header file defines the interfaces available from the CTF debugger @@ -40,8 +43,6 @@ #ifndef _CTF_API_H #define _CTF_API_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -227,6 +228,8 @@ extern int ctf_add_member(ctf_file_t *, extern int ctf_set_array(ctf_file_t *, ctf_id_t, const ctf_arinfo_t *); +extern int ctf_delete_type(ctf_file_t *, ctf_id_t); + extern int ctf_update(ctf_file_t *); extern int ctf_discard(ctf_file_t *); extern int ctf_write(ctf_file_t *, int); From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:26:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 02273367; Fri, 23 Aug 2013 23:26:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE9462BBB; Fri, 23 Aug 2013 23:26:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNQ2en062746; Fri, 23 Aug 2013 23:26:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNPwvV062677; Fri, 23 Aug 2013 23:25:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308232325.r7NNPwvV062677@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 23 Aug 2013 23:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254745 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/events components/hardware components/namespace components/tables components/utilities include... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:26:03 -0000 Author: jkim Date: Fri Aug 23 23:25:58 2013 New Revision: 254745 URL: http://svnweb.freebsd.org/changeset/base/254745 Log: Merge ACPICA 20130823. Modified: head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Fri Aug 23 23:25:58 2013 (r254745) @@ -21,7 +21,7 @@ stripdirs="generate libraries tests tool stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \ aclinux.h acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h \ acwin64.h new_table.txt osfreebsdtbl.c oslinuxtbl.c osunixdir.c \ - oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" + osunixmap.c oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" # include files to canonify src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/changes.txt Fri Aug 23 23:25:58 2013 (r254745) @@ -1,4 +1,88 @@ ---------------------------------------- +23 August 2013. Summary of changes for version 20130823: + +1) ACPICA kernel-resident subsystem: + +Implemented support for host-installed System Control Interrupt (SCI) +handlers. Certain ACPI functionality requires the host to handle raw +SCIs. For example, the "SCI Doorbell" that is defined for memory power +state support requires the host device driver to handle SCIs to examine +if the doorbell has been activated. Multiple SCI handlers can be +installed to allow for future expansion. New external interfaces are +AcpiInstallSciHandler, AcpiRemoveSciHandler; see the ACPICA reference for +details. Lv Zheng, Bob Moore. ACPICA BZ 1032. + +Operation region support: Never locally free the handler "context" +pointer. This change removes some dangerous code that attempts to free +the handler context pointer in some (rare) circumstances. The owner of +the handler owns this pointer and the ACPICA code should never touch it. +Although not seen to be an issue in any kernel, it did show up as a +problem (fault) under AcpiExec. Also, set the internal storage field for +the context pointer to zero when the region is deactivated, simply for +sanity. David Box. ACPICA BZ 1039. + +AcpiRead: On error, do not modify the return value target location. If an +error happens in the middle of a split 32/32 64-bit I/O operation, do not +modify the target of the return value pointer. Makes the code consistent +with the rest of ACPICA. Bjorn Helgaas. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 96.7K Code, 27.1K Data, 123.9K Total + Debug Version: 184.4K Code, 76.8K Data, 261.2K Total + Previous Release: + Non-Debug Version: 96.2K Code, 27.1K Data, 123.3K Total + Debug Version: 185.4K Code, 77.1K Data, 262.5K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiDump: Implemented several new features and fixed some problems: +1) Added support to dump the RSDP, RSDT, and XSDT tables. +2) Added support for multiple table instances (SSDT, UEFI). +3) Added option to dump "customized" (overridden) tables (-c). +4) Fixed a problem where some table filenames were improperly +constructed. +5) Improved some error messages, removed some unnecessary messages. + +iASL: Implemented additional support for disassembly of ACPI tables that +contain invocations of external control methods. The -fe option +allows the import of a file that specifies the external methods along +with the required number of arguments for each -- allowing for the +correct disassembly of the table. This is a workaround for a limitation +of AML code where the disassembler often cannot determine the number of +arguments required for an external control method and generates incorrect +ASL code. See the iASL reference for details. ACPICA BZ 1030. + +Debugger: Implemented a new command (paths) that displays the full +pathnames (namepaths) and object types of all objects in the namespace. +This is an alternative to the namespace command. + +Debugger: Implemented a new command (sci) that invokes the SCI dispatch +mechanism and any installed handlers. + +iASL: Fixed a possible segfault for "too many parent prefixes" condition. +This can occur if there are too many parent prefixes in a namepath (for +example, ^^^^^^PCI0.ECRD). ACPICA BZ 1035. + +Application OSLs: Set the return value for the PCI read functions. These +functions simply return AE_OK, but should set the return value to zero +also. This change implements this. ACPICA BZ 1038. + +Debugger: Prevent possible command line buffer overflow. Increase the +size of a couple of the debugger line buffers, and ensure that overflow +cannot happen. ACPICA BZ 1037. + +iASL: Changed to abort immediately on serious errors during the parsing +phase. Due to the nature of ASL, there is no point in attempting to +compile these types of errors, and they typically end up causing a +cascade of hundreds of errors which obscure the original problem. + +---------------------------------------- 25 July 2013. Summary of changes for version 20130725: 1) ACPICA kernel-resident subsystem: Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/common/adisasm.c Fri Aug 23 23:25:58 2013 (r254745) @@ -341,6 +341,10 @@ AdAmlDisassemble ( { AcpiDmClearExternalList (); } + + /* Load any externals defined in the optional external ref file */ + + AcpiDmGetExternalsFromFile (); } else { Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/common/adwalk.c Fri Aug 23 23:25:58 2013 (r254745) @@ -373,10 +373,18 @@ AcpiDmDumpDescending ( switch (Op->Common.AmlOpcode) { case AML_BYTE_OP: + + AcpiOsPrintf ("%2.2X", (UINT32) Op->Common.Value.Integer); + break; + case AML_WORD_OP: + + AcpiOsPrintf ("%4.4X", (UINT32) Op->Common.Value.Integer); + break; + case AML_DWORD_OP: - AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer); + AcpiOsPrintf ("%8.8X", (UINT32) Op->Common.Value.Integer); break; case AML_QWORD_OP: Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/common/dmextern.c Fri Aug 23 23:25:58 2013 (r254745) @@ -46,7 +46,9 @@ #include #include #include +#include #include +#include /* @@ -87,6 +89,8 @@ static const char *AcpiGbl_DmT /* 19 */ ", FieldUnitObj" }; +#define METHOD_SEPARATORS " \t,()\n" + /* Local prototypes */ @@ -99,6 +103,12 @@ AcpiDmNormalizeParentPrefix ( ACPI_PARSE_OBJECT *Op, char *Path); +static void +AcpiDmAddToExternalListFromFile ( + char *Path, + UINT8 Type, + UINT32 Value); + /******************************************************************************* * @@ -444,7 +454,7 @@ AcpiDmAddToExternalList ( (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, - "Argument count mismatch for method %s %u %u", + "External method arg count mismatch %s: Current %u, attempted %u", NextExternal->Path, NextExternal->Value, Value)); } @@ -536,6 +546,275 @@ AcpiDmAddToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmGetExternalsFromFile + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Process the optional external reference file. + * + * Each line in the file should be of the form: + * External (, MethodObj, ) + * + * Example: + * External (_SB_.PCI0.XHC_.PS0X, MethodObj, 4) + * + ******************************************************************************/ + +void +AcpiDmGetExternalsFromFile ( + void) +{ + FILE *ExternalRefFile; + char *Token; + char *MethodName; + UINT32 ArgCount; + UINT32 ImportCount = 0; + + + if (!Gbl_ExternalRefFilename) + { + return; + } + + /* Open the file */ + + ExternalRefFile = fopen (Gbl_ExternalRefFilename, "r"); + if (!ExternalRefFile) + { + fprintf (stderr, "Could not open external reference file \"%s\"\n", + Gbl_ExternalRefFilename); + return; + } + + /* Each line defines a method */ + + while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile)) + { + Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */ + if (!Token) continue; + if (strcmp (Token, "External")) continue; + + MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */ + if (!MethodName) continue; + + Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */ + if (!Token) continue; + if (strcmp (Token, "MethodObj")) continue; + + Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */ + if (!Token) continue; + + /* Convert arg count string to an integer */ + + errno = 0; + ArgCount = strtoul (Token, NULL, 0); + if (errno) + { + fprintf (stderr, "Invalid argument count (%s)\n", Token); + continue; + } + if (ArgCount > 7) + { + fprintf (stderr, "Invalid argument count (%u)\n", ArgCount); + continue; + } + + /* Add this external to the global list */ + + AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n", + Gbl_ExternalRefFilename, ArgCount, MethodName); + + AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80); + ImportCount++; + } + + if (!ImportCount) + { + fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n", + Gbl_ExternalRefFilename); + } + else + { + /* Add the external(s) to the namespace */ + + AcpiDmAddExternalsToNamespace (); + + AcpiOsPrintf ("%s: Imported %u external method definitions\n", + Gbl_ExternalRefFilename, ImportCount); + } + + fclose (ExternalRefFile); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddToExternalListFromFile + * + * PARAMETERS: Path - Internal (AML) path to the object + * Type - ACPI object type to be added + * Value - Arg count if adding a Method object + * + * RETURN: None + * + * DESCRIPTION: Insert a new name into the global list of Externals which + * will in turn be later emitted as an External() declaration + * in the disassembled output. + * + ******************************************************************************/ + +static void +AcpiDmAddToExternalListFromFile ( + char *Path, + UINT8 Type, + UINT32 Value) +{ + char *InternalPath; + char *ExternalPath; + ACPI_EXTERNAL_LIST *NewExternal; + ACPI_EXTERNAL_LIST *NextExternal; + ACPI_EXTERNAL_LIST *PrevExternal = NULL; + ACPI_STATUS Status; + BOOLEAN Resolved = FALSE; + + + if (!Path) + { + return; + } + + /* TBD: Add a flags parameter */ + + if (Type == ACPI_TYPE_METHOD) + { + if (Value & 0x80) + { + Resolved = TRUE; + } + Value &= 0x07; + } + + /* + * We don't want External() statements to contain a leading '\'. + * This prevents duplicate external statements of the form: + * + * External (\ABCD) + * External (ABCD) + * + * This would cause a compile time error when the disassembled + * output file is recompiled. + */ + if ((*Path == AML_ROOT_PREFIX) && (Path[1])) + { + Path++; + } + + /* Check all existing externals to ensure no duplicates */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (!ACPI_STRCMP (Path, NextExternal->Path)) + { + /* Duplicate method, check that the Value (ArgCount) is the same */ + + if ((NextExternal->Type == ACPI_TYPE_METHOD) && + (NextExternal->Value != Value)) + { + ACPI_ERROR ((AE_INFO, + "(File) External method arg count mismatch %s: Current %u, override to %u", + NextExternal->Path, NextExternal->Value, Value)); + + /* Override, since new value came from external reference file */ + + NextExternal->Value = Value; + } + + /* Allow upgrade of type from ANY */ + + else if (NextExternal->Type == ACPI_TYPE_ANY) + { + NextExternal->Type = Type; + NextExternal->Value = Value; + } + + return; + } + + NextExternal = NextExternal->Next; + } + + /* Get the internal pathname (AML format) */ + + Status = AcpiNsInternalizeName (Path, &InternalPath); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Allocate and init a new External() descriptor */ + + NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); + if (!NewExternal) + { + ACPI_FREE (InternalPath); + return; + } + + /* Must copy and normalize the input path */ + + AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath); + + NewExternal->Path = ExternalPath; + NewExternal->Type = Type; + NewExternal->Value = Value; + NewExternal->Resolved = Resolved; + NewExternal->Length = (UINT16) ACPI_STRLEN (Path); + NewExternal->InternalPath = InternalPath; + + /* Set flag to indicate External->InternalPath needs to be freed */ + + NewExternal->Flags |= ACPI_IPATH_ALLOCATED | ACPI_FROM_REFERENCE_FILE; + + /* Link the new descriptor into the global list, alphabetically ordered */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0) + { + if (PrevExternal) + { + PrevExternal->Next = NewExternal; + } + else + { + AcpiGbl_ExternalList = NewExternal; + } + + NewExternal->Next = NextExternal; + return; + } + + PrevExternal = NextExternal; + NextExternal = NextExternal->Next; + } + + if (PrevExternal) + { + PrevExternal->Next = NewExternal; + } + else + { + AcpiGbl_ExternalList = NewExternal; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddExternalsToNamespace * * PARAMETERS: None @@ -563,7 +842,7 @@ AcpiDmAddExternalsToNamespace ( Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, ACPI_IMODE_LOAD_PASS1, - ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (ACPI_FAILURE (Status)) @@ -731,7 +1010,8 @@ AcpiDmEmitExternals ( NextExternal->Path, AcpiDmGetObjectTypeName (NextExternal->Type)); - AcpiOsPrintf (") // Warning: Unresolved Method, " + AcpiOsPrintf ( + ") // Warning: Unresolved Method, " "guessing %u arguments (may be incorrect, see warning above)\n", NextExternal->Value); @@ -743,9 +1023,45 @@ AcpiDmEmitExternals ( AcpiOsPrintf ("\n"); + + /* Emit externals that were imported from a file */ + + if (Gbl_ExternalRefFilename) + { + AcpiOsPrintf ( + " /*\n * External declarations that were imported from\n" + " * the reference file [%s]\n */\n", + Gbl_ExternalRefFilename); + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (!NextExternal->Emitted && (NextExternal->Flags & ACPI_FROM_REFERENCE_FILE)) + { + AcpiOsPrintf (" External (%s%s", + NextExternal->Path, + AcpiDmGetObjectTypeName (NextExternal->Type)); + + if (NextExternal->Type == ACPI_TYPE_METHOD) + { + AcpiOsPrintf (") // %u Arguments\n", + NextExternal->Value); + } + else + { + AcpiOsPrintf (")\n"); + } + NextExternal->Emitted = TRUE; + } + + NextExternal = NextExternal->Next; + } + + AcpiOsPrintf ("\n"); + } + /* - * Walk the list of externals (unresolved references) - * found during the AML parsing + * Walk the list of externals found during the AML parsing */ while (AcpiGbl_ExternalList) { Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/common/dmtable.c Fri Aug 23 23:25:58 2013 (r254745) @@ -446,7 +446,7 @@ AcpiDmDumpDataTable ( Length = Table->Length; AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); } - else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_RSDP)) + else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) { Length = AcpiDmDumpRsdp (Table); } Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Fri Aug 23 23:25:58 2013 (r254745) @@ -593,10 +593,15 @@ CmDoCompile ( AslCompilerparse(); UtEndEvent (Event); - /* Flush out any remaining source after parse tree is complete */ + /* Check for parse errors */ - Event = UtBeginEvent ("Flush source input"); - CmFlushSourceCode (); + Status = AslCheckForErrorExit (); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n"); + LsDumpParseTree (); + goto ErrorExit; + } /* Did the parse tree get successfully constructed? */ @@ -606,16 +611,18 @@ CmDoCompile ( * If there are no errors, then we have some sort of * internal problem. */ - Status = AslCheckForErrorExit (); - if (Status == AE_OK) - { - AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, - NULL, "- Could not resolve parse tree root node"); - } + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, + NULL, "- Could not resolve parse tree root node"); goto ErrorExit; } + + /* Flush out any remaining source after parse tree is complete */ + + Event = UtBeginEvent ("Flush source input"); + CmFlushSourceCode (); + /* Optional parse tree dump, compiler debug output only */ LsDumpParseTree (); Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Fri Aug 23 23:25:58 2013 (r254745) @@ -186,6 +186,7 @@ ASL_EXTERN char ASL_ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); ASL_EXTERN char *Gbl_CurrentInputFilename; +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalRefFilename, NULL); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE); Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Fri Aug 23 23:25:58 2013 (r254745) @@ -487,6 +487,10 @@ LdNamespace1Begin ( ACPI_TYPE_LOCAL_SCOPE, ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &(Node)); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } /* * However, this is an error -- primarily because the MS Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Aug 23 23:25:58 2013 (r254745) @@ -138,6 +138,7 @@ Usage ( ACPI_OPTION ("-dc ", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-e ", "Include ACPI table(s) for external symbol resolution"); + ACPI_OPTION ("-fe ", "Specify external symbol declaration file"); ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Fri Aug 23 23:25:58 2013 (r254745) @@ -68,7 +68,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z" /******************************************************************************* @@ -136,8 +136,7 @@ AslCommandLine ( if (BadCommandLine) { - printf ("\n"); - Usage (); + printf ("Use -h option for help information\n"); exit (1); } @@ -276,9 +275,30 @@ AslDoOptions ( } break; - case 'f': /* Ignore errors and force creation of aml file */ + case 'f': + + switch (AcpiGbl_Optarg[0]) + { + case '^': /* Ignore errors and force creation of aml file */ + + Gbl_IgnoreErrors = TRUE; + break; + + case 'e': /* Disassembler: Get external declaration file */ + + if (AcpiGetoptArgument (argc, argv)) + { + return (-1); + } + + Gbl_ExternalRefFilename = AcpiGbl_Optarg; + break; - Gbl_IgnoreErrors = TRUE; + default: + + printf ("Unknown option: -f%s\n", AcpiGbl_Optarg); + return (-1); + } break; case 'G': Modified: head/sys/contrib/dev/acpica/compiler/dtcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtcompile.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/compiler/dtcompile.c Fri Aug 23 23:25:58 2013 (r254745) @@ -317,7 +317,7 @@ DtCompileDataTable ( DtSetTableLength (); return (Status); } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_RSDP)) + else if (ACPI_VALIDATE_RSDP_SIG (Signature)) { Status = DtCompileRsdp (FieldList); return (Status); Modified: head/sys/contrib/dev/acpica/components/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Fri Aug 23 23:25:58 2013 (r254745) @@ -1211,6 +1211,14 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } + +void +AcpiDbGenerateSci ( + void) +{ + AcpiEvSciDispatch (); +} + #endif /* !ACPI_REDUCED_HARDWARE */ #endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Fri Aug 23 23:25:58 2013 (r254745) @@ -142,7 +142,8 @@ AcpiDbOpenDebugFile ( } AcpiOsPrintf ("Debug output file %s opened\n", Name); - ACPI_STRCPY (AcpiGbl_DbDebugFilename, Name); + ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name, + sizeof (AcpiGbl_DbDebugFilename)); AcpiGbl_DbOutputToFile = TRUE; #endif @@ -274,11 +275,9 @@ AcpiDbReadTable ( fseek (fp, 0, SEEK_SET); - /* The RSDT, FACS and S3PT tables do not have standard ACPI headers */ + /* The RSDP table does not have standard ACPI header */ - if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ") || - ACPI_COMPARE_NAME (TableHeader.Signature, "FACS") || - ACPI_COMPARE_NAME (TableHeader.Signature, "S3PT")) + if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ")) { *TableLength = FileSize; StandardHeader = FALSE; Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Aug 23 23:25:58 2013 (r254745) @@ -132,12 +132,14 @@ enum AcpiExDebuggerCommands CMD_OPEN, CMD_OSI, CMD_OWNER, + CMD_PATHS, CMD_PREDEFINED, CMD_PREFIX, CMD_QUIT, CMD_REFERENCES, CMD_RESOURCES, CMD_RESULTS, + CMD_SCI, CMD_SET, CMD_SLEEP, CMD_STATS, @@ -203,12 +205,14 @@ static const ACPI_DB_COMMAND_INFO Acpi {"OPEN", 1}, {"OSI", 0}, {"OWNER", 1}, + {"PATHS", 0}, {"PREDEFINED", 0}, {"PREFIX", 0}, {"QUIT", 0}, {"REFERENCES", 1}, {"RESOURCES", 0}, {"RESULTS", 0}, + {"SCI", 0}, {"SET", 3}, {"SLEEP", 0}, {"STATS", 1}, @@ -259,22 +263,19 @@ static const ACPI_DB_COMMAND_HELP Acpi {0, "\nNamespace Access Commands:", "\n"}, {1, " Businfo", "Display system bus info\n"}, {1, " Disassemble ", "Disassemble a control method\n"}, - {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, - {1, " Gpe ", "Simulate a GPE\n"}, - {1, " Gpes", "Display info on all GPEs\n"}, {1, " Integrity", "Validate namespace integrity\n"}, {1, " Methods", "Display list of loaded control methods\n"}, {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, {1, " Notify ", "Send a notification on Object\n"}, {1, " Objects ", "Display all objects of the given type\n"}, {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, + {1, " Paths", "Display full pathnames of namespace objects\n"}, {1, " Predefined", "Check all predefined names\n"}, {1, " Prefix []", "Set or Get current execution prefix\n"}, {1, " References ", "Find all references to object at addr\n"}, {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, {1, " Set N ", "Set value for named integer\n"}, - {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, {1, " Terminate", "Delete namespace and all internal objects\n"}, {1, " Type ", "Display object type\n"}, @@ -288,7 +289,7 @@ static const ACPI_DB_COMMAND_HELP Acpi {5, " Execute [Arguments]", "Execute control method\n"}, {1, " Hex Integer", "Integer method argument\n"}, {1, " \"Ascii String\"", "String method argument\n"}, - {1, " (Byte List)", "Buffer method argument\n"}, + {1, " (Hex Byte List)", "Buffer method argument\n"}, {1, " [Package Element List]", "Package method argument\n"}, {1, " Go", "Allow method to run to completion\n"}, {1, " Information", "Display info about the current method\n"}, @@ -303,6 +304,13 @@ static const ACPI_DB_COMMAND_HELP Acpi {1, " Tree", "Display control method calling tree\n"}, {1, " ", "Single step next AML opcode (over calls)\n"}, + {0, "\nHardware Related Commands:", "\n"}, + {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, + {1, " Gpe ", "Simulate a GPE\n"}, + {1, " Gpes", "Display info on all GPEs\n"}, + {1, " Sci", "Generate an SCI\n"}, + {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, + {0, "\nFile I/O Commands:", "\n"}, {1, " Close", "Close debug output file\n"}, {1, " Load ", "Load ACPI table from a file\n"}, @@ -1002,6 +1010,11 @@ AcpiDbCommandDispatch ( AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; + case CMD_PATHS: + + AcpiDbDumpNamespacePaths (); + break; + case CMD_PREDEFINED: AcpiDbCheckPredefinedNames (); @@ -1027,6 +1040,11 @@ AcpiDbCommandDispatch ( AcpiDbDisplayResults (); break; + case CMD_SCI: + + AcpiDbGenerateSci (); + break; + case CMD_SET: AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], Modified: head/sys/contrib/dev/acpica/components/debugger/dbnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Aug 23 23:25:58 2013 (r254745) @@ -256,6 +256,37 @@ AcpiDbDumpNamespace ( /******************************************************************************* * + * FUNCTION: AcpiDbDumpNamespacePaths + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Dump entire namespace with full object pathnames and object + * type information. Alternative to "namespace" command. + * + ******************************************************************************/ + +void +AcpiDbDumpNamespacePaths ( + void) +{ + + AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); + AcpiOsPrintf ("ACPI Namespace (from root):\n"); + + /* Display the entire namespace */ + + AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); + AcpiNsDumpObjectPaths (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, + ACPI_UINT32_MAX, ACPI_OWNER_ID_MAX, AcpiGbl_RootNode); + + AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbDumpNamespaceByOwner * * PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed Modified: head/sys/contrib/dev/acpica/components/events/evgpeutil.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evgpeutil.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/events/evgpeutil.c Fri Aug 23 23:25:58 2013 (r254745) @@ -216,7 +216,7 @@ AcpiEvGetGpeDevice ( * * FUNCTION: AcpiEvGetGpeXruptBlock * - * PARAMETERS: InterruptNumber - Interrupt for a GPE block + * PARAMETERS: InterruptNumber - Interrupt for a GPE block * * RETURN: A GPE interrupt block * Modified: head/sys/contrib/dev/acpica/components/events/evmisc.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evmisc.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/events/evmisc.c Fri Aug 23 23:25:58 2013 (r254745) @@ -292,15 +292,6 @@ AcpiEvTerminate ( Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); - /* Remove SCI handler */ - - Status = AcpiEvRemoveSciHandler (); - if (ACPI_FAILURE(Status)) - { - ACPI_ERROR ((AE_INFO, - "Could not remove SCI handler")); - } - Status = AcpiEvRemoveGlobalLockHandler (); if (ACPI_FAILURE(Status)) { @@ -311,6 +302,15 @@ AcpiEvTerminate ( AcpiGbl_EventsInitialized = FALSE; } + /* Remove SCI handlers */ + + Status = AcpiEvRemoveAllSciHandlers (); + if (ACPI_FAILURE(Status)) + { + ACPI_ERROR ((AE_INFO, + "Could not remove SCI handler")); + } + /* Deallocate all handler objects installed within GPE info structs */ Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL); Modified: head/sys/contrib/dev/acpica/components/events/evregion.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evregion.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/events/evregion.c Fri Aug 23 23:25:58 2013 (r254745) @@ -234,18 +234,12 @@ AcpiEvAddressSpaceDispatch ( { RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; - if (RegionObj2->Extra.RegionContext) - { - /* The handler for this region was already installed */ - - ACPI_FREE (RegionContext); - } - else + /* + * Save the returned context for use in all accesses to + * the handler for this particular region + */ + if (!(RegionObj2->Extra.RegionContext)) { - /* - * Save the returned context for use in all accesses to - * this particular region - */ RegionObj2->Extra.RegionContext = RegionContext; } } @@ -261,7 +255,6 @@ AcpiEvAddressSpaceDispatch ( ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); - /* * Special handling for GenericSerialBus and GeneralPurposeIo: * There are three extra parameters that must be passed to the @@ -424,6 +417,15 @@ AcpiEvDetachRegion( Status = RegionSetup (RegionObj, ACPI_REGION_DEACTIVATE, HandlerObj->AddressSpace.Context, RegionContext); + /* + * RegionContext should have been released by the deactivate + * operation. We don't need access to it anymore here. + */ + if (RegionContext) + { + *RegionContext = NULL; + } + /* Init routine may fail, Just ignore errors */ if (ACPI_FAILURE (Status)) Modified: head/sys/contrib/dev/acpica/components/events/evsci.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evsci.c Fri Aug 23 23:21:24 2013 (r254744) +++ head/sys/contrib/dev/acpica/components/events/evsci.c Fri Aug 23 23:25:58 2013 (r254745) @@ -61,6 +61,57 @@ AcpiEvSciXruptHandler ( /******************************************************************************* * + * FUNCTION: AcpiEvSciDispatch + * + * PARAMETERS: None + * + * RETURN: Status code indicates whether interrupt was handled. + * + * DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers. + * + ******************************************************************************/ + +UINT32 +AcpiEvSciDispatch ( + void) +{ + ACPI_SCI_HANDLER_INFO *SciHandler; + ACPI_CPU_FLAGS Flags; + UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; + + + ACPI_FUNCTION_NAME (EvSciDispatch); + + + /* Are there any host-installed SCI handlers? */ + + if (!AcpiGbl_SciHandlerList) + { + return (IntStatus); + } + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + + /* Invoke all host-installed SCI handlers */ + + SciHandler = AcpiGbl_SciHandlerList; + while (SciHandler) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:34:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F27D54B; Fri, 23 Aug 2013 23:34:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6ABC32C17; Fri, 23 Aug 2013 23:34:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNYtKZ067410; Fri, 23 Aug 2013 23:34:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNYtRx067409; Fri, 23 Aug 2013 23:34:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232334.r7NNYtRx067409@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254746 - vendor/illumos/dist/lib/libctf/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:34:55 -0000 Author: delphij Date: Fri Aug 23 23:34:54 2013 New Revision: 254746 URL: http://svnweb.freebsd.org/changeset/base/254746 Log: Update vendor/illumos/dist to 14148:fe28bd725808: Illumos DTrace issues: 4005 libctf can't deal with extended sections Modified: vendor/illumos/dist/lib/libctf/common/ctf_lib.c Modified: vendor/illumos/dist/lib/libctf/common/ctf_lib.c ============================================================================== --- vendor/illumos/dist/lib/libctf/common/ctf_lib.c Fri Aug 23 23:25:58 2013 (r254745) +++ vendor/illumos/dist/lib/libctf/common/ctf_lib.c Fri Aug 23 23:34:54 2013 (r254746) @@ -193,6 +193,7 @@ ctf_fdopen(int fd, int *errp) { ctf_sect_t ctfsect, symsect, strsect; ctf_file_t *fp = NULL; + size_t shstrndx, shnum; struct stat64 st; ssize_t nbytes; @@ -255,11 +256,10 @@ ctf_fdopen(int fd, int *errp) #else uchar_t order = ELFDATA2LSB; #endif - GElf_Half i, n; GElf_Shdr *sp; void *strs_map; - size_t strs_mapsz; + size_t strs_mapsz, i; const char *strs; if (hdr.e32.e_ident[EI_DATA] != order) @@ -275,11 +275,38 @@ ctf_fdopen(int fd, int *errp) ehdr_to_gelf(&e32, &hdr.e64); } - if (hdr.e64.e_shstrndx >= hdr.e64.e_shnum) + shnum = hdr.e64.e_shnum; + shstrndx = hdr.e64.e_shstrndx; + + /* Extended ELF sections */ + if ((shstrndx == SHN_XINDEX) || (shnum == 0)) { + if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS32) { + Elf32_Shdr x32; + + if (pread64(fd, &x32, sizeof (x32), + hdr.e64.e_shoff) != sizeof (x32)) + return (ctf_set_open_errno(errp, + errno)); + + shnum = x32.sh_size; + shstrndx = x32.sh_link; + } else { + Elf64_Shdr x64; + + if (pread64(fd, &x64, sizeof (x64), + hdr.e64.e_shoff) != sizeof (x64)) + return (ctf_set_open_errno(errp, + errno)); + + shnum = x64.sh_size; + shstrndx = x64.sh_link; + } + } + + if (shstrndx >= shnum) return (ctf_set_open_errno(errp, ECTF_CORRUPT)); - n = hdr.e64.e_shnum; - nbytes = sizeof (GElf_Shdr) * n; + nbytes = sizeof (GElf_Shdr) * shnum; if ((sp = malloc(nbytes)) == NULL) return (ctf_set_open_errno(errp, errno)); @@ -291,7 +318,7 @@ ctf_fdopen(int fd, int *errp) if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS32) { Elf32_Shdr *sp32; - nbytes = sizeof (Elf32_Shdr) * n; + nbytes = sizeof (Elf32_Shdr) * shnum; if ((sp32 = malloc(nbytes)) == NULL || pread64(fd, sp32, nbytes, hdr.e64.e_shoff) != nbytes) { @@ -299,7 +326,7 @@ ctf_fdopen(int fd, int *errp) return (ctf_set_open_errno(errp, errno)); } - for (i = 0; i < n; i++) + for (i = 0; i < shnum; i++) shdr_to_gelf(&sp32[i], &sp[i]); free(sp32); @@ -313,14 +340,14 @@ ctf_fdopen(int fd, int *errp) * Now mmap the section header strings section so that we can * perform string comparison on the section names. */ - strs_mapsz = sp[hdr.e64.e_shstrndx].sh_size + - (sp[hdr.e64.e_shstrndx].sh_offset & ~_PAGEMASK); + strs_mapsz = sp[shstrndx].sh_size + + (sp[shstrndx].sh_offset & ~_PAGEMASK); strs_map = mmap64(NULL, strs_mapsz, PROT_READ, MAP_PRIVATE, - fd, sp[hdr.e64.e_shstrndx].sh_offset & _PAGEMASK); + fd, sp[shstrndx].sh_offset & _PAGEMASK); strs = (const char *)strs_map + - (sp[hdr.e64.e_shstrndx].sh_offset & ~_PAGEMASK); + (sp[shstrndx].sh_offset & ~_PAGEMASK); if (strs_map == MAP_FAILED) { free(sp); @@ -331,15 +358,15 @@ ctf_fdopen(int fd, int *errp) * Iterate over the section header array looking for the CTF * section and symbol table. The strtab is linked to symtab. */ - for (i = 0; i < n; i++) { + for (i = 0; i < shnum; i++) { const GElf_Shdr *shp = &sp[i]; const GElf_Shdr *lhp = &sp[shp->sh_link]; - if (shp->sh_link >= hdr.e64.e_shnum) + if (shp->sh_link >= shnum) continue; /* corrupt sh_link field */ - if (shp->sh_name >= sp[hdr.e64.e_shstrndx].sh_size || - lhp->sh_name >= sp[hdr.e64.e_shstrndx].sh_size) + if (shp->sh_name >= sp[shstrndx].sh_size || + lhp->sh_name >= sp[shstrndx].sh_size) continue; /* corrupt sh_name field */ if (shp->sh_type == SHT_PROGBITS && From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:36:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CDBA9670; Fri, 23 Aug 2013 23:36:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C2D02C1E; Fri, 23 Aug 2013 23:36:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNaTkx067923; Fri, 23 Aug 2013 23:36:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNaRv1067915; Fri, 23 Aug 2013 23:36:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232336.r7NNaRv1067915@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254747 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:36:29 -0000 Author: delphij Date: Fri Aug 23 23:36:27 2013 New Revision: 254747 URL: http://svnweb.freebsd.org/changeset/base/254747 Log: Update vendor-sys/illumos/dist to 14151:189ec27885ae: Illumos DTrace issues: 4047 panic from dbuf_free_range() from dmu_free_object() while doing zfs receive Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Aug 23 23:36:27 2013 (r254747) @@ -40,6 +40,12 @@ #include #include +/* + * Number of times that zfs_free_range() took the slow path while doing + * a zfs receive. A nonzero value indicates a potential performance problem. + */ +uint64_t zfs_free_range_recv_miss; + static void dbuf_destroy(dmu_buf_impl_t *db); static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx); static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx); @@ -819,20 +825,22 @@ dbuf_free_range(dnode_t *dn, uint64_t st } dprintf_dnode(dn, "start=%llu end=%llu\n", start, end); - if (dmu_objset_is_receiving(dn->dn_objset)) { + mutex_enter(&dn->dn_dbufs_mtx); + if (start >= dn->dn_unlisted_l0_blkid * dn->dn_datablksz) { + /* There can't be any dbufs in this range; no need to search. */ + mutex_exit(&dn->dn_dbufs_mtx); + return; + } else if (dmu_objset_is_receiving(dn->dn_objset)) { /* - * When processing a free record from a zfs receive, - * there should have been no previous modifications to the - * data in this range. Therefore there should be no dbufs - * in the range. Searching dn_dbufs for these non-existent - * dbufs can be very expensive, so simply ignore this. + * If we are receiving, we expect there to be no dbufs in + * the range to be freed, because receive modifies each + * block at most once, and in offset order. If this is + * not the case, it can lead to performance problems, + * so note that we unexpectedly took the slow path. */ - VERIFY3P(dbuf_find(dn, 0, start), ==, NULL); - VERIFY3P(dbuf_find(dn, 0, end), ==, NULL); - return; + atomic_inc_64(&zfs_free_range_recv_miss); } - mutex_enter(&dn->dn_dbufs_mtx); for (db = list_head(&dn->dn_dbufs); db; db = db_next) { db_next = list_next(&dn->dn_dbufs, db); ASSERT(db->db_blkid != DMU_BONUS_BLKID); @@ -1720,6 +1728,9 @@ dbuf_create(dnode_t *dn, uint8_t level, return (odb); } list_insert_head(&dn->dn_dbufs, db); + if (db->db_level == 0 && db->db_blkid >= + dn->dn_unlisted_l0_blkid) + dn->dn_unlisted_l0_blkid = db->db_blkid + 1; db->db_state = DB_UNCACHED; mutex_exit(&dn->dn_dbufs_mtx); arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_OTHER); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Fri Aug 23 23:36:27 2013 (r254747) @@ -569,98 +569,93 @@ dmu_prefetch(objset_t *os, uint64_t obje * the end so that the file gets shorter over time (if we crashes in the * middle, this will leave us in a better state). We find allocated file * data by simply searching the allocated level 1 indirects. + * + * On input, *start should be the first offset that does not need to be + * freed (e.g. "offset + length"). On return, *start will be the first + * offset that should be freed. */ static int -get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t limit) +get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum) { - uint64_t len = *start - limit; - uint64_t blkcnt = 0; - uint64_t maxblks = DMU_MAX_ACCESS / (1ULL << (dn->dn_indblkshift + 1)); + uint64_t maxblks = DMU_MAX_ACCESS >> (dn->dn_indblkshift + 1); + /* bytes of data covered by a level-1 indirect block */ uint64_t iblkrange = dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT); - ASSERT(limit <= *start); + ASSERT3U(minimum, <=, *start); - if (len <= iblkrange * maxblks) { - *start = limit; + if (*start - minimum <= iblkrange * maxblks) { + *start = minimum; return (0); } ASSERT(ISP2(iblkrange)); - while (*start > limit && blkcnt < maxblks) { + for (uint64_t blks = 0; *start > minimum && blks < maxblks; blks++) { int err; - /* find next allocated L1 indirect */ + /* + * dnode_next_offset(BACKWARDS) will find an allocated L1 + * indirect block at or before the input offset. We must + * decrement *start so that it is at the end of the region + * to search. + */ + (*start)--; err = dnode_next_offset(dn, DNODE_FIND_BACKWARDS, start, 2, 1, 0); - /* if there are no more, then we are done */ + /* if there are no indirect blocks before start, we are done */ if (err == ESRCH) { - *start = limit; - return (0); - } else if (err) { + *start = minimum; + break; + } else if (err != 0) { return (err); } - blkcnt += 1; - /* reset offset to end of "next" block back */ + /* set start to the beginning of this L1 indirect */ *start = P2ALIGN(*start, iblkrange); - if (*start <= limit) - *start = limit; - else - *start -= 1; } + if (*start < minimum) + *start = minimum; return (0); } static int dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset, - uint64_t length, boolean_t free_dnode) + uint64_t length) { - dmu_tx_t *tx; - uint64_t object_size, start, end, len; - boolean_t trunc = (length == DMU_OBJECT_END); - int align, err; - - align = 1 << dn->dn_datablkshift; - ASSERT(align > 0); - object_size = align == 1 ? dn->dn_datablksz : - (dn->dn_maxblkid + 1) << dn->dn_datablkshift; - - end = offset + length; - if (trunc || end > object_size) - end = object_size; - if (end <= offset) + uint64_t object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz; + int err; + + if (offset >= object_size) return (0); - length = end - offset; - while (length) { - start = end; - /* assert(offset <= start) */ - err = get_next_chunk(dn, &start, offset); + if (length == DMU_OBJECT_END || offset + length > object_size) + length = object_size - offset; + + while (length != 0) { + uint64_t chunk_end, chunk_begin; + + chunk_end = chunk_begin = offset + length; + + /* move chunk_begin backwards to the beginning of this chunk */ + err = get_next_chunk(dn, &chunk_begin, offset); if (err) return (err); - len = trunc ? DMU_OBJECT_END : end - start; + ASSERT3U(chunk_begin, >=, offset); + ASSERT3U(chunk_begin, <=, chunk_end); - tx = dmu_tx_create(os); - dmu_tx_hold_free(tx, dn->dn_object, start, len); + dmu_tx_t *tx = dmu_tx_create(os); + dmu_tx_hold_free(tx, dn->dn_object, + chunk_begin, chunk_end - chunk_begin); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); return (err); } - - dnode_free_range(dn, start, trunc ? -1 : len, tx); - - if (start == 0 && free_dnode) { - ASSERT(trunc); - dnode_free(dn, tx); - } - - length -= end - start; - + dnode_free_range(dn, chunk_begin, chunk_end - chunk_begin, tx); dmu_tx_commit(tx); - end = start; + + length -= chunk_end - chunk_begin; } return (0); } @@ -675,38 +670,32 @@ dmu_free_long_range(objset_t *os, uint64 err = dnode_hold(os, object, FTAG, &dn); if (err != 0) return (err); - err = dmu_free_long_range_impl(os, dn, offset, length, FALSE); + err = dmu_free_long_range_impl(os, dn, offset, length); dnode_rele(dn, FTAG); return (err); } int -dmu_free_object(objset_t *os, uint64_t object) +dmu_free_long_object(objset_t *os, uint64_t object) { - dnode_t *dn; dmu_tx_t *tx; int err; - err = dnode_hold_impl(os, object, DNODE_MUST_BE_ALLOCATED, - FTAG, &dn); + err = dmu_free_long_range(os, object, 0, DMU_OBJECT_END); if (err != 0) return (err); - if (dn->dn_nlevels == 1) { - tx = dmu_tx_create(os); - dmu_tx_hold_bonus(tx, object); - dmu_tx_hold_free(tx, dn->dn_object, 0, DMU_OBJECT_END); - err = dmu_tx_assign(tx, TXG_WAIT); - if (err == 0) { - dnode_free_range(dn, 0, DMU_OBJECT_END, tx); - dnode_free(dn, tx); - dmu_tx_commit(tx); - } else { - dmu_tx_abort(tx); - } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, object); + dmu_tx_hold_free(tx, object, 0, DMU_OBJECT_END); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err == 0) { + err = dmu_object_free(os, object, tx); + dmu_tx_commit(tx); } else { - err = dmu_free_long_range_impl(os, dn, 0, DMU_OBJECT_END, TRUE); + dmu_tx_abort(tx); } - dnode_rele(dn, FTAG); + return (err); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Fri Aug 23 23:36:27 2013 (r254747) @@ -1232,7 +1232,7 @@ restore_freeobjects(struct restorearg *r if (dmu_object_info(os, obj, NULL) != 0) continue; - err = dmu_free_object(os, obj); + err = dmu_free_long_object(os, obj); if (err != 0) return (err); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Fri Aug 23 23:36:27 2013 (r254747) @@ -615,7 +615,8 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t * if they are blocksize-aligned. */ if (dn->dn_datablkshift == 0) { - dmu_tx_count_write(txh, off, len); + if (off != 0 || len < dn->dn_datablksz) + dmu_tx_count_write(txh, off, len); } else { /* first block will be modified if it is not aligned */ if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift)) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Fri Aug 23 23:36:27 2013 (r254747) @@ -115,6 +115,7 @@ dnode_cons(void *arg, void *unused, int dn->dn_id_flags = 0; dn->dn_dbufs_count = 0; + dn->dn_unlisted_l0_blkid = 0; list_create(&dn->dn_dbufs, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); @@ -167,6 +168,7 @@ dnode_dest(void *arg, void *unused) ASSERT0(dn->dn_id_flags); ASSERT0(dn->dn_dbufs_count); + ASSERT0(dn->dn_unlisted_l0_blkid); list_destroy(&dn->dn_dbufs); } @@ -472,6 +474,7 @@ dnode_destroy(dnode_t *dn) dn->dn_newuid = 0; dn->dn_newgid = 0; dn->dn_id_flags = 0; + dn->dn_unlisted_l0_blkid = 0; dmu_zfetch_rele(&dn->dn_zfetch); kmem_cache_free(dnode_cache, dn); @@ -702,6 +705,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n ASSERT(list_is_empty(&ndn->dn_dbufs)); list_move_tail(&ndn->dn_dbufs, &odn->dn_dbufs); ndn->dn_dbufs_count = odn->dn_dbufs_count; + ndn->dn_unlisted_l0_blkid = odn->dn_unlisted_l0_blkid; ndn->dn_bonus = odn->dn_bonus; ndn->dn_have_spill = odn->dn_have_spill; ndn->dn_zio = odn->dn_zio; @@ -736,6 +740,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n list_create(&odn->dn_dbufs, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); odn->dn_dbufs_count = 0; + odn->dn_unlisted_l0_blkid = 0; odn->dn_bonus = NULL; odn->dn_zfetch.zf_dnode = NULL; @@ -1523,7 +1528,7 @@ dnode_free_range(dnode_t *dn, uint64_t o blkshift = dn->dn_datablkshift; epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - if (len == -1ULL) { + if (len == DMU_OBJECT_END) { len = UINT64_MAX - off; trunc = TRUE; } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Fri Aug 23 23:36:27 2013 (r254747) @@ -896,7 +896,7 @@ dsl_destroy_head(const char *name) for (uint64_t obj = 0; error == 0; error = dmu_object_next(os, &obj, FALSE, prev_snap_txg)) - (void) dmu_free_object(os, obj); + (void) dmu_free_long_object(os, obj); /* sync out all frees */ txg_wait_synced(dmu_objset_pool(os), 0); dmu_objset_disown(os, FTAG); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Fri Aug 23 23:36:27 2013 (r254747) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -581,7 +581,7 @@ int dmu_free_range(objset_t *os, uint64_ uint64_t size, dmu_tx_t *tx); int dmu_free_long_range(objset_t *os, uint64_t object, uint64_t offset, uint64_t size); -int dmu_free_object(objset_t *os, uint64_t object); +int dmu_free_long_object(objset_t *os, uint64_t object); /* * Convenience functions. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Fri Aug 23 23:34:54 2013 (r254746) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Fri Aug 23 23:36:27 2013 (r254747) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_DNODE_H @@ -188,6 +188,8 @@ typedef struct dnode { /* protected by dn_dbufs_mtx; declared here to fill 32-bit hole */ uint32_t dn_dbufs_count; /* count of dn_dbufs */ + /* There are no level-0 blocks of this blkid or higher in dn_dbufs */ + uint64_t dn_unlisted_l0_blkid; /* protected by os_lock: */ list_node_t dn_dirty_link[TXG_SIZE]; /* next on dataset's dirty */ From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:37:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 72FDB7B0; Fri, 23 Aug 2013 23:37:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD9B2C32; Fri, 23 Aug 2013 23:37:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNbuwi068406; Fri, 23 Aug 2013 23:37:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNbuTX068405; Fri, 23 Aug 2013 23:37:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232337.r7NNbuTX068405@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254748 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:37:56 -0000 Author: delphij Date: Fri Aug 23 23:37:55 2013 New Revision: 254748 URL: http://svnweb.freebsd.org/changeset/base/254748 Log: Update vendor/illumos/dist to 14152:46f5fb0b0d36: Illumos DTrace issues: 4061 libzfs: memory leak in iter_dependents_cb() Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Fri Aug 23 23:36:27 2013 (r254747) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c Fri Aug 23 23:37:55 2013 (r254748) @@ -21,8 +21,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -443,8 +443,12 @@ iter_dependents_cb(zfs_handle_t *zhp, vo err = zfs_iter_snapshots(zhp, iter_dependents_cb, ida); ida->stack = isf.next; } + if (!first && err == 0) err = ida->func(zhp, ida->data); + else + zfs_close(zhp); + return (err); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:40:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 761FB990; Fri, 23 Aug 2013 23:40:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5437D2C59; Fri, 23 Aug 2013 23:40:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNeQeX070645; Fri, 23 Aug 2013 23:40:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNePE1070642; Fri, 23 Aug 2013 23:40:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232340.r7NNePE1070642@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254749 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:40:26 -0000 Author: delphij Date: Fri Aug 23 23:40:25 2013 New Revision: 254749 URL: http://svnweb.freebsd.org/changeset/base/254749 Log: Update vendor-sys/illumos/dist to 14157:85f7bb2246ca: Illumos ZFS issues: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Fri Aug 23 23:37:55 2013 (r254748) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Fri Aug 23 23:40:25 2013 (r254749) @@ -100,9 +100,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds used, compressed, uncompressed); return; } - dmu_buf_will_dirty(ds->ds_dbuf, tx); - mutex_enter(&ds->ds_dir->dd_lock); + dmu_buf_will_dirty(ds->ds_dbuf, tx); mutex_enter(&ds->ds_lock); delta = parent_delta(ds, used); ds->ds_phys->ds_referenced_bytes += used; @@ -114,7 +113,6 @@ dsl_dataset_block_born(dsl_dataset_t *ds compressed, uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } int @@ -149,7 +147,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); - mutex_enter(&ds->ds_dir->dd_lock); mutex_enter(&ds->ds_lock); ASSERT(ds->ds_phys->ds_unique_bytes >= used || !DS_UNIQUE_IS_ACCURATE(ds)); @@ -160,7 +157,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds delta, -compressed, -uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, -used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } else { dprintf_bp(bp, "putting on dead list: %s", ""); if (async) { @@ -591,31 +587,6 @@ dsl_dataset_name(dsl_dataset_t *ds, char } } -static int -dsl_dataset_namelen(dsl_dataset_t *ds) -{ - int result; - - if (ds == NULL) { - result = 3; /* "mos" */ - } else { - result = dsl_dir_namelen(ds->ds_dir); - VERIFY0(dsl_dataset_get_snapname(ds)); - if (ds->ds_snapname[0]) { - ++result; /* adding one for the @-sign */ - if (!MUTEX_HELD(&ds->ds_lock)) { - mutex_enter(&ds->ds_lock); - result += strlen(ds->ds_snapname); - mutex_exit(&ds->ds_lock); - } else { - result += strlen(ds->ds_snapname); - } - } - } - - return (result); -} - void dsl_dataset_rele(dsl_dataset_t *ds, void *tag) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Fri Aug 23 23:37:55 2013 (r254748) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c Fri Aug 23 23:40:25 2013 (r254749) @@ -841,11 +841,21 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u int64_t used, int64_t compressed, int64_t uncompressed, dmu_tx_t *tx) { int64_t accounted_delta; + + /* + * dsl_dataset_set_refreservation_sync_impl() calls this with + * dd_lock held, so that it can atomically update + * ds->ds_reserved and the dsl_dir accounting, so that + * dsl_dataset_check_quota() can see dataset and dir accounting + * consistently. + */ boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -854,7 +864,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -887,8 +896,6 @@ void dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta, dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx) { - boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); - ASSERT(dmu_tx_is_syncing(tx)); ASSERT(oldtype < DD_USED_NUM); ASSERT(newtype < DD_USED_NUM); @@ -896,17 +903,15 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - if (needlock) - mutex_enter(&dd->dd_lock); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; - if (needlock) - mutex_exit(&dd->dd_lock); + mutex_exit(&dd->dd_lock); } typedef struct dsl_dir_set_qr_arg { From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:46:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 17ABCAE6; Fri, 23 Aug 2013 23:46:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 023BB2C9B; Fri, 23 Aug 2013 23:46:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNkRDT072967; Fri, 23 Aug 2013 23:46:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNkRqk072964; Fri, 23 Aug 2013 23:46:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232346.r7NNkRqk072964@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254750 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/lib/libzfs/common vendor/illumos... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:46:28 -0000 Author: delphij Date: Fri Aug 23 23:46:27 2013 New Revision: 254750 URL: http://svnweb.freebsd.org/changeset/base/254750 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to 14159:dc75c925d8aa: Illumos ZFS issues: 2932 support crash dumps to raidz, etc. pools Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/man/man1m/zfs.1m vendor/illumos/dist/man/man5/zpool-features.5 Changes in other areas also in this revision: Added: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_raidz.h (contents, props changed) Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Fri Aug 23 23:46:27 2013 (r254750) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -3958,9 +3959,7 @@ supported_dump_vdev_type(libzfs_handle_t uint_t children, c; verify(nvlist_lookup_string(config, ZPOOL_CONFIG_TYPE, &type) == 0); - if (strcmp(type, VDEV_TYPE_RAIDZ) == 0 || - strcmp(type, VDEV_TYPE_FILE) == 0 || - strcmp(type, VDEV_TYPE_LOG) == 0 || + if (strcmp(type, VDEV_TYPE_FILE) == 0 || strcmp(type, VDEV_TYPE_HOLE) == 0 || strcmp(type, VDEV_TYPE_MISSING) == 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -3979,8 +3978,12 @@ supported_dump_vdev_type(libzfs_handle_t } /* - * check if this zvol is allowable for use as a dump device; zero if - * it is, > 0 if it isn't, < 0 if it isn't a zvol + * Check if this zvol is allowable for use as a dump device; zero if + * it is, > 0 if it isn't, < 0 if it isn't a zvol. + * + * Allowable storage configurations include mirrors, all raidz variants, and + * pools with log, cache, and spare devices. Pools which are backed by files or + * have missing/hole vdevs are not suitable. */ int zvol_check_dump_config(char *arg) @@ -4042,12 +4045,6 @@ zvol_check_dump_config(char *arg) verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &top, &toplevels) == 0); - if (toplevels != 1) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "'%s' has multiple top level vdevs"), poolname); - (void) zfs_error(hdl, EZFS_DEVOVERFLOW, errbuf); - goto out; - } if (!supported_dump_vdev_type(hdl, top[0], errbuf)) { goto out; Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Fri Aug 23 23:40:25 2013 (r254749) +++ vendor/illumos/dist/man/man1m/zfs.1m Fri Aug 23 23:46:27 2013 (r254750) @@ -23,9 +23,9 @@ .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011 Joshua M. Clulow .\" Copyright (c) 2012 by Delphix. All rights reserved. -.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright 2013 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .TH ZFS 1M "Jan 26, 2013" .SH NAME @@ -106,7 +106,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] +\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...] [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fBall\fR | \fIproperty\fR[,\fIproperty\fR]... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR... .fi @@ -934,15 +934,18 @@ This property is not inherited. .ne 2 .na \fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2\fR | \fBfletcher4\fR | -\fBsha256\fR\fR +\fBsha256\fR | \fBnoparity\fR \fR .ad .sp .6 .RS 4n Controls the checksum used to verify data integrity. The default value is \fBon\fR, which automatically selects an appropriate algorithm (currently, \fBfletcher4\fR, but this may change in future releases). The value \fBoff\fR -disables integrity checking on user data. Disabling checksums is \fBNOT\fR a -recommended practice. +disables integrity checking on user data. The value \fBnoparity\fR not only +disables integrity but also disables maintaining parity for user data. This +setting is used internally by a dump device residing on a RAID-Z pool and should +not be used by any other dataset. Disabling checksums is \fBNOT\fR a recommended +practice. .sp Changing this property affects only newly-written data. .RE Modified: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- vendor/illumos/dist/man/man5/zpool-features.5 Fri Aug 23 23:40:25 2013 (r254749) +++ vendor/illumos/dist/man/man5/zpool-features.5 Fri Aug 23 23:46:27 2013 (r254750) @@ -1,6 +1,7 @@ '\" te .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" The contents of this file are subject to the terms of the Common Development .\" and Distribution License (the "License"). You may not use this file except .\" in compliance with the License. You can obtain a copy of the license at @@ -231,5 +232,26 @@ moment, this operation cannot be reverse .RE +.sp +.ne 2 +.na +\fB\fBmulti_vdev_crash_dump\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.joyent:multi_vdev_crash_dump +READ\-ONLY COMPATIBLE no +DEPENDENCIES none +.TE + +This feature allows a dump device to be configured with a pool comprised +of multiple vdevs. Those vdevs may be arranged in any mirrored or raidz +configuration. + +When the \fBmulti_vdev_crash_dump\fR feature is set to \fBenabled\fR, +the administrator can use the \fBdumpadm\fR(1M) command to configure a +dump device on a pool comprised of multiple vdevs. + .SH "SEE ALSO" \fBzpool\fR(1M) From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:46:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4C65AE7; Fri, 23 Aug 2013 23:46:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6EC2C9C; Fri, 23 Aug 2013 23:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNkUX6072990; Fri, 23 Aug 2013 23:46:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNkSLO072973; Fri, 23 Aug 2013 23:46:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232346.r7NNkSLO072973@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254750 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/lib/libzfs/common vendor/illumos... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:46:30 -0000 Author: delphij Date: Fri Aug 23 23:46:27 2013 New Revision: 254750 URL: http://svnweb.freebsd.org/changeset/base/254750 Log: Update vendor/illumos/dist and vendor-sys/illumos/dist to 14159:dc75c925d8aa: Illumos ZFS issues: 2932 support crash dumps to raidz, etc. pools Added: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_raidz.h (contents, props changed) Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c vendor/illumos/dist/man/man1m/zfs.1m vendor/illumos/dist/man/man5/zpool-features.5 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Fri Aug 23 23:46:27 2013 (r254750) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifdef _KERNEL @@ -160,4 +161,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", + "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); } Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.h Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Fri Aug 23 23:46:27 2013 (r254750) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _ZFEATURE_COMMON_H @@ -54,6 +55,7 @@ enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, SPA_FEATURES } spa_feature_t; Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_prop.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/common/zfs/zfs_prop.c Fri Aug 23 23:46:27 2013 (r254750) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -69,6 +70,7 @@ zfs_prop_init(void) { "fletcher2", ZIO_CHECKSUM_FLETCHER_2 }, { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 }, { "sha256", ZIO_CHECKSUM_SHA256 }, + { "noparity", ZIO_CHECKSUM_NOPARITY }, { NULL } }; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Aug 23 23:46:27 2013 (r254750) @@ -23,6 +23,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -2751,7 +2752,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { - ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); + ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF || + zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, db->db_blkptr, NULL, db->db.db_size, &zp, dbuf_write_nofill_ready, dbuf_write_nofill_done, db, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Fri Aug 23 23:46:27 2013 (r254750) @@ -22,8 +22,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. */ - /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ +/* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include #include @@ -1597,7 +1597,7 @@ dmu_write_policy(objset_t *os, dnode_t * * pipeline. */ compress = ZIO_COMPRESS_OFF; - checksum = ZIO_CHECKSUM_OFF; + checksum = ZIO_CHECKSUM_NOPARITY; } else { compress = zio_compress_select(dn->dn_compress, compress); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_disk.h Fri Aug 23 23:46:27 2013 (r254750) @@ -21,13 +21,12 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ #ifndef _SYS_VDEV_DISK_H #define _SYS_VDEV_DISK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef _KERNEL #include @@ -40,14 +39,23 @@ extern "C" { #endif +#ifdef _KERNEL typedef struct vdev_disk { ddi_devid_t vd_devid; char *vd_minor; ldi_handle_t vd_lh; } vdev_disk_t; +#endif +extern int vdev_disk_physio(vdev_t *, + caddr_t, size_t, uint64_t, int, boolean_t); + +/* + * Since vdev_disk.c is not compiled into libzpool, this function should only be + * defined in the zfs kernel module. + */ #ifdef _KERNEL -extern int vdev_disk_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int); +extern int vdev_disk_ldi_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int); #endif #ifdef __cplusplus } Added: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_raidz.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_raidz.h Fri Aug 23 23:46:27 2013 (r254750) @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ + +#ifndef _SYS_VDEV_RAIDZ_H +#define _SYS_VDEV_RAIDZ_H + +#include +#include +#ifdef _KERNEL +#include +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _KERNEL +extern int vdev_raidz_physio(vdev_t *, + caddr_t, size_t, uint64_t, uint64_t, boolean_t, boolean_t); +#endif +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_VDEV_RAIDZ_H */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Fri Aug 23 23:46:27 2013 (r254750) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _ZIO_H @@ -79,6 +80,7 @@ enum zio_checksum { ZIO_CHECKSUM_FLETCHER_4, ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, + ZIO_CHECKSUM_NOPARITY, ZIO_CHECKSUM_FUNCTIONS }; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Fri Aug 23 23:46:27 2013 (r254750) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2013 Joyent, Inc. All rights reserved. */ #include @@ -426,8 +427,29 @@ vdev_disk_close(vdev_t *vd) } int -vdev_disk_physio(ldi_handle_t vd_lh, caddr_t data, size_t size, - uint64_t offset, int flags) +vdev_disk_physio(vdev_t *vd, caddr_t data, + size_t size, uint64_t offset, int flags, boolean_t isdump) +{ + vdev_disk_t *dvd = vd->vdev_tsd; + + ASSERT(vd->vdev_ops == &vdev_disk_ops); + + /* + * If in the context of an active crash dump, use the ldi_dump(9F) + * call instead of ldi_strategy(9F) as usual. + */ + if (isdump) { + ASSERT3P(dvd, !=, NULL); + return (ldi_dump(dvd->vd_lh, data, lbtodb(offset), + lbtodb(size))); + } + + return (vdev_disk_ldi_physio(dvd->vd_lh, data, size, offset, flags)); +} + +int +vdev_disk_ldi_physio(ldi_handle_t vd_lh, caddr_t data, + size_t size, uint64_t offset, int flags) { buf_t *bp; int error = 0; @@ -675,7 +697,7 @@ vdev_disk_read_rootlabel(char *devpath, /* read vdev label */ offset = vdev_label_offset(size, l, 0); - if (vdev_disk_physio(vd_lh, (caddr_t)label, + if (vdev_disk_ldi_physio(vd_lh, (caddr_t)label, VDEV_SKIP_SIZE + VDEV_PHYS_SIZE, offset, B_READ) != 0) continue; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c Fri Aug 23 23:46:27 2013 (r254750) @@ -22,11 +22,15 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include #include #include +#include +#include +#include #include #include #include @@ -154,6 +158,8 @@ typedef struct raidz_map { VDEV_RAIDZ_64MUL_2((x), mask); \ } +#define VDEV_LABEL_OFFSET(x) (x + VDEV_LABEL_START_SIZE) + /* * Force reconstruction to use the general purpose method. */ @@ -435,14 +441,14 @@ static const zio_vsd_ops_t vdev_raidz_vs * the number of children in the target vdev. */ static raidz_map_t * -vdev_raidz_map_alloc(zio_t *zio, uint64_t unit_shift, uint64_t dcols, - uint64_t nparity) +vdev_raidz_map_alloc(caddr_t data, uint64_t size, uint64_t offset, + uint64_t unit_shift, uint64_t dcols, uint64_t nparity) { raidz_map_t *rm; /* The starting RAIDZ (parent) vdev sector of the block. */ - uint64_t b = zio->io_offset >> unit_shift; + uint64_t b = offset >> unit_shift; /* The zio's size in units of the vdev's minimum sector size. */ - uint64_t s = zio->io_size >> unit_shift; + uint64_t s = size >> unit_shift; /* The first column for this stripe. */ uint64_t f = b % dcols; /* The starting byte offset on each child vdev. */ @@ -533,7 +539,7 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ for (c = 0; c < rm->rm_firstdatacol; c++) rm->rm_col[c].rc_data = zio_buf_alloc(rm->rm_col[c].rc_size); - rm->rm_col[c].rc_data = zio->io_data; + rm->rm_col[c].rc_data = data; for (c = c + 1; c < acols; c++) rm->rm_col[c].rc_data = (char *)rm->rm_col[c - 1].rc_data + @@ -562,7 +568,7 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT(rm->rm_cols >= 2); ASSERT(rm->rm_col[0].rc_size == rm->rm_col[1].rc_size); - if (rm->rm_firstdatacol == 1 && (zio->io_offset & (1ULL << 20))) { + if (rm->rm_firstdatacol == 1 && (offset & (1ULL << 20))) { devidx = rm->rm_col[0].rc_devidx; o = rm->rm_col[0].rc_offset; rm->rm_col[0].rc_devidx = rm->rm_col[1].rc_devidx; @@ -574,8 +580,6 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ rm->rm_skipstart = 1; } - zio->io_vsd = rm; - zio->io_vsd_ops = &vdev_raidz_vsd_ops; return (rm); } @@ -985,12 +989,9 @@ vdev_raidz_reconstruct_pq(raidz_map_t *r * ~~ ~~ * __ __ * | 1 1 1 1 1 1 1 1 | - * | 128 64 32 16 8 4 2 1 | * | 19 205 116 29 64 16 4 1 | * | 1 0 0 0 0 0 0 0 | - * | 0 1 0 0 0 0 0 0 | - * (V|I)' = | 0 0 1 0 0 0 0 0 | - * | 0 0 0 1 0 0 0 0 | + * (V|I)' = | 0 0 0 1 0 0 0 0 | * | 0 0 0 0 1 0 0 0 | * | 0 0 0 0 0 1 0 0 | * | 0 0 0 0 0 0 1 0 | @@ -1522,6 +1523,152 @@ vdev_raidz_close(vdev_t *vd) vdev_close(vd->vdev_child[c]); } +/* + * Handle a read or write I/O to a RAID-Z dump device. + * + * The dump device is in a unique situation compared to other ZFS datasets: + * writing to this device should be as simple and fast as possible. In + * addition, durability matters much less since the dump will be extracted + * once the machine reboots. For that reason, this function eschews parity for + * performance and simplicity. The dump device uses the checksum setting + * ZIO_CHECKSUM_NOPARITY to indicate that parity is not maintained for this + * dataset. + * + * Blocks of size 128 KB have been preallocated for this volume. I/Os less than + * 128 KB will not fill an entire block; in addition, they may not be properly + * aligned. In that case, this function uses the preallocated 128 KB block and + * omits reading or writing any "empty" portions of that block, as opposed to + * allocating a fresh appropriately-sized block. + * + * Looking at an example of a 32 KB I/O to a RAID-Z vdev with 5 child vdevs: + * + * vdev_raidz_io_start(data, size: 32 KB, offset: 64 KB) + * + * If this were a standard RAID-Z dataset, a block of at least 40 KB would be + * allocated which spans all five child vdevs. 8 KB of data would be written to + * each of four vdevs, with the fifth containing the parity bits. + * + * parity data data data data + * | PP | XX | XX | XX | XX | + * ^ ^ ^ ^ ^ + * | | | | | + * 8 KB parity ------8 KB data blocks------ + * + * However, when writing to the dump device, the behavior is different: + * + * vdev_raidz_physio(data, size: 32 KB, offset: 64 KB) + * + * Unlike the normal RAID-Z case in which the block is allocated based on the + * I/O size, reads and writes here always use a 128 KB logical I/O size. If the + * I/O size is less than 128 KB, only the actual portions of data are written. + * In this example the data is written to the third data vdev since that vdev + * contains the offset [64 KB, 96 KB). + * + * parity data data data data + * | | | | XX | | + * ^ + * | + * 32 KB data block + * + * As a result, an individual I/O may not span all child vdevs; moreover, a + * small I/O may only operate on a single child vdev. + * + * Note that since there are no parity bits calculated or written, this format + * remains the same no matter how many parity bits are used in a normal RAID-Z + * stripe. On a RAID-Z3 configuration with seven child vdevs, the example above + * would look like: + * + * parity parity parity data data data data + * | | | | | | XX | | + * ^ + * | + * 32 KB data block + */ +int +vdev_raidz_physio(vdev_t *vd, caddr_t data, size_t size, + uint64_t offset, uint64_t origoffset, boolean_t doread, boolean_t isdump) +{ + vdev_t *tvd = vd->vdev_top; + vdev_t *cvd; + raidz_map_t *rm; + raidz_col_t *rc; + int c, err = 0; + + uint64_t start, end, colstart, colend; + uint64_t coloffset, colsize, colskip; + + int flags = doread ? B_READ : B_WRITE; + +#ifdef _KERNEL + + /* + * Don't write past the end of the block + */ + VERIFY3U(offset + size, <=, origoffset + SPA_MAXBLOCKSIZE); + + start = offset; + end = start + size; + + /* + * Allocate a RAID-Z map for this block. Note that this block starts + * from the "original" offset, this is, the offset of the extent which + * contains the requisite offset of the data being read or written. + * + * Even if this I/O operation doesn't span the full block size, let's + * treat the on-disk format as if the only blocks are the complete 128 + * KB size. + */ + rm = vdev_raidz_map_alloc(data - (offset - origoffset), + SPA_MAXBLOCKSIZE, origoffset, tvd->vdev_ashift, vd->vdev_children, + vd->vdev_nparity); + + coloffset = origoffset; + + for (c = rm->rm_firstdatacol; c < rm->rm_cols; + c++, coloffset += rc->rc_size) { + rc = &rm->rm_col[c]; + cvd = vd->vdev_child[rc->rc_devidx]; + + /* + * Find the start and end of this column in the RAID-Z map, + * keeping in mind that the stated size and offset of the + * operation may not fill the entire column for this vdev. + * + * If any portion of the data spans this column, issue the + * appropriate operation to the vdev. + */ + if (coloffset + rc->rc_size <= start) + continue; + if (coloffset >= end) + continue; + + colstart = MAX(coloffset, start); + colend = MIN(end, coloffset + rc->rc_size); + colsize = colend - colstart; + colskip = colstart - coloffset; + + VERIFY3U(colsize, <=, rc->rc_size); + VERIFY3U(colskip, <=, rc->rc_size); + + /* + * Note that the child vdev will have a vdev label at the start + * of its range of offsets, hence the need for + * VDEV_LABEL_OFFSET(). See zio_vdev_child_io() for another + * example of why this calculation is needed. + */ + if ((err = vdev_disk_physio(cvd, + ((char *)rc->rc_data) + colskip, colsize, + VDEV_LABEL_OFFSET(rc->rc_offset) + colskip, + flags, isdump)) != 0) + break; + } + + vdev_raidz_map_free(rm); +#endif /* KERNEL */ + + return (err); +} + static uint64_t vdev_raidz_asize(vdev_t *vd, uint64_t psize) { @@ -1574,9 +1721,13 @@ vdev_raidz_io_start(zio_t *zio) raidz_col_t *rc; int c, i; - rm = vdev_raidz_map_alloc(zio, tvd->vdev_ashift, vd->vdev_children, + rm = vdev_raidz_map_alloc(zio->io_data, zio->io_size, zio->io_offset, + tvd->vdev_ashift, vd->vdev_children, vd->vdev_nparity); + zio->io_vsd = rm; + zio->io_vsd_ops = &vdev_raidz_vsd_ops; + ASSERT3U(rm->rm_asize, ==, vdev_psize_to_asize(vd, zio->io_size)); if (zio->io_type == ZIO_TYPE_WRITE) { @@ -1707,6 +1858,13 @@ raidz_parity_verify(zio_t *zio, raidz_ma int c, ret = 0; raidz_col_t *rc; + blkptr_t *bp = zio->io_bp; + enum zio_checksum checksum = (bp == NULL ? zio->io_prop.zp_checksum : + (BP_IS_GANG(bp) ? ZIO_CHECKSUM_GANG_HEADER : BP_GET_CHECKSUM(bp))); + + if (checksum == ZIO_CHECKSUM_NOPARITY) + return (ret); + for (c = 0; c < rm->rm_firstdatacol; c++) { rc = &rm->rm_col[c]; if (!rc->rc_tried || rc->rc_error != 0) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio_checksum.c Fri Aug 23 23:46:27 2013 (r254750) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -78,6 +79,7 @@ zio_checksum_info_t zio_checksum_table[Z {{fletcher_4_native, fletcher_4_byteswap}, 1, 0, 0, "fletcher4"}, {{zio_checksum_SHA256, zio_checksum_SHA256}, 1, 0, 1, "sha256"}, {{fletcher_4_native, fletcher_4_byteswap}, 0, 1, 0, "zilog2"}, + {{zio_checksum_off, zio_checksum_off}, 0, 0, 0, "noparity"}, }; enum zio_checksum Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Fri Aug 23 23:40:25 2013 (r254749) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Fri Aug 23 23:46:27 2013 (r254750) @@ -25,6 +25,7 @@ * * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* @@ -54,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -77,10 +79,14 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include #include "zfs_namecheck.h" @@ -1101,27 +1107,28 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_ } static int -zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t size, - boolean_t doread, boolean_t isdump) +zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t origoffset, + uint64_t size, boolean_t doread, boolean_t isdump) { vdev_disk_t *dvd; int c; int numerrors = 0; - for (c = 0; c < vd->vdev_children; c++) { - ASSERT(vd->vdev_ops == &vdev_mirror_ops || - vd->vdev_ops == &vdev_replacing_ops || - vd->vdev_ops == &vdev_spare_ops); - int err = zvol_dumpio_vdev(vd->vdev_child[c], - addr, offset, size, doread, isdump); - if (err != 0) { - numerrors++; - } else if (doread) { - break; + if (vd->vdev_ops == &vdev_mirror_ops || + vd->vdev_ops == &vdev_replacing_ops || + vd->vdev_ops == &vdev_spare_ops) { + for (c = 0; c < vd->vdev_children; c++) { + int err = zvol_dumpio_vdev(vd->vdev_child[c], + addr, offset, origoffset, size, doread, isdump); + if (err != 0) { + numerrors++; + } else if (doread) { + break; + } } } - if (!vd->vdev_ops->vdev_op_leaf) + if (!vd->vdev_ops->vdev_op_leaf && vd->vdev_ops != &vdev_raidz_ops) return (numerrors < vd->vdev_children ? 0 : EIO); if (doread && !vdev_readable(vd)) @@ -1129,19 +1136,26 @@ zvol_dumpio_vdev(vdev_t *vd, void *addr, else if (!doread && !vdev_writeable(vd)) return (SET_ERROR(EIO)); - dvd = vd->vdev_tsd; - ASSERT3P(dvd, !=, NULL); + if (vd->vdev_ops == &vdev_raidz_ops) { + return (vdev_raidz_physio(vd, + addr, size, offset, origoffset, doread, isdump)); + } + offset += VDEV_LABEL_START_SIZE; if (ddi_in_panic() || isdump) { ASSERT(!doread); if (doread) return (SET_ERROR(EIO)); + dvd = vd->vdev_tsd; + ASSERT3P(dvd, !=, NULL); return (ldi_dump(dvd->vd_lh, addr, lbtodb(offset), lbtodb(size))); } else { - return (vdev_disk_physio(dvd->vd_lh, addr, size, offset, - doread ? B_READ : B_WRITE)); + dvd = vd->vdev_tsd; + ASSERT3P(dvd, !=, NULL); + return (vdev_disk_ldi_physio(dvd->vd_lh, addr, size, + offset, doread ? B_READ : B_WRITE)); } } @@ -1176,7 +1190,8 @@ zvol_dumpio(zvol_state_t *zv, void *addr vd = vdev_lookup_top(spa, DVA_GET_VDEV(&ze->ze_dva)); offset += DVA_GET_OFFSET(&ze->ze_dva); - error = zvol_dumpio_vdev(vd, addr, offset, size, doread, isdump); + error = zvol_dumpio_vdev(vd, addr, offset, DVA_GET_OFFSET(&ze->ze_dva), + size, doread, isdump); if (!ddi_in_panic()) spa_config_exit(spa, SCL_STATE, FTAG); @@ -1196,7 +1211,7 @@ zvol_strategy(buf_t *bp) rl_t *rl; int error = 0; boolean_t doread = bp->b_flags & B_READ; - boolean_t is_dump; + boolean_t is_dumpified; boolean_t sync; if (getminor(bp->b_edev) == 0) { @@ -1239,11 +1254,11 @@ zvol_strategy(buf_t *bp) return (0); } - is_dump = zv->zv_flags & ZVOL_DUMPIFIED; + is_dumpified = zv->zv_flags & ZVOL_DUMPIFIED; sync = ((!(bp->b_flags & B_ASYNC) && !(zv->zv_flags & ZVOL_WCE)) || (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS)) && - !doread && !is_dump; + !doread && !is_dumpified; /* * There must be no buffer changes when doing a dmu_sync() because @@ -1254,7 +1269,7 @@ zvol_strategy(buf_t *bp) while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); - if (is_dump) { + if (is_dumpified) { size = MIN(size, P2END(off, zv->zv_volblocksize) - off); error = zvol_dumpio(zv, addr, off, size, doread, B_FALSE); @@ -1813,21 +1828,67 @@ zvol_fini(void) ddi_soft_state_fini(&zfsdev_state); } +/*ARGSUSED*/ +static int +zfs_mvdev_dump_feature_check(void *arg, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP])) + return (1); + return (0); +} + +/*ARGSUSED*/ +static void +zfs_mvdev_dump_activate_feature_sync(void *arg, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + + spa_feature_incr(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP], tx); +} + static int zvol_dump_init(zvol_state_t *zv, boolean_t resize) { dmu_tx_t *tx; - int error = 0; + int error; objset_t *os = zv->zv_objset; + spa_t *spa = dmu_objset_spa(os); + vdev_t *vd = spa->spa_root_vdev; nvlist_t *nv = NULL; - uint64_t version = spa_version(dmu_objset_spa(zv->zv_objset)); + uint64_t version = spa_version(spa); + enum zio_checksum checksum; ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(vd->vdev_ops == &vdev_root_ops); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, 0, DMU_OBJECT_END); /* wait for dmu_free_long_range to actually free the blocks */ txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); + /* + * If the pool on which the dump device is being initialized has more + * than one child vdev, check that the MULTI_VDEV_CRASH_DUMP feature is + * enabled. If so, bump that feature's counter to indicate that the + * feature is active. We also check the vdev type to handle the + * following case: + * # zpool create test raidz disk1 disk2 disk3 + * Now have spa_root_vdev->vdev_children == 1 (the raidz vdev), + * the raidz vdev itself has 3 children. + */ + if (vd->vdev_children > 1 || vd->vdev_ops == &vdev_raidz_ops) { + if (!spa_feature_is_enabled(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP])) + return (SET_ERROR(ENOTSUP)); + (void) dsl_sync_task(spa_name(spa), + zfs_mvdev_dump_feature_check, + zfs_mvdev_dump_activate_feature_sync, NULL, 2); + } + tx = dmu_tx_create(os); dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL); dmu_tx_hold_bonus(tx, ZVOL_OBJ); @@ -1838,6 +1899,14 @@ zvol_dump_init(zvol_state_t *zv, boolean } /* + * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum + * function. Otherwise, use the old default -- OFF. + */ + checksum = spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP]) ? + ZIO_CHECKSUM_NOPARITY : ZIO_CHECKSUM_OFF; + + /* * If we are resizing the dump device then we only need to * update the refreservation to match the newly updated * zvolsize. Otherwise, we save off the original state of the @@ -1900,7 +1969,7 @@ zvol_dump_init(zvol_state_t *zv, boolean ZIO_COMPRESS_OFF) == 0); VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_CHECKSUM), - ZIO_CHECKSUM_OFF) == 0); + checksum) == 0); if (version >= SPA_VERSION_DEDUP) { VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_DEDUP), From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:47:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 91676D4F; Fri, 23 Aug 2013 23:47:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EADA2CB5; Fri, 23 Aug 2013 23:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNlx3R073487; Fri, 23 Aug 2013 23:47:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNlx3a073486; Fri, 23 Aug 2013 23:47:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232347.r7NNlx3a073486@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r254751 - vendor/illumos/dist/cmd/zpool X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:47:59 -0000 Author: delphij Date: Fri Aug 23 23:47:59 2013 New Revision: 254751 URL: http://svnweb.freebsd.org/changeset/base/254751 Log: Update vendor/illumos/dist to 14160:734110b9882f: Illumos ZFS issues: 1765 assert triggered in libzfs_import.c trying to import pool name beginning with a number Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_main.c Fri Aug 23 23:46:27 2013 (r254750) +++ vendor/illumos/dist/cmd/zpool/zpool_main.c Fri Aug 23 23:47:59 2013 (r254751) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. + * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. */ #include @@ -1988,8 +1989,10 @@ zpool_do_import(int argc, char **argv) errno = 0; searchguid = strtoull(argv[0], &endptr, 10); - if (errno != 0 || *endptr != '\0') + if (errno != 0 || *endptr != '\0') { searchname = argv[0]; + searchguid = 0; + } found_config = NULL; /* From owner-svn-src-all@FreeBSD.ORG Fri Aug 23 23:58:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EDCA0F20; Fri, 23 Aug 2013 23:58:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9BD22D34; Fri, 23 Aug 2013 23:58:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7NNwuhp078711; Fri, 23 Aug 2013 23:58:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7NNwu34078710; Fri, 23 Aug 2013 23:58:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308232358.r7NNwu34078710@svn.freebsd.org> From: Xin LI Date: Fri, 23 Aug 2013 23:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254752 - head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 23:58:57 -0000 Author: delphij Date: Fri Aug 23 23:58:56 2013 New Revision: 254752 URL: http://svnweb.freebsd.org/changeset/base/254752 Log: MFV r254746: To quote original Illumos ticket: libctf thinks that any ELF file containing more than 65536 sections is corrupt, because it doesn't understand the SHN_XINDEX magic. Illumos DTrace issues: 4005 libctf can't deal with extended sections Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Aug 23 23:47:59 2013 (r254751) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Aug 23 23:58:56 2013 (r254752) @@ -216,6 +216,7 @@ ctf_fdopen(int fd, int *errp) { ctf_sect_t ctfsect, symsect, strsect; ctf_file_t *fp = NULL; + size_t shstrndx, shnum; struct stat64 st; ssize_t nbytes; @@ -278,11 +279,10 @@ ctf_fdopen(int fd, int *errp) #else uchar_t order = ELFDATA2LSB; #endif - GElf_Half i, n; GElf_Shdr *sp; void *strs_map; - size_t strs_mapsz; + size_t strs_mapsz, i; char *strs; if (hdr.e32.e_ident[EI_DATA] != order) @@ -298,11 +298,38 @@ ctf_fdopen(int fd, int *errp) ehdr_to_gelf(&e32, &hdr.e64); } - if (hdr.e64.e_shstrndx >= hdr.e64.e_shnum) + shnum = hdr.e64.e_shnum; + shstrndx = hdr.e64.e_shstrndx; + + /* Extended ELF sections */ + if ((shstrndx == SHN_XINDEX) || (shnum == 0)) { + if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS32) { + Elf32_Shdr x32; + + if (pread64(fd, &x32, sizeof (x32), + hdr.e64.e_shoff) != sizeof (x32)) + return (ctf_set_open_errno(errp, + errno)); + + shnum = x32.sh_size; + shstrndx = x32.sh_link; + } else { + Elf64_Shdr x64; + + if (pread64(fd, &x64, sizeof (x64), + hdr.e64.e_shoff) != sizeof (x64)) + return (ctf_set_open_errno(errp, + errno)); + + shnum = x64.sh_size; + shstrndx = x64.sh_link; + } + } + + if (shstrndx >= shnum) return (ctf_set_open_errno(errp, ECTF_CORRUPT)); - n = hdr.e64.e_shnum; - nbytes = sizeof (GElf_Shdr) * n; + nbytes = sizeof (GElf_Shdr) * shnum; if ((sp = malloc(nbytes)) == NULL) return (ctf_set_open_errno(errp, errno)); @@ -314,7 +341,7 @@ ctf_fdopen(int fd, int *errp) if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS32) { Elf32_Shdr *sp32; - nbytes = sizeof (Elf32_Shdr) * n; + nbytes = sizeof (Elf32_Shdr) * shnum; if ((sp32 = malloc(nbytes)) == NULL || pread64(fd, sp32, nbytes, hdr.e64.e_shoff) != nbytes) { @@ -322,7 +349,7 @@ ctf_fdopen(int fd, int *errp) return (ctf_set_open_errno(errp, errno)); } - for (i = 0; i < n; i++) + for (i = 0; i < shnum; i++) shdr_to_gelf(&sp32[i], &sp[i]); free(sp32); @@ -336,14 +363,14 @@ ctf_fdopen(int fd, int *errp) * Now mmap the section header strings section so that we can * perform string comparison on the section names. */ - strs_mapsz = sp[hdr.e64.e_shstrndx].sh_size + - (sp[hdr.e64.e_shstrndx].sh_offset & ~_PAGEMASK); + strs_mapsz = sp[shstrndx].sh_size + + (sp[shstrndx].sh_offset & ~_PAGEMASK); strs_map = mmap64(NULL, strs_mapsz, PROT_READ, MAP_PRIVATE, - fd, sp[hdr.e64.e_shstrndx].sh_offset & _PAGEMASK); + fd, sp[shstrndx].sh_offset & _PAGEMASK); strs = (char *)strs_map + - (sp[hdr.e64.e_shstrndx].sh_offset & ~_PAGEMASK); + (sp[shstrndx].sh_offset & ~_PAGEMASK); if (strs_map == MAP_FAILED) { free(sp); @@ -354,15 +381,15 @@ ctf_fdopen(int fd, int *errp) * Iterate over the section header array looking for the CTF * section and symbol table. The strtab is linked to symtab. */ - for (i = 0; i < n; i++) { + for (i = 0; i < shnum; i++) { const GElf_Shdr *shp = &sp[i]; const GElf_Shdr *lhp = &sp[shp->sh_link]; - if (shp->sh_link >= hdr.e64.e_shnum) + if (shp->sh_link >= shnum) continue; /* corrupt sh_link field */ - if (shp->sh_name >= sp[hdr.e64.e_shstrndx].sh_size || - lhp->sh_name >= sp[hdr.e64.e_shstrndx].sh_size) + if (shp->sh_name >= sp[shstrndx].sh_size || + lhp->sh_name >= sp[shstrndx].sh_size) continue; /* corrupt sh_name field */ if (shp->sh_type == SHT_PROGBITS && From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 00:19:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7EB072AD; Sat, 24 Aug 2013 00:19:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50C7F2E33; Sat, 24 Aug 2013 00:19:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O0JSHg090335; Sat, 24 Aug 2013 00:19:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O0JQmt090316; Sat, 24 Aug 2013 00:19:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308240019.r7O0JQmt090316@svn.freebsd.org> From: Xin LI Date: Sat, 24 Aug 2013 00:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254753 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 00:19:28 -0000 Author: delphij Date: Sat Aug 24 00:19:26 2013 New Revision: 254753 URL: http://svnweb.freebsd.org/changeset/base/254753 Log: MFV r254747: Fix a panic from dbuf_free_range() from dmu_free_object() while doing zfs receive. This is a regression from FreeBSD r253821. Illumos ZFS issues: 4047 panic from dbuf_free_range() from dmu_free_object() while doing zfs receive Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Aug 24 00:19:26 2013 (r254753) @@ -40,6 +40,12 @@ #include #include +/* + * Number of times that zfs_free_range() took the slow path while doing + * a zfs receive. A nonzero value indicates a potential performance problem. + */ +uint64_t zfs_free_range_recv_miss; + static void dbuf_destroy(dmu_buf_impl_t *db); static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx); static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx); @@ -819,20 +825,22 @@ dbuf_free_range(dnode_t *dn, uint64_t st } dprintf_dnode(dn, "start=%llu end=%llu\n", start, end); - if (dmu_objset_is_receiving(dn->dn_objset)) { + mutex_enter(&dn->dn_dbufs_mtx); + if (start >= dn->dn_unlisted_l0_blkid * dn->dn_datablksz) { + /* There can't be any dbufs in this range; no need to search. */ + mutex_exit(&dn->dn_dbufs_mtx); + return; + } else if (dmu_objset_is_receiving(dn->dn_objset)) { /* - * When processing a free record from a zfs receive, - * there should have been no previous modifications to the - * data in this range. Therefore there should be no dbufs - * in the range. Searching dn_dbufs for these non-existent - * dbufs can be very expensive, so simply ignore this. + * If we are receiving, we expect there to be no dbufs in + * the range to be freed, because receive modifies each + * block at most once, and in offset order. If this is + * not the case, it can lead to performance problems, + * so note that we unexpectedly took the slow path. */ - VERIFY3P(dbuf_find(dn, 0, start), ==, NULL); - VERIFY3P(dbuf_find(dn, 0, end), ==, NULL); - return; + atomic_inc_64(&zfs_free_range_recv_miss); } - mutex_enter(&dn->dn_dbufs_mtx); for (db = list_head(&dn->dn_dbufs); db; db = db_next) { db_next = list_next(&dn->dn_dbufs, db); ASSERT(db->db_blkid != DMU_BONUS_BLKID); @@ -1720,6 +1728,9 @@ dbuf_create(dnode_t *dn, uint8_t level, return (odb); } list_insert_head(&dn->dn_dbufs, db); + if (db->db_level == 0 && db->db_blkid >= + dn->dn_unlisted_l0_blkid) + dn->dn_unlisted_l0_blkid = db->db_blkid + 1; db->db_state = DB_UNCACHED; mutex_exit(&dn->dn_dbufs_mtx); arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_OTHER); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Aug 24 00:19:26 2013 (r254753) @@ -575,98 +575,93 @@ dmu_prefetch(objset_t *os, uint64_t obje * the end so that the file gets shorter over time (if we crashes in the * middle, this will leave us in a better state). We find allocated file * data by simply searching the allocated level 1 indirects. + * + * On input, *start should be the first offset that does not need to be + * freed (e.g. "offset + length"). On return, *start will be the first + * offset that should be freed. */ static int -get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t limit) +get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum) { - uint64_t len = *start - limit; - uint64_t blkcnt = 0; - uint64_t maxblks = DMU_MAX_ACCESS / (1ULL << (dn->dn_indblkshift + 1)); + uint64_t maxblks = DMU_MAX_ACCESS >> (dn->dn_indblkshift + 1); + /* bytes of data covered by a level-1 indirect block */ uint64_t iblkrange = dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT); - ASSERT(limit <= *start); + ASSERT3U(minimum, <=, *start); - if (len <= iblkrange * maxblks) { - *start = limit; + if (*start - minimum <= iblkrange * maxblks) { + *start = minimum; return (0); } ASSERT(ISP2(iblkrange)); - while (*start > limit && blkcnt < maxblks) { + for (uint64_t blks = 0; *start > minimum && blks < maxblks; blks++) { int err; - /* find next allocated L1 indirect */ + /* + * dnode_next_offset(BACKWARDS) will find an allocated L1 + * indirect block at or before the input offset. We must + * decrement *start so that it is at the end of the region + * to search. + */ + (*start)--; err = dnode_next_offset(dn, DNODE_FIND_BACKWARDS, start, 2, 1, 0); - /* if there are no more, then we are done */ + /* if there are no indirect blocks before start, we are done */ if (err == ESRCH) { - *start = limit; - return (0); - } else if (err) { + *start = minimum; + break; + } else if (err != 0) { return (err); } - blkcnt += 1; - /* reset offset to end of "next" block back */ + /* set start to the beginning of this L1 indirect */ *start = P2ALIGN(*start, iblkrange); - if (*start <= limit) - *start = limit; - else - *start -= 1; } + if (*start < minimum) + *start = minimum; return (0); } static int dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset, - uint64_t length, boolean_t free_dnode) + uint64_t length) { - dmu_tx_t *tx; - uint64_t object_size, start, end, len; - boolean_t trunc = (length == DMU_OBJECT_END); - int align, err; - - align = 1 << dn->dn_datablkshift; - ASSERT(align > 0); - object_size = align == 1 ? dn->dn_datablksz : - (dn->dn_maxblkid + 1) << dn->dn_datablkshift; - - end = offset + length; - if (trunc || end > object_size) - end = object_size; - if (end <= offset) + uint64_t object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz; + int err; + + if (offset >= object_size) return (0); - length = end - offset; - while (length) { - start = end; - /* assert(offset <= start) */ - err = get_next_chunk(dn, &start, offset); + if (length == DMU_OBJECT_END || offset + length > object_size) + length = object_size - offset; + + while (length != 0) { + uint64_t chunk_end, chunk_begin; + + chunk_end = chunk_begin = offset + length; + + /* move chunk_begin backwards to the beginning of this chunk */ + err = get_next_chunk(dn, &chunk_begin, offset); if (err) return (err); - len = trunc ? DMU_OBJECT_END : end - start; + ASSERT3U(chunk_begin, >=, offset); + ASSERT3U(chunk_begin, <=, chunk_end); - tx = dmu_tx_create(os); - dmu_tx_hold_free(tx, dn->dn_object, start, len); + dmu_tx_t *tx = dmu_tx_create(os); + dmu_tx_hold_free(tx, dn->dn_object, + chunk_begin, chunk_end - chunk_begin); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); return (err); } - - dnode_free_range(dn, start, trunc ? -1 : len, tx); - - if (start == 0 && free_dnode) { - ASSERT(trunc); - dnode_free(dn, tx); - } - - length -= end - start; - + dnode_free_range(dn, chunk_begin, chunk_end - chunk_begin, tx); dmu_tx_commit(tx); - end = start; + + length -= chunk_end - chunk_begin; } return (0); } @@ -681,38 +676,32 @@ dmu_free_long_range(objset_t *os, uint64 err = dnode_hold(os, object, FTAG, &dn); if (err != 0) return (err); - err = dmu_free_long_range_impl(os, dn, offset, length, FALSE); + err = dmu_free_long_range_impl(os, dn, offset, length); dnode_rele(dn, FTAG); return (err); } int -dmu_free_object(objset_t *os, uint64_t object) +dmu_free_long_object(objset_t *os, uint64_t object) { - dnode_t *dn; dmu_tx_t *tx; int err; - err = dnode_hold_impl(os, object, DNODE_MUST_BE_ALLOCATED, - FTAG, &dn); + err = dmu_free_long_range(os, object, 0, DMU_OBJECT_END); if (err != 0) return (err); - if (dn->dn_nlevels == 1) { - tx = dmu_tx_create(os); - dmu_tx_hold_bonus(tx, object); - dmu_tx_hold_free(tx, dn->dn_object, 0, DMU_OBJECT_END); - err = dmu_tx_assign(tx, TXG_WAIT); - if (err == 0) { - dnode_free_range(dn, 0, DMU_OBJECT_END, tx); - dnode_free(dn, tx); - dmu_tx_commit(tx); - } else { - dmu_tx_abort(tx); - } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, object); + dmu_tx_hold_free(tx, object, 0, DMU_OBJECT_END); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err == 0) { + err = dmu_object_free(os, object, tx); + dmu_tx_commit(tx); } else { - err = dmu_free_long_range_impl(os, dn, 0, DMU_OBJECT_END, TRUE); + dmu_tx_abort(tx); } - dnode_rele(dn, FTAG); + return (err); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Aug 24 00:19:26 2013 (r254753) @@ -1286,7 +1286,7 @@ restore_freeobjects(struct restorearg *r if (dmu_object_info(os, obj, NULL) != 0) continue; - err = dmu_free_object(os, obj); + err = dmu_free_long_object(os, obj); if (err != 0) return (err); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Sat Aug 24 00:19:26 2013 (r254753) @@ -615,7 +615,8 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t * if they are blocksize-aligned. */ if (dn->dn_datablkshift == 0) { - dmu_tx_count_write(txh, off, len); + if (off != 0 || len < dn->dn_datablksz) + dmu_tx_count_write(txh, off, len); } else { /* first block will be modified if it is not aligned */ if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift)) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sat Aug 24 00:19:26 2013 (r254753) @@ -117,6 +117,7 @@ dnode_cons(void *arg, void *unused, int dn->dn_id_flags = 0; dn->dn_dbufs_count = 0; + dn->dn_unlisted_l0_blkid = 0; list_create(&dn->dn_dbufs, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); @@ -170,6 +171,7 @@ dnode_dest(void *arg, void *unused) ASSERT0(dn->dn_id_flags); ASSERT0(dn->dn_dbufs_count); + ASSERT0(dn->dn_unlisted_l0_blkid); list_destroy(&dn->dn_dbufs); } @@ -475,6 +477,7 @@ dnode_destroy(dnode_t *dn) dn->dn_newuid = 0; dn->dn_newgid = 0; dn->dn_id_flags = 0; + dn->dn_unlisted_l0_blkid = 0; dmu_zfetch_rele(&dn->dn_zfetch); kmem_cache_free(dnode_cache, dn); @@ -705,6 +708,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n ASSERT(list_is_empty(&ndn->dn_dbufs)); list_move_tail(&ndn->dn_dbufs, &odn->dn_dbufs); ndn->dn_dbufs_count = odn->dn_dbufs_count; + ndn->dn_unlisted_l0_blkid = odn->dn_unlisted_l0_blkid; ndn->dn_bonus = odn->dn_bonus; ndn->dn_have_spill = odn->dn_have_spill; ndn->dn_zio = odn->dn_zio; @@ -739,6 +743,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n list_create(&odn->dn_dbufs, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); odn->dn_dbufs_count = 0; + odn->dn_unlisted_l0_blkid = 0; odn->dn_bonus = NULL; odn->dn_zfetch.zf_dnode = NULL; @@ -1528,7 +1533,7 @@ dnode_free_range(dnode_t *dn, uint64_t o blkshift = dn->dn_datablkshift; epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - if (len == -1ULL) { + if (len == DMU_OBJECT_END) { len = UINT64_MAX - off; trunc = TRUE; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Sat Aug 24 00:19:26 2013 (r254753) @@ -896,7 +896,7 @@ dsl_destroy_head(const char *name) for (uint64_t obj = 0; error == 0; error = dmu_object_next(os, &obj, FALSE, prev_snap_txg)) - (void) dmu_free_object(os, obj); + (void) dmu_free_long_object(os, obj); /* sync out all frees */ txg_wait_synced(dmu_objset_pool(os), 0); dmu_objset_disown(os, FTAG); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sat Aug 24 00:19:26 2013 (r254753) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -583,7 +583,7 @@ int dmu_free_range(objset_t *os, uint64_ uint64_t size, dmu_tx_t *tx); int dmu_free_long_range(objset_t *os, uint64_t object, uint64_t offset, uint64_t size); -int dmu_free_object(objset_t *os, uint64_t object); +int dmu_free_long_object(objset_t *os, uint64_t object); /* * Convenience functions. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Aug 23 23:58:56 2013 (r254752) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Sat Aug 24 00:19:26 2013 (r254753) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_DNODE_H @@ -188,6 +188,8 @@ typedef struct dnode { /* protected by dn_dbufs_mtx; declared here to fill 32-bit hole */ uint32_t dn_dbufs_count; /* count of dn_dbufs */ + /* There are no level-0 blocks of this blkid or higher in dn_dbufs */ + uint64_t dn_unlisted_l0_blkid; /* protected by os_lock: */ list_node_t dn_dirty_link[TXG_SIZE]; /* next on dataset's dirty */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 00:26:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DC553454; Sat, 24 Aug 2013 00:26:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9ADD2E94; Sat, 24 Aug 2013 00:26:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O0QFq8094356; Sat, 24 Aug 2013 00:26:15 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O0QFDc094355; Sat, 24 Aug 2013 00:26:15 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308240026.r7O0QFDc094355@svn.freebsd.org> From: Glen Barber Date: Sat, 24 Aug 2013 00:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254754 - releng/9.2/sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 00:26:15 -0000 Author: gjb Date: Sat Aug 24 00:26:15 2013 New Revision: 254754 URL: http://svnweb.freebsd.org/changeset/base/254754 Log: Revert r250907 from releng/9.2: Reports of NFS deadlocks on -stable@ suggest that reverting this change resolves the problem. This is a direct reverse-merge to releng/9.2, pending further review and analysis on the stable/9 branch. Approved by: re (marius) Discussed on: stable Modified: releng/9.2/sys/kern/uipc_syscalls.c Directory Properties: releng/9.2/sys/ (props changed) Modified: releng/9.2/sys/kern/uipc_syscalls.c ============================================================================== --- releng/9.2/sys/kern/uipc_syscalls.c Sat Aug 24 00:19:26 2013 (r254753) +++ releng/9.2/sys/kern/uipc_syscalls.c Sat Aug 24 00:26:15 2013 (r254754) @@ -1835,11 +1835,9 @@ kern_sendfile(struct thread *td, struct struct mbuf *m = NULL; struct sf_buf *sf; struct vm_page *pg; - struct vattr va; off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0; int error, hdrlen = 0, mnw = 0; int vfslocked; - int bsize; struct sendfile_sync *sfs = NULL; /* @@ -1854,18 +1852,6 @@ kern_sendfile(struct thread *td, struct vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); if (vp->v_type == VREG) { - bsize = vp->v_mount->mnt_stat.f_iosize; - if (uap->nbytes == 0) { - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0) { - VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); - obj = NULL; - goto out; - } - rem = va.va_size; - } else - rem = uap->nbytes; obj = vp->v_object; if (obj != NULL) { /* @@ -1883,8 +1869,7 @@ kern_sendfile(struct thread *td, struct obj = NULL; } } - } else - bsize = 0; /* silence gcc */ + } VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); if (obj == NULL) { @@ -1977,20 +1962,11 @@ kern_sendfile(struct thread *td, struct * The outer loop checks the state and available space of the socket * and takes care of the overall progress. */ - for (off = uap->offset; ; ) { - struct mbuf *mtail; - int loopbytes; - int space; - int done; - - if ((uap->nbytes != 0 && uap->nbytes == fsbytes) || - (uap->nbytes == 0 && va.va_size == fsbytes)) - break; - - mtail = NULL; - loopbytes = 0; - space = 0; - done = 0; + for (off = uap->offset, rem = uap->nbytes; ; ) { + struct mbuf *mtail = NULL; + int loopbytes = 0; + int space = 0; + int done = 0; /* * Check the socket state for ongoing connection, @@ -2058,20 +2034,6 @@ retry_space: */ space -= hdrlen; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - error = vn_lock(vp, LK_SHARED); - if (error != 0) { - VFS_UNLOCK_GIANT(vfslocked); - goto done; - } - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0 || off >= va.va_size) { - VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); - goto done; - } - VFS_UNLOCK_GIANT(vfslocked); - /* * Loop and construct maximum sized mbuf chain to be bulk * dumped into socket buffer. @@ -2081,20 +2043,25 @@ retry_space: vm_offset_t pgoff; struct mbuf *m0; + VM_OBJECT_LOCK(obj); /* * Calculate the amount to transfer. * Not to exceed a page, the EOF, * or the passed in nbytes. */ pgoff = (vm_offset_t)(off & PAGE_MASK); + xfsize = omin(PAGE_SIZE - pgoff, + obj->un_pager.vnp.vnp_size - uap->offset - + fsbytes - loopbytes); if (uap->nbytes) rem = (uap->nbytes - fsbytes - loopbytes); else - rem = va.va_size - + rem = obj->un_pager.vnp.vnp_size - uap->offset - fsbytes - loopbytes; - xfsize = omin(PAGE_SIZE - pgoff, rem); + xfsize = omin(rem, xfsize); xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { + VM_OBJECT_UNLOCK(obj); done = 1; /* all data sent */ break; } @@ -2104,7 +2071,6 @@ retry_space: * if not found or wait and loop if busy. */ pindex = OFF_TO_IDX(off); - VM_OBJECT_LOCK(obj); pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY); @@ -2122,6 +2088,7 @@ retry_space: else if (uap->flags & SF_NODISKIO) error = EBUSY; else { + int bsize; ssize_t resid; /* @@ -2133,16 +2100,25 @@ retry_space: /* * Get the page from backing store. + */ + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + error = vn_lock(vp, LK_SHARED); + if (error != 0) + goto after_read; + bsize = vp->v_mount->mnt_stat.f_iosize; + + /* * XXXMAC: Because we don't have fp->f_cred * here, we pass in NOCRED. This is probably * wrong, but is consistent with our original * implementation. */ - vfslocked = VFS_LOCK_GIANT(vp->v_mount); error = vn_rdwr(UIO_READ, vp, NULL, MAXBSIZE, trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); + VOP_UNLOCK(vp, 0); + after_read: VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(obj); vm_page_io_finish(pg); @@ -2198,7 +2174,7 @@ retry_space: m0 = m_get((mnw ? M_NOWAIT : M_WAITOK), MT_DATA); if (m0 == NULL) { error = (mnw ? EAGAIN : ENOBUFS); - sf_buf_mext(NULL, sf); + sf_buf_mext((void *)sf_buf_kva(sf), sf); break; } MEXTADD(m0, sf_buf_kva(sf), PAGE_SIZE, sf_buf_mext, @@ -2226,8 +2202,6 @@ retry_space: } } - VOP_UNLOCK(vp, 0); - /* Add the buffer chain to the socket buffer. */ if (m != NULL) { int mlen, err; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 00:29:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 755EB5A8; Sat, 24 Aug 2013 00:29:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 612232EB3; Sat, 24 Aug 2013 00:29:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O0TZnc095314; Sat, 24 Aug 2013 00:29:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O0TZUe095311; Sat, 24 Aug 2013 00:29:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308240029.r7O0TZUe095311@svn.freebsd.org> From: Xin LI Date: Sat, 24 Aug 2013 00:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254755 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 00:29:35 -0000 Author: delphij Date: Sat Aug 24 00:29:34 2013 New Revision: 254755 URL: http://svnweb.freebsd.org/changeset/base/254755 Log: MFV r254748: Fix memory leak in libzfs's iter_dependents_cb(). Illumos ZFS issues: 4061 libzfs: memory leak in iter_dependents_cb() Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Sat Aug 24 00:26:15 2013 (r254754) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Sat Aug 24 00:29:34 2013 (r254755) @@ -21,10 +21,10 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -452,8 +452,12 @@ iter_dependents_cb(zfs_handle_t *zhp, vo } ida->stack = isf.next; } + if (!first && err == 0) err = ida->func(zhp, ida->data); + else + zfs_close(zhp); + return (err); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 00:30:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56E776E2; Sat, 24 Aug 2013 00:30:33 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 435792EDE; Sat, 24 Aug 2013 00:30:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O0UXFn096212; Sat, 24 Aug 2013 00:30:33 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O0UXK0096211; Sat, 24 Aug 2013 00:30:33 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201308240030.r7O0UXK0096211@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 24 Aug 2013 00:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254756 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 00:30:33 -0000 Author: alfred Date: Sat Aug 24 00:30:32 2013 New Revision: 254756 URL: http://svnweb.freebsd.org/changeset/base/254756 Log: Grow some spares in struct vfsops. This should hopefully prevent ABI breakage on adding new vfsops in 10.x. Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Aug 24 00:29:34 2013 (r254755) +++ head/sys/sys/mount.h Sat Aug 24 00:30:32 2013 (r254756) @@ -628,6 +628,7 @@ struct vfsops { vfs_susp_clean_t *vfs_susp_clean; vfs_notify_lowervp_t *vfs_reclaim_lowervp; vfs_notify_lowervp_t *vfs_unlink_lowervp; + vfs_mount_t *vfs_spare[6]; /* spares for ABI compat */ }; vfs_statfs_t __vfs_statfs; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 00:42:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0F565959; Sat, 24 Aug 2013 00:42:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0E742F65; Sat, 24 Aug 2013 00:42:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O0gb9n003320; Sat, 24 Aug 2013 00:42:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O0gb1u003318; Sat, 24 Aug 2013 00:42:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308240042.r7O0gb1u003318@svn.freebsd.org> From: Xin LI Date: Sat, 24 Aug 2013 00:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254757 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 00:42:38 -0000 Author: delphij Date: Sat Aug 24 00:42:37 2013 New Revision: 254757 URL: http://svnweb.freebsd.org/changeset/base/254757 Log: MFV r254749: Don't hold dd_lock for long by breaking it when not doing dsl_dir accounting. It is not necessary to hold the lock while manipulating the parent's accounting, because there is no interface for userland to see a consistent picture of both parent and child at the same time anyway. Illumos ZFS issues: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Aug 24 00:30:32 2013 (r254756) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Aug 24 00:42:37 2013 (r254757) @@ -101,9 +101,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds used, compressed, uncompressed); return; } - dmu_buf_will_dirty(ds->ds_dbuf, tx); - mutex_enter(&ds->ds_dir->dd_lock); + dmu_buf_will_dirty(ds->ds_dbuf, tx); mutex_enter(&ds->ds_lock); delta = parent_delta(ds, used); ds->ds_phys->ds_referenced_bytes += used; @@ -115,7 +114,6 @@ dsl_dataset_block_born(dsl_dataset_t *ds compressed, uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } int @@ -150,7 +148,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); - mutex_enter(&ds->ds_dir->dd_lock); mutex_enter(&ds->ds_lock); ASSERT(ds->ds_phys->ds_unique_bytes >= used || !DS_UNIQUE_IS_ACCURATE(ds)); @@ -161,7 +158,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds delta, -compressed, -uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, -used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } else { dprintf_bp(bp, "putting on dead list: %s", ""); if (async) { @@ -596,31 +592,6 @@ dsl_dataset_name(dsl_dataset_t *ds, char } } -static int -dsl_dataset_namelen(dsl_dataset_t *ds) -{ - int result; - - if (ds == NULL) { - result = 3; /* "mos" */ - } else { - result = dsl_dir_namelen(ds->ds_dir); - VERIFY0(dsl_dataset_get_snapname(ds)); - if (ds->ds_snapname[0]) { - ++result; /* adding one for the @-sign */ - if (!MUTEX_HELD(&ds->ds_lock)) { - mutex_enter(&ds->ds_lock); - result += strlen(ds->ds_snapname); - mutex_exit(&ds->ds_lock); - } else { - result += strlen(ds->ds_snapname); - } - } - } - - return (result); -} - void dsl_dataset_rele(dsl_dataset_t *ds, void *tag) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sat Aug 24 00:30:32 2013 (r254756) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sat Aug 24 00:42:37 2013 (r254757) @@ -845,11 +845,21 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u int64_t used, int64_t compressed, int64_t uncompressed, dmu_tx_t *tx) { int64_t accounted_delta; + + /* + * dsl_dataset_set_refreservation_sync_impl() calls this with + * dd_lock held, so that it can atomically update + * ds->ds_reserved and the dsl_dir accounting, so that + * dsl_dataset_check_quota() can see dataset and dir accounting + * consistently. + */ boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -858,7 +868,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -891,8 +900,6 @@ void dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta, dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx) { - boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); - ASSERT(dmu_tx_is_syncing(tx)); ASSERT(oldtype < DD_USED_NUM); ASSERT(newtype < DD_USED_NUM); @@ -900,17 +907,15 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - if (needlock) - mutex_enter(&dd->dd_lock); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; - if (needlock) - mutex_exit(&dd->dd_lock); + mutex_exit(&dd->dd_lock); } typedef struct dsl_dir_set_qr_arg { From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 00:54:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDFD5D46; Sat, 24 Aug 2013 00:54:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAEFA2FF7; Sat, 24 Aug 2013 00:54:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O0slDR008886; Sat, 24 Aug 2013 00:54:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O0sl1F008885; Sat, 24 Aug 2013 00:54:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201308240054.r7O0sl1F008885@svn.freebsd.org> From: Xin LI Date: Sat, 24 Aug 2013 00:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254758 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 00:54:47 -0000 Author: delphij Date: Sat Aug 24 00:54:47 2013 New Revision: 254758 URL: http://svnweb.freebsd.org/changeset/base/254758 Log: MFV r254751: Don't treat the parameter as a number (pool GUID) when there is error converting it from string, instead, treat it as the pool name. Illumos ZFS issues: 1765 assert triggered in libzfs_import.c trying to import pool name beginning with a number Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Aug 24 00:42:37 2013 (r254757) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Aug 24 00:54:47 2013 (r254758) @@ -25,6 +25,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. */ #include @@ -2128,8 +2129,10 @@ zpool_do_import(int argc, char **argv) errno = 0; searchguid = strtoull(argv[0], &endptr, 10); - if (errno != 0 || *endptr != '\0') + if (errno != 0 || *endptr != '\0') { searchname = argv[0]; + searchguid = 0; + } found_config = NULL; /* From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 01:50:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2BBFE425; Sat, 24 Aug 2013 01:50:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 180632239; Sat, 24 Aug 2013 01:50:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O1oXWE036618; Sat, 24 Aug 2013 01:50:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O1oVKk036604; Sat, 24 Aug 2013 01:50:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201308240150.r7O1oVKk036604@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 24 Aug 2013 01:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254759 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 01:50:33 -0000 Author: trasz Date: Sat Aug 24 01:50:31 2013 New Revision: 254759 URL: http://svnweb.freebsd.org/changeset/base/254759 Log: CTL changes required for iSCSI target, most notably LUN remapping and a mechanism to allow CTL frontends for retrieving LUN options. Reviewed by: ken (earlier version) Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_frontend.h head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl.c Sat Aug 24 01:50:31 2013 (r254759) @@ -894,8 +894,13 @@ ctl_isc_event_handler(ctl_ha_channel cha struct ctl_lun *lun; struct ctl_page_index *page_index; struct copan_aps_subpage *current_sp; + uint32_t targ_lun; - lun = ctl_softc->ctl_luns[msg_info.hdr.nexus.targ_lun]; + targ_lun = msg_info.hdr.nexus.targ_lun; + if (msg_info.hdr.nexus.lun_map_fn != NULL) + targ_lun = msg_info.hdr.nexus.lun_map_fn(msg_info.hdr.nexus.lun_map_arg, targ_lun); + + lun = ctl_softc->ctl_luns[targ_lun]; page_index = &lun->mode_pages.index[index_to_aps_page]; current_sp = (struct copan_aps_subpage *) (page_index->page_data + @@ -1098,7 +1103,8 @@ ctl_init(void) mtx_unlock(&softc->ctl_lock); return (error); } - printf("ctl: CAM Target Layer loaded\n"); + if (bootverbose) + printf("ctl: CAM Target Layer loaded\n"); /* * Initialize the initiator and portname mappings @@ -1194,7 +1200,8 @@ ctl_shutdown(void) free(control_softc, M_DEVBUF); control_softc = NULL; - printf("ctl: CAM Target Layer unloaded\n"); + if (bootverbose) + printf("ctl: CAM Target Layer unloaded\n"); } static int @@ -1678,12 +1685,16 @@ ctl_serialize_other_sc_cmd(struct ctl_sc union ctl_ha_msg msg_info; struct ctl_lun *lun; int retval = 0; + uint32_t targ_lun; ctl_softc = control_softc; if (have_lock == 0) mtx_lock(&ctl_softc->ctl_lock); - lun = ctl_softc->ctl_luns[ctsio->io_hdr.nexus.targ_lun]; + targ_lun = ctsio->io_hdr.nexus.targ_lun; + if (ctsio->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, targ_lun); + lun = ctl_softc->ctl_luns[targ_lun]; if (lun==NULL) { /* @@ -2980,6 +2991,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, struct sbuf *sb; struct ctl_lun *lun; struct ctl_lun_list *list; + struct ctl_be_lun_option *opt; list = (struct ctl_lun_list *)addr; @@ -3097,17 +3109,16 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - if (lun->backend->lun_info == NULL) { - retval = sbuf_printf(sb, "\n"); + if (lun->backend->lun_info != NULL) { + retval = lun->backend->lun_info(lun->be_lun->be_lun, sb); + if (retval != 0) + break; + } + STAILQ_FOREACH(opt, &lun->be_lun->options, links) { + retval = sbuf_printf(sb, "<%s>%s", opt->name, opt->value, opt->name); if (retval != 0) break; - continue; } - - retval =lun->backend->lun_info(lun->be_lun->be_lun, sb); - - if (retval != 0) - break; retval = sbuf_printf(sb, "\n"); @@ -4432,9 +4443,14 @@ ctl_free_lun(struct ctl_lun *lun) */ for (io = (union ctl_io *)STAILQ_FIRST(&softc->rtr_queue); io != NULL; io = next_io) { + uint32_t targ_lun; + next_io = (union ctl_io *)STAILQ_NEXT(&io->io_hdr, links); + targ_lun = io->io_hdr.nexus.targ_lun; + if (io->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); if ((io->io_hdr.nexus.targ_target.id == lun->target.id) - && (io->io_hdr.nexus.targ_lun == lun->lun)) + && (targ_lun == lun->lun)) STAILQ_REMOVE(&softc->rtr_queue, &io->io_hdr, ctl_io_hdr, links); } @@ -8247,12 +8263,16 @@ ctl_hndl_per_res_out_on_other_sc(union c struct ctl_lun *lun; struct ctl_softc *softc; int i; + uint32_t targ_lun; softc = control_softc; mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[msg->hdr.nexus.targ_lun]; + targ_lun = msg->hdr.nexus.targ_lun; + if (msg->hdr.nexus.lun_map_fn != NULL) + targ_lun = msg->hdr.nexus.lun_map_fn(msg->hdr.nexus.lun_map_arg, targ_lun); + lun = softc->ctl_luns[targ_lun]; switch(msg->pr.pr_info.action) { case CTL_PR_REG_KEY: if (!lun->per_res[msg->pr.pr_info.residx].registered) { @@ -8601,7 +8621,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio int num_luns, retval; uint32_t alloc_len, lun_datalen; int num_filled, well_known; - uint32_t initidx; + uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; well_known = 0; @@ -8662,63 +8682,47 @@ ctl_report_luns(struct ctl_scsiio *ctsio lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - if (lun_datalen < alloc_len) { - ctsio->residual = alloc_len - lun_datalen; - ctsio->kern_data_len = lun_datalen; - ctsio->kern_total_len = lun_datalen; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } - ctsio->kern_data_resid = 0; - ctsio->kern_rel_offset = 0; - ctsio->kern_sg_entries = 0; - initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - /* - * We set this to the actual data length, regardless of how much - * space we actually have to return results. If the user looks at - * this value, he'll know whether or not he allocated enough space - * and reissue the command if necessary. We don't support well - * known logical units, so if the user asks for that, return none. - */ - scsi_ulto4b(lun_datalen - 8, lun_data->length); - mtx_lock(&control_softc->ctl_lock); - for (num_filled = 0, lun = STAILQ_FIRST(&control_softc->lun_list); - (lun != NULL) && (num_filled < num_luns); - lun = STAILQ_NEXT(lun, links)) { + for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { + lun_id = targ_lun_id; + if (ctsio->io_hdr.nexus.lun_map_fn != NULL) + lun_id = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, lun_id); + if (lun_id >= CTL_MAX_LUNS) + continue; + lun = control_softc->ctl_luns[lun_id]; + if (lun == NULL) + continue; - if (lun->lun <= 0xff) { + if (targ_lun_id <= 0xff) { /* * Peripheral addressing method, bus number 0. */ lun_data->luns[num_filled].lundata[0] = RPL_LUNDATA_ATYP_PERIPH; - lun_data->luns[num_filled].lundata[1] = lun->lun; + lun_data->luns[num_filled].lundata[1] = targ_lun_id; num_filled++; - } else if (lun->lun <= 0x3fff) { + } else if (targ_lun_id <= 0x3fff) { /* * Flat addressing method. */ lun_data->luns[num_filled].lundata[0] = RPL_LUNDATA_ATYP_FLAT | - (lun->lun & RPL_LUNDATA_FLAT_LUN_MASK); + (targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK); #ifdef OLDCTLHEADERS (SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) | - (lun->lun & SRLD_BUS_LUN_MASK); + (targ_lun_id & SRLD_BUS_LUN_MASK); #endif lun_data->luns[num_filled].lundata[1] = #ifdef OLDCTLHEADERS - lun->lun >> SRLD_BUS_LUN_BITS; + targ_lun_id >> SRLD_BUS_LUN_BITS; #endif - lun->lun >> RPL_LUNDATA_FLAT_LUN_BITS; + targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS; num_filled++; } else { printf("ctl_report_luns: bogus LUN number %jd, " - "skipping\n", (intmax_t)lun->lun); + "skipping\n", (intmax_t)targ_lun_id); } /* * According to SPC-3, rev 14 section 6.21: @@ -8743,6 +8747,35 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_unlock(&control_softc->ctl_lock); /* + * It's quite possible that we've returned fewer LUNs than we allocated + * space for. Trim it. + */ + lun_datalen = sizeof(*lun_data) + + (num_filled * sizeof(struct scsi_report_luns_lundata)); + + if (lun_datalen < alloc_len) { + ctsio->residual = alloc_len - lun_datalen; + ctsio->kern_data_len = lun_datalen; + ctsio->kern_total_len = lun_datalen; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * We set this to the actual data length, regardless of how much + * space we actually have to return results. If the user looks at + * this value, he'll know whether or not he allocated enough space + * and reissue the command if necessary. We don't support well + * known logical units, so if the user asks for that, return none. + */ + scsi_ulto4b(lun_datalen - 8, lun_data->length); + + /* * We can only return SCSI_STATUS_CHECK_COND when we can't satisfy * this request. */ @@ -9077,6 +9110,14 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio int devid_len; ctl_softc = control_softc; + + mtx_lock(&ctl_softc->ctl_lock); + fe = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; + mtx_unlock(&ctl_softc->ctl_lock); + + if (fe->devid != NULL) + return ((fe->devid)(ctsio, alloc_len)); + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; devid_len = sizeof(struct scsi_vpd_device_id) + @@ -9130,8 +9171,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio mtx_lock(&ctl_softc->ctl_lock); - fe = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; - /* * For Fibre channel, */ @@ -10350,7 +10389,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct struct ctl_lun *lun; struct ctl_cmd_entry *entry; uint8_t opcode; - uint32_t initidx; + uint32_t initidx, targ_lun; int retval; retval = 0; @@ -10361,9 +10400,12 @@ ctl_scsiio_precheck(struct ctl_softc *ct mtx_lock(&ctl_softc->ctl_lock); - if ((ctsio->io_hdr.nexus.targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[ctsio->io_hdr.nexus.targ_lun] != NULL)) { - lun = ctl_softc->ctl_luns[ctsio->io_hdr.nexus.targ_lun]; + targ_lun = ctsio->io_hdr.nexus.targ_lun; + if (ctsio->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, targ_lun); + if ((targ_lun < CTL_MAX_LUNS) + && (ctl_softc->ctl_luns[targ_lun] != NULL)) { + lun = ctl_softc->ctl_luns[targ_lun]; /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -10403,6 +10445,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct ctl_set_unsupported_lun(ctsio); mtx_unlock(&ctl_softc->ctl_lock); ctl_done((union ctl_io *)ctsio); + CTL_DEBUG_PRINT(("ctl_scsiio_precheck: bailing out due to invalid LUN\n")); goto bailout; } else { /* @@ -10769,6 +10812,7 @@ ctl_abort_task(union ctl_io *io) char printbuf[128]; #endif int found; + uint32_t targ_lun; ctl_softc = control_softc; found = 0; @@ -10776,9 +10820,12 @@ ctl_abort_task(union ctl_io *io) /* * Look up the LUN. */ - if ((io->io_hdr.nexus.targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[io->io_hdr.nexus.targ_lun] != NULL)) - lun = ctl_softc->ctl_luns[io->io_hdr.nexus.targ_lun]; + targ_lun = io->io_hdr.nexus.targ_lun; + if (io->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); + if ((targ_lun < CTL_MAX_LUNS) + && (ctl_softc->ctl_luns[targ_lun] != NULL)) + lun = ctl_softc->ctl_luns[targ_lun]; else goto bailout; @@ -10968,6 +11015,8 @@ ctl_run_task_queue(struct ctl_softc *ctl int retval; targ_lun = io->io_hdr.nexus.targ_lun; + if (io->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); if ((targ_lun < CTL_MAX_LUNS) && (ctl_softc->ctl_luns[targ_lun] != NULL)) @@ -11042,7 +11091,7 @@ ctl_run_task_queue(struct ctl_softc *ctl (uintmax_t)io->io_hdr.nexus.initid.id, io->io_hdr.nexus.targ_port, (uintmax_t)io->io_hdr.nexus.targ_target.id, - io->io_hdr.nexus.targ_lun, + io->io_hdr.nexus.targ_lun /* XXX */, (io->io_hdr.io_type == CTL_IO_TASK) ? io->taskio.tag_num : io->scsiio.tag_num); STAILQ_REMOVE(&ctl_softc->task_queue, &io->io_hdr, @@ -11066,10 +11115,14 @@ ctl_handle_isc(union ctl_io *io) int free_io; struct ctl_lun *lun; struct ctl_softc *ctl_softc; + uint32_t targ_lun; ctl_softc = control_softc; - lun = ctl_softc->ctl_luns[io->io_hdr.nexus.targ_lun]; + targ_lun = io->io_hdr.nexus.targ_lun; + if (io->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); + lun = ctl_softc->ctl_luns[targ_lun]; switch (io->io_hdr.msg_type) { case CTL_MSG_SERIALIZE: @@ -12625,7 +12678,7 @@ ctl_queue_sense(union ctl_io *io) { struct ctl_lun *lun; struct ctl_softc *ctl_softc; - uint32_t initidx; + uint32_t initidx, targ_lun; ctl_softc = control_softc; @@ -12644,9 +12697,12 @@ ctl_queue_sense(union ctl_io *io) * If we don't have a LUN for this, just toss the sense * information. */ - if ((io->io_hdr.nexus.targ_lun < CTL_MAX_LUNS) - && (ctl_softc->ctl_luns[io->io_hdr.nexus.targ_lun] != NULL)) - lun = ctl_softc->ctl_luns[io->io_hdr.nexus.targ_lun]; + targ_lun = io->io_hdr.nexus.targ_lun; + if (io->io_hdr.nexus.lun_map_fn != NULL) + targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun); + if ((targ_lun < CTL_MAX_LUNS) + && (ctl_softc->ctl_luns[targ_lun] != NULL)) + lun = ctl_softc->ctl_luns[targ_lun]; else goto bailout; @@ -13047,6 +13103,8 @@ ctl_isc_start(struct ctl_ha_component *c { ctl_ha_comp_status ret = CTL_HA_COMP_STATUS_OK; + printf("%s: go\n", __func__); + // UNKNOWN->HA or UNKNOWN->SINGLE (bootstrap) if (c->state == CTL_HA_STATE_UNKNOWN ) { ctl_is_single = 0; Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl.h Sat Aug 24 01:50:31 2013 (r254759) @@ -52,6 +52,7 @@ typedef enum { CTL_PORT_SCSI = 0x02, CTL_PORT_IOCTL = 0x04, CTL_PORT_INTERNAL = 0x08, + CTL_PORT_ISCSI = 0x10, CTL_PORT_ALL = 0xff, CTL_PORT_ISC = 0x100 // FC port for inter-shelf communication } ctl_port_type; Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl_backend.h Sat Aug 24 01:50:31 2013 (r254759) @@ -173,6 +173,12 @@ typedef void (*be_lun_config_t)(void *be * The links field is for CTL internal use only, and should not be used by * the backend. */ +struct ctl_be_lun_option { + STAILQ_ENTRY(ctl_be_lun_option) links; + char *name; + char *value; +}; + struct ctl_be_lun { uint8_t lun_type; /* passed to CTL */ ctl_backend_lun_flags flags; /* passed to CTL */ @@ -187,6 +193,7 @@ struct ctl_be_lun { be_lun_config_t lun_config_status; /* passed to CTL */ struct ctl_backend_driver *be; /* passed to CTL */ void *ctl_lun; /* used by CTL */ + STAILQ_HEAD(, ctl_be_lun_option) options; /* passed to CTL */ STAILQ_ENTRY(ctl_be_lun) links; /* used by CTL */ }; Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Aug 24 01:50:31 2013 (r254759) @@ -1639,6 +1639,7 @@ ctl_be_block_create(struct ctl_be_block_ STAILQ_INIT(&be_lun->input_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); + STAILQ_INIT(&be_lun->ctl_be_lun.options); sprintf(be_lun->lunname, "cblk%d", softc->num_luns); mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF); @@ -1740,6 +1741,16 @@ ctl_be_block_create(struct ctl_be_block_ } num_threads = tmp_num_threads; + } else if (strcmp(req->kern_be_args[i].kname, "file") != 0 && + strcmp(req->kern_be_args[i].kname, "dev") != 0) { + struct ctl_be_lun_option *opt; + + opt = malloc(sizeof(*opt), M_CTLBLK, M_WAITOK); + opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTLBLK, M_WAITOK); + strcpy(opt->name, req->kern_be_args[i].kname); + opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTLBLK, M_WAITOK); + strcpy(opt->value, req->kern_be_args[i].kvalue); + STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); } } Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Aug 24 01:50:31 2013 (r254759) @@ -491,7 +491,7 @@ ctl_backend_ramdisk_create(struct ctl_be struct ctl_lun_create_params *params; uint32_t blocksize; char tmpstr[32]; - int retval; + int i, retval; retval = 0; params = &req->reqdata.create; @@ -509,6 +509,7 @@ ctl_backend_ramdisk_create(struct ctl_be sizeof(*be_lun)); goto bailout_error; } + STAILQ_INIT(&be_lun->ctl_be_lun.options); if (params->flags & CTL_LUN_FLAG_DEV_TYPE) be_lun->ctl_be_lun.lun_type = params->device_type; @@ -545,6 +546,17 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; + for (i = 0; i < req->num_be_args; i++) { + struct ctl_be_lun_option *opt; + + opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK); + opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK); + strcpy(opt->name, req->kern_be_args[i].kname); + opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK); + strcpy(opt->value, req->kern_be_args[i].kvalue); + STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); + } + be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; be_lun->ctl_be_lun.be_lun = be_lun; Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl_frontend.h Sat Aug 24 01:50:31 2013 (r254759) @@ -49,6 +49,9 @@ typedef enum { typedef void (*port_func_t)(void *onoff_arg); typedef int (*targ_func_t)(void *arg, struct ctl_id targ_id); typedef int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id); +typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag, + struct thread *td); +typedef int (*fe_devid_t)(struct ctl_scsiio *ctsio, int alloc_len); /* * The ctl_frontend structure is the registration mechanism between a FETD @@ -213,6 +216,8 @@ struct ctl_frontend { targ_func_t targ_disable; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ + fe_ioctl_t ioctl; /* passed to CTL */ + fe_devid_t devid; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ void (*fe_done)(union ctl_io *io); /* passed to CTL */ Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Sat Aug 24 00:54:47 2013 (r254758) +++ head/sys/cam/ctl/ctl_io.h Sat Aug 24 01:50:31 2013 (r254759) @@ -204,6 +204,8 @@ struct ctl_nexus { uint32_t targ_port; /* Target port, filled in by PORT */ struct ctl_id targ_target; /* Destination target */ uint32_t targ_lun; /* Destination lun */ + uint32_t (*lun_map_fn)(void *arg, uint32_t lun); + void *lun_map_arg; }; typedef enum { From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 04:52:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A9E95DDA; Sat, 24 Aug 2013 04:52:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9616D2B39; Sat, 24 Aug 2013 04:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O4qN67033909; Sat, 24 Aug 2013 04:52:23 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O4qMji033904; Sat, 24 Aug 2013 04:52:22 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201308240452.r7O4qMji033904@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sat, 24 Aug 2013 04:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254760 - in head: share/man/man4 sys/cam/scsi sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 04:52:23 -0000 Author: ken Date: Sat Aug 24 04:52:22 2013 New Revision: 254760 URL: http://svnweb.freebsd.org/changeset/base/254760 Log: Add support to physio(9) for devices that don't want I/O split and configure sa(4) to request no I/O splitting by default. For tape devices, the user needs to be able to clearly understand what blocksize is actually being used when writing to a tape device. The previous behavior of physio(9) was that it would split up any I/O that was too large for the device, or too large to fit into MAXPHYS. This means that if, for instance, the user wrote a 1MB block to a tape device, and MAXPHYS was 128KB, the 1MB write would be split into 8 128K chunks. This would be done without informing the user. This has suboptimal effects, especially when trying to communicate status to the user. In the event of an error writing to a tape (e.g. physical end of tape) in the middle of a 1MB block that has been split into 8 pieces, the user could have the first two 128K pieces written successfully, the third returned with an error, and the last 5 returned with 0 bytes written. If the user is using a standard write(2) system call, all he will see is the ENOSPC error. He won't have a clue how much actually got written. (With a writev(2) system call, he should be able to determine how much got written in addition to the error.) The solution is to prevent physio(9) from splitting the I/O. The new cdev flag, SI_NOSPLIT, tells physio that the driver does not want I/O to be split beforehand. Although the sa(4) driver now enables SI_NOSPLIT by default, that can be disabled by two loader tunables for now. It will not be configurable starting in FreeBSD 11.0. kern.cam.sa.allow_io_split allows the user to configure I/O splitting for all sa(4) driver instances. kern.cam.sa.%d.allow_io_split allows the user to configure I/O splitting for a specific sa(4) instance. There are also now three sa(4) driver sysctl variables that let the users see some sa(4) driver values. kern.cam.sa.%d.allow_io_split shows whether I/O splitting is turned on. kern.cam.sa.%d.maxio shows the maximum I/O size allowed by kernel configuration parameters (e.g. MAXPHYS, DFLTPHYS) and the capabilities of the controller. kern.cam.sa.%d.cpi_maxio shows the maximum I/O size supported by the controller. Note that a better long term solution would be to implement support for chaining buffers, so that that MAXPHYS is no longer a limiting factor for I/O size to tape and disk devices. At that point, the controller and the tape drive would become the limiting factors. sys/conf.h: Add a new cdev flag, SI_NOSPLIT, that allows a driver to tell physio not to split up I/O. sys/param.h: Bump __FreeBSD_version to 1000049 for the addition of the SI_NOSPLIT cdev flag. kern_physio.c: If the SI_NOSPLIT flag is set on the cdev, return any I/O that is larger than si_iosize_max or MAXPHYS, has more than one segment, or would have to be split because of misalignment with EFBIG. (File too large). In the event of an error, print a console message to give the user a clue about what happened. scsi_sa.c: Set the SI_NOSPLIT cdev flag on the devices created for the sa(4) driver by default. Add tunables to control whether we allow I/O splitting in physio(9). Explain in the comments that allowing I/O splitting will be deprecated for the sa(4) driver in FreeBSD 11.0. Add sysctl variables to display the maximum I/O size we can do (which could be further limited by read block limits) and the maximum I/O size that the controller can do. Limit our maximum I/O size (recorded in the cdev's si_iosize_max) by MAXPHYS. This isn't strictly necessary, because physio(9) will limit it to MAXPHYS, but it will provide some clarity for the application. Record the controller's maximum I/O size reported in the Path Inquiry CCB. sa.4: Document the block size behavior, and explain that the option of allowing physio(9) to split the I/O will disappear in FreeBSD 11.0. Sponsored by: Spectra Logic Modified: head/share/man/man4/sa.4 head/sys/cam/scsi/scsi_sa.c head/sys/kern/kern_physio.c head/sys/sys/conf.h head/sys/sys/param.h Modified: head/share/man/man4/sa.4 ============================================================================== --- head/share/man/man4/sa.4 Sat Aug 24 01:50:31 2013 (r254759) +++ head/share/man/man4/sa.4 Sat Aug 24 04:52:22 2013 (r254760) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 1999 +.Dd August 23, 2013 .Dt SA 4 .Os .Sh NAME @@ -159,6 +159,70 @@ of 0. (As above, if the file mark is never read, it remains for the next process to read if in no-rewind mode.) .El +.Sh BLOCK SIZES +By default, the driver will NOT accept reads or writes to a tape device that +are larger than may be written to or read from the mounted tape using a single +write or read request. +Because of this, the application author may have confidence that his wishes +are respected in terms of the block size written to tape. +For example, if the user tries to write a 256KB block to the tape, but the +controller can handle no more than 128KB, the write will fail. +The previous +.Fx +behavior, prior to +.Fx +10.0, +was to break up large reads or writes into smaller blocks when going to the +tape. +The problem with that behavior, though, is that it hides the actual on-tape +block size from the application writer, at least in variable block mode. +.Pp +If the user would like his large reads and writes broken up into separate +pieces, he may set the following loader tunables. +Note that these tunables WILL GO AWAY in +.Fx 11.0 . +They are provided for transition purposes only. +.Bl -tag -width 12 +.It kern.cam.sa.allow_io_split +.Pp +This variable, when set to 1, will configure all +.Nm +devices to split large buffers into smaller pieces when needed. +.It kern.cam.sa.%d.allow_io_split +.Pp +This variable, when set to 1, will configure the given +.Nm +unit to split large buffers into multiple pieces. +This will override the global setting, if it exists. +.El +.Pp +There are several +.Xr sysctl 8 +variables available to view block handling parameters: +.Bl -tag -width 12 +.It kern.cam.sa.%d.allow_io_split +.Pp +This variable allows the user to see, but not modify, the current I/O split +setting. +The user is not permitted to modify this setting so that there is no chance +of behavior changing for the application while a tape is mounted. +.It kern.cam.sa.%d.maxio +.Pp +This variable shows the maximum I/O size in bytes that is allowed by the +combination of kernel tuning parameters (MAXPHYS, DFLTPHYS) and the +capabilities of the controller that is attached to the tape drive. +Applications may look at this value for a guide on how large an I/O may be +permitted, but should keep in mind that the actual maximum may be +restricted further by the tape drive via the +.Tn SCSI +READ BLOCK LIMITS command. +.It kern.cam.sa.%d.cpi_maxio +.Pp +This variable shows the maximum I/O size supported by the controller, in +bytes, that is reported via the CAM Path Inquiry CCB (XPT_PATH_INQ). +If this is 0, that means that the controller has not reported a maximum I/O +size. +.El .Sh FILE MARK HANDLING The handling of file marks on write is automatic. If the user has Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Sat Aug 24 01:50:31 2013 (r254759) +++ head/sys/cam/scsi/scsi_sa.c Sat Aug 24 04:52:22 2013 (r254760) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #ifdef _KERNEL #include +#include +#include #endif #include #include @@ -223,6 +225,8 @@ struct sa_softc { u_int32_t max_blk; u_int32_t min_blk; u_int32_t maxio; + u_int32_t cpi_maxio; + int allow_io_split; u_int32_t comp_algorithm; u_int32_t saved_comp_algorithm; u_int32_t media_blksize; @@ -268,6 +272,10 @@ struct sa_softc { open_rdonly : 1, /* open read-only */ open_pending_mount : 1, /* open pending mount */ ctrl_mode : 1; /* control device open */ + + struct task sysctl_task; + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; }; struct sa_quirk_entry { @@ -426,6 +434,22 @@ static int sardpos(struct cam_periph *p static int sasetpos(struct cam_periph *periph, int, u_int32_t *); +#ifndef SA_DEFAULT_IO_SPLIT +#define SA_DEFAULT_IO_SPLIT 0 +#endif + +static int sa_allow_io_split = SA_DEFAULT_IO_SPLIT; + +/* + * Tunable to allow the user to set a global allow_io_split value. Note + * that this WILL GO AWAY in FreeBSD 11.0. Silently splitting the I/O up + * is bad behavior, because it hides the true tape block size from the + * application. + */ +TUNABLE_INT("kern.cam.sa.allow_io_split", &sa_allow_io_split); +static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD, 0, + "CAM Sequential Access Tape Driver"); + static struct periph_driver sadriver = { sainit, "sa", @@ -1448,6 +1472,49 @@ saasync(void *callback_arg, u_int32_t co } } +static void +sasysctlinit(void *context, int pending) +{ + struct cam_periph *periph; + struct sa_softc *softc; + char tmpstr[80], tmpstr2[80]; + + periph = (struct cam_periph *)context; + /* + * If the periph is invalid, no need to setup the sysctls. + */ + if (periph->flags & CAM_PERIPH_INVALID) + goto bailout; + + softc = (struct sa_softc *)periph->softc; + + snprintf(tmpstr, sizeof(tmpstr), "CAM SA unit %d", periph->unit_number); + snprintf(tmpstr2, sizeof(tmpstr2), "%u", periph->unit_number); + + sysctl_ctx_init(&softc->sysctl_ctx); + softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_kern_cam_sa), OID_AUTO, tmpstr2, + CTLFLAG_RD, 0, tmpstr); + if (softc->sysctl_tree == NULL) + goto bailout; + + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN, + &softc->allow_io_split, 0, "Allow Splitting I/O"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, + &softc->maxio, 0, "Maximum I/O size"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "cpi_maxio", CTLTYPE_INT | CTLFLAG_RD, + &softc->cpi_maxio, 0, "Maximum Controller I/O size"); + +bailout: + /* + * Release the reference that was held when this task was enqueued. + */ + cam_periph_release(periph); +} + static cam_status saregister(struct cam_periph *periph, void *arg) { @@ -1455,6 +1522,7 @@ saregister(struct cam_periph *periph, vo struct ccb_getdev *cgd; struct ccb_pathinq cpi; caddr_t match; + char tmpstr[80]; int i; cgd = (struct ccb_getdev *)arg; @@ -1509,21 +1577,55 @@ saregister(struct cam_periph *periph, vo XPORT_DEVSTAT_TYPE(cpi.transport), DEVSTAT_PRIORITY_TAPE); /* - * If maxio isn't set, we fall back to DFLTPHYS. If it is set, we - * take it whether or not it's larger than MAXPHYS. physio will - * break it down into pieces small enough to fit in a buffer. + * Load the default value that is either compiled in, or loaded + * in the global kern.cam.sa.allow_io_split tunable. + */ + softc->allow_io_split = sa_allow_io_split; + + /* + * Load a per-instance tunable, if it exists. NOTE that this + * tunable WILL GO AWAY in FreeBSD 11.0. + */ + snprintf(tmpstr, sizeof(tmpstr), "kern.cam.sa.%u.allow_io_split", + periph->unit_number); + TUNABLE_INT_FETCH(tmpstr, &softc->allow_io_split); + + /* + * If maxio isn't set, we fall back to DFLTPHYS. Otherwise we take + * the smaller of cpi.maxio or MAXPHYS. */ if (cpi.maxio == 0) softc->maxio = DFLTPHYS; + else if (cpi.maxio > MAXPHYS) + softc->maxio = MAXPHYS; else softc->maxio = cpi.maxio; /* + * Record the controller's maximum I/O size so we can report it to + * the user later. + */ + softc->cpi_maxio = cpi.maxio; + + /* + * By default we tell physio that we do not want our I/O split. + * The user needs to have a 1:1 mapping between the size of his + * write to a tape character device and the size of the write + * that actually goes down to the drive. + */ + if (softc->allow_io_split == 0) + softc->si_flags = SI_NOSPLIT; + else + softc->si_flags = 0; + + TASK_INIT(&softc->sysctl_task, 0, sasysctlinit, periph); + + /* * If the SIM supports unmapped I/O, let physio know that we can * handle unmapped buffers. */ if (cpi.hba_misc & PIM_UNMAPPED) - softc->si_flags = SI_UNMAPPED; + softc->si_flags |= SI_UNMAPPED; softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR, @@ -1586,6 +1688,13 @@ saregister(struct cam_periph *periph, vo cam_periph_lock(periph); /* + * Bump the peripheral refcount for the sysctl thread, in case we + * get invalidated before the thread has a chance to run. + */ + cam_periph_acquire(periph); + taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); + + /* * Add an async callback so that we get * notified if this device goes away. */ Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Sat Aug 24 01:50:31 2013 (r254759) +++ head/sys/kern/kern_physio.c Sat Aug 24 04:52:22 2013 (r254760) @@ -54,6 +54,36 @@ physio(struct cdev *dev, struct uio *uio dev->si_iosize_max = DFLTPHYS; } + /* + * If the driver does not want I/O to be split, that means that we + * need to reject any requests that will not fit into one buffer. + */ + if ((dev->si_flags & SI_NOSPLIT) && + ((uio->uio_resid > dev->si_iosize_max) || + (uio->uio_resid > MAXPHYS) || + (uio->uio_iovcnt > 1))) { + /* + * Tell the user why his I/O was rejected. + */ + if (uio->uio_resid > dev->si_iosize_max) + printf("%s: request size %zd > si_iosize_max=%d, " + "cannot split request\n", devtoname(dev), + uio->uio_resid, dev->si_iosize_max); + + if (uio->uio_resid > MAXPHYS) + printf("%s: request size %zd > MAXPHYS=%d, " + "cannot split request\n", devtoname(dev), + uio->uio_resid, MAXPHYS); + + if (uio->uio_iovcnt > 1) + printf("%s: request vectors=%d > 1, " + "cannot split request\n", devtoname(dev), + uio->uio_iovcnt); + + error = EFBIG; + goto doerror; + } + for (i = 0; i < uio->uio_iovcnt; i++) { while (uio->uio_iov[i].iov_len) { bp->b_flags = 0; @@ -83,6 +113,17 @@ physio(struct cdev *dev, struct uio *uio */ iolen = ((vm_offset_t) bp->b_data) & PAGE_MASK; if ((bp->b_bcount + iolen) > bp->b_kvasize) { + /* + * This device does not want I/O to be split. + */ + if (dev->si_flags & SI_NOSPLIT) { + printf("%s: request ptr %#jx is not " + "on a page boundary, cannot split " + "request\n", devtoname(dev), + (uintmax_t)bp->b_data); + error = EFBIG; + goto doerror; + } bp->b_bcount = bp->b_kvasize; if (iolen != 0) bp->b_bcount -= PAGE_SIZE; Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sat Aug 24 01:50:31 2013 (r254759) +++ head/sys/sys/conf.h Sat Aug 24 04:52:22 2013 (r254760) @@ -62,6 +62,7 @@ struct cdev { #define SI_DUMPDEV 0x0080 /* is kernel dumpdev */ #define SI_CLONELIST 0x0200 /* on a clone list */ #define SI_UNMAPPED 0x0400 /* can handle unmapped I/O */ +#define SI_NOSPLIT 0x0800 /* I/O should not be split up */ struct timespec si_atime; struct timespec si_ctime; struct timespec si_mtime; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Aug 24 01:50:31 2013 (r254759) +++ head/sys/sys/param.h Sat Aug 24 04:52:22 2013 (r254760) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000048 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000049 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 07:17:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 595D4A2C; Sat, 24 Aug 2013 07:17:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45FBE2FA8; Sat, 24 Aug 2013 07:17:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O7HTZ0006169; Sat, 24 Aug 2013 07:17:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O7HSMU006167; Sat, 24 Aug 2013 07:17:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308240717.r7O7HSMU006167@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 24 Aug 2013 07:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254761 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 07:17:29 -0000 Author: hselasky Date: Sat Aug 24 07:17:28 2013 New Revision: 254761 URL: http://svnweb.freebsd.org/changeset/base/254761 Log: MFC r254438: Fix some USB controller names according to pciconf output. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/dev/usb/controller/ehci_pci.c stable/9/sys/dev/usb/controller/ohci_pci.c Modified: stable/9/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci_pci.c Sat Aug 24 04:52:22 2013 (r254760) +++ stable/9/sys/dev/usb/controller/ehci_pci.c Sat Aug 24 07:17:28 2013 (r254761) @@ -165,7 +165,7 @@ ehci_pci_match(device_t self) case 0x00e810de: return "NVIDIA nForce3 250 USB 2.0 controller"; case 0x005b10de: - return "NVIDIA nForce4 USB 2.0 controller"; + return "NVIDIA nForce CK804 USB 2.0 controller"; case 0x036d10de: return "NVIDIA nForce MCP55 USB 2.0 controller"; case 0x03f210de: Modified: stable/9/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ohci_pci.c Sat Aug 24 04:52:22 2013 (r254760) +++ stable/9/sys/dev/usb/controller/ohci_pci.c Sat Aug 24 07:17:28 2013 (r254761) @@ -154,6 +154,8 @@ ohci_pci_match(device_t self) case 0x00d710de: return ("nVidia nForce3 USB Controller"); + case 0x005a10de: + return ("nVidia nForce CK804 USB Controller"); case 0x036c10de: return ("nVidia nForce MCP55 USB Controller"); case 0x03f110de: From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 07:19:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 204CDB70; Sat, 24 Aug 2013 07:19:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC022FB9; Sat, 24 Aug 2013 07:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O7JvCb006993; Sat, 24 Aug 2013 07:19:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O7JvCY006991; Sat, 24 Aug 2013 07:19:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201308240719.r7O7JvCY006991@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 24 Aug 2013 07:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r254762 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 07:19:58 -0000 Author: hselasky Date: Sat Aug 24 07:19:57 2013 New Revision: 254762 URL: http://svnweb.freebsd.org/changeset/base/254762 Log: MFC r254438: Fix some USB controller names according to pciconf output. Submitted by: Dmitry Luhtionov Modified: stable/8/sys/dev/usb/controller/ehci_pci.c stable/8/sys/dev/usb/controller/ohci_pci.c Directory Properties: stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci_pci.c Sat Aug 24 07:17:28 2013 (r254761) +++ stable/8/sys/dev/usb/controller/ehci_pci.c Sat Aug 24 07:19:57 2013 (r254762) @@ -165,7 +165,7 @@ ehci_pci_match(device_t self) case 0x00e810de: return "NVIDIA nForce3 250 USB 2.0 controller"; case 0x005b10de: - return "NVIDIA nForce4 USB 2.0 controller"; + return "NVIDIA nForce CK804 USB 2.0 controller"; case 0x036d10de: return "NVIDIA nForce MCP55 USB 2.0 controller"; case 0x03f210de: Modified: stable/8/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ohci_pci.c Sat Aug 24 07:17:28 2013 (r254761) +++ stable/8/sys/dev/usb/controller/ohci_pci.c Sat Aug 24 07:19:57 2013 (r254762) @@ -152,6 +152,8 @@ ohci_pci_match(device_t self) case 0x00d710de: return ("nVidia nForce3 USB Controller"); + case 0x005a10de: + return ("nVidia nForce CK804 USB Controller"); case 0x036c10de: return ("nVidia nForce MCP55 USB Controller"); case 0x03f110de: From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 09:42:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D346E3E; Sat, 24 Aug 2013 09:42:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 717CC24AC; Sat, 24 Aug 2013 09:42:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O9gFrv083078; Sat, 24 Aug 2013 09:42:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O9gFaI083076; Sat, 24 Aug 2013 09:42:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201308240942.r7O9gFaI083076@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 Aug 2013 09:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254766 - in head/sys: cam geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 09:42:15 -0000 Author: mav Date: Sat Aug 24 09:42:14 2013 New Revision: 254766 URL: http://svnweb.freebsd.org/changeset/base/254766 Log: Add new attribute lunname to report only textual LUN-specific device IDs. While lunid attribute prefers to report numeric ones, having both may be useful in some situations. Modified: head/sys/cam/cam_xpt.c head/sys/geom/geom_disk.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sat Aug 24 08:47:09 2013 (r254765) +++ head/sys/cam/cam_xpt.c Sat Aug 24 09:42:14 2013 (r254766) @@ -1091,7 +1091,8 @@ xpt_getattr(char *buf, size_t len, const cdai.buftype = CDAI_TYPE_SERIAL_NUM; else if (!strcmp(attr, "GEOM::physpath")) cdai.buftype = CDAI_TYPE_PHYS_PATH; - else if (!strcmp(attr, "GEOM::lunid")) { + else if (strcmp(attr, "GEOM::lunid") == 0 || + strcmp(attr, "GEOM::lunname") == 0) { cdai.buftype = CDAI_TYPE_SCSI_DEVID; cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; } else @@ -1108,11 +1109,14 @@ xpt_getattr(char *buf, size_t len, const if (cdai.provsiz == 0) goto out; if (cdai.buftype == CDAI_TYPE_SCSI_DEVID) { - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_naa); - if (idd == NULL) + if (strcmp(attr, "GEOM::lunid") == 0) { idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_eui64); + cdai.provsiz, scsi_devid_is_lun_naa); + if (idd == NULL) + idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, + cdai.provsiz, scsi_devid_is_lun_eui64); + } else + idd = NULL; if (idd == NULL) idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, cdai.provsiz, scsi_devid_is_lun_t10); Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat Aug 24 08:47:09 2013 (r254765) +++ head/sys/geom/geom_disk.c Sat Aug 24 09:42:14 2013 (r254766) @@ -460,6 +460,12 @@ g_disk_dumpconf(struct sbuf *sb, const c if (dp->d_getattr(bp) == 0) sbuf_printf(sb, "%s%s\n", indent, buf); + bp->bio_attribute = "GEOM::lunname"; + bp->bio_length = DISK_IDENT_SIZE; + bp->bio_data = buf; + if (dp->d_getattr(bp) == 0) + sbuf_printf(sb, "%s%s\n", + indent, buf); g_destroy_bio(bp); g_free(buf); } else From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 09:57:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B59AB2D6; Sat, 24 Aug 2013 09:57:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1813252D; Sat, 24 Aug 2013 09:57:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7O9vWiF089801; Sat, 24 Aug 2013 09:57:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7O9vW3N089800; Sat, 24 Aug 2013 09:57:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308240957.r7O9vW3N089800@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 24 Aug 2013 09:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254767 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 09:57:32 -0000 Author: jilles Date: Sat Aug 24 09:57:32 2013 New Revision: 254767 URL: http://svnweb.freebsd.org/changeset/base/254767 Log: sh: Do not prematurely discard stopped jobs in a wait builtin. If a job is specified to 'wait', wait for it to complete. Formerly, in interactive mode, the job was deleted if it stopped. If no jobs are specified in interactive mode, 'wait' still waits for all jobs to complete or stop. In non-interactive mode, WUNTRACED is not passed to wait3() so stopped jobs are not detected. PR: bin/181435 Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Aug 24 09:42:14 2013 (r254766) +++ head/bin/sh/jobs.c Sat Aug 24 09:57:32 2013 (r254767) @@ -495,14 +495,10 @@ waitcmdloop(struct job *job) in_waitcmd++; do { if (job != NULL) { - if (job->state) { + if (job->state == JOBDONE) { status = job->ps[job->nprocs - 1].status; if (WIFEXITED(status)) retval = WEXITSTATUS(status); -#if JOBS - else if (WIFSTOPPED(status)) - retval = WSTOPSIG(status) + 128; -#endif else retval = WTERMSIG(status) + 128; if (! iflag || ! job->changed) From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 10:06:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6B304788; Sat, 24 Aug 2013 10:06:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55D6625B2; Sat, 24 Aug 2013 10:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OA6r7Q095170; Sat, 24 Aug 2013 10:06:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OA6qXU095163; Sat, 24 Aug 2013 10:06:52 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308241006.r7OA6qXU095163@svn.freebsd.org> From: Ed Maste Date: Sat, 24 Aug 2013 10:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254768 - in head/contrib/llvm/tools/lldb: include/lldb/Expression source/Expression source/Host/common source/Plugins/Disassembler/llvm source/Plugins/Instruction/ARM X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 10:06:53 -0000 Author: emaste Date: Sat Aug 24 10:06:51 2013 New Revision: 254768 URL: http://svnweb.freebsd.org/changeset/base/254768 Log: Revert lldb changes due to post-3.3 clang and llvm API changes Revisions: svn git 183929 99447a6 183862 15c1774 source/Host/common/FileSpec.cpp 184954 007e7bc 184948 4dc3761 source/Expression/ClangExpressionParser.cpp 182099 b31044e 181387 779e6ac include/lldb/Expression/IRExecutionUnit.h source/Expression/IRExecutionUnit.cpp 184177 0b2934b 182650 f2dcf35 181703 7bef4e2 source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp 182683 0d91b80 source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Modified: head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h Sat Aug 24 09:57:32 2013 (r254767) +++ head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h Sat Aug 24 10:06:51 2013 (r254768) @@ -336,13 +336,7 @@ private: /// @return /// True in case of failure, false in case of success. //------------------------------------------------------------------ - virtual bool finalizeMemory(std::string *ErrMsg) { - // TODO: Ensure that the instruction cache is flushed because - // relocations are updated by dy-load. See: - // sys::Memory::InvalidateInstructionCache - // llvm::SectionMemoryManager - return false; - } + bool applyPermissions(std::string *ErrMsg) { return false; } //------------------------------------------------------------------ /// Passthrough interface stub @@ -352,6 +346,38 @@ private: //------------------------------------------------------------------ /// Passthrough interface stub //------------------------------------------------------------------ + virtual uint8_t* startExceptionTable(const llvm::Function* F, + uintptr_t &ActualSize); + + //------------------------------------------------------------------ + /// Complete the exception table for a function, and add it to the + /// m_exception_tables map + /// + /// @param[in] F + /// The function whose exception table is being written. + /// + /// @param[in] TableStart + /// The first byte of the exception table. + /// + /// @param[in] TableEnd + /// The last byte of the exception table. + /// + /// @param[in] FrameRegister + /// I don't know what this does, but it's passed through. + //------------------------------------------------------------------ + virtual void endExceptionTable(const llvm::Function *F, + uint8_t *TableStart, + uint8_t *TableEnd, + uint8_t* FrameRegister); + + //------------------------------------------------------------------ + /// Passthrough interface stub + //------------------------------------------------------------------ + virtual void deallocateExceptionTable(void *ET); + + //------------------------------------------------------------------ + /// Passthrough interface stub + //------------------------------------------------------------------ virtual size_t GetDefaultCodeSlabSize() { return m_default_mm_ap->GetDefaultCodeSlabSize(); } Modified: head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp Sat Aug 24 09:57:32 2013 (r254767) +++ head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp Sat Aug 24 10:06:51 2013 (r254768) @@ -52,7 +52,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/FileSystem.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/TargetSelect.h" #if defined(__FreeBSD__) @@ -81,16 +81,19 @@ using namespace lldb_private; //===----------------------------------------------------------------------===// std::string GetBuiltinIncludePath(const char *Argv0) { - SmallString<128> P(llvm::sys::fs::getMainExecutable( - Argv0, (void *)(intptr_t) GetBuiltinIncludePath)); - - if (!P.empty()) { - llvm::sys::path::remove_filename(P); // Remove /clang from foo/bin/clang - llvm::sys::path::remove_filename(P); // Remove /bin from foo/bin - + llvm::sys::Path P = + llvm::sys::Path::GetMainExecutable(Argv0, + (void*)(intptr_t) GetBuiltinIncludePath); + + if (!P.isEmpty()) { + P.eraseComponent(); // Remove /clang from foo/bin/clang + P.eraseComponent(); // Remove /bin from foo/bin + // Get foo/lib/clang//include - llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING, - "include"); + P.appendComponent("lib"); + P.appendComponent("clang"); + P.appendComponent(CLANG_VERSION_STRING); + P.appendComponent("include"); } return P.str(); Modified: head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp Sat Aug 24 09:57:32 2013 (r254767) +++ head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp Sat Aug 24 10:06:51 2013 (r254768) @@ -563,6 +563,28 @@ IRExecutionUnit::MemoryManager::dealloca m_default_mm_ap->deallocateFunctionBody(Body); } +uint8_t* +IRExecutionUnit::MemoryManager::startExceptionTable(const llvm::Function* F, + uintptr_t &ActualSize) +{ + return m_default_mm_ap->startExceptionTable(F, ActualSize); +} + +void +IRExecutionUnit::MemoryManager::endExceptionTable(const llvm::Function *F, + uint8_t *TableStart, + uint8_t *TableEnd, + uint8_t* FrameRegister) +{ + m_default_mm_ap->endExceptionTable(F, TableStart, TableEnd, FrameRegister); +} + +void +IRExecutionUnit::MemoryManager::deallocateExceptionTable(void *ET) +{ + m_default_mm_ap->deallocateExceptionTable (ET); +} + lldb::addr_t IRExecutionUnit::GetRemoteAddressForLocal (lldb::addr_t local_address) { Modified: head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp Sat Aug 24 09:57:32 2013 (r254767) +++ head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp Sat Aug 24 10:06:51 2013 (r254768) @@ -553,8 +553,9 @@ FileSpec::ResolveExecutableLocation () if (file_cstr) { const std::string file_str (file_cstr); - std::string path = llvm::sys::FindProgramByName (file_str); - llvm::StringRef dir_ref = llvm::sys::path::parent_path(path); + llvm::sys::Path path = llvm::sys::Program::FindProgramByName (file_str); + const std::string &path_str = path.str(); + llvm::StringRef dir_ref = llvm::sys::path::parent_path(path_str); //llvm::StringRef dir_ref = path.getDirname(); if (! dir_ref.empty()) { Modified: head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Sat Aug 24 09:57:32 2013 (r254767) +++ head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Sat Aug 24 10:06:51 2013 (r254768) @@ -10,7 +10,6 @@ #include "DisassemblerLLVMC.h" #include "llvm-c/Disassembler.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler.h" @@ -18,7 +17,6 @@ #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" -#include "llvm/MC/MCRelocationInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MemoryObject.h" @@ -442,30 +440,23 @@ DisassemblerLLVMC::LLVMCDisassembler::LL m_subtarget_info_ap.reset(curr_target->createMCSubtargetInfo(triple, "", features_str)); - m_asm_info_ap.reset(curr_target->createMCAsmInfo(*curr_target->createMCRegInfo(triple), triple)); - + m_asm_info_ap.reset(curr_target->createMCAsmInfo(triple)); + if (m_instr_info_ap.get() == NULL || m_reg_info_ap.get() == NULL || m_subtarget_info_ap.get() == NULL || m_asm_info_ap.get() == NULL) { m_is_valid = false; return; } - m_context_ap.reset(new llvm::MCContext(m_asm_info_ap.get(), m_reg_info_ap.get(), 0)); + m_context_ap.reset(new llvm::MCContext(*m_asm_info_ap.get(), *(m_reg_info_ap.get()), 0)); m_disasm_ap.reset(curr_target->createMCDisassembler(*m_subtarget_info_ap.get())); - if (m_disasm_ap.get() && m_context_ap.get()) + if (m_disasm_ap.get()) { - llvm::OwningPtr RelInfo(curr_target->createMCRelocationInfo(triple, *m_context_ap.get())); - if (!RelInfo) - { - m_is_valid = false; - return; - } m_disasm_ap->setupForSymbolicDisassembly(NULL, - DisassemblerLLVMC::SymbolLookupCallback, - (void *) &owner, - m_context_ap.get(), - RelInfo); + DisassemblerLLVMC::SymbolLookupCallback, + (void *) &owner, + m_context_ap.get()); unsigned asm_printer_variant; if (flavor == ~0U) Modified: head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Sat Aug 24 09:57:32 2013 (r254767) +++ head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Sat Aug 24 10:06:51 2013 (r254768) @@ -25,7 +25,7 @@ #include "Utility/ARM_DWARF_Registers.h" #include "llvm/Support/MathExtras.h" // for SignExtend32 template function - // and countTrailingZeros function + // and CountTrailingZeros_32 function using namespace lldb; using namespace lldb_private; @@ -47,7 +47,7 @@ using namespace lldb_private; static uint32_t CountITSize (uint32_t ITMask) { // First count the trailing zeros of the IT mask. - uint32_t TZ = llvm::countTrailingZeros(ITMask); + uint32_t TZ = llvm::CountTrailingZeros_32(ITMask); if (TZ > 3) { #ifdef LLDB_CONFIGURATION_DEBUG From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 10:14:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B43078FE; Sat, 24 Aug 2013 10:14:00 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87C7225FC; Sat, 24 Aug 2013 10:14:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OAE0HL099798; Sat, 24 Aug 2013 10:14:00 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OAE0Qs099791; Sat, 24 Aug 2013 10:14:00 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241014.r7OAE0Qs099791@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 10:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254769 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 10:14:00 -0000 Author: andre Date: Sat Aug 24 10:13:59 2013 New Revision: 254769 URL: http://svnweb.freebsd.org/changeset/base/254769 Log: Introduce typedef for pfil hook callback function and replace all spelled out occurrences with it. Reviewed by: eri Modified: head/sys/net/pfil.c head/sys/net/pfil.h Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Sat Aug 24 10:06:51 2013 (r254768) +++ head/sys/net/pfil.c Sat Aug 24 10:13:59 2013 (r254769) @@ -225,8 +225,7 @@ pfil_head_get(int type, u_long val) * PFIL_WAITOK OK to call malloc with M_WAITOK. */ int -pfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, - struct inpcb *), void *arg, int flags, struct pfil_head *ph) +pfil_add_hook(pfil_func_t func, void *arg, int flags, struct pfil_head *ph) { struct packet_filter_hook *pfh1 = NULL; struct packet_filter_hook *pfh2 = NULL; @@ -285,8 +284,7 @@ error: * list. */ int -pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, - struct inpcb *), void *arg, int flags, struct pfil_head *ph) +pfil_remove_hook(pfil_func_t func, void *arg, int flags, struct pfil_head *ph) { int err = 0; @@ -334,9 +332,7 @@ pfil_list_add(pfil_list_t *list, struct * specified list. */ static int -pfil_list_remove(pfil_list_t *list, - int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), - void *arg) +pfil_list_remove(pfil_list_t *list, pfil_func_t func, void *arg) { struct packet_filter_hook *pfh; Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sat Aug 24 10:06:51 2013 (r254768) +++ head/sys/net/pfil.h Sat Aug 24 10:13:59 2013 (r254769) @@ -43,14 +43,16 @@ struct mbuf; struct ifnet; struct inpcb; +typedef int (*pfil_func_t)(void *, struct mbuf **, struct ifnet *, int, + struct inpcb *); + /* * The packet filter hooks are designed for anything to call them to * possibly intercept the packet. */ struct packet_filter_hook { TAILQ_ENTRY(packet_filter_hook) pfil_link; - int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, - struct inpcb *); + pfil_func_t pfil_func; void *pfil_arg; }; @@ -87,10 +89,8 @@ struct pfil_head { LIST_ENTRY(pfil_head) ph_list; }; -int pfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *, - int, struct inpcb *), void *, int, struct pfil_head *); -int pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, - int, struct inpcb *), void *, int, struct pfil_head *); +int pfil_add_hook(pfil_func_t, void *, int, struct pfil_head *); +int pfil_remove_hook(pfil_func_t, void *, int, struct pfil_head *); int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 10:30:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0FD6BB0E; Sat, 24 Aug 2013 10:30:21 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0F532674; Sat, 24 Aug 2013 10:30:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OAUKZg008697; Sat, 24 Aug 2013 10:30:20 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OAUK6f008696; Sat, 24 Aug 2013 10:30:20 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241030.r7OAUK6f008696@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 10:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254770 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 10:30:21 -0000 Author: andre Date: Sat Aug 24 10:30:20 2013 New Revision: 254770 URL: http://svnweb.freebsd.org/changeset/base/254770 Log: Convert one instance of pfil hook callback missed in r254769. Modified: head/sys/net/pfil.c Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Sat Aug 24 10:13:59 2013 (r254769) +++ head/sys/net/pfil.c Sat Aug 24 10:30:20 2013 (r254770) @@ -53,10 +53,7 @@ MTX_SYSINIT(pfil_heads_lock, &pfil_globa MTX_DEF); static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int); - -static int pfil_list_remove(pfil_list_t *, - int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), - void *); +static int pfil_list_remove(pfil_list_t *, pfil_func_t, void *); LIST_HEAD(pfilheadhead, pfil_head); VNET_DEFINE(struct pfilheadhead, pfil_head_list); From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 10:36:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 58D23DAF; Sat, 24 Aug 2013 10:36:34 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2857C26C7; Sat, 24 Aug 2013 10:36:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OAaYpH010899; Sat, 24 Aug 2013 10:36:34 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OAaXTl010897; Sat, 24 Aug 2013 10:36:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241036.r7OAaXTl010897@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 10:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254771 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 10:36:34 -0000 Author: andre Date: Sat Aug 24 10:36:33 2013 New Revision: 254771 URL: http://svnweb.freebsd.org/changeset/base/254771 Log: Internalize pfil_hook_get(). There are no outside consumers of this API, it is only safe for internal use and even the pfil(9) man page says so in the BUGS section. Reviewed by: eri Modified: head/sys/net/pfil.c head/sys/net/pfil.h Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Sat Aug 24 10:30:20 2013 (r254770) +++ head/sys/net/pfil.c Sat Aug 24 10:36:33 2013 (r254771) @@ -52,6 +52,7 @@ static struct mtx pfil_global_lock; MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", MTX_DEF); +static struct packet_filter_hook *pfil_hook_get(int, struct pfil_head *); static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int); static int pfil_list_remove(pfil_list_t *, pfil_func_t, void *); @@ -89,6 +90,18 @@ pfil_run_hooks(struct pfil_head *ph, str return (rv); } +static struct packet_filter_hook * +pfil_hook_get(int dir, struct pfil_head *ph) +{ + + if (dir == PFIL_IN) + return (TAILQ_FIRST(&ph->ph_in)); + else if (dir == PFIL_OUT) + return (TAILQ_FIRST(&ph->ph_out)); + else + return (NULL); +} + /* * pfil_try_rlock() acquires rm reader lock for specified head * if this is immediately possible. Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sat Aug 24 10:30:20 2013 (r254770) +++ head/sys/net/pfil.h Sat Aug 24 10:36:33 2013 (r254771) @@ -132,16 +132,4 @@ struct pfil_head *pfil_head_get(int, u_l #define PFIL_LIST_LOCK() mtx_lock(&pfil_global_lock) #define PFIL_LIST_UNLOCK() mtx_unlock(&pfil_global_lock) -static __inline struct packet_filter_hook * -pfil_hook_get(int dir, struct pfil_head *ph) -{ - - if (dir == PFIL_IN) - return (TAILQ_FIRST(&ph->ph_in)); - else if (dir == PFIL_OUT) - return (TAILQ_FIRST(&ph->ph_out)); - else - return (NULL); -} - #endif /* _NET_PFIL_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 10:38:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD136EFC; Sat, 24 Aug 2013 10:38:02 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9926826D7; Sat, 24 Aug 2013 10:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OAc2Kt011438; Sat, 24 Aug 2013 10:38:02 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OAc2hY011437; Sat, 24 Aug 2013 10:38:02 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241038.r7OAc2hY011437@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 10:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254772 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 10:38:02 -0000 Author: andre Date: Sat Aug 24 10:38:02 2013 New Revision: 254772 URL: http://svnweb.freebsd.org/changeset/base/254772 Log: pfil_hook_get() has been internalized in r254771 and is no longer part of the API. It wasn't safe for external use in any case. Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sat Aug 24 10:36:33 2013 (r254771) +++ head/share/man/man9/pfil.9 Sat Aug 24 10:38:02 2013 (r254772) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2012 +.Dd August 23, 2013 .Dt PFIL 9 .Os .Sh NAME @@ -36,7 +36,6 @@ .Nm pfil_head_register , .Nm pfil_head_unregister , .Nm pfil_head_get , -.Nm pfil_hook_get , .Nm pfil_add_hook , .Nm pfil_remove_hook , .Nm pfil_run_hooks , @@ -56,8 +55,6 @@ .Fn pfil_head_unregister "struct pfil_head *head" .Ft "struct pfil_head *" .Fn pfil_head_get "int af" "u_long dlt" -.Ft "struct packet_filter_hook *" -.Fn pfil_hook_get "int dir" "struct pfil_head *head" .Ft void .Fn pfil_add_hook "int (*func)()" "void *arg" "int flags" "struct pfil_head *" .Ft void @@ -245,11 +242,7 @@ lock export was added in .Fx 10.0 . .Sh BUGS The -.Fn pfil_hook_get -function -is only safe for internal use. -.Pp -When a +.Fn When a .Vt pfil_head is being modified, no traffic is diverted (to avoid deadlock). From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 11:17:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D63AE624; Sat, 24 Aug 2013 11:17:25 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2FFC285B; Sat, 24 Aug 2013 11:17:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OBHPet032343; Sat, 24 Aug 2013 11:17:25 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OBHPQ1032341; Sat, 24 Aug 2013 11:17:25 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241117.r7OBHPQ1032341@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 11:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254773 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 11:17:26 -0000 Author: andre Date: Sat Aug 24 11:17:25 2013 New Revision: 254773 URL: http://svnweb.freebsd.org/changeset/base/254773 Log: Resolve the confusion between the head_list and the hook list. The linked list of pfil hooks is changed to "chain" and this term is applied consistently. The head_list remains with "list" term. Add KASSERT to vnet_pfil_uninit(). Update and extend comments. Reviewed by: eri (previous version) Modified: head/sys/net/pfil.c head/sys/net/pfil.h Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Sat Aug 24 10:38:02 2013 (r254772) +++ head/sys/net/pfil.c Sat Aug 24 11:17:25 2013 (r254773) @@ -52,9 +52,9 @@ static struct mtx pfil_global_lock; MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", MTX_DEF); -static struct packet_filter_hook *pfil_hook_get(int, struct pfil_head *); -static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int); -static int pfil_list_remove(pfil_list_t *, pfil_func_t, void *); +static struct packet_filter_hook *pfil_chain_get(int, struct pfil_head *); +static int pfil_chain_add(pfil_chain_t *, struct packet_filter_hook *, int); +static int pfil_chain_remove(pfil_chain_t *, pfil_func_t, void *); LIST_HEAD(pfilheadhead, pfil_head); VNET_DEFINE(struct pfilheadhead, pfil_head_list); @@ -63,7 +63,7 @@ VNET_DEFINE(struct rmlock, pfil_lock); #define V_pfil_lock VNET(pfil_lock) /* - * pfil_run_hooks() runs the specified packet filter hooks. + * pfil_run_hooks() runs the specified packet filter hook chain. */ int pfil_run_hooks(struct pfil_head *ph, struct mbuf **mp, struct ifnet *ifp, @@ -76,8 +76,8 @@ pfil_run_hooks(struct pfil_head *ph, str PFIL_RLOCK(ph, &rmpt); KASSERT(ph->ph_nhooks >= 0, ("Pfil hook count dropped < 0")); - for (pfh = pfil_hook_get(dir, ph); pfh != NULL; - pfh = TAILQ_NEXT(pfh, pfil_link)) { + for (pfh = pfil_chain_get(dir, ph); pfh != NULL; + pfh = TAILQ_NEXT(pfh, pfil_chain)) { if (pfh->pfil_func != NULL) { rv = (*pfh->pfil_func)(pfh->pfil_arg, &m, ifp, dir, inp); @@ -91,7 +91,7 @@ pfil_run_hooks(struct pfil_head *ph, str } static struct packet_filter_hook * -pfil_hook_get(int dir, struct pfil_head *ph) +pfil_chain_get(int dir, struct pfil_head *ph) { if (dir == PFIL_IN) @@ -163,6 +163,7 @@ pfil_wowned(struct pfil_head *ph) return (PFIL_WOWNED(ph)); } + /* * pfil_head_register() registers a pfil_head with the packet filter hook * mechanism. @@ -202,9 +203,9 @@ pfil_head_unregister(struct pfil_head *p PFIL_LIST_LOCK(); LIST_REMOVE(ph, ph_list); PFIL_LIST_UNLOCK(); - TAILQ_FOREACH_SAFE(pfh, &ph->ph_in, pfil_link, pfnext) + TAILQ_FOREACH_SAFE(pfh, &ph->ph_in, pfil_chain, pfnext) free(pfh, M_IFADDR); - TAILQ_FOREACH_SAFE(pfh, &ph->ph_out, pfil_link, pfnext) + TAILQ_FOREACH_SAFE(pfh, &ph->ph_out, pfil_chain, pfnext) free(pfh, M_IFADDR); PFIL_LOCK_DESTROY(ph); return (0); @@ -261,7 +262,7 @@ pfil_add_hook(pfil_func_t func, void *ar if (flags & PFIL_IN) { pfh1->pfil_func = func; pfh1->pfil_arg = arg; - err = pfil_list_add(&ph->ph_in, pfh1, flags & ~PFIL_OUT); + err = pfil_chain_add(&ph->ph_in, pfh1, flags & ~PFIL_OUT); if (err) goto locked_error; ph->ph_nhooks++; @@ -269,10 +270,10 @@ pfil_add_hook(pfil_func_t func, void *ar if (flags & PFIL_OUT) { pfh2->pfil_func = func; pfh2->pfil_arg = arg; - err = pfil_list_add(&ph->ph_out, pfh2, flags & ~PFIL_IN); + err = pfil_chain_add(&ph->ph_out, pfh2, flags & ~PFIL_IN); if (err) { if (flags & PFIL_IN) - pfil_list_remove(&ph->ph_in, func, arg); + pfil_chain_remove(&ph->ph_in, func, arg); goto locked_error; } ph->ph_nhooks++; @@ -291,7 +292,7 @@ error: /* * pfil_remove_hook removes a specific function from the packet filter hook - * list. + * chain. */ int pfil_remove_hook(pfil_func_t func, void *arg, int flags, struct pfil_head *ph) @@ -300,12 +301,12 @@ pfil_remove_hook(pfil_func_t func, void PFIL_WLOCK(ph); if (flags & PFIL_IN) { - err = pfil_list_remove(&ph->ph_in, func, arg); + err = pfil_chain_remove(&ph->ph_in, func, arg); if (err == 0) ph->ph_nhooks--; } if ((err == 0) && (flags & PFIL_OUT)) { - err = pfil_list_remove(&ph->ph_out, func, arg); + err = pfil_chain_remove(&ph->ph_out, func, arg); if (err == 0) ph->ph_nhooks--; } @@ -313,15 +314,18 @@ pfil_remove_hook(pfil_func_t func, void return (err); } +/* + * Internal: Add a new pfil hook into a hook chain. + */ static int -pfil_list_add(pfil_list_t *list, struct packet_filter_hook *pfh1, int flags) +pfil_chain_add(pfil_chain_t *chain, struct packet_filter_hook *pfh1, int flags) { struct packet_filter_hook *pfh; /* * First make sure the hook is not already there. */ - TAILQ_FOREACH(pfh, list, pfil_link) + TAILQ_FOREACH(pfh, chain, pfil_chain) if (pfh->pfil_func == pfh1->pfil_func && pfh->pfil_arg == pfh1->pfil_arg) return (EEXIST); @@ -331,24 +335,23 @@ pfil_list_add(pfil_list_t *list, struct * the same path is followed in or out of the kernel. */ if (flags & PFIL_IN) - TAILQ_INSERT_HEAD(list, pfh1, pfil_link); + TAILQ_INSERT_HEAD(chain, pfh1, pfil_chain); else - TAILQ_INSERT_TAIL(list, pfh1, pfil_link); + TAILQ_INSERT_TAIL(chain, pfh1, pfil_chain); return (0); } /* - * pfil_list_remove is an internal function that takes a function off the - * specified list. + * Internal: Remove a pfil hook from a hook chain. */ static int -pfil_list_remove(pfil_list_t *list, pfil_func_t func, void *arg) +pfil_chain_remove(pfil_chain_t *chain, pfil_func_t func, void *arg) { struct packet_filter_hook *pfh; - TAILQ_FOREACH(pfh, list, pfil_link) + TAILQ_FOREACH(pfh, chain, pfil_chain) if (pfh->pfil_func == func && pfh->pfil_arg == arg) { - TAILQ_REMOVE(list, pfh, pfil_link); + TAILQ_REMOVE(chain, pfh, pfil_chain); free(pfh, M_IFADDR); return (0); } @@ -375,7 +378,8 @@ static int vnet_pfil_uninit(const void *unused) { - /* XXX should panic if list is not empty */ + KASSERT(LIST_EMPTY(&V_pfil_head_list), + ("%s: pfil_head_list %p not empty", __func__, &V_pfil_head_list)); PFIL_LOCK_DESTROY_REAL(&V_pfil_lock); return (0); } Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sat Aug 24 10:38:02 2013 (r254772) +++ head/sys/net/pfil.h Sat Aug 24 11:17:25 2013 (r254773) @@ -48,10 +48,11 @@ typedef int (*pfil_func_t)(void *, struc /* * The packet filter hooks are designed for anything to call them to - * possibly intercept the packet. + * possibly intercept the packet. Multiple filter hooks are chained + * together and after each other in the specified order. */ struct packet_filter_hook { - TAILQ_ENTRY(packet_filter_hook) pfil_link; + TAILQ_ENTRY(packet_filter_hook) pfil_chain; pfil_func_t pfil_func; void *pfil_arg; }; @@ -61,16 +62,20 @@ struct packet_filter_hook { #define PFIL_WAITOK 0x00000004 #define PFIL_ALL (PFIL_IN|PFIL_OUT) -typedef TAILQ_HEAD(pfil_list, packet_filter_hook) pfil_list_t; +typedef TAILQ_HEAD(pfil_chain, packet_filter_hook) pfil_chain_t; #define PFIL_TYPE_AF 1 /* key is AF_* type */ #define PFIL_TYPE_IFNET 2 /* key is ifnet pointer */ #define PFIL_FLAG_PRIVATE_LOCK 0x01 /* Personal lock instead of global */ +/* + * A pfil head is created by each protocol or packet intercept point. + * For packet is then run through the hook chain for inspection. + */ struct pfil_head { - pfil_list_t ph_in; - pfil_list_t ph_out; + pfil_chain_t ph_in; + pfil_chain_t ph_out; int ph_type; int ph_nhooks; #if defined( __linux__ ) || defined( _WIN32 ) @@ -89,11 +94,20 @@ struct pfil_head { LIST_ENTRY(pfil_head) ph_list; }; +/* Public functions for pfil hook management by packet filters. */ +struct pfil_head *pfil_head_get(int, u_long); int pfil_add_hook(pfil_func_t, void *, int, struct pfil_head *); int pfil_remove_hook(pfil_func_t, void *, int, struct pfil_head *); + +/* Public functions to run the packet inspection by protocols. */ int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); +/* Public functions for pfil head management by protocols. */ +int pfil_head_register(struct pfil_head *); +int pfil_head_unregister(struct pfil_head *); + +/* Internal pfil locking functions. */ struct rm_priotracker; /* Do not require including rmlock header */ int pfil_try_rlock(struct pfil_head *, struct rm_priotracker *); void pfil_rlock(struct pfil_head *, struct rm_priotracker *); @@ -102,11 +116,6 @@ void pfil_wlock(struct pfil_head *); void pfil_wunlock(struct pfil_head *); int pfil_wowned(struct pfil_head *ph); -int pfil_head_register(struct pfil_head *); -int pfil_head_unregister(struct pfil_head *); - -struct pfil_head *pfil_head_get(int, u_long); - #define PFIL_HOOKED(p) ((p)->ph_nhooks > 0) #define PFIL_LOCK_INIT_REAL(l, t) \ rm_init_flags(l, "PFil " t " rmlock", RM_RECURSE) From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 11:24:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 522108C0; Sat, 24 Aug 2013 11:24:16 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2591028AE; Sat, 24 Aug 2013 11:24:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OBOGMa036421; Sat, 24 Aug 2013 11:24:16 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OBOFDL036419; Sat, 24 Aug 2013 11:24:15 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241124.r7OBOFDL036419@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 11:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254774 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 11:24:16 -0000 Author: andre Date: Sat Aug 24 11:24:15 2013 New Revision: 254774 URL: http://svnweb.freebsd.org/changeset/base/254774 Log: ename PFIL_LIST_[UN]LOCK() to PFIL_HEADLIST_[UN]LOCK() to avoid confusion with the pfil_head chain locking macros. Modified: head/sys/net/pfil.c head/sys/net/pfil.h Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Sat Aug 24 11:17:25 2013 (r254773) +++ head/sys/net/pfil.c Sat Aug 24 11:24:15 2013 (r254774) @@ -173,11 +173,11 @@ pfil_head_register(struct pfil_head *ph) { struct pfil_head *lph; - PFIL_LIST_LOCK(); + PFIL_HEADLIST_LOCK(); LIST_FOREACH(lph, &V_pfil_head_list, ph_list) { if (ph->ph_type == lph->ph_type && ph->ph_un.phu_val == lph->ph_un.phu_val) { - PFIL_LIST_UNLOCK(); + PFIL_HEADLIST_UNLOCK(); return (EEXIST); } } @@ -186,7 +186,7 @@ pfil_head_register(struct pfil_head *ph) TAILQ_INIT(&ph->ph_in); TAILQ_INIT(&ph->ph_out); LIST_INSERT_HEAD(&V_pfil_head_list, ph, ph_list); - PFIL_LIST_UNLOCK(); + PFIL_HEADLIST_UNLOCK(); return (0); } @@ -200,9 +200,9 @@ pfil_head_unregister(struct pfil_head *p { struct packet_filter_hook *pfh, *pfnext; - PFIL_LIST_LOCK(); + PFIL_HEADLIST_LOCK(); LIST_REMOVE(ph, ph_list); - PFIL_LIST_UNLOCK(); + PFIL_HEADLIST_UNLOCK(); TAILQ_FOREACH_SAFE(pfh, &ph->ph_in, pfil_chain, pfnext) free(pfh, M_IFADDR); TAILQ_FOREACH_SAFE(pfh, &ph->ph_out, pfil_chain, pfnext) @@ -219,11 +219,11 @@ pfil_head_get(int type, u_long val) { struct pfil_head *ph; - PFIL_LIST_LOCK(); + PFIL_HEADLIST_LOCK(); LIST_FOREACH(ph, &V_pfil_head_list, ph_list) if (ph->ph_type == type && ph->ph_un.phu_val == val) break; - PFIL_LIST_UNLOCK(); + PFIL_HEADLIST_UNLOCK(); return (ph); } Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sat Aug 24 11:17:25 2013 (r254773) +++ head/sys/net/pfil.h Sat Aug 24 11:24:15 2013 (r254774) @@ -138,7 +138,9 @@ int pfil_wowned(struct pfil_head *ph); #define PFIL_RUNLOCK(p, t) rm_runlock((p)->ph_plock, (t)) #define PFIL_WUNLOCK(p) rm_wunlock((p)->ph_plock) #define PFIL_WOWNED(p) rm_wowned((p)->ph_plock) -#define PFIL_LIST_LOCK() mtx_lock(&pfil_global_lock) -#define PFIL_LIST_UNLOCK() mtx_unlock(&pfil_global_lock) + +/* Internal locking macros for global/vnet pfil_head_list. */ +#define PFIL_HEADLIST_LOCK() mtx_lock(&pfil_global_lock) +#define PFIL_HEADLIST_UNLOCK() mtx_unlock(&pfil_global_lock) #endif /* _NET_PFIL_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 11:57:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 298D72DB; Sat, 24 Aug 2013 11:57:03 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16F9E2A48; Sat, 24 Aug 2013 11:57:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OBv2eF052726; Sat, 24 Aug 2013 11:57:02 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OBv2ZR052725; Sat, 24 Aug 2013 11:57:02 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241157.r7OBv2ZR052725@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 11:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254775 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 11:57:03 -0000 Author: andre Date: Sat Aug 24 11:57:02 2013 New Revision: 254775 URL: http://svnweb.freebsd.org/changeset/base/254775 Log: Adjust for the pfil_func_t typedef added in r254769. Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sat Aug 24 11:24:15 2013 (r254774) +++ head/share/man/man9/pfil.9 Sat Aug 24 11:57:02 2013 (r254775) @@ -49,6 +49,8 @@ .In sys/mbuf.h .In net/if.h .In net/pfil.h +.Bd -literal +typedef int (*pfil_func_t)(void *arg, struct mbuf **mp, struct ifnet *, int dir, struct inpcb); .Ft int .Fn pfil_head_register "struct pfil_head *head" .Ft int @@ -56,11 +58,9 @@ .Ft "struct pfil_head *" .Fn pfil_head_get "int af" "u_long dlt" .Ft void -.Fn pfil_add_hook "int (*func)()" "void *arg" "int flags" "struct pfil_head *" +.Fn pfil_add_hook "pfil_func_t" "void *arg" "int flags" "struct pfil_head *" .Ft void -.Fn pfil_remove_hook "int (*func)()" "void *arg" "int flags" "struct pfil_head *" -.Ft int -.Fn (*func) "void *arg" "struct mbuf **mp" "struct ifnet *" "int dir" "struct inpcb *" +.Fn pfil_remove_hook "pfil_func_t" "void *arg" "int flags" "struct pfil_head *" .Ft int .Fn pfil_run_hooks "struct pfil_head *head" "struct mbuf **mp" "struct ifnet *" "int dir" "struct inpcb *" .Ft void From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 11:59:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 355DB428; Sat, 24 Aug 2013 11:59:53 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2238E2A58; Sat, 24 Aug 2013 11:59:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OBxrsp053601; Sat, 24 Aug 2013 11:59:53 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OBxq2E053594; Sat, 24 Aug 2013 11:59:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201308241159.r7OBxq2E053594@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 24 Aug 2013 11:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254776 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 11:59:53 -0000 Author: trociny Date: Sat Aug 24 11:59:51 2013 New Revision: 254776 URL: http://svnweb.freebsd.org/changeset/base/254776 Log: Make ipfw nat init/unint work correctly for VIMAGE: * Do per vnet instance cleanup (previously it was only for vnet0 on module unload, and led to libalias leaks and possible panics due to stale pointer dereferences). * Instead of protecting ipfw hooks registering/deregistering by only vnet0 lock (which does not prevent pointers access from another vnets), introduce per vnet ipfw_nat_loaded variable. The variable is set after hooks are registered and unset before they are deregistered. * Devirtualize ifaddr_event_tag as we run only one event handler for all vnets. * It is supposed that ifaddr_change event handler is called in the interface vnet context, so add an assertion. Reviewed by: zec MFC after: 2 weeks Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_nat.c head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sat Aug 24 11:57:02 2013 (r254775) +++ head/sys/netpfil/ipfw/ip_fw2.c Sat Aug 24 11:59:51 2013 (r254776) @@ -142,6 +142,8 @@ VNET_DEFINE(int, verbose_limit); /* layer3_chain contains the list of rules for layer 3 */ VNET_DEFINE(struct ip_fw_chain, layer3_chain); +VNET_DEFINE(int, ipfw_nat_ready) = 0; + ipfw_nat_t *ipfw_nat_ptr = NULL; struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Sat Aug 24 11:57:02 2013 (r254775) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Sat Aug 24 11:59:51 2013 (r254776) @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ -static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); -#define V_ifaddr_event_tag VNET(ifaddr_event_tag) +static eventhandler_tag ifaddr_event_tag; static void ifaddr_change(void *arg __unused, struct ifnet *ifp) @@ -63,6 +62,8 @@ ifaddr_change(void *arg __unused, struct struct ifaddr *ifa; struct ip_fw_chain *chain; + KASSERT(curvnet == ifp->if_vnet, + ("curvnet(%p) differs from iface vnet(%p)", curvnet, ifp->if_vnet)); chain = &V_layer3_chain; IPFW_WLOCK(chain); /* Check every nat entry... */ @@ -589,11 +590,38 @@ ipfw_nat_get_log(struct sockopt *sopt) return(0); } +static int +vnet_ipfw_nat_init(const void *arg __unused) +{ + + V_ipfw_nat_ready = 1; + return (0); +} + +static int +vnet_ipfw_nat_uninit(const void *arg __unused) +{ + struct cfg_nat *ptr, *ptr_temp; + struct ip_fw_chain *chain; + + chain = &V_layer3_chain; + IPFW_WLOCK(chain); + LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) { + LIST_REMOVE(ptr, _next); + del_redir_spool_cfg(ptr, &ptr->redir_chain); + LibAliasUninit(ptr->lib); + free(ptr, M_IPFW); + } + flush_nat_ptrs(chain, -1 /* flush all */); + V_ipfw_nat_ready = 0; + IPFW_WUNLOCK(chain); + return (0); +} + static void ipfw_nat_init(void) { - IPFW_WLOCK(&V_layer3_chain); /* init ipfw hooks */ ipfw_nat_ptr = ipfw_nat; lookup_nat_ptr = lookup_nat; @@ -601,28 +629,16 @@ ipfw_nat_init(void) ipfw_nat_del_ptr = ipfw_nat_del; ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg; ipfw_nat_get_log_ptr = ipfw_nat_get_log; - IPFW_WUNLOCK(&V_layer3_chain); - V_ifaddr_event_tag = EVENTHANDLER_REGISTER( - ifaddr_event, ifaddr_change, + + ifaddr_event_tag = EVENTHANDLER_REGISTER(ifaddr_event, ifaddr_change, NULL, EVENTHANDLER_PRI_ANY); } static void ipfw_nat_destroy(void) { - struct cfg_nat *ptr, *ptr_temp; - struct ip_fw_chain *chain; - chain = &V_layer3_chain; - IPFW_WLOCK(chain); - LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) { - LIST_REMOVE(ptr, _next); - del_redir_spool_cfg(ptr, &ptr->redir_chain); - LibAliasUninit(ptr->lib); - free(ptr, M_IPFW); - } - EVENTHANDLER_DEREGISTER(ifaddr_event, V_ifaddr_event_tag); - flush_nat_ptrs(chain, -1 /* flush all */); + EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_event_tag); /* deregister ipfw_nat */ ipfw_nat_ptr = NULL; lookup_nat_ptr = NULL; @@ -630,7 +646,6 @@ ipfw_nat_destroy(void) ipfw_nat_del_ptr = NULL; ipfw_nat_get_cfg_ptr = NULL; ipfw_nat_get_log_ptr = NULL; - IPFW_WUNLOCK(chain); } static int @@ -640,11 +655,9 @@ ipfw_nat_modevent(module_t mod, int type switch (type) { case MOD_LOAD: - ipfw_nat_init(); break; case MOD_UNLOAD: - ipfw_nat_destroy(); break; default: @@ -660,8 +673,25 @@ static moduledata_t ipfw_nat_mod = { 0 }; -DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +/* Define startup order. */ +#define IPFW_NAT_SI_SUB_FIREWALL SI_SUB_PROTO_IFATTACHDOMAIN +#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 255) +#define IPFW_NAT_MODULE_ORDER (IPFW_NAT_MODEVENT_ORDER + 1) +#define IPFW_NAT_VNET_ORDER (IPFW_NAT_MODEVENT_ORDER + 2) + +DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, IPFW_NAT_SI_SUB_FIREWALL, SI_ORDER_ANY); MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1); MODULE_DEPEND(ipfw_nat, ipfw, 2, 2, 2); MODULE_VERSION(ipfw_nat, 1); + +SYSINIT(ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER, + ipfw_nat_init, NULL); +VNET_SYSINIT(vnet_ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_VNET_ORDER, + vnet_ipfw_nat_init, NULL); + +SYSUNINIT(ipfw_nat_destroy, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER, + ipfw_nat_destroy, NULL); +VNET_SYSUNINIT(vnet_ipfw_nat_uninit, IPFW_NAT_SI_SUB_FIREWALL, + IPFW_NAT_VNET_ORDER, vnet_ipfw_nat_uninit, NULL); + /* end of file */ Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Sat Aug 24 11:57:02 2013 (r254775) +++ head/sys/netpfil/ipfw/ip_fw_private.h Sat Aug 24 11:59:51 2013 (r254776) @@ -327,9 +327,11 @@ extern struct cfg_nat *(*lookup_nat_ptr) typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *); typedef int ipfw_nat_cfg_t(struct sockopt *); -extern ipfw_nat_t *ipfw_nat_ptr; -#define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) +VNET_DECLARE(int, ipfw_nat_ready); +#define V_ipfw_nat_ready VNET(ipfw_nat_ready) +#define IPFW_NAT_LOADED (V_ipfw_nat_ready) +extern ipfw_nat_t *ipfw_nat_ptr; extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 12:03:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FA677BF; Sat, 24 Aug 2013 12:03:25 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6492AD4; Sat, 24 Aug 2013 12:03:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OC3OKx056926; Sat, 24 Aug 2013 12:03:24 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OC3OQR056925; Sat, 24 Aug 2013 12:03:24 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241203.r7OC3OQR056925@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 12:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254777 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 12:03:25 -0000 Author: andre Date: Sat Aug 24 12:03:24 2013 New Revision: 254777 URL: http://svnweb.freebsd.org/changeset/base/254777 Log: Whitespace, style cleanups, and improved comments. Modified: head/sys/net/pfil.h Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sat Aug 24 11:59:51 2013 (r254776) +++ head/sys/net/pfil.h Sat Aug 24 12:03:24 2013 (r254777) @@ -52,9 +52,9 @@ typedef int (*pfil_func_t)(void *, struc * together and after each other in the specified order. */ struct packet_filter_hook { - TAILQ_ENTRY(packet_filter_hook) pfil_chain; - pfil_func_t pfil_func; - void *pfil_arg; + TAILQ_ENTRY(packet_filter_hook) pfil_chain; + pfil_func_t pfil_func; + void *pfil_arg; }; #define PFIL_IN 0x00000001 @@ -74,23 +74,23 @@ typedef TAILQ_HEAD(pfil_chain, packet_fi * For packet is then run through the hook chain for inspection. */ struct pfil_head { - pfil_chain_t ph_in; - pfil_chain_t ph_out; - int ph_type; - int ph_nhooks; + pfil_chain_t ph_in; + pfil_chain_t ph_out; + int ph_type; + int ph_nhooks; #if defined( __linux__ ) || defined( _WIN32 ) - rwlock_t ph_mtx; + rwlock_t ph_mtx; #else struct rmlock *ph_plock; /* Pointer to the used lock */ - struct rmlock ph_lock; /* Private lock storage */ - int flags; + struct rmlock ph_lock; /* Private lock storage */ + int flags; #endif union { - u_long phu_val; - void *phu_ptr; + u_long phu_val; + void *phu_ptr; } ph_un; -#define ph_af ph_un.phu_val -#define ph_ifnet ph_un.phu_ptr +#define ph_af ph_un.phu_val +#define ph_ifnet ph_un.phu_ptr LIST_ENTRY(pfil_head) ph_list; }; @@ -98,6 +98,7 @@ struct pfil_head { struct pfil_head *pfil_head_get(int, u_long); int pfil_add_hook(pfil_func_t, void *, int, struct pfil_head *); int pfil_remove_hook(pfil_func_t, void *, int, struct pfil_head *); +#define PFIL_HOOKED(p) ((p)->ph_nhooks > 0) /* Public functions to run the packet inspection by protocols. */ int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *, @@ -107,16 +108,16 @@ int pfil_run_hooks(struct pfil_head *, s int pfil_head_register(struct pfil_head *); int pfil_head_unregister(struct pfil_head *); -/* Internal pfil locking functions. */ +/* Public pfil locking functions for self managed locks by packet filters. */ struct rm_priotracker; /* Do not require including rmlock header */ -int pfil_try_rlock(struct pfil_head *, struct rm_priotracker *); -void pfil_rlock(struct pfil_head *, struct rm_priotracker *); -void pfil_runlock(struct pfil_head *, struct rm_priotracker *); -void pfil_wlock(struct pfil_head *); -void pfil_wunlock(struct pfil_head *); -int pfil_wowned(struct pfil_head *ph); +int pfil_try_rlock(struct pfil_head *, struct rm_priotracker *); +void pfil_rlock(struct pfil_head *, struct rm_priotracker *); +void pfil_runlock(struct pfil_head *, struct rm_priotracker *); +void pfil_wlock(struct pfil_head *); +void pfil_wunlock(struct pfil_head *); +int pfil_wowned(struct pfil_head *ph); -#define PFIL_HOOKED(p) ((p)->ph_nhooks > 0) +/* Internal pfil locking functions. */ #define PFIL_LOCK_INIT_REAL(l, t) \ rm_init_flags(l, "PFil " t " rmlock", RM_RECURSE) #define PFIL_LOCK_DESTROY_REAL(l) \ @@ -132,6 +133,7 @@ int pfil_wowned(struct pfil_head *ph); if ((p)->flags & PFIL_FLAG_PRIVATE_LOCK) \ PFIL_LOCK_DESTROY_REAL((p)->ph_plock); \ } while (0) + #define PFIL_TRY_RLOCK(p, t) rm_try_rlock((p)->ph_plock, (t)) #define PFIL_RLOCK(p, t) rm_rlock((p)->ph_plock, (t)) #define PFIL_WLOCK(p) rm_wlock((p)->ph_plock) From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 12:10:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 065A5A41; Sat, 24 Aug 2013 12:10:12 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD8772B28; Sat, 24 Aug 2013 12:10:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OCAB6T060367; Sat, 24 Aug 2013 12:10:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OCABTk060051; Sat, 24 Aug 2013 12:10:11 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201308241210.r7OCABTk060051@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 24 Aug 2013 12:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254778 - in stable/9/sys: netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 12:10:12 -0000 Author: trociny Date: Sat Aug 24 12:10:11 2013 New Revision: 254778 URL: http://svnweb.freebsd.org/changeset/base/254778 Log: MFC r253282: A complete duplication of binding should be allowed if on both new and duplicated sockets a multicast address is bound and either SO_REUSEPORT or SO_REUSEADDR is set. But actually it works for the following combinations: * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new; * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new; * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new; and fails for this: * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new. Fix the last case. PR: 179901 Modified: stable/9/sys/netinet/in_pcb.c stable/9/sys/netinet6/in6_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in_pcb.c ============================================================================== --- stable/9/sys/netinet/in_pcb.c Sat Aug 24 12:03:24 2013 (r254777) +++ stable/9/sys/netinet/in_pcb.c Sat Aug 24 12:10:11 2013 (r254778) @@ -553,7 +553,7 @@ in_pcbbind_setup(struct inpcb *inp, stru * and a multicast address is bound on both * new and duplicated sockets. */ - if (so->so_options & SO_REUSEADDR) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; } else if (sin->sin_addr.s_addr != INADDR_ANY) { sin->sin_port = 0; /* yech... */ Modified: stable/9/sys/netinet6/in6_pcb.c ============================================================================== --- stable/9/sys/netinet6/in6_pcb.c Sat Aug 24 12:03:24 2013 (r254777) +++ stable/9/sys/netinet6/in6_pcb.c Sat Aug 24 12:10:11 2013 (r254778) @@ -158,7 +158,7 @@ in6_pcbbind(register struct inpcb *inp, * and a multicast address is bound on both * new and duplicated sockets. */ - if (so->so_options & SO_REUSEADDR) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct ifaddr *ifa; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 12:24:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6AADEF9F; Sat, 24 Aug 2013 12:24:59 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D64A2BC1; Sat, 24 Aug 2013 12:24:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OCOxaU069851; Sat, 24 Aug 2013 12:24:59 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OCOx9l069850; Sat, 24 Aug 2013 12:24:59 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241224.r7OCOx9l069850@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 12:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254779 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 12:24:59 -0000 Author: andre Date: Sat Aug 24 12:24:58 2013 New Revision: 254779 URL: http://svnweb.freebsd.org/changeset/base/254779 Log: Avoid code duplication for mbuf initialization and use m_init() instead in mb_ctor_mbuf() and mb_ctor_pack(). Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Aug 24 12:10:11 2013 (r254778) +++ head/sys/kern/kern_mbuf.c Sat Aug 24 12:24:58 2013 (r254779) @@ -410,18 +410,14 @@ mb_ctor_mbuf(void *mem, int size, void * { struct mbuf *m; struct mb_args *args; -#ifdef MAC int error; -#endif int flags; short type; #ifdef INVARIANTS trash_ctor(mem, size, arg, how); #endif - m = (struct mbuf *)mem; args = (struct mb_args *)arg; - flags = args->flags; type = args->type; /* @@ -431,32 +427,12 @@ mb_ctor_mbuf(void *mem, int size, void * if (type == MT_NOINIT) return (0); - m->m_next = NULL; - m->m_nextpkt = NULL; - m->m_len = 0; - m->m_flags = flags; - m->m_type = type; - if (flags & M_PKTHDR) { - m->m_data = m->m_pktdat; - m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.header = NULL; - m->m_pkthdr.len = 0; - m->m_pkthdr.csum_flags = 0; - m->m_pkthdr.csum_data = 0; - m->m_pkthdr.tso_segsz = 0; - m->m_pkthdr.ether_vtag = 0; - m->m_pkthdr.flowid = 0; - m->m_pkthdr.fibnum = 0; - SLIST_INIT(&m->m_pkthdr.tags); -#ifdef MAC - /* If the label init fails, fail the alloc */ - error = mac_mbuf_init(m, how); - if (error) - return (error); -#endif - } else - m->m_data = m->m_dat; - return (0); + m = (struct mbuf *)mem; + flags = args->flags; + + error = m_init(m, NULL, size, how, type, flags); + + return (error); } /* @@ -656,34 +632,14 @@ mb_ctor_pack(void *mem, int size, void * #ifdef INVARIANTS trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how); #endif - m->m_next = NULL; - m->m_nextpkt = NULL; - m->m_data = m->m_ext.ext_buf; - m->m_len = 0; - m->m_flags = (flags | M_EXT); - m->m_type = type; - - if (flags & M_PKTHDR) { - m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.len = 0; - m->m_pkthdr.header = NULL; - m->m_pkthdr.csum_flags = 0; - m->m_pkthdr.csum_data = 0; - m->m_pkthdr.tso_segsz = 0; - m->m_pkthdr.ether_vtag = 0; - m->m_pkthdr.flowid = 0; - m->m_pkthdr.fibnum = 0; - SLIST_INIT(&m->m_pkthdr.tags); -#ifdef MAC - /* If the label init fails, fail the alloc */ - error = mac_mbuf_init(m, how); - if (error) - return (error); -#endif - } + + error = m_init(m, NULL, size, how, type, flags); + /* m_ext is already initialized. */ + m->m_data = m->m_ext.ext_buf; + m->m_flags = (flags | M_EXT); - return (0); + return (error); } int From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 13:15:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3D6E6D26; Sat, 24 Aug 2013 13:15:43 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B4BC2DEB; Sat, 24 Aug 2013 13:15:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ODFhqV003254; Sat, 24 Aug 2013 13:15:43 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ODFgtK003250; Sat, 24 Aug 2013 13:15:42 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241315.r7ODFgtK003250@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 13:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254780 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 13:15:43 -0000 Author: andre Date: Sat Aug 24 13:15:42 2013 New Revision: 254780 URL: http://svnweb.freebsd.org/changeset/base/254780 Log: dd a 24 bits wide ext_flags field to m_ext by reducing ext_type to 8 bits. ext_type is an enumerator and the number of types we have is a mere dozen. A couple of ext_types are renumbered to fit within 8 bits. EXT_VENDOR[1-4] and EXT_EXP[1-4] types for vendor-internal and experimental local mapping. The ext_flags field is currently unused but has a couple of flags already defined for future use. Again vendor and experimental flags are provided for local mapping. EXT_FLAG_BITS is provided for the printf(9) %b identifier. Initialize and copy ext_flags in the relevant mbuf functions. Improve alignment and packing of struct m_ext on 32 and 64 archs by carefully sorting the fields. Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Aug 24 12:24:58 2013 (r254779) +++ head/sys/kern/kern_mbuf.c Sat Aug 24 13:15:42 2013 (r254780) @@ -547,6 +547,7 @@ mb_ctor_clust(void *mem, int size, void m->m_ext.ext_arg2 = NULL; m->m_ext.ext_size = size; m->m_ext.ext_type = type; + m->m_ext.ext_flags = 0; m->m_ext.ref_cnt = refcnt; } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sat Aug 24 12:24:58 2013 (r254779) +++ head/sys/kern/uipc_mbuf.c Sat Aug 24 13:15:42 2013 (r254780) @@ -267,6 +267,7 @@ m_extadd(struct mbuf *mb, caddr_t buf, u mb->m_ext.ext_arg1 = arg1; mb->m_ext.ext_arg2 = arg2; mb->m_ext.ext_type = type; + mb->m_ext.ext_flags = 0; return (0); } @@ -342,6 +343,7 @@ mb_free_ext(struct mbuf *m) m->m_ext.ref_cnt = NULL; m->m_ext.ext_size = 0; m->m_ext.ext_type = 0; + m->m_ext.ext_flags = 0; m->m_flags &= ~M_EXT; uma_zfree(zone_mbuf, m); } @@ -368,6 +370,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) n->m_ext.ext_size = m->m_ext.ext_size; n->m_ext.ref_cnt = m->m_ext.ref_cnt; n->m_ext.ext_type = m->m_ext.ext_type; + n->m_ext.ext_flags = m->m_ext.ext_flags; n->m_flags |= M_EXT; n->m_flags |= m->m_flags & M_RDONLY; } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 24 12:24:58 2013 (r254779) +++ head/sys/sys/mbuf.h Sat Aug 24 13:15:42 2013 (r254780) @@ -138,16 +138,19 @@ struct pkthdr { /* * Description of external storage mapped into mbuf; valid only if M_EXT is * set. + * Size ILP32: 28 + * LP64: 48 */ struct m_ext { + volatile u_int *ref_cnt; /* pointer to ref count info */ caddr_t ext_buf; /* start of buffer */ + uint32_t ext_size; /* size of buffer, for ext_free */ + uint32_t ext_type:8, /* type of external storage */ + ext_flags:24; /* external storage mbuf flags */ void (*ext_free) /* free routine if not the usual */ (void *, void *); void *ext_arg1; /* optional argument pointer */ void *ext_arg2; /* optional argument pointer */ - u_int ext_size; /* size of buffer, for ext_free */ - volatile u_int *ref_cnt; /* pointer to ref count info */ - int ext_type; /* type of external storage */ }; /* @@ -269,7 +272,7 @@ struct mbuf { M_PROTOFLAGS|M_HASHTYPEBITS) /* - * External buffer types: identify ext_buf type. + * External mbuf storage buffer types. */ #define EXT_CLUSTER 1 /* mbuf cluster */ #define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ @@ -278,10 +281,48 @@ struct mbuf { #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */ -#define EXT_NET_DRV 100 /* custom ext_buf provided by net driver(s) */ -#define EXT_MOD_TYPE 200 /* custom module's ext_buf type */ -#define EXT_DISPOSABLE 300 /* can throw this buffer away w/page flipping */ -#define EXT_EXTREF 400 /* has externally maintained ref_cnt ptr */ + +#define EXT_VENDOR1 224 /* for vendor-internal use */ +#define EXT_VENDOR2 225 /* for vendor-internal use */ +#define EXT_VENDOR3 226 /* for vendor-internal use */ +#define EXT_VENDOR4 227 /* for vendor-internal use */ + +#define EXT_EXP1 244 /* for experimental use */ +#define EXT_EXP2 245 /* for experimental use */ +#define EXT_EXP3 246 /* for experimental use */ +#define EXT_EXP4 247 /* for experimental use */ + +#define EXT_NET_DRV 252 /* custom ext_buf provided by net driver(s) */ +#define EXT_MOD_TYPE 253 /* custom module's ext_buf type */ +#define EXT_DISPOSABLE 254 /* can throw this buffer away w/page flipping */ +#define EXT_EXTREF 255 /* has externally maintained ref_cnt ptr */ + +/* + * Flags for external mbuf buffer types. + * NB: limited to the lower 24 bits. + */ +#define EXT_FLAG_EMBREF 0x000001 /* embedded ref_cnt, notyet */ +#define EXT_FLAG_EXTREF 0x000002 /* external ref_cnt, notyet */ +#define EXT_FLAG_NOFREE 0x000010 /* don't free mbuf to pool, notyet */ + +#define EXT_FLAG_VENDOR1 0x010000 /* for vendor-internal use */ +#define EXT_FLAG_VENDOR2 0x020000 /* for vendor-internal use */ +#define EXT_FLAG_VENDOR3 0x040000 /* for vendor-internal use */ +#define EXT_FLAG_VENDOR4 0x080000 /* for vendor-internal use */ + +#define EXT_FLAG_EXP1 0x100000 /* for experimental use */ +#define EXT_FLAG_EXP2 0x200000 /* for experimental use */ +#define EXT_FLAG_EXP3 0x400000 /* for experimental use */ +#define EXT_FLAG_EXP4 0x800000 /* for experimental use */ + +/* + * EXT flag description for use with printf(9) %b identifier. + */ +#define EXT_FLAG_BITS \ + "\20\1EXT_FLAG_EMBREF\2EXT_FLAG_EXTREF\5EXT_FLAG_NOFREE" \ + "\21EXT_FLAG_VENDOR1\22EXT_FLAG_VENDOR2\23EXT_FLAG_VENDOR3" \ + "\24EXT_FLAG_VENDOR4\25EXT_FLAG_EXP1\26EXT_FLAG_EXP2\27EXT_FLAG_EXP3" \ + "\30EXT_FLAG_EXP4" /* * Flags indicating hw checksum support and sw checksum requirements. This @@ -605,6 +646,7 @@ m_cljset(struct mbuf *m, void *cl, int t m->m_ext.ext_free = m->m_ext.ext_arg1 = m->m_ext.ext_arg2 = NULL; m->m_ext.ext_size = size; m->m_ext.ext_type = type; + m->m_ext.ext_flags = 0; m->m_ext.ref_cnt = uma_find_refcnt(zone, cl); m->m_flags |= M_EXT; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 13:34:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 740A6F4C; Sat, 24 Aug 2013 13:34:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 616BC2E8D; Sat, 24 Aug 2013 13:34:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ODYbDs015526; Sat, 24 Aug 2013 13:34:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ODYbnT015525; Sat, 24 Aug 2013 13:34:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201308241334.r7ODYbnT015525@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 Aug 2013 13:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254781 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 13:34:37 -0000 Author: mav Date: Sat Aug 24 13:34:36 2013 New Revision: 254781 URL: http://svnweb.freebsd.org/changeset/base/254781 Log: Make dummynet use new direct callout(9) execution mechanism. Since the only thing done by the dummynet handler is taskqueue_enqueue() call, it doesn't need extra switch to the clock SWI context. On idle system this change in half reduces number of active CPU cycles and wakes up only one CPU from sleep instead of two. I was going to make this change much earlier as part of calloutng project, but waited for better solution with skipping idle ticks to be implemented. Unfortunately with 10.0 release coming it is better get at least this. Modified: head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Sat Aug 24 13:15:42 2013 (r254780) +++ head/sys/netpfil/ipfw/ip_dummynet.c Sat Aug 24 13:34:36 2013 (r254781) @@ -82,13 +82,15 @@ dummynet(void *arg) { (void)arg; /* UNUSED */ - taskqueue_enqueue(dn_tq, &dn_task); + taskqueue_enqueue_fast(dn_tq, &dn_task); } void dn_reschedule(void) { - callout_reset(&dn_timeout, 1, dummynet, NULL); + + callout_reset_sbt(&dn_timeout, tick_sbt, 0, dummynet, NULL, + C_HARDCLOCK | C_DIRECT_EXEC); } /*----- end of callout hooks -----*/ @@ -2159,12 +2161,12 @@ ip_dn_init(void) DN_LOCK_INIT(); TASK_INIT(&dn_task, 0, dummynet_task, curvnet); - dn_tq = taskqueue_create("dummynet", M_WAITOK, + dn_tq = taskqueue_create_fast("dummynet", M_WAITOK, taskqueue_thread_enqueue, &dn_tq); taskqueue_start_threads(&dn_tq, 1, PI_NET, "dummynet"); callout_init(&dn_timeout, CALLOUT_MPSAFE); - callout_reset(&dn_timeout, 1, dummynet, NULL); + dn_reschedule(); /* Initialize curr_time adjustment mechanics. */ getmicrouptime(&dn_cfg.prev_t); From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 13:49:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 97C7E3F1; Sat, 24 Aug 2013 13:49:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84B5B2F24; Sat, 24 Aug 2013 13:49:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ODnh4I024412; Sat, 24 Aug 2013 13:49:43 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ODnh7w024411; Sat, 24 Aug 2013 13:49:43 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308241349.r7ODnh7w024411@svn.freebsd.org> From: Ed Maste Date: Sat, 24 Aug 2013 13:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254783 - stable/9/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 13:49:43 -0000 Author: emaste Date: Sat Aug 24 13:49:43 2013 New Revision: 254783 URL: http://svnweb.freebsd.org/changeset/base/254783 Log: MFC r254465: Correct implementation of atomic_flag_test_and_set (This is a direct commit to stable/9 as atomic_flag_test_and_set_explicit is an inline function on HEAD and in a different file.) Modified: stable/9/include/stdatomic.h Modified: stable/9/include/stdatomic.h ============================================================================== --- stable/9/include/stdatomic.h Sat Aug 24 13:42:20 2013 (r254782) +++ stable/9/include/stdatomic.h Sat Aug 24 13:49:43 2013 (r254783) @@ -317,7 +317,7 @@ typedef atomic_bool atomic_flag; #define atomic_flag_clear_explicit(object, order) \ atomic_store_explicit(object, 0, order) #define atomic_flag_test_and_set_explicit(object, order) \ - atomic_compare_exchange_strong_explicit(object, 0, 1, order, order) + atomic_exchange_explicit(object, 1, order) #define atomic_flag_clear(object) \ atomic_flag_clear_explicit(object, memory_order_seq_cst) From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 13:58:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FE56699; Sat, 24 Aug 2013 13:58:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D89E2F7E; Sat, 24 Aug 2013 13:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ODwI5T030267; Sat, 24 Aug 2013 13:58:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ODwIJ3030266; Sat, 24 Aug 2013 13:58:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308241358.r7ODwIJ3030266@svn.freebsd.org> From: Ed Maste Date: Sat, 24 Aug 2013 13:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254785 - releng/9.2/include X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 13:58:18 -0000 Author: emaste Date: Sat Aug 24 13:58:17 2013 New Revision: 254785 URL: http://svnweb.freebsd.org/changeset/base/254785 Log: MF9 r254783: Correct implementation of atomic_flag_test_and_set Approved by: re Modified: releng/9.2/include/stdatomic.h Directory Properties: releng/9.2/include/ (props changed) Modified: releng/9.2/include/stdatomic.h ============================================================================== --- releng/9.2/include/stdatomic.h Sat Aug 24 13:54:56 2013 (r254784) +++ releng/9.2/include/stdatomic.h Sat Aug 24 13:58:17 2013 (r254785) @@ -322,7 +322,7 @@ typedef atomic_bool atomic_flag; #define atomic_flag_clear_explicit(object, order) \ atomic_store_explicit(object, 0, order) #define atomic_flag_test_and_set_explicit(object, order) \ - atomic_compare_exchange_strong_explicit(object, 0, 1, order, order) + atomic_exchange_explicit(object, 1, order) #define atomic_flag_clear(object) \ atomic_flag_clear_explicit(object, memory_order_seq_cst) From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 14:33:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B25D1E9E; Sat, 24 Aug 2013 14:33:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 862AF211E; Sat, 24 Aug 2013 14:33:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OEXBMk054812; Sat, 24 Aug 2013 14:33:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OEXBwF054811; Sat, 24 Aug 2013 14:33:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308241433.r7OEXBwF054811@svn.freebsd.org> From: Ed Maste Date: Sat, 24 Aug 2013 14:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254786 - releng/9.2/contrib/llvm/tools/clang/lib/Sema X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 14:33:11 -0000 Author: emaste Date: Sat Aug 24 14:33:11 2013 New Revision: 254786 URL: http://svnweb.freebsd.org/changeset/base/254786 Log: MFS r254728: Pull in r182983 from upstream clang trunk: Fix handling of braced-init-list as reference initializer within aggregate initialization. Previously we would incorrectly require an extra set of braces around such initializers. Pull in r188718 from upstream clang trunk: Handle init lists and _Atomic fields. Fixes PR16931. These fixes are needed for the atomic_flag type to work correctly in our stdatomic.h. Approved by: re Modified: releng/9.2/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Directory Properties: releng/9.2/contrib/llvm/tools/clang/ (props changed) Modified: releng/9.2/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp ============================================================================== --- releng/9.2/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Sat Aug 24 13:58:17 2013 (r254785) +++ releng/9.2/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp Sat Aug 24 14:33:11 2013 (r254786) @@ -774,6 +774,11 @@ void InitListChecker::CheckSubElementTyp InitListExpr *StructuredList, unsigned &StructuredIndex) { Expr *expr = IList->getInit(Index); + + if (ElemType->isReferenceType()) + return CheckReferenceType(Entity, IList, ElemType, Index, + StructuredList, StructuredIndex); + if (InitListExpr *SubInitList = dyn_cast(expr)) { if (!ElemType->isRecordType() || ElemType->isAggregateType()) { unsigned newIndex = 0; @@ -793,13 +798,13 @@ void InitListChecker::CheckSubElementTyp // C++ initialization is handled later. } - if (ElemType->isScalarType()) { + // FIXME: Need to handle atomic aggregate types with implicit init lists. + if (ElemType->isScalarType() || ElemType->isAtomicType()) return CheckScalarType(Entity, IList, ElemType, Index, StructuredList, StructuredIndex); - } else if (ElemType->isReferenceType()) { - return CheckReferenceType(Entity, IList, ElemType, Index, - StructuredList, StructuredIndex); - } + + assert((ElemType->isRecordType() || ElemType->isVectorType() || + ElemType->isArrayType()) && "Unexpected type"); if (const ArrayType *arrayType = SemaRef.Context.getAsArrayType(ElemType)) { // arrayType can be incomplete if we're initializing a flexible From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 14:41:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18E8E2B0; Sat, 24 Aug 2013 14:41:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06CC5218B; Sat, 24 Aug 2013 14:41:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OEfnQe060672; Sat, 24 Aug 2013 14:41:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OEfnFx060671; Sat, 24 Aug 2013 14:41:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201308241441.r7OEfnFx060671@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 Aug 2013 14:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254787 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 14:41:50 -0000 Author: mav Date: Sat Aug 24 14:41:49 2013 New Revision: 254787 URL: http://svnweb.freebsd.org/changeset/base/254787 Log: MFprojects/camlock r254460: Remove locking from taskqueue_member(). The list of threads is static during the taskqueue life cycle, so there is no need to protect it, taking quite congested lock several more times for each ZFS I/O. Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Sat Aug 24 14:33:11 2013 (r254786) +++ head/sys/kern/subr_taskqueue.c Sat Aug 24 14:41:49 2013 (r254787) @@ -620,7 +620,6 @@ taskqueue_member(struct taskqueue *queue { int i, j, ret = 0; - TQ_LOCK(queue); for (i = 0, j = 0; ; i++) { if (queue->tq_threads[i] == NULL) continue; @@ -631,6 +630,5 @@ taskqueue_member(struct taskqueue *queue if (++j >= queue->tq_tcount) break; } - TQ_UNLOCK(queue); return (ret); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 15:09:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD180913; Sat, 24 Aug 2013 15:09:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC5322C7; Sat, 24 Aug 2013 15:09:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OF95qr074593; Sat, 24 Aug 2013 15:09:05 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OF95dG074592; Sat, 24 Aug 2013 15:09:05 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308241509.r7OF95dG074592@svn.freebsd.org> From: Glen Barber Date: Sat, 24 Aug 2013 15:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254789 - releng/9.2/sys/netinet X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 15:09:05 -0000 Author: gjb Date: Sat Aug 24 15:09:05 2013 New Revision: 254789 URL: http://svnweb.freebsd.org/changeset/base/254789 Log: Default net.inet.tcp.experimental.initcwnd10 to 0 in releng/9.2. Concerns have been raised regarding enabling initcwnd10 by default in the stable/ branch, so as a cautionary measure, turn this off for the 9.2-RELEASE. This sysctl is still available for those who want to enable this on their own systems. This is a direct commit to releng/9.2. Discussed with: re Approved by: re (marius) Modified: releng/9.2/sys/netinet/tcp_input.c Modified: releng/9.2/sys/netinet/tcp_input.c ============================================================================== --- releng/9.2/sys/netinet/tcp_input.c Sat Aug 24 14:49:51 2013 (r254788) +++ releng/9.2/sys/netinet/tcp_input.c Sat Aug 24 15:09:05 2013 (r254789) @@ -161,7 +161,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, "Experimental TCP extensions"); -VNET_DEFINE(int, tcp_do_initcwnd10) = 1; +VNET_DEFINE(int, tcp_do_initcwnd10) = 0; SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, &VNET_NAME(tcp_do_initcwnd10), 0, "Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)"); From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 15:27:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A7D1EECC; Sat, 24 Aug 2013 15:27:22 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 320472392; Sat, 24 Aug 2013 15:27:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r7OFRJ8I096603; Sat, 24 Aug 2013 19:27:19 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Sat, 24 Aug 2013 19:27:19 +0400 (MSK) From: Dmitry Morozovsky To: Alexander Motin Subject: Re: svn commit: r254787 - head/sys/kern In-Reply-To: <201308241441.r7OEfnFx060671@svn.freebsd.org> Message-ID: References: <201308241441.r7OEfnFx060671@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Sat, 24 Aug 2013 19:27:19 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 15:27:22 -0000 On Sat, 24 Aug 2013, Alexander Motin wrote: > MFprojects/camlock r254460: > Remove locking from taskqueue_member(). The list of threads is static > during the taskqueue life cycle, so there is no need to protect it, > taking quite congested lock several more times for each ZFS I/O. Great, thanks! Any chances to MFC this to 9? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 15:33:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9F003ED; Sat, 24 Aug 2013 15:33:09 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ea0-x232.google.com (mail-ea0-x232.google.com [IPv6:2a00:1450:4013:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D673A23E4; Sat, 24 Aug 2013 15:33:08 +0000 (UTC) Received: by mail-ea0-f178.google.com with SMTP id a15so806861eae.9 for ; Sat, 24 Aug 2013 08:33:07 -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=MAQk8EFM2bx/mXyK3bhXloYvvSWS9ljhXGrDQQQZ88Q=; b=cj71u4NyU7ePTsVLderqLICaxF9WoUIQaVIAnw9kjQxNNCFFv4d+j2tnmNaEWT5mmS kStjYhg9XD6P2lN2It0fsM05IjcLoMk8n55QfyTRJM7Wk6mY8JrthCbxgEarVynzEz3U sU7sazLbsA+1BK/hoo3yjMLGrkQ38KFdhSaqo35mHeoz++ih1C3gnVt8Z7ViZD+YBPSe TIemum+21ByPPh+AxPfECgnil4FtaWAHPmSI4mTZznbPcbhmGRroHNrHfFnU5AfA3DUL fSWw/VB5lAJfJmtZ+iiDrK+IzNFrAFoOXhZU1tgiqw85N6JbUrJylxFQWnqVz3c4yGgQ 6x1w== X-Received: by 10.14.208.194 with SMTP id q42mr8776207eeo.31.1377358387142; Sat, 24 Aug 2013 08:33:07 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([37.229.21.195]) by mx.google.com with ESMTPSA id z12sm7534762eev.6.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Aug 2013 08:33:06 -0700 (PDT) Sender: Alexander Motin Message-ID: <5218D22F.8000009@FreeBSD.org> Date: Sat, 24 Aug 2013 18:33:03 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Dmitry Morozovsky Subject: Re: svn commit: r254787 - head/sys/kern References: <201308241441.r7OEfnFx060671@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 15:33:09 -0000 On 24.08.2013 18:27, Dmitry Morozovsky wrote: > On Sat, 24 Aug 2013, Alexander Motin wrote: > >> MFprojects/camlock r254460: >> Remove locking from taskqueue_member(). The list of threads is static >> during the taskqueue life cycle, so there is no need to protect it, >> taking quite congested lock several more times for each ZFS I/O. > > Great, thanks! > > Any chances to MFC this to 9? I don't see any problem to do it after some time. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 15:33:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7D0A11CF; Sat, 24 Aug 2013 15:33:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69CD123E5; Sat, 24 Aug 2013 15:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OFXIDn088687; Sat, 24 Aug 2013 15:33:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OFXHtW088677; Sat, 24 Aug 2013 15:33:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308241533.r7OFXHtW088677@svn.freebsd.org> From: Ed Maste Date: Sat, 24 Aug 2013 15:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254790 - in head/contrib/llvm: include/llvm/MC lib/MC lib/Target/X86/InstPrinter X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 15:33:18 -0000 Author: emaste Date: Sat Aug 24 15:33:17 2013 New Revision: 254790 URL: http://svnweb.freebsd.org/changeset/base/254790 Log: Import llvm r187614 (git 44c8e34), for lldb's use: Author: Daniel Malea Date: Thu Aug 1 21:18:16 2013 +0000 Fixed the Intel-syntax X86 disassembler to respect the (existing) option for hexadecimal immediates, to match AT&T syntax. This also brings a new option for C-vs-MASM-style hex. Patch by Richard Mitton Reviewed: http://llvm-reviews.chandlerc.com/D1243 Modified: head/contrib/llvm/include/llvm/MC/MCInstPrinter.h head/contrib/llvm/lib/MC/MCInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp Modified: head/contrib/llvm/include/llvm/MC/MCInstPrinter.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCInstPrinter.h Sat Aug 24 15:09:05 2013 (r254789) +++ head/contrib/llvm/include/llvm/MC/MCInstPrinter.h Sat Aug 24 15:33:17 2013 (r254790) @@ -21,6 +21,13 @@ class MCInstrInfo; class MCRegisterInfo; class StringRef; +namespace HexStyle { + enum Style { + C, ///< 0xff + Asm ///< 0ffh + }; +} + /// MCInstPrinter - This is an instance of a target assembly language printer /// that converts an MCInst to valid target assembly syntax. class MCInstPrinter { @@ -42,13 +49,16 @@ protected: /// True if we are printing immediates as hex. bool PrintImmHex; + /// Which style to use for printing hexadecimal values. + HexStyle::Style PrintHexStyle; + /// Utility function for printing annotations. void printAnnotation(raw_ostream &OS, StringRef Annot); public: MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri) : CommentStream(0), MAI(mai), MII(mii), MRI(mri), AvailableFeatures(0), - UseMarkup(0), PrintImmHex(0) {} + UseMarkup(0), PrintImmHex(0), PrintHexStyle(HexStyle::C) {} virtual ~MCInstPrinter(); @@ -80,8 +90,16 @@ public: bool getPrintImmHex() const { return PrintImmHex; } void setPrintImmHex(bool Value) { PrintImmHex = Value; } + HexStyle::Style getPrintHexStyleHex() const { return PrintHexStyle; } + void setPrintImmHex(HexStyle::Style Value) { PrintHexStyle = Value; } + /// Utility function to print immediates in decimal or hex. - format_object1 formatImm(const int64_t Value) const; + format_object1 formatImm(const int64_t Value) const { return PrintImmHex ? formatHex(Value) : formatDec(Value); } + + /// Utility functions to print decimal/hexadecimal values. + format_object1 formatDec(const int64_t Value) const; + format_object1 formatHex(const int64_t Value) const; + format_object1 formatHex(const uint64_t Value) const; }; } // namespace llvm Modified: head/contrib/llvm/lib/MC/MCInstPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCInstPrinter.cpp Sat Aug 24 15:09:05 2013 (r254789) +++ head/contrib/llvm/lib/MC/MCInstPrinter.cpp Sat Aug 24 15:33:17 2013 (r254790) @@ -52,10 +52,53 @@ StringRef MCInstPrinter::markup(StringRe return b; } -/// Utility function to print immediates in decimal or hex. -format_object1 MCInstPrinter::formatImm(const int64_t Value) const { - if (getPrintImmHex()) - return format("0x%" PRIx64, Value); - else - return format("%" PRId64, Value); +// For asm-style hex (e.g. 0ffh) the first digit always has to be a number. +static bool needsLeadingZero(uint64_t Value) +{ + while(Value) + { + uint64_t digit = (Value >> 60) & 0xf; + if (digit != 0) + return (digit >= 0xa); + Value <<= 4; + } + return false; +} + +format_object1 MCInstPrinter::formatDec(const int64_t Value) const { + return format("%" PRId64, Value); +} + +format_object1 MCInstPrinter::formatHex(const int64_t Value) const { + switch(PrintHexStyle) { + case HexStyle::C: + if (Value < 0) + return format("-0x%" PRIx64, -Value); + else + return format("0x%" PRIx64, Value); + case HexStyle::Asm: + if (Value < 0) { + if (needsLeadingZero((uint64_t)(-Value))) + return format("-0%" PRIx64 "h", -Value); + else + return format("-%" PRIx64 "h", -Value); + } else { + if (needsLeadingZero((uint64_t)(Value))) + return format("0%" PRIx64 "h", Value); + else + return format("%" PRIx64 "h", Value); + } + } +} + +format_object1 MCInstPrinter::formatHex(const uint64_t Value) const { + switch(PrintHexStyle) { + case HexStyle::C: + return format("0x%" PRIx64, Value); + case HexStyle::Asm: + if (needsLeadingZero(Value)) + return format("0%" PRIx64 "h", Value); + else + return format("%" PRIx64 "h", Value); + } } Modified: head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp Sat Aug 24 15:09:05 2013 (r254789) +++ head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp Sat Aug 24 15:33:17 2013 (r254790) @@ -139,8 +139,7 @@ void X86ATTInstPrinter::printPCRelImm(co const MCConstantExpr *BranchTarget = dyn_cast(Op.getExpr()); int64_t Address; if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) { - O << "0x"; - O.write_hex(Address); + O << formatHex((uint64_t)Address); } else { // Otherwise, just print the expression. Modified: head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp Sat Aug 24 15:09:05 2013 (r254789) +++ head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp Sat Aug 24 15:33:17 2013 (r254790) @@ -119,7 +119,7 @@ void X86IntelInstPrinter::printPCRelImm( raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNo); if (Op.isImm()) - O << Op.getImm(); + O << formatImm(Op.getImm()); else { assert(Op.isExpr() && "unknown pcrel immediate operand"); // If a symbolic branch target was added as a constant expression then print @@ -127,8 +127,7 @@ void X86IntelInstPrinter::printPCRelImm( const MCConstantExpr *BranchTarget = dyn_cast(Op.getExpr()); int64_t Address; if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) { - O << "0x"; - O.write_hex(Address); + O << formatHex((uint64_t)Address); } else { // Otherwise, just print the expression. @@ -148,7 +147,7 @@ void X86IntelInstPrinter::printOperand(c if (Op.isReg()) { PrintRegName(O, getRegisterName(Op.getReg())); } else if (Op.isImm()) { - O << Op.getImm(); + O << formatImm((int64_t)Op.getImm()); } else { assert(Op.isExpr() && "unknown operand kind in printOperand"); O << *Op.getExpr(); @@ -200,7 +199,7 @@ void X86IntelInstPrinter::printMemRefere DispVal = -DispVal; } } - O << DispVal; + O << formatImm(DispVal); } } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 15:41:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4357F51E; Sat, 24 Aug 2013 15:41:37 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 314C62457; Sat, 24 Aug 2013 15:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OFfbu6093418; Sat, 24 Aug 2013 15:41:37 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OFfbes093416; Sat, 24 Aug 2013 15:41:37 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201308241541.r7OFfbes093416@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 24 Aug 2013 15:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254791 - head/sys/modules/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 15:41:37 -0000 Author: uqs Date: Sat Aug 24 15:41:36 2013 New Revision: 254791 URL: http://svnweb.freebsd.org/changeset/base/254791 Log: Include bsd.own.mk before trying to check MK_* values. Modified: head/sys/modules/vmware/vmxnet3/Makefile Modified: head/sys/modules/vmware/vmxnet3/Makefile ============================================================================== --- head/sys/modules/vmware/vmxnet3/Makefile Sat Aug 24 15:33:17 2013 (r254790) +++ head/sys/modules/vmware/vmxnet3/Makefile Sat Aug 24 15:41:36 2013 (r254791) @@ -23,6 +23,8 @@ # SUCH DAMAGE. # +.include + .PATH: ${.CURDIR}/../../../dev/vmware/vmxnet3 KMOD= if_vmx From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 15:47:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1AC9E90D; Sat, 24 Aug 2013 15:47:16 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB93324A5; Sat, 24 Aug 2013 15:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OFlFYc095272; Sat, 24 Aug 2013 15:47:15 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OFlFv0095270; Sat, 24 Aug 2013 15:47:15 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308241547.r7OFlFv0095270@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 15:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254792 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 15:47:16 -0000 Author: dumbbell Date: Sat Aug 24 15:47:15 2013 New Revision: 254792 URL: http://svnweb.freebsd.org/changeset/base/254792 Log: drm: Call drm_global_init() & drm_global_release() at module load/unload Added: head/sys/dev/drm2/drm_core.h (contents, props changed) Modified: head/sys/dev/drm2/drm_drv.c Added: head/sys/dev/drm2/drm_core.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_core.h Sat Aug 24 15:47:15 2013 (r254792) @@ -0,0 +1,38 @@ +/* + * Copyright 2004 Jon Smirl + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define CORE_AUTHOR "Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl" + +#define CORE_NAME "drm" +#define CORE_DESC "DRM shared core routines" +#define CORE_DATE "20060810" + +#define DRM_IF_MAJOR 1 +#define DRM_IF_MINOR 4 + +#define CORE_MAJOR 1 +#define CORE_MINOR 1 +#define CORE_PATCHLEVEL 0 Modified: head/sys/dev/drm2/drm_drv.c ============================================================================== --- head/sys/dev/drm2/drm_drv.c Sat Aug 24 15:41:36 2013 (r254791) +++ head/sys/dev/drm2/drm_drv.c Sat Aug 24 15:47:15 2013 (r254792) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -78,7 +80,7 @@ static moduledata_t drm_mod = { "drmn", drm_modevent, 0 -}; +}; DECLARE_MODULE(drmn, drm_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); MODULE_VERSION(drmn, 1); MODULE_DEPEND(drmn, agp, 1, 1, 1); @@ -210,7 +212,7 @@ static struct drm_msi_blacklist_entry dr static int drm_msi_is_blacklisted(int vendor, int device) { int i = 0; - + for (i = 0; drm_msi_blacklist[i].vendor != 0; i++) { if ((drm_msi_blacklist[i].vendor == vendor) && (drm_msi_blacklist[i].device == device)) { @@ -349,7 +351,7 @@ drm_pci_id_list_t *drm_find_description( drm_pci_id_list_t *idlist) { int i = 0; - + for (i = 0; idlist[i].vendor != 0; i++) { if ((idlist[i].vendor == vendor) && ((idlist[i].device == device) || @@ -746,7 +748,7 @@ void drm_close(void *data) drm_lock_free(&dev->lock, _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)); - + /* FIXME: may require heavy-handed reset of hardware at this point, possibly processed via a callback to the X @@ -809,7 +811,7 @@ extern drm_ioctl_desc_t drm_compat_ioctl /* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. */ -int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, +int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, DRM_STRUCTPROC *p) { struct drm_device *dev = drm_get_device_from_kdev(kdev); @@ -984,14 +986,9 @@ MODULE_DEPEND(DRIVER_NAME, linux, 1, 1, #define LINUX_IOCTL_DRM_MAX 0x64ff static linux_ioctl_function_t drm_linux_ioctl; -static struct linux_ioctl_handler drm_handler = {drm_linux_ioctl, +static struct linux_ioctl_handler drm_handler = {drm_linux_ioctl, LINUX_IOCTL_DRM_MIN, LINUX_IOCTL_DRM_MAX}; -SYSINIT(drm_register, SI_SUB_KLD, SI_ORDER_MIDDLE, - linux_ioctl_register_handler, &drm_handler); -SYSUNINIT(drm_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, - linux_ioctl_unregister_handler, &drm_handler); - /* The bits for in/out are switched on Linux */ #define LINUX_IOC_IN IOC_OUT #define LINUX_IOC_OUT IOC_IN @@ -1007,13 +1004,45 @@ drm_linux_ioctl(DRM_STRUCTPROC *p, struc args->cmd |= IOC_IN; if (cmd & LINUX_IOC_OUT) args->cmd |= IOC_OUT; - + error = ioctl(p, (struct ioctl_args *)args); return error; } #endif /* DRM_LINUX */ + +static int +drm_core_init(void *arg) +{ + + drm_global_init(); + +#if DRM_LINUX + linux_ioctl_register_handler(&drm_handler); +#endif /* DRM_LINUX */ + + DRM_INFO("Initialized %s %d.%d.%d %s\n", + CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); + return 0; +} + +static void +drm_core_exit(void *arg) +{ + +#if DRM_LINUX + linux_ioctl_unregister_handler(&drm_handler); +#endif /* DRM_LINUX */ + + drm_global_release(); +} + +SYSINIT(drm_register, SI_SUB_KLD, SI_ORDER_MIDDLE, + drm_core_init, NULL); +SYSUNINIT(drm_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, + drm_core_exit, NULL); + bool dmi_check_system(const struct dmi_system_id *sysid) { @@ -1021,4 +1050,3 @@ dmi_check_system(const struct dmi_system /* XXXKIB */ return (false); } - From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:09:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4769ED52; Sat, 24 Aug 2013 16:09:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 348C025B9; Sat, 24 Aug 2013 16:09:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OG9row007106; Sat, 24 Aug 2013 16:09:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OG9rYY007105; Sat, 24 Aug 2013 16:09:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201308241609.r7OG9rYY007105@svn.freebsd.org> From: Ed Maste Date: Sat, 24 Aug 2013 16:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254793 - head/contrib/llvm/tools/lldb/source/Expression X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:09:53 -0000 Author: emaste Date: Sat Aug 24 16:09:52 2013 New Revision: 254793 URL: http://svnweb.freebsd.org/changeset/base/254793 Log: Revert lldb change for Attribute::NoBuiltin NoBuiltin was introduced after clang/llvm 3.3 and thus does not exist in FreeBSD. Thus special handling for the attribute is not needed in lldb. This reverts lldb r186990 (git eebd175) Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Modified: head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Sat Aug 24 15:47:15 2013 (r254792) +++ head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Sat Aug 24 16:09:52 2013 (r254793) @@ -356,20 +356,6 @@ IRForTarget::ResolveFunctionPointers(llv if (value_ptr) *value_ptr = value; - - // If we are replacing a function with the nobuiltin attribute, it may - // be called with the builtin attribute on call sites. Remove any such - // attributes since it's illegal to have a builtin call to something - // other than a nobuiltin function. - if (fun->hasFnAttribute(Attribute::NoBuiltin)) { - Attribute builtin = Attribute::get(fun->getContext(), Attribute::Builtin); - - for (auto u = fun->use_begin(), e = fun->use_end(); u != e; ++u) { - if (auto call = dyn_cast(*u)) { - call->removeAttribute(AttributeSet::FunctionIndex, builtin); - } - } - } fun->replaceAllUsesWith(value); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:11:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 84FEAE98; Sat, 24 Aug 2013 16:11:09 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F7EA25EA; Sat, 24 Aug 2013 16:11:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r7OGB7fR097080; Sat, 24 Aug 2013 20:11:07 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Sat, 24 Aug 2013 20:11:07 +0400 (MSK) From: Dmitry Morozovsky To: Alexander Motin Subject: Re: svn commit: r254787 - head/sys/kern In-Reply-To: <5218D22F.8000009@FreeBSD.org> Message-ID: References: <201308241441.r7OEfnFx060671@svn.freebsd.org> <5218D22F.8000009@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Sat, 24 Aug 2013 20:11:07 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:11:09 -0000 On Sat, 24 Aug 2013, Alexander Motin wrote: > > > MFprojects/camlock r254460: > > > Remove locking from taskqueue_member(). The list of threads is static > > > during the taskqueue life cycle, so there is no need to protect it, > > > taking quite congested lock several more times for each ZFS I/O. > > > > Great, thanks! > > > > Any chances to MFC this to 9? > > I don't see any problem to do it after some time. Ah, so IIUC, it does not depend on other changes and could be tested on stock stable/9 right now? If so, I'd merge this to our tinderbox/poudriere builder and test. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:14:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F5FC2D5; Sat, 24 Aug 2013 16:14:21 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3DF2633; Sat, 24 Aug 2013 16:14:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OGELH1010791; Sat, 24 Aug 2013 16:14:21 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OGEKdD010787; Sat, 24 Aug 2013 16:14:20 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308241614.r7OGEKdD010787@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 16:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254794 - in head/sys: dev/drm2 modules/drm2/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:14:21 -0000 Author: dumbbell Date: Sat Aug 24 16:14:20 2013 New Revision: 254794 URL: http://svnweb.freebsd.org/changeset/base/254794 Log: drm: Import drm_buffer.[ch] from Linux 3.8-rc3 This will be used by the Radeon KMS driver. Added: head/sys/dev/drm2/drm_buffer.c (contents, props changed) head/sys/dev/drm2/drm_buffer.h (contents, props changed) Modified: head/sys/modules/drm2/drm2/Makefile Added: head/sys/dev/drm2/drm_buffer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_buffer.c Sat Aug 24 16:14:20 2013 (r254794) @@ -0,0 +1,183 @@ +/************************************************************************** + * + * Copyright 2010 Pauli Nieminen. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + **************************************************************************/ +/* + * Multipart buffer for coping data which is larger than the page size. + * + * Authors: + * Pauli Nieminen + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +/** + * Allocate the drm buffer object. + * + * buf: Pointer to a pointer where the object is stored. + * size: The number of bytes to allocate. + */ +int drm_buffer_alloc(struct drm_buffer **buf, int size) +{ + int nr_pages = size / PAGE_SIZE + 1; + int idx; + + /* Allocating pointer table to end of structure makes drm_buffer + * variable sized */ + *buf = malloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *), + DRM_MEM_DRIVER, M_ZERO | M_WAITOK); + + if (*buf == NULL) { + DRM_ERROR("Failed to allocate drm buffer object to hold" + " %d bytes in %d pages.\n", + size, nr_pages); + return -ENOMEM; + } + + (*buf)->size = size; + + for (idx = 0; idx < nr_pages; ++idx) { + + (*buf)->data[idx] = + malloc(min(PAGE_SIZE, size - idx * PAGE_SIZE), + DRM_MEM_DRIVER, M_WAITOK); + + + if ((*buf)->data[idx] == NULL) { + DRM_ERROR("Failed to allocate %dth page for drm" + " buffer with %d bytes and %d pages.\n", + idx + 1, size, nr_pages); + goto error_out; + } + + } + + return 0; + +error_out: + + /* Only last element can be null pointer so check for it first. */ + if ((*buf)->data[idx]) + free((*buf)->data[idx], DRM_MEM_DRIVER); + + for (--idx; idx >= 0; --idx) + free((*buf)->data[idx], DRM_MEM_DRIVER); + + free(*buf, DRM_MEM_DRIVER); + return -ENOMEM; +} + +/** + * Copy the user data to the begin of the buffer and reset the processing + * iterator. + * + * user_data: A pointer the data that is copied to the buffer. + * size: The Number of bytes to copy. + */ +int drm_buffer_copy_from_user(struct drm_buffer *buf, + void __user *user_data, int size) +{ + int nr_pages = size / PAGE_SIZE + 1; + int idx; + + if (size > buf->size) { + DRM_ERROR("Requesting to copy %d bytes to a drm buffer with" + " %d bytes space\n", + size, buf->size); + return -EFAULT; + } + + for (idx = 0; idx < nr_pages; ++idx) { + + if (DRM_COPY_FROM_USER(buf->data[idx], + (char *)user_data + idx * PAGE_SIZE, + min(PAGE_SIZE, size - idx * PAGE_SIZE))) { + DRM_ERROR("Failed to copy user data (%p) to drm buffer" + " (%p) %dth page.\n", + user_data, buf, idx); + return -EFAULT; + + } + } + buf->iterator = 0; + return 0; +} + +/** + * Free the drm buffer object + */ +void drm_buffer_free(struct drm_buffer *buf) +{ + + if (buf != NULL) { + + int nr_pages = buf->size / PAGE_SIZE + 1; + int idx; + for (idx = 0; idx < nr_pages; ++idx) + free(buf->data[idx], DRM_MEM_DRIVER); + + free(buf, DRM_MEM_DRIVER); + } +} + +/** + * Read an object from buffer that may be split to multiple parts. If object + * is not split function just returns the pointer to object in buffer. But in + * case of split object data is copied to given stack object that is suplied + * by caller. + * + * The processing location of the buffer is also advanced to the next byte + * after the object. + * + * objsize: The size of the objet in bytes. + * stack_obj: A pointer to a memory location where object can be copied. + */ +void *drm_buffer_read_object(struct drm_buffer *buf, + int objsize, void *stack_obj) +{ + int idx = drm_buffer_index(buf); + int page = drm_buffer_page(buf); + void *obj = NULL; + + if (idx + objsize <= PAGE_SIZE) { + obj = &buf->data[page][idx]; + } else { + /* The object is split which forces copy to temporary object.*/ + int beginsz = PAGE_SIZE - idx; + memcpy(stack_obj, &buf->data[page][idx], beginsz); + + memcpy((char *)stack_obj + beginsz, &buf->data[page + 1][0], + objsize - beginsz); + + obj = stack_obj; + } + + drm_buffer_advance(buf, objsize); + return obj; +} Added: head/sys/dev/drm2/drm_buffer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_buffer.h Sat Aug 24 16:14:20 2013 (r254794) @@ -0,0 +1,151 @@ +/************************************************************************** + * + * Copyright 2010 Pauli Nieminen. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + **************************************************************************/ +/* + * Multipart buffer for coping data which is larger than the page size. + * + * Authors: + * Pauli Nieminen + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifndef _DRM_BUFFER_H_ +#define _DRM_BUFFER_H_ + +#include + +struct drm_buffer { + int iterator; + int size; + char *data[]; +}; + + +/** + * Return the index of page that buffer is currently pointing at. + */ +static inline int drm_buffer_page(struct drm_buffer *buf) +{ + return buf->iterator / PAGE_SIZE; +} +/** + * Return the index of the current byte in the page + */ +static inline int drm_buffer_index(struct drm_buffer *buf) +{ + return buf->iterator & (PAGE_SIZE - 1); +} +/** + * Return number of bytes that is left to process + */ +static inline int drm_buffer_unprocessed(struct drm_buffer *buf) +{ + return buf->size - buf->iterator; +} + +/** + * Advance the buffer iterator number of bytes that is given. + */ +static inline void drm_buffer_advance(struct drm_buffer *buf, int bytes) +{ + buf->iterator += bytes; +} + +/** + * Allocate the drm buffer object. + * + * buf: A pointer to a pointer where the object is stored. + * size: The number of bytes to allocate. + */ +extern int drm_buffer_alloc(struct drm_buffer **buf, int size); + +/** + * Copy the user data to the begin of the buffer and reset the processing + * iterator. + * + * user_data: A pointer the data that is copied to the buffer. + * size: The Number of bytes to copy. + */ +extern int drm_buffer_copy_from_user(struct drm_buffer *buf, + void __user *user_data, int size); + +/** + * Free the drm buffer object + */ +extern void drm_buffer_free(struct drm_buffer *buf); + +/** + * Read an object from buffer that may be split to multiple parts. If object + * is not split function just returns the pointer to object in buffer. But in + * case of split object data is copied to given stack object that is suplied + * by caller. + * + * The processing location of the buffer is also advanced to the next byte + * after the object. + * + * objsize: The size of the objet in bytes. + * stack_obj: A pointer to a memory location where object can be copied. + */ +extern void *drm_buffer_read_object(struct drm_buffer *buf, + int objsize, void *stack_obj); + +/** + * Returns the pointer to the dword which is offset number of elements from the + * current processing location. + * + * Caller must make sure that dword is not split in the buffer. This + * requirement is easily met if all the sizes of objects in buffer are + * multiples of dword and PAGE_SIZE is multiple dword. + * + * Call to this function doesn't change the processing location. + * + * offset: The index of the dword relative to the internat iterator. + */ +static inline void *drm_buffer_pointer_to_dword(struct drm_buffer *buffer, + int offset) +{ + int iter = buffer->iterator + offset * 4; + return &buffer->data[iter / PAGE_SIZE][iter & (PAGE_SIZE - 1)]; +} +/** + * Returns the pointer to the dword which is offset number of elements from + * the current processing location. + * + * Call to this function doesn't change the processing location. + * + * offset: The index of the byte relative to the internat iterator. + */ +static inline void *drm_buffer_pointer_to_byte(struct drm_buffer *buffer, + int offset) +{ + int iter = buffer->iterator + offset; + return &buffer->data[iter / PAGE_SIZE][iter & (PAGE_SIZE - 1)]; +} + +#endif Modified: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/drm2/Makefile Sat Aug 24 16:09:52 2013 (r254793) +++ head/sys/modules/drm2/drm2/Makefile Sat Aug 24 16:14:20 2013 (r254794) @@ -6,6 +6,7 @@ SRCS = \ drm_agpsupport.c \ drm_auth.c \ drm_bufs.c \ + drm_buffer.c \ drm_context.c \ drm_crtc.c \ drm_crtc_helper.c \ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:17:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E25044D; Sat, 24 Aug 2013 16:17:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B718264D; Sat, 24 Aug 2013 16:17:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OGHYmK011892; Sat, 24 Aug 2013 16:17:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OGHYYY011890; Sat, 24 Aug 2013 16:17:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201308241617.r7OGHYYY011890@svn.freebsd.org> From: Glen Barber Date: Sat, 24 Aug 2013 16:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r254795 - in releng/9.2: release sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:17:34 -0000 Author: gjb Date: Sat Aug 24 16:17:33 2013 New Revision: 254795 URL: http://svnweb.freebsd.org/changeset/base/254795 Log: Update releng/9.2 to -RC3. Approved by: re (implicit) Modified: releng/9.2/release/Makefile.sysinstall releng/9.2/sys/conf/newvers.sh Modified: releng/9.2/release/Makefile.sysinstall ============================================================================== --- releng/9.2/release/Makefile.sysinstall Sat Aug 24 16:14:20 2013 (r254794) +++ releng/9.2/release/Makefile.sysinstall Sat Aug 24 16:17:33 2013 (r254795) @@ -24,7 +24,7 @@ # Set these, release builder! # # Fixed version: -#BUILDNAME=9.2-RC2 +#BUILDNAME=9.2-RC3 # # Automatic SNAP versioning: DATE != date +%Y%m%d Modified: releng/9.2/sys/conf/newvers.sh ============================================================================== --- releng/9.2/sys/conf/newvers.sh Sat Aug 24 16:14:20 2013 (r254794) +++ releng/9.2/sys/conf/newvers.sh Sat Aug 24 16:17:33 2013 (r254795) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.2" -BRANCH="RC2" +BRANCH="RC3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:25:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 754C1759; Sat, 24 Aug 2013 16:25:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-x236.google.com (mail-ee0-x236.google.com [IPv6:2a00:1450:4013:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A74A726BA; Sat, 24 Aug 2013 16:25:21 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id e53so834890eek.27 for ; Sat, 24 Aug 2013 09:25:20 -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=keUAZ7OkC7OOUmCshc7cLZGLf9NFPknDj2Kub8MPt8g=; b=rlWa6GARYzNVOt/sTbEWWgYvCnNhe9acApqft4okOTZ2/HOOEUbt83AwFmXKV4Ufto yAHEvZ/e9B5m+IwPK8RCnAf3A87wXNXL9Q0RVu7QfBW17N/b/JbEzwl2mVObZxe5jSni BZP4hdoPDdpErV+pJM3N8g+upRhzPAuvX1K/v8Vfnx46MgJR/maIv7h57lF1NGxv9Pxr gvLmet4+imK1WTdgXydNBgX4Ik1knbLtCVHrwaQf4lDKteV8HTKmf3XOUxiYmMtYtMsA Q5xGv0JC/Pff/8uLQ5Iymepgwqwr95OavLftRO8v9cAfVh95XOAg+ZSIMZY8EqZ6iYJT XiuA== X-Received: by 10.14.223.1 with SMTP id u1mr9217095eep.10.1377361519898; Sat, 24 Aug 2013 09:25:19 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([37.229.21.195]) by mx.google.com with ESMTPSA id i1sm7831492eeg.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 Aug 2013 09:25:18 -0700 (PDT) Sender: Alexander Motin Message-ID: <5218DE6C.4060700@FreeBSD.org> Date: Sat, 24 Aug 2013 19:25:16 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Dmitry Morozovsky Subject: Re: svn commit: r254787 - head/sys/kern References: <201308241441.r7OEfnFx060671@svn.freebsd.org> <5218D22F.8000009@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:25:22 -0000 On 24.08.2013 19:11, Dmitry Morozovsky wrote: > On Sat, 24 Aug 2013, Alexander Motin wrote: > >>>> MFprojects/camlock r254460: >>>> Remove locking from taskqueue_member(). The list of threads is static >>>> during the taskqueue life cycle, so there is no need to protect it, >>>> taking quite congested lock several more times for each ZFS I/O. >>> >>> Great, thanks! >>> >>> Any chances to MFC this to 9? >> >> I don't see any problem to do it after some time. > > Ah, so IIUC, it does not depend on other changes and could be tested on stock > stable/9 right now? If so, I'd merge this to our tinderbox/poudriere builder > and test. Yes, it is completely independent. Please, welcome. I am just not sure whether you notice much difference unless you have really a lot of IOPS. On my tests doing 90K IOPS over bunch of SSDs I've measured difference of several percents. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:41:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A7BD1EC; Sat, 24 Aug 2013 16:41:15 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5755E27E4; Sat, 24 Aug 2013 16:41:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OGfFBq025670; Sat, 24 Aug 2013 16:41:15 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OGfF4T025668; Sat, 24 Aug 2013 16:41:15 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308241641.r7OGfF4T025668@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 16:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254796 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:41:15 -0000 Author: dumbbell Date: Sat Aug 24 16:41:14 2013 New Revision: 254796 URL: http://svnweb.freebsd.org/changeset/base/254796 Log: drm/i915: Import Linux commit 71244653a8fb0f46bc12ae421f1d5f72af6a75da Author: Daniel Vetter Date: Mon Jun 4 18:39:20 2012 +0200 drm/i915: adjusted_mode->clock in the dp mode_fixup ... instead of changing mode->clock, which we should leave as-is. After the previous patch we only touch that if it's a panel, and then adjusted mode->clock equals adjusted_mode->clock. Outside of intel_dp.c we only use ajusted_mode->clock in the mode_set functions. Within intel_dp.c we only use it to calculate the dp dithering and link bw parameters, so that's the only thing we need to fix up. As a temporary ugliness (until the cleanup in the next patch) we pass the adjusted_mode into dp_dither for both parameters (because that one still looks at mode->clock). Note that we do overwrite adjusted_mode->clock with the selected dp link clock, but that only happens after we've calculated everything we need based on the dotclock of the adjusted output configuration. Outside of intel_dp.c only intel_display.c uses adjusted_mode->clock, and that stays the same after this patch (still equals the selected dp link clock). intel_display.c also needs the actual dotclock (as target_clock), but that has been fixed up in the previous patch. v2: Adjust the debug message to also use adjusted_mode->clock. Reviewed-by: Chris Wilson Reviewed-by: Jesse Barnes Signed-off-by: Daniel Vetter Modified: head/sys/dev/drm2/i915/intel_dp.c Modified: head/sys/dev/drm2/i915/intel_dp.c ============================================================================== --- head/sys/dev/drm2/i915/intel_dp.c Sat Aug 24 16:17:33 2013 (r254795) +++ head/sys/dev/drm2/i915/intel_dp.c Sat Aug 24 16:41:14 2013 (r254796) @@ -691,14 +691,9 @@ intel_dp_mode_fixup(struct drm_encoder * intel_fixed_panel_mode(intel_dp->panel_fixed_mode, adjusted_mode); intel_pch_panel_fitting(dev, DRM_MODE_SCALE_FULLSCREEN, mode, adjusted_mode); - /* - * the mode->clock is used to calculate the Data&Link M/N - * of the pipe. For the eDP the fixed clock should be used. - */ - mode->clock = intel_dp->panel_fixed_mode->clock; } - if (!intel_dp_adjust_dithering(intel_dp, mode, adjusted_mode)) + if (!intel_dp_adjust_dithering(intel_dp, adjusted_mode, adjusted_mode)) return false; bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; @@ -707,7 +702,7 @@ intel_dp_mode_fixup(struct drm_encoder * for (clock = 0; clock <= max_clock; clock++) { int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); - if (intel_dp_link_required(mode->clock, bpp) + if (intel_dp_link_required(adjusted_mode->clock, bpp) <= link_avail) { intel_dp->link_bw = bws[clock]; intel_dp->lane_count = lane_count; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:44:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C409E332; Sat, 24 Aug 2013 16:44:25 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A37427F1; Sat, 24 Aug 2013 16:44:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r7OGiNi6097555; Sat, 24 Aug 2013 20:44:23 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Sat, 24 Aug 2013 20:44:23 +0400 (MSK) From: Dmitry Morozovsky To: Alexander Motin Subject: Re: svn commit: r254787 - head/sys/kern In-Reply-To: <5218DE6C.4060700@FreeBSD.org> Message-ID: References: <201308241441.r7OEfnFx060671@svn.freebsd.org> <5218D22F.8000009@FreeBSD.org> <5218DE6C.4060700@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Sat, 24 Aug 2013 20:44:23 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:44:25 -0000 On Sat, 24 Aug 2013, Alexander Motin wrote: > > > > > Remove locking from taskqueue_member(). The list of threads is > > > > Ah, so IIUC, it does not depend on other changes and could be tested on > > stock stable/9 right now? If so, I'd merge this to our tinderbox/poudriere > > builder and test. > > Yes, it is completely independent. Please, welcome. I am just not sure whether > you notice much difference unless you have really a lot of IOPS. On my tests > doing 90K IOPS over bunch of SSDs I've measured difference of several > percents. Yes, this is not a case of a builder, as most of IOSP is done in tmpfs (BTW, doesn't this lock appliy there as well?) OTOH, we have a couple of iSCSI storages where this could be useable too... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:44:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5B2C7465; Sat, 24 Aug 2013 16:44:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB7127F5; Sat, 24 Aug 2013 16:44:49 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:99cd:72d:5e87:427e]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id C74902A24; Sat, 24 Aug 2013 16:44:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us C74902A24 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 24 Aug 2013 12:44:46 -0400 From: Glen Barber To: "Kenneth D. Merry" Subject: Re: svn commit: r254760 - in head: share/man/man4 sys/cam/scsi sys/kern sys/sys Message-ID: <20130824164446.GA41859@glenbarber.us> References: <201308240452.r7O4qMji033904@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CPaaJmjEtnx7DmsZ" Content-Disposition: inline In-Reply-To: <201308240452.r7O4qMji033904@svn.freebsd.org> X-Operating-System: 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:44:50 -0000 --CPaaJmjEtnx7DmsZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 24, 2013 at 04:52:22AM +0000, Kenneth D. Merry wrote: > Author: ken > Date: Sat Aug 24 04:52:22 2013 > New Revision: 254760 > URL: http://svnweb.freebsd.org/changeset/base/254760 >=20 > [...] > @@ -83,6 +113,17 @@ physio(struct cdev *dev, struct uio *uio > */ > iolen =3D ((vm_offset_t) bp->b_data) & PAGE_MASK; > if ((bp->b_bcount + iolen) > bp->b_kvasize) { > + /* > + * This device does not want I/O to be split. > + */ > + if (dev->si_flags & SI_NOSPLIT) { > + printf("%s: request ptr %#jx is not " > + "on a page boundary, cannot split " > + "request\n", devtoname(dev), > + (uintmax_t)bp->b_data); This breaks LINT for at least powerpc. cc1: warnings being treated as errors /src/sys/kern/kern_physio.c: In function 'physio': /src/sys/kern/kern_physio.c:123: warning: cast from pointer to integer of d= ifferent size [-Wpointer-to-int-cast] *** Error code 1 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-powerpc-powerpc.full Glen --CPaaJmjEtnx7DmsZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJSGOL+AAoJEFJPDDeguUajy7MIAI1S2l6dQY7IKsoYWwBrVpGx BgdgJMcbNA2vD2ZORtcwe9j9blcXrfZ3AZPWrSky4xA3qFuEA5ryndyge5t3FeQR UHXu7wK+aOM54RqvJajWawBpe3Abfvsa0NibNja8Ir9L7JCqI7QT28ss1d3P012E CZ8p/hGT5ycT4hsSzNDfuYZLxsXpWSXyDg1cK0OCbWdLCVAtDtFBlu2EB5PTIg14 GlnlHj29oPFA2tSWsD9EdYpvuJFUeSWoAkhcP1hLOetAtQYVpvj/FxbyIU9Q4v7q DJnR+1wA9eKnWDA06EM0nSVbsu9Fu253rLXiu2iTTviSFBZB8CNz/xDKoG8hotE= =8VIY -----END PGP SIGNATURE----- --CPaaJmjEtnx7DmsZ-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:50:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6C1C36B8; Sat, 24 Aug 2013 16:50:50 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5082842; Sat, 24 Aug 2013 16:50:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OGooKL030877; Sat, 24 Aug 2013 16:50:50 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OGolRX030724; Sat, 24 Aug 2013 16:50:48 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308241650.r7OGolRX030724@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 16:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254797 - in head/sys/dev/drm2: . i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:50:50 -0000 Author: dumbbell Date: Sat Aug 24 16:50:47 2013 New Revision: 254797 URL: http://svnweb.freebsd.org/changeset/base/254797 Log: drm: Const'ify the 1st "drm_display_mode" passed to "mode_fixup" callbacks This will be needed by the Radeon KMS driver. Modified: head/sys/dev/drm2/drm_crtc.h head/sys/dev/drm2/drm_crtc_helper.h head/sys/dev/drm2/i915/intel_crt.c head/sys/dev/drm2/i915/intel_display.c head/sys/dev/drm2/i915/intel_dp.c head/sys/dev/drm2/i915/intel_drv.h head/sys/dev/drm2/i915/intel_hdmi.c head/sys/dev/drm2/i915/intel_lvds.c head/sys/dev/drm2/i915/intel_panel.c head/sys/dev/drm2/i915/intel_sdvo.c head/sys/dev/drm2/i915/intel_tv.c Modified: head/sys/dev/drm2/drm_crtc.h ============================================================================== --- head/sys/dev/drm2/drm_crtc.h Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/drm_crtc.h Sat Aug 24 16:50:47 2013 (r254797) @@ -659,7 +659,7 @@ struct drm_mode_config { int min_width, min_height; int max_width, max_height; - struct drm_mode_config_funcs *funcs; + const struct drm_mode_config_funcs *funcs; resource_size_t fb_base; /* output poll support */ Modified: head/sys/dev/drm2/drm_crtc_helper.h ============================================================================== --- head/sys/dev/drm2/drm_crtc_helper.h Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/drm_crtc_helper.h Sat Aug 24 16:50:47 2013 (r254797) @@ -51,7 +51,7 @@ struct drm_crtc_helper_funcs { /* Provider can fixup or change mode timings before modeset occurs */ bool (*mode_fixup)(struct drm_crtc *crtc, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); /* Actually set the mode */ int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, @@ -78,7 +78,7 @@ struct drm_encoder_helper_funcs { void (*restore)(struct drm_encoder *encoder); bool (*mode_fixup)(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); void (*prepare)(struct drm_encoder *encoder); void (*commit)(struct drm_encoder *encoder); Modified: head/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- head/sys/dev/drm2/i915/intel_crt.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_crt.c Sat Aug 24 16:50:47 2013 (r254797) @@ -111,7 +111,7 @@ static int intel_crt_mode_valid(struct d } static bool intel_crt_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { return true; Modified: head/sys/dev/drm2/i915/intel_display.c ============================================================================== --- head/sys/dev/drm2/i915/intel_display.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_display.c Sat Aug 24 16:50:47 2013 (r254797) @@ -3512,7 +3512,7 @@ void intel_encoder_destroy(struct drm_en } static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = crtc->dev; Modified: head/sys/dev/drm2/i915/intel_dp.c ============================================================================== --- head/sys/dev/drm2/i915/intel_dp.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_dp.c Sat Aug 24 16:50:47 2013 (r254797) @@ -224,7 +224,7 @@ intel_dp_max_data_rate(int max_link_cloc static bool intel_dp_adjust_dithering(struct intel_dp *intel_dp, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); @@ -676,7 +676,7 @@ intel_dp_i2c_init(struct intel_dp *intel } static bool -intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, +intel_dp_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = encoder->dev; Modified: head/sys/dev/drm2/i915/intel_drv.h ============================================================================== --- head/sys/dev/drm2/i915/intel_drv.h Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_drv.h Sat Aug 24 16:50:47 2013 (r254797) @@ -320,7 +320,7 @@ extern void intel_fixed_panel_mode(struc struct drm_display_mode *adjusted_mode); extern void intel_pch_panel_fitting(struct drm_device *dev, int fitting_mode, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); extern u32 intel_panel_get_max_backlight(struct drm_device *dev); extern u32 intel_panel_get_backlight(struct drm_device *dev); Modified: head/sys/dev/drm2/i915/intel_hdmi.c ============================================================================== --- head/sys/dev/drm2/i915/intel_hdmi.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_hdmi.c Sat Aug 24 16:50:47 2013 (r254797) @@ -318,7 +318,7 @@ static int intel_hdmi_mode_valid(struct } static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { return true; Modified: head/sys/dev/drm2/i915/intel_lvds.c ============================================================================== --- head/sys/dev/drm2/i915/intel_lvds.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_lvds.c Sat Aug 24 16:50:47 2013 (r254797) @@ -230,7 +230,7 @@ static inline u32 panel_fitter_scaling(u } static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = encoder->dev; Modified: head/sys/dev/drm2/i915/intel_panel.c ============================================================================== --- head/sys/dev/drm2/i915/intel_panel.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_panel.c Sat Aug 24 16:50:47 2013 (r254797) @@ -59,7 +59,7 @@ intel_fixed_panel_mode(struct drm_displa void intel_pch_panel_fitting(struct drm_device *dev, int fitting_mode, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_i915_private *dev_priv = dev->dev_private; Modified: head/sys/dev/drm2/i915/intel_sdvo.c ============================================================================== --- head/sys/dev/drm2/i915/intel_sdvo.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_sdvo.c Sat Aug 24 16:50:47 2013 (r254797) @@ -924,7 +924,7 @@ static bool intel_sdvo_set_tv_format(str static bool intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo, - struct drm_display_mode *mode) + const struct drm_display_mode *mode) { struct intel_sdvo_dtd output_dtd; @@ -941,7 +941,7 @@ intel_sdvo_set_output_timings_from_mode( static bool intel_sdvo_set_input_timings_for_mode(struct intel_sdvo *intel_sdvo, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { /* Reset the input timing to the screen. Assume always input 0. */ @@ -964,7 +964,7 @@ intel_sdvo_set_input_timings_for_mode(st } static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, - struct drm_display_mode *mode, + const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder); Modified: head/sys/dev/drm2/i915/intel_tv.c ============================================================================== --- head/sys/dev/drm2/i915/intel_tv.c Sat Aug 24 16:41:14 2013 (r254796) +++ head/sys/dev/drm2/i915/intel_tv.c Sat Aug 24 16:50:47 2013 (r254797) @@ -846,7 +846,7 @@ intel_tv_mode_valid(struct drm_connector static bool -intel_tv_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, +intel_tv_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = encoder->dev; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:55:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4371F927 for ; Sat, 24 Aug 2013 16:55:11 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAE512867 for ; Sat, 24 Aug 2013 16:55:10 +0000 (UTC) Received: (qmail 93552 invoked from network); 24 Aug 2013 17:37:41 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 24 Aug 2013 17:37:41 -0000 Message-ID: <5218E563.7030308@freebsd.org> Date: Sat, 24 Aug 2013 18:54:59 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r254780 - in head/sys: kern sys References: <201308241315.r7ODFgtK003250@svn.freebsd.org> In-Reply-To: <201308241315.r7ODFgtK003250@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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:55:11 -0000 On 24.08.2013 15:15, Andre Oppermann wrote: > Author: andre > Date: Sat Aug 24 13:15:42 2013 > New Revision: 254780 > URL: http://svnweb.freebsd.org/changeset/base/254780 > > Log: > dd a 24 bits wide ext_flags field to m_ext by reducing ext_type > to 8 bits. ext_type is an enumerator and the number of types we > have is a mere dozen. > > A couple of ext_types are renumbered to fit within 8 bits. > > EXT_VENDOR[1-4] and EXT_EXP[1-4] types for vendor-internal and > experimental local mapping. > > The ext_flags field is currently unused but has a couple of flags > already defined for future use. Again vendor and experimental > flags are provided for local mapping. > > EXT_FLAG_BITS is provided for the printf(9) %b identifier. > > Initialize and copy ext_flags in the relevant mbuf functions. > > Improve alignment and packing of struct m_ext on 32 and 64 archs > by carefully sorting the fields. Sponsored by: The FreeBSD Foundation -- Andre From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:55:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E3DFAA5C; Sat, 24 Aug 2013 16:55:53 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1692286D; Sat, 24 Aug 2013 16:55:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OGtrIh032585; Sat, 24 Aug 2013 16:55:53 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OGtree032584; Sat, 24 Aug 2013 16:55:53 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308241655.r7OGtree032584@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 16:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254798 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:55:54 -0000 Author: dumbbell Date: Sat Aug 24 16:55:53 2013 New Revision: 254798 URL: http://svnweb.freebsd.org/changeset/base/254798 Log: drm: Fix leak of connector->edid_blob_ptr Modified: head/sys/dev/drm2/drm_crtc.c Modified: head/sys/dev/drm2/drm_crtc.c ============================================================================== --- head/sys/dev/drm2/drm_crtc.c Sat Aug 24 16:50:47 2013 (r254797) +++ head/sys/dev/drm2/drm_crtc.c Sat Aug 24 16:55:53 2013 (r254798) @@ -170,6 +170,9 @@ static struct drm_prop_enum_list drm_enc { DRM_MODE_ENCODER_TVDAC, "TV" }, }; +static void drm_property_destroy_blob(struct drm_device *dev, + struct drm_property_blob *blob); + char *drm_get_encoder_name(struct drm_encoder *encoder) { static char buf[32]; @@ -520,6 +523,8 @@ void drm_connector_cleanup(struct drm_co drm_mode_remove(connector, mode); sx_xlock(&dev->mode_config.mutex); + if (connector->edid_blob_ptr) + drm_property_destroy_blob(dev, connector->edid_blob_ptr); drm_mode_object_put(dev, &connector->base); list_del(&connector->head); dev->mode_config.num_connector--; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 16:57:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 15E2FC93; Sat, 24 Aug 2013 16:57:47 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 019EC2885; Sat, 24 Aug 2013 16:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OGvkUm033273; Sat, 24 Aug 2013 16:57:46 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OGvie8033186; Sat, 24 Aug 2013 16:57:44 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241657.r7OGvie8033186@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 16:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254799 - in head/sys: dev/cas dev/hatm dev/iscsi_initiator dev/lge dev/mwl kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 16:57:47 -0000 Author: andre Date: Sat Aug 24 16:57:44 2013 New Revision: 254799 URL: http://svnweb.freebsd.org/changeset/base/254799 Log: Add an mbuf pointer parameter to (*ext_free) to give the external free function access to the mbuf the external memory was attached to. Mechanically adjust all users to include the mbuf parameter. This fixes a long standing annoyance for external free functions. Before one had to sacrifice one of the argument pointers for this. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/cas/if_cas.c head/sys/dev/hatm/if_hatm_intr.c head/sys/dev/iscsi_initiator/isc_soc.c head/sys/dev/lge/if_lge.c head/sys/dev/mwl/if_mwl.c head/sys/kern/subr_mbpool.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_syscalls.c head/sys/sys/mbpool.h head/sys/sys/mbuf.h head/sys/sys/sf_buf.h Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/dev/cas/if_cas.c Sat Aug 24 16:57:44 2013 (r254799) @@ -132,7 +132,7 @@ static void cas_detach(struct cas_softc static int cas_disable_rx(struct cas_softc *sc); static int cas_disable_tx(struct cas_softc *sc); static void cas_eint(struct cas_softc *sc, u_int status); -static void cas_free(void *arg1, void* arg2); +static void cas_free(struct mbuf *m, void *arg1, void* arg2); static void cas_init(void *xsc); static void cas_init_locked(struct cas_softc *sc); static void cas_init_regs(struct cas_softc *sc); @@ -1888,7 +1888,7 @@ cas_rint(struct cas_softc *sc) } static void -cas_free(void *arg1, void *arg2) +cas_free(struct mbuf *m, void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; Modified: head/sys/dev/hatm/if_hatm_intr.c ============================================================================== --- head/sys/dev/hatm/if_hatm_intr.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/dev/hatm/if_hatm_intr.c Sat Aug 24 16:57:44 2013 (r254799) @@ -261,7 +261,7 @@ hatm_mbuf_page_alloc(struct hatm_softc * * Free an mbuf and put it onto the free list. */ static void -hatm_mbuf0_free(void *buf, void *args) +hatm_mbuf0_free(struct mbuf *m, void *buf, void *args) { struct hatm_softc *sc = args; struct mbuf0_chunk *c = buf; @@ -272,7 +272,7 @@ hatm_mbuf0_free(void *buf, void *args) hatm_ext_free(&sc->mbuf_list[0], (struct mbufx_free *)c); } static void -hatm_mbuf1_free(void *buf, void *args) +hatm_mbuf1_free(struct mbuf *m, void *buf, void *args) { struct hatm_softc *sc = args; struct mbuf1_chunk *c = buf; @@ -461,7 +461,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_ hatm_mbuf0_free, c0, sc, M_PKTHDR, EXT_EXTREF); m->m_data += MBUF0_OFFSET; } else - hatm_mbuf0_free(c0, sc); + hatm_mbuf0_free(NULL, c0, sc); } else { struct mbuf1_chunk *c1; @@ -485,7 +485,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_ hatm_mbuf1_free, c1, sc, M_PKTHDR, EXT_EXTREF); m->m_data += MBUF1_OFFSET; } else - hatm_mbuf1_free(c1, sc); + hatm_mbuf1_free(NULL, c1, sc); } return (m); Modified: head/sys/dev/iscsi_initiator/isc_soc.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_soc.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/dev/iscsi_initiator/isc_soc.c Sat Aug 24 16:57:44 2013 (r254799) @@ -69,7 +69,7 @@ static int ou_refcnt = 0; | function for freeing external storage for mbuf */ static void -ext_free(void *a, void *b) +ext_free(struct mbuf *m, void *a, void *b) { pduq_t *pq = b; Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/dev/lge/if_lge.c Sat Aug 24 16:57:44 2013 (r254799) @@ -122,7 +122,7 @@ static int lge_detach(device_t); static int lge_alloc_jumbo_mem(struct lge_softc *); static void lge_free_jumbo_mem(struct lge_softc *); static void *lge_jalloc(struct lge_softc *); -static void lge_jfree(void *, void *); +static void lge_jfree(struct mbuf *, void *, void *); static int lge_newbuf(struct lge_softc *, struct lge_rx_desc *, struct mbuf *); static int lge_encap(struct lge_softc *, struct mbuf *, u_int32_t *); @@ -847,9 +847,7 @@ lge_jalloc(sc) * Release a jumbo buffer. */ static void -lge_jfree(buf, args) - void *buf; - void *args; +lge_jfree(struct mbuf *m, void *buf, void *args) { struct lge_softc *sc; int i; Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/dev/mwl/if_mwl.c Sat Aug 24 16:57:44 2013 (r254799) @@ -2622,7 +2622,7 @@ mwl_rxbuf_init(struct mwl_softc *sc, str } static void -mwl_ext_free(void *data, void *arg) +mwl_ext_free(struct mbuf *m, void *data, void *arg) { struct mwl_softc *sc = arg; Modified: head/sys/kern/subr_mbpool.c ============================================================================== --- head/sys/kern/subr_mbpool.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/kern/subr_mbpool.c Sat Aug 24 16:57:44 2013 (r254799) @@ -283,7 +283,7 @@ mbp_free(struct mbpool *p, void *ptr) * Mbuf system external mbuf free routine */ void -mbp_ext_free(void *buf, void *arg) +mbp_ext_free(struct mbuf *m, void *buf, void *arg) { mbp_free(arg, buf); } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/kern/uipc_mbuf.c Sat Aug 24 16:57:44 2013 (r254799) @@ -247,8 +247,8 @@ m_freem(struct mbuf *mb) */ int m_extadd(struct mbuf *mb, caddr_t buf, u_int size, - void (*freef)(void *, void *), void *arg1, void *arg2, int flags, int type, - int wait) + void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, + int flags, int type, int wait) { KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); @@ -321,7 +321,7 @@ mb_free_ext(struct mbuf *m) case EXT_EXTREF: KASSERT(m->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - (*(m->m_ext.ext_free))(m->m_ext.ext_arg1, + (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, m->m_ext.ext_arg2); break; default: Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/kern/uipc_syscalls.c Sat Aug 24 16:57:44 2013 (r254799) @@ -1855,7 +1855,7 @@ struct sendfile_sync { * Detach mapped page and release resources back to the system. */ void -sf_buf_mext(void *addr, void *args) +sf_buf_mext(struct mbuf *mb, void *addr, void *args) { vm_page_t m; struct sendfile_sync *sfs; @@ -2315,14 +2315,14 @@ retry_space: m0 = m_get((mnw ? M_NOWAIT : M_WAITOK), MT_DATA); if (m0 == NULL) { error = (mnw ? EAGAIN : ENOBUFS); - sf_buf_mext(NULL, sf); + sf_buf_mext(NULL, NULL, sf); break; } if (m_extadd(m0, (caddr_t )sf_buf_kva(sf), PAGE_SIZE, sf_buf_mext, sfs, sf, M_RDONLY, EXT_SFBUF, (mnw ? M_NOWAIT : M_WAITOK)) != 0) { error = (mnw ? EAGAIN : ENOBUFS); - sf_buf_mext(NULL, sf); + sf_buf_mext(NULL, NULL, sf); m_freem(m0); break; } Modified: head/sys/sys/mbpool.h ============================================================================== --- head/sys/sys/mbpool.h Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/sys/mbpool.h Sat Aug 24 16:57:44 2013 (r254799) @@ -69,7 +69,7 @@ void *mbp_alloc(struct mbpool *, bus_add void mbp_free(struct mbpool *, void *); /* free a chunk that is an external mbuf */ -void mbp_ext_free(void *, void *); +void mbp_ext_free(struct mbuf *, void *, void *); /* free all buffers that are marked to be on the card */ void mbp_card_free(struct mbpool *); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/sys/mbuf.h Sat Aug 24 16:57:44 2013 (r254799) @@ -148,7 +148,7 @@ struct m_ext { uint32_t ext_type:8, /* type of external storage */ ext_flags:24; /* external storage mbuf flags */ void (*ext_free) /* free routine if not the usual */ - (void *, void *); + (struct mbuf *, void *, void *); void *ext_arg1; /* optional argument pointer */ void *ext_arg2; /* optional argument pointer */ }; @@ -822,7 +822,8 @@ int m_apply(struct mbuf *, int, int, int m_append(struct mbuf *, int, c_caddr_t); void m_cat(struct mbuf *, struct mbuf *); int m_extadd(struct mbuf *, caddr_t, u_int, - void (*)(void *, void *), void *, void *, int, int, int); + void (*)(struct mbuf *, void *, void *), void *, void *, + int, int, int); struct mbuf *m_collapse(struct mbuf *, int, int); void m_copyback(struct mbuf *, int, int, c_caddr_t); void m_copydata(const struct mbuf *, int, int, caddr_t); Modified: head/sys/sys/sf_buf.h ============================================================================== --- head/sys/sys/sf_buf.h Sat Aug 24 16:55:53 2013 (r254798) +++ head/sys/sys/sf_buf.h Sat Aug 24 16:57:44 2013 (r254799) @@ -55,6 +55,7 @@ struct sfstat { /* sendfile statistic #ifdef _KERNEL #include #include +struct mbuf; /* for sf_buf_mext() */ extern counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; #define SFSTAT_ADD(name, val) \ @@ -66,6 +67,6 @@ extern counter_u64_t sfstat[sizeof(struc struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); void sf_buf_free(struct sf_buf *sf); -void sf_buf_mext(void *addr, void *args); +void sf_buf_mext(struct mbuf *mb, void *addr, void *args); #endif /* !_SYS_SF_BUF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 17:14:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7AB2648F; Sat, 24 Aug 2013 17:14:15 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 681F82974; Sat, 24 Aug 2013 17:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OHEF9g043388; Sat, 24 Aug 2013 17:14:15 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OHEFGi043385; Sat, 24 Aug 2013 17:14:15 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241714.r7OHEFGi043385@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 17:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254800 - in head/sys/dev: cxgb sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 17:14:15 -0000 Author: andre Date: Sat Aug 24 17:14:14 2013 New Revision: 254800 URL: http://svnweb.freebsd.org/changeset/base/254800 Log: Remove unnecessary setup of the m->pkthdr.header pointer. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Aug 24 16:57:44 2013 (r254799) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Aug 24 17:14:14 2013 (r254800) @@ -2634,7 +2634,6 @@ t3_rx_eth(struct adapter *adap, struct m } m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.header = mtod(m, uint8_t *) + sizeof(*cpl) + ethpad; /* * adjust after conversion to mbuf chain */ Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Sat Aug 24 16:57:44 2013 (r254799) +++ head/sys/dev/sfxge/sfxge_rx.c Sat Aug 24 17:14:14 2013 (r254800) @@ -282,7 +282,6 @@ static void __sfxge_rx_deliver(struct sf struct ifnet *ifp = sc->ifnet; m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.header = m->m_data; m->m_pkthdr.csum_data = 0xffff; ifp->if_input(ifp, m); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 17:45:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB66E8C8; Sat, 24 Aug 2013 17:45:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97D5C2A9C; Sat, 24 Aug 2013 17:45:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OHjgmW059564; Sat, 24 Aug 2013 17:45:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OHjgUK059563; Sat, 24 Aug 2013 17:45:42 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201308241745.r7OHjgUK059563@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 24 Aug 2013 17:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254801 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 17:45:42 -0000 Author: pfg Date: Sat Aug 24 17:45:42 2013 New Revision: 254801 URL: http://svnweb.freebsd.org/changeset/base/254801 Log: MFC r253651, r253652, r253657; ext2fs: Don't assume that on-disk format of a directory is the same as in ext2_readdir() has always been very fs specific and different with respect to its ufs_ counterpart. Recent changes from UFS have made it possible to share more closely the implementation. Always start parsing at DIRBLKSIZ aligned offset, skip first entries if uio_offset is not DIRBLKSIZ aligned. Return EINVAL if buffer is too small for single entry. Preallocate buffer for cookies. Skip entries with zero inode number. Reviewed by: gleb, Zheng Liu Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Sat Aug 24 17:14:14 2013 (r254800) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Sat Aug 24 17:45:42 2013 (r254801) @@ -128,60 +128,66 @@ ext2_is_dot_entry(struct componentname * /* * Vnode op for reading directories. - * - * This function has to convert directory entries from the on-disk - * format to the format defined by . Unfortunately, the - * conversion will blow up some entries by four bytes, so it can't be - * done in place. Instead, the conversion is done entry by entry and - * the converted entry is sent via uiomove. - * - * XXX allocate a buffer, convert as many entries as possible, then send - * the whole buffer to uiomove */ int ext2_readdir(struct vop_readdir_args *ap) { + struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; - int count, error; - - struct ext2fs_direct_2 *edp, *dp; - int ncookies; + struct buf *bp; + struct inode *ip; + struct ext2fs_direct_2 *dp, *edp; + u_long *cookies; struct dirent dstdp; - struct uio auio; - struct iovec aiov; - caddr_t dirbuf; + off_t offset, startoffset; + size_t readcnt, skipcnt; + ssize_t startresid; + int ncookies; int DIRBLKSIZ = VTOI(ap->a_vp)->i_e2fs->e2fs_bsize; - int readcnt; - off_t startoffset = uio->uio_offset; + int error; - count = uio->uio_resid; - /* - * Avoid complications for partial directory entries by adjusting - * the i/o to end at a block boundary. Don't give up (like ufs - * does) if the initial adjustment gives a negative count, since - * many callers don't supply a large enough buffer. The correct - * size is a little larger than DIRBLKSIZ to allow for expansion - * of directory entries, but some callers just use 512. - */ - count -= (uio->uio_offset + count) & (DIRBLKSIZ -1); - if (count <= 0) - count += DIRBLKSIZ; - auio = *uio; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_resid = count; - auio.uio_segflg = UIO_SYSSPACE; - aiov.iov_len = count; - dirbuf = malloc(count, M_TEMP, M_WAITOK); - aiov.iov_base = dirbuf; - error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); - if (error == 0) { - readcnt = count - auio.uio_resid; - edp = (struct ext2fs_direct_2 *)&dirbuf[readcnt]; + if (uio->uio_offset < 0) + return (EINVAL); + ip = VTOI(vp); + if (ap->a_ncookies != NULL) { + ncookies = uio->uio_resid; + if (uio->uio_offset >= ip->i_size) + ncookies = 0; + else if (ip->i_size - uio->uio_offset < ncookies) + ncookies = ip->i_size - uio->uio_offset; + ncookies = ncookies / (offsetof(struct ext2fs_direct_2, + e2d_namlen) + 4) + 1; + cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK); + *ap->a_ncookies = ncookies; + *ap->a_cookies = cookies; + } else { ncookies = 0; - bzero(&dstdp, offsetof(struct dirent, d_name)); - for (dp = (struct ext2fs_direct_2 *)dirbuf; - !error && uio->uio_resid > 0 && dp < edp; ) { + cookies = NULL; + } + offset = startoffset = uio->uio_offset; + startresid = uio->uio_resid; + error = 0; + while (error == 0 && uio->uio_resid > 0 && + uio->uio_offset < ip->i_size) { + error = ext2_blkatoff(vp, uio->uio_offset, NULL, &bp); + if (error) + break; + if (bp->b_offset + bp->b_bcount > ip->i_size) + readcnt = ip->i_size - bp->b_offset; + else + readcnt = bp->b_bcount; + skipcnt = (size_t)(uio->uio_offset - bp->b_offset) & + ~(size_t)(DIRBLKSIZ - 1); + offset = bp->b_offset + skipcnt; + dp = (struct ext2fs_direct_2 *)&bp->b_data[skipcnt]; + edp = (struct ext2fs_direct_2 *)&bp->b_data[readcnt]; + while (error == 0 && uio->uio_resid > 0 && dp < edp) { + if (dp->e2d_reclen <= offsetof(struct ext2fs_direct_2, + e2d_namlen) || (caddr_t)dp + dp->e2d_reclen > + (caddr_t)edp) { + error = EIO; + break; + } /*- * "New" ext2fs directory entries differ in 3 ways * from ufs on-disk ones: @@ -198,57 +204,60 @@ ext2_readdir(struct vop_readdir_args *ap * because ext2fs uses a machine-independent disk * layout. */ - dstdp.d_fileno = dp->e2d_ino; - dstdp.d_type = FTTODT(dp->e2d_type); dstdp.d_namlen = dp->e2d_namlen; + dstdp.d_type = FTTODT(dp->e2d_type); + if (offsetof(struct ext2fs_direct_2, e2d_namlen) + + dstdp.d_namlen > dp->e2d_reclen) { + error = EIO; + break; + } + if (offset < startoffset || dp->e2d_ino == 0) + goto nextentry; + dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - bzero(dstdp.d_name + dstdp.d_namlen, - dstdp.d_reclen - offsetof(struct dirent, d_name) - - dstdp.d_namlen); - - if (dp->e2d_reclen > 0) { - if(dstdp.d_reclen <= uio->uio_resid) { - /* advance dp */ - dp = (struct ext2fs_direct_2 *) - ((char *)dp + dp->e2d_reclen); - error = - uiomove(&dstdp, dstdp.d_reclen, uio); - if (!error) - ncookies++; - } else - break; - } else { - error = EIO; + dstdp.d_name[dstdp.d_namlen] = '\0'; + if (dstdp.d_reclen > uio->uio_resid) { + if (uio->uio_resid == startresid) + error = EINVAL; + else + error = EJUSTRETURN; break; } - } - /* we need to correct uio_offset */ - uio->uio_offset = startoffset + (caddr_t)dp - dirbuf; - - if (!error && ap->a_ncookies != NULL) { - u_long *cookiep, *cookies, *ecookies; - off_t off; - - if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1) - panic("ext2_readdir: unexpected uio from NFS server"); - cookies = malloc(ncookies * sizeof(u_long), M_TEMP, - M_WAITOK); - off = startoffset; - for (dp = (struct ext2fs_direct_2 *)dirbuf, - cookiep = cookies, ecookies = cookies + ncookies; - cookiep < ecookies; - dp = (struct ext2fs_direct_2 *)((caddr_t) dp + dp->e2d_reclen)) { - off += dp->e2d_reclen; - *cookiep++ = (u_long) off; + /* Advance dp. */ + error = uiomove((caddr_t)&dstdp, dstdp.d_reclen, uio); + if (error) + break; + if (cookies != NULL) { + KASSERT(ncookies > 0, + ("ext2_readdir: cookies buffer too small")); + *cookies = offset + dp->e2d_reclen; + cookies++; + ncookies--; } - *ap->a_ncookies = ncookies; - *ap->a_cookies = cookies; +nextentry: + offset += dp->e2d_reclen; + dp = (struct ext2fs_direct_2 *)((caddr_t)dp + + dp->e2d_reclen); + } + bqrelse(bp); + uio->uio_offset = offset; + } + /* We need to correct uio_offset. */ + uio->uio_offset = offset; + if (error == EJUSTRETURN) + error = 0; + if (ap->a_ncookies != NULL) { + if (error == 0) { + ap->a_ncookies -= ncookies; + } else { + free(*ap->a_cookies, M_TEMP); + *ap->a_ncookies = 0; + *ap->a_cookies = NULL; } } - free(dirbuf, M_TEMP); - if (ap->a_eofflag) - *ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset; + if (error == 0 && ap->a_eofflag) + *ap->a_eofflag = ip->i_size <= uio->uio_offset; return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 18:54:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EB123907 for ; Sat, 24 Aug 2013 18:54:15 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x22d.google.com (mail-pb0-x22d.google.com [IPv6:2607:f8b0:400e:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C05752D99 for ; Sat, 24 Aug 2013 18:54:15 +0000 (UTC) Received: by mail-pb0-f45.google.com with SMTP id mc17so1894710pbc.4 for ; Sat, 24 Aug 2013 11:54:14 -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:message-id :subject:to:cc:content-type; bh=OcVSGsmaff7SrneocG+y8sbWiFZsPAC+RaOKNKA2tvM=; b=FEnS7YepXrj/WRS7to2w217QbF+9KRAhsIiHKCqivtt05Pxpf6SIiKAR79m+D9k5dT YpFx7gXG4kAboWo8/Cm4hTHu1bEJTD55ogeh7hk0psdjiKPJIkRg+4QQVQy8//TwQtXR AY5NPQYBGVEDqsn67+MoBEwgjYLSX7YQ1lcZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=OcVSGsmaff7SrneocG+y8sbWiFZsPAC+RaOKNKA2tvM=; b=a2tJ7mhQqgRLjlewILQB5QWG9Zzzhocm34CFGcoNnFW/MIBQCx9mDWyYC1koBvM2sN nVAFNGfEFmLzmr+XF/8vthE4bpX/QSDza75vc0G1+z8Hr2OLEQWWMO7KaUk7soGxfIZr Er/qVs6mGHvSFRUnrXzuMLBRbv50AczbXJcTFiX7X80cUDMuEFsq6dc11wkUfqn9Qqak MeJAWD07eP8Jhsav+VqIcB3wlhLGfFNVbSlCLGWGMAYZbO2shEX6Fuk7YOYdXbAmMpWX GHta8Kxe4kwKD79xZPfCsvDHTh3Sey9kDSFPZt2+6l+irnQcPs5lq3qcVjPKScWdHFF+ 5Zpw== X-Gm-Message-State: ALoCoQkVL4bp9TboMsv9N3kmZQNTzx92IUq8RKDmggvj3u6kMyvUQG3ykx94ACmUivKuof0Zic20 X-Received: by 10.68.114.132 with SMTP id jg4mr6300455pbb.109.1377370454856; Sat, 24 Aug 2013 11:54:14 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.70.6.3 with HTTP; Sat, 24 Aug 2013 11:53:44 -0700 (PDT) In-Reply-To: <201308200114.r7K1EGcQ040405@svn.freebsd.org> References: <201308200114.r7K1EGcQ040405@svn.freebsd.org> From: Eitan Adler Date: Sat, 24 Aug 2013 14:53:44 -0400 X-Google-Sender-Auth: e7TFsiemqCN5CCftCLaVhR156Wg Message-ID: Subject: Re: svn commit: r254546 - releng/9.2/usr.sbin/makefs To: Glen Barber Content-Type: text/plain; charset=UTF-8 Cc: svn-src-releng@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 18:54:16 -0000 On Mon, Aug 19, 2013 at 9:14 PM, Glen Barber wrote: > Author: gjb > Date: Tue Aug 20 01:14:16 2013 > New Revision: 254546 > URL: http://svnweb.freebsd.org/changeset/base/254546 > case 'p': > + /* Deprecated in favor of 'Z' */ I know I'm late here but can you please add to the comment a date or release number by which this could be removed? From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 19:02:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9FE22AA0; Sat, 24 Aug 2013 19:02:36 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9D12DF7; Sat, 24 Aug 2013 19:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OJ2aNa001975; Sat, 24 Aug 2013 19:02:36 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OJ2a0I001974; Sat, 24 Aug 2013 19:02:36 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201308241902.r7OJ2a0I001974@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sat, 24 Aug 2013 19:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254802 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 19:02:36 -0000 Author: ken Date: Sat Aug 24 19:02:36 2013 New Revision: 254802 URL: http://svnweb.freebsd.org/changeset/base/254802 Log: Fix a printf format warning on 32-bit mips and powerpc. Reported by: bde, gjb Pointy hat to: ken Modified: head/sys/kern/kern_physio.c Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Sat Aug 24 17:45:42 2013 (r254801) +++ head/sys/kern/kern_physio.c Sat Aug 24 19:02:36 2013 (r254802) @@ -117,10 +117,10 @@ physio(struct cdev *dev, struct uio *uio * This device does not want I/O to be split. */ if (dev->si_flags & SI_NOSPLIT) { - printf("%s: request ptr %#jx is not " + printf("%s: request ptr %p is not " "on a page boundary, cannot split " "request\n", devtoname(dev), - (uintmax_t)bp->b_data); + bp->b_data); error = EFBIG; goto doerror; } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 19:03:18 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 27493BD8; Sat, 24 Aug 2013 19:03:18 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF8C22DFD; Sat, 24 Aug 2013 19:03:17 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r7OJ3AqJ062806; Sat, 24 Aug 2013 13:03:10 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r7OJ3AaL062805; Sat, 24 Aug 2013 13:03:10 -0600 (MDT) (envelope-from ken) Date: Sat, 24 Aug 2013 13:03:10 -0600 From: "Kenneth D. Merry" To: Glen Barber Subject: Re: svn commit: r254760 - in head: share/man/man4 sys/cam/scsi sys/kern sys/sys Message-ID: <20130824190310.GA62787@nargothrond.kdm.org> References: <201308240452.r7O4qMji033904@svn.freebsd.org> <20130824164446.GA41859@glenbarber.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130824164446.GA41859@glenbarber.us> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 19:03:18 -0000 On Sat, Aug 24, 2013 at 12:44:46 -0400, Glen Barber wrote: > On Sat, Aug 24, 2013 at 04:52:22AM +0000, Kenneth D. Merry wrote: > > Author: ken > > Date: Sat Aug 24 04:52:22 2013 > > New Revision: 254760 > > URL: http://svnweb.freebsd.org/changeset/base/254760 > > > > > [...] > > > @@ -83,6 +113,17 @@ physio(struct cdev *dev, struct uio *uio > > */ > > iolen = ((vm_offset_t) bp->b_data) & PAGE_MASK; > > if ((bp->b_bcount + iolen) > bp->b_kvasize) { > > + /* > > + * This device does not want I/O to be split. > > + */ > > + if (dev->si_flags & SI_NOSPLIT) { > > + printf("%s: request ptr %#jx is not " > > + "on a page boundary, cannot split " > > + "request\n", devtoname(dev), > > + (uintmax_t)bp->b_data); > > This breaks LINT for at least powerpc. > > cc1: warnings being treated as errors > /src/sys/kern/kern_physio.c: In function 'physio': > /src/sys/kern/kern_physio.c:123: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] > *** Error code 1 > > > http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-powerpc-powerpc.full Oops, sorry about that! Fixed. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 19:38:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 842D03B9; Sat, 24 Aug 2013 19:38:37 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 717322F57; Sat, 24 Aug 2013 19:38:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OJcbbt020509; Sat, 24 Aug 2013 19:38:37 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OJcbEe020507; Sat, 24 Aug 2013 19:38:37 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241938.r7OJcbEe020507@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 19:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254803 - in head/sys/dev: jme nfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 19:38:37 -0000 Author: andre Date: Sat Aug 24 19:38:36 2013 New Revision: 254803 URL: http://svnweb.freebsd.org/changeset/base/254803 Log: Change local variable tso_segsz to tsosegsz to avoid mbuf.h macro conflicts. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/jme/if_jme.c head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Sat Aug 24 19:02:36 2013 (r254802) +++ head/sys/dev/jme/if_jme.c Sat Aug 24 19:38:36 2013 (r254803) @@ -1690,7 +1690,7 @@ jme_encap(struct jme_softc *sc, struct m struct mbuf *m; bus_dma_segment_t txsegs[JME_MAXTXSEGS]; int error, i, nsegs, prod; - uint32_t cflags, tso_segsz; + uint32_t cflags, tsosegsz; JME_LOCK_ASSERT(sc); @@ -1808,10 +1808,10 @@ jme_encap(struct jme_softc *sc, struct m m = *m_head; cflags = 0; - tso_segsz = 0; + tsosegsz = 0; /* Configure checksum offload and TSO. */ if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz << + tsosegsz = (uint32_t)m->m_pkthdr.tso_segsz << JME_TD_MSS_SHIFT; cflags |= JME_TD_TSO; } else { @@ -1830,7 +1830,7 @@ jme_encap(struct jme_softc *sc, struct m desc = &sc->jme_rdata.jme_tx_ring[prod]; desc->flags = htole32(cflags); - desc->buflen = htole32(tso_segsz); + desc->buflen = htole32(tsosegsz); desc->addr_hi = htole32(m->m_pkthdr.len); desc->addr_lo = 0; sc->jme_cdata.jme_tx_cnt++; Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Sat Aug 24 19:02:36 2013 (r254802) +++ head/sys/dev/nfe/if_nfe.c Sat Aug 24 19:38:36 2013 (r254803) @@ -2390,7 +2390,7 @@ nfe_encap(struct nfe_softc *sc, struct m bus_dmamap_t map; bus_dma_segment_t segs[NFE_MAX_SCATTER]; int error, i, nsegs, prod, si; - uint32_t tso_segsz; + uint32_t tsosegsz; uint16_t cflags, flags; struct mbuf *m; @@ -2429,9 +2429,9 @@ nfe_encap(struct nfe_softc *sc, struct m m = *m_head; cflags = flags = 0; - tso_segsz = 0; + tsosegsz = 0; if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz << + tsosegsz = (uint32_t)m->m_pkthdr.tso_segsz << NFE_TX_TSO_SHIFT; cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM); cflags |= NFE_TX_TSO; @@ -2482,14 +2482,14 @@ nfe_encap(struct nfe_softc *sc, struct m if ((m->m_flags & M_VLANTAG) != 0) desc64->vtag = htole32(NFE_TX_VTAG | m->m_pkthdr.ether_vtag); - if (tso_segsz != 0) { + if (tsosegsz != 0) { /* * XXX * The following indicates the descriptor element * is a 32bit quantity. */ - desc64->length |= htole16((uint16_t)tso_segsz); - desc64->flags |= htole16(tso_segsz >> 16); + desc64->length |= htole16((uint16_t)tsosegsz); + desc64->flags |= htole16(tsosegsz >> 16); } /* * finally, set the valid/checksum/TSO bit in the first @@ -2502,14 +2502,14 @@ nfe_encap(struct nfe_softc *sc, struct m else desc32->flags |= htole16(NFE_TX_LASTFRAG_V1); desc32 = &sc->txq.desc32[si]; - if (tso_segsz != 0) { + if (tsosegsz != 0) { /* * XXX * The following indicates the descriptor element * is a 32bit quantity. */ - desc32->length |= htole16((uint16_t)tso_segsz); - desc32->flags |= htole16(tso_segsz >> 16); + desc32->length |= htole16((uint16_t)tsosegsz); + desc32->flags |= htole16(tsosegsz >> 16); } /* * finally, set the valid/checksum/TSO bit in the first From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 19:51:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 35FAE6E7; Sat, 24 Aug 2013 19:51:22 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20DB12FFC; Sat, 24 Aug 2013 19:51:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OJpM13028993; Sat, 24 Aug 2013 19:51:22 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OJpJxa028966; Sat, 24 Aug 2013 19:51:19 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241951.r7OJpJxa028966@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 19:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254804 - in head/sys: dev/cxgb dev/e1000 dev/ixgbe dev/patm dev/qlxgb kern net netinet netinet6 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 19:51:22 -0000 Author: andre Date: Sat Aug 24 19:51:18 2013 New Revision: 254804 URL: http://svnweb.freebsd.org/changeset/base/254804 Log: Restructure the mbuf pkthdr to make it fit for upcoming capabilities and features. The changes in particular are: o Remove rarely used "header" pointer and replace it with a 64bit protocol/ layer specific union PH_loc for local use. Protocols can flexibly overlay their own 8 to 64 bit fields to store information while the packet is worked on. o Mechanically convert IP reassembly, IGMP/MLD and ATM to use pkthdr.PH_loc instead of pkthdr.header. o Extend csum_flags to 64bits to allow for additional future offload information to be carried (e.g. iSCSI, IPsec offload, and others). o Move the RSS hash type enumerator from abusing m_flags to its own 8bit rsstype field. Adjust accessor macros. o Add cosqos field to store Class of Service / Quality of Service information with the packet. It is not yet supported in any drivers but allows us to get on par with Cisco/Juniper in routing applications (plus MPLS QoS) with a modernized ALTQ. o Add four 8 bit fields l[2-5]hlen to store the relative header offsets from the start of the packet. This is important for various offload capabilities and to relieve the drivers from having to parse the packet and protocol headers to find out location of checksums and other information. Header parsing in drivers is a lot of copy-paste and unhandled corner cases which we want to avoid. o Add another flexible 64bit union to map various additional persistent packet information, like ether_vtag, tso_segsz and csum fields. Depending on the csum_flags settings some fields may have different usage making it very flexible and adaptable to future capabilities. o Restructure the CSUM flags to better signify their outbound (down the stack) and inbound (up the stack) use. The CSUM flags used to be a bit chaotic and rather poorly documented leading to incorrect use in many places. Bring clarity into their use through better naming. Compatibility mappings are provided to preserve the API. The drivers can be corrected one by one and MFC'd without issue. o The size of pkthdr stays the same at 48/56bytes (32/64bit architectures). Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c head/sys/dev/patm/if_patm.c head/sys/dev/patm/if_patm_tx.c head/sys/dev/qlxgb/qla_hw.c head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/net/if.h head/sys/netinet/igmp.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/mld6.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Aug 24 19:51:18 2013 (r254804) @@ -1470,9 +1470,9 @@ t3_encap(struct sge_qset *qs, struct mbu hdr->len = htonl(mlen | 0x80000000); if (__predict_false(mlen < TCPPKTHDRSIZE)) { - printf("mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%#x,flags=%#x", + printf("mbuf=%p,len=%d,tso_segsz=%d,csum_flags=%b,flags=%#x", m0, mlen, m0->m_pkthdr.tso_segsz, - m0->m_pkthdr.csum_flags, m0->m_flags); + (int)m0->m_pkthdr.csum_flags, CSUM_BITS, m0->m_flags); panic("tx tso packet too small"); } Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/e1000/if_igb.c Sat Aug 24 19:51:18 2013 (r254804) @@ -4981,7 +4981,7 @@ igb_rx_checksum(u32 staterr, struct mbuf } if (status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) { - u16 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + u64 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); #if __FreeBSD_version >= 800000 if (sctp) /* reassign */ type = CSUM_SCTP_VALID; Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/ixgbe/ixgbe.c Sat Aug 24 19:51:18 2013 (r254804) @@ -4625,7 +4625,7 @@ ixgbe_rx_checksum(u32 staterr, struct mb mp->m_pkthdr.csum_flags = 0; } if (status & IXGBE_RXD_STAT_L4CS) { - u16 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + u64 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); #if __FreeBSD_version >= 800000 if (sctp) type = CSUM_SCTP_VALID; Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/ixgbe/ixv.c Sat Aug 24 19:51:18 2013 (r254804) @@ -3544,7 +3544,7 @@ ixv_rx_checksum(u32 staterr, struct mbuf mp->m_pkthdr.csum_flags = 0; } if (status & IXGBE_RXD_STAT_L4CS) { - u16 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + u64 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); #if __FreeBSD_version >= 800000 if (sctp) type = CSUM_SCTP_VALID; Modified: head/sys/dev/patm/if_patm.c ============================================================================== --- head/sys/dev/patm/if_patm.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/patm/if_patm.c Sat Aug 24 19:51:18 2013 (r254804) @@ -319,7 +319,7 @@ patm_stop(struct patm_softc *sc) for (i = 0; i < IDT_TSQE_TAG_SPACE; i++) { if ((m = scd->on_card[i]) != NULL) { scd->on_card[i] = 0; - map = m->m_pkthdr.header; + map = m->m_pkthdr.PH_loc.ptr; bus_dmamap_unload(sc->tx_tag, map->map); SLIST_INSERT_HEAD(&sc->tx_maps_free, map, link); Modified: head/sys/dev/patm/if_patm_tx.c ============================================================================== --- head/sys/dev/patm/if_patm_tx.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/patm/if_patm_tx.c Sat Aug 24 19:51:18 2013 (r254804) @@ -373,7 +373,7 @@ patm_start(struct ifnet *ifp) } /* save data */ - m->m_pkthdr.header = vcc; + m->m_pkthdr.PH_loc.ptr = vcc; /* try to put it on the channels queue */ if (_IF_QFULL(&vcc->scd->q)) { @@ -473,7 +473,7 @@ patm_launch(struct patm_softc *sc, struc if (m == NULL) break; - a.vcc = m->m_pkthdr.header; + a.vcc = m->m_pkthdr.PH_loc.ptr; /* we must know the number of segments beforehand - count * this may actually give a wrong number of segments for @@ -499,7 +499,7 @@ patm_launch(struct patm_softc *sc, struc } /* load the map */ - m->m_pkthdr.header = map; + m->m_pkthdr.PH_loc.ptr = map; a.mbuf = m; /* handle AAL_RAW */ @@ -690,7 +690,7 @@ patm_tx(struct patm_softc *sc, u_int sta scd->on_card[last] = NULL; patm_debug(sc, TX, "ok tag=%x", last); - map = m->m_pkthdr.header; + map = m->m_pkthdr.PH_loc.ptr; scd->space += m->m_pkthdr.csum_data; bus_dmamap_sync(sc->tx_tag, map->map, Modified: head/sys/dev/qlxgb/qla_hw.c ============================================================================== --- head/sys/dev/qlxgb/qla_hw.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/dev/qlxgb/qla_hw.c Sat Aug 24 19:51:18 2013 (r254804) @@ -1000,9 +1000,9 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm (mp->m_pkthdr.len > ha->max_frame_size)){ /* TBD: copy into private buffer and send it */ device_printf(dev, - "%s: (nsegs[%d, %d, 0x%x] > Q8_TX_MAX_SEGMENTS)\n", + "%s: (nsegs[%d, %d, 0x%b] > Q8_TX_MAX_SEGMENTS)\n", __func__, nsegs, mp->m_pkthdr.len, - mp->m_pkthdr.csum_flags); + (int)mp->m_pkthdr.csum_flags, CSUM_BITS); qla_dump_buf8(ha, "qla_hw_send: wrong pkt", mtod(mp, char *), mp->m_len); return (EINVAL); Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/kern/kern_mbuf.c Sat Aug 24 19:51:18 2013 (r254804) @@ -650,16 +650,20 @@ m_pkthdr_init(struct mbuf *m, int how) int error; #endif m->m_data = m->m_pktdat; - SLIST_INIT(&m->m_pkthdr.tags); m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.header = NULL; + SLIST_INIT(&m->m_pkthdr.tags); m->m_pkthdr.len = 0; m->m_pkthdr.flowid = 0; - m->m_pkthdr.fibnum = 0; m->m_pkthdr.csum_flags = 0; - m->m_pkthdr.csum_data = 0; - m->m_pkthdr.tso_segsz = 0; - m->m_pkthdr.ether_vtag = 0; + m->m_pkthdr.fibnum = 0; + m->m_pkthdr.cosqos = 0; + m->m_pkthdr.rsstype = 0; + m->m_pkthdr.l2hlen = 0; + m->m_pkthdr.l3hlen = 0; + m->m_pkthdr.l4hlen = 0; + m->m_pkthdr.l5hlen = 0; + m->m_pkthdr.PH_per.sixtyfour[0] = 0; + m->m_pkthdr.PH_loc.sixtyfour[0] = 0; #ifdef MAC /* If the label init fails, fail the alloc */ error = mac_mbuf_init(m, how); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/kern/uipc_mbuf.c Sat Aug 24 19:51:18 2013 (r254804) @@ -438,11 +438,6 @@ m_sanity(struct mbuf *m0, int sanitize) M_SANITY_ACTION("m_data outside mbuf data range right"); if ((caddr_t)m->m_data + m->m_len > b) M_SANITY_ACTION("m_data + m_len exeeds mbuf space"); - if ((m->m_flags & M_PKTHDR) && m->m_pkthdr.header) { - if ((caddr_t)m->m_pkthdr.header < a || - (caddr_t)m->m_pkthdr.header > b) - M_SANITY_ACTION("m_pkthdr.header outside mbuf data range"); - } /* m->m_nextpkt may only be set on first mbuf in chain. */ if (m != m0 && m->m_nextpkt != NULL) { @@ -746,7 +741,6 @@ m_copymdata(struct mbuf *m, struct mbuf return NULL; bcopy(&buf, mm->m_ext.ext_buf, mm->m_len); mm->m_data = mm->m_ext.ext_buf; - mm->m_pkthdr.header = NULL; } if (prep && !(mm->m_flags & M_EXT) && len > M_LEADINGSPACE(mm)) { bcopy(mm->m_data, &buf, mm->m_len); @@ -757,7 +751,6 @@ m_copymdata(struct mbuf *m, struct mbuf mm->m_ext.ext_size - mm->m_len, mm->m_len); mm->m_data = (caddr_t)mm->m_ext.ext_buf + mm->m_ext.ext_size - mm->m_len; - mm->m_pkthdr.header = NULL; } /* Append/prepend as many mbuf (clusters) as necessary to fit len. */ Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/net/if.h Sat Aug 24 19:51:18 2013 (r254804) @@ -103,7 +103,7 @@ struct if_data { u_long ifi_omcasts; /* packets sent via multicast */ u_long ifi_iqdrops; /* dropped on input, this interface */ u_long ifi_noproto; /* destined for unsupported protocol */ - u_long ifi_hwassist; /* HW offload capabilities, see IFCAP */ + uint64_t ifi_hwassist; /* HW offload capabilities, see IFCAP */ time_t ifi_epoch; /* uptime at attach or stat reset */ struct timeval ifi_lastchange; /* time of last administrative change */ }; Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/netinet/igmp.c Sat Aug 24 19:51:18 2013 (r254804) @@ -289,7 +289,7 @@ igmp_save_context(struct mbuf *m, struct { #ifdef VIMAGE - m->m_pkthdr.header = ifp->if_vnet; + m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; #endif /* VIMAGE */ m->m_pkthdr.flowid = ifp->if_index; } @@ -298,7 +298,7 @@ static __inline void igmp_scrub_context(struct mbuf *m) { - m->m_pkthdr.header = NULL; + m->m_pkthdr.PH_loc.ptr = NULL; m->m_pkthdr.flowid = 0; } @@ -326,7 +326,7 @@ igmp_restore_context(struct mbuf *m) #ifdef notyet #if defined(VIMAGE) && defined(INVARIANTS) - KASSERT(curvnet == (m->m_pkthdr.header), + KASSERT(curvnet == (m->m_pkthdr.PH_loc.ptr), ("%s: called when curvnet was not restored", __func__)); #endif #endif @@ -3403,7 +3403,7 @@ igmp_intr(struct mbuf *m) * indexes to guard against interface detach, they are * unique to each VIMAGE and must be retrieved. */ - CURVNET_SET((struct vnet *)(m->m_pkthdr.header)); + CURVNET_SET((struct vnet *)(m->m_pkthdr.PH_loc.ptr)); ifindex = igmp_restore_context(m); /* Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/netinet/ip_input.c Sat Aug 24 19:51:18 2013 (r254804) @@ -921,7 +921,7 @@ found: * ip_reass() will return a different mbuf. */ IPSTAT_INC(ips_fragments); - m->m_pkthdr.header = ip; + m->m_pkthdr.PH_loc.ptr = ip; /* Previous ip_reass() started here. */ /* @@ -964,7 +964,7 @@ found: #endif } -#define GETIP(m) ((struct ip*)((m)->m_pkthdr.header)) +#define GETIP(m) ((struct ip*)((m)->m_pkthdr.PH_loc.ptr)) /* * Handle ECN by comparing this segment with the first one; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/netinet6/ip6_output.c Sat Aug 24 19:51:18 2013 (r254804) @@ -196,8 +196,8 @@ in6_delayed_cksum(struct mbuf *m, uint32 if (offset + sizeof(u_short) > m->m_len) { printf("%s: delayed m_pullup, m->len: %d plen %u off %u " - "csum_flags=0x%04x\n", __func__, m->m_len, plen, offset, - m->m_pkthdr.csum_flags); + "csum_flags=%b\n", __func__, m->m_len, plen, offset, + (int)m->m_pkthdr.csum_flags, CSUM_BITS); /* * XXX this should not happen, but if it does, the correct * behavior may be to insert the checksum in the appropriate Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/netinet6/mld6.c Sat Aug 24 19:51:18 2013 (r254804) @@ -275,7 +275,7 @@ mld_save_context(struct mbuf *m, struct { #ifdef VIMAGE - m->m_pkthdr.header = ifp->if_vnet; + m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; #endif /* VIMAGE */ m->m_pkthdr.flowid = ifp->if_index; } @@ -284,7 +284,7 @@ static __inline void mld_scrub_context(struct mbuf *m) { - m->m_pkthdr.header = NULL; + m->m_pkthdr.PH_loc.ptr = NULL; m->m_pkthdr.flowid = 0; } @@ -300,7 +300,7 @@ mld_restore_context(struct mbuf *m) { #if defined(VIMAGE) && defined(INVARIANTS) - KASSERT(curvnet == m->m_pkthdr.header, + KASSERT(curvnet == m->m_pkthdr.PH_loc.ptr, ("%s: called when curvnet was not restored", __func__)); #endif return (m->m_pkthdr.flowid); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 24 19:38:36 2013 (r254803) +++ head/sys/sys/mbuf.h Sat Aug 24 19:51:18 2013 (r254804) @@ -112,28 +112,49 @@ struct m_tag { /* * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. + * Size ILP32: 48 + * LP64: 56 */ struct pkthdr { struct ifnet *rcvif; /* rcv interface */ - /* variables for ip and tcp reassembly */ - void *header; /* pointer to packet header */ - int len; /* total packet length */ - uint32_t flowid; /* packet's 4-tuple system - * flow identifier - */ - /* variables for hardware checksum */ - int csum_flags; /* flags regarding checksum */ - int csum_data; /* data field used by csum routines */ - u_int16_t tso_segsz; /* TSO segment size */ - union { - u_int16_t vt_vtag; /* Ethernet 802.1p+q vlan tag */ - u_int16_t vt_nrecs; /* # of IGMPv3 records in this chain */ - } PH_vt; - u_int16_t fibnum; /* this packet should use this fib */ - u_int16_t pad2; /* align to 32 bits */ SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ + int32_t len; /* total packet length */ + + /* Layer crossing persistent information. */ + uint32_t flowid; /* packet's 4-tuple system */ + uint64_t csum_flags; /* checksum and offload features */ + uint16_t fibnum; /* this packet should use this fib */ + uint8_t cosqos; /* class/quality of service */ + uint8_t rsstype; /* hash type */ + uint8_t l2hlen; /* layer 2 header length */ + uint8_t l3hlen; /* layer 3 header length */ + uint8_t l4hlen; /* layer 4 header length */ + uint8_t l5hlen; /* layer 5 header length */ + union { + uint8_t eigth[8]; + uint16_t sixteen[4]; + uint32_t thirtytwo[2]; + uint64_t sixtyfour[1]; + uintptr_t unintptr[1]; + void *ptr; + } PH_per; + + /* Layer specific non-persistent local storage for reassembly, etc. */ + union { + uint8_t eigth[8]; + uint16_t sixteen[4]; + uint32_t thirtytwo[2]; + uint64_t sixtyfour[1]; + uintptr_t unintptr[1]; + void *ptr; + } PH_loc; }; -#define ether_vtag PH_vt.vt_vtag +#define ether_vtag PH_per.sixteen[0] +#define PH_vt PH_per +#define vt_nrecs sixteen[0] +#define tso_segsz PH_per.sixteen[1] +#define csum_phsum PH_per.sixteen[2] +#define csum_data PH_per.thirtytwo[1] /* * Description of external storage mapped into mbuf; valid only if M_EXT is @@ -209,8 +230,6 @@ struct mbuf { #define M_PROTO11 0x00400000 /* protocol-specific */ #define M_PROTO12 0x00800000 /* protocol-specific */ -#define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ - /* * Flags to purge when crossing layers. */ @@ -219,6 +238,13 @@ struct mbuf { M_PROTO9|M_PROTO10|M_PROTO11|M_PROTO12) /* + * Flags preserved when copying m_pkthdr. + */ +#define M_COPYFLAGS \ + (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_VLANTAG|M_PROMISC| \ + M_PROTOFLAGS) + +/* * Mbuf flag description for use with printf(9) %b identifier. */ #define M_FLAG_BITS \ @@ -245,31 +271,46 @@ struct mbuf { * that provide an opaque flow identifier, allowing for ordering and * distribution without explicit affinity. */ -#define M_HASHTYPE_SHIFT 24 -#define M_HASHTYPE_NONE 0x0 -#define M_HASHTYPE_RSS_IPV4 0x1 /* IPv4 2-tuple */ -#define M_HASHTYPE_RSS_TCP_IPV4 0x2 /* TCPv4 4-tuple */ -#define M_HASHTYPE_RSS_IPV6 0x3 /* IPv6 2-tuple */ -#define M_HASHTYPE_RSS_TCP_IPV6 0x4 /* TCPv6 4-tuple */ -#define M_HASHTYPE_RSS_IPV6_EX 0x5 /* IPv6 2-tuple + ext hdrs */ -#define M_HASHTYPE_RSS_TCP_IPV6_EX 0x6 /* TCPv6 4-tiple + ext hdrs */ -#define M_HASHTYPE_OPAQUE 0xf /* ordering, not affinity */ - -#define M_HASHTYPE_CLEAR(m) (m)->m_flags &= ~(M_HASHTYPEBITS) -#define M_HASHTYPE_GET(m) (((m)->m_flags & M_HASHTYPEBITS) >> \ - M_HASHTYPE_SHIFT) -#define M_HASHTYPE_SET(m, v) do { \ - (m)->m_flags &= ~M_HASHTYPEBITS; \ - (m)->m_flags |= ((v) << M_HASHTYPE_SHIFT); \ -} while (0) +#define M_HASHTYPE_NONE 0 +#define M_HASHTYPE_RSS_IPV4 1 /* IPv4 2-tuple */ +#define M_HASHTYPE_RSS_TCP_IPV4 2 /* TCPv4 4-tuple */ +#define M_HASHTYPE_RSS_IPV6 3 /* IPv6 2-tuple */ +#define M_HASHTYPE_RSS_TCP_IPV6 4 /* TCPv6 4-tuple */ +#define M_HASHTYPE_RSS_IPV6_EX 5 /* IPv6 2-tuple + ext hdrs */ +#define M_HASHTYPE_RSS_TCP_IPV6_EX 6 /* TCPv6 4-tiple + ext hdrs */ +#define M_HASHTYPE_OPAQUE 255 /* ordering, not affinity */ + +#define M_HASHTYPE_CLEAR(m) ((m)->m_pkthdr.rsstype = 0) +#define M_HASHTYPE_GET(m) ((m)->m_pkthdr.rsstype) +#define M_HASHTYPE_SET(m, v) ((m)->m_pkthdr.rsstype = (v)) #define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v)) /* - * Flags preserved when copying m_pkthdr. + * COS/QOS class and quality of service tags. + * It uses DSCP code points as base. */ -#define M_COPYFLAGS \ - (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_VLANTAG|M_PROMISC| \ - M_PROTOFLAGS|M_HASHTYPEBITS) +#define QOS_DSCP_CS0 0x00 +#define QOS_DSCP_DEF QOS_DSCP_CS0 +#define QOS_DSCP_CS1 0x20 +#define QOS_DSCP_AF11 0x28 +#define QOS_DSCP_AF12 0x30 +#define QOS_DSCP_AF13 0x38 +#define QOS_DSCP_CS2 0x40 +#define QOS_DSCP_AF21 0x48 +#define QOS_DSCP_AF22 0x50 +#define QOS_DSCP_AF23 0x58 +#define QOS_DSCP_CS3 0x60 +#define QOS_DSCP_AF31 0x68 +#define QOS_DSCP_AF32 0x70 +#define QOS_DSCP_AF33 0x78 +#define QOS_DSCP_CS4 0x80 +#define QOS_DSCP_AF41 0x88 +#define QOS_DSCP_AF42 0x90 +#define QOS_DSCP_AF43 0x98 +#define QOS_DSCP_CS5 0xa0 +#define QOS_DSCP_EF 0xb8 +#define QOS_DSCP_CS6 0xc0 +#define QOS_DSCP_CS7 0xe0 /* * External mbuf storage buffer types. @@ -325,33 +366,66 @@ struct mbuf { "\30EXT_FLAG_EXP4" /* - * Flags indicating hw checksum support and sw checksum requirements. This - * field can be directly tested against if_data.ifi_hwassist. - */ -#define CSUM_IP 0x0001 /* will csum IP */ -#define CSUM_TCP 0x0002 /* will csum TCP */ -#define CSUM_UDP 0x0004 /* will csum UDP */ -#define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ -#define CSUM_TSO 0x0020 /* will do TSO */ -#define CSUM_SCTP 0x0040 /* will csum SCTP */ -#define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ - -#define CSUM_IP_CHECKED 0x0100 /* did csum IP */ -#define CSUM_IP_VALID 0x0200 /* ... the csum is valid */ -#define CSUM_DATA_VALID 0x0400 /* csum_data field is valid */ -#define CSUM_PSEUDO_HDR 0x0800 /* csum_data has pseudo hdr */ -#define CSUM_SCTP_VALID 0x1000 /* SCTP checksum is valid */ -#define CSUM_UDP_IPV6 0x2000 /* will csum IPv6/UDP */ -#define CSUM_TCP_IPV6 0x4000 /* will csum IPv6/TCP */ -/* CSUM_TSO_IPV6 0x8000 will do IPv6/TSO */ - -/* CSUM_FRAGMENT_IPV6 0x10000 will do IPv6 fragementation */ - -#define CSUM_DELAY_DATA_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) + * Flags indicating checksum, segmentation and other offload work to be + * done, or already done, by hardware or lower layers. It is split into + * separate inbound and outbound flags. + * + * Outbound flags that are set by upper protocol layers requesting lower + * layers, or ideally the hardware, to perform these offloading tasks. + * For outbound packets this field and its flags can be directly tested + * against if_data.ifi_hwassist. + */ +#define CSUM_IP 0x00000001 /* IP header checksum offload */ +#define CSUM_IP_UDP 0x00000002 /* UDP checksum offload */ +#define CSUM_IP_TCP 0x00000004 /* TCP checksum offload */ +#define CSUM_IP_SCTP 0x00000008 /* SCTP checksum offload */ +#define CSUM_IP_TSO 0x00000010 /* TCP segmentation offload */ +#define CSUM_IP_ISCSI 0x00000020 /* iSCSI checksum offload */ + +#define CSUM_IP6_UDP 0x00000200 /* UDP checksum offload */ +#define CSUM_IP6_TCP 0x00000400 /* TCP checksum offload */ +#define CSUM_IP6_SCTP 0x00000800 /* SCTP checksum offload */ +#define CSUM_IP6_TSO 0x00001000 /* TCP segmentation offload */ +#define CSUM_IP6_ISCSI 0x00002000 /* iSCSI checksum offload */ + +/* Inbound checksum support where the checksum was verified by hardware. */ +#define CSUM_L3_CALC 0x01000000 /* calculated layer 3 csum */ +#define CSUM_L3_VALID 0x02000000 /* checksum is correct */ +#define CSUM_L4_CALC 0x04000000 /* calculated layer 4 csum */ +#define CSUM_L4_VALID 0x08000000 /* checksum is correct */ +#define CSUM_L5_CALC 0x10000000 /* calculated layer 5 csum */ +#define CSUM_L5_VALID 0x20000000 /* checksum is correct */ +#define CSUM_COALESED 0x40000000 /* contains merged segments */ + +/* + * CSUM flag description for use with printf(9) %b identifier. + */ +#define CSUM_BITS \ + "\20\1CSUM_IP\2CSUM_IP_UDP\3CSUM_IP_TCP\4CSUM_IP_SCTP\5CSUM_IP_TSO" \ + "\6CSUM_IP_ISCSI" \ + "\12CSUM_IP6_UDP\13CSUM_IP6_TCP\14CSUM_IP6_SCTP\15CSUM_IP6_TSO" \ + "\16CSUM_IP6_ISCSI" \ + "\31CSUM_L3_CALC\32CSUM_L3_VALID\33CSUM_L4_CALC\34CSUM_L4_VALID" \ + "\35CSUM_L5_CALC\36CSUM_L5_VALID\37CSUM_COALESED" + +/* CSUM flags compatibility mappings. */ +#define CSUM_IP_CHECKED CSUM_L3_CALC +#define CSUM_IP_VALID CSUM_L3_VALID +#define CSUM_DATA_VALID CSUM_L4_VALID +#define CSUM_PSEUDO_HDR CSUM_L4_CALC +#define CSUM_SCTP_VALID CSUM_L3_VALID +#define CSUM_DELAY_DATA (CSUM_TCP|CSUM_UDP) +#define CSUM_DELAY_IP CSUM_IP /* Only v4, no v6 IP hdr csum */ +#define CSUM_DELAY_DATA_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6) #define CSUM_DATA_VALID_IPV6 CSUM_DATA_VALID - -#define CSUM_DELAY_DATA (CSUM_TCP | CSUM_UDP) -#define CSUM_DELAY_IP (CSUM_IP) /* Only v4, no v6 IP hdr csum */ +#define CSUM_TCP CSUM_IP_TCP +#define CSUM_UDP CSUM_IP_UDP +#define CSUM_SCTP CSUM_IP_SCTP +#define CSUM_TSO (CSUM_IP_TSO|CSUM_IP6_TSO) +#define CSUM_UDP_IPV6 CSUM_IP6_UDP +#define CSUM_TCP_IPV6 CSUM_IP6_TCP +#define CSUM_SCTP_IPV6 CSUM_IP6_SCTP +#define CSUM_FRAGMENT 0x0 /* Unused */ /* * mbuf types. From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 19:58:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AAAA6A1D; Sat, 24 Aug 2013 19:58:36 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96483202B; Sat, 24 Aug 2013 19:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OJwa9f031369; Sat, 24 Aug 2013 19:58:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OJwaxV031368; Sat, 24 Aug 2013 19:58:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308241958.r7OJwaxV031368@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 19:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254805 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 19:58:36 -0000 Author: andre Date: Sat Aug 24 19:58:36 2013 New Revision: 254805 URL: http://svnweb.freebsd.org/changeset/base/254805 Log: Add mtodo(m, o) macro taking an additional offset into the mbuf data section. Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 24 19:51:18 2013 (r254804) +++ head/sys/sys/mbuf.h Sat Aug 24 19:58:36 2013 (r254805) @@ -67,8 +67,10 @@ * type: * * mtod(m, t) -- Convert mbuf pointer to data pointer of correct type. + * mtodo(m, o) -- Same as above but with offset 'o' into data. */ #define mtod(m, t) ((t)((m)->m_data)) +#define mtodo(m, o) ((void *)(((m)->m_data) + (o))) /* * Argument structure passed to UMA routines during mbuf and packet From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 20:06:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA9D2DD5; Sat, 24 Aug 2013 20:06:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C733C20B8; Sat, 24 Aug 2013 20:06:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OK60l9036250; Sat, 24 Aug 2013 20:06:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OK60e0036247; Sat, 24 Aug 2013 20:06:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201308242006.r7OK60e0036247@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 24 Aug 2013 20:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254806 - in head: bin/sh tools/regression/bin/sh/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 20:06:00 -0000 Author: jilles Date: Sat Aug 24 20:06:00 2013 New Revision: 254806 URL: http://svnweb.freebsd.org/changeset/base/254806 Log: sh: Reject ++ and -- in arithmetic. POSIX does not require ++ and -- in arithmetic. It is probably more useful to reject them than to treat ++x and --x as x silently. Note that the behaviour of increment and decrement can be obtained via (x+=1), ((x+=1)-1), (x-=1) and ((x-=1)+1). PR: bin/176444 Added: head/tools/regression/bin/sh/expansion/arith13.0 (contents, props changed) Modified: head/bin/sh/arith_yylex.c Modified: head/bin/sh/arith_yylex.c ============================================================================== --- head/bin/sh/arith_yylex.c Sat Aug 24 19:58:36 2013 (r254805) +++ head/bin/sh/arith_yylex.c Sat Aug 24 20:06:00 2013 (r254806) @@ -218,9 +218,13 @@ checkeqcur: value += ARITH_REM - '%'; goto checkeq; case '+': + if (buf[1] == '+') + return ARITH_BAD; value += ARITH_ADD - '+'; goto checkeq; case '-': + if (buf[1] == '-') + return ARITH_BAD; value += ARITH_SUB - '-'; goto checkeq; case '~': Added: head/tools/regression/bin/sh/expansion/arith13.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/arith13.0 Sat Aug 24 20:06:00 2013 (r254806) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# Pre-increment and pre-decrement in arithmetic expansion are not in POSIX. +# Require either an error or a correct implementation. + +! (eval 'x=4; [ $((++x)) != 5 ] || [ $x != 5 ]') 2>/dev/null && +! (eval 'x=2; [ $((--x)) != 1 ] || [ $x != 1 ]') 2>/dev/null From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 20:26:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0EB38251; Sat, 24 Aug 2013 20:26:42 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF365217D; Sat, 24 Aug 2013 20:26:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OKQf2Y047548; Sat, 24 Aug 2013 20:26:41 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OKQfWa047547; Sat, 24 Aug 2013 20:26:41 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308242026.r7OKQfWa047547@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 20:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254807 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 20:26:42 -0000 Author: andre Date: Sat Aug 24 20:26:41 2013 New Revision: 254807 URL: http://svnweb.freebsd.org/changeset/base/254807 Log: Compact m_hdr by packing the type and flags fields into one uint32_t. The mbuf type is an enumerator with only a handful of types in use and thus reduced from int to 8bits allowing for 255 types to be specified. Only 5 types have been in use for a long time. The flags field gets the remaining 24 bits with 12 bits for global persistent flags and 12 bits for protocol/layer specific overlays. Some of the global flags/functionality can be moved to the csum_flags or ext_flags bits in the future. MT_VENDOR[1-4] and MT_EXP[1-4] types for vendor-internal and experimental local mapping are added. The size of m_hdr shrinks from 24/40 to 20/32bytes (32/64bit architectures). Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 24 20:06:00 2013 (r254806) +++ head/sys/sys/mbuf.h Sat Aug 24 20:26:41 2013 (r254807) @@ -82,23 +82,18 @@ struct mb_args { }; #endif /* _KERNEL */ -#if defined(__LP64__) -#define M_HDR_PAD 6 -#else -#define M_HDR_PAD 2 -#endif - /* * Header present at the beginning of every mbuf. + * Size ILP32: 20 + * LP64: 32 */ struct m_hdr { struct mbuf *mh_next; /* next buffer in chain */ struct mbuf *mh_nextpkt; /* next chain in queue/record */ caddr_t mh_data; /* location of data */ - int mh_len; /* amount of data in this mbuf */ - int mh_flags; /* flags; see below */ - short mh_type; /* type of data in this mbuf */ - uint8_t pad[M_HDR_PAD];/* word align */ + int32_t mh_len; /* amount of data in this mbuf */ + uint32_t mh_type:8, /* type of data in this mbuf */ + mh_flags:24; /* flags; see below */ }; /* @@ -206,7 +201,10 @@ struct mbuf { #define m_dat M_dat.M_databuf /* - * mbuf flags. + * mbuf flags of global significance and layer crossing. + * Those of only protocol/layer specific significance are to be mapped + * to M_PROTO[1-12] and cleared at layer handoff boundaries. + * NB: Limited to the lower 24 bits. */ #define M_EXT 0x00000001 /* has associated external storage */ #define M_PKTHDR 0x00000002 /* start of record */ @@ -430,12 +428,24 @@ struct mbuf { #define CSUM_FRAGMENT 0x0 /* Unused */ /* - * mbuf types. + * mbuf types describing the content of the mbuf (including external storage). */ #define MT_NOTMBUF 0 /* USED INTERNALLY ONLY! Object is not mbuf */ #define MT_DATA 1 /* dynamic (data) allocation */ #define MT_HEADER MT_DATA /* packet header, use M_PKTHDR instead */ + +#define MT_VENDOR1 4 /* for vendor-internal use */ +#define MT_VENDOR2 5 /* for vendor-internal use */ +#define MT_VENDOR3 6 /* for vendor-internal use */ +#define MT_VENDOR4 7 /* for vendor-internal use */ + #define MT_SONAME 8 /* socket name */ + +#define MT_EXP1 9 /* for experimental use */ +#define MT_EXP2 10 /* for experimental use */ +#define MT_EXP3 11 /* for experimental use */ +#define MT_EXP4 12 /* for experimental use */ + #define MT_CONTROL 14 /* extra-data protocol message */ #define MT_OOBDATA 15 /* expedited data */ #define MT_NTYPES 16 /* number of mbuf types for mbtypes[] */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:00:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6FFB3B64; Sat, 24 Aug 2013 21:00:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CD682322; Sat, 24 Aug 2013 21:00:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OL0eNf065721; Sat, 24 Aug 2013 21:00:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OL0eNG065720; Sat, 24 Aug 2013 21:00:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201308242100.r7OL0eNG065720@svn.freebsd.org> From: Mark Johnston Date: Sat, 24 Aug 2013 21:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254808 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:00:40 -0000 Author: markj Date: Sat Aug 24 21:00:39 2013 New Revision: 254808 URL: http://svnweb.freebsd.org/changeset/base/254808 Log: Remove some code that has been commented out since it was added in 2000. Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Sat Aug 24 20:26:41 2013 (r254807) +++ head/sys/kern/link_elf.c Sat Aug 24 21:00:39 2013 (r254808) @@ -702,16 +702,6 @@ link_elf_link_preload_finish(linker_file int error; ef = (elf_file_t) lf; -#if 0 /* this will be more trouble than it's worth for now */ - for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) { - if (dp->d_tag != DT_NEEDED) - continue; - modname = ef->strtab + dp->d_un.d_val; - error = linker_load_module(modname, lf); - if (error != 0) - goto out; - } -#endif error = relocate_file(ef); if (error != 0) return (error); @@ -973,16 +963,6 @@ link_elf_load_file(linker_class_t cls, c vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) goto out; -#if 0 /* this will be more trouble than it's worth for now */ - for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) { - if (dp->d_tag != DT_NEEDED) - continue; - modname = ef->strtab + dp->d_un.d_val; - error = linker_load_module(modname, lf); - if (error != 0) - goto out; - } -#endif error = relocate_file(ef); if (error != 0) goto out; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:04:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 612B8E0B; Sat, 24 Aug 2013 21:04:55 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DE362347; Sat, 24 Aug 2013 21:04:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OL4t1X068824; Sat, 24 Aug 2013 21:04:55 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OL4tUf068823; Sat, 24 Aug 2013 21:04:55 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201308242104.r7OL4tUf068823@svn.freebsd.org> From: Joerg Wunsch Date: Sat, 24 Aug 2013 21:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254809 - head/sys/dev/fdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:04:55 -0000 Author: joerg Date: Sat Aug 24 21:04:54 2013 New Revision: 254809 URL: http://svnweb.freebsd.org/changeset/base/254809 Log: Do not use "Enable Implied Seek" on enhanced floppy controllers. This breaks the "2step" feature of the driver, e.g. in order to read 360 KiB media on a 1200 KiB drive. As the only potential advantage of implied (vs. explicit) seeks is to minimize the software effort, yet our driver always contained the logic needed for explicit seeks, simply dropping implied seeks is the best solution without introducing risks for new bugs. There is no performance penalty, reading a 1440 KiB medium takes exactly the same time with both, implied or explicit seeks. MFC after: 1 week Modified: head/sys/dev/fdc/fdc.c Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Sat Aug 24 21:00:39 2013 (r254808) +++ head/sys/dev/fdc/fdc.c Sat Aug 24 21:04:54 2013 (r254809) @@ -528,7 +528,8 @@ fdc_reset(struct fdc_data *fdc) if (fdc_cmd(fdc, 4, I8207X_CONFIG, 0, - 0x40 | /* Enable Implied Seek */ + /* 0x40 | */ /* Enable Implied Seek - + * breaks 2step! */ 0x10 | /* Polling disabled */ (fifo_threshold - 1), /* Fifo threshold */ 0x00, /* Precomp track */ @@ -922,14 +923,8 @@ fdc_worker(struct fdc_data *fdc) /* * SEEK to where we want to be - * - * Enhanced controllers do implied seeks for read&write as long as - * we do not need multiple steps per track. */ - if (cylinder != fd->track && ( - fdc->fdct != FDC_ENHANCED || - descyl != cylinder || - (bp->bio_cmd & (BIO_RDID|BIO_FMT)))) { + if (cylinder != fd->track) { retry_line = __LINE__; if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, descyl, 0)) return (1); From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:07:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6C05F5; Sat, 24 Aug 2013 21:07:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B315A2364; Sat, 24 Aug 2013 21:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OL74vs069441; Sat, 24 Aug 2013 21:07:04 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OL74v2069440; Sat, 24 Aug 2013 21:07:04 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201308242107.r7OL74v2069440@svn.freebsd.org> From: Mark Johnston Date: Sat, 24 Aug 2013 21:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254810 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:07:04 -0000 Author: markj Date: Sat Aug 24 21:07:04 2013 New Revision: 254810 URL: http://svnweb.freebsd.org/changeset/base/254810 Log: Remove the kld lock macros and just use the sx(9) API. Add locking in linker_init_kernel_modules() and linker_preload() in order to remove most of the checks for !cold before asserting that the kld lock is held. These routines are invoked by SYSINIT(9), so there's no harm in them taking the kld lock. Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Aug 24 21:04:54 2013 (r254809) +++ head/sys/kern/kern_linker.c Sat Aug 24 21:07:04 2013 (r254810) @@ -71,17 +71,6 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, TUNABLE_INT("debug.kld_debug", &kld_debug); #endif -#define KLD_LOCK() sx_xlock(&kld_sx) -#define KLD_UNLOCK() sx_xunlock(&kld_sx) -#define KLD_DOWNGRADE() sx_downgrade(&kld_sx) -#define KLD_LOCK_READ() sx_slock(&kld_sx) -#define KLD_UNLOCK_READ() sx_sunlock(&kld_sx) -#define KLD_LOCKED() sx_xlocked(&kld_sx) -#define KLD_LOCK_ASSERT() do { \ - if (!cold) \ - sx_assert(&kld_sx, SX_XLOCKED); \ -} while (0) - /* * static char *linker_search_path(const char *name, struct mod_depend * *verinfo); @@ -121,7 +110,8 @@ static int linker_no_more_classes = 0; #define LINKER_GET_NEXT_FILE_ID(a) do { \ linker_file_t lftmp; \ \ - KLD_LOCK_ASSERT(); \ + if (!cold) \ + sx_assert(&kld_sx, SA_XLOCKED); \ retry: \ TAILQ_FOREACH(lftmp, &linker_files, link) { \ if (next_file_id == lftmp->id) { \ @@ -360,7 +350,9 @@ static void linker_init_kernel_modules(void) { + sx_xlock(&kld_sx); linker_file_register_modules(linker_kernel_file); + sx_xunlock(&kld_sx); } SYSINIT(linker_kernel, SI_SUB_KLD, SI_ORDER_ANY, linker_init_kernel_modules, @@ -377,7 +369,7 @@ linker_load_file(const char *filename, l if (prison0.pr_securelevel > 0) return (EPERM); - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); lf = linker_find_file_by_name(filename); if (lf) { KLD_DPF(FILE, ("linker_load_file: file %s is already loaded," @@ -411,10 +403,10 @@ linker_load_file(const char *filename, l return (error); } modules = !TAILQ_EMPTY(&lf->modules); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); linker_file_register_sysctls(lf); linker_file_sysinit(lf); - KLD_LOCK(); + sx_xlock(&kld_sx); lf->flags |= LINKER_FILE_LINKED; /* @@ -465,16 +457,16 @@ linker_reference_module(const char *modn modlist_t mod; int error; - KLD_LOCK(); + sx_xlock(&kld_sx); if ((mod = modlist_lookup2(modname, verinfo)) != NULL) { *result = mod->container; (*result)->refs++; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (0); } error = linker_load_module(NULL, modname, NULL, verinfo, result); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -485,13 +477,13 @@ linker_release_module(const char *modnam modlist_t mod; int error; - KLD_LOCK(); + sx_xlock(&kld_sx); if (lf == NULL) { KASSERT(modname != NULL, ("linker_release_module: no file or name")); mod = modlist_lookup2(modname, verinfo); if (mod == NULL) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (ESRCH); } lf = mod->container; @@ -499,7 +491,7 @@ linker_release_module(const char *modnam KASSERT(modname == NULL && verinfo == NULL, ("linker_release_module: both file and name")); error = linker_file_unload(lf, LINKER_UNLOAD_NORMAL); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -512,7 +504,7 @@ linker_find_file_by_name(const char *fil koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK); sprintf(koname, "%s.ko", filename); - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); TAILQ_FOREACH(lf, &linker_files, link) { if (strcmp(lf->filename, koname) == 0) break; @@ -528,7 +520,7 @@ linker_find_file_by_id(int fileid) { linker_file_t lf; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); TAILQ_FOREACH(lf, &linker_files, link) if (lf->id == fileid && lf->flags & LINKER_FILE_LINKED) break; @@ -541,13 +533,13 @@ linker_file_foreach(linker_predicate_t * linker_file_t lf; int retval = 0; - KLD_LOCK(); + sx_xlock(&kld_sx); TAILQ_FOREACH(lf, &linker_files, link) { retval = predicate(lf, context); if (retval != 0) break; } - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (retval); } @@ -557,7 +549,8 @@ linker_make_file(const char *pathname, l linker_file_t lf; const char *filename; - KLD_LOCK_ASSERT(); + if (!cold) + sx_assert(&kld_sx, SA_XLOCKED); filename = linker_basename(pathname); KLD_DPF(FILE, ("linker_make_file: new file, filename='%s' for pathname='%s'\n", filename, pathname)); @@ -591,7 +584,7 @@ linker_file_unload(linker_file_t file, i if (prison0.pr_securelevel > 0) return (EPERM); - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); KLD_DPF(FILE, ("linker_file_unload: lf->refs=%d\n", file->refs)); /* Easy case of just dropping a reference. */ @@ -664,10 +657,10 @@ linker_file_unload(linker_file_t file, i */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); linker_file_sysuninit(file); linker_file_unregister_sysctls(file); - KLD_LOCK(); + sx_xlock(&kld_sx); } TAILQ_REMOVE(&linker_files, file, link); @@ -706,7 +699,7 @@ linker_file_add_dependency(linker_file_t { linker_file_t *newdeps; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); newdeps = malloc((file->ndeps + 1) * sizeof(linker_file_t *), M_LINKER, M_WAITOK | M_ZERO); if (newdeps == NULL) @@ -738,12 +731,12 @@ linker_file_lookup_set(linker_file_t fil { int error, locked; - locked = KLD_LOCKED(); + locked = sx_xlocked(&kld_sx); if (!locked) - KLD_LOCK(); + sx_xlock(&kld_sx); error = LINKER_LOOKUP_SET(file, name, firstp, lastp, countp); if (!locked) - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -763,12 +756,12 @@ linker_file_lookup_symbol(linker_file_t caddr_t sym; int locked; - locked = KLD_LOCKED(); + locked = sx_xlocked(&kld_sx); if (!locked) - KLD_LOCK(); + sx_xlock(&kld_sx); sym = linker_file_lookup_symbol_internal(file, name, deps); if (!locked) - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (sym); } @@ -782,7 +775,7 @@ linker_file_lookup_symbol_internal(linke size_t common_size = 0; int i; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); KLD_DPF(SYM, ("linker_file_lookup_symbol: file=%p, name=%s, deps=%d\n", file, name, deps)); @@ -982,9 +975,9 @@ linker_search_symbol_name(caddr_t value, { int error; - KLD_LOCK(); + sx_xlock(&kld_sx); error = linker_debug_search_symbol_name(value, buf, buflen, offset); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1026,10 +1019,10 @@ kern_kldload(struct thread *td, const ch modname = file; } - KLD_LOCK(); + sx_xlock(&kld_sx); error = linker_load_module(kldname, modname, NULL, NULL, &lf); if (error) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); goto done; } lf->userrefs++; @@ -1039,13 +1032,13 @@ kern_kldload(struct thread *td, const ch EVENTHANDLER_INVOKE(kld_load, lf); #ifdef HWPMC_HOOKS - KLD_DOWNGRADE(); + sx_downgrade(&kld_sx); pkm.pm_file = lf->filename; pkm.pm_address = (uintptr_t) lf->address; PMC_CALL_HOOK(td, PMC_FN_KLD_LOAD, (void *) &pkm); - KLD_UNLOCK_READ(); + sx_sunlock(&kld_sx); #else - KLD_UNLOCK(); + sx_xunlock(&kld_sx); #endif done: @@ -1088,7 +1081,7 @@ kern_kldunload(struct thread *td, int fi return (error); CURVNET_SET(TD_TO_VNET(td)); - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_id(fileid); if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); @@ -1119,13 +1112,13 @@ kern_kldunload(struct thread *td, int fi #ifdef HWPMC_HOOKS if (error == 0) { - KLD_DOWNGRADE(); + sx_downgrade(&kld_sx); PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); - KLD_UNLOCK_READ(); + sx_sunlock(&kld_sx); } else - KLD_UNLOCK(); + sx_xunlock(&kld_sx); #else - KLD_UNLOCK(); + sx_xunlock(&kld_sx); #endif CURVNET_RESTORE(); return (error); @@ -1169,13 +1162,13 @@ sys_kldfind(struct thread *td, struct kl goto out; filename = linker_basename(pathname); - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_name(filename); if (lf) td->td_retval[0] = lf->id; else error = ENOENT; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); out: free(pathname, M_TEMP); return (error); @@ -1193,7 +1186,7 @@ sys_kldnext(struct thread *td, struct kl return (error); #endif - KLD_LOCK(); + sx_xlock(&kld_sx); if (uap->fileid == 0) lf = TAILQ_FIRST(&linker_files); else { @@ -1214,7 +1207,7 @@ sys_kldnext(struct thread *td, struct kl else td->td_retval[0] = 0; out: - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1253,10 +1246,10 @@ kern_kldstat(struct thread *td, int file return (error); #endif - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_id(fileid); if (lf == NULL) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (ENOENT); } @@ -1274,7 +1267,7 @@ kern_kldstat(struct thread *td, int file if (namelen > MAXPATHLEN) namelen = MAXPATHLEN; bcopy(lf->pathname, &stat->pathname[0], namelen); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); td->td_retval[0] = 0; return (0); @@ -1293,7 +1286,7 @@ sys_kldfirstmod(struct thread *td, struc return (error); #endif - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_id(uap->fileid); if (lf) { MOD_SLOCK; @@ -1305,7 +1298,7 @@ sys_kldfirstmod(struct thread *td, struc MOD_SUNLOCK; } else error = ENOENT; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1333,7 +1326,7 @@ sys_kldsym(struct thread *td, struct kld symstr = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); if ((error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL)) != 0) goto out; - KLD_LOCK(); + sx_xlock(&kld_sx); if (uap->fileid != 0) { lf = linker_find_file_by_id(uap->fileid); if (lf == NULL) @@ -1359,7 +1352,7 @@ sys_kldsym(struct thread *td, struct kld if (lf == NULL) error = ENOENT; } - KLD_UNLOCK(); + sx_xunlock(&kld_sx); out: free(symstr, M_TEMP); return (error); @@ -1468,6 +1461,7 @@ linker_preload(void *arg) error = 0; modptr = NULL; + sx_xlock(&kld_sx); while ((modptr = preload_search_next_name(modptr)) != NULL) { modname = (char *)preload_search_info(modptr, MODINFO_NAME); modtype = (char *)preload_search_info(modptr, MODINFO_TYPE); @@ -1649,6 +1643,7 @@ fail: TAILQ_REMOVE(&depended_files, lf, loaded); linker_file_unload(lf, LINKER_UNLOAD_FORCE); } + sx_xunlock(&kld_sx); /* woohoo! we made it! */ } @@ -1948,7 +1943,7 @@ linker_hwpmc_list_objects(void) int i, nmappings; nmappings = 0; - KLD_LOCK_READ(); + sx_slock(&kld_sx); TAILQ_FOREACH(lf, &linker_files, link) nmappings++; @@ -1963,7 +1958,7 @@ linker_hwpmc_list_objects(void) kobase[i].pm_address = (uintptr_t)lf->address; i++; } - KLD_UNLOCK_READ(); + sx_sunlock(&kld_sx); KASSERT(i > 0, ("linker_hpwmc_list_objects: no kernel objects?")); @@ -1989,7 +1984,7 @@ linker_load_module(const char *kldname, char *pathname; int error; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); if (modname == NULL) { /* * We have to load KLD @@ -2063,7 +2058,7 @@ linker_load_dependencies(linker_file_t l /* * All files are dependant on /kernel. */ - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); if (linker_kernel_file) { linker_kernel_file->refs++; error = linker_file_add_dependency(lf, linker_kernel_file); @@ -2155,16 +2150,16 @@ sysctl_kern_function_list(SYSCTL_HANDLER error = sysctl_wire_old_buffer(req, 0); if (error != 0) return (error); - KLD_LOCK(); + sx_xlock(&kld_sx); TAILQ_FOREACH(lf, &linker_files, link) { error = LINKER_EACH_FUNCTION_NAME(lf, sysctl_kern_function_list_iterate, req); if (error) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } } - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (SYSCTL_OUT(req, "", 1)); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:08:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2CBC24B; Sat, 24 Aug 2013 21:08:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F19B2375; Sat, 24 Aug 2013 21:08:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OL8tfR070092; Sat, 24 Aug 2013 21:08:55 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OL8tcG070091; Sat, 24 Aug 2013 21:08:55 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201308242108.r7OL8tcG070091@svn.freebsd.org> From: Mark Johnston Date: Sat, 24 Aug 2013 21:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254811 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:08:55 -0000 Author: markj Date: Sat Aug 24 21:08:55 2013 New Revision: 254811 URL: http://svnweb.freebsd.org/changeset/base/254811 Log: Set things up so that linker_file_lookup_set() is always called with the linker lock held. This makes it possible to call it from a kld event handler with the shared lock held. Reviewed by: jhb Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Aug 24 21:07:04 2013 (r254810) +++ head/sys/kern/kern_linker.c Sat Aug 24 21:08:55 2013 (r254811) @@ -188,6 +188,8 @@ linker_file_sysinit(linker_file_t lf) KLD_DPF(FILE, ("linker_file_sysinit: calling SYSINITs for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysinit_set", &start, &stop, NULL) != 0) return; /* @@ -213,6 +215,7 @@ linker_file_sysinit(linker_file_t lf) * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. */ + sx_xunlock(&kld_sx); mtx_lock(&Giant); for (sipp = start; sipp < stop; sipp++) { if ((*sipp)->subsystem == SI_SUB_DUMMY) @@ -222,6 +225,7 @@ linker_file_sysinit(linker_file_t lf) (*((*sipp)->func)) ((*sipp)->udata); } mtx_unlock(&Giant); + sx_xlock(&kld_sx); } static void @@ -232,6 +236,8 @@ linker_file_sysuninit(linker_file_t lf) KLD_DPF(FILE, ("linker_file_sysuninit: calling SYSUNINITs for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysuninit_set", &start, &stop, NULL) != 0) return; @@ -259,6 +265,7 @@ linker_file_sysuninit(linker_file_t lf) * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. */ + sx_xunlock(&kld_sx); mtx_lock(&Giant); for (sipp = start; sipp < stop; sipp++) { if ((*sipp)->subsystem == SI_SUB_DUMMY) @@ -268,6 +275,7 @@ linker_file_sysuninit(linker_file_t lf) (*((*sipp)->func)) ((*sipp)->udata); } mtx_unlock(&Giant); + sx_xlock(&kld_sx); } static void @@ -279,13 +287,17 @@ linker_file_register_sysctls(linker_file ("linker_file_register_sysctls: registering SYSCTLs for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) return; + sx_xunlock(&kld_sx); sysctl_lock(); for (oidp = start; oidp < stop; oidp++) sysctl_register_oid(*oidp); sysctl_unlock(); + sx_xlock(&kld_sx); } static void @@ -296,13 +308,17 @@ linker_file_unregister_sysctls(linker_fi KLD_DPF(FILE, ("linker_file_unregister_sysctls: unregistering SYSCTLs" " for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) return; + sx_xunlock(&kld_sx); sysctl_lock(); for (oidp = start; oidp < stop; oidp++) sysctl_unregister_oid(*oidp); sysctl_unlock(); + sx_xlock(&kld_sx); } static int @@ -315,6 +331,8 @@ linker_file_register_modules(linker_file KLD_DPF(FILE, ("linker_file_register_modules: registering modules" " in %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "modmetadata_set", &start, &stop, NULL) != 0) { /* @@ -403,10 +421,8 @@ linker_load_file(const char *filename, l return (error); } modules = !TAILQ_EMPTY(&lf->modules); - sx_xunlock(&kld_sx); linker_file_register_sysctls(lf); linker_file_sysinit(lf); - sx_xlock(&kld_sx); lf->flags |= LINKER_FILE_LINKED; /* @@ -657,10 +673,8 @@ linker_file_unload(linker_file_t file, i */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - sx_xunlock(&kld_sx); linker_file_sysuninit(file); linker_file_unregister_sysctls(file); - sx_xlock(&kld_sx); } TAILQ_REMOVE(&linker_files, file, link); @@ -729,15 +743,9 @@ int linker_file_lookup_set(linker_file_t file, const char *name, void *firstp, void *lastp, int *countp) { - int error, locked; - locked = sx_xlocked(&kld_sx); - if (!locked) - sx_xlock(&kld_sx); - error = LINKER_LOOKUP_SET(file, name, firstp, lastp, countp); - if (!locked) - sx_xunlock(&kld_sx); - return (error); + sx_assert(&kld_sx, SA_LOCKED); + return (LINKER_LOOKUP_SET(file, name, firstp, lastp, countp)); } /* From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:09:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B7366390; Sat, 24 Aug 2013 21:09:58 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 890F82383; Sat, 24 Aug 2013 21:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OL9wR3070548; Sat, 24 Aug 2013 21:09:58 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OL9wu0070546; Sat, 24 Aug 2013 21:09:58 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308242109.r7OL9wu0070546@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 21:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254812 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:09:58 -0000 Author: andre Date: Sat Aug 24 21:09:57 2013 New Revision: 254812 URL: http://svnweb.freebsd.org/changeset/base/254812 Log: Remove unused m_free_fast(). The difference to m_free() is only 2 predictable branches nowadays. However as a pre-condition the caller had to ensure that the mbuf pkthdr did not have any mtags attached to it, costing some potential branches again. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Aug 24 21:08:55 2013 (r254811) +++ head/sys/kern/kern_mbuf.c Sat Aug 24 21:09:57 2013 (r254812) @@ -447,7 +447,7 @@ mb_dtor_mbuf(void *mem, int size, void * m = (struct mbuf *)mem; flags = (unsigned long)arg; - if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0) + if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags)) m_tag_delete_chain(m, NULL); KASSERT((m->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__)); KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__)); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sat Aug 24 21:08:55 2013 (r254811) +++ head/sys/sys/mbuf.h Sat Aug 24 21:09:57 2013 (r254812) @@ -453,8 +453,6 @@ struct mbuf { #define MT_NOINIT 255 /* Not a type but a flag to allocate a non-initialized mbuf */ -#define MB_NOTAGS 0x1UL /* no tags attached to mbuf */ - /* * Compatibility with historic mbuf allocator. */ @@ -636,17 +634,6 @@ m_getcl(int how, short type, int flags) return (uma_zalloc_arg(zone_pack, &args, how)); } -static __inline void -m_free_fast(struct mbuf *m) -{ -#ifdef INVARIANTS - if (m->m_flags & M_PKTHDR) - KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags")); -#endif - - uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS); -} - static __inline struct mbuf * m_free(struct mbuf *m) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:13:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 898014F8; Sat, 24 Aug 2013 21:13:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C08D23C2; Sat, 24 Aug 2013 21:13:29 +0000 (UTC) Received: from glenbarber.us (unknown [IPv6:2001:470:8:1205:99cd:72d:5e87:427e]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id A09B526AD; Sat, 24 Aug 2013 21:13:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us A09B526AD Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 24 Aug 2013 17:13:25 -0400 From: Glen Barber To: Andre Oppermann Subject: Re: svn commit: r254779 - head/sys/kern Message-ID: <20130824211325.GA33782@glenbarber.us> References: <201308241224.r7OCOx9l069850@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: <201308241224.r7OCOx9l069850@svn.freebsd.org> X-Operating-System: 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:13:29 -0000 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 24, 2013 at 12:24:59PM +0000, Andre Oppermann wrote: > Author: andre > Date: Sat Aug 24 12:24:58 2013 > New Revision: 254779 > URL: http://svnweb.freebsd.org/changeset/base/254779 >=20 > Log: > Avoid code duplication for mbuf initialization and use m_init() instead > in mb_ctor_mbuf() and mb_ctor_pack(). >=20 > Modified: > head/sys/kern/kern_mbuf.c >=20 > [...] > -#ifdef MAC > - /* If the label init fails, fail the alloc */ > - error =3D mac_mbuf_init(m, how); > - if (error) > - return (error); > -#endif > - } else > - m->m_data =3D m->m_dat; > - return (0); > + m =3D (struct mbuf *)mem; > + flags =3D args->flags; > + > + error =3D m_init(m, NULL, size, how, type, flags); > + > + return (error); > } > =20 This breaks head/. cc -c -O -pipe -std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -funwind-tables -mllvm -arm-enable-ehabi -ffreestanding -Werror /src/sys/kern/kern_mbuf.c /src/sys/kern/kern_mbuf.c:637:2: error: use of undeclared identifier 'error' error =3D m_init(m, NULL, size, how, type, flags); ^ /src/sys/kern/kern_mbuf.c:643:10: error: use of undeclared identifier 'erro= r' return (error); ^=20 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-armv6-arm.full Glen --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJSGSH1AAoJEFJPDDeguUaj1dwH/25PG6K7KQ1aIyEpYDbjKt+W 1z8fHkawnLFoOYhRe5Zs1ffmA/+HS6XfqWkS+cOrWfdKeMBunxgc973tx+jkMmWO slKMYqMPLQHcN4TeTSbMsYQ1fofCcweL5ZTB4O0GS4G6F18KQzCtopBn/XCLfxs0 AgnWvdg7ipD/r3aeTGoeGKOzPRv7E+WDsDfMIWAmzqLFi4Ci23IE4bqDR3OnFP86 2eOcOjd1gj1oe58BIUmeDsLW0zL2bFgCfcHa7rzMn5Y1kDk/KioUgQHTTAuxhhI+ FZBLJayMy8gxy1YI+T/WqRenVmNb1P6Skh20Ni+TOF2qrcxsV9sbxZ8lbNjgWbQ= =z9RW -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi-- From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:13:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6559F70C; Sat, 24 Aug 2013 21:13:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 509E023CE; Sat, 24 Aug 2013 21:13:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OLDf9k073791; Sat, 24 Aug 2013 21:13:41 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OLDdTw073778; Sat, 24 Aug 2013 21:13:39 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201308242113.r7OLDdTw073778@svn.freebsd.org> From: Mark Johnston Date: Sat, 24 Aug 2013 21:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254813 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/dev/hwpmc sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:13:41 -0000 Author: markj Date: Sat Aug 24 21:13:38 2013 New Revision: 254813 URL: http://svnweb.freebsd.org/changeset/base/254813 Log: Rename the kld_unload event handler to kld_unload_try, and add a new kld_unload event handler which gets invoked after a linker file has been successfully unloaded. The kld_unload and kld_load event handlers are now invoked with the shared linker lock held, while kld_unload_try is invoked with the lock exclusively held. Convert hwpmc(4) to use these event handlers instead of having kern_kldload() and kern_kldunload() invoke hwpmc(4) hooks whenever files are loaded or unloaded. This has no functional effect, but simplifes the linker code somewhat. Reviewed by: jhb Modified: head/share/man/man9/EVENTHANDLER.9 head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/dtrace_unload.c head/sys/cddl/dev/sdt/sdt.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/kern_linker.c head/sys/sys/eventhandler.h head/sys/sys/pmckern.h Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Sat Aug 24 21:09:57 2013 (r254812) +++ head/share/man/man9/EVENTHANDLER.9 Sat Aug 24 21:13:38 2013 (r254813) @@ -202,6 +202,8 @@ Callbacks invoked when a BPF listener at .It Vt kld_load Callbacks invoked after a linker file has been loaded. .It Vt kld_unload +Callbacks invoked after a linker file has been successfully unloaded. +.It Vt kld_unload_try Callbacks invoked before a linker file is about to be unloaded. These callbacks may be used to return an error and prevent the unload from proceeding. Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Aug 24 21:13:38 2013 (r254813) @@ -242,7 +242,7 @@ int dtrace_in_probe; /* non-zero if exe uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif static eventhandler_tag dtrace_kld_load_tag; -static eventhandler_tag dtrace_kld_unload_tag; +static eventhandler_tag dtrace_kld_unload_try_tag; #endif /* @@ -15351,7 +15351,7 @@ dtrace_kld_load(void *arg __unused, link } static void -dtrace_kld_unload(void *arg __unused, linker_file_t lf, int *error) +dtrace_kld_unload_try(void *arg __unused, linker_file_t lf, int *error) { if (*error != 0) Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Sat Aug 24 21:13:38 2013 (r254813) @@ -59,8 +59,8 @@ dtrace_load(void *dummy) /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); - dtrace_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, - dtrace_kld_unload, NULL, EVENTHANDLER_PRI_ANY); + dtrace_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try, + dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* * Initialise the mutexes without 'witness' because the dtrace Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_unload.c Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/cddl/dev/dtrace/dtrace_unload.c Sat Aug 24 21:13:38 2013 (r254813) @@ -68,7 +68,7 @@ dtrace_unload() dtrace_provider = NULL; EVENTHANDLER_DEREGISTER(kld_load, dtrace_kld_load_tag); - EVENTHANDLER_DEREGISTER(kld_unload, dtrace_kld_unload_tag); + EVENTHANDLER_DEREGISTER(kld_unload_try, dtrace_kld_unload_try_tag); if ((state = dtrace_anon_grab()) != NULL) { /* Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/cddl/dev/sdt/sdt.c Sat Aug 24 21:13:38 2013 (r254813) @@ -59,7 +59,7 @@ static int sdt_unload(void *); static void sdt_create_provider(struct sdt_provider *); static void sdt_create_probe(struct sdt_probe *); static void sdt_kld_load(void *, struct linker_file *); -static void sdt_kld_unload(void *, struct linker_file *, int *); +static void sdt_kld_unload_try(void *, struct linker_file *, int *); static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); @@ -95,7 +95,7 @@ static struct cdev *sdt_cdev; static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; -eventhandler_tag sdt_kld_unload_tag; +eventhandler_tag sdt_kld_unload_try_tag; static void sdt_create_provider(struct sdt_provider *prov) @@ -264,7 +264,7 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; @@ -319,8 +319,8 @@ sdt_load(void *arg __unused) sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, EVENTHANDLER_PRI_ANY); - sdt_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, sdt_kld_unload, - NULL, EVENTHANDLER_PRI_ANY); + sdt_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try, + sdt_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* Pick up probes from the kernel and already-loaded linker files. */ linker_file_foreach(sdt_linker_file_cb, NULL); @@ -332,7 +332,7 @@ sdt_unload(void *arg __unused) struct sdt_provider *prov, *tmp; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); - EVENTHANDLER_DEREGISTER(kld_unload, sdt_kld_unload_tag); + EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); sdt_probe_func = sdt_probe_stub; Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Aug 24 21:13:38 2013 (r254813) @@ -132,7 +132,8 @@ static int *pmc_pmcdisp; /* PMC row di /* various event handlers */ -static eventhandler_tag pmc_exit_tag, pmc_fork_tag; +static eventhandler_tag pmc_exit_tag, pmc_fork_tag, pmc_kld_load_tag, + pmc_kld_unload_tag; /* Module statistics */ struct pmc_op_getdriverstats pmc_stats; @@ -1476,50 +1477,6 @@ pmc_process_csw_out(struct thread *td) } /* - * Log a KLD operation. - */ - -static void -pmc_process_kld_load(struct pmckern_map_in *pkm) -{ - struct pmc_owner *po; - - sx_assert(&pmc_sx, SX_LOCKED); - - /* - * Notify owners of system sampling PMCs about KLD operations. - */ - - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) - if (po->po_flags & PMC_PO_OWNS_LOGFILE) - pmclog_process_map_in(po, (pid_t) -1, pkm->pm_address, - (char *) pkm->pm_file); - - /* - * TODO: Notify owners of (all) process-sampling PMCs too. - */ - - return; -} - -static void -pmc_process_kld_unload(struct pmckern_map_out *pkm) -{ - struct pmc_owner *po; - - sx_assert(&pmc_sx, SX_LOCKED); - - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) - if (po->po_flags & PMC_PO_OWNS_LOGFILE) - pmclog_process_map_out(po, (pid_t) -1, - pkm->pm_address, pkm->pm_address + pkm->pm_size); - - /* - * TODO: Notify owners of process-sampling PMCs. - */ -} - -/* * A mapping change for a process. */ @@ -1833,8 +1790,8 @@ const char *pmc_hooknames[] = { "CSW-IN", "CSW-OUT", "SAMPLE", - "KLDLOAD", - "KLDUNLOAD", + "UNUSED1", + "UNUSED2", "MMAP", "MUNMAP", "CALLCHAIN-NMI", @@ -2002,17 +1959,6 @@ pmc_hook_handler(struct thread *td, int pmc_process_samples(PCPU_GET(cpuid), PMC_SR); break; - - case PMC_FN_KLD_LOAD: - sx_assert(&pmc_sx, SX_LOCKED); - pmc_process_kld_load((struct pmckern_map_in *) arg); - break; - - case PMC_FN_KLD_UNLOAD: - sx_assert(&pmc_sx, SX_LOCKED); - pmc_process_kld_unload((struct pmckern_map_out *) arg); - break; - case PMC_FN_MMAP: sx_assert(&pmc_sx, SX_LOCKED); pmc_process_mmap(td, (struct pmckern_map_in *) arg); @@ -4644,6 +4590,47 @@ pmc_process_fork(void *arg __unused, str sx_xunlock(&pmc_sx); } +static void +pmc_kld_load(void *arg __unused, linker_file_t lf) +{ + struct pmc_owner *po; + + sx_slock(&pmc_sx); + + /* + * Notify owners of system sampling PMCs about KLD operations. + */ + LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_map_in(po, (pid_t) -1, + (uintfptr_t) lf->address, lf->filename); + + /* + * TODO: Notify owners of (all) process-sampling PMCs too. + */ + + sx_sunlock(&pmc_sx); +} + +static void +pmc_kld_unload(void *arg __unused, const char *filename __unused, + caddr_t address, size_t size) +{ + struct pmc_owner *po; + + sx_slock(&pmc_sx); + + LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_map_out(po, (pid_t) -1, + (uintfptr_t) address, (uintfptr_t) address + size); + + /* + * TODO: Notify owners of process-sampling PMCs. + */ + + sx_sunlock(&pmc_sx); +} /* * initialization @@ -4913,6 +4900,12 @@ pmc_initialize(void) pmc_fork_tag = EVENTHANDLER_REGISTER(process_fork, pmc_process_fork, NULL, EVENTHANDLER_PRI_ANY); + /* register kld event handlers */ + pmc_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, pmc_kld_load, + NULL, EVENTHANDLER_PRI_ANY); + pmc_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, pmc_kld_unload, + NULL, EVENTHANDLER_PRI_ANY); + /* initialize logging */ pmclog_initialize(); @@ -4970,6 +4963,8 @@ pmc_cleanup(void) /* deregister event handlers */ EVENTHANDLER_DEREGISTER(process_fork, pmc_fork_tag); EVENTHANDLER_DEREGISTER(process_exit, pmc_exit_tag); + EVENTHANDLER_DEREGISTER(kld_load, pmc_kld_load_tag); + EVENTHANDLER_DEREGISTER(kld_unload, pmc_kld_unload_tag); /* send SIGBUS to all owner threads, free up allocations */ if (pmc_ownerhash) Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/kern/kern_linker.c Sat Aug 24 21:13:38 2013 (r254813) @@ -995,9 +995,6 @@ linker_search_symbol_name(caddr_t value, int kern_kldload(struct thread *td, const char *file, int *fileid) { -#ifdef HWPMC_HOOKS - struct pmckern_map_in pkm; -#endif const char *kldname, *modname; linker_file_t lf; int error; @@ -1037,17 +1034,9 @@ kern_kldload(struct thread *td, const ch if (fileid != NULL) *fileid = lf->id; - EVENTHANDLER_INVOKE(kld_load, lf); - -#ifdef HWPMC_HOOKS sx_downgrade(&kld_sx); - pkm.pm_file = lf->filename; - pkm.pm_address = (uintptr_t) lf->address; - PMC_CALL_HOOK(td, PMC_FN_KLD_LOAD, (void *) &pkm); + EVENTHANDLER_INVOKE(kld_load, lf); sx_sunlock(&kld_sx); -#else - sx_xunlock(&kld_sx); -#endif done: CURVNET_RESTORE(); @@ -1076,10 +1065,10 @@ sys_kldload(struct thread *td, struct kl int kern_kldunload(struct thread *td, int fileid, int flags) { -#ifdef HWPMC_HOOKS - struct pmckern_map_out pkm; -#endif linker_file_t lf; + char *filename = NULL; + caddr_t address; + size_t size; int error = 0; if ((error = securelevel_gt(td->td_ucred, 0)) != 0) @@ -1094,7 +1083,7 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - EVENTHANDLER_INVOKE(kld_unload, lf, &error); + EVENTHANDLER_INVOKE(kld_unload_try, lf, &error); if (error != 0) error = EBUSY; else if (lf->userrefs == 0) { @@ -1105,11 +1094,11 @@ kern_kldunload(struct thread *td, int fi " loaded by the kernel\n"); error = EBUSY; } else { -#ifdef HWPMC_HOOKS - /* Save data needed by hwpmc(4) before unloading. */ - pkm.pm_address = (uintptr_t) lf->address; - pkm.pm_size = lf->size; -#endif + /* Save data needed for the kld_unload callbacks. */ + filename = strdup(lf->filename, M_TEMP); + address = lf->address; + size = lf->size; + lf->userrefs--; error = linker_file_unload(lf, flags); if (error) @@ -1118,16 +1107,14 @@ kern_kldunload(struct thread *td, int fi } else error = ENOENT; -#ifdef HWPMC_HOOKS if (error == 0) { sx_downgrade(&kld_sx); - PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); + EVENTHANDLER_INVOKE(kld_unload, filename, address, size); sx_sunlock(&kld_sx); } else sx_xunlock(&kld_sx); -#else - sx_xunlock(&kld_sx); -#endif + free(filename, M_TEMP); + CURVNET_RESTORE(); return (error); } Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/sys/eventhandler.h Sat Aug 24 21:13:38 2013 (r254813) @@ -269,8 +269,10 @@ EVENTHANDLER_DECLARE(maxsockets_change, /* Kernel linker file load and unload events */ struct linker_file; typedef void (*kld_load_fn)(void *, struct linker_file *); -typedef void (*kld_unload_fn)(void *, struct linker_file *, int *); +typedef void (*kld_unload_fn)(void *, const char *, caddr_t, size_t); +typedef void (*kld_unload_try_fn)(void *, struct linker_file *, int *); EVENTHANDLER_DECLARE(kld_load, kld_load_fn); EVENTHANDLER_DECLARE(kld_unload, kld_unload_fn); +EVENTHANDLER_DECLARE(kld_unload_try, kld_unload_try_fn); #endif /* SYS_EVENTHANDLER_H */ Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Sat Aug 24 21:09:57 2013 (r254812) +++ head/sys/sys/pmckern.h Sat Aug 24 21:13:38 2013 (r254813) @@ -51,8 +51,8 @@ #define PMC_FN_CSW_IN 2 #define PMC_FN_CSW_OUT 3 #define PMC_FN_DO_SAMPLES 4 -#define PMC_FN_KLD_LOAD 5 -#define PMC_FN_KLD_UNLOAD 6 +#define PMC_FN_UNUSED1 5 +#define PMC_FN_UNUSED2 6 #define PMC_FN_MMAP 7 #define PMC_FN_MUNMAP 8 #define PMC_FN_USER_CALLCHAIN 9 From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:25:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 70CD4B46; Sat, 24 Aug 2013 21:25:05 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1557247D; Sat, 24 Aug 2013 21:25:04 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id z10so1032295qcx.4 for ; Sat, 24 Aug 2013 14:25:03 -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=uYl3s5NNMgZOW0JKaEvaa8J/jpSoyRh2yN5KLrOSZeE=; b=YKfPCakvHgocfhneyXbgaJpKmAvRpUcdKD4RcJW7njKwSVr4ABtOws5FY+3GHtd4ix tT3V6dGSxNSGzqhSSOLuBq6GrZiUSbTyvY5Pnv5sfv69zUYuTMgA1tOw17oCeOcVTCWH 5f2oSGO06WKM11IB0MoZv5plYqqqfnv8QVlZXGv+7fOLn5yO61BmYINZVMohzhpvQ2dj sCTWIaFmAyhFEOVtszoJ5IYqYeKnd8NmzptgLrNJ4D4Zlogwm1/O2FqN7zbI1t1360c6 sxg2FGhNJcNGvzCtPYZk7HD29qG+aSmdwRoUt8GN5g/ywA3a5WAVMNc0a7LVB9Qu8OjL FMeQ== MIME-Version: 1.0 X-Received: by 10.224.7.67 with SMTP id c3mr6914935qac.6.1377379502964; Sat, 24 Aug 2013 14:25:02 -0700 (PDT) Received: by 10.49.30.233 with HTTP; Sat, 24 Aug 2013 14:25:02 -0700 (PDT) In-Reply-To: <201308241038.r7OAc2hY011437@svn.freebsd.org> References: <201308241038.r7OAc2hY011437@svn.freebsd.org> Date: Sat, 24 Aug 2013 17:25:02 -0400 Message-ID: Subject: Re: svn commit: r254772 - head/share/man/man9 From: Benjamin Kaduk To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:25:05 -0000 On Sat, Aug 24, 2013 at 6:38 AM, Andre Oppermann wrote: > Author: andre > Date: Sat Aug 24 10:38:02 2013 > New Revision: 254772 > URL: http://svnweb.freebsd.org/changeset/base/254772 > > Log: > pfil_hook_get() has been internalized in r254771 and is no longer > part of the API. It wasn't safe for external use in any case. > > Modified: head/share/man/man9/pfil.9 > > ============================================================================== > --- head/share/man/man9/pfil.9 Sat Aug 24 10:36:33 2013 (r254771) > +++ head/share/man/man9/pfil.9 Sat Aug 24 10:38:02 2013 (r254772) > @@ -245,11 +242,7 @@ lock export was added in > .Fx 10.0 . > .Sh BUGS > The > -.Fn pfil_hook_get > -function > -is only safe for internal use. > -.Pp > -When a > +.Fn When a > This hunk looks pretty bogus. -Ben > .Vt pfil_head > is being modified, no traffic is diverted > (to avoid deadlock). > From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:25:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 05EC2C8E; Sat, 24 Aug 2013 21:25:54 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E767A248A; Sat, 24 Aug 2013 21:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OLPrPK079512; Sat, 24 Aug 2013 21:25:53 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OLPrfC079511; Sat, 24 Aug 2013 21:25:53 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308242125.r7OLPrfC079511@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 21:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254814 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:25:54 -0000 Author: andre Date: Sat Aug 24 21:25:53 2013 New Revision: 254814 URL: http://svnweb.freebsd.org/changeset/base/254814 Log: After r254779 "error" must always be present in mb_ctor_pack(), not only when MAC is defined. Reported by: gjb / tinderbox Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sat Aug 24 21:13:38 2013 (r254813) +++ head/sys/kern/kern_mbuf.c Sat Aug 24 21:25:53 2013 (r254814) @@ -619,10 +619,7 @@ mb_ctor_pack(void *mem, int size, void * { struct mbuf *m; struct mb_args *args; -#ifdef MAC - int error; -#endif - int flags; + int error, flags; short type; m = (struct mbuf *)mem; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:26:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7D61EE69 for ; Sat, 24 Aug 2013 21:26:54 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3B1A249C for ; Sat, 24 Aug 2013 21:26:53 +0000 (UTC) Received: (qmail 97161 invoked from network); 24 Aug 2013 22:09:22 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 24 Aug 2013 22:09:22 -0000 Message-ID: <52192512.50206@freebsd.org> Date: Sat, 24 Aug 2013 23:26:42 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r254779 - head/sys/kern References: <201308241224.r7OCOx9l069850@svn.freebsd.org> <20130824211325.GA33782@glenbarber.us> In-Reply-To: <20130824211325.GA33782@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:26:54 -0000 On 24.08.2013 23:13, Glen Barber wrote: > On Sat, Aug 24, 2013 at 12:24:59PM +0000, Andre Oppermann wrote: >> Author: andre >> Date: Sat Aug 24 12:24:58 2013 >> New Revision: 254779 >> URL: http://svnweb.freebsd.org/changeset/base/254779 >> >> Log: >> Avoid code duplication for mbuf initialization and use m_init() instead >> in mb_ctor_mbuf() and mb_ctor_pack(). >> >> Modified: >> head/sys/kern/kern_mbuf.c >> > >> [...] > >> -#ifdef MAC >> - /* If the label init fails, fail the alloc */ >> - error = mac_mbuf_init(m, how); >> - if (error) >> - return (error); >> -#endif >> - } else >> - m->m_data = m->m_dat; >> - return (0); >> + m = (struct mbuf *)mem; >> + flags = args->flags; >> + >> + error = m_init(m, NULL, size, how, type, flags); >> + >> + return (error); >> } >> > > > This breaks head/. > > cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith > -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions > -Wmissing-include-dirs -fdiagnostics-show-option > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -nostdinc -I. -I/src/sys > -I/src/sys/contrib/altq -I/src/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -funwind-tables -mllvm > -arm-enable-ehabi -ffreestanding -Werror /src/sys/kern/kern_mbuf.c > /src/sys/kern/kern_mbuf.c:637:2: error: use of undeclared identifier 'error' > error = m_init(m, NULL, size, how, type, flags); > ^ > /src/sys/kern/kern_mbuf.c:643:10: error: use of undeclared identifier 'error' > return (error); > ^ > > http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-armv6-arm.full Sorry, and thanks for the report. Fixed in r254814. -- Andre From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:30:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9C0C7E7; Sat, 24 Aug 2013 21:30:35 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88F1924E0; Sat, 24 Aug 2013 21:30:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7OLUZXG081149; Sat, 24 Aug 2013 21:30:35 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7OLUZfG081148; Sat, 24 Aug 2013 21:30:35 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201308242130.r7OLUZfG081148@svn.freebsd.org> From: Andre Oppermann Date: Sat, 24 Aug 2013 21:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254815 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:30:35 -0000 Author: andre Date: Sat Aug 24 21:30:35 2013 New Revision: 254815 URL: http://svnweb.freebsd.org/changeset/base/254815 Log: Fix BUGS section after botched modify in r254772. Reported by: bjk Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sat Aug 24 21:25:53 2013 (r254814) +++ head/share/man/man9/pfil.9 Sat Aug 24 21:30:35 2013 (r254815) @@ -241,8 +241,7 @@ Fine-grained locking was added in lock export was added in .Fx 10.0 . .Sh BUGS -The -.Fn When a +.Pp When a .Vt pfil_head is being modified, no traffic is diverted (to avoid deadlock). From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 21:31:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB7BE34C for ; Sat, 24 Aug 2013 21:31:37 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28D4924F5 for ; Sat, 24 Aug 2013 21:31:36 +0000 (UTC) Received: (qmail 97195 invoked from network); 24 Aug 2013 22:14:06 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 24 Aug 2013 22:14:06 -0000 Message-ID: <5219262D.2040804@freebsd.org> Date: Sat, 24 Aug 2013 23:31:25 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Benjamin Kaduk Subject: Re: svn commit: r254772 - head/share/man/man9 References: <201308241038.r7OAc2hY011437@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 21:31:37 -0000 On 24.08.2013 23:25, Benjamin Kaduk wrote: > On Sat, Aug 24, 2013 at 6:38 AM, Andre Oppermann > wrote: > > Author: andre > Date: Sat Aug 24 10:38:02 2013 > New Revision: 254772 > URL: http://svnweb.freebsd.org/changeset/base/254772 > > Log: > pfil_hook_get() has been internalized in r254771 and is no longer > part of the API. It wasn't safe for external use in any case. > > Modified: head/share/man/man9/pfil.9 > ============================================================================== > --- head/share/man/man9/pfil.9 Sat Aug 24 10:36:33 2013 (r254771) > +++ head/share/man/man9/pfil.9 Sat Aug 24 10:38:02 2013 (r254772) > @@ -245,11 +242,7 @@ lock export was added in > .Fx 10.0 . > .Sh BUGS > The > -.Fn pfil_hook_get > -function > -is only safe for internal use. > -.Pp > -When a > +.Fn When a > > > This hunk looks pretty bogus. Thanks for the report. I'm a total mdoc noob. (Hopefully) fixed in r254815. -- Andre > -Ben > > .Vt pfil_head > is being modified, no traffic is diverted > (to avoid deadlock). > From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 23:38:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D650DE; Sat, 24 Aug 2013 23:38:58 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 594622AE1; Sat, 24 Aug 2013 23:38:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ONcwhC051131; Sat, 24 Aug 2013 23:38:58 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ONcvCZ051127; Sat, 24 Aug 2013 23:38:57 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308242338.r7ONcvCZ051127@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 23:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254817 - in head/sys: dev/drm2 modules/drm2/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 23:38:58 -0000 Author: dumbbell Date: Sat Aug 24 23:38:57 2013 New Revision: 254817 URL: http://svnweb.freebsd.org/changeset/base/254817 Log: drm: Import drm_dp_helper.c from Linux 3.8-rc3 While here, update drm_dp_helper.h to better match Linux one. Added: head/sys/dev/drm2/drm_dp_helper.c (contents, props changed) Modified: head/sys/dev/drm2/drmP.h head/sys/dev/drm2/drm_dp_helper.h head/sys/modules/drm2/drm2/Makefile Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Sat Aug 24 22:42:19 2013 (r254816) +++ head/sys/dev/drm2/drmP.h Sat Aug 24 23:38:57 2013 (r254817) @@ -317,6 +317,9 @@ typedef int8_t s8; #define DRM_HZ hz #define DRM_UDELAY(udelay) DELAY(udelay) +#define DRM_MDELAY(msecs) do { int loops = (msecs); \ + while (loops--) DELAY(1000); \ + } while (0) #define DRM_TIME_SLICE (hz/20) /* Time slice for GLXContexts */ #define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \ Added: head/sys/dev/drm2/drm_dp_helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm_dp_helper.c Sat Aug 24 23:38:57 2013 (r254817) @@ -0,0 +1,147 @@ +/* + * Copyright © 2009 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +/** + * DOC: dp helpers + * + * These functions contain some common logic and helpers at various abstraction + * levels to deal with Display Port sink devices and related things like DP aux + * channel transfers, EDID reading over DP aux channels, decoding certain DPCD + * blocks, ... + */ + +static u8 dp_link_status(u8 link_status[DP_LINK_STATUS_SIZE], int r) +{ + return link_status[r - DP_LANE0_1_STATUS]; +} + +static u8 dp_get_lane_status(u8 link_status[DP_LINK_STATUS_SIZE], + int lane) +{ + int i = DP_LANE0_1_STATUS + (lane >> 1); + int s = (lane & 1) * 4; + u8 l = dp_link_status(link_status, i); + return (l >> s) & 0xf; +} + +bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE], + int lane_count) +{ + u8 lane_align; + u8 lane_status; + int lane; + + lane_align = dp_link_status(link_status, + DP_LANE_ALIGN_STATUS_UPDATED); + if ((lane_align & DP_INTERLANE_ALIGN_DONE) == 0) + return false; + for (lane = 0; lane < lane_count; lane++) { + lane_status = dp_get_lane_status(link_status, lane); + if ((lane_status & DP_CHANNEL_EQ_BITS) != DP_CHANNEL_EQ_BITS) + return false; + } + return true; +} + +bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE], + int lane_count) +{ + int lane; + u8 lane_status; + + for (lane = 0; lane < lane_count; lane++) { + lane_status = dp_get_lane_status(link_status, lane); + if ((lane_status & DP_LANE_CR_DONE) == 0) + return false; + } + return true; +} + +u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE], + int lane) +{ + int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1); + int s = ((lane & 1) ? + DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT : + DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT); + u8 l = dp_link_status(link_status, i); + + return ((l >> s) & 0x3) << DP_TRAIN_VOLTAGE_SWING_SHIFT; +} + +u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE], + int lane) +{ + int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1); + int s = ((lane & 1) ? + DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT : + DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT); + u8 l = dp_link_status(link_status, i); + + return ((l >> s) & 0x3) << DP_TRAIN_PRE_EMPHASIS_SHIFT; +} + +void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]) { + if (dpcd[DP_TRAINING_AUX_RD_INTERVAL] == 0) + DRM_UDELAY(100); + else + DRM_MDELAY(dpcd[DP_TRAINING_AUX_RD_INTERVAL] * 4); +} + +void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]) { + if (dpcd[DP_TRAINING_AUX_RD_INTERVAL] == 0) + DRM_UDELAY(400); + else + DRM_MDELAY(dpcd[DP_TRAINING_AUX_RD_INTERVAL] * 4); +} + +u8 drm_dp_link_rate_to_bw_code(int link_rate) +{ + switch (link_rate) { + case 162000: + default: + return DP_LINK_BW_1_62; + case 270000: + return DP_LINK_BW_2_7; + case 540000: + return DP_LINK_BW_5_4; + } +} + +int drm_dp_bw_code_to_link_rate(u8 link_bw) +{ + switch (link_bw) { + case DP_LINK_BW_1_62: + default: + return 162000; + case DP_LINK_BW_2_7: + return 270000; + case DP_LINK_BW_5_4: + return 540000; + } +} Modified: head/sys/dev/drm2/drm_dp_helper.h ============================================================================== --- head/sys/dev/drm2/drm_dp_helper.h Sat Aug 24 22:42:19 2013 (r254816) +++ head/sys/dev/drm2/drm_dp_helper.h Sat Aug 24 23:38:57 2013 (r254817) @@ -25,7 +25,19 @@ #ifndef _DRM_DP_HELPER_H_ #define _DRM_DP_HELPER_H_ -/* From the VESA DisplayPort spec */ +/* + * Unless otherwise noted, all values are from the DP 1.1a spec. Note that + * DP and DPCD versions are independent. Differences from 1.0 are not noted, + * 1.0 devices basically don't exist in the wild. + * + * Abbreviations, in chronological order: + * + * eDP: Embedded DisplayPort version 1 + * DPI: DisplayPort Interoperability Guideline v1.1a + * 1.2: DisplayPort 1.2 + * + * 1.2 formally includes both eDP and DPI definitions. + */ #define AUX_NATIVE_WRITE 0x8 #define AUX_NATIVE_READ 0x9 @@ -52,7 +64,7 @@ #define DP_MAX_LANE_COUNT 0x002 # define DP_MAX_LANE_COUNT_MASK 0x1f -# define DP_TPS3_SUPPORTED (1 << 6) +# define DP_TPS3_SUPPORTED (1 << 6) /* 1.2 */ # define DP_ENHANCED_FRAME_CAP (1 << 7) #define DP_MAX_DOWNSPREAD 0x003 @@ -68,14 +80,33 @@ /* 10b = TMDS or HDMI */ /* 11b = Other */ # define DP_FORMAT_CONVERSION (1 << 3) +# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4) /* DPI */ #define DP_MAIN_LINK_CHANNEL_CODING 0x006 -#define DP_TRAINING_AUX_RD_INTERVAL 0x00e +#define DP_DOWN_STREAM_PORT_COUNT 0x007 +# define DP_PORT_COUNT_MASK 0x0f +# define DP_MSA_TIMING_PAR_IGNORED (1 << 6) /* eDP */ +# define DP_OUI_SUPPORT (1 << 7) + +#define DP_I2C_SPEED_CAP 0x00c /* DPI */ +# define DP_I2C_SPEED_1K 0x01 +# define DP_I2C_SPEED_5K 0x02 +# define DP_I2C_SPEED_10K 0x04 +# define DP_I2C_SPEED_100K 0x08 +# define DP_I2C_SPEED_400K 0x10 +# define DP_I2C_SPEED_1M 0x20 + +#define DP_EDP_CONFIGURATION_CAP 0x00d /* XXX 1.2? */ +#define DP_TRAINING_AUX_RD_INTERVAL 0x00e /* XXX 1.2? */ + +/* Multiple stream transport */ +#define DP_MSTM_CAP 0x021 /* 1.2 */ +# define DP_MST_CAP (1 << 0) -#define DP_PSR_SUPPORT 0x070 +#define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */ # define DP_PSR_IS_SUPPORTED 1 -#define DP_PSR_CAPS 0x071 +#define DP_PSR_CAPS 0x071 /* XXX 1.2? */ # define DP_PSR_NO_TRAIN_ON_EXIT 1 # define DP_PSR_SETUP_TIME_330 (0 << 1) # define DP_PSR_SETUP_TIME_275 (1 << 1) @@ -87,11 +118,36 @@ # define DP_PSR_SETUP_TIME_MASK (7 << 1) # define DP_PSR_SETUP_TIME_SHIFT 1 +/* + * 0x80-0x8f describe downstream port capabilities, but there are two layouts + * based on whether DP_DETAILED_CAP_INFO_AVAILABLE was set. If it was not, + * each port's descriptor is one byte wide. If it was set, each port's is + * four bytes wide, starting with the one byte from the base info. As of + * DP interop v1.1a only VGA defines additional detail. + */ + +/* offset 0 */ +#define DP_DOWNSTREAM_PORT_0 0x80 +# define DP_DS_PORT_TYPE_MASK (7 << 0) +# define DP_DS_PORT_TYPE_DP 0 +# define DP_DS_PORT_TYPE_VGA 1 +# define DP_DS_PORT_TYPE_DVI 2 +# define DP_DS_PORT_TYPE_HDMI 3 +# define DP_DS_PORT_TYPE_NON_EDID 4 +# define DP_DS_PORT_HPD (1 << 3) +/* offset 1 for VGA is maximum megapixels per second / 8 */ +/* offset 2 */ +# define DP_DS_VGA_MAX_BPC_MASK (3 << 0) +# define DP_DS_VGA_8BPC 0 +# define DP_DS_VGA_10BPC 1 +# define DP_DS_VGA_12BPC 2 +# define DP_DS_VGA_16BPC 3 + /* link configuration */ #define DP_LINK_BW_SET 0x100 # define DP_LINK_BW_1_62 0x06 # define DP_LINK_BW_2_7 0x0a -# define DP_LINK_BW_5_4 0x14 +# define DP_LINK_BW_5_4 0x14 /* 1.2 */ #define DP_LANE_COUNT_SET 0x101 # define DP_LANE_COUNT_MASK 0x0f @@ -101,7 +157,7 @@ # define DP_TRAINING_PATTERN_DISABLE 0 # define DP_TRAINING_PATTERN_1 1 # define DP_TRAINING_PATTERN_2 2 -# define DP_TRAINING_PATTERN_3 3 +# define DP_TRAINING_PATTERN_3 3 /* 1.2 */ # define DP_TRAINING_PATTERN_MASK 0x3 # define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2) @@ -142,16 +198,32 @@ #define DP_DOWNSPREAD_CTRL 0x107 # define DP_SPREAD_AMP_0_5 (1 << 4) +# define DP_MSA_TIMING_PAR_IGNORE_EN (1 << 7) /* eDP */ #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 # define DP_SET_ANSI_8B10B (1 << 0) -#define DP_PSR_EN_CFG 0x170 +#define DP_I2C_SPEED_CONTROL_STATUS 0x109 /* DPI */ +/* bitmask as for DP_I2C_SPEED_CAP */ + +#define DP_EDP_CONFIGURATION_SET 0x10a /* XXX 1.2? */ + +#define DP_MSTM_CTRL 0x111 /* 1.2 */ +# define DP_MST_EN (1 << 0) +# define DP_UP_REQ_EN (1 << 1) +# define DP_UPSTREAM_IS_SRC (1 << 2) + +#define DP_PSR_EN_CFG 0x170 /* XXX 1.2? */ # define DP_PSR_ENABLE (1 << 0) # define DP_PSR_MAIN_LINK_ACTIVE (1 << 1) # define DP_PSR_CRC_VERIFICATION (1 << 2) # define DP_PSR_FRAME_CAPTURE (1 << 3) +#define DP_SINK_COUNT 0x200 +/* prior to 1.2 bit 7 was reserved mbz */ +# define DP_GET_SINK_COUNT(x) ((((x) & 0x80) >> 1) | ((x) & 0x3f)) +# define DP_SINK_CP_READY (1 << 6) + #define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201 # define DP_REMOTE_CONTROL_COMMAND_PENDING (1 << 0) # define DP_AUTOMATED_TEST_REQUEST (1 << 1) @@ -209,18 +281,22 @@ # define DP_TEST_NAK (1 << 1) # define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) +#define DP_SOURCE_OUI 0x300 +#define DP_SINK_OUI 0x400 +#define DP_BRANCH_OUI 0x500 + #define DP_SET_POWER 0x600 # define DP_SET_POWER_D0 0x1 # define DP_SET_POWER_D3 0x2 -#define DP_PSR_ERROR_STATUS 0x2006 +#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */ # define DP_PSR_LINK_CRC_ERROR (1 << 0) # define DP_PSR_RFB_STORAGE_ERROR (1 << 1) -#define DP_PSR_ESI 0x2007 +#define DP_PSR_ESI 0x2007 /* XXX 1.2? */ # define DP_PSR_CAPS_CHANGE (1 << 0) -#define DP_PSR_STATUS 0x2008 +#define DP_PSR_STATUS 0x2008 /* XXX 1.2? */ # define DP_PSR_SINK_INACTIVE 0 # define DP_PSR_SINK_ACTIVE_SRC_SYNCED 1 # define DP_PSR_SINK_ACTIVE_RFB 2 @@ -247,4 +323,34 @@ int iic_dp_aux_add_bus(device_t dev, con int (*ch)(device_t idev, int mode, uint8_t write_byte, uint8_t *read_byte), void *priv, device_t *bus, device_t *adapter); + +#define DP_LINK_STATUS_SIZE 6 +bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE], + int lane_count); +bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE], + int lane_count); +u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE], + int lane); +u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE], + int lane); + +#define DP_RECEIVER_CAP_SIZE 0xf +void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); +void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); + +u8 drm_dp_link_rate_to_bw_code(int link_rate); +int drm_dp_bw_code_to_link_rate(u8 link_bw); + +static inline int +drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + return drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]); +} + +static inline u8 +drm_dp_max_lane_count(u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK; +} + #endif /* _DRM_DP_HELPER_H_ */ Modified: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/drm2/Makefile Sat Aug 24 22:42:19 2013 (r254816) +++ head/sys/modules/drm2/drm2/Makefile Sat Aug 24 23:38:57 2013 (r254817) @@ -11,6 +11,7 @@ SRCS = \ drm_crtc.c \ drm_crtc_helper.c \ drm_dma.c \ + drm_dp_helper.c \ drm_dp_iic_helper.c \ drm_drawable.c \ drm_drv.c \ From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 23:47:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5B28F33D; Sat, 24 Aug 2013 23:47:32 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4877B2B34; Sat, 24 Aug 2013 23:47:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ONlWhD055924; Sat, 24 Aug 2013 23:47:32 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ONlVF1055922; Sat, 24 Aug 2013 23:47:31 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308242347.r7ONlVF1055922@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 23:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254818 - in head/sys/dev/drm2: . i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 23:47:32 -0000 Author: dumbbell Date: Sat Aug 24 23:47:31 2013 New Revision: 254818 URL: http://svnweb.freebsd.org/changeset/base/254818 Log: drm: Move definition of EREMOTEIO to drmP.h It will be used by both i915 and radeon drivers. Add ERESTARTSYS definition at the same time. Modified: head/sys/dev/drm2/drmP.h head/sys/dev/drm2/i915/intel_dp.c Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Sat Aug 24 23:38:57 2013 (r254817) +++ head/sys/dev/drm2/drmP.h Sat Aug 24 23:47:31 2013 (r254818) @@ -1411,5 +1411,10 @@ do { \ #define KTR_DRM KTR_DEV #define KTR_DRM_REG KTR_SPARE3 +/* Error codes conversion from Linux to FreeBSD. */ +/* XXXKIB what is the right code for EREMOTEIO on FreeBSD? */ +#define EREMOTEIO ENXIO +#define ERESTARTSYS ERESTART + #endif /* __KERNEL__ */ #endif /* _DRM_P_H_ */ Modified: head/sys/dev/drm2/i915/intel_dp.c ============================================================================== --- head/sys/dev/drm2/i915/intel_dp.c Sat Aug 24 23:38:57 2013 (r254817) +++ head/sys/dev/drm2/i915/intel_dp.c Sat Aug 24 23:47:31 2013 (r254818) @@ -43,9 +43,6 @@ __FBSDID("$FreeBSD$"); #define DP_LINK_CONFIGURATION_SIZE 9 -/* XXXKIB what is the right code for the FreeBSD ? */ -#define EREMOTEIO ENXIO - struct intel_dp { struct intel_encoder base; uint32_t output_reg; From owner-svn-src-all@FreeBSD.ORG Sat Aug 24 23:54:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CD695B4; Sat, 24 Aug 2013 23:54:07 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A9B32B8D; Sat, 24 Aug 2013 23:54:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7ONs6kD060148; Sat, 24 Aug 2013 23:54:06 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7ONs6D7060147; Sat, 24 Aug 2013 23:54:06 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201308242354.r7ONs6D7060147@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 24 Aug 2013 23:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254819 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 23:54:07 -0000 Author: dumbbell Date: Sat Aug 24 23:54:06 2013 New Revision: 254819 URL: http://svnweb.freebsd.org/changeset/base/254819 Log: drm: Don't delete already deleted iicbus child from drm_iic_dp_aux The iic_dp_aux_detach callback is therefore useless: it's replaced by bus_generic_detach. This fixes a "General protection fault" panic during second (incorrect) deletion of the child. Tested by: kwm@ Reviewed by: ray@ Modified: head/sys/dev/drm2/drm_dp_iic_helper.c Modified: head/sys/dev/drm2/drm_dp_iic_helper.c ============================================================================== --- head/sys/dev/drm2/drm_dp_iic_helper.c Sat Aug 24 23:47:31 2013 (r254818) +++ head/sys/dev/drm2/drm_dp_iic_helper.c Sat Aug 24 23:54:06 2013 (r254819) @@ -216,22 +216,6 @@ iic_dp_aux_attach(device_t idev) return (0); } -static int -iic_dp_aux_detach(device_t idev) -{ - struct iic_dp_aux_data *aux_data; - device_t port; - - aux_data = device_get_softc(idev); - - port = aux_data->port; - bus_generic_detach(idev); - if (port != NULL) - device_delete_child(idev, port); - - return (0); -} - int iic_dp_aux_add_bus(device_t dev, const char *name, int (*ch)(device_t idev, int mode, uint8_t write_byte, uint8_t *read_byte), @@ -277,7 +261,7 @@ iic_dp_aux_add_bus(device_t dev, const c static device_method_t drm_iic_dp_aux_methods[] = { DEVMETHOD(device_probe, iic_dp_aux_probe), DEVMETHOD(device_attach, iic_dp_aux_attach), - DEVMETHOD(device_detach, iic_dp_aux_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(iicbus_reset, iic_dp_aux_reset), DEVMETHOD(iicbus_transfer, iic_dp_aux_xfer), DEVMETHOD_END