From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 02:34:00 2014 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 ESMTPS id 1DC27DF1; Sun, 16 Feb 2014 02:34:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09A911031; Sun, 16 Feb 2014 02:34:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G2XxD4052035; Sun, 16 Feb 2014 02:33:59 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G2Xxq2052034; Sun, 16 Feb 2014 02:33:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402160233.s1G2Xxq2052034@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Feb 2014 02:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261954 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 02:34:00 -0000 Author: eadler Date: Sun Feb 16 02:33:59 2014 New Revision: 261954 URL: http://svnweb.freebsd.org/changeset/base/261954 Log: MFC r261824: libutil/pw_util.3: Fix two prototypes. Modified: stable/10/lib/libutil/pw_util.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/pw_util.3 ============================================================================== --- stable/10/lib/libutil/pw_util.3 Sun Feb 16 02:09:42 2014 (r261953) +++ stable/10/lib/libutil/pw_util.3 Sun Feb 16 02:33:59 2014 (r261954) @@ -48,13 +48,13 @@ .In pwd.h .In libutil.h .Ft int -.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "const struct passwd *oldpw" +.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "struct passwd *oldpw" .Ft "struct passwd *" .Fn pw_dup "const struct passwd *pw" .Ft int .Fn pw_edit "int nosetuid" .Ft int -.Fn pw_equal "const struct passwd *pw1" "const struct passwd pw2" +.Fn pw_equal "const struct passwd *pw1" "const struct passwd *pw2" .Ft void .Fn pw_fini "void" .Ft int From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 03:01:00 2014 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 ESMTPS id 0C154BA; Sun, 16 Feb 2014 03:01:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D18DD1180; Sun, 16 Feb 2014 03:00:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G30xOB062906; Sun, 16 Feb 2014 03:00:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G30xu8062904; Sun, 16 Feb 2014 03:00:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402160300.s1G30xu8062904@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Feb 2014 03:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261955 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 03:01:00 -0000 Author: ian Date: Sun Feb 16 03:00:59 2014 New Revision: 261955 URL: http://svnweb.freebsd.org/changeset/base/261955 Log: Add a helper routine to depth-search the device tree for a node with a matching 'compatible' property. This probably has a short half-life (as do most of the fdt_ functions), but it helps solve some near-term needs until we work out the larger problems of device instantiation order versus the order of things in the fdt data. Modified: head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Feb 16 02:33:59 2014 (r261954) +++ head/sys/dev/fdt/fdt_common.c Sun Feb 16 03:00:59 2014 (r261955) @@ -223,6 +223,27 @@ fdt_find_compatible(phandle_t start, con return (0); } +phandle_t +fdt_depth_search_compatible(phandle_t start, const char *compat, int strict) +{ + phandle_t child, node; + + /* + * Depth-search all descendants of 'start' node, and find first with + * matching 'compatible' property. + */ + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + if (fdt_is_compatible(node, compat) && + (strict == 0 || fdt_is_compatible_strict(node, compat))) { + return (node); + } + child = fdt_search_compatible(node, compat, strict); + if (child != 0) + return (child); + } + return (0); +} + int fdt_is_enabled(phandle_t node) { Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Sun Feb 16 02:33:59 2014 (r261954) +++ head/sys/dev/fdt/fdt_common.h Sun Feb 16 03:00:59 2014 (r261955) @@ -81,6 +81,7 @@ u_long fdt_data_get(void *, int); int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *); int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); +phandle_t fdt_depth_search_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); int fdt_get_reserved_regions(struct mem_region *, int *); int fdt_get_phyaddr(phandle_t, device_t, int *, void **); From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 03:09:40 2014 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 ESMTPS id 5257774A; Sun, 16 Feb 2014 03:09:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33DB715CE; Sun, 16 Feb 2014 03:09:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G39e9d067248; Sun, 16 Feb 2014 03:09:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G39dUv067246; Sun, 16 Feb 2014 03:09:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402160309.s1G39dUv067246@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Feb 2014 03:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261956 - head/sys/arm/freescale 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 03:09:40 -0000 Author: ian Date: Sun Feb 16 03:09:39 2014 New Revision: 261956 URL: http://svnweb.freebsd.org/changeset/base/261956 Log: Make it possible to access the ocotp registers before the ocotp device is attached, by establishing a temporary mapping of the registers when necessary. This is a temporary measure to keep progress moving; in the long run we need better control over the order in which devices attach (better than "the order they appear in the fdt dts source"). Modified: head/sys/arm/freescale/fsl_ocotp.c head/sys/arm/freescale/fsl_ocotpreg.h Modified: head/sys/arm/freescale/fsl_ocotp.c ============================================================================== --- head/sys/arm/freescale/fsl_ocotp.c Sun Feb 16 03:00:59 2014 (r261955) +++ head/sys/arm/freescale/fsl_ocotp.c Sun Feb 16 03:09:39 2014 (r261956) @@ -46,6 +46,48 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Find the physical address and size of the ocotp registers and devmap them, + * returning a pointer to the virtual address of the base. + * + * XXX This is temporary until we've worked out all the details of controlling + * the load order of devices. In an ideal world this device would be up and + * running before anything that needs it. When we're at a point to make that + * happen, this little block of code, and the few lines in fsl_ocotp_read_4() + * that refer to it can be deleted. + */ +#include +#include +#include +#include + +static uint32_t *ocotp_regs; +static vm_size_t ocotp_size; + +static void +fsl_ocotp_devmap(void) +{ + phandle_t child, root; + u_long base, size; + + if ((root = OF_finddevice("/")) == 0) + goto fatal; + if ((child = fdt_depth_search_compatible(root, "fsl,imx6q-ocotp", 0)) == 0) + goto fatal; + if (fdt_regsize(child, &base, &size) != 0) + goto fatal; + + ocotp_size = (vm_size_t)size; + + if ((ocotp_regs = pmap_mapdev((vm_offset_t)base, ocotp_size)) == NULL) + goto fatal; + + return; +fatal: + panic("cannot find/map the ocotp registers, %d", where); +} +/* XXX end of temporary code */ + struct ocotp_softc { device_t dev; struct resource *mem_res; @@ -60,20 +102,12 @@ RD4(struct ocotp_softc *sc, bus_size_t o return (bus_read_4(sc->mem_res, off)); } - static int ocotp_detach(device_t dev) { - struct ocotp_softc *sc; - sc = device_get_softc(dev); - - if (sc->mem_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - - ocotp_sc = NULL; - - return (0); + /* The ocotp registers are always accessible. */ + return (EBUSY); } static int @@ -96,6 +130,11 @@ ocotp_attach(device_t dev) } ocotp_sc = sc; + + /* We're done with the temporary mapping now. */ + if (ocotp_regs != NULL) + pmap_unmapdev((vm_offset_t)ocotp_regs, ocotp_size); + err = 0; out: @@ -112,7 +151,7 @@ ocotp_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "fsl,imx6q-ocotp") == 0) + if (ofw_bus_is_compatible(dev, "fsl,imx6q-ocotp") == 0) return (ENXIO); device_set_desc(dev, @@ -125,13 +164,23 @@ uint32_t fsl_ocotp_read_4(bus_size_t off) { - if (ocotp_sc == NULL) - panic("fsl_ocotp_read_4: softc not set!"); - if (off > FSL_OCOTP_LAST_REG) panic("fsl_ocotp_read_4: offset out of range"); - return (RD4(ocotp_sc, off)); + /* If we have a softcontext use the regular bus_space read. */ + if (ocotp_sc != NULL) + return (RD4(ocotp_sc, off)); + + /* + * Otherwise establish a tempory device mapping if necessary, and read + * the device without any help from bus_space. + * + * XXX Eventually the code from there down can be deleted. + */ + if (ocotp_regs == NULL) + fsl_ocotp_devmap(); + + return (ocotp_regs[off / 4]); } static device_method_t ocotp_methods[] = { Modified: head/sys/arm/freescale/fsl_ocotpreg.h ============================================================================== --- head/sys/arm/freescale/fsl_ocotpreg.h Sun Feb 16 03:00:59 2014 (r261955) +++ head/sys/arm/freescale/fsl_ocotpreg.h Sun Feb 16 03:09:39 2014 (r261956) @@ -48,6 +48,13 @@ #define FSL_OCOTP_CFG1 0x420 #define FSL_OCOTP_CFG2 0x430 #define FSL_OCOTP_CFG3 0x440 +#define FSL_OCOTP_CFG3_SPEED_SHIFT 16 +#define FSL_OCOTP_CFG3_SPEED_MASK \ + (0x03 << FSL_OCOTP_CFG3_SPEED_SHIFT) +#define FSL_OCOTP_CFG3_SPEED_792MHZ 0 +#define FSL_OCOTP_CFG3_SPEED_852MHZ 1 +#define FSL_OCOTP_CFG3_SPEED_996MHZ 2 +#define FSL_OCOTP_CFG3_SPEED_1200MHZ 3 #define FSL_OCOTP_CFG4 0x450 #define FSL_OCOTP_CFG5 0x460 #define FSL_OCOTP_CFG6 0x470 From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 03:30:22 2014 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 ESMTPS id D1D1FB16; Sun, 16 Feb 2014 03:30:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE3011732; Sun, 16 Feb 2014 03:30:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G3UMgt076750; Sun, 16 Feb 2014 03:30:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G3UM65076749; Sun, 16 Feb 2014 03:30:22 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402160330.s1G3UM65076749@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Feb 2014 03:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261957 - head/sys/arm/freescale 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 03:30:22 -0000 Author: ian Date: Sun Feb 16 03:30:22 2014 New Revision: 261957 URL: http://svnweb.freebsd.org/changeset/base/261957 Log: Oops, remove some dregs of debugging. Modified: head/sys/arm/freescale/fsl_ocotp.c Modified: head/sys/arm/freescale/fsl_ocotp.c ============================================================================== --- head/sys/arm/freescale/fsl_ocotp.c Sun Feb 16 03:09:39 2014 (r261956) +++ head/sys/arm/freescale/fsl_ocotp.c Sun Feb 16 03:30:22 2014 (r261957) @@ -84,7 +84,7 @@ fsl_ocotp_devmap(void) return; fatal: - panic("cannot find/map the ocotp registers, %d", where); + panic("cannot find/map the ocotp registers"); } /* XXX end of temporary code */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 03:34:08 2014 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 ESMTPS id 742F4D85; Sun, 16 Feb 2014 03:34:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6025117B7; Sun, 16 Feb 2014 03:34:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G3Y8iM079760; Sun, 16 Feb 2014 03:34:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G3Y8Ph079759; Sun, 16 Feb 2014 03:34:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402160334.s1G3Y8Ph079759@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Feb 2014 03:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261958 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 03:34:08 -0000 Author: ian Date: Sun Feb 16 03:34:07 2014 New Revision: 261958 URL: http://svnweb.freebsd.org/changeset/base/261958 Log: Catch up with last-second name change. Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Feb 16 03:30:22 2014 (r261957) +++ head/sys/dev/fdt/fdt_common.c Sun Feb 16 03:34:07 2014 (r261958) @@ -237,7 +237,7 @@ fdt_depth_search_compatible(phandle_t st (strict == 0 || fdt_is_compatible_strict(node, compat))) { return (node); } - child = fdt_search_compatible(node, compat, strict); + child = fdt_depth_search_compatible(node, compat, strict); if (child != 0) return (child); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 04:10:00 2014 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 ESMTPS id 2C8EF1A3; Sun, 16 Feb 2014 04:10:00 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id C61331989; Sun, 16 Feb 2014 04:09:59 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0518B1042843; Sun, 16 Feb 2014 15:09:51 +1100 (EST) Date: Sun, 16 Feb 2014 15:09:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall Subject: Re: svn commit: r261916 - head/sys/dev/xen/console In-Reply-To: <8C22DE47-60F2-47C0-938D-590324818872@FreeBSD.org> Message-ID: <20140216134006.R788@besplex.bde.org> References: <201402151237.s1FCbRnh000507@svn.freebsd.org> <20140216035823.I2978@besplex.bde.org> <8C22DE47-60F2-47C0-938D-590324818872@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=3iJA4HwJju4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=FBIJrv5t4GUA:10 a=V-6b4kTEUMR3rLk6NukA:9 a=9XmJS-t9oMu7HOe1:21 a=Rq1lg_kM_SzjcKl2:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 04:10:00 -0000 On Sat, 15 Feb 2014, David Chisnall wrote: > On 15 Feb 2014, at 17:02, Bruce Evans wrote: > >> Why? There are hundreds if not thousands of static inline functions in >> headers, and most of these functions are not always used, so there would >> be [hundreds if not thousands] * [number of #includes] compiler warnings >> if compilers warned about things like this. They could handle include >> files specially, but shouldn't. > > They do, and absolutely should, handle include files separately. If you have a static inline function in a header that is not used in a specific compilation unit, then that is a little bit of extra work for the compiler as it has to parse it without it being used, but it is not a problem. It is a safe assumption that it is used by at least one compilation unit and so is not dead code (and even if it isn't yet, it is part of an API, and so removing it would be an error). No, there is no difference between an include file and a main source file, except for STDC headers in hosted implementations. Main source files may by included. Compilers shouldn't police the dubious style of this. > In contrast, a static inline function in the main source file for a compilation unit is definitely a bug. It is obviously dead code. It is likely that it either should have been removed when all callers were deleted, or should not have been static but accidentally was. It is _not_ obviously a bug. The main source file may have been carefully designed to be #included, with only the necessary #ifdef uglyness for this. Something like: main.c: /* * Broken compilers might barf if this is file used in the usual way by * including it, but I refuse to work around the brokenness by ifdefing * standards-conforming code. */ static inline int foo(int _x) { ... } /* Squillions more non-ifdefed static inline functions. */ /* Public functions need ifdefs of course. */ #ifdef WANT_MAIN int main(void) { ... } #endif /* * In C99, 'inline' is only a hint, so non-online functions strictly don't * need ifdefs any more that inline ones. However, some compilers will * keep plain static functions, and we need this feature. Ifdefing these * functions is not as essential as for public functions, but we do it to * avoid duplication of the functions. * * It is unclear how to write the ifdefs for this. The above main() is * only used in a special testing context, so we can use the condition * used to configure this context (the tests of it probably started in * a makefile). Whether this file is used being used as an include file * is probably determined by the same configuration info, but we don't * want to depend on that, and we want to show the full awfulness of the * potential ifdef ugliness, so we use a separate macro for each function. * The number of functions that need this should of course be minimized. * * XXX need more magic to keep static functions in a portable way as * renamed public functions. */ #ifdef WANT_BAR static int bar(int x) /* The ifdef messes allow naming x without an underscore. */ { ... } #endif For extra complications, use even worse style where the main source file is never used directly, but is included deeply nested and turns back into the main source file (with public functions) in 1 compilation unit. The ifdefs in the above example already support this, since they don't have any magic depending on the nesting level. For more practical examples of the brokenness, consider the effect of preprocessing. I often use cpp -P and compile the result. I use -P here to mainly to remove unwanted #line statements. Preprocessing must keep static inline functions, and -P removes any hints about whether they are in include files. Of course, using preprocessed output is outside of the C standard, but it is useful. The compiler might have further bugs involving special cases for preprocessed output in files name *.i. But the preprocessed output may be placed in files named *.c. That and removing #line statements and unportable directives with hints about include files if the preprocessed output is the final version of the file and/or is compiled by a compiler that doesn't support *.i. Similar considerations apply to the -W[no-]system-headers magic. Errors in system headers (other than ones related to the preprocessing pass) become just as fatal as anywhere else after cpp -P. Similar considerations apply to machine-generated main source files from other sources. yacc and lex are well known for generating unreachable break statements that lint doesn't like, except lint ignores these by default and has a flag -b to report them. You don't want to either complicate the generating program or have special compiler flags and complications in makefiles to set the flags to do the same thing for compilers. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 04:11:40 2014 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 ESMTPS id A60C42EE; Sun, 16 Feb 2014 04:11:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 913D519F1; Sun, 16 Feb 2014 04:11:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G4Be5B096609; Sun, 16 Feb 2014 04:11:40 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G4BePP096608; Sun, 16 Feb 2014 04:11:40 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201402160411.s1G4BePP096608@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Feb 2014 04:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261959 - head/tests 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 04:11:40 -0000 Author: jmmv Date: Sun Feb 16 04:11:40 2014 New Revision: 261959 URL: http://svnweb.freebsd.org/changeset/base/261959 Log: Install a symlink from /usr/tests/local to /usr/local/tests. This is to let Kyua descend into any tests that may have been installed by ports under /usr/local/tests when running the test suite from /usr/tests. Some ports (namely those that build Kyua) already install test programs into /usr/local/tests. Just make sure to select the TEST option while building them. MFC after: 3 days Modified: head/tests/Makefile Modified: head/tests/Makefile ============================================================================== --- head/tests/Makefile Sun Feb 16 03:34:07 2014 (r261958) +++ head/tests/Makefile Sun Feb 16 04:11:40 2014 (r261959) @@ -7,4 +7,8 @@ SUBDIR= sys TESTSDIR= ${TESTSBASE} KYUAFILE= yes +afterinstall: install-tests-local +install-tests-local: .PHONY + ${INSTALL_SYMLINK} ../local/tests ${TESTSDIR}/local + .include From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 06:56:44 2014 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 ESMTPS id ACC7A491; Sun, 16 Feb 2014 06:56:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 976DD1489; Sun, 16 Feb 2014 06:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G6uime065849; Sun, 16 Feb 2014 06:56:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G6uipp065848; Sun, 16 Feb 2014 06:56:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201402160656.s1G6uipp065848@svn.freebsd.org> From: Devin Teske Date: Sun, 16 Feb 2014 06:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261960 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 06:56:44 -0000 Author: dteske Date: Sun Feb 16 06:56:44 2014 New Revision: 261960 URL: http://svnweb.freebsd.org/changeset/base/261960 Log: Add zfsboot to the scripted interface of bsdinstall(8); oops! NB: If the zfsboot variables ($ZFSBOOT_*) are set, a script is assumed to want zfsboot module instead of scriptedpart module. Submitted by: Loïc Brarda Reviewed by: nwhitehorn@ MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/script Modified: head/usr.sbin/bsdinstall/scripts/script ============================================================================== --- head/usr.sbin/bsdinstall/scripts/script Sun Feb 16 04:11:40 2014 (r261959) +++ head/usr.sbin/bsdinstall/scripts/script Sun Feb 16 06:56:44 2014 (r261960) @@ -95,7 +95,11 @@ fi # Make partitions rm -f $PATH_FSTAB touch $PATH_FSTAB -bsdinstall scriptedpart "$PARTITIONS" +if [ "$ZFSBOOT_DISKS" ]; then + bsdinstall zfsboot +else + bsdinstall scriptedpart "$PARTITIONS" +fi bsdinstall mount # Unpack distributions From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 08:35:34 2014 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 ESMTPS id B10A4C2C; Sun, 16 Feb 2014 08:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8153919BC; Sun, 16 Feb 2014 08:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G8ZYd8009165; Sun, 16 Feb 2014 08:35:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G8ZYkh009164; Sun, 16 Feb 2014 08:35:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201402160835.s1G8ZYkh009164@svn.freebsd.org> From: Rui Paulo Date: Sun, 16 Feb 2014 08:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261961 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 08:35:34 -0000 Author: rpaulo Date: Sun Feb 16 08:35:33 2014 New Revision: 261961 URL: http://svnweb.freebsd.org/changeset/base/261961 Log: MFC r261863 Add urtwn_start_locked() to avoid unlocking during TX. Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Sun Feb 16 06:56:44 2014 (r261960) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Sun Feb 16 08:35:33 2014 (r261961) @@ -209,6 +209,8 @@ static int urtwn_tx_start(struct urtwn_ struct ieee80211_node *, struct mbuf *, struct urtwn_data *); static void urtwn_start(struct ifnet *); +static void urtwn_start_locked(struct ifnet *, + struct urtwn_softc *); static int urtwn_ioctl(struct ifnet *, u_long, caddr_t); static int urtwn_power_on(struct urtwn_softc *); static int urtwn_llt_init(struct urtwn_softc *); @@ -866,13 +868,9 @@ tr_setup: } STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next); STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next); - usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); usbd_transfer_submit(xfer); - - URTWN_UNLOCK(sc); - urtwn_start(ifp); - URTWN_LOCK(sc); + urtwn_start_locked(ifp, sc); break; default: data = STAILQ_FIRST(&sc->sc_tx_active); @@ -1715,14 +1713,22 @@ static void urtwn_start(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; - struct ieee80211_node *ni; - struct mbuf *m; - struct urtwn_data *bf; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - URTWN_LOCK(sc); + urtwn_start_locked(ifp, sc); + URTWN_UNLOCK(sc); +} + +static void +urtwn_start_locked(struct ifnet *ifp, struct urtwn_softc *sc) +{ + struct ieee80211_node *ni; + struct mbuf *m; + struct urtwn_data *bf; + + URTWN_ASSERT_LOCKED(sc); for (;;) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) @@ -1745,7 +1751,6 @@ urtwn_start(struct ifnet *ifp) sc->sc_txtimer = 5; callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); } - URTWN_UNLOCK(sc); } static int From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 08:42:53 2014 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 ESMTPS id 4505FDCE; Sun, 16 Feb 2014 08:42:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2EDA71A3E; Sun, 16 Feb 2014 08:42:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G8grxG012954; Sun, 16 Feb 2014 08:42:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G8gr4E012947; Sun, 16 Feb 2014 08:42:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201402160842.s1G8gr4E012947@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 16 Feb 2014 08:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261962 - head/usr.bin/rctl 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 08:42:53 -0000 Author: trasz Date: Sun Feb 16 08:42:52 2014 New Revision: 261962 URL: http://svnweb.freebsd.org/changeset/base/261962 Log: Mention that rctl(8) was sponsored by the Foundation. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sun Feb 16 08:35:33 2014 (r261961) +++ head/usr.bin/rctl/rctl.8 Sun Feb 16 08:42:52 2014 (r261962) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2014 +.Dd February 16, 2014 .Dt RCTL 8 .Os .Sh NAME @@ -267,8 +267,9 @@ command appeared in .An -nosplit The .Nm -command was written by -.An Edward Tomasz Napierala Aq trasz@FreeBSD.org . +was developed by +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. .Sh BUGS Limiting .Sy memoryuse From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 09:05:13 2014 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 ESMTPS id 8B722449; Sun, 16 Feb 2014 09:05:13 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD081B86; Sun, 16 Feb 2014 09:05:12 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.5) with ESMTP id s1G94gt9073914 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 16 Feb 2014 09:04:52 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261916 - head/sys/dev/xen/console From: David Chisnall In-Reply-To: <20140216134006.R788@besplex.bde.org> Date: Sun, 16 Feb 2014 09:04:37 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9AECF0D9-9230-4312-858D-E0C92674FC18@FreeBSD.org> References: <201402151237.s1FCbRnh000507@svn.freebsd.org> <20140216035823.I2978@besplex.bde.org> <8C22DE47-60F2-47C0-938D-590324818872@FreeBSD.org> <20140216134006.R788@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 09:05:13 -0000 On 16 Feb 2014, at 04:09, Bruce Evans wrote: > [a long list of corner cases where the warning may not be correct] Fortunately, the goal of compiler warnings is not to address every = possible case, but rather to minimise false positives while still giving = useful results. The warning can be turned off if you are using the C = preprocessor in a way designed to provide cautionary tales to young = programmers, but for everyone else it makes sense to have it on by = default. Anyone using a single file as both the main file for a compilation unit = and as an included file in others, deserves to have a new antipattern = named after them so that their name can live in infamy, but should not = in any way be allowed to influence the design of compiler warnings. David From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 10:16:08 2014 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 ESMTPS id 1FD7B369; Sun, 16 Feb 2014 10:16:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08FDB10B5; Sun, 16 Feb 2014 10:16:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GAG7fj053182; Sun, 16 Feb 2014 10:16:07 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GAG7hA053179; Sun, 16 Feb 2014 10:16:07 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161016.s1GAG7hA053179@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 10:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261963 - in stable/10/sbin: growfs newfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 10:16:08 -0000 Author: brueffer Date: Sun Feb 16 10:16:07 2014 New Revision: 261963 URL: http://svnweb.freebsd.org/changeset/base/261963 Log: Refer newfs and growfs users to fsck_ffs instead of fsck, the latter does not accept the referred to "-b" flag. PR: 82720 Submitted by: David D.W. Downey Modified: stable/10/sbin/growfs/growfs.c stable/10/sbin/newfs/mkfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/growfs/growfs.c ============================================================================== --- stable/10/sbin/growfs/growfs.c Sun Feb 16 08:42:52 2014 (r261962) +++ stable/10/sbin/growfs/growfs.c Sun Feb 16 10:16:07 2014 (r261963) @@ -201,7 +201,7 @@ growfs(int fsi, int fso, unsigned int Nf * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); Modified: stable/10/sbin/newfs/mkfs.c ============================================================================== --- stable/10/sbin/newfs/mkfs.c Sun Feb 16 08:42:52 2014 (r261962) +++ stable/10/sbin/newfs/mkfs.c Sun Feb 16 10:16:07 2014 (r261963) @@ -546,7 +546,7 @@ restart: * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 10:28:19 2014 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 ESMTPS id 01BEE65A; Sun, 16 Feb 2014 10:28:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF13E114C; Sun, 16 Feb 2014 10:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GASIMp057728; Sun, 16 Feb 2014 10:28:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GASI5v057727; Sun, 16 Feb 2014 10:28:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161028.s1GASI5v057727@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 10:28:18 +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: r261964 - stable/9/sbin/growfs 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 10:28:19 -0000 Author: brueffer Date: Sun Feb 16 10:28:18 2014 New Revision: 261964 URL: http://svnweb.freebsd.org/changeset/base/261964 Log: MFC: r261655 Refer newfs and growfs users to fsck_ffs instead of fsck, the latter does not accept the referred to "-b" flag. The part of the change pertaining newfs has already been merged to stable/9 in r237505, so only record that part of the merge. PR: 82720 Submitted by: David D.W. Downey Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) stable/9/sbin/newfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sun Feb 16 10:16:07 2014 (r261963) +++ stable/9/sbin/growfs/growfs.c Sun Feb 16 10:28:18 2014 (r261964) @@ -206,7 +206,7 @@ growfs(int fsi, int fso, unsigned int Nf * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 10:39:30 2014 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 ESMTPS id 72B8C59E; Sun, 16 Feb 2014 10:39:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41E351218; Sun, 16 Feb 2014 10:39:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GAdUdf063391; Sun, 16 Feb 2014 10:39:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GAdUd2063390; Sun, 16 Feb 2014 10:39:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161039.s1GAdUd2063390@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 10:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261965 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 10:39:30 -0000 Author: brueffer Date: Sun Feb 16 10:39:29 2014 New Revision: 261965 URL: http://svnweb.freebsd.org/changeset/base/261965 Log: MFC: r261701 Allow iwn2000 and iwn2030 firmware to be linked into the kernel. PR: 184631 Submitted by: Oliver Pinter Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Feb 16 10:28:18 2014 (r261964) +++ stable/10/sys/conf/files Sun Feb 16 10:39:29 2014 (r261965) @@ -1605,6 +1605,34 @@ iwn1000.fw optional iwn1000fw | iwnfw compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn1000.fw" +iwn2000fw.c optional iwn2000fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn2000.fw:iwn2000fw -miwn2000fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn2000fw.c" +iwn2000fw.fwo optional iwn2000fw | iwnfw \ + dependency "iwn2000.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwn2000fw.fwo" +iwn2000.fw optional iwn2000fw | iwnfw \ + dependency "$S/contrib/dev/iwn/iwlwifi-2000-18.168.6.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwn2000.fw" +iwn2030fw.c optional iwn2030fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn2030.fw:iwn2030fw -miwn2030fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn2030fw.c" +iwn2030fw.fwo optional iwn2030fw | iwnfw \ + dependency "iwn2030.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwn2030fw.fwo" +iwn2030.fw optional iwn2030fw | iwnfw \ + dependency "$S/contrib/dev/iwn/iwnwifi-2030-18.168.6.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwn2030.fw" iwn4965fw.c optional iwn4965fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn4965.fw:iwn4965fw -miwn4965fw -c${.TARGET}" \ no-implicit-rule before-depend local \ From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 11:11:42 2014 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 ESMTPS id 91890393; Sun, 16 Feb 2014 11:11:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7D3148D; Sun, 16 Feb 2014 11:11:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBBgeJ080414; Sun, 16 Feb 2014 11:11:42 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBBgvR080411; Sun, 16 Feb 2014 11:11:42 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161111.s1GBBgvR080411@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261971 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 11:11:42 -0000 Author: brueffer Date: Sun Feb 16 11:11:41 2014 New Revision: 261971 URL: http://svnweb.freebsd.org/changeset/base/261971 Log: MFC: r261702 Update and sort the list of iwn(4) firmware. Modified: stable/10/share/man/man4/iwn.4 stable/10/share/man/man4/iwnfw.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/iwn.4 ============================================================================== --- stable/10/share/man/man4/iwn.4 Sun Feb 16 10:59:44 2014 (r261970) +++ stable/10/share/man/man4/iwn.4 Sun Feb 16 11:11:41 2014 (r261971) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd February 9, 2014 .Dt IWN 4 .Os .Sh NAME @@ -45,8 +45,10 @@ kernel configuration file: You also need to select a firmware for your device. Choose one from: .Bd -ragged -offset indent -.Cd "device iwn4965fw" .Cd "device iwn1000fw" +.Cd "device iwn2000fw" +.Cd "device iwn2030fw" +.Cd "device iwn4965fw" .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" @@ -67,8 +69,10 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent if_iwn_load="YES" -iwn4965fw_load="YES" iwn1000fw_load="YES" +iwn2000fw_load="YES" +iwn2030fw_load="YES" +iwn4965fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" Modified: stable/10/share/man/man4/iwnfw.4 ============================================================================== --- stable/10/share/man/man4/iwnfw.4 Sun Feb 16 10:59:44 2014 (r261970) +++ stable/10/share/man/man4/iwnfw.4 Sun Feb 16 11:11:41 2014 (r261971) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2011 +.Dd February 9, 2014 .Dt IWNFW 4 .Os .Sh NAME @@ -40,8 +40,10 @@ This will include three firmware images If you want to pick only the firmware image for your network adapter choose one of the following: .Bd -ragged -offset indent -.Cd "device iwn4965fw" .Cd "device iwn1000fw" +.Cd "device iwn2000fw" +.Cd "device iwn2030fw" +.Cd "device iwn4965fw" .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" @@ -54,8 +56,10 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -iwn4965fw_load="YES" iwn1000fw_load="YES" +iwn2000fw_load="YES" +iwn2030fw_load="YES" +iwn4965fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" @@ -65,7 +69,7 @@ iwn6050fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Wireless WiFi Link 4965, 1000, 5000 and 6000 series of +Intel Wireless WiFi Link 1000, 2000, 2030, 4965, 5000 and 6000 series of IEEE 802.11n adapters. It may be statically linked into the kernel, or loaded as a module. From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 11:13:14 2014 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 ESMTPS id B9D2560B; Sun, 16 Feb 2014 11:13:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5D9014A5; Sun, 16 Feb 2014 11:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBDEwJ080755; Sun, 16 Feb 2014 11:13:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBDEPJ080754; Sun, 16 Feb 2014 11:13:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161113.s1GBDEPJ080754@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261972 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 11:13:14 -0000 Author: brueffer Date: Sun Feb 16 11:13:14 2014 New Revision: 261972 URL: http://svnweb.freebsd.org/changeset/base/261972 Log: MFC: r261838 Add a deprecation notice to nve.4 and Xref nfe.4. Modified: stable/10/share/man/man4/nve.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/nve.4 ============================================================================== --- stable/10/share/man/man4/nve.4 Sun Feb 16 11:11:41 2014 (r261971) +++ stable/10/share/man/man4/nve.4 Sun Feb 16 11:13:14 2014 (r261972) @@ -26,13 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd February 13, 2014 .Dt NVE 4 .Os .Sh NAME .Nm nve .Nd "NVIDIA nForce MCP Networking Adapter device driver" .Sh SYNOPSIS +.Sy Warning: +This driver is deprecated and will not be available in +.Fx 11.0 +and later. +Please consider using the +.Xr nfe 4 +driver instead. +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -119,6 +127,7 @@ the network connection (cable). .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr nfe 4 , .Xr ng_ether 4 , .Xr rgephy 4 , .Xr ifconfig 8 From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 11:14:39 2014 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 ESMTPS id 6D6C18F3; Sun, 16 Feb 2014 11:14:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA97114B7; Sun, 16 Feb 2014 11:14:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBEbe4081232; Sun, 16 Feb 2014 11:14:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBEbFf081231; Sun, 16 Feb 2014 11:14:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161114.s1GBEbFf081231@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:14: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: r261973 - stable/9/share/man/man4 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 11:14:39 -0000 Author: brueffer Date: Sun Feb 16 11:14:36 2014 New Revision: 261973 URL: http://svnweb.freebsd.org/changeset/base/261973 Log: MFC: r261838 Add a deprecation notice to nve.4 and Xref nfe.4. Modified: stable/9/share/man/man4/nve.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/nve.4 ============================================================================== --- stable/9/share/man/man4/nve.4 Sun Feb 16 11:13:14 2014 (r261972) +++ stable/9/share/man/man4/nve.4 Sun Feb 16 11:14:36 2014 (r261973) @@ -26,13 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd February 13, 2014 .Dt NVE 4 .Os .Sh NAME .Nm nve .Nd "NVIDIA nForce MCP Networking Adapter device driver" .Sh SYNOPSIS +.Sy Warning: +This driver is deprecated and will not be available in +.Fx 11.0 +and later. +Please consider using the +.Xr nfe 4 +driver instead. +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -119,6 +127,7 @@ the network connection (cable). .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr nfe 4 , .Xr ng_ether 4 , .Xr rgephy 4 , .Xr ifconfig 8 From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 11:17:40 2014 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 ESMTPS id AFA62A4A; Sun, 16 Feb 2014 11:17:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9886214CA; Sun, 16 Feb 2014 11:17:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBHe83081803; Sun, 16 Feb 2014 11:17:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBHeQY081802; Sun, 16 Feb 2014 11:17:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161117.s1GBHeQY081802@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:17:40 +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: r261974 - stable/8/share/man/man4 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 11:17:40 -0000 Author: brueffer Date: Sun Feb 16 11:17:40 2014 New Revision: 261974 URL: http://svnweb.freebsd.org/changeset/base/261974 Log: MFC: r261838 Add a deprecation notice to nve.4 and Xref nfe.4. Modified: stable/8/share/man/man4/nve.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/nve.4 ============================================================================== --- stable/8/share/man/man4/nve.4 Sun Feb 16 11:14:36 2014 (r261973) +++ stable/8/share/man/man4/nve.4 Sun Feb 16 11:17:40 2014 (r261974) @@ -26,13 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd February 13, 2014 .Dt NVE 4 .Os .Sh NAME .Nm nve .Nd "NVIDIA nForce MCP Networking Adapter device driver" .Sh SYNOPSIS +.Sy Warning: +This driver is deprecated and will not be available in +.Fx 11.0 +and later. +Please consider using the +.Xr nfe 4 +driver instead. +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -123,6 +131,7 @@ bandwidth show that the card is actually .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr nfe 4 , .Xr ng_ether 4 , .Xr rgephy 4 , .Xr ifconfig 8 From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 12:22:48 2014 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 ESMTPS id 0D313232; Sun, 16 Feb 2014 12:22:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEC0318D9; Sun, 16 Feb 2014 12:22:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GCMlUg012257; Sun, 16 Feb 2014 12:22:47 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GCMi6b012236; Sun, 16 Feb 2014 12:22:44 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161222.s1GCMi6b012236@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 12:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261975 - in head: release/doc/en_US.ISO8859-1/hardware release/doc/share/misc share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/contrib/dev/nve sys/dev/nve sys/i386/conf sys/mi... 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 12:22:48 -0000 Author: brueffer Date: Sun Feb 16 12:22:43 2014 New Revision: 261975 URL: http://svnweb.freebsd.org/changeset/base/261975 Log: Retire the nve(4) driver; nfe(4) has been the default driver for NVIDIA nForce MCP adapters for a long time. Yays: jhb, remko, yongari Nays: none on the current and stable lists Deleted: head/share/man/man4/nve.4 head/sys/contrib/dev/nve/ head/sys/dev/nve/ head/sys/modules/nve/ Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml head/release/doc/share/misc/dev.archlist.txt head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/WITHOUT_SOURCELESS_HOST head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/i386/conf/PAE head/sys/i386/conf/XEN head/sys/mips/conf/OCTEON1 head/sys/modules/Makefile Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Feb 16 11:17:40 2014 (r261974) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Feb 16 12:22:43 2014 (r261975) @@ -883,8 +883,6 @@ &hwlist.nge; - &hwlist.nve; - &hwlist.nxge; &hwlist.oce; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Sun Feb 16 11:17:40 2014 (r261974) +++ head/release/doc/share/misc/dev.archlist.txt Sun Feb 16 12:22:43 2014 (r261975) @@ -97,7 +97,6 @@ nfe i386,amd64 ng_bt3c i386,pc98,amd64 ng_ubt i386,pc98,amd64 nsp i386,pc98 -nve i386,amd64 nxge i386,amd64 oce i386,amd64 ohci i386,pc98,ia64,amd64,powerpc Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Feb 16 11:17:40 2014 (r261974) +++ head/share/man/man4/Makefile Sun Feb 16 12:22:43 2014 (r261975) @@ -344,7 +344,6 @@ MAN= aac.4 \ ${_ntb.4} \ null.4 \ ${_nvd.4} \ - ${_nve.4} \ ${_nvme.4} \ ${_nvram.4} \ ${_nvram2env.4} \ @@ -673,7 +672,6 @@ MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 MLINKS+=${_ntb.4} ${_if_ntb.4} \ ${_ntb.4} ${_ntb_hw.4} -MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 MLINKS+=pccbb.4 cbb.4 @@ -772,7 +770,6 @@ _ichwd.4= ichwd.4 _if_bxe.4= if_bxe.4 _if_ndis.4= if_ndis.4 _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 @@ -787,7 +784,6 @@ _ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _nvd.4= nvd.4 -_nve.4= nve.4 _nvme.4= nvme.4 _nvram.4= nvram.4 _nxge.4= nxge.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Sun Feb 16 11:17:40 2014 (r261974) +++ head/share/man/man4/altq.4 Sun Feb 16 12:22:43 2014 (r261975) @@ -151,7 +151,6 @@ They have been applied to the following .Xr nfe 4 , .Xr nge 4 , .Xr npe 4 , -.Xr nve 4 , .Xr qlxgb 4 , .Xr ral 4 , .Xr re 4 , Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Sun Feb 16 11:17:40 2014 (r261974) +++ head/share/man/man4/miibus.4 Sun Feb 16 12:22:43 2014 (r261975) @@ -87,8 +87,6 @@ Marvell/SysKonnect Yukon II Gigabit Ethe NVIDIA nForce MCP Networking Adapter .It Xr nge 4 National Semiconductor DP83820/DP83821 Gigabit Ethernet -.It Xr nve 4 -NVIDIA nForce MCP Networking Adapter .It Xr pcn 4 AMD Am79C97x PCI 10/100 .It Xr re 4 @@ -159,7 +157,6 @@ but as a result are not well behaved new .Xr netintro 4 , .Xr nfe 4 , .Xr nge 4 , -.Xr nve 4 , .Xr pcn 4 , .Xr re 4 , .Xr rgephy 4 , Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Sun Feb 16 11:17:40 2014 (r261974) +++ head/share/man/man4/vlan.4 Sun Feb 16 12:22:43 2014 (r261975) @@ -176,7 +176,6 @@ These interfaces natively support long f .Xr hme 4 , .Xr le 4 , .Xr nfe 4 , -.Xr nve 4 , .Xr rl 4 , .Xr sf 4 , .Xr sis 4 , Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/amd64/conf/GENERIC Sun Feb 16 12:22:43 2014 (r261975) @@ -235,7 +235,6 @@ device lge # Level 1 LXT1001 gigabit E device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet -#device nve # nVidia nForce MCP on-board Ethernet Networking device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/amd64/conf/NOTES Sun Feb 16 12:22:43 2014 (r261975) @@ -309,7 +309,6 @@ options DRM_DEBUG # Include debug print # mlxen: Mellanox ConnectX HCA Ethernet # mthca: Mellanox HCA InfiniBand # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) -# nve: nVidia nForce MCP on-board Ethernet Networking # sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters # vmx: VMware VMXNET3 Ethernet (BSD open source) # wpi: Intel 3945ABG Wireless LAN controller @@ -327,7 +326,6 @@ device mlx4ib # Mellanox ConnectX HCA device mlxen # Mellanox ConnectX HCA Ethernet device mthca # Mellanox HCA InfiniBand device nfe # nVidia nForce MCP on-board Ethernet -device nve # nVidia nForce MCP on-board Ethernet Networking device sfxge # Solarflare SFC9000 10Gb Ethernet device vmx # VMware VMXNET3 Ethernet device wpi # Intel 3945ABG wireless NICs. Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/boot/forth/loader.conf Sun Feb 16 12:22:43 2014 (r261975) @@ -327,7 +327,6 @@ if_mxge_load="NO" # Myricom Myri10GE 10 if_my_load="NO" # Myson PCI Fast Ethernet if_nfe_load="NO" # NVIDIA nForce MCP Networking Adapter if_nge_load="NO" # National Semiconductor PCI Gigabit Ethernet -if_nve_load="NO" # NVIDIA nForce MCP Networking Adapter if_nxge_load="NO" # Neterion Xframe 10Gb Ethernet if_patm_load="NO" # IDT77252 ATM if_pcn_load="NO" # AMD PCnet PCI Modified: head/sys/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 16 12:22:43 2014 (r261975) @@ -8,4 +8,3 @@ nodevice hpt27xx nodevice hptmv nodevice hptnr nodevice hptrr -nodevice nve Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/conf/files.amd64 Sun Feb 16 12:22:43 2014 (r261975) @@ -47,17 +47,6 @@ ukbdmap.h optional ukbd_dflt_keymap \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # -nvenetlib.o optional nve pci \ - dependency "$S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu" \ - compile-with "uudecode $S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \ - no-implicit-rule -# -os+%DIKED-nve.h optional nve pci \ - dependency "$S/contrib/dev/nve/os.h" \ - compile-with "sed -e 's/^.*#include.*phy\.h.*$$//' $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \ - no-implicit-rule no-obj before-depend \ - clean "os+%DIKED-nve.h" -# hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ @@ -248,7 +237,6 @@ dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw dev/nvd/nvd.c optional nvd nvme -dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme dev/nvme/nvme_ctrlr.c optional nvme dev/nvme/nvme_ctrlr_cmd.c optional nvme Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/conf/files.i386 Sun Feb 16 12:22:43 2014 (r261975) @@ -46,17 +46,6 @@ ukbdmap.h optional ukbd_dflt_keymap \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # -nvenetlib.o optional nve pci \ - dependency "$S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu" \ - compile-with "uudecode $S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \ - no-implicit-rule -# -os+%DIKED-nve.h optional nve pci \ - dependency "$S/contrib/dev/nve/os.h" \ - compile-with "sed -e 's/^.*#include.*phy\.h.*$$//' $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \ - no-implicit-rule no-obj before-depend \ - clean "os+%DIKED-nve.h" -# hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ @@ -257,7 +246,6 @@ dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci dev/nvd/nvd.c optional nvd nvme -dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme dev/nvme/nvme_ctrlr.c optional nvme dev/nvme/nvme_ctrlr_cmd.c optional nvme Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/i386/conf/GENERIC Sun Feb 16 12:22:43 2014 (r261975) @@ -245,7 +245,6 @@ device lge # Level 1 LXT1001 gigabit E device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet -#device nve # nVidia nForce MCP on-board Ethernet Networking device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/i386/conf/NOTES Sun Feb 16 12:22:43 2014 (r261975) @@ -581,7 +581,6 @@ hint.mse.0.irq="5" # mlxen: Mellanox ConnectX HCA Ethernet # mthca: Mellanox HCA InfiniBand # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) -# nve: nVidia nForce MCP on-board Ethernet Networking # sbni: Granch SBNI12-xx ISA and PCI adapters # vmx: VMware VMXNET3 Ethernet (BSD open source) # wl: Lucent Wavelan (ISA card only). @@ -628,7 +627,6 @@ device mlx4ib # Mellanox ConnectX HCA device mlxen # Mellanox ConnectX HCA Ethernet device mthca # Mellanox HCA InfiniBand device nfe # nVidia nForce MCP on-board Ethernet -device nve # nVidia nForce MCP on-board Ethernet Networking device sbni hint.sbni.0.at="isa" hint.sbni.0.port="0x210" Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/i386/conf/PAE Sun Feb 16 12:22:43 2014 (r261975) @@ -54,7 +54,6 @@ nodevice agp nodevice txp nodevice vx -nodevice nve nodevice pcn nodevice sf nodevice sis Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/i386/conf/XEN Sun Feb 16 12:22:43 2014 (r261975) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mps mwl nve rdma sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mps mwl rdma sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/mips/conf/OCTEON1 Sun Feb 16 12:22:43 2014 (r261975) @@ -218,7 +218,6 @@ device jme # JMicron JMC250 Gigabit/JM device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nge # NatSemi DP83820 gigabit Ethernet -#device nve # nVidia nForce MCP on-board Ethernet Networking device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Feb 16 11:17:40 2014 (r261974) +++ head/sys/modules/Makefile Sun Feb 16 12:22:43 2014 (r261975) @@ -251,7 +251,6 @@ SUBDIR= \ nullfs \ ${_ntb} \ ${_nvd} \ - ${_nve} \ ${_nvme} \ ${_nvram} \ ${_nxge} \ @@ -609,9 +608,6 @@ _ixgbe= ixgbe _mly= mly _nfe= nfe _nvd= nvd -.if ${MK_SOURCELESS_HOST} != "no" -_nve= nve -.endif _nvme= nvme _nvram= nvram _nxge= nxge @@ -730,9 +726,6 @@ _ndis= ndis _nfe= nfe _ntb= ntb _nvd= nvd -.if ${MK_SOURCELESS_HOST} != "no" -_nve= nve -.endif _nvme= nvme _nvram= nvram _nxge= nxge From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 12:25:23 2014 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 ESMTPS id 770B4465; Sun, 16 Feb 2014 12:25:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62D9318EA; Sun, 16 Feb 2014 12:25:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GCPNPA012835; Sun, 16 Feb 2014 12:25:23 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GCPNWB012834; Sun, 16 Feb 2014 12:25:23 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161225.s1GCPNWB012834@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 12:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261976 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 12:25:23 -0000 Author: brueffer Date: Sun Feb 16 12:25:22 2014 New Revision: 261976 URL: http://svnweb.freebsd.org/changeset/base/261976 Log: Note the removal of nve(4). Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Feb 16 12:22:43 2014 (r261975) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun Feb 16 12:25:22 2014 (r261976) @@ -176,6 +176,11 @@ Support for Broadcom chipsets BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787 has been added to &man.bge.4;. + + The deprecated nve(4) driver has been + removed. Users of NVIDIA nForce MCP network adapters are + advised to use the &man.nfe.4; driver instead, which has been + the default driver for this hardware since &os; 7.0. From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 12:41:58 2014 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 ESMTPS id 4FEB0AF6; Sun, 16 Feb 2014 12:41:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC451A23; Sun, 16 Feb 2014 12:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GCfwjm021097; Sun, 16 Feb 2014 12:41:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GCfwA8021096; Sun, 16 Feb 2014 12:41:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402161241.s1GCfwA8021096@svn.freebsd.org> From: Dimitry Andric Date: Sun, 16 Feb 2014 12:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261977 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 12:41:58 -0000 Author: dim Date: Sun Feb 16 12:41:57 2014 New Revision: 261977 URL: http://svnweb.freebsd.org/changeset/base/261977 Log: In sys/dev/usb/controller/musb_otg.c, fix a warning about musbotg_odevd being unused, by adding it to the part that handles getting descriptors. Reviewed by: hselasky MFC after: 3 days Modified: head/sys/dev/usb/controller/musb_otg.c Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Feb 16 12:25:22 2014 (r261976) +++ head/sys/dev/usb/controller/musb_otg.c Sun Feb 16 12:41:57 2014 (r261977) @@ -3776,6 +3776,13 @@ tr_handle_get_descriptor: len = sizeof(musbotg_devd); ptr = (const void *)&musbotg_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(musbotg_odevd); + ptr = (const void *)&musbotg_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 12:43:31 2014 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 ESMTPS id 04D86C3F; Sun, 16 Feb 2014 12:43:31 +0000 (UTC) Received: from mail.jr-hosting.nl (mail.jr-hosting.nl [IPv6:2a01:4f8:141:5ffd::25]) by mx1.freebsd.org (Postfix) with ESMTP id 779961A2D; Sun, 16 Feb 2014 12:43:30 +0000 (UTC) Received: from [10.0.2.17] (a44084.upc-a.chello.nl [62.163.44.84]) by mail.jr-hosting.nl (Postfix) with ESMTPSA id 2A0CF3F49E; Sun, 16 Feb 2014 13:43:27 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_59F3AE70-6290-4F3E-A071-A03A459B3A07"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261975 - in head: release/doc/en_US.ISO8859-1/hardware release/doc/share/misc share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/contrib/dev/nve sys/dev/nve sys/i386/conf sys/mi... From: Remko Lodder In-Reply-To: <201402161222.s1GCMi6b012236@svn.freebsd.org> Date: Sun, 16 Feb 2014 13:43:26 +0100 Message-Id: <231B327E-98D0-4285-AE2E-4885B9635E1D@FreeBSD.org> References: <201402161222.s1GCMi6b012236@svn.freebsd.org> To: Christian Brueffer X-Mailer: Apple Mail (2.1827) 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 12:43:31 -0000 --Apple-Mail=_59F3AE70-6290-4F3E-A071-A03A459B3A07 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 16 Feb 2014, at 13:22, Christian Brueffer = wrote: > Author: brueffer > Date: Sun Feb 16 12:22:43 2014 > New Revision: 261975 > URL: http://svnweb.freebsd.org/changeset/base/261975 >=20 > Log: > Retire the nve(4) driver; nfe(4) has been the default driver for = NVIDIA > nForce MCP adapters for a long time. >=20 > Yays: jhb, remko, yongari > Nays: none on the current and stable lists \o/ yay! >=20 > Deleted: > head/share/man/man4/nve.4 > head/sys/contrib/dev/nve/ > head/sys/dev/nve/ > head/sys/modules/nve/ > Modified: > head/release/doc/en_US.ISO8859-1/hardware/article.xml > head/release/doc/share/misc/dev.archlist.txt > head/share/man/man4/Makefile > head/share/man/man4/altq.4 > head/share/man/man4/miibus.4 > head/share/man/man4/vlan.4 > head/sys/amd64/conf/GENERIC > head/sys/amd64/conf/NOTES > head/sys/boot/forth/loader.conf > head/sys/conf/WITHOUT_SOURCELESS_HOST > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/i386/conf/GENERIC > head/sys/i386/conf/NOTES > head/sys/i386/conf/PAE > head/sys/i386/conf/XEN > head/sys/mips/conf/OCTEON1 > head/sys/modules/Makefile >=20 > Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Feb = 16 11:17:40 2014 (r261974) > +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Feb = 16 12:22:43 2014 (r261975) > @@ -883,8 +883,6 @@ >=20 > &hwlist.nge; >=20 > - &hwlist.nve; > - > &hwlist.nxge; >=20 > &hwlist.oce; >=20 > Modified: head/release/doc/share/misc/dev.archlist.txt > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/doc/share/misc/dev.archlist.txt Sun Feb 16 = 11:17:40 2014 (r261974) > +++ head/release/doc/share/misc/dev.archlist.txt Sun Feb 16 = 12:22:43 2014 (r261975) > @@ -97,7 +97,6 @@ nfe i386,amd64 > ng_bt3c i386,pc98,amd64 > ng_ubt i386,pc98,amd64 > nsp i386,pc98 > -nve i386,amd64 > nxge i386,amd64 > oce i386,amd64 > ohci i386,pc98,ia64,amd64,powerpc >=20 > Modified: head/share/man/man4/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man4/Makefile Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/share/man/man4/Makefile Sun Feb 16 12:22:43 2014 = (r261975) > @@ -344,7 +344,6 @@ MAN=3D aac.4 \ > ${_ntb.4} \ > null.4 \ > ${_nvd.4} \ > - ${_nve.4} \ > ${_nvme.4} \ > ${_nvram.4} \ > ${_nvram2env.4} \ > @@ -673,7 +672,6 @@ MLINKS+=3D${_nfe.4} ${_if_nfe.4} > MLINKS+=3Dnge.4 if_nge.4 > MLINKS+=3D${_ntb.4} ${_if_ntb.4} \ > ${_ntb.4} ${_ntb_hw.4} > -MLINKS+=3D${_nve.4} ${_if_nve.4} > MLINKS+=3D${_nxge.4} ${_if_nxge.4} > MLINKS+=3Dpatm.4 if_patm.4 > MLINKS+=3Dpccbb.4 cbb.4 > @@ -772,7 +770,6 @@ _ichwd.4=3D ichwd.4 > _if_bxe.4=3D if_bxe.4 > _if_ndis.4=3D if_ndis.4 > _if_nfe.4=3D if_nfe.4 > -_if_nve.4=3D if_nve.4 > _if_nxge.4=3D if_nxge.4 > _if_urtw.4=3D if_urtw.4 > _if_vmx.4=3D if_vmx.4 > @@ -787,7 +784,6 @@ _ndis.4=3D ndis.4 > _nfe.4=3D nfe.4 > _nfsmb.4=3D nfsmb.4 > _nvd.4=3D nvd.4 > -_nve.4=3D nve.4 > _nvme.4=3D nvme.4 > _nvram.4=3D nvram.4 > _nxge.4=3D nxge.4 >=20 > Modified: head/share/man/man4/altq.4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man4/altq.4 Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/share/man/man4/altq.4 Sun Feb 16 12:22:43 2014 = (r261975) > @@ -151,7 +151,6 @@ They have been applied to the following=20 > .Xr nfe 4 , > .Xr nge 4 , > .Xr npe 4 , > -.Xr nve 4 , > .Xr qlxgb 4 , > .Xr ral 4 , > .Xr re 4 , >=20 > Modified: head/share/man/man4/miibus.4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man4/miibus.4 Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/share/man/man4/miibus.4 Sun Feb 16 12:22:43 2014 = (r261975) > @@ -87,8 +87,6 @@ Marvell/SysKonnect Yukon II Gigabit Ethe > NVIDIA nForce MCP Networking Adapter > .It Xr nge 4 > National Semiconductor DP83820/DP83821 Gigabit Ethernet > -.It Xr nve 4 > -NVIDIA nForce MCP Networking Adapter > .It Xr pcn 4 > AMD Am79C97x PCI 10/100 > .It Xr re 4 > @@ -159,7 +157,6 @@ but as a result are not well behaved new > .Xr netintro 4 , > .Xr nfe 4 , > .Xr nge 4 , > -.Xr nve 4 , > .Xr pcn 4 , > .Xr re 4 , > .Xr rgephy 4 , >=20 > Modified: head/share/man/man4/vlan.4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man4/vlan.4 Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/share/man/man4/vlan.4 Sun Feb 16 12:22:43 2014 = (r261975) > @@ -176,7 +176,6 @@ These interfaces natively support long f > .Xr hme 4 , > .Xr le 4 , > .Xr nfe 4 , > -.Xr nve 4 , > .Xr rl 4 , > .Xr sf 4 , > .Xr sis 4 , >=20 > Modified: head/sys/amd64/conf/GENERIC > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/amd64/conf/GENERIC Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/amd64/conf/GENERIC Sun Feb 16 12:22:43 2014 = (r261975) > @@ -235,7 +235,6 @@ device lge # Level 1 = LXT1001 gigabit E > device msk # Marvell/SysKonnect Yukon II = Gigabit Ethernet > device nfe # nVidia nForce MCP on-board = Ethernet > device nge # NatSemi DP83820 gigabit = Ethernet > -#device nve # nVidia nForce MCP on-board = Ethernet Networking > device pcn # AMD Am79C97x PCI 10/100 = (precedence over 'le') > device re # RealTek = 8139C+/8169/8169S/8110S > device rl # RealTek 8129/8139 >=20 > Modified: head/sys/amd64/conf/NOTES > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/amd64/conf/NOTES Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/amd64/conf/NOTES Sun Feb 16 12:22:43 2014 = (r261975) > @@ -309,7 +309,6 @@ options DRM_DEBUG # Include debug print > # mlxen: Mellanox ConnectX HCA Ethernet > # mthca: Mellanox HCA InfiniBand > # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open = source) > -# nve: nVidia nForce MCP on-board Ethernet Networking > # sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters > # vmx: VMware VMXNET3 Ethernet (BSD open source) > # wpi: Intel 3945ABG Wireless LAN controller > @@ -327,7 +326,6 @@ device mlx4ib # Mellanox ConnectX HCA > device mlxen # Mellanox ConnectX HCA Ethernet > device mthca # Mellanox HCA InfiniBand > device nfe # nVidia nForce MCP on-board = Ethernet > -device nve # nVidia nForce MCP on-board = Ethernet Networking > device sfxge # Solarflare SFC9000 10Gb = Ethernet > device vmx # VMware VMXNET3 Ethernet > device wpi # Intel 3945ABG wireless NICs. >=20 > Modified: head/sys/boot/forth/loader.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/forth/loader.conf Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/boot/forth/loader.conf Sun Feb 16 12:22:43 2014 = (r261975) > @@ -327,7 +327,6 @@ if_mxge_load=3D"NO" # Myricom = Myri10GE 10 > if_my_load=3D"NO" # Myson PCI Fast Ethernet > if_nfe_load=3D"NO" # NVIDIA nForce MCP Networking Adapter > if_nge_load=3D"NO" # National Semiconductor PCI Gigabit = Ethernet > -if_nve_load=3D"NO" # NVIDIA nForce MCP Networking Adapter > if_nxge_load=3D"NO" # Neterion Xframe 10Gb Ethernet > if_patm_load=3D"NO" # IDT77252 ATM > if_pcn_load=3D"NO" # AMD PCnet PCI >=20 > Modified: head/sys/conf/WITHOUT_SOURCELESS_HOST > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 16 12:22:43 2014 = (r261975) > @@ -8,4 +8,3 @@ nodevice hpt27xx > nodevice hptmv > nodevice hptnr > nodevice hptrr > -nodevice nve >=20 > Modified: head/sys/conf/files.amd64 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/files.amd64 Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/conf/files.amd64 Sun Feb 16 12:22:43 2014 = (r261975) > @@ -47,17 +47,6 @@ ukbdmap.h optional = ukbd_dflt_keymap \ > no-obj no-implicit-rule before-depend = \ > clean "ukbdmap.h" > # > -nvenetlib.o optional nve pci = \ > - dependency "$S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu" = \ > - compile-with "uudecode = $S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" = \ > - no-implicit-rule > -# > -os+%DIKED-nve.h optional nve pci = \ > - dependency "$S/contrib/dev/nve/os.h" = \ > - compile-with "sed -e 's/^.*#include.*phy\.h.*$$//' = $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \ > - no-implicit-rule no-obj before-depend = \ > - clean "os+%DIKED-nve.h" > -# > hpt27xx_lib.o optional hpt27xx = \ > dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" = \ > compile-with "uudecode < = $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ > @@ -248,7 +237,6 @@ dev/nfe/if_nfe.c optional nfe pci > dev/ntb/if_ntb/if_ntb.c optional if_ntb > dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw > dev/nvd/nvd.c optional nvd nvme > -dev/nve/if_nve.c optional nve pci > dev/nvme/nvme.c optional nvme > dev/nvme/nvme_ctrlr.c optional nvme > dev/nvme/nvme_ctrlr_cmd.c optional nvme >=20 > Modified: head/sys/conf/files.i386 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/files.i386 Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/conf/files.i386 Sun Feb 16 12:22:43 2014 = (r261975) > @@ -46,17 +46,6 @@ ukbdmap.h optional = ukbd_dflt_keymap \ > no-obj no-implicit-rule before-depend = \ > clean "ukbdmap.h" > # > -nvenetlib.o optional nve pci = \ > - dependency "$S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu" = \ > - compile-with "uudecode = $S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" = \ > - no-implicit-rule > -# > -os+%DIKED-nve.h optional nve pci = \ > - dependency "$S/contrib/dev/nve/os.h" = \ > - compile-with "sed -e 's/^.*#include.*phy\.h.*$$//' = $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \ > - no-implicit-rule no-obj before-depend = \ > - clean "os+%DIKED-nve.h" > -# > hpt27xx_lib.o optional hpt27xx = \ > dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" = \ > compile-with "uudecode < = $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ > @@ -257,7 +246,6 @@ dev/mse/mse.c optional mse > dev/mse/mse_isa.c optional mse isa > dev/nfe/if_nfe.c optional nfe pci > dev/nvd/nvd.c optional nvd nvme > -dev/nve/if_nve.c optional nve pci > dev/nvme/nvme.c optional nvme > dev/nvme/nvme_ctrlr.c optional nvme > dev/nvme/nvme_ctrlr_cmd.c optional nvme >=20 > Modified: head/sys/i386/conf/GENERIC > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/i386/conf/GENERIC Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/i386/conf/GENERIC Sun Feb 16 12:22:43 2014 = (r261975) > @@ -245,7 +245,6 @@ device lge # Level 1 = LXT1001 gigabit E > device msk # Marvell/SysKonnect Yukon II = Gigabit Ethernet > device nfe # nVidia nForce MCP on-board = Ethernet > device nge # NatSemi DP83820 gigabit = Ethernet > -#device nve # nVidia nForce MCP on-board = Ethernet Networking > device pcn # AMD Am79C97x PCI 10/100 = (precedence over 'le') > device re # RealTek = 8139C+/8169/8169S/8110S > device rl # RealTek 8129/8139 >=20 > Modified: head/sys/i386/conf/NOTES > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/i386/conf/NOTES Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/i386/conf/NOTES Sun Feb 16 12:22:43 2014 = (r261975) > @@ -581,7 +581,6 @@ hint.mse.0.irq=3D"5" > # mlxen: Mellanox ConnectX HCA Ethernet > # mthca: Mellanox HCA InfiniBand > # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open = source) > -# nve: nVidia nForce MCP on-board Ethernet Networking > # sbni: Granch SBNI12-xx ISA and PCI adapters > # vmx: VMware VMXNET3 Ethernet (BSD open source) > # wl: Lucent Wavelan (ISA card only). > @@ -628,7 +627,6 @@ device mlx4ib # Mellanox ConnectX HCA > device mlxen # Mellanox ConnectX HCA Ethernet > device mthca # Mellanox HCA InfiniBand > device nfe # nVidia nForce MCP on-board = Ethernet > -device nve # nVidia nForce MCP on-board = Ethernet Networking > device sbni > hint.sbni.0.at=3D"isa" > hint.sbni.0.port=3D"0x210" >=20 > Modified: head/sys/i386/conf/PAE > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/i386/conf/PAE Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/i386/conf/PAE Sun Feb 16 12:22:43 2014 = (r261975) > @@ -54,7 +54,6 @@ nodevice agp > nodevice txp > nodevice vx >=20 > -nodevice nve > nodevice pcn > nodevice sf > nodevice sis >=20 > Modified: head/sys/i386/conf/XEN > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/i386/conf/XEN Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/i386/conf/XEN Sun Feb 16 12:22:43 2014 = (r261975) > @@ -7,7 +7,7 @@ cpu I686_CPU > ident XEN >=20 > makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug = symbols > -makeoptions WITHOUT_MODULES=3D"aha ahb amd ctl cxgb dpt drm drm2 = hptnr hptmv ida malo mps mwl nve rdma sound sym trm xfs" > +makeoptions WITHOUT_MODULES=3D"aha ahb amd ctl cxgb dpt drm drm2 = hptnr hptmv ida malo mps mwl rdma sound sym trm xfs" >=20 > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread = preemption >=20 > Modified: head/sys/mips/conf/OCTEON1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/mips/conf/OCTEON1 Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/mips/conf/OCTEON1 Sun Feb 16 12:22:43 2014 = (r261975) > @@ -218,7 +218,6 @@ device jme # JMicron JMC250 = Gigabit/JM > device lge # Level 1 LXT1001 gigabit = Ethernet > device msk # Marvell/SysKonnect Yukon II = Gigabit Ethernet > device nge # NatSemi DP83820 gigabit = Ethernet > -#device nve # nVidia nForce MCP on-board = Ethernet Networking > device pcn # AMD Am79C97x PCI 10/100 = (precedence over 'le') > device re # RealTek = 8139C+/8169/8169S/8110S > device rl # RealTek 8129/8139 >=20 > Modified: head/sys/modules/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/modules/Makefile Sun Feb 16 11:17:40 2014 = (r261974) > +++ head/sys/modules/Makefile Sun Feb 16 12:22:43 2014 = (r261975) > @@ -251,7 +251,6 @@ SUBDIR=3D \ > nullfs \ > ${_ntb} \ > ${_nvd} \ > - ${_nve} \ > ${_nvme} \ > ${_nvram} \ > ${_nxge} \ > @@ -609,9 +608,6 @@ _ixgbe=3D ixgbe > _mly=3D mly > _nfe=3D nfe > _nvd=3D nvd > -.if ${MK_SOURCELESS_HOST} !=3D "no" > -_nve=3D nve > -.endif > _nvme=3D nvme > _nvram=3D nvram > _nxge=3D nxge > @@ -730,9 +726,6 @@ _ndis=3D ndis > _nfe=3D nfe > _ntb=3D ntb > _nvd=3D nvd > -.if ${MK_SOURCELESS_HOST} !=3D "no" > -_nve=3D nve > -.endif > _nvme=3D nvme > _nvram=3D nvram > _nxge=3D nxge --=20 /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News --Apple-Mail=_59F3AE70-6290-4F3E-A071-A03A459B3A07 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJTALJuAAoJEKjD27JZ84ywQGkQAIodO0Nxo61U3WA2eJdvprzd mpR+MWiQ1i8cowyZ/D5PYk+bc0hoxtTbD1evk94rjKSioOsWS2rF9wEJWB/cucv9 4aaJGv4XMwGFTzr9hCvTRlJ6M+WvyOMG4n0FPwyXtdFM7ZixjCfElgoIJAKQ72Ld gziNm1nDlfueQ72xMpXNKJ5x1sK69/f+8uO6OyZJeCbhRVXPsYh2gbhB81Vk9Lym c3D35nyeva0/AwO2n6B54EM8MSRaWrzn81z9OfFHRpDOGnBRxQp0L0GgCCxKw3uV RX3nqpnKFcKCxhGJ+cAiI2pvFD6OXv+Qj7fK3MsMjY0dUlKcGzdZdRzbCVpUyOZX h9sAJuQSKVTbJYe9VQ//JQYWBFW8qM6pD7IUTmDUFTZbPoAm7PzROPSQ2pDI/kzn f1ovQJkOGfUpw9YvHY/NKH4LydPzZvASsmdl5npvS0Kxx87QmPH4U9tdgQs2OXuO xc97Srzs7oXBCd1q2pdTRIsyAHJPQwhCCYIjhLDIiV9XPfHmdsz8ofZkpN8c3Oy0 vyFoMoDZCejkWYVsHVB/XqpLGPkwlC0AFGw9iH93rHJtSV4NYD9uBlKCJPtpHoOv BhbkTlZbvduyWu3NRr77aFGJVZsHgHaO0qRERgEDYr/EWws0JTZDAKytRgIeC5aN HT8ADC3VHUrGQ3cqykMP =XpJu -----END PGP SIGNATURE----- --Apple-Mail=_59F3AE70-6290-4F3E-A071-A03A459B3A07-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 12:56:05 2014 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 ESMTPS id D4E18ECE; Sun, 16 Feb 2014 12:56:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDA1A1ABD; Sun, 16 Feb 2014 12:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GCu5wr025347; Sun, 16 Feb 2014 12:56:05 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GCu5r5025346; Sun, 16 Feb 2014 12:56:05 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201402161256.s1GCu5r5025346@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Feb 2014 12:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261978 - head/tests 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 12:56:05 -0000 Author: jmmv Date: Sun Feb 16 12:56:05 2014 New Revision: 261978 URL: http://svnweb.freebsd.org/changeset/base/261978 Log: Use DESTDIR for the installation of the /usr/tests/local symlink. MFC after: 5 days Modified: head/tests/Makefile Modified: head/tests/Makefile ============================================================================== --- head/tests/Makefile Sun Feb 16 12:41:57 2014 (r261977) +++ head/tests/Makefile Sun Feb 16 12:56:05 2014 (r261978) @@ -9,6 +9,6 @@ KYUAFILE= yes afterinstall: install-tests-local install-tests-local: .PHONY - ${INSTALL_SYMLINK} ../local/tests ${TESTSDIR}/local + ${INSTALL_SYMLINK} ../local/tests ${DESTDIR}${TESTSDIR}/local .include From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 14:35:20 2014 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 ESMTPS id 1A799751; Sun, 16 Feb 2014 14:35:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 066EA1297; Sun, 16 Feb 2014 14:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GEZJIm069149; Sun, 16 Feb 2014 14:35:19 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GEZJuA069148; Sun, 16 Feb 2014 14:35:19 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161435.s1GEZJuA069148@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 14:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261980 - head/sys/i386/xbox 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 14:35:20 -0000 Author: brueffer Date: Sun Feb 16 14:35:19 2014 New Revision: 261980 URL: http://svnweb.freebsd.org/changeset/base/261980 Log: Remove an nve(4)-specific workaround from the xbox port. nfe(4) doesn't need it. Reviewed by: ed Modified: head/sys/i386/xbox/xbox.c Modified: head/sys/i386/xbox/xbox.c ============================================================================== --- head/sys/i386/xbox/xbox.c Sun Feb 16 13:42:49 2014 (r261979) +++ head/sys/i386/xbox/xbox.c Sun Feb 16 14:35:19 2014 (r261980) @@ -59,27 +59,6 @@ xbox_init(void) /* register our poweroff function */ EVENTHANDLER_REGISTER (shutdown_final, xbox_poweroff, NULL, SHUTDOWN_PRI_LAST); - - /* - * Some XBOX loaders, such as Cromwell, have a flaw which cause the - * nve(4) driver to fail attaching to the NIC. - * - * This is because they leave the NIC running; this will cause the - * Nvidia driver to fail as the NIC does not return any sensible - * values and thus fails attaching (using an error 0x5, this means - * it cannot find a valid PHY) - * - * We bluntly tell the NIC to stop whatever it's doing; this makes - * nve(4) attach correctly. As the NIC always resides at - * 0xfef00000-0xfef003ff on an XBOX, we simply hardcode this address. - */ - ptr = pmap_mapdev (0xfef00000, 0x400); - *(uint32_t*)(ptr + 0x188) = 0; /* clear adapter control field */ - pmap_unmapdev ((vm_offset_t)ptr, 0x400); } -/* - * This must be called before the drivers, as the if_nve(4) driver will fail - * if we do not do this in advance. - */ SYSINIT(xbox, SI_SUB_DRIVERS, SI_ORDER_FIRST, xbox_init, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 14:37:23 2014 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 ESMTPS id EF10BA5C; Sun, 16 Feb 2014 14:37:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB8FE12C6; Sun, 16 Feb 2014 14:37:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GEbNpv069541; Sun, 16 Feb 2014 14:37:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GEbNkd069540; Sun, 16 Feb 2014 14:37:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402161437.s1GEbNkd069540@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 16 Feb 2014 14:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261981 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 14:37:24 -0000 Author: hselasky Date: Sun Feb 16 14:37:23 2014 New Revision: 261981 URL: http://svnweb.freebsd.org/changeset/base/261981 Log: Add new PCI ID for hardware which needs port routing for USB 3.0. PR: usb/186811 MFC after: 1 week Submitted by: Philipp Maechler Modified: head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Sun Feb 16 14:35:19 2014 (r261980) +++ head/sys/dev/usb/controller/xhci_pci.c Sun Feb 16 14:37:23 2014 (r261981) @@ -102,6 +102,7 @@ xhci_pci_match(device_t self) case 0x10421b21: return ("ASMedia ASM1042 USB 3.0 controller"); + case 0x9c318086: case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: @@ -237,6 +238,7 @@ xhci_pci_attach(device_t self) /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ switch (pci_get_devid(self)) { + case 0x9c318086: /* Panther Point */ case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ sc->sc_port_route = &xhci_pci_port_route; From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 16:49:55 2014 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 ESMTPS id 932DBD51; Sun, 16 Feb 2014 16:49:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D63D1BE2; Sun, 16 Feb 2014 16:49:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GGntk5029266; Sun, 16 Feb 2014 16:49:55 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GGntOo029263; Sun, 16 Feb 2014 16:49:55 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402161649.s1GGntOo029263@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 16 Feb 2014 16:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261982 - in head/sys: arm/freescale/vybrid boot/fdt/dts 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 16:49:55 -0000 Author: br Date: Sun Feb 16 16:49:54 2014 New Revision: 261982 URL: http://svnweb.freebsd.org/changeset/base/261982 Log: Add driver for Synchronous Audio Interface (SAI). SAI supports full-duplex serial interfaces with frame synchronization such as I2S, AC97, TDM, and codec/DSP interfaces. Added: head/sys/arm/freescale/vybrid/vf_sai.c (contents, props changed) Modified: head/sys/arm/freescale/vybrid/files.vybrid head/sys/boot/fdt/dts/vybrid.dtsi Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Sun Feb 16 14:37:23 2014 (r261981) +++ head/sys/arm/freescale/vybrid/files.vybrid Sun Feb 16 16:49:54 2014 (r261982) @@ -29,4 +29,5 @@ arm/freescale/vybrid/vf_nfc.c optional arm/freescale/vybrid/vf_ehci.c optional ehci arm/freescale/vybrid/vf_gpio.c optional gpio arm/freescale/vybrid/vf_uart.c optional uart +arm/freescale/vybrid/vf_sai.c optional sound dev/ffec/if_ffec.c optional ffec Added: head/sys/arm/freescale/vybrid/vf_sai.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_sai.c Sun Feb 16 16:49:54 2014 (r261982) @@ -0,0 +1,802 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * 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. + */ + +/* + * Vybrid Family Synchronous Audio Interface (SAI) + * Chapter 51, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#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 + +#define I2S_TCSR 0x00 /* SAI Transmit Control */ +#define I2S_TCR1 0x04 /* SAI Transmit Configuration 1 */ +#define I2S_TCR2 0x08 /* SAI Transmit Configuration 2 */ +#define I2S_TCR3 0x0C /* SAI Transmit Configuration 3 */ +#define I2S_TCR4 0x10 /* SAI Transmit Configuration 4 */ +#define I2S_TCR5 0x14 /* SAI Transmit Configuration 5 */ +#define I2S_TDR0 0x20 /* SAI Transmit Data */ +#define I2S_TFR0 0x40 /* SAI Transmit FIFO */ +#define I2S_TMR 0x60 /* SAI Transmit Mask */ +#define I2S_RCSR 0x80 /* SAI Receive Control */ +#define I2S_RCR1 0x84 /* SAI Receive Configuration 1 */ +#define I2S_RCR2 0x88 /* SAI Receive Configuration 2 */ +#define I2S_RCR3 0x8C /* SAI Receive Configuration 3 */ +#define I2S_RCR4 0x90 /* SAI Receive Configuration 4 */ +#define I2S_RCR5 0x94 /* SAI Receive Configuration 5 */ +#define I2S_RDR0 0xA0 /* SAI Receive Data */ +#define I2S_RFR0 0xC0 /* SAI Receive FIFO */ +#define I2S_RMR 0xE0 /* SAI Receive Mask */ + +#define TCR1_TFW_M 0x1f /* Transmit FIFO Watermark Mask */ +#define TCR1_TFW_S 0 /* Transmit FIFO Watermark Shift */ +#define TCR2_MSEL_M 0x3 /* MCLK Select Mask*/ +#define TCR2_MSEL_S 26 /* MCLK Select Shift*/ +#define TCR2_BCP (1 << 25) /* Bit Clock Polarity */ +#define TCR2_BCD (1 << 24) /* Bit Clock Direction */ +#define TCR3_TCE (1 << 16) /* Transmit Channel Enable */ +#define TCR4_FRSZ_M 0x1f /* Frame size Mask */ +#define TCR4_FRSZ_S 16 /* Frame size Shift */ +#define TCR4_SYWD_M 0x1f /* Sync Width Mask */ +#define TCR4_SYWD_S 8 /* Sync Width Shift */ +#define TCR4_MF (1 << 4) /* MSB First */ +#define TCR4_FSE (1 << 3) /* Frame Sync Early */ +#define TCR4_FSP (1 << 1) /* Frame Sync Polarity Low */ +#define TCR4_FSD (1 << 0) /* Frame Sync Direction Master */ +#define TCR5_FBT_M 0x1f /* First Bit Shifted */ +#define TCR5_FBT_S 8 /* First Bit Shifted */ +#define TCR5_W0W_M 0x1f /* Word 0 Width */ +#define TCR5_W0W_S 16 /* Word 0 Width */ +#define TCR5_WNW_M 0x1f /* Word N Width */ +#define TCR5_WNW_S 24 /* Word N Width */ +#define TCSR_TE (1 << 31) /* Transmitter Enable */ +#define TCSR_BCE (1 << 28) /* Bit Clock Enable */ +#define TCSR_FRDE (1 << 0) /* FIFO Request DMA Enable */ + +#define SAI_NCHANNELS 1 + +static MALLOC_DEFINE(M_SAI, "sai", "sai audio"); + +struct sai_rate { + uint32_t speed; + uint32_t div; /* Bit Clock Divide. Division value is (div + 1) * 2. */ + uint32_t mfi; /* PLL4 Multiplication Factor Integer */ + uint32_t mfn; /* PLL4 Multiplication Factor Numerator */ + uint32_t mfd; /* PLL4 Multiplication Factor Denominator */ +}; + +/* + * Bit clock divider formula + * (div + 1) * 2 = MCLK/(nch * LRCLK * bits/1000000), + * where: + * MCLK - master clock + * nch - number of channels + * LRCLK - left right clock + * e.g. (div + 1) * 2 = 16.9344/(2 * 44100 * 24/1000000) + * + * Example for 96khz, 24bit, 18.432 Mhz mclk (192fs) + * { 96000, 1, 18, 40176000, 93000000 }, + */ + +static struct sai_rate rate_map[] = { + { 44100, 7, 33, 80798400, 93000000 }, /* 33.8688 Mhz */ + { 96000, 3, 36, 80352000, 93000000 }, /* 36.864 Mhz */ + { 192000, 1, 36, 80352000, 93000000 }, /* 36.864 Mhz */ + { 0, 0 }, +}; + +struct sc_info { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + device_t dev; + struct mtx *lock; + uint32_t speed; + uint32_t period; + void *ih; + int pos; + int dma_size; + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + bus_addr_t buf_base_phys; + uint32_t *buf_base; + struct tcd_conf *tcd; + struct sai_rate *sr; + struct edma_softc *edma_sc; + int edma_chnum; +}; + +/* Channel registers */ +struct sc_chinfo { + struct snd_dbuf *buffer; + struct pcm_channel *channel; + struct sc_pcminfo *parent; + + /* Channel information */ + uint32_t dir; + uint32_t format; + + /* Flags */ + uint32_t run; +}; + +/* PCM device private data */ +struct sc_pcminfo { + device_t dev; + uint32_t (*ih) (struct sc_pcminfo *scp); + uint32_t chnum; + struct sc_chinfo chan[SAI_NCHANNELS]; + struct sc_info *sc; +}; + +static struct resource_spec sai_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int setup_dma(struct sc_pcminfo *scp); +static void setup_sai(struct sc_info *); +static void sai_configure_clock(struct sc_info *); + +/* + * Mixer interface. + */ + +static int +saimixer_init(struct snd_mixer *m) +{ + struct sc_pcminfo *scp; + struct sc_info *sc; + int mask; + + scp = mix_getdevinfo(m); + sc = scp->sc; + + if (sc == NULL) + return -1; + + mask = SOUND_MASK_PCM; + + snd_mtxlock(sc->lock); + pcm_setflags(scp->dev, pcm_getflags(scp->dev) | SD_F_SOFTPCMVOL); + mix_setdevs(m, mask); + snd_mtxunlock(sc->lock); + + return (0); +} + +static int +saimixer_set(struct snd_mixer *m, unsigned dev, + unsigned left, unsigned right) +{ + struct sc_pcminfo *scp; + + scp = mix_getdevinfo(m); + +#if 0 + device_printf(scp->dev, "saimixer_set() %d %d\n", + left, right); +#endif + + return (0); +} + +static kobj_method_t saimixer_methods[] = { + KOBJMETHOD(mixer_init, saimixer_init), + KOBJMETHOD(mixer_set, saimixer_set), + KOBJMETHOD_END +}; +MIXER_DECLARE(saimixer); + +/* + * Channel interface. + */ + +static void * +saichan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, + struct pcm_channel *c, int dir) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + + scp = (struct sc_pcminfo *)devinfo; + sc = scp->sc; + + snd_mtxlock(sc->lock); + ch = &scp->chan[0]; + ch->dir = dir; + ch->run = 0; + ch->buffer = b; + ch->channel = c; + ch->parent = scp; + snd_mtxunlock(sc->lock); + + if (sndbuf_setup(ch->buffer, sc->buf_base, sc->dma_size) != 0) { + device_printf(scp->dev, "Can't setup sndbuf.\n"); + return NULL; + } + + return ch; +} + +static int +saichan_free(kobj_t obj, void *data) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + +#if 0 + device_printf(scp->dev, "saichan_free()\n"); +#endif + + snd_mtxlock(sc->lock); + /* TODO: free channel buffer */ + snd_mtxunlock(sc->lock); + + return (0); +} + +static int +saichan_setformat(kobj_t obj, void *data, uint32_t format) +{ + struct sc_chinfo *ch = data; + + ch->format = format; + + return (0); +} + +static uint32_t +saichan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sai_rate *sr; + struct sc_info *sc; + int threshold; + int i; + + ch = data; + scp = ch->parent; + sc = scp->sc; + + sr = NULL; + + /* First look for equal frequency. */ + for (i = 0; rate_map[i].speed != 0; i++) { + if (rate_map[i].speed == speed) + sr = &rate_map[i]; + } + + /* If no match, just find nearest. */ + if (sr == NULL) { + for (i = 0; rate_map[i].speed != 0; i++) { + sr = &rate_map[i]; + threshold = sr->speed + ((rate_map[i + 1].speed != 0) ? + ((rate_map[i + 1].speed - sr->speed) >> 1) : 0); + if (speed < threshold) + break; + } + } + + sc->sr = sr; + + sai_configure_clock(sc); + + return (sr->speed); +} + +static void +sai_configure_clock(struct sc_info *sc) +{ + struct sai_rate *sr; + int reg; + + sr = sc->sr; + + /* + * Manual says that TCR/RCR registers must not be + * altered when TCSR[TE] is set. + * We ignore it since we have problem sometimes + * after re-enabling transmitter (DMA goes stall). + */ + + reg = READ4(sc, I2S_TCR2); + reg &= ~(0xff << 0); + reg |= (sr->div << 0); + WRITE4(sc, I2S_TCR2, reg); + + pll4_configure_output(sr->mfi, sr->mfn, sr->mfd); +} + +static uint32_t +saichan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + + sndbuf_resize(ch->buffer, sc->dma_size / blocksize, blocksize); + + sc->period = sndbuf_getblksz(ch->buffer); + return (sc->period); +} + +uint32_t sai_dma_intr(void *arg, int chn); +uint32_t +sai_dma_intr(void *arg, int chn) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + struct tcd_conf *tcd; + + scp = arg; + ch = &scp->chan[0]; + + sc = scp->sc; + tcd = sc->tcd; + + sc->pos += (tcd->nbytes * tcd->nmajor); + if (sc->pos >= sc->dma_size) + sc->pos -= sc->dma_size; + + chn_intr(ch->channel); + + return (0); +} + +static int +find_edma_controller(struct sc_info *sc) +{ + struct edma_softc *edma_sc; + phandle_t node, edma_node; + int edma_src_transmit; + int edma_mux_group; + int edma_device_id; + device_t edma_dev; + int dts_value; + int len; + int i; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if ((len = OF_getproplen(node, "edma-controller")) <= 0) + return (ENXIO); + if ((len = OF_getproplen(node, "edma-src-transmit")) <= 0) + return (ENXIO); + if ((len = OF_getproplen(node, "edma-mux-group")) <= 0) + return (ENXIO); + + OF_getprop(node, "edma-src-transmit", &dts_value, len); + edma_src_transmit = fdt32_to_cpu(dts_value); + OF_getprop(node, "edma-mux-group", &dts_value, len); + edma_mux_group = fdt32_to_cpu(dts_value); + OF_getprop(node, "edma-controller", &dts_value, len); + edma_node = OF_xref_phandle(fdt32_to_cpu(dts_value)); + + if ((len = OF_getproplen(edma_node, "device-id")) <= 0) { + return (ENXIO); + }; + + OF_getprop(edma_node, "device-id", &dts_value, len); + edma_device_id = fdt32_to_cpu(dts_value); + + edma_sc = NULL; + + for (i = 0; i < EDMA_NUM_DEVICES; i++) { + edma_dev = devclass_get_device(devclass_find("edma"), i); + if (edma_dev) { + edma_sc = device_get_softc(edma_dev); + if (edma_sc->device_id == edma_device_id) { + /* found */ + break; + }; + + edma_sc = NULL; + }; + }; + + if (edma_sc == NULL) { + device_printf(sc->dev, "no eDMA. can't operate\n"); + return (ENXIO); + }; + + sc->edma_sc = edma_sc; + + sc->edma_chnum = edma_sc->channel_configure(edma_sc, edma_mux_group, + edma_src_transmit); + if (sc->edma_chnum < 0) { + /* cant setup eDMA */ + return (ENXIO); + }; + + return (0); +}; + +static int +setup_dma(struct sc_pcminfo *scp) +{ + struct tcd_conf *tcd; + struct sc_info *sc; + + sc = scp->sc; + + tcd = malloc(sizeof(struct tcd_conf), M_DEVBUF, M_WAITOK | M_ZERO); + tcd->channel = sc->edma_chnum; + tcd->ih = sai_dma_intr; + tcd->ih_user = scp; + tcd->saddr = sc->buf_base_phys; + tcd->daddr = rman_get_start(sc->res[0]) + I2S_TDR0; + + /* + * Bytes to transfer per each minor loop. + * Hardware FIFO buffer size is 32x32bits. + */ + tcd->nbytes = 64; + + tcd->nmajor = 512; + tcd->smod = 18; /* dma_size range */ + tcd->dmod = 0; + tcd->esg = 0; + tcd->soff = 0x4; + tcd->doff = 0; + tcd->ssize = 0x2; + tcd->dsize = 0x2; + tcd->slast = 0; + tcd->dlast_sga = 0; + + sc->tcd = tcd; + + sc->edma_sc->dma_setup(sc->edma_sc, sc->tcd); + + return (0); +} + +static int +saichan_trigger(kobj_t obj, void *data, int go) +{ + struct sc_chinfo *ch = data; + struct sc_pcminfo *scp = ch->parent; + struct sc_info *sc = scp->sc; + + snd_mtxlock(sc->lock); + + switch (go) { + case PCMTRIG_START: +#if 0 + device_printf(scp->dev, "trigger start\n"); +#endif + break; + + case PCMTRIG_STOP: + case PCMTRIG_ABORT: +#if 0 + device_printf(scp->dev, "trigger stop or abort\n"); +#endif + break; + } + + snd_mtxunlock(sc->lock); + + return (0); +} + +static uint32_t +saichan_getptr(kobj_t obj, void *data) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + + ch = data; + scp = ch->parent; + sc = scp->sc; + + return (sc->pos); +} + +static uint32_t sai_pfmt[] = { + /* + * eDMA doesn't allow 24-bit coping, + * so we use 32. + */ + SND_FORMAT(AFMT_S32_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps sai_pcaps = {44100, 192000, sai_pfmt, 0}; + +static struct pcmchan_caps * +saichan_getcaps(kobj_t obj, void *data) +{ + + return (&sai_pcaps); +} + +static kobj_method_t saichan_methods[] = { + KOBJMETHOD(channel_init, saichan_init), + KOBJMETHOD(channel_free, saichan_free), + KOBJMETHOD(channel_setformat, saichan_setformat), + KOBJMETHOD(channel_setspeed, saichan_setspeed), + KOBJMETHOD(channel_setblocksize, saichan_setblocksize), + KOBJMETHOD(channel_trigger, saichan_trigger), + KOBJMETHOD(channel_getptr, saichan_getptr), + KOBJMETHOD(channel_getcaps, saichan_getcaps), + KOBJMETHOD_END +}; +CHANNEL_DECLARE(saichan); + +static int +sai_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-sai")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Synchronous Audio Interface"); + return (BUS_PROBE_DEFAULT); +} + +static void +sai_intr(void *arg) +{ + struct sc_pcminfo *scp; + struct sc_info *sc; + + scp = arg; + sc = scp->sc; + + device_printf(sc->dev, "Error I2S_TCSR == 0x%08x\n", + READ4(sc, I2S_TCSR)); +} + +static void +setup_sai(struct sc_info *sc) +{ + int reg; + + /* + * TCR/RCR registers must not be altered when TCSR[TE] is set. + */ + + reg = READ4(sc, I2S_TCSR); + reg &= ~(TCSR_BCE | TCSR_TE | TCSR_FRDE); + WRITE4(sc, I2S_TCSR, reg); + + reg = READ4(sc, I2S_TCR3); + reg &= ~(TCR3_TCE); + WRITE4(sc, I2S_TCR3, reg); + + reg = (64 << TCR1_TFW_S); + WRITE4(sc, I2S_TCR1, reg); + + reg = READ4(sc, I2S_TCR2); + reg &= ~(TCR2_MSEL_M << TCR2_MSEL_S); + reg |= (1 << TCR2_MSEL_S); + reg |= (TCR2_BCP | TCR2_BCD); + WRITE4(sc, I2S_TCR2, reg); + + sai_configure_clock(sc); + + reg = READ4(sc, I2S_TCR3); + reg |= (TCR3_TCE); + WRITE4(sc, I2S_TCR3, reg); + + /* Configure to 32-bit I2S mode */ + reg = READ4(sc, I2S_TCR4); + reg &= ~(TCR4_FRSZ_M << TCR4_FRSZ_S); + reg |= (1 << TCR4_FRSZ_S); /* 2 words per frame */ + reg &= ~(TCR4_SYWD_M << TCR4_SYWD_S); + reg |= (23 << TCR4_SYWD_S); + reg |= (TCR4_MF | TCR4_FSE | TCR4_FSP | TCR4_FSD); + WRITE4(sc, I2S_TCR4, reg); + + reg = READ4(sc, I2S_TCR5); + reg &= ~(TCR5_W0W_M << TCR5_W0W_S); + reg |= (23 << TCR5_W0W_S); + reg &= ~(TCR5_WNW_M << TCR5_WNW_S); + reg |= (23 << TCR5_WNW_S); + reg &= ~(TCR5_FBT_M << TCR5_FBT_S); + reg |= (31 << TCR5_FBT_S); + WRITE4(sc, I2S_TCR5, reg); + + /* Enable transmitter */ + reg = READ4(sc, I2S_TCSR); + reg |= (TCSR_BCE | TCSR_TE | TCSR_FRDE); + reg |= (1 << 10); /* FEIE */ + WRITE4(sc, I2S_TCSR, reg); +} + + +static void +sai_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + + addr = (bus_addr_t*)arg; + *addr = segs[0].ds_addr; +} + +static int +sai_attach(device_t dev) +{ + char status[SND_STATUSLEN]; + struct sc_pcminfo *scp; + struct sc_info *sc; + int err; + + sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); + sc->dev = dev; + sc->sr = &rate_map[0]; + sc->pos = 0; + + sc->lock = snd_mtxcreate(device_get_nameunit(dev), "sai softc"); + if (sc->lock == NULL) { + device_printf(dev, "Cant create mtx\n"); + return (ENXIO); + } + + if (bus_alloc_resources(dev, sai_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* eDMA */ + if (find_edma_controller(sc)) { + device_printf(dev, "could not find active eDMA\n"); + return (ENXIO); + } + + /* Setup PCM */ + scp = malloc(sizeof(struct sc_pcminfo), M_DEVBUF, M_NOWAIT | M_ZERO); + scp->sc = sc; + scp->dev = dev; + + /* DMA */ + sc->dma_size = 262144; + + /* + * Must use dma_size boundary as modulo feature required. + * Modulo feature allows setup circular buffer. + */ + + err = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), + 4, sc->dma_size, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sc->dma_size, 1, /* maxsize, nsegments */ + sc->dma_size, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dma_tag); + + err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->buf_base, + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &sc->dma_map); + if (err) { + device_printf(dev, "cannot allocate framebuffer\n"); + return (ENXIO); + } + + err = bus_dmamap_load(sc->dma_tag, sc->dma_map, sc->buf_base, + sc->dma_size, sai_dmamap_cb, &sc->buf_base_phys, BUS_DMA_NOWAIT); + if (err) { + device_printf(dev, "cannot load DMA map\n"); + return (ENXIO); + } + + bzero(sc->buf_base, sc->dma_size); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_MPSAFE | INTR_TYPE_AV, + NULL, sai_intr, scp, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); + + err = pcm_register(dev, scp, 1, 0); + if (err) { + device_printf(dev, "Can't register pcm.\n"); + return (ENXIO); + } + + scp->chnum = 0; + pcm_addchan(dev, PCMDIR_PLAY, &saichan_class, scp); + scp->chnum++; + + snprintf(status, SND_STATUSLEN, "at simplebus"); + pcm_setstatus(dev, status); + + mixer_init(dev, &saimixer_class, scp); + + setup_dma(scp); + setup_sai(sc); + + return (0); +} + +static device_method_t sai_pcm_methods[] = { + DEVMETHOD(device_probe, sai_probe), + DEVMETHOD(device_attach, sai_attach), + { 0, 0 } +}; + +static driver_t sai_pcm_driver = { + "pcm", + sai_pcm_methods, + PCM_SOFTC_SIZE, +}; + +DRIVER_MODULE(sai, simplebus, sai_pcm_driver, pcm_devclass, 0, 0); +MODULE_DEPEND(sai, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_VERSION(sai, 1); Modified: head/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- head/sys/boot/fdt/dts/vybrid.dtsi Sun Feb 16 14:37:23 2014 (r261981) +++ head/sys/boot/fdt/dts/vybrid.dtsi Sun Feb 16 16:49:54 2014 (r261982) @@ -311,6 +311,9 @@ interrupt-parent = <&GIC>; status = "disabled"; edma-controller = <&edma1>; + edma-src-receive = < 8 >; + edma-src-transmit = < 9 >; + edma-mux-group = < 1 >; clock_names = "sai3", "cko1"; iomux_config = < 16 0x2 19 0x2 From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 17:22:50 2014 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 ESMTPS id 5D76964B; Sun, 16 Feb 2014 17:22:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F88A1E1F; Sun, 16 Feb 2014 17:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GHMoDO048511; Sun, 16 Feb 2014 17:22:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GHMom6048510; Sun, 16 Feb 2014 17:22:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402161722.s1GHMom6048510@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Feb 2014 17:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261983 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 17:22:50 -0000 Author: ian Date: Sun Feb 16 17:22:49 2014 New Revision: 261983 URL: http://svnweb.freebsd.org/changeset/base/261983 Log: After a timeout, reset the controller using SDHCI_RESET_CMD|SDHCI_RESET_DATA rather than SDHCI_RESET_ALL; the latter turns off clocks and power, removing any possibility of recovering from the error. Also, double the timeout to 2 seconds. Despite what the SD spec says about all transactions completing in 250ms or less, I have a card which sometimes takes more than a second to complete a write. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Feb 16 16:49:54 2014 (r261982) +++ head/sys/dev/sdhci/sdhci.c Sun Feb 16 17:22:49 2014 (r261983) @@ -725,7 +725,7 @@ sdhci_timeout(void *arg) struct sdhci_slot *slot = arg; if (slot->curcmd != NULL) { - sdhci_reset(slot, SDHCI_RESET_ALL); + sdhci_reset(slot, SDHCI_RESET_CMD|SDHCI_RESET_DATA); slot->curcmd->error = MMC_ERR_TIMEOUT; sdhci_req_done(slot); } @@ -850,8 +850,8 @@ sdhci_start_command(struct sdhci_slot *s sdhci_set_transfer_mode(slot, cmd->data); /* Start command. */ WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); - /* Start timeout callout; no command should take more than a second. */ - callout_reset(&slot->timeout_callout, hz, sdhci_timeout, slot); + /* Start timeout callout. */ + callout_reset(&slot->timeout_callout, 2*hz, sdhci_timeout, slot); } static void From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 18:22:26 2014 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 ESMTPS id 7BDC1E00; Sun, 16 Feb 2014 18:22:26 +0000 (UTC) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id 607F5130F; Sun, 16 Feb 2014 18:22:26 +0000 (UTC) Received: from [IPv6:2601:9:8280:43f:51e1:7746:f4f:7015] (unknown [IPv6:2601:9:8280:43f:51e1:7746:f4f:7015]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 3F57339828; Sun, 16 Feb 2014 10:22:19 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261875 - head/usr.bin/netstat From: Rui Paulo In-Reply-To: Date: Sun, 16 Feb 2014 10:22:18 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402140743.s1E7he4O010232@svn.freebsd.org> <20140214075100.GD26785@FreeBSD.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1827) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 18:22:26 -0000 On 14 Feb 2014, at 01:23, Adrian Chadd wrote: > ew, ok. Sorry. We don't have a generic way of doing that. I'll fix it = in the am. Of course we do. Just move the %s to 'lookup%s'. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:08:10 2014 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 ESMTPS id BEF57AFB; Sun, 16 Feb 2014 19:08:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A832F1623; Sun, 16 Feb 2014 19:08:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJ8A8U091952; Sun, 16 Feb 2014 19:08:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJ8Ajl091951; Sun, 16 Feb 2014 19:08:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161908.s1GJ8Ajl091951@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261984 - head/etc/etc.ia64 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:08:10 -0000 Author: marcel Date: Sun Feb 16 19:08:10 2014 New Revision: 261984 URL: http://svnweb.freebsd.org/changeset/base/261984 Log: Start getty(8) on ttyu1 as well. It's not uncommon for HP hardware to have that be the iLO console (e.g. pluto). Modified: head/etc/etc.ia64/ttys Modified: head/etc/etc.ia64/ttys ============================================================================== --- head/etc/etc.ia64/ttys Sun Feb 16 17:22:49 2014 (r261983) +++ head/etc/etc.ia64/ttys Sun Feb 16 19:08:10 2014 (r261984) @@ -42,7 +42,7 @@ ttyv8 "/usr/local/bin/xdm -nodaemon" xte # Serial terminals. The 'dialup' keyword identifies dialin lines to login, # fingerd etc. ttyu0 "/usr/libexec/getty std.9600" vt100 on secure -ttyu1 "/usr/libexec/getty std.9600" dialup off secure +ttyu1 "/usr/libexec/getty std.9600" vt100 on secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure # Dumb console From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:12:51 2014 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 ESMTPS id B0358E36; Sun, 16 Feb 2014 19:12:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80EE3169F; Sun, 16 Feb 2014 19:12:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJCpDB095686; Sun, 16 Feb 2014 19:12:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJCo3N095683; Sun, 16 Feb 2014 19:12:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161912.s1GJCo3N095683@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261985 - in stable/10/sys/ia64: ia64 include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:12:51 -0000 Author: marcel Date: Sun Feb 16 19:12:50 2014 New Revision: 261985 URL: http://svnweb.freebsd.org/changeset/base/261985 Log: MFC r257487: Use LOG2_ID_PAGE_SIZE again for the identity mapping in regions 6 & 7. Modified: stable/10/sys/ia64/ia64/machdep.c stable/10/sys/ia64/ia64/mp_machdep.c stable/10/sys/ia64/include/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/machdep.c Sun Feb 16 19:08:10 2014 (r261984) +++ stable/10/sys/ia64/ia64/machdep.c Sun Feb 16 19:12:50 2014 (r261985) @@ -716,8 +716,8 @@ ia64_init(void) * handlers. Here we just make sure that they have the largest * possible page size to minimise TLB usage. */ - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2)); ia64_srlz_d(); /* Initialize/setup physical memory datastructures */ Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:08:10 2014 (r261984) +++ stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:12:50 2014 (r261985) @@ -206,8 +206,8 @@ ia64_ap_startup(void) ia64_ap_state.as_trace = 0x100; ia64_set_rr(IA64_RR_BASE(5), (5 << 8) | (PAGE_SHIFT << 2) | 1); - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2)); ia64_srlz_d(); pcpup = ia64_ap_state.as_pcpu; Modified: stable/10/sys/ia64/include/param.h ============================================================================== --- stable/10/sys/ia64/include/param.h Sun Feb 16 19:08:10 2014 (r261984) +++ stable/10/sys/ia64/include/param.h Sun Feb 16 19:12:50 2014 (r261985) @@ -105,6 +105,11 @@ #endif #define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ +/* The default size of identity mappings in region 6 & 7. */ +#ifndef LOG2_ID_PAGE_SIZE +#define LOG2_ID_PAGE_SIZE 16 +#endif + /* * Mach derived conversion macros */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:20:14 2014 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 ESMTPS id 8AD5E132; Sun, 16 Feb 2014 19:20:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75DAD16D3; Sun, 16 Feb 2014 19:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJKEfJ097029; Sun, 16 Feb 2014 19:20:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJKEc1097028; Sun, 16 Feb 2014 19:20:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161920.s1GJKEc1097028@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261986 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:20:14 -0000 Author: marcel Date: Sun Feb 16 19:20:13 2014 New Revision: 261986 URL: http://svnweb.freebsd.org/changeset/base/261986 Log: MFC r257910: Don't enable interrupts before we call sched_throw(). Modified: stable/10/sys/ia64/ia64/mp_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:12:50 2014 (r261985) +++ stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:20:13 2014 (r261986) @@ -249,8 +249,6 @@ ia64_ap_startup(void) ia64_set_tpr(0); ia64_srlz_d(); - ia64_enable_intr(); - sched_throw(NULL); /* NOTREACHED */ } From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:21:45 2014 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 ESMTPS id 63BA7271; Sun, 16 Feb 2014 19:21:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EBD8173A; Sun, 16 Feb 2014 19:21:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJLjQo099870; Sun, 16 Feb 2014 19:21:45 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJLjjB099869; Sun, 16 Feb 2014 19:21:45 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402161921.s1GJLjjB099869@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 16 Feb 2014 19:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261987 - head/sys/arm/freescale/vybrid 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:21:45 -0000 Author: br Date: Sun Feb 16 19:21:44 2014 New Revision: 261987 URL: http://svnweb.freebsd.org/changeset/base/261987 Log: - Decrease buffer size. - Handle eDMA interrupt on running channel only. Modified: head/sys/arm/freescale/vybrid/vf_sai.c Modified: head/sys/arm/freescale/vybrid/vf_sai.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_sai.c Sun Feb 16 19:20:13 2014 (r261986) +++ head/sys/arm/freescale/vybrid/vf_sai.c Sun Feb 16 19:21:44 2014 (r261987) @@ -396,7 +396,8 @@ sai_dma_intr(void *arg, int chn) if (sc->pos >= sc->dma_size) sc->pos -= sc->dma_size; - chn_intr(ch->channel); + if (ch->run) + chn_intr(ch->channel); return (0); } @@ -492,7 +493,7 @@ setup_dma(struct sc_pcminfo *scp) tcd->nbytes = 64; tcd->nmajor = 512; - tcd->smod = 18; /* dma_size range */ + tcd->smod = 17; /* dma_size range */ tcd->dmod = 0; tcd->esg = 0; tcd->soff = 0x4; @@ -523,6 +524,7 @@ saichan_trigger(kobj_t obj, void *data, #if 0 device_printf(scp->dev, "trigger start\n"); #endif + ch->run = 1; break; case PCMTRIG_STOP: @@ -530,6 +532,7 @@ saichan_trigger(kobj_t obj, void *data, #if 0 device_printf(scp->dev, "trigger stop or abort\n"); #endif + ch->run = 0; break; } @@ -720,7 +723,7 @@ sai_attach(device_t dev) scp->dev = dev; /* DMA */ - sc->dma_size = 262144; + sc->dma_size = 131072; /* * Must use dma_size boundary as modulo feature required. From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:33:34 2014 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 ESMTPS id A28167E5; Sun, 16 Feb 2014 19:33:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E4971840; Sun, 16 Feb 2014 19:33:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJXYXN004759; Sun, 16 Feb 2014 19:33:34 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJXYTT004758; Sun, 16 Feb 2014 19:33:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161933.s1GJXYTT004758@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261988 - head 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:33:34 -0000 Author: brueffer Date: Sun Feb 16 19:33:34 2014 New Revision: 261988 URL: http://svnweb.freebsd.org/changeset/base/261988 Log: Add an UPDATING entry about the nve(4) driver removal. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Feb 16 19:21:44 2014 (r261987) +++ head/UPDATING Sun Feb 16 19:33:34 2014 (r261988) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140216: + The nve(4) driver has been removed. Please use the nfe(4) driver + for NVIDIA nForce MCP Ethernet adapters instead. + 20140212: An ABI incompatibility crept into the libc++ 3.4 import in r261283. This could cause certain C++ applications using shared libraries built From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:38:18 2014 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 ESMTPS id 58729950; Sun, 16 Feb 2014 19:38:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 443B81865; Sun, 16 Feb 2014 19:38:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJcIYh005495; Sun, 16 Feb 2014 19:38:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJcI4H005494; Sun, 16 Feb 2014 19:38:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161938.s1GJcI4H005494@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261989 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:38:18 -0000 Author: brueffer Date: Sun Feb 16 19:38:17 2014 New Revision: 261989 URL: http://svnweb.freebsd.org/changeset/base/261989 Log: Direct commit to stable/10 to note that the nve(4) driver has been deprecated. Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Sun Feb 16 19:33:34 2014 (r261988) +++ stable/10/UPDATING Sun Feb 16 19:38:17 2014 (r261989) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. + +20140216: + The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has + been deprecated and will not be part of FreeBSD 11.0 and later + releases. If you use this driver, please consider switching to + the nfe(4) driver instead. + 20140120: 10.0-RELEASE. From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:41:44 2014 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 ESMTPS id 9E425B89; Sun, 16 Feb 2014 19:41:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8938118D2; Sun, 16 Feb 2014 19:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJfiVu008664; Sun, 16 Feb 2014 19:41:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJfiwo008663; Sun, 16 Feb 2014 19:41:44 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161941.s1GJfiwo008663@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:41: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: r261990 - stable/9 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:41:44 -0000 Author: brueffer Date: Sun Feb 16 19:41:44 2014 New Revision: 261990 URL: http://svnweb.freebsd.org/changeset/base/261990 Log: Direct commit to stable/9 to note that the nve(4) driver has been deprecated. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Sun Feb 16 19:38:17 2014 (r261989) +++ stable/9/UPDATING Sun Feb 16 19:41:44 2014 (r261990) @@ -11,6 +11,12 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20140216: + The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has + been deprecated and will not be part of FreeBSD 11.0 and later + releases. If you use this driver, please consider switching to + the nfe(4) driver instead. + 20131216: The behavior of gss_pseudo_random() for the krb5 mechanism has changed, for applications requesting a longer random string From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:44:13 2014 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 ESMTPS id 9C3F0CCC; Sun, 16 Feb 2014 19:44:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0A618D9; Sun, 16 Feb 2014 19:44:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJiDbM009157; Sun, 16 Feb 2014 19:44:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJiASi009135; Sun, 16 Feb 2014 19:44:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402161944.s1GJiASi009135@svn.freebsd.org> From: Dimitry Andric Date: Sun, 16 Feb 2014 19:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261991 - in head: . contrib/gcc contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm/inc... 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:44:13 -0000 Author: dim Date: Sun Feb 16 19:44:07 2014 New Revision: 261991 URL: http://svnweb.freebsd.org/changeset/base/261991 Log: Upgrade our copy of llvm/clang to 3.4 release. This version supports all of the features in the current working draft of the upcoming C++ standard, provisionally named C++1y. The code generator's performance is greatly increased, and the loop auto-vectorizer is now enabled at -Os and -O2 in addition to -O3. The PowerPC backend has made several major improvements to code generation quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ backends have all seen major feature work. Release notes for llvm and clang can be found here: MFC after: 1 month Added: head/contrib/llvm/include/llvm-c/IRReader.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm-c/IRReader.h head/contrib/llvm/include/llvm-c/Support.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm-c/Support.h head/contrib/llvm/include/llvm/ADT/polymorphic_ptr.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/ADT/polymorphic_ptr.h head/contrib/llvm/include/llvm/Analysis/CFG.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Analysis/CFG.h head/contrib/llvm/include/llvm/CodeGen/LiveRegUnits.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/CodeGen/LiveRegUnits.h head/contrib/llvm/include/llvm/CodeGen/StackMaps.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/CodeGen/StackMaps.h head/contrib/llvm/include/llvm/CodeGen/StackProtector.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/CodeGen/StackProtector.h head/contrib/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/ExecutionEngine/RTDyldMemoryManager.h head/contrib/llvm/include/llvm/IR/IntrinsicsAArch64.td - copied unchanged from r259740, vendor/llvm/dist/include/llvm/IR/IntrinsicsAArch64.td head/contrib/llvm/include/llvm/IR/LegacyPassManager.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/IR/LegacyPassManager.h head/contrib/llvm/include/llvm/IR/LegacyPassManagers.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/IR/LegacyPassManagers.h head/contrib/llvm/include/llvm/IR/PassManager.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/IR/PassManager.h head/contrib/llvm/include/llvm/LTO/ - copied from r259740, vendor/llvm/dist/include/llvm/LTO/ head/contrib/llvm/include/llvm/MC/MCAsmInfoELF.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCAsmInfoELF.h head/contrib/llvm/include/llvm/MC/MCExternalSymbolizer.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCExternalSymbolizer.h head/contrib/llvm/include/llvm/MC/MCFunction.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCFunction.h head/contrib/llvm/include/llvm/MC/MCModuleYAML.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCModuleYAML.h head/contrib/llvm/include/llvm/MC/MCObjectDisassembler.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCObjectDisassembler.h head/contrib/llvm/include/llvm/MC/MCObjectSymbolizer.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCObjectSymbolizer.h head/contrib/llvm/include/llvm/MC/MCRelocationInfo.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCRelocationInfo.h head/contrib/llvm/include/llvm/MC/MCSymbolizer.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/MC/MCSymbolizer.h head/contrib/llvm/include/llvm/Object/COFFYAML.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Object/COFFYAML.h head/contrib/llvm/include/llvm/Object/ELFObjectFile.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Object/ELFObjectFile.h head/contrib/llvm/include/llvm/Object/ELFTypes.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Object/ELFTypes.h head/contrib/llvm/include/llvm/Object/ELFYAML.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Object/ELFYAML.h head/contrib/llvm/include/llvm/Object/MachOUniversal.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Object/MachOUniversal.h head/contrib/llvm/include/llvm/Object/YAML.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Object/YAML.h head/contrib/llvm/include/llvm/Support/MD5.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Support/MD5.h head/contrib/llvm/include/llvm/Support/StringRefMemoryObject.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Support/StringRefMemoryObject.h head/contrib/llvm/include/llvm/Support/Unicode.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Support/Unicode.h head/contrib/llvm/include/llvm/Support/UnicodeCharRanges.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Support/UnicodeCharRanges.h head/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/TableGen/StringToOffsetTable.h head/contrib/llvm/include/llvm/Transforms/Utils/GlobalStatus.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Transforms/Utils/GlobalStatus.h head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Transforms/Utils/LoopUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/SpecialCaseList.h - copied unchanged from r259740, vendor/llvm/dist/include/llvm/Transforms/Utils/SpecialCaseList.h head/contrib/llvm/lib/Analysis/CFG.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Analysis/CFG.cpp head/contrib/llvm/lib/Analysis/Delinearization.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Analysis/Delinearization.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIEHash.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DIEHash.h - copied unchanged from r259740, vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIEHash.h head/contrib/llvm/lib/CodeGen/LiveRegUnits.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/CodeGen/LiveRegUnits.cpp head/contrib/llvm/lib/CodeGen/StackMaps.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/CodeGen/StackMaps.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugLoc.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/DebugInfo/DWARFDebugLoc.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugLoc.h - copied unchanged from r259740, vendor/llvm/dist/lib/DebugInfo/DWARFDebugLoc.h head/contrib/llvm/lib/DebugInfo/DWARFTypeUnit.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/DebugInfo/DWARFTypeUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARFTypeUnit.h - copied unchanged from r259740, vendor/llvm/dist/lib/DebugInfo/DWARFTypeUnit.h head/contrib/llvm/lib/DebugInfo/DWARFUnit.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/DebugInfo/DWARFUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARFUnit.h - copied unchanged from r259740, vendor/llvm/dist/lib/DebugInfo/DWARFUnit.h head/contrib/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp - copied, changed from r259740, vendor/llvm/dist/lib/ExecutionEngine/RTDyldMemoryManager.cpp head/contrib/llvm/lib/IR/AsmWriter.h - copied unchanged from r259740, vendor/llvm/dist/lib/IR/AsmWriter.h head/contrib/llvm/lib/IR/LegacyPassManager.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/IR/LegacyPassManager.cpp head/contrib/llvm/lib/LTO/ - copied from r259740, vendor/llvm/dist/lib/LTO/ head/contrib/llvm/lib/MC/MCAsmInfoELF.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCAsmInfoELF.cpp head/contrib/llvm/lib/MC/MCExternalSymbolizer.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCExternalSymbolizer.cpp head/contrib/llvm/lib/MC/MCFunction.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCFunction.cpp head/contrib/llvm/lib/MC/MCModuleYAML.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCModuleYAML.cpp head/contrib/llvm/lib/MC/MCObjectDisassembler.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCObjectDisassembler.cpp head/contrib/llvm/lib/MC/MCObjectSymbolizer.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCObjectSymbolizer.cpp head/contrib/llvm/lib/MC/MCRelocationInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCRelocationInfo.cpp head/contrib/llvm/lib/MC/MCSymbolizer.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/MC/MCSymbolizer.cpp head/contrib/llvm/lib/Object/COFFYAML.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Object/COFFYAML.cpp head/contrib/llvm/lib/Object/ELF.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Object/ELF.cpp head/contrib/llvm/lib/Object/ELFYAML.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Object/ELFYAML.cpp head/contrib/llvm/lib/Object/MachOUniversal.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Object/MachOUniversal.cpp head/contrib/llvm/lib/Object/YAML.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Object/YAML.cpp head/contrib/llvm/lib/Support/MD5.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Support/MD5.cpp head/contrib/llvm/lib/Support/StringRefMemoryObject.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Support/StringRefMemoryObject.cpp head/contrib/llvm/lib/Support/Unicode.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Support/Unicode.cpp head/contrib/llvm/lib/Target/AArch64/AArch64InstrNEON.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/AArch64/AArch64InstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMFPUName.def - copied unchanged from r259740, vendor/llvm/dist/lib/Target/ARM/ARMFPUName.def head/contrib/llvm/lib/Target/ARM/ARMFPUName.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/ARM/ARMFPUName.h head/contrib/llvm/lib/Target/ARM/ARMFeatures.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/ARM/ARMFeatures.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Hexagon/HexagonCopyToCombine.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Hexagon/HexagonMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Hexagon/HexagonSplitConst32AndConst64.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp head/contrib/llvm/lib/Target/Mips/MSA.txt - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/MSA.txt head/contrib/llvm/lib/Target/Mips/Mips16HardFloat.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/Mips16HardFloat.cpp head/contrib/llvm/lib/Target/Mips/Mips16HardFloat.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/Mips16HardFloat.h head/contrib/llvm/lib/Target/Mips/MipsMSAInstrFormats.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/MipsMSAInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsMSAInstrInfo.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/MipsMSAInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Mips/MipsTargetStreamer.h head/contrib/llvm/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.h head/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/NVPTX/NVPTXMCExpr.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXMCExpr.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/NVPTX/NVPTXMCExpr.h head/contrib/llvm/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/NVPTX/NVPTXPrologEpilogPass.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/PPCFastISel.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/PPCTargetObjectFile.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/PPCTargetObjectFile.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetStreamer.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/PowerPC/PPCTargetStreamer.h head/contrib/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/AMDGPUISelDAGToDAG.cpp head/contrib/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/AMDGPUTargetTransformInfo.cpp head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCCodeEmitter.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/MCTargetDesc/AMDGPUMCCodeEmitter.cpp head/contrib/llvm/lib/Target/R600/R600ClauseMergePass.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/R600ClauseMergePass.cpp head/contrib/llvm/lib/Target/R600/R600InstrFormats.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/R600InstrFormats.td head/contrib/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/R600OptimizeVectorRegisters.cpp head/contrib/llvm/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp head/contrib/llvm/lib/Target/R600/SIFixSGPRCopies.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/SIFixSGPRCopies.cpp head/contrib/llvm/lib/Target/R600/SITypeRewriter.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/R600/SITypeRewriter.cpp head/contrib/llvm/lib/Target/Sparc/SparcCodeEmitter.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Sparc/SparcCodeEmitter.cpp head/contrib/llvm/lib/Target/Sparc/SparcJITInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Sparc/SparcJITInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcJITInfo.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Sparc/SparcJITInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRelocations.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/Sparc/SparcRelocations.h head/contrib/llvm/lib/Target/SystemZ/Disassembler/ - copied from r259740, vendor/llvm/dist/lib/Target/SystemZ/Disassembler/ head/contrib/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZElimCompare.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZLongBranch.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZLongBranch.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZProcessors.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZProcessors.td head/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZSelectionDAGInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/SystemZ/SystemZShortenInst.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp head/contrib/llvm/lib/Target/X86/X86CallingConv.h - copied unchanged from r259740, vendor/llvm/dist/lib/Target/X86/X86CallingConv.h head/contrib/llvm/lib/Target/X86/X86InstrAVX512.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td head/contrib/llvm/lib/Target/X86/X86ScheduleSLM.td - copied unchanged from r259740, vendor/llvm/dist/lib/Target/X86/X86ScheduleSLM.td head/contrib/llvm/lib/Target/XCore/XCoreTargetTransformInfo.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Target/XCore/XCoreTargetTransformInfo.cpp head/contrib/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/DebugIR.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Instrumentation/DebugIR.cpp head/contrib/llvm/lib/Transforms/Instrumentation/DebugIR.h - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Instrumentation/DebugIR.h head/contrib/llvm/lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h head/contrib/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Scalar/FlattenCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Scalar/LoopRerollPass.cpp head/contrib/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/SampleProfile.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Scalar/SampleProfile.cpp head/contrib/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Scalar/StructurizeCFG.cpp head/contrib/llvm/lib/Transforms/Utils/FlattenCFG.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Utils/FlattenCFG.cpp head/contrib/llvm/lib/Transforms/Utils/GlobalStatus.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Utils/GlobalStatus.cpp head/contrib/llvm/lib/Transforms/Utils/SpecialCaseList.cpp - copied unchanged from r259740, vendor/llvm/dist/lib/Transforms/Utils/SpecialCaseList.cpp head/contrib/llvm/tools/clang/include/clang/AST/ASTFwd.h - copied unchanged from r259745, vendor/clang/dist/include/clang/AST/ASTFwd.h head/contrib/llvm/tools/clang/include/clang/AST/ASTLambda.h - copied unchanged from r259745, vendor/clang/dist/include/clang/AST/ASTLambda.h head/contrib/llvm/tools/clang/include/clang/AST/MangleNumberingContext.h - copied unchanged from r259745, vendor/clang/dist/include/clang/AST/MangleNumberingContext.h head/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h - copied unchanged from r259745, vendor/clang/dist/include/clang/AST/StmtOpenMP.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/Dynamic/ - copied from r259745, vendor/clang/dist/include/clang/ASTMatchers/Dynamic/ head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Consumed.h - copied unchanged from r259745, vendor/clang/dist/include/clang/Analysis/Analyses/Consumed.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsXCore.def - copied unchanged from r259745, vendor/clang/dist/include/clang/Basic/BuiltinsXCore.def head/contrib/llvm/tools/clang/include/clang/CodeGen/CGFunctionInfo.h - copied unchanged from r259745, vendor/clang/dist/include/clang/CodeGen/CGFunctionInfo.h head/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenABITypes.h - copied unchanged from r259745, vendor/clang/dist/include/clang/CodeGen/CodeGenABITypes.h head/contrib/llvm/tools/clang/include/clang/Driver/CLCompatOptions.td - copied unchanged from r259745, vendor/clang/dist/include/clang/Driver/CLCompatOptions.td head/contrib/llvm/tools/clang/include/clang/Driver/SanitizerArgs.h - copied unchanged from r259745, vendor/clang/dist/include/clang/Driver/SanitizerArgs.h head/contrib/llvm/tools/clang/include/clang/Index/ - copied from r259745, vendor/clang/dist/include/clang/Index/ head/contrib/llvm/tools/clang/include/clang/Sema/SemaLambda.h - copied unchanged from r259745, vendor/clang/dist/include/clang/Sema/SemaLambda.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h - copied unchanged from r259745, vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h - copied unchanged from r259745, vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h head/contrib/llvm/tools/clang/include/clang/Tooling/ReplacementsYaml.h - copied unchanged from r259745, vendor/clang/dist/include/clang/Tooling/ReplacementsYaml.h head/contrib/llvm/tools/clang/lib/AST/ASTTypeTraits.cpp - copied unchanged from r259745, vendor/clang/dist/lib/AST/ASTTypeTraits.cpp head/contrib/llvm/tools/clang/lib/AST/MangleNumberingContext.cpp - copied unchanged from r259745, vendor/clang/dist/lib/AST/MangleNumberingContext.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/ - copied from r259745, vendor/clang/dist/lib/ASTMatchers/Dynamic/ head/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp - copied unchanged from r259745, vendor/clang/dist/lib/Analysis/Consumed.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenABITypes.cpp - copied unchanged from r259745, vendor/clang/dist/lib/CodeGen/CodeGenABITypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/EHScopeStack.h - copied unchanged from r259745, vendor/clang/dist/lib/CodeGen/EHScopeStack.h head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftVBTables.cpp - copied unchanged from r259745, vendor/clang/dist/lib/CodeGen/MicrosoftVBTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftVBTables.h - copied unchanged from r259745, vendor/clang/dist/lib/CodeGen/MicrosoftVBTables.h head/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.cpp - copied unchanged from r259745, vendor/clang/dist/lib/Driver/SanitizerArgs.cpp head/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.cpp - copied unchanged from r259745, vendor/clang/dist/lib/Format/ContinuationIndenter.cpp head/contrib/llvm/tools/clang/lib/Format/ContinuationIndenter.h - copied unchanged from r259745, vendor/clang/dist/lib/Format/ContinuationIndenter.h head/contrib/llvm/tools/clang/lib/Format/Encoding.h - copied unchanged from r259745, vendor/clang/dist/lib/Format/Encoding.h head/contrib/llvm/tools/clang/lib/Format/FormatToken.cpp - copied unchanged from r259745, vendor/clang/dist/lib/Format/FormatToken.cpp head/contrib/llvm/tools/clang/lib/Format/FormatToken.h - copied unchanged from r259745, vendor/clang/dist/lib/Format/FormatToken.h head/contrib/llvm/tools/clang/lib/Headers/Intrin.h - copied unchanged from r259745, vendor/clang/dist/lib/Headers/Intrin.h head/contrib/llvm/tools/clang/lib/Headers/shaintrin.h - copied unchanged from r259745, vendor/clang/dist/lib/Headers/shaintrin.h head/contrib/llvm/tools/clang/lib/Headers/tbmintrin.h - copied unchanged from r259745, vendor/clang/dist/lib/Headers/tbmintrin.h head/contrib/llvm/tools/clang/lib/Index/ - copied from r259745, vendor/clang/dist/lib/Index/ head/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.cpp - copied unchanged from r259745, vendor/clang/dist/lib/Sema/TypeLocBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp - copied unchanged from r259745, vendor/clang/dist/lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CommonBugCategories.cpp - copied unchanged from r259745, vendor/clang/dist/lib/StaticAnalyzer/Core/CommonBugCategories.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h - copied unchanged from r259745, vendor/clang/dist/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h head/contrib/llvm/tools/lli/ChildTarget/ - copied from r259740, vendor/llvm/dist/tools/lli/ChildTarget/ head/contrib/llvm/tools/lli/RemoteMemoryManager.cpp - copied unchanged from r259740, vendor/llvm/dist/tools/lli/RemoteMemoryManager.cpp head/contrib/llvm/tools/lli/RemoteMemoryManager.h - copied unchanged from r259740, vendor/llvm/dist/tools/lli/RemoteMemoryManager.h head/contrib/llvm/tools/lli/RemoteTargetExternal.cpp - copied unchanged from r259740, vendor/llvm/dist/tools/lli/RemoteTargetExternal.cpp head/contrib/llvm/tools/lli/RemoteTargetExternal.h - copied unchanged from r259740, vendor/llvm/dist/tools/lli/RemoteTargetExternal.h head/contrib/llvm/tools/lli/RemoteTargetMessage.h - copied unchanged from r259740, vendor/llvm/dist/tools/lli/RemoteTargetMessage.h head/contrib/llvm/tools/lli/Unix/ - copied from r259740, vendor/llvm/dist/tools/lli/Unix/ head/contrib/llvm/tools/lli/Windows/ - copied from r259740, vendor/llvm/dist/tools/lli/Windows/ head/lib/clang/include/PPCGenFastISel.inc (contents, props changed) head/lib/clang/include/clang/Parse/AttrIdentifierArg.inc (contents, props changed) head/lib/clang/include/clang/Parse/AttrTypeArg.inc (contents, props changed) head/lib/clang/include/clang/Sema/AttrParsedAttrImpl.inc (contents, props changed) head/lib/clang/libllvmoption/ head/lib/clang/libllvmoption/Makefile (contents, props changed) Deleted: head/contrib/llvm/include/llvm/ADT/NullablePtr.h head/contrib/llvm/include/llvm/Analysis/PathNumbering.h head/contrib/llvm/include/llvm/Analysis/PathProfileInfo.h head/contrib/llvm/include/llvm/Analysis/ProfileDataLoader.h head/contrib/llvm/include/llvm/Analysis/ProfileDataTypes.h head/contrib/llvm/include/llvm/Analysis/ProfileInfo.h head/contrib/llvm/include/llvm/Analysis/ProfileInfoLoader.h head/contrib/llvm/include/llvm/Analysis/ProfileInfoTypes.h head/contrib/llvm/include/llvm/Bitcode/Archive.h head/contrib/llvm/include/llvm/Object/MachOFormat.h head/contrib/llvm/include/llvm/PassManagers.h head/contrib/llvm/include/llvm/Support/IntegersSubset.h head/contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h head/contrib/llvm/include/llvm/Support/PathV1.h head/contrib/llvm/include/llvm/Support/PathV2.h head/contrib/llvm/include/llvm/Transforms/Utils/BlackList.h head/contrib/llvm/lib/Analysis/PathNumbering.cpp head/contrib/llvm/lib/Analysis/PathProfileInfo.cpp head/contrib/llvm/lib/Analysis/PathProfileVerifier.cpp head/contrib/llvm/lib/Analysis/ProfileDataLoader.cpp head/contrib/llvm/lib/Analysis/ProfileDataLoaderPass.cpp head/contrib/llvm/lib/Analysis/ProfileEstimatorPass.cpp head/contrib/llvm/lib/Analysis/ProfileInfo.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoader.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp head/contrib/llvm/lib/Analysis/ProfileVerifierPass.cpp head/contrib/llvm/lib/Archive/ head/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeOrdering.h head/contrib/llvm/lib/CodeGen/ShrinkWrapping.cpp head/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp head/contrib/llvm/lib/DebugInfo/DWARFAttribute.h head/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.h head/contrib/llvm/lib/LTO/CMakeLists.txt head/contrib/llvm/lib/LTO/LLVMBuild.txt head/contrib/llvm/lib/LTO/Makefile head/contrib/llvm/lib/Support/LocaleGeneric.inc head/contrib/llvm/lib/Support/LocaleWindows.inc head/contrib/llvm/lib/Support/LocaleXlocale.inc head/contrib/llvm/lib/Support/PathV2.cpp head/contrib/llvm/lib/Support/Unix/PathV2.inc head/contrib/llvm/lib/Support/Windows/PathV2.inc head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.h head/contrib/llvm/lib/Target/MBlaze/ head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsDirectObjLower.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsDirectObjLower.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h head/contrib/llvm/lib/Target/NVPTX/NVPTXNumRegisters.h head/contrib/llvm/lib/Target/R600/AMDGPUIndirectAddressing.cpp head/contrib/llvm/lib/Target/R600/AMDGPUStructurizeCFG.cpp head/contrib/llvm/lib/Target/R600/AMDIL.h head/contrib/llvm/lib/Target/R600/AMDIL7XXDevice.cpp head/contrib/llvm/lib/Target/R600/AMDIL7XXDevice.h head/contrib/llvm/lib/Target/R600/AMDILDevice.cpp head/contrib/llvm/lib/Target/R600/AMDILDevice.h head/contrib/llvm/lib/Target/R600/AMDILDeviceInfo.cpp head/contrib/llvm/lib/Target/R600/AMDILDeviceInfo.h head/contrib/llvm/lib/Target/R600/AMDILDevices.h head/contrib/llvm/lib/Target/R600/AMDILEvergreenDevice.cpp head/contrib/llvm/lib/Target/R600/AMDILEvergreenDevice.h head/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp head/contrib/llvm/lib/Target/R600/AMDILNIDevice.cpp head/contrib/llvm/lib/Target/R600/AMDILNIDevice.h head/contrib/llvm/lib/Target/R600/AMDILSIDevice.cpp head/contrib/llvm/lib/Target/R600/AMDILSIDevice.h head/contrib/llvm/lib/Target/Sparc/FPMover.cpp head/contrib/llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt head/contrib/llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt head/contrib/llvm/lib/Target/SystemZ/Disassembler/Makefile head/contrib/llvm/lib/Transforms/Instrumentation/BlackList.cpp head/contrib/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.h head/contrib/llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Vectorize/VecUtils.cpp head/contrib/llvm/lib/Transforms/Vectorize/VecUtils.h head/contrib/llvm/tools/clang/include/clang/AST/LambdaMangleContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/Support/BlkExprDeclBitVector.h head/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/ head/contrib/llvm/tools/clang/include/clang/Driver/Arg.h head/contrib/llvm/tools/clang/include/clang/Driver/ArgList.h head/contrib/llvm/tools/clang/include/clang/Driver/OptParser.td head/contrib/llvm/tools/clang/include/clang/Driver/OptSpecifier.h head/contrib/llvm/tools/clang/include/clang/Driver/OptTable.h head/contrib/llvm/tools/clang/include/clang/Driver/Option.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp head/contrib/llvm/tools/clang/lib/AST/LambdaMangleContext.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt head/contrib/llvm/tools/clang/lib/ASTMatchers/Dynamic/Makefile head/contrib/llvm/tools/clang/lib/Driver/Arg.cpp head/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp head/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp head/contrib/llvm/tools/clang/lib/Driver/Option.cpp head/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.h head/contrib/llvm/tools/clang/lib/Index/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Index/Makefile head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CommonBugCategories.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp head/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp head/contrib/llvm/tools/lli/ChildTarget/CMakeLists.txt head/contrib/llvm/tools/lli/ChildTarget/LLVMBuild.txt head/contrib/llvm/tools/lli/ChildTarget/Makefile head/contrib/llvm/tools/lli/RecordingMemoryManager.cpp head/contrib/llvm/tools/lli/RecordingMemoryManager.h head/contrib/llvm/tools/llvm-objdump/MCFunction.cpp head/contrib/llvm/tools/llvm-objdump/MCFunction.h head/contrib/llvm/tools/llvm-prof/ head/contrib/llvm/tools/llvm-ranlib/ head/contrib/llvm/tools/llvm-stub/ head/contrib/llvm/utils/TableGen/StringToOffsetTable.h head/lib/clang/include/clang/Parse/AttrExprArgs.inc head/lib/clang/libllvmarchive/ head/usr.bin/clang/llvm-prof/ head/usr.bin/clang/llvm-ranlib/ Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/gcc/libgcc2.c head/contrib/gcc/libgcc2.h head/contrib/llvm/LICENSE.TXT head/contrib/llvm/include/llvm-c/BitReader.h head/contrib/llvm/include/llvm-c/BitWriter.h head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/Disassembler.h head/contrib/llvm/include/llvm-c/ExecutionEngine.h head/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h head/contrib/llvm/include/llvm-c/Object.h head/contrib/llvm/include/llvm-c/Target.h head/contrib/llvm/include/llvm-c/TargetMachine.h head/contrib/llvm/include/llvm-c/Transforms/Scalar.h head/contrib/llvm/include/llvm-c/lto.h head/contrib/llvm/include/llvm/ADT/APFloat.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/APSInt.h head/contrib/llvm/include/llvm/ADT/ArrayRef.h head/contrib/llvm/include/llvm/ADT/BitVector.h head/contrib/llvm/include/llvm/ADT/DenseMap.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/ImmutableMap.h head/contrib/llvm/include/llvm/ADT/ImmutableSet.h head/contrib/llvm/include/llvm/ADT/IntervalMap.h head/contrib/llvm/include/llvm/ADT/OwningPtr.h head/contrib/llvm/include/llvm/ADT/PointerIntPair.h head/contrib/llvm/include/llvm/ADT/PointerUnion.h head/contrib/llvm/include/llvm/ADT/STLExtras.h head/contrib/llvm/include/llvm/ADT/SetVector.h head/contrib/llvm/include/llvm/ADT/SmallBitVector.h head/contrib/llvm/include/llvm/ADT/SmallPtrSet.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/SparseBitVector.h head/contrib/llvm/include/llvm/ADT/StringExtras.h head/contrib/llvm/include/llvm/ADT/StringMap.h head/contrib/llvm/include/llvm/ADT/StringRef.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/ADT/ilist.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyInfo.h head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h head/contrib/llvm/include/llvm/Analysis/CFGPrinter.h head/contrib/llvm/include/llvm/Analysis/CallGraph.h head/contrib/llvm/include/llvm/Analysis/ConstantFolding.h head/contrib/llvm/include/llvm/Analysis/DependenceAnalysis.h head/contrib/llvm/include/llvm/Analysis/Dominators.h head/contrib/llvm/include/llvm/Analysis/InlineCost.h head/contrib/llvm/include/llvm/Analysis/InstructionSimplify.h head/contrib/llvm/include/llvm/Analysis/LoopInfo.h head/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h head/contrib/llvm/include/llvm/Analysis/LoopPass.h head/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h head/contrib/llvm/include/llvm/Analysis/Passes.h head/contrib/llvm/include/llvm/Analysis/PostDominators.h head/contrib/llvm/include/llvm/Analysis/RegionPass.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h head/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/AutoUpgrade.h head/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h head/contrib/llvm/include/llvm/Bitcode/BitstreamWriter.h head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h head/contrib/llvm/include/llvm/CodeGen/Analysis.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/CalcSpillWeights.h head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/include/llvm/CodeGen/CommandFlags.h head/contrib/llvm/include/llvm/CodeGen/FastISel.h head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LexicalScopes.h head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalUnion.h head/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h head/contrib/llvm/include/llvm/CodeGen/LiveVariables.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineConstantPool.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineRelocation.h head/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h head/contrib/llvm/include/llvm/CodeGen/PBQP/Graph.h head/contrib/llvm/include/llvm/CodeGen/PBQP/HeuristicBase.h head/contrib/llvm/include/llvm/CodeGen/PBQP/HeuristicSolver.h head/contrib/llvm/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h head/contrib/llvm/include/llvm/CodeGen/PBQP/Solution.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h head/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h head/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h head/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h head/contrib/llvm/include/llvm/CodeGen/RegisterScavenging.h head/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h head/contrib/llvm/include/llvm/CodeGen/TargetSchedule.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.td head/contrib/llvm/include/llvm/DIBuilder.h head/contrib/llvm/include/llvm/DebugInfo.h head/contrib/llvm/include/llvm/DebugInfo/DIContext.h head/contrib/llvm/include/llvm/DebugInfo/DWARFFormValue.h head/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h head/contrib/llvm/include/llvm/ExecutionEngine/JITMemoryManager.h head/contrib/llvm/include/llvm/ExecutionEngine/ObjectBuffer.h head/contrib/llvm/include/llvm/ExecutionEngine/ObjectCache.h head/contrib/llvm/include/llvm/ExecutionEngine/ObjectImage.h head/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h head/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h head/contrib/llvm/include/llvm/GVMaterializer.h head/contrib/llvm/include/llvm/IR/Argument.h head/contrib/llvm/include/llvm/IR/Attributes.h head/contrib/llvm/include/llvm/IR/CallingConv.h head/contrib/llvm/include/llvm/IR/Constants.h head/contrib/llvm/include/llvm/IR/DataLayout.h head/contrib/llvm/include/llvm/IR/Function.h head/contrib/llvm/include/llvm/IR/GlobalAlias.h head/contrib/llvm/include/llvm/IR/GlobalValue.h head/contrib/llvm/include/llvm/IR/GlobalVariable.h head/contrib/llvm/include/llvm/IR/IRBuilder.h head/contrib/llvm/include/llvm/IR/InlineAsm.h head/contrib/llvm/include/llvm/IR/InstrTypes.h head/contrib/llvm/include/llvm/IR/Instruction.def head/contrib/llvm/include/llvm/IR/Instructions.h head/contrib/llvm/include/llvm/IR/Intrinsics.h head/contrib/llvm/include/llvm/IR/Intrinsics.td head/contrib/llvm/include/llvm/IR/IntrinsicsARM.td head/contrib/llvm/include/llvm/IR/IntrinsicsMips.td head/contrib/llvm/include/llvm/IR/IntrinsicsNVVM.td head/contrib/llvm/include/llvm/IR/IntrinsicsPowerPC.td head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td head/contrib/llvm/include/llvm/IR/IntrinsicsXCore.td head/contrib/llvm/include/llvm/IR/LLVMContext.h head/contrib/llvm/include/llvm/IR/Metadata.h head/contrib/llvm/include/llvm/IR/Module.h head/contrib/llvm/include/llvm/IR/Operator.h head/contrib/llvm/include/llvm/IR/Type.h head/contrib/llvm/include/llvm/IR/TypeBuilder.h head/contrib/llvm/include/llvm/IR/Use.h head/contrib/llvm/include/llvm/IR/Value.h head/contrib/llvm/include/llvm/InitializePasses.h head/contrib/llvm/include/llvm/InstVisitor.h head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/Linker.h head/contrib/llvm/include/llvm/MC/MCAsmBackend.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCAssembler.h head/contrib/llvm/include/llvm/MC/MCAtom.h head/contrib/llvm/include/llvm/MC/MCCodeGenInfo.h head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/MC/MCDisassembler.h head/contrib/llvm/include/llvm/MC/MCDwarf.h head/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h head/contrib/llvm/include/llvm/MC/MCELFStreamer.h head/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h head/contrib/llvm/include/llvm/MC/MCExpr.h head/contrib/llvm/include/llvm/MC/MCInstPrinter.h head/contrib/llvm/include/llvm/MC/MCInstrAnalysis.h head/contrib/llvm/include/llvm/MC/MCInstrDesc.h head/contrib/llvm/include/llvm/MC/MCInstrItineraries.h head/contrib/llvm/include/llvm/MC/MCMachOSymbolFlags.h head/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h head/contrib/llvm/include/llvm/MC/MCModule.h head/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h head/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h head/contrib/llvm/include/llvm/MC/MCRegisterInfo.h head/contrib/llvm/include/llvm/MC/MCSchedule.h head/contrib/llvm/include/llvm/MC/MCSectionCOFF.h head/contrib/llvm/include/llvm/MC/MCSectionMachO.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h head/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h head/contrib/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h head/contrib/llvm/include/llvm/MC/MachineLocation.h head/contrib/llvm/include/llvm/MC/SubtargetFeature.h head/contrib/llvm/include/llvm/Object/Archive.h head/contrib/llvm/include/llvm/Object/Binary.h head/contrib/llvm/include/llvm/Object/COFF.h head/contrib/llvm/include/llvm/Object/ELF.h head/contrib/llvm/include/llvm/Object/Error.h head/contrib/llvm/include/llvm/Object/MachO.h head/contrib/llvm/include/llvm/Object/ObjectFile.h head/contrib/llvm/include/llvm/Object/RelocVisitor.h head/contrib/llvm/include/llvm/Option/ArgList.h head/contrib/llvm/include/llvm/Option/OptParser.td head/contrib/llvm/include/llvm/Option/OptTable.h head/contrib/llvm/include/llvm/Option/Option.h head/contrib/llvm/include/llvm/PassManager.h head/contrib/llvm/include/llvm/Support/Allocator.h head/contrib/llvm/include/llvm/Support/BlockFrequency.h head/contrib/llvm/include/llvm/Support/CFG.h head/contrib/llvm/include/llvm/Support/COFF.h head/contrib/llvm/include/llvm/Support/CallSite.h head/contrib/llvm/include/llvm/Support/Casting.h head/contrib/llvm/include/llvm/Support/CommandLine.h head/contrib/llvm/include/llvm/Support/Compiler.h head/contrib/llvm/include/llvm/Support/Compression.h head/contrib/llvm/include/llvm/Support/ConstantRange.h head/contrib/llvm/include/llvm/Support/ConvertUTF.h head/contrib/llvm/include/llvm/Support/DataTypes.h.in head/contrib/llvm/include/llvm/Support/Debug.h head/contrib/llvm/include/llvm/Support/DebugLoc.h head/contrib/llvm/include/llvm/Support/Dwarf.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/include/llvm/Support/ErrorOr.h head/contrib/llvm/include/llvm/Support/FileSystem.h head/contrib/llvm/include/llvm/Support/FileUtilities.h head/contrib/llvm/include/llvm/Support/FormattedStream.h head/contrib/llvm/include/llvm/Support/GCOV.h head/contrib/llvm/include/llvm/Support/GetElementPtrTypeIterator.h head/contrib/llvm/include/llvm/Support/GraphWriter.h head/contrib/llvm/include/llvm/Support/Host.h head/contrib/llvm/include/llvm/Support/LEB128.h head/contrib/llvm/include/llvm/Support/MachO.h head/contrib/llvm/include/llvm/Support/ManagedStatic.h head/contrib/llvm/include/llvm/Support/MathExtras.h head/contrib/llvm/include/llvm/Support/MemoryBuffer.h head/contrib/llvm/include/llvm/Support/MemoryObject.h head/contrib/llvm/include/llvm/Support/PassNameParser.h head/contrib/llvm/include/llvm/Support/Path.h head/contrib/llvm/include/llvm/Support/PatternMatch.h head/contrib/llvm/include/llvm/Support/PrettyStackTrace.h head/contrib/llvm/include/llvm/Support/Process.h head/contrib/llvm/include/llvm/Support/Program.h head/contrib/llvm/include/llvm/Support/RecyclingAllocator.h head/contrib/llvm/include/llvm/Support/Regex.h head/contrib/llvm/include/llvm/Support/Registry.h head/contrib/llvm/include/llvm/Support/Signals.h head/contrib/llvm/include/llvm/Support/Solaris.h head/contrib/llvm/include/llvm/Support/SourceMgr.h head/contrib/llvm/include/llvm/Support/StreamableMemoryObject.h head/contrib/llvm/include/llvm/Support/SystemUtils.h head/contrib/llvm/include/llvm/Support/TargetRegistry.h head/contrib/llvm/include/llvm/Support/TimeValue.h head/contrib/llvm/include/llvm/Support/ToolOutputFile.h head/contrib/llvm/include/llvm/Support/Valgrind.h head/contrib/llvm/include/llvm/Support/ValueHandle.h head/contrib/llvm/include/llvm/Support/YAMLParser.h head/contrib/llvm/include/llvm/Support/YAMLTraits.h head/contrib/llvm/include/llvm/Support/raw_ostream.h head/contrib/llvm/include/llvm/TableGen/Record.h head/contrib/llvm/include/llvm/TableGen/TableGenBackend.h head/contrib/llvm/include/llvm/Target/CostTable.h head/contrib/llvm/include/llvm/Target/Mangler.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetCallingConv.h head/contrib/llvm/include/llvm/Target/TargetCallingConv.td head/contrib/llvm/include/llvm/Target/TargetFrameLowering.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h head/contrib/llvm/include/llvm/Target/TargetMachine.h head/contrib/llvm/include/llvm/Target/TargetOpcodes.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetSchedule.td head/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td head/contrib/llvm/include/llvm/Target/TargetSelectionDAGInfo.h head/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h head/contrib/llvm/include/llvm/Transforms/IPO.h head/contrib/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h head/contrib/llvm/include/llvm/Transforms/Instrumentation.h head/contrib/llvm/include/llvm/Transforms/Scalar.h head/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Transforms/Utils/ModuleUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h head/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h head/contrib/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h head/contrib/llvm/include/llvm/Transforms/Utils/ValueMapper.h head/contrib/llvm/include/llvm/Transforms/Vectorize.h head/contrib/llvm/lib/Analysis/AliasAnalysis.cpp head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp head/contrib/llvm/lib/Analysis/Analysis.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/BlockFrequencyInfo.cpp head/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp head/contrib/llvm/lib/Analysis/CaptureTracking.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/CostModel.cpp head/contrib/llvm/lib/Analysis/DependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp head/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp head/contrib/llvm/lib/Analysis/IPA/IPA.cpp head/contrib/llvm/lib/Analysis/IPA/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm/lib/Analysis/Lint.cpp head/contrib/llvm/lib/Analysis/LoopInfo.cpp head/contrib/llvm/lib/Analysis/LoopPass.cpp head/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/RegionInfo.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp head/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp head/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLParser.h head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/AsmParser/Parser.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.h head/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp head/contrib/llvm/lib/Bitcode/Writer/BitWriter.cpp head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/Analysis.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h head/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.h head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/CodeGen.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp head/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp head/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.h head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LexicalScopes.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.h head/contrib/llvm/lib/CodeGen/LiveInterval.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp head/contrib/llvm/lib/CodeGen/LiveRangeCalc.h head/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp head/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp head/contrib/llvm/lib/CodeGen/LiveVariables.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp head/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp head/contrib/llvm/lib/CodeGen/MachineScheduler.cpp head/contrib/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/PHIElimination.cpp head/contrib/llvm/lib/CodeGen/PHIEliminationUtils.h head/contrib/llvm/lib/CodeGen/Passes.cpp head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.h head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.h head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RegisterPressure.cpp head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SpillPlacement.cpp head/contrib/llvm/lib/CodeGen/SpillPlacement.h head/contrib/llvm/lib/CodeGen/Spiller.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/CodeGen/StackColoring.cpp head/contrib/llvm/lib/CodeGen/StackProtector.cpp head/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TargetOptionsImpl.cpp head/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/TargetSchedule.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.cpp head/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.h head/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.h head/contrib/llvm/lib/DebugInfo/DWARFContext.cpp head/contrib/llvm/lib/DebugInfo/DWARFContext.h head/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.h head/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.h head/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h head/contrib/llvm/lib/DebugInfo/DWARFDebugLine.cpp head/contrib/llvm/lib/DebugInfo/DWARFFormValue.cpp head/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp head/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp head/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h head/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h head/contrib/llvm/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp head/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp head/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/JITRegistrar.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h head/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp head/contrib/llvm/lib/IR/AsmWriter.cpp head/contrib/llvm/lib/IR/AttributeImpl.h head/contrib/llvm/lib/IR/Attributes.cpp head/contrib/llvm/lib/IR/AutoUpgrade.cpp head/contrib/llvm/lib/IR/ConstantFold.cpp head/contrib/llvm/lib/IR/Constants.cpp head/contrib/llvm/lib/IR/Core.cpp head/contrib/llvm/lib/IR/DIBuilder.cpp head/contrib/llvm/lib/IR/DataLayout.cpp head/contrib/llvm/lib/IR/DebugInfo.cpp head/contrib/llvm/lib/IR/Function.cpp head/contrib/llvm/lib/IR/GCOV.cpp head/contrib/llvm/lib/IR/Globals.cpp head/contrib/llvm/lib/IR/Instruction.cpp head/contrib/llvm/lib/IR/Instructions.cpp head/contrib/llvm/lib/IR/LLVMContextImpl.h head/contrib/llvm/lib/IR/Metadata.cpp head/contrib/llvm/lib/IR/Module.cpp head/contrib/llvm/lib/IR/PassManager.cpp head/contrib/llvm/lib/IR/PassRegistry.cpp head/contrib/llvm/lib/IR/Type.cpp head/contrib/llvm/lib/IR/TypeFinder.cpp head/contrib/llvm/lib/IR/Value.cpp head/contrib/llvm/lib/IR/ValueTypes.cpp head/contrib/llvm/lib/IR/Verifier.cpp head/contrib/llvm/lib/IRReader/IRReader.cpp head/contrib/llvm/lib/Linker/LinkModules.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCAsmBackend.cpp head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCAtom.cpp head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/MC/MCDisassembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELF.cpp head/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/MC/MCExpr.cpp head/contrib/llvm/lib/MC/MCInstPrinter.cpp head/contrib/llvm/lib/MC/MCInstrAnalysis.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCModule.cpp head/contrib/llvm/lib/MC/MCNullStreamer.cpp head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCPureStreamer.cpp head/contrib/llvm/lib/MC/MCRegisterInfo.cpp head/contrib/llvm/lib/MC/MCSectionCOFF.cpp head/contrib/llvm/lib/MC/MCSectionELF.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/MCSubtargetInfo.cpp head/contrib/llvm/lib/MC/MCSymbol.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/MC/SubtargetFeature.cpp head/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp head/contrib/llvm/lib/MC/WinCOFFStreamer.cpp head/contrib/llvm/lib/Object/Archive.cpp head/contrib/llvm/lib/Object/Binary.cpp head/contrib/llvm/lib/Object/COFFObjectFile.cpp head/contrib/llvm/lib/Object/ELFObjectFile.cpp head/contrib/llvm/lib/Object/Error.cpp head/contrib/llvm/lib/Object/MachOObjectFile.cpp head/contrib/llvm/lib/Object/Object.cpp head/contrib/llvm/lib/Object/ObjectFile.cpp head/contrib/llvm/lib/Option/ArgList.cpp head/contrib/llvm/lib/Option/OptTable.cpp head/contrib/llvm/lib/Option/Option.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/Allocator.cpp head/contrib/llvm/lib/Support/BlockFrequency.cpp head/contrib/llvm/lib/Support/CommandLine.cpp head/contrib/llvm/lib/Support/Compression.cpp head/contrib/llvm/lib/Support/ConstantRange.cpp head/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp head/contrib/llvm/lib/Support/CrashRecoveryContext.cpp head/contrib/llvm/lib/Support/DataStream.cpp head/contrib/llvm/lib/Support/Disassembler.cpp head/contrib/llvm/lib/Support/Dwarf.cpp head/contrib/llvm/lib/Support/DynamicLibrary.cpp head/contrib/llvm/lib/Support/Errno.cpp head/contrib/llvm/lib/Support/ErrorHandling.cpp head/contrib/llvm/lib/Support/FileOutputBuffer.cpp head/contrib/llvm/lib/Support/FileUtilities.cpp head/contrib/llvm/lib/Support/FormattedStream.cpp head/contrib/llvm/lib/Support/GraphWriter.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Support/Locale.cpp head/contrib/llvm/lib/Support/LockFileManager.cpp head/contrib/llvm/lib/Support/MemoryBuffer.cpp head/contrib/llvm/lib/Support/MemoryObject.cpp head/contrib/llvm/lib/Support/Path.cpp head/contrib/llvm/lib/Support/PrettyStackTrace.cpp head/contrib/llvm/lib/Support/Process.cpp head/contrib/llvm/lib/Support/Program.cpp head/contrib/llvm/lib/Support/Regex.cpp head/contrib/llvm/lib/Support/SmallPtrSet.cpp head/contrib/llvm/lib/Support/SourceMgr.cpp head/contrib/llvm/lib/Support/StreamableMemoryObject.cpp head/contrib/llvm/lib/Support/StringRef.cpp head/contrib/llvm/lib/Support/SystemUtils.cpp head/contrib/llvm/lib/Support/TargetRegistry.cpp head/contrib/llvm/lib/Support/ThreadLocal.cpp head/contrib/llvm/lib/Support/Timer.cpp head/contrib/llvm/lib/Support/ToolOutputFile.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/Unix/Memory.inc head/contrib/llvm/lib/Support/Unix/Path.inc head/contrib/llvm/lib/Support/Unix/Process.inc head/contrib/llvm/lib/Support/Unix/Program.inc head/contrib/llvm/lib/Support/Unix/Signals.inc head/contrib/llvm/lib/Support/Unix/ThreadLocal.inc head/contrib/llvm/lib/Support/Unix/TimeValue.inc head/contrib/llvm/lib/Support/Unix/Unix.h head/contrib/llvm/lib/Support/Windows/DynamicLibrary.inc head/contrib/llvm/lib/Support/Windows/Memory.inc head/contrib/llvm/lib/Support/Windows/Path.inc head/contrib/llvm/lib/Support/Windows/Process.inc head/contrib/llvm/lib/Support/Windows/Program.inc head/contrib/llvm/lib/Support/Windows/RWMutex.inc head/contrib/llvm/lib/Support/Windows/Signals.inc head/contrib/llvm/lib/Support/Windows/TimeValue.inc head/contrib/llvm/lib/Support/Windows/Windows.h head/contrib/llvm/lib/Support/YAMLParser.cpp head/contrib/llvm/lib/Support/YAMLTraits.cpp head/contrib/llvm/lib/Support/raw_ostream.cpp head/contrib/llvm/lib/TableGen/Main.cpp head/contrib/llvm/lib/TableGen/Record.cpp head/contrib/llvm/lib/TableGen/TGParser.cpp head/contrib/llvm/lib/Target/AArch64/AArch64.td head/contrib/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp head/contrib/llvm/lib/Target/AArch64/AArch64AsmPrinter.h head/contrib/llvm/lib/Target/AArch64/AArch64BranchFixupPass.cpp head/contrib/llvm/lib/Target/AArch64/AArch64CallingConv.td head/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.h head/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h head/contrib/llvm/lib/Target/AArch64/AArch64InstrFormats.td head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.h head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td head/contrib/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.h head/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.td head/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp head/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.h head/contrib/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp head/contrib/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp head/contrib/llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp head/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp head/contrib/llvm/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.h head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp head/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h head/contrib/llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp head/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp head/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMBuildAttrs.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td head/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp head/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.h head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp head/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSchedule.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td head/contrib/llvm/lib/Target/ARM/ARMScheduleSwift.td head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h head/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h head/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2RegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2RegisterInfo.h head/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp head/contrib/llvm/lib/Target/Hexagon/Hexagon.h head/contrib/llvm/lib/Target/Hexagon/Hexagon.td head/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.h head/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td head/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.h head/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonPeephole.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSelectionDAGInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h head/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h head/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp head/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp head/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp head/contrib/llvm/lib/Target/MSP430/MSP430CallingConv.td head/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp head/contrib/llvm/lib/Target/Mangler.cpp head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.h head/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips.h head/contrib/llvm/lib/Target/Mips/Mips.td head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h head/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h head/contrib/llvm/lib/Target/Mips/Mips16InstrFormats.td head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.h head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsAnalyzeImmediate.cpp head/contrib/llvm/lib/Target/Mips/MipsAnalyzeImmediate.h head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h head/contrib/llvm/lib/Target/Mips/MipsCallingConv.td head/contrib/llvm/lib/Target/Mips/MipsCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MipsCondMov.td head/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp head/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsJITInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsOs16.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsSchedule.td head/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp head/contrib/llvm/lib/Target/Mips/MipsSubtarget.h head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h head/contrib/llvm/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXBaseInfo.h head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp head/contrib/llvm/lib/Target/NVPTX/ManagedStringPool.h head/contrib/llvm/lib/Target/NVPTX/NVPTX.h head/contrib/llvm/lib/Target/NVPTX/NVPTX.td head/contrib/llvm/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h head/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h head/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.h head/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h head/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td head/contrib/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td head/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h head/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.td head/contrib/llvm/lib/Target/NVPTX/NVPTXSection.h head/contrib/llvm/lib/Target/NVPTX/NVPTXSplitBBatBar.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.h head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp head/contrib/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h head/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp head/contrib/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h head/contrib/llvm/lib/Target/PowerPC/PPC.h head/contrib/llvm/lib/Target/PowerPC/PPC.td head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td head/contrib/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp head/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.h head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCSchedule.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleE500mc.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleE5500.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp head/contrib/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp head/contrib/llvm/lib/Target/R600/AMDGPU.h head/contrib/llvm/lib/Target/R600/AMDGPU.td head/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp head/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.h head/contrib/llvm/lib/Target/R600/AMDGPUCallingConv.td head/contrib/llvm/lib/Target/R600/AMDGPUFrameLowering.cpp head/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp head/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.h head/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.cpp head/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.h head/contrib/llvm/lib/Target/R600/AMDGPUInstrInfo.td head/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td head/contrib/llvm/lib/Target/R600/AMDGPUIntrinsics.td head/contrib/llvm/lib/Target/R600/AMDGPUMCInstLower.cpp head/contrib/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp head/contrib/llvm/lib/Target/R600/AMDGPUMachineFunction.h head/contrib/llvm/lib/Target/R600/AMDGPURegisterInfo.cpp head/contrib/llvm/lib/Target/R600/AMDGPURegisterInfo.h head/contrib/llvm/lib/Target/R600/AMDGPURegisterInfo.td head/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp head/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h head/contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp head/contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.h head/contrib/llvm/lib/Target/R600/AMDILBase.td head/contrib/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp head/contrib/llvm/lib/Target/R600/AMDILISelLowering.cpp head/contrib/llvm/lib/Target/R600/AMDILInstrInfo.td head/contrib/llvm/lib/Target/R600/AMDILIntrinsicInfo.cpp head/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp head/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.h head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCCodeEmitter.h head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.h head/contrib/llvm/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp head/contrib/llvm/lib/Target/R600/Processors.td head/contrib/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp head/contrib/llvm/lib/Target/R600/R600Defines.h head/contrib/llvm/lib/Target/R600/R600EmitClauseMarkers.cpp head/contrib/llvm/lib/Target/R600/R600ExpandSpecialInstrs.cpp head/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp head/contrib/llvm/lib/Target/R600/R600ISelLowering.h head/contrib/llvm/lib/Target/R600/R600InstrInfo.cpp head/contrib/llvm/lib/Target/R600/R600InstrInfo.h head/contrib/llvm/lib/Target/R600/R600Instructions.td head/contrib/llvm/lib/Target/R600/R600Intrinsics.td head/contrib/llvm/lib/Target/R600/R600MachineFunctionInfo.cpp head/contrib/llvm/lib/Target/R600/R600MachineFunctionInfo.h head/contrib/llvm/lib/Target/R600/R600MachineScheduler.cpp head/contrib/llvm/lib/Target/R600/R600MachineScheduler.h head/contrib/llvm/lib/Target/R600/R600Packetizer.cpp head/contrib/llvm/lib/Target/R600/R600RegisterInfo.cpp head/contrib/llvm/lib/Target/R600/R600RegisterInfo.h head/contrib/llvm/lib/Target/R600/R600RegisterInfo.td head/contrib/llvm/lib/Target/R600/R600Schedule.td head/contrib/llvm/lib/Target/R600/SIAnnotateControlFlow.cpp head/contrib/llvm/lib/Target/R600/SIDefines.h head/contrib/llvm/lib/Target/R600/SIISelLowering.cpp head/contrib/llvm/lib/Target/R600/SIISelLowering.h head/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp head/contrib/llvm/lib/Target/R600/SIInstrFormats.td head/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp head/contrib/llvm/lib/Target/R600/SIInstrInfo.h head/contrib/llvm/lib/Target/R600/SIInstrInfo.td head/contrib/llvm/lib/Target/R600/SIInstructions.td head/contrib/llvm/lib/Target/R600/SIIntrinsics.td head/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp head/contrib/llvm/lib/Target/R600/SIMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/R600/SIMachineFunctionInfo.h head/contrib/llvm/lib/Target/R600/SIRegisterInfo.cpp head/contrib/llvm/lib/Target/R600/SIRegisterInfo.h head/contrib/llvm/lib/Target/R600/SIRegisterInfo.td head/contrib/llvm/lib/Target/R600/TargetInfo/AMDGPUTargetInfo.cpp head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h head/contrib/llvm/lib/Target/Sparc/Sparc.h head/contrib/llvm/lib/Target/Sparc/Sparc.td head/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp head/contrib/llvm/lib/Target/Sparc/SparcCallingConv.td head/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h head/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td head/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td head/contrib/llvm/lib/Target/Sparc/SparcMachineFunctionInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h head/contrib/llvm/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp head/contrib/llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp head/contrib/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp head/contrib/llvm/lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.h head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.h head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCCodeEmitter.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h head/contrib/llvm/lib/Target/SystemZ/README.txt head/contrib/llvm/lib/Target/SystemZ/SystemZ.h head/contrib/llvm/lib/Target/SystemZ/SystemZ.td head/contrib/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZCallingConv.td head/contrib/llvm/lib/Target/SystemZ/SystemZConstantPoolValue.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZFrameLowering.h head/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrFP.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrFormats.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZMCInstLower.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMCInstLower.h head/contrib/llvm/lib/Target/SystemZ/SystemZMachineFunctionInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZOperands.td head/contrib/llvm/lib/Target/SystemZ/SystemZOperators.td head/contrib/llvm/lib/Target/SystemZ/SystemZPatterns.td head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.h head/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.h head/contrib/llvm/lib/Target/Target.cpp head/contrib/llvm/lib/Target/TargetLibraryInfo.cpp head/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetMachineC.cpp head/contrib/llvm/lib/Target/TargetSubtargetInfo.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.h head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.h head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrControl.td head/contrib/llvm/lib/Target/X86/X86InstrExtension.td head/contrib/llvm/lib/Target/X86/X86InstrFMA.td head/contrib/llvm/lib/Target/X86/X86InstrFPStack.td head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrMMX.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86InstrSVM.td head/contrib/llvm/lib/Target/X86/X86InstrShiftRotate.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86InstrTSX.td head/contrib/llvm/lib/Target/X86/X86InstrXOP.td head/contrib/llvm/lib/Target/X86/X86JITInfo.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86SchedHaswell.td head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.h head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp head/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp head/contrib/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp head/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp head/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h head/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp head/contrib/llvm/lib/Target/XCore/XCore.h head/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp head/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp head/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/InlineAlways.cpp head/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp head/contrib/llvm/lib/Transforms/IPO/Inliner.cpp head/contrib/llvm/lib/Transforms/IPO/Internalize.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp head/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp head/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp head/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp head/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp head/contrib/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.h head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.h head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.h head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp head/contrib/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h head/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp head/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp head/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/GlobalMerge.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Scalar/SROA.cpp head/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp head/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp head/contrib/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp head/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp head/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp head/contrib/llvm/lib/Transforms/Utils/MetaRenamer.cpp head/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp head/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp head/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp head/contrib/llvm/tools/bugpoint/BugDriver.cpp head/contrib/llvm/tools/bugpoint/BugDriver.h head/contrib/llvm/tools/bugpoint/CrashDebugger.cpp head/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp head/contrib/llvm/tools/bugpoint/ExtractFunction.cpp head/contrib/llvm/tools/bugpoint/FindBugs.cpp head/contrib/llvm/tools/bugpoint/Miscompilation.cpp head/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp head/contrib/llvm/tools/bugpoint/ToolRunner.cpp head/contrib/llvm/tools/bugpoint/ToolRunner.h head/contrib/llvm/tools/bugpoint/bugpoint.cpp head/contrib/llvm/tools/clang/include/clang-c/CXCompilationDatabase.h head/contrib/llvm/tools/clang/include/clang-c/CXString.h head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMT.h head/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMTActions.h head/contrib/llvm/tools/clang/include/clang/ARCMigrate/FileRemapper.h head/contrib/llvm/tools/clang/include/clang/AST/APValue.h head/contrib/llvm/tools/clang/include/clang/AST/ASTConsumer.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTDiagnostic.h head/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h head/contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h head/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h head/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h head/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h head/contrib/llvm/tools/clang/include/clang/AST/Attr.h head/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h head/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h head/contrib/llvm/tools/clang/include/clang/AST/CharUnits.h head/contrib/llvm/tools/clang/include/clang/AST/Comment.h head/contrib/llvm/tools/clang/include/clang/AST/CommentCommandTraits.h head/contrib/llvm/tools/clang/include/clang/AST/CommentCommands.td head/contrib/llvm/tools/clang/include/clang/AST/CommentDiagnostic.h head/contrib/llvm/tools/clang/include/clang/AST/CommentParser.h head/contrib/llvm/tools/clang/include/clang/AST/CommentSema.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclAccessPair.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h head/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h head/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h head/contrib/llvm/tools/clang/include/clang/AST/EvaluatedExprVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/GlobalDecl.h head/contrib/llvm/tools/clang/include/clang/AST/Mangle.h head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/ParentMap.h head/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h head/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h head/contrib/llvm/tools/clang/include/clang/AST/RecordLayout.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Redeclarable.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h head/contrib/llvm/tools/clang/include/clang/AST/StmtIterator.h head/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h head/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h head/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def head/contrib/llvm/tools/clang/include/clang/AST/TypeOrdering.h head/contrib/llvm/tools/clang/include/clang/AST/TypeVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/UnresolvedSet.h head/contrib/llvm/tools/clang/include/clang/AST/VTTBuilder.h head/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchFinder.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersMacros.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h head/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h head/contrib/llvm/tools/clang/include/clang/Analysis/FlowSensitive/DataflowSolver.h head/contrib/llvm/tools/clang/include/clang/Basic/ABI.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsMips.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsNVPTX.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/CapturedStmt.h head/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommentKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.def head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h head/contrib/llvm/tools/clang/include/clang/Basic/FileSystemStatCache.h head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/Lambda.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h head/contrib/llvm/tools/clang/include/clang/Basic/Module.h head/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/OperatorKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def head/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/TargetBuiltins.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/TemplateKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/Driver/Action.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/DriverDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Driver/Job.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Tool.h head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Driver/Types.def head/contrib/llvm/tools/clang/include/clang/Driver/Types.h head/contrib/llvm/tools/clang/include/clang/Driver/Util.h head/contrib/llvm/tools/clang/include/clang/Edit/Commit.h head/contrib/llvm/tools/clang/include/clang/Edit/EditedSource.h head/contrib/llvm/tools/clang/include/clang/Edit/Rewriters.h head/contrib/llvm/tools/clang/include/clang/Format/Format.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTConsumers.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.def head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h head/contrib/llvm/tools/clang/include/clang/Frontend/DependencyOutputOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h head/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Lex/LexDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h head/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h head/contrib/llvm/tools/clang/include/clang/Lex/ModuleLoader.h head/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h head/contrib/llvm/tools/clang/include/clang/Lex/MultipleIncludeOpt.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/PPConditionalDirectiveRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/PTHLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/Token.h head/contrib/llvm/tools/clang/include/clang/Lex/TokenLexer.h head/contrib/llvm/tools/clang/include/clang/Parse/ParseDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Core/HTMLRewrite.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Core/Rewriter.h head/contrib/llvm/tools/clang/include/clang/Sema/AnalysisBasedWarnings.h head/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h head/contrib/llvm/tools/clang/include/clang/Sema/IdentifierResolver.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h head/contrib/llvm/tools/clang/include/clang/Sema/MultiplexExternalSemaSource.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Sema/SemaDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h head/contrib/llvm/tools/clang/include/clang/Sema/Template.h head/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h head/contrib/llvm/tools/clang/include/clang/Sema/TypoCorrection.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/Serialization/GlobalModuleIndex.h head/contrib/llvm/tools/clang/include/clang/Serialization/ModuleManager.h head/contrib/llvm/tools/clang/include/clang/Serialization/SerializationDiagnostic.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerRegistry.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h head/contrib/llvm/tools/clang/include/clang/Tooling/ArgumentsAdjusters.h head/contrib/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h head/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h head/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h head/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/FileRemapper.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.h head/contrib/llvm/tools/clang/lib/AST/APValue.cpp head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/AttrImpl.cpp head/contrib/llvm/tools/clang/lib/AST/CXXABI.h head/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp head/contrib/llvm/tools/clang/lib/AST/Comment.cpp head/contrib/llvm/tools/clang/lib/AST/CommentCommandTraits.cpp head/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp head/contrib/llvm/tools/clang/lib/AST/CommentParser.cpp head/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp head/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/InheritViz.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/Mangle.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp head/contrib/llvm/tools/clang/lib/AST/RawCommentList.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtIterator.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFGReachabilityAnalysis.cpp head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp head/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/Module.cpp head/contrib/llvm/tools/clang/lib/Basic/ObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp head/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCUDARuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h head/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h head/contrib/llvm/tools/clang/lib/Driver/Action.cpp head/contrib/llvm/tools/clang/lib/Driver/CC1AsOptions.cpp head/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/DriverOptions.cpp head/contrib/llvm/tools/clang/lib/Driver/InputInfo.h head/contrib/llvm/tools/clang/lib/Driver/Job.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h head/contrib/llvm/tools/clang/lib/Driver/Types.cpp head/contrib/llvm/tools/clang/lib/Driver/WindowsToolChain.cpp head/contrib/llvm/tools/clang/lib/Edit/Commit.cpp head/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp head/contrib/llvm/tools/clang/lib/Format/BreakableToken.h head/contrib/llvm/tools/clang/lib/Format/Format.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.h head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp head/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h head/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp head/contrib/llvm/tools/clang/lib/Frontend/ChainedIncludesSource.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp head/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendOptions.cpp head/contrib/llvm/tools/clang/lib/Frontend/HeaderIncludeGen.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/MultiplexConsumer.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h head/contrib/llvm/tools/clang/lib/Headers/avxintrin.h head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/f16cintrin.h head/contrib/llvm/tools/clang/lib/Headers/immintrin.h head/contrib/llvm/tools/clang/lib/Headers/limits.h head/contrib/llvm/tools/clang/lib/Headers/module.map head/contrib/llvm/tools/clang/lib/Headers/prfchwintrin.h head/contrib/llvm/tools/clang/lib/Headers/rdseedintrin.h head/contrib/llvm/tools/clang/lib/Headers/rtmintrin.h head/contrib/llvm/tools/clang/lib/Headers/smmintrin.h head/contrib/llvm/tools/clang/lib/Headers/tgmath.h head/contrib/llvm/tools/clang/lib/Headers/unwind.h head/contrib/llvm/tools/clang/lib/Headers/x86intrin.h head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h head/contrib/llvm/tools/clang/lib/Headers/xopintrin.h head/contrib/llvm/tools/clang/lib/Lex/HeaderMap.cpp head/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Lex/ModuleMap.cpp head/contrib/llvm/tools/clang/lib/Lex/PPConditionalDirectiveRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp head/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h head/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseInit.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h head/contrib/llvm/tools/clang/lib/Rewrite/Core/HTMLRewrite.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Core/Rewriter.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FixItRewriter.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteMacros.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp head/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp head/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaFixItUtils.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h head/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/GeneratePCH.cpp head/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp head/contrib/llvm/tools/clang/lib/Serialization/ModuleManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangSACheckers.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/Tooling/ArgumentsAdjusters.cpp head/contrib/llvm/tools/clang/lib/Tooling/CommonOptionsParser.cpp head/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp head/contrib/llvm/tools/clang/lib/Tooling/FileMatchTrie.cpp head/contrib/llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp head/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp head/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp head/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/tools/clang/tools/driver/driver.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h head/contrib/llvm/tools/llc/llc.cpp head/contrib/llvm/tools/lli/RemoteTarget.cpp head/contrib/llvm/tools/lli/RemoteTarget.h head/contrib/llvm/tools/lli/lli.cpp head/contrib/llvm/tools/llvm-ar/llvm-ar.cpp head/contrib/llvm/tools/llvm-as/llvm-as.cpp head/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp head/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp head/contrib/llvm/tools/llvm-diff/llvm-diff.cpp head/contrib/llvm/tools/llvm-dis/llvm-dis.cpp head/contrib/llvm/tools/llvm-extract/llvm-extract.cpp head/contrib/llvm/tools/llvm-link/llvm-link.cpp head/contrib/llvm/tools/llvm-mc/Disassembler.cpp head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp head/contrib/llvm/tools/llvm-nm/llvm-nm.cpp head/contrib/llvm/tools/llvm-objdump/COFFDump.cpp head/contrib/llvm/tools/llvm-objdump/ELFDump.cpp head/contrib/llvm/tools/llvm-objdump/MachODump.cpp head/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp head/contrib/llvm/tools/llvm-objdump/llvm-objdump.h head/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp head/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp head/contrib/llvm/tools/llvm-readobj/MachODumper.cpp head/contrib/llvm/tools/llvm-readobj/llvm-readobj.cpp head/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp head/contrib/llvm/tools/llvm-stress/llvm-stress.cpp head/contrib/llvm/tools/llvm-symbolizer/LLVMSymbolize.cpp head/contrib/llvm/tools/llvm-symbolizer/LLVMSymbolize.h head/contrib/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp head/contrib/llvm/tools/macho-dump/macho-dump.cpp head/contrib/llvm/tools/opt/opt.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterInst.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.h head/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h head/contrib/llvm/utils/TableGen/CodeGenMapTable.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp head/contrib/llvm/utils/TableGen/CodeGenSchedule.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/DAGISelEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcher.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcher.h head/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherOpt.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/OptParserEmitter.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h head/contrib/llvm/utils/TableGen/SetTheory.cpp head/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp head/contrib/llvm/utils/TableGen/TGValueTypes.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerTables.h head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.h head/etc/mtree/BSD.include.dist head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/include/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangast/Makefile head/lib/clang/libclangcodegen/Makefile head/lib/clang/libclangdriver/Makefile head/lib/clang/libclangparse/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libclangstaticanalyzercheckers/Makefile head/lib/clang/libclangstaticanalyzercore/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmarmdesc/Makefile head/lib/clang/libllvmasmprinter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvmdebuginfo/Makefile head/lib/clang/libllvmexecutionengine/Makefile head/lib/clang/libllvminstrumentation/Makefile head/lib/clang/libllvmjit/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmmipsdesc/Makefile head/lib/clang/libllvmobject/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmpowerpcdesc/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmvectorize/Makefile head/lib/clang/libllvmx86desc/Makefile head/share/mk/bsd.sys.mk head/sys/amd64/conf/GENERIC head/sys/conf/kern.mk head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/sys/param.h head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile head/usr.bin/clang/bugpoint/bugpoint.1 head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/clang.prog.mk head/usr.bin/clang/clang/Makefile head/usr.bin/clang/clang/clang.1 head/usr.bin/clang/llc/Makefile head/usr.bin/clang/llc/llc.1 head/usr.bin/clang/lli/Makefile head/usr.bin/clang/lli/lli.1 head/usr.bin/clang/llvm-ar/Makefile head/usr.bin/clang/llvm-ar/llvm-ar.1 head/usr.bin/clang/llvm-as/llvm-as.1 head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 head/usr.bin/clang/llvm-diff/llvm-diff.1 head/usr.bin/clang/llvm-dis/llvm-dis.1 head/usr.bin/clang/llvm-extract/llvm-extract.1 head/usr.bin/clang/llvm-link/llvm-link.1 head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-nm/Makefile head/usr.bin/clang/llvm-nm/llvm-nm.1 head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/opt/Makefile head/usr.bin/clang/opt/opt.1 head/usr.bin/clang/tblgen/tblgen.1 Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Feb 16 19:41:44 2014 (r261990) +++ head/ObsoleteFiles.inc Sun Feb 16 19:44:07 2014 (r261991) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20140216: new clang import which bumps version from 3.3 to 3.4. +OLD_FILES+=usr/bin/llvm-prof +OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/include/clang/3.3/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.3/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.3/altivec.h +OLD_FILES+=usr/include/clang/3.3/ammintrin.h +OLD_FILES+=usr/include/clang/3.3/avx2intrin.h +OLD_FILES+=usr/include/clang/3.3/avxintrin.h +OLD_FILES+=usr/include/clang/3.3/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.3/bmiintrin.h +OLD_FILES+=usr/include/clang/3.3/cpuid.h +OLD_FILES+=usr/include/clang/3.3/emmintrin.h +OLD_FILES+=usr/include/clang/3.3/f16cintrin.h +OLD_FILES+=usr/include/clang/3.3/fma4intrin.h +OLD_FILES+=usr/include/clang/3.3/fmaintrin.h +OLD_FILES+=usr/include/clang/3.3/immintrin.h +OLD_FILES+=usr/include/clang/3.3/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.3/mm3dnow.h +OLD_FILES+=usr/include/clang/3.3/mm_malloc.h +OLD_FILES+=usr/include/clang/3.3/mmintrin.h +OLD_FILES+=usr/include/clang/3.3/module.map +OLD_FILES+=usr/include/clang/3.3/nmmintrin.h +OLD_FILES+=usr/include/clang/3.3/pmmintrin.h +OLD_FILES+=usr/include/clang/3.3/popcntintrin.h +OLD_FILES+=usr/include/clang/3.3/prfchwintrin.h +OLD_FILES+=usr/include/clang/3.3/rdseedintrin.h +OLD_FILES+=usr/include/clang/3.3/rtmintrin.h +OLD_FILES+=usr/include/clang/3.3/smmintrin.h +OLD_FILES+=usr/include/clang/3.3/tmmintrin.h +OLD_FILES+=usr/include/clang/3.3/wmmintrin.h +OLD_FILES+=usr/include/clang/3.3/x86intrin.h +OLD_FILES+=usr/include/clang/3.3/xmmintrin.h +OLD_FILES+=usr/include/clang/3.3/xopintrin.h +OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_DIRS+=usr/include/clang/3.3 # 20140205: Open Firmware device moved OLD_FILES+=usr/include/dev/ofw/ofw_nexus.h # 20140128: libelf and libdwarf import Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Feb 16 19:41:44 2014 (r261990) +++ head/UPDATING Sun Feb 16 19:44:07 2014 (r261991) @@ -32,6 +32,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20140216: + Clang and llvm have been upgraded to 3.4 release. + +20140216: The nve(4) driver has been removed. Please use the nfe(4) driver for NVIDIA nForce MCP Ethernet adapters instead. Modified: head/contrib/gcc/libgcc2.c ============================================================================== --- head/contrib/gcc/libgcc2.c Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/gcc/libgcc2.c Sun Feb 16 19:44:07 2014 (r261991) @@ -2007,8 +2007,8 @@ __eprintf (const char *string, const cha /* Clear part of an instruction cache. */ void -__clear_cache (char *beg __attribute__((__unused__)), - char *end __attribute__((__unused__))) +__clear_cache (void *beg __attribute__((__unused__)), + void *end __attribute__((__unused__))) { #ifdef CLEAR_INSN_CACHE CLEAR_INSN_CACHE (beg, end); Modified: head/contrib/gcc/libgcc2.h ============================================================================== --- head/contrib/gcc/libgcc2.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/gcc/libgcc2.h Sun Feb 16 19:44:07 2014 (r261991) @@ -35,7 +35,7 @@ Software Foundation, 51 Franklin Street, #endif extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t); -extern void __clear_cache (char *, char *); +extern void __clear_cache (void *, void *); extern void __eprintf (const char *, const char *, unsigned int, const char *) __attribute__ ((__noreturn__)); Modified: head/contrib/llvm/LICENSE.TXT ============================================================================== --- head/contrib/llvm/LICENSE.TXT Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/LICENSE.TXT Sun Feb 16 19:44:07 2014 (r261991) @@ -68,3 +68,4 @@ Google Test llvm/utils/unittest/ OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} ARM contributions llvm/lib/Target/ARM/LICENSE.TXT +md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h Modified: head/contrib/llvm/include/llvm-c/BitReader.h ============================================================================== --- head/contrib/llvm/include/llvm-c/BitReader.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/BitReader.h Sun Feb 16 19:44:07 2014 (r261991) @@ -34,7 +34,7 @@ extern "C" { /* Builds a module from the bitcode in the specified memory buffer, returning a reference to the module via the OutModule parameter. Returns 0 on success. - Optionally returns a human-readable error message via OutMessage. */ + Optionally returns a human-readable error message via OutMessage. */ LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule, char **OutMessage); @@ -44,7 +44,7 @@ LLVMBool LLVMParseBitcodeInContext(LLVMC /** Reads a module from the specified path, returning via the OutMP parameter a module provider which performs lazy deserialization. Returns 0 on success. - Optionally returns a human-readable error message via OutMessage. */ + Optionally returns a human-readable error message via OutMessage. */ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, Modified: head/contrib/llvm/include/llvm-c/BitWriter.h ============================================================================== --- head/contrib/llvm/include/llvm-c/BitWriter.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/BitWriter.h Sun Feb 16 19:44:07 2014 (r261991) @@ -34,7 +34,7 @@ extern "C" { /*===-- Operations on modules ---------------------------------------------===*/ -/** Writes a module to the specified path. Returns 0 on success. */ +/** Writes a module to the specified path. Returns 0 on success. */ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path); /** Writes a module to an open file descriptor. Returns 0 on success. */ @@ -42,7 +42,7 @@ int LLVMWriteBitcodeToFD(LLVMModuleRef M int Unbuffered); /** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file - descriptor. Returns 0 on success. Closes the Handle. */ + descriptor. Returns 0 on success. Closes the Handle. */ int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); /** Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/Core.h Sun Feb 16 19:44:07 2014 (r261991) @@ -165,7 +165,9 @@ typedef enum { a temporary measure until the API/ABI impact to the C API is understood and the path forward agreed upon. LLVMAddressSafety = 1ULL << 32, - LLVMStackProtectStrongAttribute = 1ULL<<33 + LLVMStackProtectStrongAttribute = 1ULL<<33, + LLVMCold = 1ULL << 34, + LLVMOptimizeNone = 1ULL << 35 */ } LLVMAttribute; @@ -220,6 +222,7 @@ typedef enum { LLVMPtrToInt = 39, LLVMIntToPtr = 40, LLVMBitCast = 41, + LLVMAddrSpaceCast = 60, /* Other Operators */ LLVMICmp = 42, @@ -272,7 +275,7 @@ typedef enum { LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/ LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something equivalent. */ - LLVMLinkOnceODRAutoHideLinkage, /**< Like LinkOnceODR, but possibly hidden. */ + LLVMLinkOnceODRAutoHideLinkage, /**< Obsolete */ LLVMWeakAnyLinkage, /**< Keep one copy of function when linking (weak) */ LLVMWeakODRLinkage, /**< Same, but only replaced by something equivalent. */ @@ -299,6 +302,8 @@ typedef enum { LLVMCCallConv = 0, LLVMFastCallConv = 8, LLVMColdCallConv = 9, + LLVMWebKitJSCallConv = 12, + LLVMAnyRegCallConv = 13, LLVMX86StdcallCallConv = 64, LLVMX86FastcallCallConv = 65 } LLVMCallConv; @@ -352,26 +357,26 @@ typedef enum { LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */ LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees somewhat sane results, lock free. */ - LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the - operations affecting a specific address, + LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the + operations affecting a specific address, a consistent ordering exists */ - LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort - necessary to acquire a lock to access other + LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort + necessary to acquire a lock to access other memory with normal loads and stores. */ - LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with - a barrier of the sort necessary to release + LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with + a barrier of the sort necessary to release a lock. */ - LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a - Release barrier (for fences and + LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a + Release barrier (for fences and operations which both read and write memory). */ - LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics - for loads and Release - semantics for stores. - Additionally, it guarantees - that a total ordering exists - between all - SequentiallyConsistent + LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics + for loads and Release + semantics for stores. + Additionally, it guarantees + that a total ordering exists + between all + SequentiallyConsistent operations. */ } LLVMAtomicOrdering; @@ -384,16 +389,16 @@ typedef enum { LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */ LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */ LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the - original using a signed comparison and return + original using a signed comparison and return the old one */ LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the - original using a signed comparison and return + original using a signed comparison and return the old one */ LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the - original using an unsigned comparison and return + original using an unsigned comparison and return the old one */ LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the - original using an unsigned comparison and return + original using an unsigned comparison and return the old one */ } LLVMAtomicRMWBinOp; @@ -406,13 +411,37 @@ void LLVMInitializeCore(LLVMPassRegistry /** Deallocate and destroy all ManagedStatic variables. @see llvm::llvm_shutdown @see ManagedStatic */ -void LLVMShutdown(); +void LLVMShutdown(void); /*===-- Error handling ----------------------------------------------------===*/ +char *LLVMCreateMessage(const char *Message); void LLVMDisposeMessage(char *Message); +typedef void (*LLVMFatalErrorHandler)(const char *Reason); + +/** + * Install a fatal error handler. By default, if LLVM detects a fatal error, it + * will call exit(1). This may not be appropriate in many contexts. For example, + * doing exit(1) will bypass many crash reporting/tracing system tools. This + * function allows you to install a callback that will be invoked prior to the + * call to exit(1). + */ +void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler); + +/** + * Reset the fatal error handler. This resets LLVM's fatal error handling + * behavior to the default. + */ +void LLVMResetFatalErrorHandler(void); + +/** + * Enable LLVM's built-in stack trace code. This intercepts the OS's crash + * signals and prints which component of LLVM you were in at the time if the + * crash. + */ +void LLVMEnablePrettyStackTrace(void); /** * @defgroup LLVMCCoreContext Contexts @@ -458,7 +487,7 @@ unsigned LLVMGetMDKindID(const char* Nam /** * @defgroup LLVMCCoreModule Modules * - * Modules represent the top-level structure in a LLVM program. An LLVM + * Modules represent the top-level structure in an LLVM program. An LLVM * module is effectively a translation unit or a collection of * translation units merged together. * @@ -538,6 +567,14 @@ LLVMBool LLVMPrintModuleToFile(LLVMModul char **ErrorMessage); /** + * Return a string representation of the module. Use + * LLVMDisposeMessage to free the string. + * + * @see Module::print() + */ +char *LLVMPrintModuleToString(LLVMModuleRef M); + +/** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() @@ -689,6 +726,21 @@ LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty) LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty); /** + * Dump a representation of a type to stderr. + * + * @see llvm::Type::dump() + */ +void LLVMDumpType(LLVMTypeRef Val); + +/** + * Return a string representation of the type. Use + * LLVMDisposeMessage to free the string. + * + * @see llvm::Type::print() + */ +char *LLVMPrintTypeToString(LLVMTypeRef Val); + +/** * @defgroup LLVMCCoreTypeInt Integer Types * * Functions in this section operate on integer types. @@ -1039,7 +1091,7 @@ LLVMTypeRef LLVMX86MMXType(void); * hierarchy of classes within this type. Depending on the instance * obtained, not all APIs are available. * - * Callers can determine the type of a LLVMValueRef by calling the + * Callers can determine the type of an LLVMValueRef by calling the * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These * functions are defined by a macro, so it isn't obvious which are * available by looking at the Doxygen source code. Instead, look at the @@ -1061,6 +1113,9 @@ LLVMTypeRef LLVMX86MMXType(void); macro(BlockAddress) \ macro(ConstantAggregateZero) \ macro(ConstantArray) \ + macro(ConstantDataSequential) \ + macro(ConstantDataArray) \ + macro(ConstantDataVector) \ macro(ConstantExpr) \ macro(ConstantFP) \ macro(ConstantInt) \ @@ -1105,6 +1160,7 @@ LLVMTypeRef LLVMX86MMXType(void); macro(UnaryInstruction) \ macro(AllocaInst) \ macro(CastInst) \ + macro(AddrSpaceCastInst) \ macro(BitCastInst) \ macro(FPExtInst) \ macro(FPToSIInst) \ @@ -1160,6 +1216,14 @@ void LLVMSetValueName(LLVMValueRef Val, void LLVMDumpValue(LLVMValueRef Val); /** + * Return a string representation of the value. Use + * LLVMDisposeMessage to free the string. + * + * @see llvm::Value::print() + */ +char *LLVMPrintValueToString(LLVMValueRef Val); + +/** * Replace all uses of a value with another one. * * @see llvm::Value::replaceAllUsesWith() @@ -1179,7 +1243,7 @@ LLVMBool LLVMIsUndef(LLVMValueRef Val); /** * Convert value instances between types. * - * Internally, a LLVMValueRef is "pinned" to a specific type. This + * Internally, an LLVMValueRef is "pinned" to a specific type. This * series of functions allows you to cast an instance to a specific * type. * @@ -1201,7 +1265,7 @@ LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLAR * This module defines functions that allow you to inspect the uses of a * LLVMValueRef. * - * It is possible to obtain a LLVMUseRef for any LLVMValueRef instance. + * It is possible to obtain an LLVMUseRef for any LLVMValueRef instance. * Each LLVMUseRef (which corresponds to a llvm::Use instance) holds a * llvm::User and llvm::Value. * @@ -1568,6 +1632,7 @@ LLVMValueRef LLVMConstFPToSI(LLVMValueRe LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, @@ -1623,8 +1688,33 @@ const char *LLVMGetSection(LLVMValueRef void LLVMSetSection(LLVMValueRef Global, const char *Section); LLVMVisibility LLVMGetVisibility(LLVMValueRef Global); void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); -unsigned LLVMGetAlignment(LLVMValueRef Global); -void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes); + +/** + * @defgroup LLVMCCoreValueWithAlignment Values with alignment + * + * Functions in this group only apply to values with alignment, i.e. + * global variables, load and store instructions. + */ + +/** + * Obtain the preferred alignment of the value. + * @see llvm::LoadInst::getAlignment() + * @see llvm::StoreInst::getAlignment() + * @see llvm::GlobalValue::getAlignment() + */ +unsigned LLVMGetAlignment(LLVMValueRef V); + +/** + * Set the preferred alignment of the value. + * @see llvm::LoadInst::setAlignment() + * @see llvm::StoreInst::setAlignment() + * @see llvm::GlobalValue::setAlignment() + */ +void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes); + +/** + * @} + */ /** * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables @@ -1804,7 +1894,7 @@ LLVMValueRef LLVMGetParam(LLVMValueRef F /** * Obtain the function to which this argument belongs. * - * Unlike other functions in this group, this one takes a LLVMValueRef + * Unlike other functions in this group, this one takes an LLVMValueRef * that corresponds to a llvm::Attribute. * * The returned LLVMValueRef is the llvm::Function to which this @@ -1829,7 +1919,7 @@ LLVMValueRef LLVMGetLastParam(LLVMValueR /** * Obtain the next parameter to a function. * - * This takes a LLVMValueRef obtained from LLVMGetFirstParam() (which is + * This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is * actually a wrapped iterator) and obtains the next parameter from the * underlying iterator. */ @@ -1978,12 +2068,12 @@ void LLVMGetMDNodeOperands(LLVMValueRef LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB); /** - * Determine whether a LLVMValueRef is itself a basic block. + * Determine whether an LLVMValueRef is itself a basic block. */ LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val); /** - * Convert a LLVMValueRef to a LLVMBasicBlockRef instance. + * Convert an LLVMValueRef to an LLVMBasicBlockRef instance. */ LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val); @@ -2140,7 +2230,7 @@ LLVMValueRef LLVMGetFirstInstruction(LLV /** * Obtain the last instruction in a basic block. * - * The returned LLVMValueRef corresponds to a LLVM:Instruction. + * The returned LLVMValueRef corresponds to an LLVM:Instruction. */ LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB); @@ -2322,12 +2412,12 @@ void LLVMAddIncoming(LLVMValueRef PhiNod unsigned LLVMCountIncoming(LLVMValueRef PhiNode); /** - * Obtain an incoming value to a PHI node as a LLVMValueRef. + * Obtain an incoming value to a PHI node as an LLVMValueRef. */ LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index); /** - * Obtain an incoming value to a PHI node as a LLVMBasicBlockRef. + * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef. */ LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index); @@ -2518,6 +2608,8 @@ LLVMValueRef LLVMBuildIntToPtr(LLVMBuild LLVMTypeRef DestTy, const char *Name); LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name); LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, @@ -2571,9 +2663,9 @@ LLVMValueRef LLVMBuildIsNotNull(LLVMBuil const char *Name); LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); -LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, - LLVMValueRef PTR, LLVMValueRef Val, - LLVMAtomicOrdering ordering, +LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, + LLVMValueRef PTR, LLVMValueRef Val, + LLVMAtomicOrdering ordering, LLVMBool singleThread); /** @@ -2706,16 +2798,16 @@ void LLVMDisposePassManager(LLVMPassMana initialization succeeded. Must be executed in isolation from all other LLVM api calls. @see llvm::llvm_start_multithreaded */ -LLVMBool LLVMStartMultithreaded(); +LLVMBool LLVMStartMultithreaded(void); /** Deallocate structures necessary to make LLVM safe for multithreading. Must be executed in isolation from all other LLVM api calls. @see llvm::llvm_stop_multithreaded */ -void LLVMStopMultithreaded(); +void LLVMStopMultithreaded(void); /** Check whether LLVM is executing in thread-safe mode or not. @see llvm::llvm_is_multithreaded */ -LLVMBool LLVMIsMultithreaded(); +LLVMBool LLVMIsMultithreaded(void); /** * @} Modified: head/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Disassembler.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/Disassembler.h Sun Feb 16 19:44:07 2014 (r261991) @@ -42,7 +42,7 @@ typedef void *LLVMDisasmContextRef; * instruction are specified by the Offset parameter and its byte widith is the * size parameter. For instructions sets with fixed widths and one symbolic * operand per instruction, the Offset parameter will be zero and Size parameter - * will be the instruction width. The information is returned in TagBuf and is + * will be the instruction width. The information is returned in TagBuf and is * Triple specific with its specific information defined by the value of * TagType for that Triple. If symbolic information is returned the function * returns 1, otherwise it returns 0. @@ -58,7 +58,7 @@ typedef int (*LLVMOpInfoCallback)(void * * SubtractSymbol can be link edited independent of each other. Many other * platforms only allow a relocatable expression of the form AddSymbol + Offset * to be encoded. - * + * * The LLVMOpInfoCallback() for the TagType value of 1 uses the struct * LLVMOpInfo1. The value of the relocatable expression for the operand, * including any PC adjustment, is passed in to the call back in the Value @@ -130,6 +130,17 @@ typedef const char *(*LLVMSymbolLookupCa /* The output reference is to a cstring address in a literal pool. */ #define LLVMDisassembler_ReferenceType_Out_LitPool_CstrAddr 3 +/* The output reference is to a Objective-C CoreFoundation string. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_CFString_Ref 4 +/* The output reference is to a Objective-C message. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Message 5 +/* The output reference is to a Objective-C message ref. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Message_Ref 6 +/* The output reference is to a Objective-C selector ref. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Selector_Ref 7 +/* The output reference is to a Objective-C class ref. */ +#define LLVMDisassembler_ReferenceType_Out_Objc_Class_Ref 8 + #ifdef __cplusplus extern "C" { #endif /* !defined(__cplusplus) */ @@ -170,6 +181,10 @@ int LLVMSetDisasmOptions(LLVMDisasmConte #define LLVMDisassembler_Option_PrintImmHex 2 /* The option use the other assembler printer variant */ #define LLVMDisassembler_Option_AsmPrinterVariant 4 +/* The option to set comment on instructions */ +#define LLVMDisassembler_Option_SetInstrComments 8 + /* The option to print latency information alongside instructions */ +#define LLVMDisassembler_Option_PrintLatency 16 /** * Dispose of a disassembler context. Modified: head/contrib/llvm/include/llvm-c/ExecutionEngine.h ============================================================================== --- head/contrib/llvm/include/llvm-c/ExecutionEngine.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/ExecutionEngine.h Sun Feb 16 19:44:07 2014 (r261991) @@ -40,12 +40,14 @@ void LLVMLinkInInterpreter(void); typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; +typedef struct LLVMOpaqueMCJITMemoryManager *LLVMMCJITMemoryManagerRef; struct LLVMMCJITCompilerOptions { unsigned OptLevel; LLVMCodeModel CodeModel; LLVMBool NoFramePointerElim; LLVMBool EnableFastISel; + LLVMMCJITMemoryManagerRef MCJMM; }; /*===-- Operations on generic values --------------------------------------===*/ @@ -167,12 +169,44 @@ void LLVMAddGlobalMapping(LLVMExecutionE void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global); +/*===-- Operations on memory managers -------------------------------------===*/ + +typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)( + void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, + const char *SectionName); +typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)( + void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID, + const char *SectionName, LLVMBool IsReadOnly); +typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)( + void *Opaque, char **ErrMsg); +typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque); + +/** + * Create a simple custom MCJIT memory manager. This memory manager can + * intercept allocations in a module-oblivious way. This will return NULL + * if any of the passed functions are NULL. + * + * @param Opaque An opaque client object to pass back to the callbacks. + * @param AllocateCodeSection Allocate a block of memory for executable code. + * @param AllocateDataSection Allocate a block of memory for data. + * @param FinalizeMemory Set page permissions and flush cache. Return 0 on + * success, 1 on error. + */ +LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager( + void *Opaque, + LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection, + LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection, + LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory, + LLVMMemoryManagerDestroyCallback Destroy); + +void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM); + /** * @} */ #ifdef __cplusplus -} +} #endif /* defined(__cplusplus) */ #endif Copied: head/contrib/llvm/include/llvm-c/IRReader.h (from r259740, vendor/llvm/dist/include/llvm-c/IRReader.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm-c/IRReader.h Sun Feb 16 19:44:07 2014 (r261991, copy of r259740, vendor/llvm/dist/include/llvm-c/IRReader.h) @@ -0,0 +1,40 @@ +/*===-- llvm-c/IRReader.h - IR Reader C Interface -----------------*- C -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines the C interface to the IR Reader. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_IRREADER_H +#define LLVM_C_IRREADER_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Read LLVM IR from a memory buffer and convert it into an in-memory Module + * object. Returns 0 on success. + * Optionally returns a human-readable description of any errors that + * occured during parsing IR. OutMessage must be disposed with + * LLVMDisposeMessage. + * + * @see llvm::ParseIR() + */ +LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, + char **OutMessage); + +#ifdef __cplusplus +} +#endif + +#endif Modified: head/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h ============================================================================== --- head/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Sun Feb 16 19:44:07 2014 (r261991) @@ -4,7 +4,7 @@ // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -// +// //===----------------------------------------------------------------------===// // // This header provides a C API to use the LLVM link time optimization @@ -46,7 +46,7 @@ extern "C" { // Added C-specific error codes LLVM_LTO_NULL_OBJECT } llvm_lto_status_t; - + /// This provides C interface to initialize link time optimizer. This allows /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer. /// extern "C" helps, because dlopen() interface uses name to find the symbol. Modified: head/contrib/llvm/include/llvm-c/Object.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Object.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/Object.h Sun Feb 16 19:44:07 2014 (r261991) @@ -100,4 +100,3 @@ const char *LLVMGetRelocationValueString #endif /* defined(__cplusplus) */ #endif - Copied: head/contrib/llvm/include/llvm-c/Support.h (from r259740, vendor/llvm/dist/include/llvm-c/Support.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm-c/Support.h Sun Feb 16 19:44:07 2014 (r261991, copy of r259740, vendor/llvm/dist/include/llvm-c/Support.h) @@ -0,0 +1,35 @@ +/*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines the C interface to the LLVM support library. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_SUPPORT_H +#define LLVM_C_SUPPORT_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function permanently loads the dynamic library at the given path. + * It is safe to call this function multiple times for the same library. + * + * @see sys::DynamicLibrary::LoadLibraryPermanently() + */ +LLVMBool LLVMLoadLibraryPermanently(const char* Filename); + +#ifdef __cplusplus +} +#endif + +#endif Modified: head/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Target.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/Target.h Sun Feb 16 19:44:07 2014 (r261991) @@ -22,6 +22,10 @@ #include "llvm-c/Core.h" #include "llvm/Config/llvm-config.h" +#if defined(_MSC_VER) && !defined(inline) +#define inline __inline +#endif + #ifdef __cplusplus extern "C" { #endif @@ -37,14 +41,13 @@ enum LLVMByteOrdering { LLVMBigEndian, L typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef; typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef; -typedef struct LLVMStructLayout *LLVMStructLayoutRef; /* Declare all of the target-initialization functions that are available. */ #define LLVM_TARGET(TargetName) \ void LLVMInitialize##TargetName##TargetInfo(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ - + #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ @@ -53,7 +56,7 @@ typedef struct LLVMStructLayout *LLVMStr void LLVMInitialize##TargetName##TargetMC(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ - + /* Declare all of the available assembly printer initialization functions. */ #define LLVM_ASM_PRINTER(TargetName) \ void LLVMInitialize##TargetName##AsmPrinter(void); @@ -71,7 +74,7 @@ typedef struct LLVMStructLayout *LLVMStr void LLVMInitialize##TargetName##Disassembler(void); #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ - + /** LLVMInitializeAllTargetInfos - The main program should call this function if it wants access to all available targets that LLVM is configured to support. */ @@ -98,7 +101,7 @@ static inline void LLVMInitializeAllTarg #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry. */ @@ -107,7 +110,7 @@ static inline void LLVMInitializeAllAsmP #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry. */ @@ -116,7 +119,7 @@ static inline void LLVMInitializeAllAsmP #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry. */ @@ -126,9 +129,9 @@ static inline void LLVMInitializeAllDisa #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ } - + /** LLVMInitializeNativeTarget - The main program should call this function to - initialize the native target corresponding to the host. This is useful + initialize the native target corresponding to the host. This is useful for JIT applications to ensure that the target gets linked in correctly. */ static inline LLVMBool LLVMInitializeNativeTarget(void) { /* If we have a native target, initialize it to ensure it is linked in. */ @@ -140,7 +143,43 @@ static inline LLVMBool LLVMInitializeNat #else return 1; #endif -} +} + +/** LLVMInitializeNativeTargetAsmParser - The main program should call this + function to initialize the parser for the native target corresponding to the + host. */ +static inline LLVMBool LLVMInitializeNativeAsmParser(void) { +#ifdef LLVM_NATIVE_ASMPARSER + LLVM_NATIVE_ASMPARSER(); + return 0; +#else + return 1; +#endif +} + +/** LLVMInitializeNativeTargetAsmPrinter - The main program should call this + function to initialize the printer for the native target corresponding to + the host. */ +static inline LLVMBool LLVMInitializeNativeAsmPrinter(void) { +#ifdef LLVM_NATIVE_ASMPRINTER + LLVM_NATIVE_ASMPRINTER(); + return 0; +#else + return 1; +#endif +} + +/** LLVMInitializeNativeTargetDisassembler - The main program should call this + function to initialize the disassembler for the native target corresponding + to the host. */ +static inline LLVMBool LLVMInitializeNativeDisassembler(void) { +#ifdef LLVM_NATIVE_DISASSEMBLER + LLVM_NATIVE_DISASSEMBLER(); + return 0; +#else + return 1; +#endif +} /*===-- Target Data -------------------------------------------------------===*/ @@ -151,83 +190,94 @@ LLVMTargetDataRef LLVMCreateTargetData(c /** Adds target data information to a pass manager. This does not take ownership of the target data. See the method llvm::PassManagerBase::add. */ -void LLVMAddTargetData(LLVMTargetDataRef, LLVMPassManagerRef); +void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM); /** Adds target library information to a pass manager. This does not take ownership of the target library info. See the method llvm::PassManagerBase::add. */ -void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef, LLVMPassManagerRef); +void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI, + LLVMPassManagerRef PM); /** Converts target data to a target layout string. The string must be disposed with LLVMDisposeMessage. See the constructor llvm::DataLayout::DataLayout. */ -char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef); +char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD); /** Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian. See the method llvm::DataLayout::isLittleEndian. */ -enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef); +enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD); /** Returns the pointer size in bytes for a target. See the method llvm::DataLayout::getPointerSize. */ -unsigned LLVMPointerSize(LLVMTargetDataRef); +unsigned LLVMPointerSize(LLVMTargetDataRef TD); /** Returns the pointer size in bytes for a target for a specified address space. See the method llvm::DataLayout::getPointerSize. */ -unsigned LLVMPointerSizeForAS(LLVMTargetDataRef, unsigned AS); +unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS); + +/** Returns the integer type that is the same size as a pointer on a target. + See the method llvm::DataLayout::getIntPtrType. */ +LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD); + +/** Returns the integer type that is the same size as a pointer on a target. + This version allows the address space to be specified. + See the method llvm::DataLayout::getIntPtrType. */ +LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS); /** Returns the integer type that is the same size as a pointer on a target. See the method llvm::DataLayout::getIntPtrType. */ -LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef); +LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD); /** Returns the integer type that is the same size as a pointer on a target. This version allows the address space to be specified. See the method llvm::DataLayout::getIntPtrType. */ -LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef, unsigned AS); +LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, + unsigned AS); /** Computes the size of a type in bytes for a target. See the method llvm::DataLayout::getTypeSizeInBits. */ -unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef, LLVMTypeRef); +unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the storage size of a type in bytes for a target. See the method llvm::DataLayout::getTypeStoreSize. */ -unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the ABI size of a type in bytes for a target. See the method llvm::DataLayout::getTypeAllocSize. */ -unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the ABI alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize. */ -unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the call frame alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize. */ -unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the preferred alignment of a type in bytes for a target. See the method llvm::DataLayout::getTypeABISize. */ -unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); +unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty); /** Computes the preferred alignment of a global variable in bytes for a target. See the method llvm::DataLayout::getPreferredAlignment. */ -unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef, +unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD, LLVMValueRef GlobalVar); /** Computes the structure element that contains the byte offset for a target. See the method llvm::StructLayout::getElementContainingOffset. */ -unsigned LLVMElementAtOffset(LLVMTargetDataRef, LLVMTypeRef StructTy, +unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned long long Offset); /** Computes the byte offset of the indexed struct element for a target. See the method llvm::StructLayout::getElementContainingOffset. */ -unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy, - unsigned Element); +unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, + LLVMTypeRef StructTy, unsigned Element); /** Deallocates a TargetData. See the destructor llvm::DataLayout::~DataLayout. */ -void LLVMDisposeTargetData(LLVMTargetDataRef); +void LLVMDisposeTargetData(LLVMTargetDataRef TD); /** * @} Modified: head/contrib/llvm/include/llvm-c/TargetMachine.h ============================================================================== --- head/contrib/llvm/include/llvm-c/TargetMachine.h Sun Feb 16 19:41:44 2014 (r261990) +++ head/contrib/llvm/include/llvm-c/TargetMachine.h Sun Feb 16 19:44:07 2014 (r261991) @@ -57,11 +57,21 @@ typedef enum { } LLVMCodeGenFileType; /** Returns the first llvm::Target in the registered targets list. */ -LLVMTargetRef LLVMGetFirstTarget(); +LLVMTargetRef LLVMGetFirstTarget(void); /** Returns the next llvm::Target given a previous one (or null if there's none) */ LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T); /*===-- Target ------------------------------------------------------------===*/ +/** Finds the target corresponding to the given name and stores it in \p T. + Returns 0 on success. */ +LLVMTargetRef LLVMGetTargetFromName(const char *Name); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:44:30 2014 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 ESMTPS id D4380DCC; Sun, 16 Feb 2014 19:44:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCFD918DB; Sun, 16 Feb 2014 19:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJiUi8009228; Sun, 16 Feb 2014 19:44:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJiUID009227; Sun, 16 Feb 2014 19:44:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161944.s1GJiUID009227@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:44:30 +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: r261992 - stable/8 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:44:30 -0000 Author: brueffer Date: Sun Feb 16 19:44:30 2014 New Revision: 261992 URL: http://svnweb.freebsd.org/changeset/base/261992 Log: Direct commit to stable/8 to note that the nve(4) driver has been deprecated. Modified: stable/8/UPDATING Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Sun Feb 16 19:44:07 2014 (r261991) +++ stable/8/UPDATING Sun Feb 16 19:44:30 2014 (r261992) @@ -15,6 +15,12 @@ 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. +20140216: + The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has + been deprecated and will not be part of FreeBSD 11.0 and later + releases. If you use this driver, please consider switching to + the nfe(4) driver instead. + 20131216: The behavior of gss_pseudo_random() for the krb5 mechanism has changed, for applications requesting a longer random string From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 19:46:21 2014 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 ESMTPS id 2F3B0FC3; Sun, 16 Feb 2014 19:46:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F229B18EF; Sun, 16 Feb 2014 19:46:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJkKtD009651; Sun, 16 Feb 2014 19:46:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJkKqn009650; Sun, 16 Feb 2014 19:46:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161946.s1GJkKqn009650@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261993 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 19:46:21 -0000 Author: marcel Date: Sun Feb 16 19:46:20 2014 New Revision: 261993 URL: http://svnweb.freebsd.org/changeset/base/261993 Log: MFC r258448: Have the GPT probe return a lower priority when the MBR is not a PMBR. Modified: stable/10/sys/geom/part/g_part_gpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Sun Feb 16 19:44:30 2014 (r261992) +++ stable/10/sys/geom/part/g_part_gpt.c Sun Feb 16 19:46:20 2014 (r261993) @@ -758,8 +758,8 @@ static int g_part_gpt_probe(struct g_part_table *table, struct g_consumer *cp) { struct g_provider *pp; - char *buf; - int error, res; + u_char *buf; + int error, index, pri, res; /* We don't nest, which means that our depth should be 0. */ if (table->gpt_depth != 0) @@ -784,11 +784,21 @@ g_part_gpt_probe(struct g_part_table *ta if (pp->sectorsize < MBRSIZE || pp->mediasize < 6 * pp->sectorsize) return (ENOSPC); - /* Check that there's a MBR. */ + /* + * Check that there's a MBR or a PMBR. If it's a PMBR, we return + * as the highest priority on a match, otherwise we assume some + * GPT-unaware tool has destroyed the GPT by recreating a MBR and + * we really want the MBR scheme to take precedence. + */ buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) return (error); res = le16dec(buf + DOSMAGICOFFSET); + pri = G_PART_PROBE_PRI_LOW; + for (index = 0; index < NDOSPART; index++) { + if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee) + pri = G_PART_PROBE_PRI_HIGH; + } g_free(buf); if (res != DOSMAGIC) return (ENXIO); @@ -800,7 +810,7 @@ g_part_gpt_probe(struct g_part_table *ta res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); if (res == 0) - return (G_PART_PROBE_PRI_HIGH); + return (pri); /* No primary? Check that there's a secondary. */ buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, @@ -809,7 +819,7 @@ g_part_gpt_probe(struct g_part_table *ta return (error); res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); - return ((res == 0) ? G_PART_PROBE_PRI_HIGH : ENXIO); + return ((res == 0) ? pri : ENXIO); } static int From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 20:02:30 2014 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 ESMTPS id 809BC35F; Sun, 16 Feb 2014 20:02:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69C6F1A05; Sun, 16 Feb 2014 20:02:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GK2UCV017791; Sun, 16 Feb 2014 20:02:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GK2Uum017790; Sun, 16 Feb 2014 20:02:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162002.s1GK2Uum017790@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261994 - stable/10/games/fortune/fortune X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 20:02:30 -0000 Author: marcel Date: Sun Feb 16 20:02:29 2014 New Revision: 261994 URL: http://svnweb.freebsd.org/changeset/base/261994 Log: MFC r259056: Fix r203922 for "fortune -o". Modified: stable/10/games/fortune/fortune/fortune.c Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/fortune/fortune.c ============================================================================== --- stable/10/games/fortune/fortune/fortune.c Sun Feb 16 19:46:20 2014 (r261993) +++ stable/10/games/fortune/fortune/fortune.c Sun Feb 16 20:02:29 2014 (r261994) @@ -486,7 +486,7 @@ add_file(int percent, const char *file, if (Offend) { if (was_malloc) free(tpath); - path = offensive; + path = tpath = offensive; offensive = NULL; was_malloc = TRUE; DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path)); @@ -508,7 +508,7 @@ over: if (All_forts && offensive != NULL) { if (was_malloc) free(tpath); - path = offensive; + path = tpath = offensive; offensive = NULL; was_malloc = TRUE; DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path)); From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 20:13:19 2014 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 ESMTPS id 24C496EA; Sun, 16 Feb 2014 20:13:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1013B1AA5; Sun, 16 Feb 2014 20:13:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKDIU0022613; Sun, 16 Feb 2014 20:13:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKDIiw022612; Sun, 16 Feb 2014 20:13:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162013.s1GKDIiw022612@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261995 - stable/10/games/fortune/fortune X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 20:13:19 -0000 Author: marcel Date: Sun Feb 16 20:13:18 2014 New Revision: 261995 URL: http://svnweb.freebsd.org/changeset/base/261995 Log: MFC r259057: Remove "Warning: file \"%s\" unreadable". It was introduced with revision 44599 and turned less than useful ever since fortunes-o.dat got removed. Modified: stable/10/games/fortune/fortune/fortune.c Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/fortune/fortune.c ============================================================================== --- stable/10/games/fortune/fortune/fortune.c Sun Feb 16 20:02:29 2014 (r261994) +++ stable/10/games/fortune/fortune/fortune.c Sun Feb 16 20:13:18 2014 (r261995) @@ -806,10 +806,6 @@ is_fortfile(const char *file, char **dat strcat(datfile, ".dat"); if (access(datfile, R_OK) < 0) { DPRINTF(2, (stderr, "FALSE (no readable \".dat\" file)\n")); -#ifdef DEBUG - if (Debug < 2) - DPRINTF(0, (stderr, "Warning: file \"%s\" unreadable\n", datfile)); -#endif free(datfile); return (FALSE); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 20:26:23 2014 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 ESMTPS id 27738CB2; Sun, 16 Feb 2014 20:26:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 118741BA7; Sun, 16 Feb 2014 20:26:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKQMm0027672; Sun, 16 Feb 2014 20:26:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKQMqO027671; Sun, 16 Feb 2014 20:26:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162026.s1GKQMqO027671@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261996 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 20:26:23 -0000 Author: marcel Date: Sun Feb 16 20:26:22 2014 New Revision: 261996 URL: http://svnweb.freebsd.org/changeset/base/261996 Log: MFC r259244: Allow pmap_remove_pages() to be called for physical maps not associated with the current thread. Modified: stable/10/sys/ia64/ia64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 20:13:18 2014 (r261995) +++ stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 20:26:22 2014 (r261996) @@ -2118,19 +2118,16 @@ pmap_remove_pages(pmap_t pmap) { struct pv_chunk *pc, *npc; struct ia64_lpte *pte; + pmap_t oldpmap; pv_entry_t pv; vm_offset_t va; vm_page_t m; u_long inuse, bitmask; int allfree, bit, field, idx; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: %s called with non-current pmap\n", - __func__); - return; - } rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); + oldpmap = pmap_switch(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; for (field = 0; field < _NPCM; field++) { @@ -2170,8 +2167,9 @@ pmap_remove_pages(pmap_t pmap) free_pv_chunk(pc); } } - rw_wunlock(&pvh_global_lock); + pmap_switch(oldpmap); PMAP_UNLOCK(pmap); + rw_wunlock(&pvh_global_lock); } /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 20:37:40 2014 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 ESMTPS id 33BFAEC; Sun, 16 Feb 2014 20:37:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EBA31C64; Sun, 16 Feb 2014 20:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKbdvN032240; Sun, 16 Feb 2014 20:37:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKbdnJ032239; Sun, 16 Feb 2014 20:37:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162037.s1GKbdnJ032239@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261997 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 20:37:40 -0000 Author: marcel Date: Sun Feb 16 20:37:39 2014 New Revision: 261997 URL: http://svnweb.freebsd.org/changeset/base/261997 Log: MFC r259441: Properly drain the TTY when both revoke(2) and close(2) end up closing the TTY. Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Sun Feb 16 20:26:22 2014 (r261996) +++ stable/10/sys/kern/tty.c Sun Feb 16 20:37:39 2014 (r261997) @@ -191,8 +191,10 @@ ttydev_leave(struct tty *tp) /* Drain any output. */ MPASS((tp->t_flags & TF_STOPPED) == 0); - if (!tty_gone(tp)) - tty_drain(tp); + if (!tty_gone(tp)) { + while (tty_drain(tp) == ERESTART) + ; + } ttydisc_close(tp); From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 20:45:13 2014 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 ESMTPS id 75A5F587; Sun, 16 Feb 2014 20:45:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60C091D01; Sun, 16 Feb 2014 20:45:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKjDve036209; Sun, 16 Feb 2014 20:45:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKjDGB036208; Sun, 16 Feb 2014 20:45:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162045.s1GKjDGB036208@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261998 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 20:45:13 -0000 Author: marcel Date: Sun Feb 16 20:45:12 2014 New Revision: 261998 URL: http://svnweb.freebsd.org/changeset/base/261998 Log: MFC r259838: Add another HP iLO serial (console) port, found on Itanium servers. Modified: stable/10/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_pci.c Sun Feb 16 20:37:39 2014 (r261997) +++ stable/10/sys/dev/uart/uart_bus_pci.c Sun Feb 16 20:45:12 2014 (r261998) @@ -82,6 +82,7 @@ static const struct pci_id pci_ns8250_id 0x10 }, { 0x103c, 0x1048, 0x103c, 0x1301, "HP Diva RMP3", 0x14 }, { 0x103c, 0x1290, 0xffff, 0, "HP Auxiliary Diva Serial Port", 0x18 }, +{ 0x103c, 0x3301, 0xffff, 0, "HP iLO serial port", 0x10 }, { 0x11c1, 0x0480, 0xffff, 0, "Agere Systems Venus Modem (V90, 56KFlex)", 0x14 }, { 0x115d, 0x0103, 0xffff, 0, "Xircom Cardbus Ethernet + 56k Modem", 0x10 }, { 0x1282, 0x6585, 0xffff, 0, "Davicom 56PDV PCI Modem", 0x10 }, From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 20:54:27 2014 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 ESMTPS id 3EA4F702; Sun, 16 Feb 2014 20:54:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27FAF1D8B; Sun, 16 Feb 2014 20:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKsRmW040260; Sun, 16 Feb 2014 20:54:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKsRjI040259; Sun, 16 Feb 2014 20:54:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162054.s1GKsRjI040259@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261999 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 20:54:27 -0000 Author: marcel Date: Sun Feb 16 20:54:26 2014 New Revision: 261999 URL: http://svnweb.freebsd.org/changeset/base/261999 Log: MFC r259908: For ia64, use pmap_remove_pages() and not pmap_remove(). Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Sun Feb 16 20:45:12 2014 (r261998) +++ stable/10/sys/vm/vm_pageout.c Sun Feb 16 20:54:26 2014 (r261999) @@ -875,6 +875,14 @@ vm_pageout_map_deactivate_pages(map, des tmpe = tmpe->next; } +#ifdef __ia64__ + /* + * Remove all non-wired, managed mappings if a process is swapped out. + * This will free page table pages. + */ + if (desired == 0) + pmap_remove_pages(map->pmap); +#else /* * Remove all mappings if a process is swapped out, this will free page * table pages. @@ -883,6 +891,8 @@ vm_pageout_map_deactivate_pages(map, des pmap_remove(vm_map_pmap(map), vm_map_min(map), vm_map_max(map)); } +#endif + vm_map_unlock(map); } #endif /* !defined(NO_SWAPPING) */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 21:53:34 2014 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 ESMTPS id 1785A1F3; Sun, 16 Feb 2014 21:53:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03B0912C1; Sun, 16 Feb 2014 21:53:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GLrXw5066153; Sun, 16 Feb 2014 21:53:33 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GLrXPw066152; Sun, 16 Feb 2014 21:53:33 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201402162153.s1GLrXPw066152@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Feb 2014 21:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262000 - head/contrib/atf 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 21:53:34 -0000 Author: jmmv Date: Sun Feb 16 21:53:33 2014 New Revision: 262000 URL: http://svnweb.freebsd.org/changeset/base/262000 Log: Undefine HAVE_VSNPRINTF_IN_STD. Should fix the build with g++/libstdc++. This is what we used to do prior the import of atf 0.20 and the build worked just fine with both libstdc++ and libc++. Still investigating how to properly fix this upstream so that we do not hit the same issue on the next import. Modified: head/contrib/atf/bconfig.h Modified: head/contrib/atf/bconfig.h ============================================================================== --- head/contrib/atf/bconfig.h Sun Feb 16 20:54:26 2014 (r261999) +++ head/contrib/atf/bconfig.h Sun Feb 16 21:53:33 2014 (r262000) @@ -56,7 +56,7 @@ #define HAVE_UNSETENV 1 /* Define to 1 if vsnprintf is in std */ -#define HAVE_VSNPRINTF_IN_STD 1 +/* #undef HAVE_VSNPRINTF_IN_STD */ /* Define to the sub-directory in which libtool stores uninstalled libraries. */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 22:01:44 2014 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 ESMTPS id B33C456B; Sun, 16 Feb 2014 22:01:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6881352; Sun, 16 Feb 2014 22:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GM1ikN070454; Sun, 16 Feb 2014 22:01:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GM1iDC070453; Sun, 16 Feb 2014 22:01:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162201.s1GM1iDC070453@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 22:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262001 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 22:01:44 -0000 Author: marcel Date: Sun Feb 16 22:01:44 2014 New Revision: 262001 URL: http://svnweb.freebsd.org/changeset/base/262001 Log: MFC r260666: In the nested TLB fault handler, for a direct-mapped address, make sure to clear the lower 12 bits. Modified: stable/10/sys/ia64/ia64/exception.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/exception.S ============================================================================== --- stable/10/sys/ia64/ia64/exception.S Sun Feb 16 21:53:33 2014 (r262000) +++ stable/10/sys/ia64/ia64/exception.S Sun Feb 16 22:01:44 2014 (r262001) @@ -1026,7 +1026,7 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) } { .mii mov cr.itir=r26 -(p12) dep r28=0,r30,61,3 +(p12) dep r28=0,r30,0,12 (p13) extr.u r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3 // dir L0 index ;; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 22:12:13 2014 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 ESMTPS id D39947E1; Sun, 16 Feb 2014 22:12:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF0AA1438; Sun, 16 Feb 2014 22:12:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GMCD2p075199; Sun, 16 Feb 2014 22:12:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GMCDBc075198; Sun, 16 Feb 2014 22:12:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162212.s1GMCDBc075198@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 22:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262002 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 22:12:13 -0000 Author: marcel Date: Sun Feb 16 22:12:13 2014 New Revision: 262002 URL: http://svnweb.freebsd.org/changeset/base/262002 Log: MFC r260914: In pmap_set_pte(), make sure to enforce ordering by inserting a memory fence. Modified: stable/10/sys/ia64/ia64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 22:01:44 2014 (r262001) +++ stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 22:12:13 2014 (r262002) @@ -1318,6 +1318,8 @@ pmap_set_pte(struct ia64_lpte *pte, vm_o pte->itir = PAGE_SHIFT << 2; + ia64_mf(); + pte->tag = ia64_ttag(va); } @@ -1336,8 +1338,8 @@ pmap_remove_pte(pmap_t pmap, struct ia64 * First remove from the VHPT. */ error = pmap_remove_vhpt(va); - if (error) - return (error); + KASSERT(error == 0, ("%s: pmap_remove_vhpt returned %d", + __func__, error)); pmap_invalidate_page(va); From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 22:48:36 2014 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 ESMTPS id C75CBE55; Sun, 16 Feb 2014 22:48:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1B3B1652; Sun, 16 Feb 2014 22:48:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GMmabn089256; Sun, 16 Feb 2014 22:48:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GMmaXv089255; Sun, 16 Feb 2014 22:48:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402162248.s1GMmaXv089255@svn.freebsd.org> From: Dimitry Andric Date: Sun, 16 Feb 2014 22:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262003 - head/sys/i386/xbox 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 22:48:36 -0000 Author: dim Date: Sun Feb 16 22:48:36 2014 New Revision: 262003 URL: http://svnweb.freebsd.org/changeset/base/262003 Log: After r261980, the local ptr variable in xbox_init() is no longer used, breaking the LINT build. Pointy hat to: brueffer Modified: head/sys/i386/xbox/xbox.c Modified: head/sys/i386/xbox/xbox.c ============================================================================== --- head/sys/i386/xbox/xbox.c Sun Feb 16 22:12:13 2014 (r262002) +++ head/sys/i386/xbox/xbox.c Sun Feb 16 22:48:36 2014 (r262003) @@ -51,7 +51,6 @@ xbox_poweroff(void* junk, int howto) static void xbox_init(void) { - char* ptr; if (!arch_i386_is_xbox) return; From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 23:03:10 2014 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 ESMTPS id ADB1498; Sun, 16 Feb 2014 23:03:10 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4113E1749; Sun, 16 Feb 2014 23:03:10 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 6530CB806F; Mon, 17 Feb 2014 00:03:07 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 4FCD728497; Mon, 17 Feb 2014 00:03:07 +0100 (CET) Date: Mon, 17 Feb 2014 00:03:07 +0100 From: Jilles Tjoelker To: Marcel Moolenaar , ed@FreeBSD.org Subject: Re: svn commit: r259441 - head/sys/kern Message-ID: <20140216230306.GA33995@stack.nl> References: <201312160050.rBG0oFjY071411@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312160050.rBG0oFjY071411@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 23:03:10 -0000 On Mon, Dec 16, 2013 at 12:50:15AM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Dec 16 00:50:14 2013 > New Revision: 259441 > URL: http://svnweb.freebsd.org/changeset/base/259441 > Log: > Properly drain the TTY when both revoke(2) and close(2) end up closing > the TTY. In such a case, ttydev_close() is called multiple times and > each time, t_revokecnt is incremented and cv_broadcast() is called for > both the t_outwait and t_inwait condition variables. > Let's say revoke(2) comes in first and gets to call tty_drain() from > ttydev_leave(). Let's say that the revoke comes from init(8) as the > result of running "shutdown -r now". Since shutdown prints various > messages to the console before announing that the machine will reboot > immediately, let's also say that the output queue is not empty and > that tty_drain() has something to do. Let's assume this all happens > on a 9600 baud serial console, so it takes a time to drain. > The shutdown command will exit(2) and as such will end up closing > stdout. Let's say this close will come in second, bump t_revokecnt > and call tty_wakeup(). This has tty_wait() return prematurely and > the next thing that will happen is that the thread doing revoke(2) > will flush the TTY. Since the drain wasn't complete, the flush will > effectively drop whatever is left in t_outq. > This change takes into account that tty_drain() will return ERESTART > due to the fact that t_revokecnt was bumped and in that case simply > call tty_drain() again. The thread in question is already performing > the close so it can safely finish draining the TTY before destroying > the TTY structure. > Now all messages from shutdown will be printed on the serial console. > Obtained from: Juniper Networks, Inc. > Modified: > head/sys/kern/tty.c > Modified: head/sys/kern/tty.c > ============================================================================== > --- head/sys/kern/tty.c Sun Dec 15 23:49:42 2013 (r259440) > +++ head/sys/kern/tty.c Mon Dec 16 00:50:14 2013 (r259441) > @@ -191,8 +191,10 @@ ttydev_leave(struct tty *tp) > > /* Drain any output. */ > MPASS((tp->t_flags & TF_STOPPED) == 0); > - if (!tty_gone(tp)) > - tty_drain(tp); > + if (!tty_gone(tp)) { > + while (tty_drain(tp) == ERESTART) > + ; > + } > > ttydisc_close(tp); > Unfortunately, this is only correct if the [ERESTART] is because of the (tp->t_revokecnt != revokecnt) check. If cv_wait_sig() returned ERESTART, it will return ERESTART immediately the next time it is called, until the signal has been handled. Therefore, if a process performing the last close of a TTY via close(2) receives a signal with SA_RESTART set, it will spin until the data has drained. Formerly, the data would be discarded when the signal was received (without reflecting this in close(2)'s return value, since ttydev_leave() returns nothing and ttydev_close() always returns 0). One way to fix this would be to replicate the revokecnt check into ttydev_leave() so that tty_drain() is only retried if t_revokecnt changed. Discarding data because of a signal is not ideal, but I think leaving a process unkillable because of a drain that will never complete is worse. A process that cares about data in TTY buffers can use tcdrain(3) and handle signals and errors normally. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 23:08:21 2014 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 ESMTPS id D6F8E208; Sun, 16 Feb 2014 23:08:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C04651765; Sun, 16 Feb 2014 23:08:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GN8LMj098065; Sun, 16 Feb 2014 23:08:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GN8LqU098064; Sun, 16 Feb 2014 23:08:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162308.s1GN8LqU098064@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 23:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262004 - stable/10/sys/ia64/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 23:08:21 -0000 Author: marcel Date: Sun Feb 16 23:08:21 2014 New Revision: 262004 URL: http://svnweb.freebsd.org/changeset/base/262004 Log: MFC r260175: Implement atomic_swap_. Modified: stable/10/sys/ia64/include/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/include/atomic.h ============================================================================== --- stable/10/sys/ia64/include/atomic.h Sun Feb 16 22:48:36 2014 (r262003) +++ stable/10/sys/ia64/include/atomic.h Sun Feb 16 23:08:21 2014 (r262004) @@ -386,4 +386,32 @@ atomic_fetchadd_long(volatile u_long *p, return (value); } +/* + * atomic_swap_(volatile *p, v); + */ + +static __inline uint32_t +atomic_swap_32(volatile uint32_t *p, uint32_t v) +{ + uint32_t r; + + __asm __volatile ("xchg4 %0 = %3, %2;;" : "=r"(r), "=m"(*p) : + "r"(v), "m"(*p) : "memory"); + return (r); +} + +static __inline uint64_t +atomic_swap_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t r; + + __asm __volatile ("xchg8 %0 = %3, %2;;" : "=r"(r), "=m"(*p) : + "r"(v), "m"(*p) : "memory"); + return (r); +} + +#define atomic_swap_int atomic_swap_32 +#define atomic_swap_long atomic_swap_64 +#define atomic_swap_ptr atomic_swap_64 + #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 16 23:10:47 2014 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 ESMTPS id 3741F34B; Sun, 16 Feb 2014 23:10:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23C0D17CB; Sun, 16 Feb 2014 23:10:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GNAl3P099174; Sun, 16 Feb 2014 23:10:47 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GNAkbQ099173; Sun, 16 Feb 2014 23:10:46 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402162310.s1GNAkbQ099173@svn.freebsd.org> From: Bryan Drewery Date: Sun, 16 Feb 2014 23:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262005 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 16 Feb 2014 23:10:47 -0000 Author: bdrewery Date: Sun Feb 16 23:10:46 2014 New Revision: 262005 URL: http://svnweb.freebsd.org/changeset/base/262005 Log: Remove redundant memcpy of fd_ofiles in fdgrowtable() added in r247602 Discussed with: mjg Approved by: bapt (mentor) MFC after: 2 weeks Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Feb 16 23:08:21 2014 (r262004) +++ head/sys/kern/kern_descrip.c Sun Feb 16 23:10:46 2014 (r262005) @@ -1537,7 +1537,6 @@ fdgrowtable(struct filedesc *fdp, int nf memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); /* update the pointers and counters */ - memcpy(ntable, otable, onfiles * sizeof(ntable[0])); fdp->fd_ofiles = ntable; fdp->fd_map = nmap; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 00:00:39 2014 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 ESMTPS id C204DD03; Mon, 17 Feb 2014 00:00:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB1F31AD4; Mon, 17 Feb 2014 00:00:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H00dwO021148; Mon, 17 Feb 2014 00:00:39 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H00dsP021119; Mon, 17 Feb 2014 00:00:39 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402170000.s1H00dsP021119@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 00:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262006 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 00:00:39 -0000 Author: bdrewery Date: Mon Feb 17 00:00:39 2014 New Revision: 262006 URL: http://svnweb.freebsd.org/changeset/base/262006 Log: Fix M_FILEDESC leak in fdgrowtable() introduced in r244510. fdgrowtable() now only reallocates fd_map when necessary. This fixes fdgrowtable() to use the same logic as fdescfree() for when to free the fd_map. The logic in fdescfree() is intended to not free the initial static allocation, however the fd_map grows at a slower rate than the table does. The table is intended to hold 20 fd, but its initial map has many more slots than 20. The slot sizing causes NDSLOTS(20) through NDSLOTS(63) to be 1 which matches NDSLOTS(20), so fdescfree() was assuming that the fd_map was still the initial allocation and not freeing it. This partially reverts r244510 by reintroducing some of the logic it removed in fdgrowtable(). Reviewed by: mjg Approved by: bapt (mentor) MFC after: 2 weeks Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Feb 16 23:10:46 2014 (r262005) +++ head/sys/kern/kern_descrip.c Mon Feb 17 00:00:39 2014 (r262006) @@ -1521,7 +1521,7 @@ fdgrowtable(struct filedesc *fdp, int nf return; /* - * Allocate a new table and map. We need enough space for the + * Allocate a new table. We need enough space for the * file entries themselves and the struct freetable we will use * when we decommission the table and place it on the freelist. * We place the struct freetable in the middle so we don't have @@ -1529,16 +1529,20 @@ fdgrowtable(struct filedesc *fdp, int nf */ ntable = malloc(nnfiles * sizeof(ntable[0]) + sizeof(struct freetable), M_FILEDESC, M_ZERO | M_WAITOK); - nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, - M_ZERO | M_WAITOK); - /* copy the old data over and point at the new tables */ memcpy(ntable, otable, onfiles * sizeof(*otable)); - memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); - - /* update the pointers and counters */ fdp->fd_ofiles = ntable; - fdp->fd_map = nmap; + + /* Allocate a new map only if the old is not large enough. It will + * grow at a slower rate than the table as it can map more + * entries than the table can hold. */ + if (NDSLOTS(nnfiles) > NDSLOTS(onfiles)) { + nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, + M_ZERO | M_WAITOK); + /* copy over the old data and update the pointer */ + memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); + fdp->fd_map = nmap; + } /* * In order to have a valid pattern for fget_unlocked() @@ -1554,8 +1558,6 @@ fdgrowtable(struct filedesc *fdp, int nf * reference entries within it. Instead, place it on a freelist * which will be processed when the struct filedesc is released. * - * Do, however, free the old map. - * * Note that if onfiles == NDFILE, we're dealing with the original * static allocation contained within (struct filedesc0 *)fdp, * which must not be freed. @@ -1565,8 +1567,12 @@ fdgrowtable(struct filedesc *fdp, int nf fdp0 = (struct filedesc0 *)fdp; ft->ft_table = otable; SLIST_INSERT_HEAD(&fdp0->fd_free, ft, ft_next); - free(omap, M_FILEDESC); } + /* The map does not have the same possibility of threads still + * holding references to it. So always free it as long as it + * does not reference the original static allocation. */ + if (NDSLOTS(onfiles) > NDSLOTS(NDFILE)) + free(omap, M_FILEDESC); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 01:37:02 2014 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 ESMTPS id 6B501773; Mon, 17 Feb 2014 01:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5186211E4; Mon, 17 Feb 2014 01:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H1b2em063713; Mon, 17 Feb 2014 01:37:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H1aruu063646; Mon, 17 Feb 2014 01:36:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402170136.s1H1aruu063646@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Feb 2014 01:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262007 - in stable/10: contrib/libpcap share/man/man9 sys/dev/ath sys/dev/bwi sys/dev/bwn sys/dev/ipw sys/dev/iwi sys/dev/iwn sys/dev/malo sys/dev/mwl sys/dev/ral sys/dev/usb/wlan sys/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 01:37:02 -0000 Author: kevlo Date: Mon Feb 17 01:36:53 2014 New Revision: 262007 URL: http://svnweb.freebsd.org/changeset/base/262007 Log: MFC r260444: Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED. The origin of WEP comes from IEEE Std 802.11-1997 where it defines whether the frame body of MAC frame has been encrypted using WEP algorithm or not. IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates whether the frame is protected by a cryptographic encapsulation algorithm. Reviewed by: adrian, rpaulo Modified: stable/10/contrib/libpcap/ieee80211.h stable/10/share/man/man9/ieee80211_crypto.9 stable/10/sys/dev/ath/if_ath_tx.c stable/10/sys/dev/bwi/if_bwi.c stable/10/sys/dev/bwn/if_bwn.c stable/10/sys/dev/ipw/if_ipw.c stable/10/sys/dev/iwi/if_iwi.c stable/10/sys/dev/iwn/if_iwn.c stable/10/sys/dev/malo/if_malo.c stable/10/sys/dev/mwl/if_mwl.c stable/10/sys/dev/ral/rt2560.c stable/10/sys/dev/ral/rt2661.c stable/10/sys/dev/ral/rt2860.c stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_rum.c stable/10/sys/dev/usb/wlan/if_run.c stable/10/sys/dev/usb/wlan/if_uath.c stable/10/sys/dev/usb/wlan/if_upgt.c stable/10/sys/dev/usb/wlan/if_ural.c stable/10/sys/dev/usb/wlan/if_urtw.c stable/10/sys/dev/usb/wlan/if_urtwn.c stable/10/sys/dev/usb/wlan/if_zyd.c stable/10/sys/dev/wi/if_wi.c stable/10/sys/dev/wpi/if_wpi.c stable/10/sys/net80211/ieee80211.h stable/10/sys/net80211/ieee80211_adhoc.c stable/10/sys/net80211/ieee80211_hostap.c stable/10/sys/net80211/ieee80211_mesh.c stable/10/sys/net80211/ieee80211_output.c stable/10/sys/net80211/ieee80211_proto.c stable/10/sys/net80211/ieee80211_sta.c stable/10/sys/net80211/ieee80211_wds.c stable/10/tools/tools/net80211/stumbler/stumbler.c stable/10/tools/tools/net80211/w00t/ap/ap.c stable/10/tools/tools/net80211/w00t/assoc/assoc.c stable/10/tools/tools/net80211/w00t/expand/expand.c stable/10/tools/tools/net80211/w00t/prga/prga.c stable/10/tools/tools/net80211/w00t/redir/redir.c stable/10/tools/tools/net80211/wesside/wesside/wesside.c stable/10/tools/tools/net80211/wlaninject/wlaninject.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libpcap/ieee80211.h ============================================================================== --- stable/10/contrib/libpcap/ieee80211.h Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/contrib/libpcap/ieee80211.h Mon Feb 17 01:36:53 2014 (r262007) @@ -90,7 +90,7 @@ #define IEEE80211_FC1_RETRY 0x08 #define IEEE80211_FC1_PWR_MGT 0x10 #define IEEE80211_FC1_MORE_DATA 0x20 -#define IEEE80211_FC1_WEP 0x40 +#define IEEE80211_FC1_PROTECTED 0x40 #define IEEE80211_FC1_ORDER 0x80 #define IEEE80211_SEQ_FRAG_MASK 0x000f Modified: stable/10/share/man/man9/ieee80211_crypto.9 ============================================================================== --- stable/10/share/man/man9/ieee80211_crypto.9 Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/share/man/man9/ieee80211_crypto.9 Mon Feb 17 01:36:53 2014 (r262007) @@ -236,7 +236,7 @@ For receive, drivers mark frames with th .Dv M_WEP mbuf flag to indicate the hardware has decrypted the payload. If frames have the -.Dv IEEE80211_FC1_WEP +.Dv IEEE80211_FC1_PROTECTED bit marked in their 802.11 header and are not tagged with .Dv M_WEP then decryption is done in software. Modified: stable/10/sys/dev/ath/if_ath_tx.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_tx.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ath/if_ath_tx.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1584,7 +1584,7 @@ ath_tx_normal_setup(struct ath_softc *sc ATH_TX_LOCK_ASSERT(sc); wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; + iswep = wh->i_fc[1] & IEEE80211_FC1_PROTECTED; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); isfrag = m0->m_flags & M_FRAG; hdrlen = ieee80211_anyhdrsize(wh); @@ -2214,7 +2214,7 @@ ath_tx_raw_start(struct ath_softc *sc, s sc->sc_tx_th.wt_tsf = htole64(tsf); sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (m0->m_flags & M_FRAG) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; Modified: stable/10/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/10/sys/dev/bwi/if_bwi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/bwi/if_bwi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1395,7 +1395,7 @@ bwi_start_locked(struct ifnet *ifp) ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { ieee80211_free_node(ni); @@ -3000,7 +3000,7 @@ bwi_encap(struct bwi_softc *sc, int idx, */ if (ieee80211_radiotap_active_vap(vap)) { sc->sc_tx_th.wt_flags = 0; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_DS && (ic->ic_flags & IEEE80211_F_SHPREAMBLE) && @@ -3183,7 +3183,7 @@ bwi_encap_raw(struct bwi_softc *sc, int if (ieee80211_radiotap_active_vap(vap)) { sc->sc_tx_th.wt_flags = 0; /* XXX IEEE80211_BPF_CRYPTO */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; @@ -3819,7 +3819,7 @@ bwi_rx_radiotap(struct bwi_softc *sc, st sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; wh = mtod(m, const struct ieee80211_frame_min *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_WEP; sc->sc_rx_th.wr_tsf = hdr->rxh_tsf; /* No endian convertion */ Modified: stable/10/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/10/sys/dev/bwn/if_bwn.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/bwn/if_bwn.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1316,7 +1316,7 @@ bwn_start_locked(struct ifnet *ifp) } KASSERT(ni != NULL, ("%s:%d: fail", __func__, __LINE__)); wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { ieee80211_free_node(ni); @@ -9780,7 +9780,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc */ if (ieee80211_radiotap_active_vap(vap)) { sc->sc_tx_th.wt_flags = 0; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (isshort && (rate == BWN_CCK_RATE_2MB || rate == BWN_CCK_RATE_5MB || @@ -10319,7 +10319,7 @@ bwn_rx_radiotap(struct bwn_mac *mac, str sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; wh = mtod(m, const struct ieee80211_frame_min *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_WEP; bwn_tsf_read(mac, &tsf); Modified: stable/10/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/10/sys/dev/ipw/if_ipw.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ipw/if_ipw.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1604,7 +1604,7 @@ ipw_tx_start(struct ifnet *ifp, struct m wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1628,7 +1628,7 @@ ipw_tx_start(struct ifnet *ifp, struct m shdr->hdr.type = htole32(IPW_HDR_TYPE_SEND); shdr->hdr.subtype = 0; - shdr->hdr.encrypted = (wh->i_fc[1] & IEEE80211_FC1_WEP) ? 1 : 0; + shdr->hdr.encrypted = (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) ? 1 : 0; shdr->hdr.encrypt = 0; shdr->hdr.keyidx = 0; shdr->hdr.keysz = 0; Modified: stable/10/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/10/sys/dev/iwi/if_iwi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/iwi/if_iwi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1849,7 +1849,7 @@ iwi_tx_start(struct ifnet *ifp, struct m } else staid = 0; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/10/sys/dev/iwn/if_iwn.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/iwn/if_iwn.c Mon Feb 17 01:36:53 2014 (r262007) @@ -3623,7 +3623,7 @@ iwn_tx_data(struct iwn_softc *sc, struct rate & IEEE80211_RATE_VAL); /* Encrypt the frame if need be. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { /* Retrieve key for TX. */ k = ieee80211_crypto_encap(ni, m); if (k == NULL) { Modified: stable/10/sys/dev/malo/if_malo.c ============================================================================== --- stable/10/sys/dev/malo/if_malo.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/malo/if_malo.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1101,7 +1101,7 @@ malo_tx_start(struct malo_softc *sc, str uint16_t qos; wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; + iswep = wh->i_fc[1] & IEEE80211_FC1_PROTECTED; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); copyhdrlen = hdrlen = ieee80211_anyhdrsize(wh); pktlen = m0->m_pkthdr.len; Modified: stable/10/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/10/sys/dev/mwl/if_mwl.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/mwl/if_mwl.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2885,12 +2885,13 @@ mwl_rx_proc(void *arg, int npending) * upper layer to put a station in power save * (except when configured with MWL_HOST_PS_SUPPORT). */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) m->m_flags |= M_WEP; #ifdef MWL_HOST_PS_SUPPORT - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; #else - wh->i_fc[1] &= ~(IEEE80211_FC1_WEP | IEEE80211_FC1_PWR_MGT); + wh->i_fc[1] &= ~(IEEE80211_FC1_PROTECTED | + IEEE80211_FC1_PWR_MGT); #endif if (ieee80211_radiotap_active(ic)) { @@ -3204,7 +3205,7 @@ mwl_tx_start(struct mwl_softc *sc, struc #endif wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; + iswep = wh->i_fc[1] & IEEE80211_FC1_PROTECTED; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); hdrlen = ieee80211_anyhdrsize(wh); copyhdrlen = hdrlen; Modified: stable/10/sys/dev/ral/rt2560.c ============================================================================== --- stable/10/sys/dev/ral/rt2560.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ral/rt2560.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1557,7 +1557,7 @@ rt2560_tx_mgt(struct rt2560_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1803,7 +1803,7 @@ rt2560_tx_data(struct rt2560_softc *sc, rate = ni->ni_txrate; } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/ral/rt2661.c ============================================================================== --- stable/10/sys/dev/ral/rt2661.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ral/rt2661.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1318,7 +1318,7 @@ rt2661_tx_mgt(struct rt2661_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1493,7 +1493,7 @@ rt2661_tx_data(struct rt2661_softc *sc, noack = cap->cap_wmeParams[ac].wmep_noackPolicy; } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/ral/rt2860.c ============================================================================== --- stable/10/sys/dev/ral/rt2860.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ral/rt2860.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1284,9 +1284,9 @@ rt2860_rx_intr(struct rt2860_softc *sc) wh = mtod(m, struct ieee80211_frame *); #ifdef HW_CRYPTO - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { /* frame is decrypted by hardware */ - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } #endif @@ -1492,7 +1492,7 @@ rt2860_tx(struct rt2860_softc *sc, struc wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { m_freem(m); Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1669,7 +1669,7 @@ rsu_tx_start(struct rsu_softc *sc, struc wh = mtod(m0, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rum.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_rum.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1120,7 +1120,7 @@ rum_tx_mgt(struct rum_softc *sc, struct sc->tx_nfree--; wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1238,7 +1238,7 @@ rum_tx_data(struct rum_softc *sc, struct else rate = ni->ni_txrate; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_run.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2793,8 +2793,8 @@ run_rx_frame(struct run_softc *sc, struc wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; m->m_flags |= M_WEP; } Modified: stable/10/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_uath.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_uath.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1625,7 +1625,7 @@ uath_tx_start(struct uath_softc *sc, str } wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_upgt.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_upgt.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2222,7 +2222,7 @@ upgt_tx_start(struct upgt_softc *sc, str * Software crypto. */ wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_ural.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_ural.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1119,7 +1119,7 @@ ural_tx_mgt(struct ural_softc *sc, struc tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1288,7 +1288,7 @@ ural_tx_data(struct ural_softc *sc, stru else rate = ni->ni_txrate; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtw.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_urtw.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1696,7 +1696,7 @@ urtw_tx_start(struct urtw_softc *sc, str /* * Software crypto. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1596,7 +1596,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s * Software crypto. */ wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_zyd.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_zyd.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2506,7 +2506,7 @@ zyd_tx_start(struct zyd_softc *sc, struc } } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/wi/if_wi.c ============================================================================== --- stable/10/sys/dev/wi/if_wi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/wi/if_wi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1003,7 +1003,7 @@ wi_start_locked(struct ifnet *ifp) mtod(m0, const uint8_t *) + ieee80211_hdrsize(wh)); frmhdr.wi_ehdr.ether_type = llc->llc_snap.ether_type; frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { ieee80211_free_node(ni); @@ -1106,7 +1106,7 @@ wi_raw_xmit(struct ieee80211_node *ni, s frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); if (params && (params->ibp_flags & IEEE80211_BPF_NOACK)) frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_ALTRTRY); - if ((wh->i_fc[1] & IEEE80211_FC1_WEP) && + if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && (!params || (params && (params->ibp_flags & IEEE80211_BPF_CRYPTO)))) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { Modified: stable/10/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/10/sys/dev/wpi/if_wpi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/wpi/if_wpi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1886,7 +1886,7 @@ wpi_tx_data(struct wpi_softc *sc, struct hdrlen = ieee80211_hdrsize(wh); ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1955,7 +1955,7 @@ wpi_tx_data(struct wpi_softc *sc, struct tap->wt_flags = 0; tap->wt_rate = rate; tap->wt_hwqueue = ac; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; ieee80211_radiotap_tx(vap, m0); Modified: stable/10/sys/net80211/ieee80211.h ============================================================================== --- stable/10/sys/net80211/ieee80211.h Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211.h Mon Feb 17 01:36:53 2014 (r262007) @@ -166,7 +166,7 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_FC1_RETRY 0x08 #define IEEE80211_FC1_PWR_MGT 0x10 #define IEEE80211_FC1_MORE_DATA 0x20 -#define IEEE80211_FC1_WEP 0x40 +#define IEEE80211_FC1_PROTECTED 0x40 #define IEEE80211_FC1_ORDER 0x80 #define IEEE80211_SEQ_FRAG_MASK 0x000f Modified: stable/10/sys/net80211/ieee80211_adhoc.c ============================================================================== --- stable/10/sys/net80211/ieee80211_adhoc.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_adhoc.c Mon Feb 17 01:36:53 2014 (r262007) @@ -474,7 +474,7 @@ adhoc_input(struct ieee80211_node *ni, s * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -492,7 +492,7 @@ adhoc_input(struct ieee80211_node *ni, s goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -630,7 +630,7 @@ adhoc_input(struct ieee80211_node *ni, s ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ Modified: stable/10/sys/net80211/ieee80211_hostap.c ============================================================================== --- stable/10/sys/net80211/ieee80211_hostap.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_hostap.c Mon Feb 17 01:36:53 2014 (r262007) @@ -693,7 +693,7 @@ hostap_input(struct ieee80211_node *ni, * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -711,7 +711,7 @@ hostap_input(struct ieee80211_node *ni, goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -855,7 +855,7 @@ hostap_input(struct ieee80211_node *ni, ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (subtype != IEEE80211_FC0_SUBTYPE_AUTH) { /* * Only shared key auth frames with a challenge @@ -883,7 +883,7 @@ hostap_input(struct ieee80211_node *ni, goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } /* * Pass the packet to radiotap before calling iv_recv_mgmt(). Modified: stable/10/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/10/sys/net80211/ieee80211_mesh.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_mesh.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1824,7 +1824,7 @@ mesh_input(struct ieee80211_node *ni, st ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ Modified: stable/10/sys/net80211/ieee80211_output.c ============================================================================== --- stable/10/sys/net80211/ieee80211_output.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_output.c Mon Feb 17 01:36:53 2014 (r262007) @@ -771,7 +771,7 @@ ieee80211_mgmt_output(struct ieee80211_n if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_AUTH, wh->i_addr1, "encrypting frame (%s)", __func__); - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; } m->m_flags |= M_ENCAP; /* mark encapsulated */ @@ -1496,7 +1496,7 @@ ieee80211_encap(struct ieee80211vap *vap (vap->iv_opmode == IEEE80211_M_STA ? !IEEE80211_KEY_UNDEFINED(key) : !IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)))) { - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; if (!ieee80211_crypto_enmic(vap, key, m, txfrag)) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_OUTPUT, eh.ether_dhost, Modified: stable/10/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/10/sys/net80211/ieee80211_proto.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_proto.c Mon Feb 17 01:36:53 2014 (r262007) @@ -447,7 +447,7 @@ ieee80211_dump_pkt(struct ieee80211com * printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID, qwh->i_qos[0] & IEEE80211_QOS_ACKPOLICY ? " ACM" : ""); } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { int off; off = ieee80211_anyhdrspace(ic, wh); Modified: stable/10/sys/net80211/ieee80211_sta.c ============================================================================== --- stable/10/sys/net80211/ieee80211_sta.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_sta.c Mon Feb 17 01:36:53 2014 (r262007) @@ -728,7 +728,7 @@ sta_input(struct ieee80211_node *ni, str * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -746,7 +746,7 @@ sta_input(struct ieee80211_node *ni, str goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -881,7 +881,7 @@ sta_input(struct ieee80211_node *ni, str ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (subtype != IEEE80211_FC0_SUBTYPE_AUTH) { /* * Only shared key auth frames with a challenge @@ -910,7 +910,7 @@ sta_input(struct ieee80211_node *ni, str goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } vap->iv_recv_mgmt(ni, m, subtype, rssi, nf); goto out; Modified: stable/10/sys/net80211/ieee80211_wds.c ============================================================================== --- stable/10/sys/net80211/ieee80211_wds.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_wds.c Mon Feb 17 01:36:53 2014 (r262007) @@ -556,7 +556,7 @@ wds_input(struct ieee80211_node *ni, str * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -574,7 +574,7 @@ wds_input(struct ieee80211_node *ni, str goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -708,7 +708,7 @@ wds_input(struct ieee80211_node *ni, str ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ Modified: stable/10/tools/tools/net80211/stumbler/stumbler.c ============================================================================== --- stable/10/tools/tools/net80211/stumbler/stumbler.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/stumbler/stumbler.c Mon Feb 17 01:36:53 2014 (r262007) @@ -711,7 +711,7 @@ int get_packet_info(struct ieee80211_fra else if (type == IEEE80211_FC0_TYPE_DATA && stype == IEEE80211_FC0_SUBTYPE_DATA) { - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { unsigned char* iv; node->wep = CRYPT_WEP; Modified: stable/10/tools/tools/net80211/w00t/ap/ap.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/ap/ap.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/ap/ap.c Mon Feb 17 01:36:53 2014 (r262007) @@ -509,7 +509,7 @@ void read_real_data(struct params *p, st memcpy(dst, wh->i_addr3, 6); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (!p->wep_len) { printf("Got wep but i aint wep\n"); return; @@ -737,7 +737,7 @@ void read_tap(struct params *p) wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_FROMDS; if (p->wep_len) - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; /* LLC & SNAP */ ptr = (char*) (wh+1); Modified: stable/10/tools/tools/net80211/w00t/assoc/assoc.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/assoc/assoc.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/assoc/assoc.c Mon Feb 17 01:36:53 2014 (r262007) @@ -368,7 +368,7 @@ void generic_process(struct ieee80211_fr ptr = (char*) (wh + 1); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (!p->wep_len) { char srca[3*6]; char dsta[3*6]; @@ -676,7 +676,7 @@ void read_tap(struct params *p) wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; if (p->wep_len) - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; /* LLC & SNAP */ ptr = (char*) (wh+1); Modified: stable/10/tools/tools/net80211/w00t/expand/expand.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/expand/expand.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/expand/expand.c Mon Feb 17 01:36:53 2014 (r262007) @@ -99,7 +99,7 @@ int wanted(struct params *p, struct ieee if (memcmp(bssid, p->ap, 6) != 0) return 0; - if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { printf("Got non WEP packet...\n"); return 0; } @@ -197,7 +197,7 @@ void send_mcast(struct params *p, unsign wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_dur[0] = 0x69; Modified: stable/10/tools/tools/net80211/w00t/prga/prga.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/prga/prga.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/prga/prga.c Mon Feb 17 01:36:53 2014 (r262007) @@ -190,7 +190,7 @@ void get_prga(struct params *p) if (memcmp(p->ap, bssid, 6) != 0) return; - if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { printf("Packet not WEP!\n"); return; } @@ -281,7 +281,7 @@ void send_frag(struct params *p) /* 802.11 */ wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; if (!last) wh->i_fc[1] |= IEEE80211_FC1_MORE_FRAG; @@ -527,7 +527,7 @@ void read_tap(struct params *p) wh = (struct ieee80211_frame*) p->packet; wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; wh->i_dur[0] = 0x69; Modified: stable/10/tools/tools/net80211/w00t/redir/redir.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/redir/redir.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/redir/redir.c Mon Feb 17 01:36:53 2014 (r262007) @@ -140,7 +140,7 @@ int wanted(struct params *p, struct ieee if (memcmp(bssid, p->ap, 6) != 0) return 0; - if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { printf("Got non WEP packet...\n"); return 0; } @@ -268,7 +268,7 @@ void send_header(struct params *p, struc wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_fc[1] |= IEEE80211_FC1_MORE_FRAG; wh->i_dur[0] = 0x69; @@ -345,7 +345,7 @@ void send_data(struct params *p) wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_dur[0] = 0x69; Modified: stable/10/tools/tools/net80211/wesside/wesside/wesside.c ============================================================================== --- stable/10/tools/tools/net80211/wesside/wesside/wesside.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/wesside/wesside/wesside.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1093,13 +1093,13 @@ void stuff_for_us(struct ieee80211_frame int dlen; dlen = len - sizeof(*wh) - 4 -4; - if (!( wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!( wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { time_print("WARNING: Got NON wep packet from %s dlen %d stype=%x\n", mac2str(wh->i_addr2), dlen, stype); return; } - assert (wh->i_fc[1] & IEEE80211_FC1_WEP); + assert (wh->i_fc[1] & IEEE80211_FC1_PROTECTED); if ((dlen == 36 || dlen == PADDED_ARPLEN) && rtrmac == (unsigned char*) 1) { rtrmac = (unsigned char *) malloc(6); @@ -1577,7 +1577,8 @@ void stuff_for_net(struct ieee80211_fram } // wep data! - if ( (wh->i_fc[1] & IEEE80211_FC1_WEP) && dlen > (4+8+4)) { + if ( (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && + dlen > (4+8+4)) { got_wep(wh, rd); } } @@ -1768,7 +1769,7 @@ void prepare_fragstate(struct frag_state fs->wh.i_fc[0] |= IEEE80211_FC0_TYPE_DATA; fs->wh.i_fc[1] |= IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_MORE_FRAG | - IEEE80211_FC1_WEP; + IEEE80211_FC1_PROTECTED; memset(&fs->data[8+8+20], 0, pad); } @@ -1858,7 +1859,7 @@ void flood_inet(tx) { fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memset(wh->i_addr3, 0xff, 6); body = (unsigned char*) wh + sizeof(*wh); @@ -1880,7 +1881,7 @@ void flood_inet(tx) { fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memcpy(wh->i_addr3, rtrmac, 6); body = (unsigned char*) wh + sizeof(*wh); @@ -1975,7 +1976,7 @@ void send_arp(int tx, unsigned short op, fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memset(wh->i_addr3, 0xff, 6); body = (unsigned char*) wh + sizeof(*wh); @@ -2254,7 +2255,7 @@ void read_tap() { fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memcpy(wh->i_addr2, eh->ether_shost, 6); memcpy(wh->i_addr3, eh->ether_dhost, 6); Modified: stable/10/tools/tools/net80211/wlaninject/wlaninject.c ============================================================================== --- stable/10/tools/tools/net80211/wlaninject/wlaninject.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/wlaninject/wlaninject.c Mon Feb 17 01:36:53 2014 (r262007) @@ -600,7 +600,7 @@ int main(int argc, char *argv[]) break; case 'w': - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; break; case 'o': From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 01:39:04 2014 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 ESMTPS id 7A8F68B8; Mon, 17 Feb 2014 01:39:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB6911F3; Mon, 17 Feb 2014 01:39:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H1d4gX064063; Mon, 17 Feb 2014 01:39:04 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H1d3qB064060; Mon, 17 Feb 2014 01:39:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402170139.s1H1d3qB064060@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Feb 2014 01:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262008 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 01:39:04 -0000 Author: kevlo Date: Mon Feb 17 01:39:03 2014 New Revision: 262008 URL: http://svnweb.freebsd.org/changeset/base/262008 Log: MFC r260463: Replace deprecated M_DONTWAIT with M_NOWAIT. Modified: stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 01:36:53 2014 (r262007) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 01:39:03 2014 (r262008) @@ -1144,11 +1144,11 @@ rsu_event_survey(struct rsu_softc *sc, u pktlen = sizeof(*wh) + le32toh(bss->ieslen); if (__predict_false(pktlen > MCLBYTES)) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (__predict_false(m == NULL)) return; if (pktlen > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_free(m); return; @@ -1357,13 +1357,13 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 DPRINTFN(5, "Rx frame len=%d rate=%d infosz=%d rssi=%d\n", pktlen, rate, infosz, *rssi); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (__predict_false(m == NULL)) { ifp->if_ierrors++; return NULL; } if (pktlen > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (__predict_false(!(m->m_flags & M_EXT))) { ifp->if_ierrors++; m_freem(m); Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:36:53 2014 (r262007) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:39:03 2014 (r262008) @@ -625,7 +625,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u rssi = URTWN_RSSI(rssi); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "could not create RX mbuf\n"); return (NULL); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 01:40:34 2014 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 ESMTPS id 44A249ED; Mon, 17 Feb 2014 01:40:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC8311FB; Mon, 17 Feb 2014 01:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H1eYSw065073; Mon, 17 Feb 2014 01:40:34 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H1eYJe065071; Mon, 17 Feb 2014 01:40:34 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402170140.s1H1eYJe065071@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Feb 2014 01:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262009 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 01:40:34 -0000 Author: kevlo Date: Mon Feb 17 01:40:33 2014 New Revision: 262009 URL: http://svnweb.freebsd.org/changeset/base/262009 Log: MFC r261506: Correct setting R92C_TXAGC_MCS11_MCS08 register. Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:39:03 2014 (r262008) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:40:33 2014 (r262009) @@ -2492,7 +2492,7 @@ urtwn_write_txpower(struct urtwn_softc * SM(R92C_TXAGC_MCS07, power[19])); urtwn_bb_write(sc, R92C_TXAGC_MCS11_MCS08(chain), SM(R92C_TXAGC_MCS08, power[20]) | - SM(R92C_TXAGC_MCS08, power[21]) | + SM(R92C_TXAGC_MCS09, power[21]) | SM(R92C_TXAGC_MCS10, power[22]) | SM(R92C_TXAGC_MCS11, power[23])); urtwn_bb_write(sc, R92C_TXAGC_MCS15_MCS12(chain), From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 02:24:59 2014 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 ESMTPS id 0F9A22CE; Mon, 17 Feb 2014 02:24:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC2E615C8; Mon, 17 Feb 2014 02:24:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H2OwpL085129; Mon, 17 Feb 2014 02:24:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H2Owv8085127; Mon, 17 Feb 2014 02:24:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402170224.s1H2Owv8085127@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Feb 2014 02:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262010 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 02:24:59 -0000 Author: adrian Date: Mon Feb 17 02:24:58 2014 New Revision: 262010 URL: http://svnweb.freebsd.org/changeset/base/262010 Log: Implement PHY bus MMD writes for arswitch. This is used by the AR8327 PHY setup path. Obtained from: OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Mon Feb 17 01:40:33 2014 (r262009) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Mon Feb 17 02:24:58 2014 (r262010) @@ -111,6 +111,16 @@ arswitch_writedbg(device_t dev, int phy, MII_ATH_DBG_DATA, dbg_data); } +void +arswitch_writemmd(device_t dev, int phy, uint16_t dbg_addr, + uint16_t dbg_data) +{ + (void) MDIO_WRITEREG(device_get_parent(dev), phy, + MII_ATH_MMD_ADDR, dbg_addr); + (void) MDIO_WRITEREG(device_get_parent(dev), phy, + MII_ATH_MMD_DATA, dbg_data); +} + /* * Write half a register */ Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 17 01:40:33 2014 (r262009) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 17 02:24:58 2014 (r262010) @@ -39,6 +39,8 @@ #define MS(_v, _f) (((_v) & (_f)) >> _f##_S) /* Atheros specific MII registers */ +#define MII_ATH_MMD_ADDR 0x0d +#define MII_ATH_MMD_DATA 0x0e #define MII_ATH_DBG_ADDR 0x1d #define MII_ATH_DBG_DATA 0x1e From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 03:24:01 2014 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 ESMTPS id 63B8FFC2; Mon, 17 Feb 2014 03:24:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 505C91D6D; Mon, 17 Feb 2014 03:24:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H3O1LL012400; Mon, 17 Feb 2014 03:24:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H3O1Gk012399; Mon, 17 Feb 2014 03:24:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402170324.s1H3O1Gk012399@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Feb 2014 03:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262011 - head/usr.bin/calendar 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 03:24:01 -0000 Author: eadler Date: Mon Feb 17 03:24:00 2014 New Revision: 262011 URL: http://svnweb.freebsd.org/changeset/base/262011 Log: calendar(1): don't segfault in invalid input When the user supplies an invalid number of days provide a useful error message instead of segfaulting. PR: bin/186697 Reported by: kaltheat Submitted by: oliver (older version) Modified: head/usr.bin/calendar/calendar.c Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Mon Feb 17 02:24:58 2014 (r262010) +++ head/usr.bin/calendar/calendar.c Mon Feb 17 03:24:00 2014 (r262011) @@ -96,10 +96,14 @@ main(int argc, char *argv[]) case 'A': /* days after current date */ f_dayAfter = atoi(optarg); + if (f_dayAfter < 0) + errx(1, "number of days must be positive"); break; case 'B': /* days before current date */ f_dayBefore = atoi(optarg); + if (f_dayBefore < 0) + errx(1, "number of days must be positive"); break; case 'D': /* debug output of sun and moon info */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 05:06:44 2014 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 ESMTPS id 45683E9E; Mon, 17 Feb 2014 05:06:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 157DE14C9; Mon, 17 Feb 2014 05:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H56hui054619; Mon, 17 Feb 2014 05:06:43 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H56hoD054617; Mon, 17 Feb 2014 05:06:43 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402170506.s1H56hoD054617@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 05:06: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: r262012 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 05:06:44 -0000 Author: markj Date: Mon Feb 17 05:06:43 2014 New Revision: 262012 URL: http://svnweb.freebsd.org/changeset/base/262012 Log: MFC r249514 (by gnn): Point args[0] not at the thread that is ending but at the one that is starting. This is in line with practice in OpenSolaris. Note that this change is only in ULE and not in the 4BSD scheduler. Once this change settles in (MFC timeout has expired) we'll try it out on 4BSD as well. MFC r260043: The arguments to sched:::off-cpu are the thread and associated process of the thread selected to run, not the currently running thread. Modified: stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Mon Feb 17 03:24:00 2014 (r262011) +++ stable/8/sys/kern/sched_4bsd.c Mon Feb 17 05:06:43 2014 (r262012) @@ -1055,7 +1055,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Feb 17 03:24:00 2014 (r262011) +++ stable/8/sys/kern/sched_ule.c Mon Feb 17 05:06:43 2014 (r262012) @@ -1909,7 +1909,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 05:07:10 2014 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 ESMTPS id 28088FD0; Mon, 17 Feb 2014 05:07:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1372014D9; Mon, 17 Feb 2014 05:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H579pC054761; Mon, 17 Feb 2014 05:07:09 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H579XS054760; Mon, 17 Feb 2014 05:07:09 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402170507.s1H579XS054760@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 05:07: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: r262013 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 05:07:10 -0000 Author: markj Date: Mon Feb 17 05:07:09 2014 New Revision: 262013 URL: http://svnweb.freebsd.org/changeset/base/262013 Log: MFC r260043: The arguments to sched:::off-cpu are the thread and associated process of the thread selected to run, not the currently running thread. Modified: stable/9/sys/kern/sched_4bsd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_4bsd.c ============================================================================== --- stable/9/sys/kern/sched_4bsd.c Mon Feb 17 05:06:43 2014 (r262012) +++ stable/9/sys/kern/sched_4bsd.c Mon Feb 17 05:07:09 2014 (r262013) @@ -1033,7 +1033,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 05:07:43 2014 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 ESMTPS id C7470184; Mon, 17 Feb 2014 05:07:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9004214E3; Mon, 17 Feb 2014 05:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H57hrS054885; Mon, 17 Feb 2014 05:07:43 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H57hRX054884; Mon, 17 Feb 2014 05:07:43 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402170507.s1H57hRX054884@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 05:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262014 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 05:07:43 -0000 Author: markj Date: Mon Feb 17 05:07:43 2014 New Revision: 262014 URL: http://svnweb.freebsd.org/changeset/base/262014 Log: MFC r260043: The arguments to sched:::off-cpu are the thread and associated process of the thread selected to run, not the currently running thread. Modified: stable/10/sys/kern/sched_4bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_4bsd.c ============================================================================== --- stable/10/sys/kern/sched_4bsd.c Mon Feb 17 05:07:09 2014 (r262013) +++ stable/10/sys/kern/sched_4bsd.c Mon Feb 17 05:07:43 2014 (r262014) @@ -1033,7 +1033,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off__cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 05:51:38 2014 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 ESMTPS id 18A4B5E6; Mon, 17 Feb 2014 05:51:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04147179C; Mon, 17 Feb 2014 05:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H5pb7c076483; Mon, 17 Feb 2014 05:51:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H5pblp076482; Mon, 17 Feb 2014 05:51:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402170551.s1H5pblp076482@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Feb 2014 05:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262015 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 05:51:38 -0000 Author: adrian Date: Mon Feb 17 05:51:37 2014 New Revision: 262015 URL: http://svnweb.freebsd.org/changeset/base/262015 Log: Add mmd declaration. Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.h Mon Feb 17 05:07:43 2014 (r262014) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.h Mon Feb 17 05:51:37 2014 (r262015) @@ -30,6 +30,8 @@ extern void arswitch_writedbg(device_t dev, int phy, uint16_t dbg_addr, uint16_t dbg_data); +extern void arswitch_writemmd(device_t dev, int phy, uint16_t dbg_addr, + uint16_t dbg_data); extern int arswitch_readreg(device_t dev, int addr); extern int arswitch_writereg(device_t dev, int addr, int value); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 05:54:25 2014 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 ESMTPS id 622DF759; Mon, 17 Feb 2014 05:54:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9CC17B6; Mon, 17 Feb 2014 05:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H5sPS6076797; Mon, 17 Feb 2014 05:54:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H5sPSC076796; Mon, 17 Feb 2014 05:54:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402170554.s1H5sPSC076796@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Feb 2014 05:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262016 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 05:54:25 -0000 Author: adrian Date: Mon Feb 17 05:54:24 2014 New Revision: 262016 URL: http://svnweb.freebsd.org/changeset/base/262016 Log: The MDIO control register for the AR8327 has a different address to previous chipsets. Obtained from: AR8327 datasheet Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 17 05:51:37 2014 (r262015) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 17 05:54:24 2014 (r262016) @@ -395,6 +395,8 @@ #define AR8327_REG_MIB_FUNC 0x034 #define AR8327_MIB_CPU_KEEP (1 << 20) +#define AR8327_REG_MDIO_CTRL 0x03c + #define AR8327_REG_SERVICE_TAG 0x048 #define AR8327_REG_LED_CTRL0 0x050 #define AR8327_REG_LED_CTRL1 0x054 From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 09:35:31 2014 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 ESMTPS id 80AF4D04; Mon, 17 Feb 2014 09:35:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68C6418AA; Mon, 17 Feb 2014 09:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H9ZVLT066384; Mon, 17 Feb 2014 09:35:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H9ZV4s066383; Mon, 17 Feb 2014 09:35:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402170935.s1H9ZV4s066383@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 09:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262017 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 09:35:31 -0000 Author: mav Date: Mon Feb 17 09:35:30 2014 New Revision: 262017 URL: http://svnweb.freebsd.org/changeset/base/262017 Log: MFC r261719: Fix wrong device name in example. PR: docs/185602 Submitted by: koitsu Modified: stable/10/share/man/man4/scsi.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/scsi.4 ============================================================================== --- stable/10/share/man/man4/scsi.4 Mon Feb 17 05:54:24 2014 (r262016) +++ stable/10/share/man/man4/scsi.4 Mon Feb 17 09:35:30 2014 (r262017) @@ -195,7 +195,7 @@ hint.scbus.0.bus="1" This assigns .Nm bus 0 to the bus 1 instance on -.Em ahc0 . +.Em ahc1 . Peripheral drivers can be wired to a specific bus, target, and lun as so: .Bd -literal -offset indent hint.da.0.at="scbus0" From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 09:37:01 2014 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 ESMTPS id 9F984E42; Mon, 17 Feb 2014 09:37:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AD4D18B8; Mon, 17 Feb 2014 09:37:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H9b1TS066597; Mon, 17 Feb 2014 09:37:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H9b1G4066595; Mon, 17 Feb 2014 09:37:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402170937.s1H9b1G4066595@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 09:37: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: r262018 - stable/9/share/man/man4 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 09:37:01 -0000 Author: mav Date: Mon Feb 17 09:37:01 2014 New Revision: 262018 URL: http://svnweb.freebsd.org/changeset/base/262018 Log: MFC r261719: Fix wrong device name in example. PR: docs/185602 Submitted by: koitsu Modified: stable/9/share/man/man4/scsi.4 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/scsi.4 ============================================================================== --- stable/9/share/man/man4/scsi.4 Mon Feb 17 09:35:30 2014 (r262017) +++ stable/9/share/man/man4/scsi.4 Mon Feb 17 09:37:01 2014 (r262018) @@ -195,7 +195,7 @@ hint.scbus.0.bus="1" This assigns .Nm bus 0 to the bus 1 instance on -.Em ahc0 . +.Em ahc1 . Peripheral drivers can be wired to a specific bus, target, and lun as so: .Bd -literal -offset indent hint.da.0.at="scbus0" From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:05:57 2014 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 ESMTPS id DF25C9E4; Mon, 17 Feb 2014 11:05:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C931B1143; Mon, 17 Feb 2014 11:05:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HB5vk6001974; Mon, 17 Feb 2014 11:05:57 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HB5vM9001972; Mon, 17 Feb 2014 11:05:57 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <201402171105.s1HB5vM9001972@svn.freebsd.org> From: John Hay Date: Mon, 17 Feb 2014 11:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262020 - head/sys/arm/xscale/ixp425 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:05:57 -0000 Author: jhay Date: Mon Feb 17 11:05:57 2014 New Revision: 262020 URL: http://svnweb.freebsd.org/changeset/base/262020 Log: Make it possible to use the env kernel config file option for AVILA and CAMBRIA boards that does not use loader to load the kernel. This is basically how it was done for i386. This way tunables can also be set. For example in config file: env "/conf/AVILA.env" And in AVILA.env: vfs.unmapped_buf_allowed=0 MFC after: 2 weeks Modified: head/sys/arm/xscale/ixp425/avila_machdep.c Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Mon Feb 17 10:57:06 2014 (r262019) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Mon Feb 17 11:05:57 2014 (r262020) @@ -227,6 +227,8 @@ initarm(struct arm_boot_params *abp) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); + if (envmode == 1) + kern_envp = static_env; /* Do basic tuning, hz etc */ init_param1(); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:23:00 2014 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 ESMTPS id C8FE1A8E; Mon, 17 Feb 2014 11:23:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2BDF14C0; Mon, 17 Feb 2014 11:23:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBN0WF009692; Mon, 17 Feb 2014 11:23:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBN09t009687; Mon, 17 Feb 2014 11:23:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171123.s1HBN09t009687@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:23:00 +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: r262021 - stable/9/share/man/man9 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:23:00 -0000 Author: avg Date: Mon Feb 17 11:22:59 2014 New Revision: 262021 URL: http://svnweb.freebsd.org/changeset/base/262021 Log: MFC r252895: Add a man page for the SDT_* macros Added: stable/9/share/man/man9/SDT.9 - copied unchanged from r252895, head/share/man/man9/SDT.9 Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Feb 17 11:05:57 2014 (r262020) +++ stable/9/share/man/man9/Makefile Mon Feb 17 11:22:59 2014 (r262021) @@ -233,6 +233,7 @@ MAN= accept_filter.9 \ rwlock.9 \ sbuf.9 \ scheduler.9 \ + SDT.9 \ securelevel_gt.9 \ selrecord.9 \ sema.9 \ @@ -1128,6 +1129,11 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 sched_setup.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 +MLINKS+=SDT.9 SDT_PROVIDER_DECLARE.9 \ + SDT.9 SDT_PROVIDER_DEFINE.9 \ + SDT.9 SDT_PROBE_DECLARE.9 \ + SDT.9 SDT_PROBE_DEFINE.9 \ + SDT.9 SDT_PROBE.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 MLINKS+=selrecord.9 seldrain.9 \ selrecord.9 selwakeup.9 Copied: stable/9/share/man/man9/SDT.9 (from r252895, head/share/man/man9/SDT.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/SDT.9 Mon Feb 17 11:22:59 2014 (r262021, copy of r252895, head/share/man/man9/SDT.9) @@ -0,0 +1,243 @@ +.\" Copyright (c) 2013 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 3, 2013 +.Dt SDT 9 +.Os +.Sh NAME +.Nm SDT +.Nd a DTrace framework for adding statically-defined tracing probes +.Sh SYNOPSIS +.In sys/sdt.h +.Fn SDT_PROVIDER_DECLARE prov +.Fn SDT_PROVIDER_DEFINE prov +.Fn SDT_PROBE_DECLARE prov mod func name +.Fn SDT_PROBE_DEFINE prov mod func name sname +.Fn SDT_PROBE_DEFINE0 prov mod func name sname +.Fn SDT_PROBE_DEFINE1 prov mod func name sname arg0 +.Fn SDT_PROBE_DEFINE2 prov mod func name sname arg0 arg1 +.Fn SDT_PROBE_DEFINE3 prov mod func name sname arg0 arg1 arg2 +.Fn SDT_PROBE_DEFINE4 prov mod func name sname arg0 arg1 arg2 arg3 +.Fn SDT_PROBE_DEFINE5 prov mod func name sname arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ + arg6 +.Fn SDT_PROBE0 prov mod func name +.Fn SDT_PROBE1 prov mod func name arg0 +.Fn SDT_PROBE2 prov mod func name arg0 arg1 +.Fn SDT_PROBE3 prov mod func name arg0 arg1 arg2 +.Fn SDT_PROBE4 prov mod func name arg0 arg1 arg2 arg3 +.Fn SDT_PROBE5 prov mod func name arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6 +.Sh DESCRIPTION +.Pp +The +.Nm +macros allow programmers to define static trace points in kernel code. +These trace points are used by the +.Nm +framework to create DTrace probes, allowing the code to be instrumented +using +.Xr dtrace 1 . +By default, +.Nm +trace points are disabled and have no effect on the surrounding code. +When a DTrace probe corresponding to a given trace point is enabled, threads +that execute the trace point will call a handler and cause the probe to fire. +Moreover, trace points can take arguments, making it possible to pass data +to the DTrace framework when an enabled probe fires. +.Pp +Multiple trace points may correspond to a single DTrace probe, allowing +programmers to create DTrace probes that correspond to logical system events +rather than tying probes to specific code execution paths. +For instance, a DTrace probe corresponding to the arrival of an IP packet into +the network stack may be defined using two +.Nm +trace points: one for IPv4 packets and one for IPv6 packets. +.Pp +In addition to defining DTrace probes, the +.Nm +macros allow programmers to define new DTrace providers, making it possible to +namespace logically-related probes. +An example is FreeBSD's sctp provider, which contains +.Nm +probes for FreeBSD's +.Xr sctp 4 +implementation. +.Pp +The +.Fn SDT_PROVIDER_DECLARE +and +.Fn SDT_PROVIDER_DEFINE +macros are used respectively to declare and define a DTrace provider named +.Ar prov +with the +.Nm +framework. +A provider need only be defined once; however, the provider must be declared +before defining any +.Nm +probes belonging to that provider. +.Pp +Similarly, the +.Fn SDT_PROBE_DECLARE +and +.Fn SDT_PROBE_DEFINE* +macros are used to declare and define DTrace probes using the +.Nm +framework. +Once a probe has been defined, trace points for that probe may be added to +kernel code. +DTrace probe identifiers consist of a provider, module, function and name, all +of which may be specified in the +.Nm +probe definition. +Note that probes should not specify a module name: the module name of a probe is +used to determine whether or not it should be destroyed when a kernel module is +unloaded. +See the +.Sx BUGS +section. +Note in particular that probes must not be defined across multiple kernel +modules. +The +.Fn SDT_PROBE_DEFINE* +macros also take an extra +.Ar sname +parameter. +This is used to allow the creation of probes with names containing the +.Ql - +character. +Specifically, the +.Ar name +argument should contain the probe name with all dashes converted to underscores, +and the +.Ar sname +argument should be the probe name as it will be referenced by D scripts. +.Pp +The +.Fn SDT_PROBE_DEFINE* +macros also allow programmers to declare the types of the arguments that are +passed to probes. +This is optional; if the argument types are omitted (through use of the +.Fn SDT_PROBE_DEFINE +macro), users wishing to make use of the arguments will have to manually cast +them to the correct types in their D scripts. +It is strongly recommended that probe definitions include a declaration of their +argument types. +.Pp +The +.Fn SDT_PROBE* +macros are used to create +.Nm +trace points. +They are meant to be added to executable code and can be used to instrument the +code in which they are called. +.Sh EXAMPLES +.Pp +The following probe definition will create a DTrace probe called +.Ql icmp::unreach:pkt-receive , +which would hypothetically be triggered when the kernel receives an ICMP packet +of type Destination Unreachable: +.Bd -literal -offset indent +SDT_PROVIDER_DECLARE(icmp); + +SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, + "struct mbuf *", "struct icmp *"); + +.Ed +This particular probe would take two arguments: a pointer to the +.Xr mbuf 9 +containing the incoming packet, and a pointer to the ICMP header for the packet. +Note that the module name of this probe is not specified. +.Pp +Consider a DTrace probe which fires when the network stack receives an IP +packet. +Such a probe would be defined by multiple tracepoints: +.Bd -literal -offset indent +SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + +int +ip_input(struct mbuf *m) +{ + struct ip *ip; + ... + ip = mtod(m, struct ip *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + ... +} + +int +ip6_input(struct mbuf *m) +{ + struct ip6_hdr *ip6; + ... + ip6 = mtod(m, struct ip6_hdr *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + ... +} + +.Ed +In particular, the probe should fire when the kernel receives either an IPv4 +packet or an IPv6 packet. +.Sh SEE ALSO +.Xr dtrace 1 +.Sh AUTHORS +.An -nosplit +DTrace and the +.Nm +framework were originally ported to FreeBSD from Solaris by +.An John Birrell Aq jb@FreeBSD.org . +This manual page was written by +.An Mark Johnston Aq markj@FreeBSD.org . +.Sh BUGS +.Pp +The +.Nm +macros allow the module name of a probe to be specified as part of a probe +definition. +However, the DTrace framework uses the module name of probes to determine +which probes should be destroyed when a kernel module is unloaded, so the module +name of a probe should match the name of the module in which its defined. +.Nm +will set the module name properly if it is left unspecified in the probe +definition; see the +.Sx EXAMPLES +section. +.Pp +One of the goals of the original +.Nm +implementation (and by extension, of FreeBSD's port) is that inactive +.Nm +probes should have no performance impact. +This is unfortunately not the case; +.Nm +trace points will add a small but non-zero amount of latency to the code +in which they are defined. +A more sophisticated implementation of the probes will help alleviate this +problem. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:23:22 2014 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 ESMTPS id BE32EC4C; Mon, 17 Feb 2014 11:23:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A856C14CD; Mon, 17 Feb 2014 11:23:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBNMx8009780; Mon, 17 Feb 2014 11:23:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBNMUk009777; Mon, 17 Feb 2014 11:23:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171123.s1HBNMUk009777@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:23:22 +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: r262022 - stable/8/share/man/man9 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:23:22 -0000 Author: avg Date: Mon Feb 17 11:23:21 2014 New Revision: 262022 URL: http://svnweb.freebsd.org/changeset/base/262022 Log: MFC r252895: Add a man page for the SDT_* macros Added: stable/8/share/man/man9/SDT.9 - copied unchanged from r252895, head/share/man/man9/SDT.9 Modified: stable/8/share/man/man9/Makefile Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 17 11:22:59 2014 (r262021) +++ stable/8/share/man/man9/Makefile Mon Feb 17 11:23:21 2014 (r262022) @@ -232,6 +232,7 @@ MAN= accept_filter.9 \ rwlock.9 \ sbuf.9 \ scheduler.9 \ + SDT.9 \ securelevel_gt.9 \ selrecord.9 \ sema.9 \ @@ -1085,6 +1086,11 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 sched_setup.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 +MLINKS+=SDT.9 SDT_PROVIDER_DECLARE.9 \ + SDT.9 SDT_PROVIDER_DEFINE.9 \ + SDT.9 SDT_PROBE_DECLARE.9 \ + SDT.9 SDT_PROBE_DEFINE.9 \ + SDT.9 SDT_PROBE.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 MLINKS+=selrecord.9 seldrain.9 \ selrecord.9 selwakeup.9 Copied: stable/8/share/man/man9/SDT.9 (from r252895, head/share/man/man9/SDT.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man9/SDT.9 Mon Feb 17 11:23:21 2014 (r262022, copy of r252895, head/share/man/man9/SDT.9) @@ -0,0 +1,243 @@ +.\" Copyright (c) 2013 Mark Johnston +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 3, 2013 +.Dt SDT 9 +.Os +.Sh NAME +.Nm SDT +.Nd a DTrace framework for adding statically-defined tracing probes +.Sh SYNOPSIS +.In sys/sdt.h +.Fn SDT_PROVIDER_DECLARE prov +.Fn SDT_PROVIDER_DEFINE prov +.Fn SDT_PROBE_DECLARE prov mod func name +.Fn SDT_PROBE_DEFINE prov mod func name sname +.Fn SDT_PROBE_DEFINE0 prov mod func name sname +.Fn SDT_PROBE_DEFINE1 prov mod func name sname arg0 +.Fn SDT_PROBE_DEFINE2 prov mod func name sname arg0 arg1 +.Fn SDT_PROBE_DEFINE3 prov mod func name sname arg0 arg1 arg2 +.Fn SDT_PROBE_DEFINE4 prov mod func name sname arg0 arg1 arg2 arg3 +.Fn SDT_PROBE_DEFINE5 prov mod func name sname arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ + arg6 +.Fn SDT_PROBE0 prov mod func name +.Fn SDT_PROBE1 prov mod func name arg0 +.Fn SDT_PROBE2 prov mod func name arg0 arg1 +.Fn SDT_PROBE3 prov mod func name arg0 arg1 arg2 +.Fn SDT_PROBE4 prov mod func name arg0 arg1 arg2 arg3 +.Fn SDT_PROBE5 prov mod func name arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6 +.Sh DESCRIPTION +.Pp +The +.Nm +macros allow programmers to define static trace points in kernel code. +These trace points are used by the +.Nm +framework to create DTrace probes, allowing the code to be instrumented +using +.Xr dtrace 1 . +By default, +.Nm +trace points are disabled and have no effect on the surrounding code. +When a DTrace probe corresponding to a given trace point is enabled, threads +that execute the trace point will call a handler and cause the probe to fire. +Moreover, trace points can take arguments, making it possible to pass data +to the DTrace framework when an enabled probe fires. +.Pp +Multiple trace points may correspond to a single DTrace probe, allowing +programmers to create DTrace probes that correspond to logical system events +rather than tying probes to specific code execution paths. +For instance, a DTrace probe corresponding to the arrival of an IP packet into +the network stack may be defined using two +.Nm +trace points: one for IPv4 packets and one for IPv6 packets. +.Pp +In addition to defining DTrace probes, the +.Nm +macros allow programmers to define new DTrace providers, making it possible to +namespace logically-related probes. +An example is FreeBSD's sctp provider, which contains +.Nm +probes for FreeBSD's +.Xr sctp 4 +implementation. +.Pp +The +.Fn SDT_PROVIDER_DECLARE +and +.Fn SDT_PROVIDER_DEFINE +macros are used respectively to declare and define a DTrace provider named +.Ar prov +with the +.Nm +framework. +A provider need only be defined once; however, the provider must be declared +before defining any +.Nm +probes belonging to that provider. +.Pp +Similarly, the +.Fn SDT_PROBE_DECLARE +and +.Fn SDT_PROBE_DEFINE* +macros are used to declare and define DTrace probes using the +.Nm +framework. +Once a probe has been defined, trace points for that probe may be added to +kernel code. +DTrace probe identifiers consist of a provider, module, function and name, all +of which may be specified in the +.Nm +probe definition. +Note that probes should not specify a module name: the module name of a probe is +used to determine whether or not it should be destroyed when a kernel module is +unloaded. +See the +.Sx BUGS +section. +Note in particular that probes must not be defined across multiple kernel +modules. +The +.Fn SDT_PROBE_DEFINE* +macros also take an extra +.Ar sname +parameter. +This is used to allow the creation of probes with names containing the +.Ql - +character. +Specifically, the +.Ar name +argument should contain the probe name with all dashes converted to underscores, +and the +.Ar sname +argument should be the probe name as it will be referenced by D scripts. +.Pp +The +.Fn SDT_PROBE_DEFINE* +macros also allow programmers to declare the types of the arguments that are +passed to probes. +This is optional; if the argument types are omitted (through use of the +.Fn SDT_PROBE_DEFINE +macro), users wishing to make use of the arguments will have to manually cast +them to the correct types in their D scripts. +It is strongly recommended that probe definitions include a declaration of their +argument types. +.Pp +The +.Fn SDT_PROBE* +macros are used to create +.Nm +trace points. +They are meant to be added to executable code and can be used to instrument the +code in which they are called. +.Sh EXAMPLES +.Pp +The following probe definition will create a DTrace probe called +.Ql icmp::unreach:pkt-receive , +which would hypothetically be triggered when the kernel receives an ICMP packet +of type Destination Unreachable: +.Bd -literal -offset indent +SDT_PROVIDER_DECLARE(icmp); + +SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, + "struct mbuf *", "struct icmp *"); + +.Ed +This particular probe would take two arguments: a pointer to the +.Xr mbuf 9 +containing the incoming packet, and a pointer to the ICMP header for the packet. +Note that the module name of this probe is not specified. +.Pp +Consider a DTrace probe which fires when the network stack receives an IP +packet. +Such a probe would be defined by multiple tracepoints: +.Bd -literal -offset indent +SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + +int +ip_input(struct mbuf *m) +{ + struct ip *ip; + ... + ip = mtod(m, struct ip *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + ... +} + +int +ip6_input(struct mbuf *m) +{ + struct ip6_hdr *ip6; + ... + ip6 = mtod(m, struct ip6_hdr *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + ... +} + +.Ed +In particular, the probe should fire when the kernel receives either an IPv4 +packet or an IPv6 packet. +.Sh SEE ALSO +.Xr dtrace 1 +.Sh AUTHORS +.An -nosplit +DTrace and the +.Nm +framework were originally ported to FreeBSD from Solaris by +.An John Birrell Aq jb@FreeBSD.org . +This manual page was written by +.An Mark Johnston Aq markj@FreeBSD.org . +.Sh BUGS +.Pp +The +.Nm +macros allow the module name of a probe to be specified as part of a probe +definition. +However, the DTrace framework uses the module name of probes to determine +which probes should be destroyed when a kernel module is unloaded, so the module +name of a probe should match the name of the module in which its defined. +.Nm +will set the module name properly if it is left unspecified in the probe +definition; see the +.Sx EXAMPLES +section. +.Pp +One of the goals of the original +.Nm +implementation (and by extension, of FreeBSD's port) is that inactive +.Nm +probes should have no performance impact. +This is unfortunately not the case; +.Nm +trace points will add a small but non-zero amount of latency to the code +in which they are defined. +A more sophisticated implementation of the probes will help alleviate this +problem. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:28:18 2014 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 ESMTPS id 2431F78; Mon, 17 Feb 2014 11:28:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03403151A; Mon, 17 Feb 2014 11:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBSH6L010500; Mon, 17 Feb 2014 11:28:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBSGnB010491; Mon, 17 Feb 2014 11:28:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171128.s1HBSGnB010491@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:28:16 +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: r262023 - stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:28:18 -0000 Author: avg Date: Mon Feb 17 11:28:16 2014 New Revision: 262023 URL: http://svnweb.freebsd.org/changeset/base/262023 Log: MFC r253720: Use kern_ioctl() rather than ioctl() for testing the FBT provider Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,12 +36,12 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); exit(0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The function return value is stored in %u\n", arg1); exit(0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,13 +36,13 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:28:16 2014 (r262023) @@ -41,12 +41,12 @@ BEGIN self->traceme = 1; } -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The offset = %u\n", arg0); exit(0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,14 +36,14 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); exit(0); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { self->traceme = 1; } @@ -47,7 +47,7 @@ fbt:::entry printf("called %s\n", probefunc); } -fbt::ioctl:return +fbt::kern_ioctl:return /self->traceme/ { self->traceme = 0; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:28:30 2014 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 ESMTPS id D9C1717D; Mon, 17 Feb 2014 11:28:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA42D151C; Mon, 17 Feb 2014 11:28:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBSTEd010562; Mon, 17 Feb 2014 11:28:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBSS6Q010553; Mon, 17 Feb 2014 11:28:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171128.s1HBSS6Q010553@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:28: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: r262024 - stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:28:30 -0000 Author: avg Date: Mon Feb 17 11:28:27 2014 New Revision: 262024 URL: http://svnweb.freebsd.org/changeset/base/262024 Log: MFC r253720: Use kern_ioctl() rather than ioctl() for testing the FBT provider Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,12 +36,12 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); exit(0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The function return value is stored in %u\n", arg1); exit(0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,13 +36,13 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:28:27 2014 (r262024) @@ -41,12 +41,12 @@ BEGIN self->traceme = 1; } -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The offset = %u\n", arg0); exit(0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,14 +36,14 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); exit(0); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { self->traceme = 1; } @@ -47,7 +47,7 @@ fbt:::entry printf("called %s\n", probefunc); } -fbt::ioctl:return +fbt::kern_ioctl:return /self->traceme/ { self->traceme = 0; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:36:31 2014 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 ESMTPS id C4197767; Mon, 17 Feb 2014 11:36:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACB6F163C; Mon, 17 Feb 2014 11:36:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBaVAq014187; Mon, 17 Feb 2014 11:36:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBaVmh014183; Mon, 17 Feb 2014 11:36:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171136.s1HBaVmh014183@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:36:31 +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: r262025 - in stable/9: share/man/man9 sys/cddl/dev/sdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:36:31 -0000 Author: avg Date: Mon Feb 17 11:36:30 2014 New Revision: 262025 URL: http://svnweb.freebsd.org/changeset/base/262025 Log: MFC r254468,r254469: Add a "translated type" argument to SDT_PROBE_ARGTYPE() Note: this breaks ABI compatibility with older modules with SDT probes. My opinion is that benefits outweigh downsides, because I am not aware of any thirdparty binary-only modules with SDT probes. Modified: stable/9/share/man/man9/SDT.9 stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/sys/sdt.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/SDT.9 ============================================================================== --- stable/9/share/man/man9/SDT.9 Mon Feb 17 11:28:27 2014 (r262024) +++ stable/9/share/man/man9/SDT.9 Mon Feb 17 11:36:30 2014 (r262025) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2013 +.Dd August 17, 2013 .Dt SDT 9 .Os .Sh NAME @@ -45,6 +45,19 @@ .Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 .Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ arg6 +.Fn SDT_PROBE_DEFINE0_XLATE prov mod func name sname +.Fn SDT_PROBE_DEFINE1_XLATE prov mod func name sname arg0 xarg0 +.Fn SDT_PROBE_DEFINE2_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 +.Fn SDT_PROBE_DEFINE3_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 +.Fn SDT_PROBE_DEFINE4_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 +.Fn SDT_PROBE_DEFINE5_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 arg4 xarg4 +.Fn SDT_PROBE_DEFINE6_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 arg4 xarg4 arg5 xarg5 +.Fn SDT_PROBE_DEFINE7_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 arg4 xarg4 arg5 xarg5 arg6 xarg6 .Fn SDT_PROBE0 prov mod func name .Fn SDT_PROBE1 prov mod func name arg0 .Fn SDT_PROBE2 prov mod func name arg0 arg1 @@ -151,6 +164,30 @@ It is strongly recommended that probe de argument types. .Pp The +.Fn SDT_PROBE_DEFINE*_XLATE +macros are used for probes whose argument types are to be dynamically translated +to the types specified by the corresponding +.Ar xarg +arguments. +This is mainly useful when porting probe definitions from other operating +systems. +As seen by +.Xr dtrace 1 , +the arguments of a probe defined using these macros will have types which match +the +.Ar xarg +types in the probe definition. +However, the arguments passed in at the trace point will have types matching the +native argument types in the probe definition, and thus the native type is +dynamically translated to the translated type. +So long as an appropriate translator is defined in +.Pa /usr/lib/dtrace , +scripts making use of the probe need not concern themselves with the underlying +type of a given +.Nm +probe argument. +.Pp +The .Fn SDT_PROBE* macros are used to create .Nm @@ -166,21 +203,20 @@ of type Destination Unreachable: .Bd -literal -offset indent SDT_PROVIDER_DECLARE(icmp); -SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, - "struct mbuf *", "struct icmp *"); +SDT_PROBE_DEFINE1(icmp, , unreach, pkt_receive, pkt-receive, + "struct icmp *"); .Ed -This particular probe would take two arguments: a pointer to the -.Xr mbuf 9 -containing the incoming packet, and a pointer to the ICMP header for the packet. +This particular probe would take a single argument: a pointer to the struct +containing the ICMP header for the packet. Note that the module name of this probe is not specified. .Pp Consider a DTrace probe which fires when the network stack receives an IP packet. Such a probe would be defined by multiple tracepoints: .Bd -literal -offset indent -SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", - "struct ifnet *", "struct ip *", "struct ip6_hdr *"); +SDT_PROBE_DEFINE3(ip, , , receive, receive, "struct ifnet *", + "struct ip *", "struct ip6_hdr *"); int ip_input(struct mbuf *m) @@ -188,7 +224,7 @@ ip_input(struct mbuf *m) struct ip *ip; ... ip = mtod(m, struct ip *); - SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + SDT_PROBE3(ip, , , receive, m->m_pkthdr.rcvif, ip, NULL); ... } @@ -198,13 +234,46 @@ ip6_input(struct mbuf *m) struct ip6_hdr *ip6; ... ip6 = mtod(m, struct ip6_hdr *); - SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + SDT_PROBE3(ip, , , receive, m->m_pkthdr.rcvif, NULL, ip6); ... } .Ed In particular, the probe should fire when the kernel receives either an IPv4 packet or an IPv6 packet. +.Pp +Consider the ICMP probe discussed above. +We note that its second argument is of type +.Ar struct icmp , +which is a type defined in the FreeBSD kernel to represent the ICMP header of +an ICMP packet, defined in RFC 792. +Linux has a corresponding type, +.Ar struct icmphdr , +for the same purpose, but its field names differ from FreeBSD's +.Ar struct icmp . +Similarly, illumos defines the +.Ar icmph_t +type, again with different field names. +Even with the +.Ql icmp:::pkt-receive +probes defined in all three operating systems, +one would still have to write OS-specific scripts to extract a given field out +of the ICMP header argument. +Dynamically-translated types solve this problem: one can define an +OS-independent +.Xr c 7 +struct to represent an ICMP header, say +.Ar struct icmp_hdr_dt , +and define translators from each of the three OS-specific types to +.Ar struct icmp_hdr_dt , +all in the +.Xr dtrace 1 +library path. +Then the FreeBSD probe above can be defined with: +.Bd -literal -offset indent +SDT_PROBE_DEFINE1_XLATE(ip, , , receive, receive, "struct icmp *", + "struct icmp_hdr_dt *"); +.Ed .Sh SEE ALSO .Xr dtrace 1 .Sh AUTHORS Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 11:28:27 2014 (r262024) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 11:36:30 2014 (r262025) @@ -201,11 +201,15 @@ sdt_getargdesc(void *arg, dtrace_id_t id if (desc->dtargd_ndx < probe->n_args) { TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { if (desc->dtargd_ndx == argtype->ndx) { - /* XXX */ desc->dtargd_mapping = desc->dtargd_ndx; strlcpy(desc->dtargd_native, argtype->type, sizeof(desc->dtargd_native)); - desc->dtargd_xlate[0] = '\0'; /* XXX */ + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, + argtype->xtype, + sizeof(desc->dtargd_xlate)); + else + desc->dtargd_xlate[0] = '\0'; } } } else Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 11:28:27 2014 (r262024) +++ stable/9/sys/sys/sdt.h Mon Feb 17 11:36:30 2014 (r262025) @@ -87,7 +87,7 @@ #define SDT_PROBE_DEFINE(prov, mod, func, name, sname) #define SDT_PROBE_DECLARE(prov, mod, func, name) #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) -#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) +#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) #define SDT_PROBE_DEFINE0(prov, mod, func, name, sname) #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) @@ -110,6 +110,22 @@ #define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ arg6) +#define SDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname) +#define SDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, xarg0) +#define SDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1) +#define SDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2) +#define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3) +#define SDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4) +#define SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5) +#define SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ + xarg6) + #else SET_DECLARE(sdt_providers_set, struct sdt_provider); @@ -143,9 +159,9 @@ SET_DECLARE(sdt_argtypes_set, struct sdt (uintptr_t) arg3, (uintptr_t) arg4); \ } while (0) -#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) \ +#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) \ static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ - = { { num, type, { NULL, NULL }, \ + = { { num, type, xtype, { NULL, NULL }, \ sdt_##prov##_##mod##_##func##_##name } \ }; \ DATA_SET(sdt_argtypes_set, sdt_##prov##_##mod##_##func##_##name##num); @@ -155,54 +171,113 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL) #define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL) #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)\ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL) #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL) #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL) #define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ arg4, arg5) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, NULL) #define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ arg4, arg5, arg6) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6); + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6, NULL) + +#define SDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname) + +#define SDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, xarg0) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0) + +#define SDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1) + +#define SDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2) + +#define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3) + +#define SDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4) + +#define SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, xarg5) + +#define SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ + xarg6) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, xarg5); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6, xarg6) #define SDT_PROBE0(prov, mod, func, name) \ SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0) @@ -257,12 +332,12 @@ struct sdt_provider; struct linker_file; struct sdt_argtype { - int ndx; /* Argument index. */ - const char *type; /* Argument type string. */ + int ndx; /* Argument index. */ + const char *type; /* Argument type string. */ + const char *xtype; /* Translated argument type. */ TAILQ_ENTRY(sdt_argtype) argtype_entry; /* Argument type list entry. */ - struct sdt_probe - *probe; /* Ptr to the probe structure. */ + struct sdt_probe *probe; /* Ptr to the probe structure. */ }; struct sdt_probe { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 11:44:58 2014 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 ESMTPS id B70B79AC; Mon, 17 Feb 2014 11:44:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD531700; Mon, 17 Feb 2014 11:44:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBiwcm017732; Mon, 17 Feb 2014 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBiwdp017731; Mon, 17 Feb 2014 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171144.s1HBiwdp017731@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:44: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: r262026 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:44:58 -0000 Author: avg Date: Mon Feb 17 11:44:58 2014 New Revision: 262026 URL: http://svnweb.freebsd.org/changeset/base/262026 Log: MFC r254810: Remove the kld lock macros and just use the sx(9) API Modified: stable/9/sys/kern/kern_linker.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Mon Feb 17 11:36:30 2014 (r262025) +++ stable/9/sys/kern/kern_linker.c Mon Feb 17 11:44:58 2014 (r262026) @@ -69,17 +69,6 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, &kld_debug, 0, "Set various levels of 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); @@ -119,7 +108,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) { \ @@ -368,7 +358,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, @@ -385,7 +377,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," @@ -419,10 +411,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; /* @@ -473,16 +465,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); } @@ -493,13 +485,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; @@ -507,7 +499,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); } @@ -520,7 +512,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; @@ -536,7 +528,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; @@ -549,13 +541,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); } @@ -565,7 +557,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)); @@ -599,7 +592,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. */ @@ -672,10 +665,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); @@ -714,7 +707,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) @@ -746,12 +739,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); } @@ -771,12 +764,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); } @@ -790,7 +783,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)); @@ -990,9 +983,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); } @@ -1034,10 +1027,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++; @@ -1047,13 +1040,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: @@ -1096,7 +1089,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)); @@ -1127,13 +1120,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); @@ -1177,13 +1170,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); @@ -1201,7 +1194,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 { @@ -1222,7 +1215,7 @@ sys_kldnext(struct thread *td, struct kl else td->td_retval[0] = 0; out: - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1261,10 +1254,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); } @@ -1282,7 +1275,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); @@ -1301,7 +1294,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; @@ -1313,7 +1306,7 @@ sys_kldfirstmod(struct thread *td, struc MOD_SUNLOCK; } else error = ENOENT; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1341,7 +1334,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) @@ -1367,7 +1360,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); @@ -1476,6 +1469,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); @@ -1657,6 +1651,7 @@ fail: TAILQ_REMOVE(&depended_files, lf, loaded); linker_file_unload(lf, LINKER_UNLOAD_FORCE); } + sx_xunlock(&kld_sx); /* woohoo! we made it! */ } @@ -1962,7 +1957,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++; @@ -1977,7 +1972,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?")); @@ -2003,7 +1998,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 @@ -2077,7 +2072,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); @@ -2169,16 +2164,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 Mon Feb 17 11:50:56 2014 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 ESMTPS id BD68BD3C; Mon, 17 Feb 2014 11:50:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7CA11811; Mon, 17 Feb 2014 11:50:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBou0B018880; Mon, 17 Feb 2014 11:50:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBou3Q018877; Mon, 17 Feb 2014 11:50:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402171150.s1HBou3Q018877@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Feb 2014 11:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262027 - in head/sys: conf net netinet 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 11:50:56 -0000 Author: glebius Date: Mon Feb 17 11:50:56 2014 New Revision: 262027 URL: http://svnweb.freebsd.org/changeset/base/262027 Log: o Remove at compile time the HASH_ALL code, that was never tested and is unfinished. However, I've tested my version, it works okay. As before it is unfinished: timeout aren't driven by TCP session state. To enable the HASH_ALL mode, one needs in kernel config: options FLOWTABLE_HASH_ALL o Reduce the alignment on flentry to 64 bytes. Without the FLOWTABLE_HASH_ALL option, twice less memory would be consumed by flows. o API to ip_output()/ip6_output() got even more thin: 1 liner. o Remove unused unions. Simply use fle->f_key[]. o Merge all IPv4 code into flowtable_lookup_ipv4(), and do same flowtable_lookup_ipv6(). Stop copying data to on stack sockaddr structures, simply use key[] on stack. o Move code from flowtable_lookup_common() that actually works on insertion into flowtable_insert(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/conf/options head/sys/net/flowtable.c head/sys/net/flowtable.h head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Feb 17 11:44:58 2014 (r262026) +++ head/sys/conf/options Mon Feb 17 11:50:56 2014 (r262027) @@ -440,6 +440,7 @@ TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK FLOWTABLE opt_route.h +FLOWTABLE_HASH_ALL opt_route.h # # SCTP Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Mon Feb 17 11:44:58 2014 (r262026) +++ head/sys/net/flowtable.c Mon Feb 17 11:50:56 2014 (r262027) @@ -73,91 +73,53 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #endif +#ifdef FLOWTABLE_HASH_ALL #include #include #include +#endif #include -#ifdef INET -struct ipv4_tuple { - uint16_t ip_sport; /* source port */ - uint16_t ip_dport; /* destination port */ - in_addr_t ip_saddr; /* source address */ - in_addr_t ip_daddr; /* destination address */ -}; - -union ipv4_flow { - struct ipv4_tuple ipf_ipt; - uint32_t ipf_key[3]; -}; +#ifdef FLOWTABLE_HASH_ALL +#define KEY_PORTS (sizeof(uint16_t) * 2) +#define KEY_ADDRS 2 +#else +#define KEY_PORTS 0 +#define KEY_ADDRS 1 #endif -#ifdef INET6 -struct ipv6_tuple { - uint16_t ip_sport; /* source port */ - uint16_t ip_dport; /* destination port */ - struct in6_addr ip_saddr; /* source address */ - struct in6_addr ip_daddr; /* destination address */ -}; - -union ipv6_flow { - struct ipv6_tuple ipf_ipt; - uint32_t ipf_key[9]; -}; +#ifdef INET6 +#define KEY_ADDR_LEN sizeof(struct in6_addr) +#else +#define KEY_ADDR_LEN sizeof(struct in_addr) #endif +#define KEYLEN ((KEY_ADDR_LEN * KEY_ADDRS + KEY_PORTS) / sizeof(uint32_t)) + struct flentry { - uint32_t f_fhash; /* hash flowing forward */ - uint16_t f_flags; /* flow flags */ - uint8_t f_pad; - uint8_t f_proto; /* protocol */ - uint32_t f_fibnum; /* fib index */ + uint32_t f_hash; /* hash flowing forward */ + uint32_t f_key[KEYLEN]; /* address(es and ports) */ uint32_t f_uptime; /* uptime at last access */ + uint16_t f_fibnum; /* fib index */ +#ifdef FLOWTABLE_HASH_ALL + uint8_t f_proto; /* protocol */ + uint8_t f_flags; /* stale? */ +#define FL_STALE 1 +#endif SLIST_ENTRY(flentry) f_next; /* pointer to collision entry */ struct rtentry *f_rt; /* rtentry for flow */ struct llentry *f_lle; /* llentry for flow */ - union { -#ifdef INET - union ipv4_flow v4; -#endif -#ifdef INET6 - union ipv6_flow v6; -#endif - } f_flow; -#define f_flow4 f_flow.v4 -#define f_flow6 f_flow.v6 }; -#define KEYLEN(flags) ((((flags) & FL_IPV6) ? 9 : 3) * 4) - -/* Make sure f_flow begins with key. */ -#ifdef INET -CTASSERT(offsetof(struct flentry, f_flow) == - offsetof(struct flentry, f_flow4.ipf_key)); -#endif -#ifdef INET6 -CTASSERT(offsetof(struct flentry, f_flow) == - offsetof(struct flentry, f_flow6.ipf_key)); -#endif +#undef KEYLEN SLIST_HEAD(flist, flentry); /* Make sure we can use pcpu_zone_ptr for struct flist. */ CTASSERT(sizeof(struct flist) == sizeof(void *)); -#define SECS_PER_HOUR 3600 -#define SECS_PER_DAY (24*SECS_PER_HOUR) - -#define SYN_IDLE 300 -#define UDP_IDLE 300 -#define FIN_WAIT_IDLE 600 -#define TCP_IDLE SECS_PER_DAY - struct flowtable { counter_u64_t *ft_stat; int ft_size; - uint32_t ft_flags; - uint32_t ft_max_depth; - /* * ft_table is a malloc(9)ed array of pointers. Pointers point to * memory from UMA_ZONE_PCPU zone. @@ -167,12 +129,6 @@ struct flowtable { struct flist **ft_table; bitstr_t **ft_masks; bitstr_t *ft_tmpmask; - - uint32_t ft_udp_idle; - uint32_t ft_fin_wait_idle; - uint32_t ft_syn_idle; - uint32_t ft_tcp_idle; - boolean_t ft_full; }; #define FLOWSTAT_ADD(ft, name, v) \ @@ -186,7 +142,6 @@ static struct cv flowclean_f_cv; static struct cv flowclean_c_cv; static struct mtx flowclean_lock; static uint32_t flowclean_cycles; -static uint32_t flowclean_freq; /* * TODO: @@ -213,16 +168,7 @@ static VNET_DEFINE(struct flowtable, ip6 static uma_zone_t flow_zone; static VNET_DEFINE(int, flowtable_enable) = 1; -static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; -static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; -static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; -static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; - #define V_flowtable_enable VNET(flowtable_enable) -#define V_flowtable_syn_expire VNET(flowtable_syn_expire) -#define V_flowtable_udp_expire VNET(flowtable_udp_expire) -#define V_flowtable_fin_wait_expire VNET(flowtable_fin_wait_expire) -#define V_flowtable_tcp_expire VNET(flowtable_tcp_expire) static SYSCTL_NODE(_net, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); @@ -231,197 +177,96 @@ SYSCTL_VNET_INT(_net_flowtable, OID_AUTO SYSCTL_UMA_MAX(_net_flowtable, OID_AUTO, maxflows, CTLFLAG_RW, &flow_zone, "Maximum number of flows allowed"); -/* - * XXX This does not end up updating timeouts at runtime - * and only reflects the value for the last table added :-/ - */ -SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, syn_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_syn_expire), 0, - "seconds after which to remove syn allocated flow."); -SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, udp_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_udp_expire), 0, - "seconds after which to remove flow allocated to UDP."); -SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, fin_wait_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_fin_wait_expire), 0, - "seconds after which to remove a flow in FIN_WAIT."); -SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, tcp_expire, CTLFLAG_RW, - &VNET_NAME(flowtable_tcp_expire), 0, - "seconds after which to remove flow allocated to a TCP connection."); - -#define FL_STALE (1<<8) - static MALLOC_DEFINE(M_FTABLE, "flowtable", "flowtable hashes and bitstrings"); -static struct flentry *flowtable_lookup_common(struct flowtable *, - struct sockaddr_storage *, struct sockaddr_storage *, struct mbuf *, int); - -static __inline int -proto_to_flags(uint8_t proto) -{ - int flag; - - switch (proto) { - case IPPROTO_TCP: - flag = FL_TCP; - break; - case IPPROTO_SCTP: - flag = FL_SCTP; - break; - case IPPROTO_UDP: - flag = FL_UDP; - break; - default: - flag = 0; - break; - } - - return (flag); -} - -static __inline int -flags_to_proto(int flags) -{ - int proto, protoflags; - - protoflags = flags & (FL_TCP|FL_SCTP|FL_UDP); - switch (protoflags) { - case FL_TCP: - proto = IPPROTO_TCP; - break; - case FL_SCTP: - proto = IPPROTO_SCTP; - break; - case FL_UDP: - proto = IPPROTO_UDP; - break; - default: - proto = 0; - break; - } - return (proto); -} +static struct flentry * +flowtable_lookup_common(struct flowtable *, uint32_t *, int, uint32_t); #ifdef INET -static int -ipv4_mbuf_demarshal(struct mbuf *m, struct sockaddr_in *ssin, - struct sockaddr_in *dsin, uint16_t *flags) +static struct flentry * +flowtable_lookup_ipv4(struct mbuf *m, struct route *ro) { + struct flentry *fle; + struct sockaddr_in *sin; struct ip *ip; - uint8_t proto; + uint32_t fibnum; +#ifdef FLOWTABLE_HASH_ALL + uint32_t key[3]; int iphlen; - struct tcphdr *th; - struct udphdr *uh; - struct sctphdr *sh; uint16_t sport, dport; + uint8_t proto; +#endif - proto = sport = dport = 0; ip = mtod(m, struct ip *); - dsin->sin_family = AF_INET; - dsin->sin_len = sizeof(*dsin); - dsin->sin_addr = ip->ip_dst; - ssin->sin_family = AF_INET; - ssin->sin_len = sizeof(*ssin); - ssin->sin_addr = ip->ip_src; - proto = ip->ip_p; - if ((*flags & FL_HASH_ALL) == 0) - goto skipports; + if (ip->ip_src.s_addr == ip->ip_dst.s_addr || + (ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || + (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) + return (NULL); + + fibnum = M_GETFIB(m); - iphlen = ip->ip_hl << 2; /* XXX options? */ +#ifdef FLOWTABLE_HASH_ALL + iphlen = ip->ip_hl << 2; + proto = ip->ip_p; switch (proto) { - case IPPROTO_TCP: - th = (struct tcphdr *)((caddr_t)ip + iphlen); + case IPPROTO_TCP: { + struct tcphdr *th; + + th = (struct tcphdr *)((char *)ip + iphlen); sport = th->th_sport; dport = th->th_dport; - if ((*flags & FL_HASH_ALL) && - (th->th_flags & (TH_RST|TH_FIN))) - *flags |= FL_STALE; + if (th->th_flags & (TH_RST|TH_FIN)) + fibnum |= (FL_STALE << 24); break; - case IPPROTO_UDP: - uh = (struct udphdr *)((caddr_t)ip + iphlen); + } + case IPPROTO_UDP: { + struct udphdr *uh; + + uh = (struct udphdr *)((char *)ip + iphlen); sport = uh->uh_sport; dport = uh->uh_dport; break; - case IPPROTO_SCTP: - sh = (struct sctphdr *)((caddr_t)ip + iphlen); + } + case IPPROTO_SCTP: { + struct sctphdr *sh; + + sh = (struct sctphdr *)((char *)ip + iphlen); sport = sh->src_port; dport = sh->dest_port; + /* XXXGL: handle stale? */ break; + } default: - return (ENOTSUP); - /* no port - hence not a protocol we care about */ + sport = dport = 0; break; - } -skipports: - *flags |= proto_to_flags(proto); - ssin->sin_port = sport; - dsin->sin_port = dport; - return (0); -} - -static uint32_t -ipv4_flow_lookup_hash( - struct sockaddr_in *ssin, struct sockaddr_in *dsin, - uint32_t *key, uint16_t flags) -{ - uint16_t sport, dport; - uint8_t proto; - int offset = 0; + key[0] = ip->ip_dst.s_addr; + key[1] = ip->ip_src.s_addr; + key[2] = (dport << 16) | sport; + fibnum |= proto << 16; - proto = flags_to_proto(flags); - sport = dport = key[2] = key[1] = key[0] = 0; - if ((ssin != NULL) && (flags & FL_HASH_ALL)) { - key[1] = ssin->sin_addr.s_addr; - sport = ssin->sin_port; - } - if (dsin != NULL) { - key[2] = dsin->sin_addr.s_addr; - dport = dsin->sin_port; - } - if (flags & FL_HASH_ALL) { - ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; - } else - offset = flow_hashjitter + proto; + fle = flowtable_lookup_common(&V_ip4_ft, key, 3 * sizeof(uint32_t), + fibnum); - return (jenkins_hash32(key, 3, offset)); -} +#else /* !FLOWTABLE_HASH_ALL */ -static struct flentry * -flowtable_lookup_ipv4(struct mbuf *m) -{ - struct sockaddr_storage ssa, dsa; - uint16_t flags; - struct sockaddr_in *dsin, *ssin; - - dsin = (struct sockaddr_in *)&dsa; - ssin = (struct sockaddr_in *)&ssa; - bzero(dsin, sizeof(*dsin)); - bzero(ssin, sizeof(*ssin)); - flags = V_ip4_ft.ft_flags; - if (ipv4_mbuf_demarshal(m, ssin, dsin, &flags) != 0) - return (NULL); + fle = flowtable_lookup_common(&V_ip4_ft, (uint32_t *)&ip->ip_dst, + sizeof(struct in_addr), fibnum); - return (flowtable_lookup_common(&V_ip4_ft, &ssa, &dsa, m, flags)); -} +#endif /* FLOWTABLE_HASH_ALL */ -void -flow_to_route(struct flentry *fle, struct route *ro) -{ - uint32_t *hashkey = NULL; - struct sockaddr_in *sin; + if (fle == NULL) + return (NULL); sin = (struct sockaddr_in *)&ro->ro_dst; sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); - hashkey = fle->f_flow4.ipf_key; - sin->sin_addr.s_addr = hashkey[2]; - ro->ro_rt = fle->f_rt; - ro->ro_lle = fle->f_lle; - ro->ro_flags |= RT_NORTREF; + sin->sin_addr = ip->ip_dst; + + return (fle); } #endif /* INET */ @@ -435,9 +280,8 @@ flow_to_route(struct flentry *fle, struc #define PULLUP_TO(_len, p, T) \ do { \ int x = (_len) + sizeof(T); \ - if ((m)->m_len < x) { \ - goto receive_failed; \ - } \ + if ((m)->m_len < x) \ + return (NULL); \ p = (mtod(m, char *) + (_len)); \ } while (0) @@ -445,26 +289,35 @@ do { \ #define SCTP(p) ((struct sctphdr *)(p)) #define UDP(p) ((struct udphdr *)(p)) -static int -ipv6_mbuf_demarshal(struct mbuf *m, struct sockaddr_in6 *ssin6, - struct sockaddr_in6 *dsin6, uint16_t *flags) +static struct flentry * +flowtable_lookup_ipv6(struct mbuf *m, struct route *ro) { + struct flentry *fle; + struct sockaddr_in6 *sin6; struct ip6_hdr *ip6; - uint8_t proto; + uint32_t fibnum; +#ifdef FLOWTABLE_HASH_ALL + uint32_t key[9]; + void *ulp; int hlen; - uint16_t src_port, dst_port; + uint16_t sport, dport; u_short offset; - void *ulp; + uint8_t proto; +#else + uint32_t key[4]; +#endif - offset = hlen = src_port = dst_port = 0; - ulp = NULL; ip6 = mtod(m, struct ip6_hdr *); - hlen = sizeof(struct ip6_hdr); - proto = ip6->ip6_nxt; + if (in6_localaddr(&ip6->ip6_dst)) + return (NULL); - if ((*flags & FL_HASH_ALL) == 0) - goto skipports; + fibnum = M_GETFIB(m); +#ifdef FLOWTABLE_HASH_ALL + hlen = sizeof(struct ip6_hdr); + proto = ip6->ip6_nxt; + offset = sport = dport = 0; + ulp = NULL; while (ulp == NULL) { switch (proto) { case IPPROTO_ICMPV6: @@ -477,21 +330,21 @@ ipv6_mbuf_demarshal(struct mbuf *m, stru break; case IPPROTO_TCP: PULLUP_TO(hlen, ulp, struct tcphdr); - dst_port = TCP(ulp)->th_dport; - src_port = TCP(ulp)->th_sport; - if ((*flags & FL_HASH_ALL) && - (TCP(ulp)->th_flags & (TH_RST|TH_FIN))) - *flags |= FL_STALE; + dport = TCP(ulp)->th_dport; + sport = TCP(ulp)->th_sport; + if (TCP(ulp)->th_flags & (TH_RST|TH_FIN)) + fibnum |= (FL_STALE << 24); break; case IPPROTO_SCTP: PULLUP_TO(hlen, ulp, struct sctphdr); - src_port = SCTP(ulp)->src_port; - dst_port = SCTP(ulp)->dest_port; + dport = SCTP(ulp)->src_port; + sport = SCTP(ulp)->dest_port; + /* XXXGL: handle stale? */ break; case IPPROTO_UDP: PULLUP_TO(hlen, ulp, struct udphdr); - dst_port = UDP(ulp)->uh_dport; - src_port = UDP(ulp)->uh_sport; + dport = UDP(ulp)->uh_dport; + sport = UDP(ulp)->uh_sport; break; case IPPROTO_HOPOPTS: /* RFC 2460 */ PULLUP_TO(hlen, ulp, struct ip6_hbh); @@ -531,102 +384,28 @@ ipv6_mbuf_demarshal(struct mbuf *m, stru } } - if (src_port == 0) { - receive_failed: - return (ENOTSUP); - } - -skipports: - dsin6->sin6_family = AF_INET6; - dsin6->sin6_len = sizeof(*dsin6); - dsin6->sin6_port = dst_port; - memcpy(&dsin6->sin6_addr, &ip6->ip6_dst, sizeof(struct in6_addr)); - - ssin6->sin6_family = AF_INET6; - ssin6->sin6_len = sizeof(*ssin6); - ssin6->sin6_port = src_port; - memcpy(&ssin6->sin6_addr, &ip6->ip6_src, sizeof(struct in6_addr)); - *flags |= proto_to_flags(proto); - - return (0); -} - -#define zero_key(key) \ -do { \ - key[0] = 0; \ - key[1] = 0; \ - key[2] = 0; \ - key[3] = 0; \ - key[4] = 0; \ - key[5] = 0; \ - key[6] = 0; \ - key[7] = 0; \ - key[8] = 0; \ -} while (0) - -static uint32_t -ipv6_flow_lookup_hash( - struct sockaddr_in6 *ssin6, struct sockaddr_in6 *dsin6, - uint32_t *key, uint16_t flags) -{ - uint16_t sport, dport; - uint8_t proto; - int offset = 0; - - proto = flags_to_proto(flags); - zero_key(key); - sport = dport = 0; - if (dsin6 != NULL) { - memcpy(&key[1], &dsin6->sin6_addr, sizeof(struct in6_addr)); - dport = dsin6->sin6_port; - } - if ((ssin6 != NULL) && (flags & FL_HASH_ALL)) { - memcpy(&key[5], &ssin6->sin6_addr, sizeof(struct in6_addr)); - sport = ssin6->sin6_port; - } - if (flags & FL_HASH_ALL) { - ((uint16_t *)key)[0] = sport; - ((uint16_t *)key)[1] = dport; - } else - offset = flow_hashjitter + proto; - - return (jenkins_hash32(key, 9, offset)); -} - -static struct flentry * -flowtable_lookup_ipv6(struct mbuf *m) -{ - struct sockaddr_storage ssa, dsa; - struct sockaddr_in6 *dsin6, *ssin6; - uint16_t flags; - - dsin6 = (struct sockaddr_in6 *)&dsa; - ssin6 = (struct sockaddr_in6 *)&ssa; - bzero(dsin6, sizeof(*dsin6)); - bzero(ssin6, sizeof(*ssin6)); - flags = V_ip6_ft.ft_flags; + bcopy(&ip6->ip6_dst, &key[0], sizeof(struct in6_addr)); + bcopy(&ip6->ip6_src, &key[4], sizeof(struct in6_addr)); + key[8] = (dport << 16) | sport; + fibnum |= proto << 16; + + fle = flowtable_lookup_common(&V_ip6_ft, key, 9 * sizeof(uint32_t), + fibnum); +#else /* !FLOWTABLE_HASH_ALL */ + bcopy(&ip6->ip6_dst, &key[0], sizeof(struct in6_addr)); + fle = flowtable_lookup_common(&V_ip6_ft, key, sizeof(struct in6_addr), + fibnum); +#endif /* FLOWTABLE_HASH_ALL */ - if (ipv6_mbuf_demarshal(m, ssin6, dsin6, &flags) != 0) + if (fle == NULL) return (NULL); - return (flowtable_lookup_common(&V_ip6_ft, &ssa, &dsa, m, flags)); -} - -void -flow_to_route_in6(struct flentry *fle, struct route_in6 *ro) -{ - uint32_t *hashkey = NULL; - struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ro->ro_dst; - sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); - hashkey = fle->f_flow6.ipf_key; - memcpy(&sin6->sin6_addr, &hashkey[5], sizeof (struct in6_addr)); - ro->ro_rt = fle->f_rt; - ro->ro_lle = fle->f_lle; - ro->ro_flags |= RT_NORTREF; + bcopy(&ip6->ip6_dst, &sin6->sin6_addr, sizeof(struct in6_addr)); + + return (fle); } #endif /* INET6 */ @@ -654,75 +433,57 @@ flowtable_list(struct flowtable *ft, uin } static int -flow_stale(struct flowtable *ft, struct flentry *fle) +flow_stale(struct flowtable *ft, struct flentry *fle, int maxidle) { - time_t idle_time; - if ((fle->f_fhash == 0) - || ((fle->f_rt->rt_flags & RTF_HOST) && - ((fle->f_rt->rt_flags & (RTF_UP)) - != (RTF_UP))) - || (fle->f_rt->rt_ifp == NULL) - || !RT_LINK_IS_UP(fle->f_rt->rt_ifp)) + if (((fle->f_rt->rt_flags & RTF_HOST) && + ((fle->f_rt->rt_flags & (RTF_UP)) != (RTF_UP))) || + (fle->f_rt->rt_ifp == NULL) || + !RT_LINK_IS_UP(fle->f_rt->rt_ifp) || + (fle->f_lle->la_flags & LLE_VALID) == 0) return (1); - idle_time = time_uptime - fle->f_uptime; + if (time_uptime - fle->f_uptime > maxidle) + return (1); - if ((fle->f_flags & FL_STALE) || - ((fle->f_flags & (TH_SYN|TH_ACK|TH_FIN)) == 0 - && (idle_time > ft->ft_udp_idle)) || - ((fle->f_flags & TH_FIN) - && (idle_time > ft->ft_fin_wait_idle)) || - ((fle->f_flags & (TH_SYN|TH_ACK)) == TH_SYN - && (idle_time > ft->ft_syn_idle)) || - ((fle->f_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK) - && (idle_time > ft->ft_tcp_idle)) || - ((fle->f_rt->rt_flags & RTF_UP) == 0 || - (fle->f_rt->rt_ifp == NULL))) +#ifdef FLOWTABLE_HASH_ALL + if (fle->f_flags & FL_STALE) return (1); +#endif return (0); } static int -flow_full(struct flowtable *ft) +flow_full(void) { - boolean_t full; int count, max; - full = ft->ft_full; count = uma_zone_get_cur(flow_zone); max = uma_zone_get_max(flow_zone); - if (full && (count < (max - (max >> 3)))) - ft->ft_full = FALSE; - else if (!full && (count > (max - (max >> 5)))) - ft->ft_full = TRUE; - - if (full && !ft->ft_full) { - flowclean_freq = 4*hz; - if ((ft->ft_flags & FL_HASH_ALL) == 0) - ft->ft_udp_idle = ft->ft_fin_wait_idle = - ft->ft_syn_idle = ft->ft_tcp_idle = 5; - cv_broadcast(&flowclean_c_cv); - } else if (!full && ft->ft_full) { - flowclean_freq = 20*hz; - if ((ft->ft_flags & FL_HASH_ALL) == 0) - ft->ft_udp_idle = ft->ft_fin_wait_idle = - ft->ft_syn_idle = ft->ft_tcp_idle = 30; - } - - return (ft->ft_full); + return (count > (max - (max >> 3))); } static int -flow_matches(struct flentry *fle, uint32_t hash, uint32_t *key, uint8_t - proto, uint32_t fibnum) +flow_matches(struct flentry *fle, uint32_t *key, int keylen, uint32_t fibnum) { +#ifdef FLOWTABLE_HASH_ALL + uint8_t proto; + + proto = (fibnum >> 16) & 0xff; + fibnum &= 0xffff; +#endif + + CRITICAL_ASSERT(curthread); - if (fle->f_fhash == hash && - bcmp(&fle->f_flow, key, KEYLEN(fle->f_flags)) == 0 && - proto == fle->f_proto && fibnum == fle->f_fibnum && + /* Microoptimization for IPv4: don't use bcmp(). */ + if (((keylen == sizeof(uint32_t) && (fle->f_key[0] != key[0])) || + (bcmp(fle->f_key, key, keylen) == 0)) && + fibnum == fle->f_fibnum && +#ifdef FLOWTABLE_HASH_ALL + proto == fle->f_proto && +#endif (fle->f_rt->rt_flags & RTF_UP) && fle->f_rt->rt_ifp != NULL && (fle->f_lle->la_flags & LLE_VALID)) @@ -733,27 +494,131 @@ flow_matches(struct flentry *fle, uint32 static struct flentry * flowtable_insert(struct flowtable *ft, uint32_t hash, uint32_t *key, - uint32_t fibnum, struct route *ro, uint16_t flags) + int keylen, uint32_t fibnum0) { +#ifdef INET6 + struct route_in6 sro6; +#endif +#ifdef INET + struct route sro; +#endif + struct route *ro = NULL; + struct rtentry *rt; + struct lltable *lt = NULL; + struct llentry *lle; + struct sockaddr_storage *l3addr; + struct ifnet *ifp; struct flist *flist; struct flentry *fle, *iter; bitstr_t *mask; - int depth; + uint16_t fibnum = fibnum0; +#ifdef FLOWTABLE_HASH_ALL uint8_t proto; + proto = (fibnum0 >> 16) & 0xff; + fibnum = fibnum0 & 0xffff; +#endif + + /* + * This bit of code ends up locking the + * same route 3 times (just like ip_output + ether_output) + * - at lookup + * - in rt_check when called by arpresolve + * - dropping the refcount for the rtentry + * + * This could be consolidated to one if we wrote a variant + * of arpresolve with an rt_check variant that expected to + * receive the route locked + */ +#ifdef INET + if (ft == &V_ip4_ft) { + struct sockaddr_in *sin; + + ro = &sro; + bzero(&sro.ro_dst, sizeof(sro.ro_dst)); + + sin = (struct sockaddr_in *)&sro.ro_dst; + sin->sin_family = AF_INET; + sin->sin_len = sizeof(*sin); + sin->sin_addr.s_addr = key[0]; + } +#endif +#ifdef INET6 + if (ft == &V_ip6_ft) { + struct sockaddr_in6 *sin6; + + ro = (struct route *)&sro6; + sin6 = &sro6.ro_dst; + + bzero(sin6, sizeof(*sin6)); + sin6->sin6_family = AF_INET6; + sin6->sin6_len = sizeof(*sin6); + bcopy(key, &sin6->sin6_addr, sizeof(struct in6_addr)); + } +#endif + + ro->ro_rt = NULL; +#ifdef RADIX_MPATH + rtalloc_mpath_fib(ro, hash, fibnum); +#else + rtalloc_ign_fib(ro, 0, fibnum); +#endif + if (ro->ro_rt == NULL) + return (NULL); + + rt = ro->ro_rt; + ifp = rt->rt_ifp; + + if (ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) { + RTFREE(rt); + return (NULL); + } + +#ifdef INET + if (ft == &V_ip4_ft) + lt = LLTABLE(ifp); +#endif +#ifdef INET6 + if (ft == &V_ip6_ft) + lt = LLTABLE6(ifp); +#endif + + if (rt->rt_flags & RTF_GATEWAY) + l3addr = (struct sockaddr_storage *)rt->rt_gateway; + else + l3addr = (struct sockaddr_storage *)&ro->ro_dst; + lle = llentry_alloc(ifp, lt, l3addr); + + if (lle == NULL) { + RTFREE(rt); + return (NULL); + } + + /* Don't insert the entry if the ARP hasn't yet finished resolving. */ + if ((lle->la_flags & LLE_VALID) == 0) { + RTFREE(rt); + LLE_FREE(lle); + FLOWSTAT_INC(ft, ft_fail_lle_invalid); + return (NULL); + } + fle = uma_zalloc(flow_zone, M_NOWAIT | M_ZERO); - if (fle == NULL) + if (fle == NULL) { + RTFREE(rt); + LLE_FREE(lle); return (NULL); + } - proto = flags_to_proto(flags); - bcopy(key, &fle->f_flow, KEYLEN(flags)); - fle->f_flags |= (flags & FL_IPV6); - fle->f_proto = proto; - fle->f_rt = ro->ro_rt; - fle->f_lle = ro->ro_lle; - fle->f_fhash = hash; + fle->f_hash = hash; + bcopy(key, &fle->f_key, keylen); + fle->f_rt = rt; + fle->f_lle = lle; fle->f_fibnum = fibnum; fle->f_uptime = time_uptime; +#ifdef FLOWTABLE_HASH_ALL + fle->f_proto = proto; + fle->f_flags = fibnum0 >> 24; +#endif critical_enter(); mask = flowtable_mask(ft); @@ -765,13 +630,13 @@ flowtable_insert(struct flowtable *ft, u goto skip; } - depth = 0; /* * find end of list and make sure that we were not * preempted by another thread handling this flow */ SLIST_FOREACH(iter, flist, f_next) { - if (flow_matches(iter, hash, key, proto, fibnum)) { + KASSERT(iter->f_hash == hash, ("%s: wrong hash", __func__)); + if (flow_matches(iter, key, keylen, fibnum)) { /* * We probably migrated to an other CPU after * lookup in flowtable_lookup_common() failed. @@ -779,18 +644,16 @@ flowtable_insert(struct flowtable *ft, u * entry. */ iter->f_uptime = time_uptime; - iter->f_flags |= flags; +#ifdef FLOWTABLE_HASH_ALL + iter->f_flags |= fibnum >> 24; +#endif critical_exit(); FLOWSTAT_INC(ft, ft_collisions); uma_zfree(flow_zone, fle); return (iter); } - depth++; } - if (depth > ft->ft_max_depth) - ft->ft_max_depth = depth; - SLIST_INSERT_HEAD(flist, fle, f_next); skip: critical_exit(); @@ -799,215 +662,75 @@ skip: return (fle); } -struct flentry * -flowtable_lookup(sa_family_t sa, struct mbuf *m) +int +flowtable_lookup(sa_family_t sa, struct mbuf *m, struct route *ro) { + struct flentry *fle; + + if (V_flowtable_enable == 0) + return (ENXIO); switch (sa) { #ifdef INET case AF_INET: - return (flowtable_lookup_ipv4(m)); + fle = flowtable_lookup_ipv4(m, ro); + break; #endif #ifdef INET6 case AF_INET6: - return (flowtable_lookup_ipv6(m)); + fle = flowtable_lookup_ipv6(m, ro); + break; #endif default: panic("%s: sa %d", __func__, sa); } -} -static struct flentry * -flowtable_lookup_common(struct flowtable *ft, struct sockaddr_storage *ssa, - struct sockaddr_storage *dsa, struct mbuf *m, int flags) -{ - struct route_in6 sro6; - struct route sro, *ro; - struct flist *flist; - struct flentry *fle; - struct rtentry *rt; - struct llentry *lle; - struct sockaddr_storage *l3addr; - struct ifnet *ifp; - uint32_t key[9], hash, fibnum; - uint8_t proto; - - if (V_flowtable_enable == 0) - return (NULL); - - sro.ro_rt = sro6.ro_rt = NULL; - sro.ro_lle = sro6.ro_lle = NULL; - flags |= ft->ft_flags; - proto = flags_to_proto(flags); - fibnum = M_GETFIB(m); - - switch (ssa->ss_family) { -#ifdef INET - case AF_INET: { - struct sockaddr_in *ssin, *dsin; - - KASSERT(dsa->ss_family == AF_INET, - ("%s: dsa family %d\n", __func__, dsa->ss_family)); - - ro = &sro; - memcpy(&ro->ro_dst, dsa, sizeof(struct sockaddr_in)); - /* - * The harvested source and destination addresses - * may contain port information if the packet is - * from a transport protocol (e.g. TCP/UDP). The - * port field must be cleared before performing - * a route lookup. - */ - ((struct sockaddr_in *)&ro->ro_dst)->sin_port = 0; - dsin = (struct sockaddr_in *)dsa; - ssin = (struct sockaddr_in *)ssa; - if ((dsin->sin_addr.s_addr == ssin->sin_addr.s_addr) || - (ntohl(dsin->sin_addr.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || - (ntohl(ssin->sin_addr.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) - return (NULL); + if (fle == NULL) + return (EHOSTUNREACH); - hash = ipv4_flow_lookup_hash(ssin, dsin, key, flags); - break; + if (!(m->m_flags & M_FLOWID)) { + m->m_flags |= M_FLOWID; + m->m_pkthdr.flowid = fle->f_hash; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:01:51 2014 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 ESMTPS id 0E6E3F7C; Mon, 17 Feb 2014 12:01:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED7AF18DD; Mon, 17 Feb 2014 12:01:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HC1oYF025115; Mon, 17 Feb 2014 12:01:50 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HC1oXq025113; Mon, 17 Feb 2014 12:01:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402171201.s1HC1oXq025113@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Feb 2014 12:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262028 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:01:51 -0000 Author: glebius Date: Mon Feb 17 12:01:50 2014 New Revision: 262028 URL: http://svnweb.freebsd.org/changeset/base/262028 Log: Bring copyright notice to standard style. Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Mon Feb 17 11:50:56 2014 (r262027) +++ head/sys/net/flowtable.c Mon Feb 17 12:01:50 2014 (r262028) @@ -1,31 +1,30 @@ -/************************************************************************** - -Copyright (c) 2008-2010, BitGravity 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. Neither the name of the BitGravity Corporation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -***************************************************************************/ +/*- + * + * Copyright (c) 2008-2010, BitGravity 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. Neither the name of the BitGravity Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #include "opt_route.h" #include "opt_mpath.h" Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Mon Feb 17 11:50:56 2014 (r262027) +++ head/sys/net/flowtable.h Mon Feb 17 12:01:50 2014 (r262028) @@ -1,33 +1,33 @@ -/************************************************************************** - -Copyright (c) 2008-2010, BitGravity 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. Neither the name of the BitGravity Corporation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -$FreeBSD$ - -***************************************************************************/ +/*- + * + * Copyright (c) 2008-2010, BitGravity 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. Neither the name of the BitGravity Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ #ifndef _NET_FLOWTABLE_H_ #define _NET_FLOWTABLE_H_ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:02:45 2014 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 ESMTPS id 5744D21A; Mon, 17 Feb 2014 12:02:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42A8918ED; Mon, 17 Feb 2014 12:02:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HC2jLq025401; Mon, 17 Feb 2014 12:02:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HC2jg9025400; Mon, 17 Feb 2014 12:02:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402171202.s1HC2jg9025400@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Feb 2014 12:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262029 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:02:45 -0000 Author: glebius Date: Mon Feb 17 12:02:44 2014 New Revision: 262029 URL: http://svnweb.freebsd.org/changeset/base/262029 Log: Whitespace. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Mon Feb 17 12:01:50 2014 (r262028) +++ head/sys/net/flowtable.c Mon Feb 17 12:02:44 2014 (r262029) @@ -412,7 +412,7 @@ static bitstr_t * flowtable_mask(struct flowtable *ft) { - /* + /* * flowtable_free_stale() calls w/o critical section, but * with sched_bind(). Since pointer is stable throughout * ft lifetime, it is safe, otherwise... @@ -496,10 +496,10 @@ flowtable_insert(struct flowtable *ft, u int keylen, uint32_t fibnum0) { #ifdef INET6 - struct route_in6 sro6; + struct route_in6 sro6; #endif #ifdef INET - struct route sro; + struct route sro; #endif struct route *ro = NULL; struct rtentry *rt; @@ -735,7 +735,7 @@ flowtable_lookup_common(struct flowtable /* * used by the bit_alloc macro */ -#define calloc(count, size) malloc((count)*(size), M_FTABLE, M_WAITOK | M_ZERO) +#define calloc(count, size) malloc((count)*(size), M_FTABLE, M_WAITOK | M_ZERO) static void flowtable_alloc(struct flowtable *ft) { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:07:18 2014 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 ESMTPS id 5336A4D3; Mon, 17 Feb 2014 12:07:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC8B1952; Mon, 17 Feb 2014 12:07:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HC7ItG026212; Mon, 17 Feb 2014 12:07:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HC7HTc026207; Mon, 17 Feb 2014 12:07:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402171207.s1HC7HTc026207@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Feb 2014 12:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262030 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:07:18 -0000 Author: glebius Date: Mon Feb 17 12:07:17 2014 New Revision: 262030 URL: http://svnweb.freebsd.org/changeset/base/262030 Log: Add my copyright to flowtable. Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Mon Feb 17 12:02:44 2014 (r262029) +++ head/sys/net/flowtable.c Mon Feb 17 12:07:17 2014 (r262030) @@ -1,5 +1,5 @@ /*- - * + * Copyright (c) 2014 Gleb Smirnoff * Copyright (c) 2008-2010, BitGravity Inc. * All rights reserved. * Modified: head/sys/net/flowtable.h ============================================================================== --- head/sys/net/flowtable.h Mon Feb 17 12:02:44 2014 (r262029) +++ head/sys/net/flowtable.h Mon Feb 17 12:07:17 2014 (r262030) @@ -1,5 +1,5 @@ /*- - * + * Copyright (c) 2014 Gleb Smirnoff * Copyright (c) 2008-2010, BitGravity Inc. * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:12:32 2014 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 ESMTPS id AB4B0834; Mon, 17 Feb 2014 12:12:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9699419E4; Mon, 17 Feb 2014 12:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCCWob029785; Mon, 17 Feb 2014 12:12:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCCWE6029784; Mon, 17 Feb 2014 12:12:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171212.s1HCCWE6029784@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:12:32 +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: r262032 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:12:32 -0000 Author: avg Date: Mon Feb 17 12:12:32 2014 New Revision: 262032 URL: http://svnweb.freebsd.org/changeset/base/262032 Log: MFC r254811: call linker_file_lookup_set() with the shared lock held Modified: stable/9/sys/kern/kern_linker.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Mon Feb 17 12:10:08 2014 (r262031) +++ stable/9/sys/kern/kern_linker.c Mon Feb 17 12:12:32 2014 (r262032) @@ -196,6 +196,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; /* @@ -221,6 +223,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) @@ -230,6 +233,7 @@ linker_file_sysinit(linker_file_t lf) (*((*sipp)->func)) ((*sipp)->udata); } mtx_unlock(&Giant); + sx_xlock(&kld_sx); } static void @@ -240,6 +244,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; @@ -267,6 +273,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) @@ -276,6 +283,7 @@ linker_file_sysuninit(linker_file_t lf) (*((*sipp)->func)) ((*sipp)->udata); } mtx_unlock(&Giant); + sx_xlock(&kld_sx); } static void @@ -287,13 +295,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 @@ -304,13 +316,17 @@ linker_file_unregister_sysctls(linker_fi KLD_DPF(FILE, ("linker_file_unregister_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_unregister_oid(*oidp); sysctl_unlock(); + sx_xlock(&kld_sx); } static int @@ -323,6 +339,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) { /* @@ -411,10 +429,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; /* @@ -665,10 +681,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); @@ -737,15 +751,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 Mon Feb 17 12:14:51 2014 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 ESMTPS id 26F82978; Mon, 17 Feb 2014 12:14:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1296E19F2; Mon, 17 Feb 2014 12:14:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCEoEl030165; Mon, 17 Feb 2014 12:14:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCEoG8030164; Mon, 17 Feb 2014 12:14:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171214.s1HCEoG8030164@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:14: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: r262033 - stable/9/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:14:51 -0000 Author: avg Date: Mon Feb 17 12:14:50 2014 New Revision: 262033 URL: http://svnweb.freebsd.org/changeset/base/262033 Log: MFC r255776: Give argtype struct names a different prefix than probe struct names Modified: stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 12:12:32 2014 (r262032) +++ stable/9/sys/sys/sdt.h Mon Feb 17 12:14:50 2014 (r262033) @@ -160,11 +160,11 @@ SET_DECLARE(sdt_argtypes_set, struct sdt } while (0) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) \ - static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ + static struct sdt_argtype sdta_##prov##_##mod##_##func##_##name##num[1] \ = { { num, type, xtype, { NULL, NULL }, \ sdt_##prov##_##mod##_##func##_##name } \ }; \ - DATA_SET(sdt_argtypes_set, sdt_##prov##_##mod##_##func##_##name##num); + DATA_SET(sdt_argtypes_set, sdta_##prov##_##mod##_##func##_##name##num); #define SDT_PROBE_DEFINE0(prov, mod, func, name, sname) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:24:06 2014 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 ESMTPS id 2B4DFD02; Mon, 17 Feb 2014 12:24:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0CA1AB9; Mon, 17 Feb 2014 12:24:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCO510033937; Mon, 17 Feb 2014 12:24:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCO5lK033934; Mon, 17 Feb 2014 12:24:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171224.s1HCO5lK033934@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:24:05 +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: r262034 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:24:06 -0000 Author: avg Date: Mon Feb 17 12:24:05 2014 New Revision: 262034 URL: http://svnweb.freebsd.org/changeset/base/262034 Log: MFC r255777: Omit "__restrict" when generating syscall argument strings syscall argument strings are also regenerated as part of this commit Modified: stable/9/sys/kern/makesyscalls.sh stable/9/sys/kern/systrace_args.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/makesyscalls.sh ============================================================================== --- stable/9/sys/kern/makesyscalls.sh Mon Feb 17 12:14:50 2014 (r262033) +++ stable/9/sys/kern/makesyscalls.sh Mon Feb 17 12:24:05 2014 (r262034) @@ -392,19 +392,21 @@ s/\$//g printf("\t\tswitch(ndx) {\n") > systracetmp printf("\t\tstruct %s *p = params;\n", argalias) > systrace for (i = 1; i <= argc; i++) { - printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, argtype[i]) > systracetmp - if (index(argtype[i], "*") > 0 || argtype[i] == "caddr_t") + arg = argtype[i] + sub("__restrict$", "", arg) + printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, arg) > systracetmp + if (index(arg, "*") > 0 || arg == "caddr_t") printf("\t\tuarg[%d] = (intptr_t) p->%s; /* %s */\n", \ i - 1, \ - argname[i], argtype[i]) > systrace - else if (substr(argtype[i], 1, 1) == "u" || argtype[i] == "size_t") + argname[i], arg) > systrace + else if (substr(arg, 1, 1) == "u" || arg == "size_t") printf("\t\tuarg[%d] = p->%s; /* %s */\n", \ i - 1, \ - argname[i], argtype[i]) > systrace + argname[i], arg) > systrace else printf("\t\tiarg[%d] = p->%s; /* %s */\n", \ i - 1, \ - argname[i], argtype[i]) > systrace + argname[i], arg) > systrace } printf("\t\tdefault:\n\t\t\tbreak;\n\t\t};\n") > systracetmp } Modified: stable/9/sys/kern/systrace_args.c ============================================================================== --- stable/9/sys/kern/systrace_args.c Mon Feb 17 12:14:50 2014 (r262033) +++ stable/9/sys/kern/systrace_args.c Mon Feb 17 12:24:05 2014 (r262034) @@ -209,8 +209,8 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->buf; /* caddr_t */ uarg[2] = p->len; /* size_t */ iarg[3] = p->flags; /* int */ - uarg[4] = (intptr_t) p->from; /* struct sockaddr *__restrict */ - uarg[5] = (intptr_t) p->fromlenaddr; /* __socklen_t *__restrict */ + uarg[4] = (intptr_t) p->from; /* struct sockaddr * */ + uarg[5] = (intptr_t) p->fromlenaddr; /* __socklen_t * */ *n_args = 6; break; } @@ -218,8 +218,8 @@ systrace_args(int sysnum, void *params, case 30: { struct accept_args *p = params; iarg[0] = p->s; /* int */ - uarg[1] = (intptr_t) p->name; /* struct sockaddr *__restrict */ - uarg[2] = (intptr_t) p->anamelen; /* __socklen_t *__restrict */ + uarg[1] = (intptr_t) p->name; /* struct sockaddr * */ + uarg[2] = (intptr_t) p->anamelen; /* __socklen_t * */ *n_args = 3; break; } @@ -227,8 +227,8 @@ systrace_args(int sysnum, void *params, case 31: { struct getpeername_args *p = params; iarg[0] = p->fdes; /* int */ - uarg[1] = (intptr_t) p->asa; /* struct sockaddr *__restrict */ - uarg[2] = (intptr_t) p->alen; /* __socklen_t *__restrict */ + uarg[1] = (intptr_t) p->asa; /* struct sockaddr * */ + uarg[2] = (intptr_t) p->alen; /* __socklen_t * */ *n_args = 3; break; } @@ -236,8 +236,8 @@ systrace_args(int sysnum, void *params, case 32: { struct getsockname_args *p = params; iarg[0] = p->fdes; /* int */ - uarg[1] = (intptr_t) p->asa; /* struct sockaddr *__restrict */ - uarg[2] = (intptr_t) p->alen; /* __socklen_t *__restrict */ + uarg[1] = (intptr_t) p->asa; /* struct sockaddr * */ + uarg[2] = (intptr_t) p->alen; /* __socklen_t * */ *n_args = 3; break; } @@ -3594,10 +3594,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 4: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 5: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; @@ -3610,10 +3610,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 2: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; @@ -3626,10 +3626,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 2: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; @@ -3642,10 +3642,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 2: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:27:03 2014 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 ESMTPS id 5D033E59; Mon, 17 Feb 2014 12:27:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47D6C1AD1; Mon, 17 Feb 2014 12:27:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCR3C6034305; Mon, 17 Feb 2014 12:27:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCR3fP034304; Mon, 17 Feb 2014 12:27:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171227.s1HCR3fP034304@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:27:03 +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: r262035 - stable/9/sys/cddl/contrib/opensolaris/uts/intel/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:27:03 -0000 Author: avg Date: Mon Feb 17 12:27:02 2014 New Revision: 262035 URL: http://svnweb.freebsd.org/changeset/base/262035 Log: MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 12:24:05 2014 (r262034) +++ stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 12:27:02 2014 (r262035) @@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le #define r_rip r_eip #define r_rflags r_eflags #define r_rsp r_esp +#define r_rbp r_ebp #endif /* @@ -1381,29 +1382,27 @@ fasttrap_pid_probe(struct reg *rp) case FASTTRAP_T_PUSHL_EBP: { int ret = 0; - uintptr_t addr = 0; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { - addr = rp->r_rsp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uintptr_t); + ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); } else { #endif #ifdef __i386__ - addr = rp->r_rsp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uint32_t); + ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); #endif #ifdef __amd64 } #endif if (ret == -1) { - fasttrap_sigsegv(p, curthread, addr); + fasttrap_sigsegv(p, curthread, rp->r_rsp); new_pc = pc; break; } - rp->r_rsp = addr; new_pc = pc + tp->ftt_size; break; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:29:18 2014 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 ESMTPS id 6B1AEFA7; Mon, 17 Feb 2014 12:29:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 583CE1AE4; Mon, 17 Feb 2014 12:29:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCTIiF034583; Mon, 17 Feb 2014 12:29:18 GMT (envelope-from jhay@svn.freebsd.org) Received: (from jhay@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCTIrx034582; Mon, 17 Feb 2014 12:29:18 GMT (envelope-from jhay@svn.freebsd.org) Message-Id: <201402171229.s1HCTIrx034582@svn.freebsd.org> From: John Hay Date: Mon, 17 Feb 2014 12:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262036 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:29:18 -0000 Author: jhay Date: Mon Feb 17 12:29:17 2014 New Revision: 262036 URL: http://svnweb.freebsd.org/changeset/base/262036 Log: etcupdate should use the src tree from where the release is built, not the default (/usr/src) tree. MFC after: 2 weeks Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Feb 17 12:27:02 2014 (r262035) +++ head/release/Makefile Mon Feb 17 12:29:17 2014 (r262036) @@ -105,7 +105,7 @@ base.txz: sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \ "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base" etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ - -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" + -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" # Package all components cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} mv ${DISTDIR}/*.txz . From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:37:27 2014 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 ESMTPS id 83FA725C; Mon, 17 Feb 2014 12:37:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2B51BC1; Mon, 17 Feb 2014 12:37:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCbRu5038265; Mon, 17 Feb 2014 12:37:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCbRoB038264; Mon, 17 Feb 2014 12:37:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171237.s1HCbRoB038264@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:37:27 +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: r262037 - stable/9/share/man/man9 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:37:27 -0000 Author: avg Date: Mon Feb 17 12:37:26 2014 New Revision: 262037 URL: http://svnweb.freebsd.org/changeset/base/262037 Log: MFC r254266,254309: Add event handlers for module load and unload events This is just a merge of EVENTHANDLER.9, the actual code chnage was merged earlier. Modified: stable/9/share/man/man9/EVENTHANDLER.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/EVENTHANDLER.9 ============================================================================== --- stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:29:17 2014 (r262036) +++ stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:37:26 2014 (r262037) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd August 1, 2013 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -197,6 +197,12 @@ Callbacks invoked when an interface is c Callbacks invoked when a new network interface appears. .It Vt ifnet_departure_event Callbacks invoked when a network interface is taken down. +.It Vt kld_load +Callbacks invoked after a linker file has been loaded. +.It Vt kld_unload +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. .It Vt power_profile_change Callbacks invoked when the power profile of the system changes. .It Vt process_exec From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:43:00 2014 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 ESMTPS id 0049B440; Mon, 17 Feb 2014 12:42:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C340C1C4C; Mon, 17 Feb 2014 12:42:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCgxcL041532; Mon, 17 Feb 2014 12:42:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCgvtm041518; Mon, 17 Feb 2014 12:42:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171242.s1HCgvtm041518@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:42:57 +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: r262038 - in stable/9: 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: 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:43:00 -0000 Author: avg Date: Mon Feb 17 12:42:57 2014 New Revision: 262038 URL: http://svnweb.freebsd.org/changeset/base/262038 Log: MFC r254813,259587: Rename the kld_unload event handler to kld_unload_try Modified: stable/9/share/man/man9/EVENTHANDLER.9 stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.c stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/dev/hwpmc/hwpmc_mod.c stable/9/sys/kern/kern_linker.c stable/9/sys/sys/eventhandler.h stable/9/sys/sys/pmckern.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/EVENTHANDLER.9 ============================================================================== --- stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:42:57 2014 (r262038) @@ -200,6 +200,8 @@ Callbacks invoked when a network interfa .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: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 12:42:57 2014 (r262038) @@ -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 /* @@ -15333,7 +15333,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: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 12:42:57 2014 (r262038) @@ -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); /* * XXX This is a short term hack to avoid having to comment Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 12:42:57 2014 (r262038) @@ -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: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:42:57 2014 (r262038) @@ -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: stable/9/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_mod.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/dev/hwpmc/hwpmc_mod.c Mon Feb 17 12:42:57 2014 (r262038) @@ -131,7 +131,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; @@ -1475,50 +1476,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. */ @@ -1835,8 +1792,8 @@ const char *pmc_hooknames[] = { "CSW-IN", "CSW-OUT", "SAMPLE", - "KLDLOAD", - "KLDUNLOAD", + "UNUSED1", + "UNUSED2", "MMAP", "MUNMAP", "CALLCHAIN-NMI", @@ -2004,17 +1961,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); @@ -4649,6 +4595,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 @@ -4924,6 +4911,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(); @@ -4981,6 +4974,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: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/kern/kern_linker.c Mon Feb 17 12:42:57 2014 (r262038) @@ -442,6 +442,7 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); } @@ -617,6 +618,12 @@ linker_file_unload(linker_file_t file, i return (0); } + /* Give eventhandlers a chance to prevent the unload. */ + error = 0; + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -698,6 +705,10 @@ linker_file_unload(linker_file_t file, i } LINKER_UNLOAD(file); + + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); + if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; @@ -1003,9 +1014,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; @@ -1044,18 +1052,7 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; 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); - sx_sunlock(&kld_sx); -#else sx_xunlock(&kld_sx); -#endif done: CURVNET_RESTORE(); @@ -1084,9 +1081,6 @@ 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; int error = 0; @@ -1102,10 +1096,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); - if (error != 0) - error = EBUSY; - else if (lf->userrefs == 0) { + if (lf->userrefs == 0) { /* * XXX: maybe LINKER_UNLOAD_FORCE should override ? */ @@ -1113,11 +1104,6 @@ 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 lf->userrefs--; error = linker_file_unload(lf, flags); if (error) @@ -1125,17 +1111,8 @@ 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); - sx_sunlock(&kld_sx); - } else - sx_xunlock(&kld_sx); -#else sx_xunlock(&kld_sx); -#endif + CURVNET_RESTORE(); return (error); } Modified: stable/9/sys/sys/eventhandler.h ============================================================================== --- stable/9/sys/sys/eventhandler.h Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/sys/eventhandler.h Mon Feb 17 12:42:57 2014 (r262038) @@ -259,8 +259,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: stable/9/sys/sys/pmckern.h ============================================================================== --- stable/9/sys/sys/pmckern.h Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/sys/pmckern.h Mon Feb 17 12:42:57 2014 (r262038) @@ -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 Mon Feb 17 12:45:36 2014 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 ESMTPS id E571769F; Mon, 17 Feb 2014 12:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5C2C1C71; Mon, 17 Feb 2014 12:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCjZFX042024; Mon, 17 Feb 2014 12:45:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCjZej042023; Mon, 17 Feb 2014 12:45:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171245.s1HCjZej042023@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262039 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:45:36 -0000 Author: avg Date: Mon Feb 17 12:45:35 2014 New Revision: 262039 URL: http://svnweb.freebsd.org/changeset/base/262039 Log: MFC r259587: Invoke the kld_* event handlers from linker_load_file() ... Modified: stable/10/sys/kern/kern_linker.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_linker.c ============================================================================== --- stable/10/sys/kern/kern_linker.c Mon Feb 17 12:42:57 2014 (r262038) +++ stable/10/sys/kern/kern_linker.c Mon Feb 17 12:45:35 2014 (r262039) @@ -434,6 +434,7 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); } @@ -609,6 +610,12 @@ linker_file_unload(linker_file_t file, i return (0); } + /* Give eventhandlers a chance to prevent the unload. */ + error = 0; + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -690,6 +697,10 @@ linker_file_unload(linker_file_t file, i } LINKER_UNLOAD(file); + + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); + if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; @@ -1033,10 +1044,7 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; if (fileid != NULL) *fileid = lf->id; - - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_load, lf); - sx_sunlock(&kld_sx); + sx_xunlock(&kld_sx); done: CURVNET_RESTORE(); @@ -1066,9 +1074,6 @@ int kern_kldunload(struct thread *td, int fileid, int flags) { 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) @@ -1083,10 +1088,7 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - EVENTHANDLER_INVOKE(kld_unload_try, lf, &error); - if (error != 0) - error = EBUSY; - else if (lf->userrefs == 0) { + if (lf->userrefs == 0) { /* * XXX: maybe LINKER_UNLOAD_FORCE should override ? */ @@ -1094,11 +1096,6 @@ kern_kldunload(struct thread *td, int fi " loaded by the kernel\n"); error = EBUSY; } else { - /* 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) @@ -1106,14 +1103,7 @@ kern_kldunload(struct thread *td, int fi } } else error = ENOENT; - - if (error == 0) { - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_unload, filename, address, size); - sx_sunlock(&kld_sx); - } else - sx_xunlock(&kld_sx); - free(filename, M_TEMP); + sx_xunlock(&kld_sx); CURVNET_RESTORE(); return (error); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:48:06 2014 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 ESMTPS id 554257FD; Mon, 17 Feb 2014 12:48:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3F6701C89; Mon, 17 Feb 2014 12:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCm6bT042371; Mon, 17 Feb 2014 12:48:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCm59u042368; Mon, 17 Feb 2014 12:48:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171248.s1HCm59u042368@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262040 - in stable/10/sys: cddl/dev/sdt sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:48:06 -0000 Author: avg Date: Mon Feb 17 12:48:05 2014 New Revision: 262040 URL: http://svnweb.freebsd.org/changeset/base/262040 Log: MFC r257152: Do some cleanup of the SDT code Modified: stable/10/sys/cddl/dev/sdt/sdt.c stable/10/sys/sys/sdt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/10/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:45:35 2014 (r262039) +++ stable/10/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:48:05 2014 (r262040) @@ -24,6 +24,21 @@ * */ +/* + * This file contains a reimplementation of the statically-defined tracing (SDT) + * framework for DTrace. Probes and SDT providers are defined using the macros + * in sys/sdt.h, which append all the needed structures to linker sets. When + * this module is loaded, it iterates over all of the loaded modules and + * registers probes and providers with the DTrace framework based on the + * contents of these linker sets. + * + * A list of SDT providers is maintained here since a provider may span multiple + * modules. When a kernel module is unloaded, a provider defined in that module + * is unregistered only if no other modules refer to it. The DTrace framework is + * responsible for destroying individual probes when a kernel module is + * unloaded; in particular, probes may not span multiple kernel modules. + */ + #include "opt_kdtrace.h" #include @@ -53,9 +68,8 @@ static void sdt_destroy(void *, dtrace_i static void sdt_enable(void *, dtrace_id_t, void *); static void sdt_disable(void *, dtrace_id_t, void *); -static d_open_t sdt_open; -static void sdt_load(void *); -static int sdt_unload(void *); +static void sdt_load(void); +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 *); @@ -63,12 +77,6 @@ static void sdt_kld_unload_try(void *, s static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); -static struct cdevsw sdt_cdevsw = { - .d_version = D_VERSION, - .d_open = sdt_open, - .d_name = "sdt", -}; - static dtrace_pattr_t sdt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -90,8 +98,6 @@ static dtrace_pops_t sdt_pops = { sdt_destroy, }; -static struct cdev *sdt_cdev; - static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; @@ -117,7 +123,6 @@ sdt_create_provider(struct sdt_provider newprov = malloc(sizeof(*newprov), M_SDT, M_WAITOK | M_ZERO); newprov->name = strdup(prov->name, M_SDT); prov->sdt_refs = newprov->sdt_refs = 1; - TAILQ_INIT(&newprov->probe_list); TAILQ_INSERT_TAIL(&sdt_prov_list, newprov, prov_entry); @@ -174,12 +179,14 @@ sdt_create_probe(struct sdt_probe *probe if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; - TAILQ_INSERT_TAIL(&prov->probe_list, probe, probe_entry); - (void)dtrace_probe_create(prov->id, mod, func, name, 1, probe); } -/* Probes are created through the SDT module load/unload hook. */ +/* + * Probes are created through the SDT module load/unload hook, so this function + * has nothing to do. It only exists because the DTrace provider framework + * requires one of provide_probes and provide_module to be defined. + */ static void sdt_provide_probes(void *arg, dtrace_probedesc_t *desc) { @@ -211,39 +218,39 @@ sdt_getargdesc(void *arg, dtrace_id_t id struct sdt_argtype *argtype; struct sdt_probe *probe = parg; - if (desc->dtargd_ndx < probe->n_args) { - TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { - if (desc->dtargd_ndx == argtype->ndx) { - desc->dtargd_mapping = desc->dtargd_ndx; - strlcpy(desc->dtargd_native, argtype->type, - sizeof(desc->dtargd_native)); - if (argtype->xtype != NULL) - strlcpy(desc->dtargd_xlate, - argtype->xtype, - sizeof(desc->dtargd_xlate)); - else - desc->dtargd_xlate[0] = '\0'; + if (desc->dtargd_ndx >= probe->n_args) { + desc->dtargd_ndx = DTRACE_ARGNONE; + return; + } + + TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { + if (desc->dtargd_ndx == argtype->ndx) { + desc->dtargd_mapping = desc->dtargd_ndx; + if (argtype->type == NULL) { + desc->dtargd_native[0] = '\0'; + desc->dtargd_xlate[0] = '\0'; + continue; } + strlcpy(desc->dtargd_native, argtype->type, + sizeof(desc->dtargd_native)); + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, argtype->xtype, + sizeof(desc->dtargd_xlate)); } - } else - desc->dtargd_ndx = DTRACE_ARGNONE; + } } static void sdt_destroy(void *arg, dtrace_id_t id, void *parg) { - struct sdt_probe *probe; - - probe = parg; - TAILQ_REMOVE(&probe->prov->probe_list, probe, probe_entry); } /* * Called from the kernel linker when a module is loaded, before * dtrace_module_loaded() is called. This is done so that it's possible to - * register new providers when modules are loaded. We cannot do this in the - * provide_module method since it's called with the provider lock held - * and dtrace_register() will try to acquire it again. + * register new providers when modules are loaded. The DTrace framework + * explicitly disallows calling into the framework from the provide_module + * provider method, so we cannot do this there. */ static void sdt_kld_load(void *arg __unused, struct linker_file *lf) @@ -277,14 +284,15 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; if (*error != 0) /* We already have an error, so don't do anything. */ return; - else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL)) + else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, + NULL)) /* No DTrace providers are declared in this file. */ return; @@ -294,17 +302,20 @@ sdt_kld_unload_try(void *arg __unused, s */ for (curr = begin; curr < end; curr++) { TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { - if (strcmp(prov->name, (*curr)->name) == 0) { - if (prov->sdt_refs == 1) { - TAILQ_REMOVE(&sdt_prov_list, prov, - prov_entry); - dtrace_unregister(prov->id); - free(prov->name, M_SDT); - free(prov, M_SDT); - } else - prov->sdt_refs--; - break; - } + if (strcmp(prov->name, (*curr)->name) != 0) + continue; + + if (prov->sdt_refs == 1) { + if (dtrace_unregister(prov->id) != 0) { + *error = 1; + return; + } + TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); + free(prov->name, M_SDT); + free(prov, M_SDT); + } else + prov->sdt_refs--; + break; } } } @@ -319,15 +330,11 @@ sdt_linker_file_cb(linker_file_t lf, voi } static void -sdt_load(void *arg __unused) +sdt_load() { TAILQ_INIT(&sdt_prov_list); - /* Create the /dev/dtrace/sdt entry. */ - sdt_cdev = make_dev(&sdt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/sdt"); - sdt_probe_func = dtrace_probe; sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, @@ -340,9 +347,10 @@ sdt_load(void *arg __unused) } static int -sdt_unload(void *arg __unused) +sdt_unload() { struct sdt_provider *prov, *tmp; + int ret; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); @@ -350,18 +358,17 @@ sdt_unload(void *arg __unused) sdt_probe_func = sdt_probe_stub; TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { + ret = dtrace_unregister(prov->id); + if (ret != 0) + return (ret); TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); - dtrace_unregister(prov->id); free(prov->name, M_SDT); free(prov, M_SDT); } - destroy_dev(sdt_cdev); - return (0); } -/* ARGSUSED */ static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { @@ -369,9 +376,11 @@ sdt_modevent(module_t mod __unused, int switch (type) { case MOD_LOAD: + sdt_load(); break; case MOD_UNLOAD: + error = sdt_unload(); break; case MOD_SHUTDOWN: @@ -385,18 +394,6 @@ sdt_modevent(module_t mod __unused, int return (error); } -/* ARGSUSED */ -static int -sdt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, - struct thread *td __unused) -{ - - return (0); -} - -SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); -SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); - DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); Modified: stable/10/sys/sys/sdt.h ============================================================================== --- stable/10/sys/sys/sdt.h Mon Feb 17 12:45:35 2014 (r262039) +++ stable/10/sys/sys/sdt.h Mon Feb 17 12:48:05 2014 (r262040) @@ -134,7 +134,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROVIDER_DEFINE(prov) \ struct sdt_provider sdt_provider_##prov[1] = { \ - { #prov, { NULL, NULL }, { NULL, NULL }, 0, 0 } \ + { #prov, { NULL, NULL }, 0, 0 } \ }; \ DATA_SET(sdt_providers_set, sdt_provider_##prov); @@ -358,7 +358,6 @@ struct sdt_provider { char *name; /* Provider name. */ TAILQ_ENTRY(sdt_provider) prov_entry; /* SDT provider list entry. */ - TAILQ_HEAD(probe_list_head, sdt_probe) probe_list; uintptr_t id; /* DTrace provider ID. */ int sdt_refs; /* Number of module references. */ }; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:48:20 2014 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 ESMTPS id 3E186929; Mon, 17 Feb 2014 12:48:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27E081C8B; Mon, 17 Feb 2014 12:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCmK0U042436; Mon, 17 Feb 2014 12:48:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCmJ7i042434; Mon, 17 Feb 2014 12:48:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171248.s1HCmJ7i042434@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:48:19 +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: r262041 - in stable/9/sys: cddl/dev/sdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:48:20 -0000 Author: avg Date: Mon Feb 17 12:48:19 2014 New Revision: 262041 URL: http://svnweb.freebsd.org/changeset/base/262041 Log: MFC r257152: Do some cleanup of the SDT code Modified: stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:48:05 2014 (r262040) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:48:19 2014 (r262041) @@ -24,6 +24,21 @@ * */ +/* + * This file contains a reimplementation of the statically-defined tracing (SDT) + * framework for DTrace. Probes and SDT providers are defined using the macros + * in sys/sdt.h, which append all the needed structures to linker sets. When + * this module is loaded, it iterates over all of the loaded modules and + * registers probes and providers with the DTrace framework based on the + * contents of these linker sets. + * + * A list of SDT providers is maintained here since a provider may span multiple + * modules. When a kernel module is unloaded, a provider defined in that module + * is unregistered only if no other modules refer to it. The DTrace framework is + * responsible for destroying individual probes when a kernel module is + * unloaded; in particular, probes may not span multiple kernel modules. + */ + #include "opt_kdtrace.h" #include @@ -53,9 +68,8 @@ static void sdt_destroy(void *, dtrace_i static void sdt_enable(void *, dtrace_id_t, void *); static void sdt_disable(void *, dtrace_id_t, void *); -static d_open_t sdt_open; -static void sdt_load(void *); -static int sdt_unload(void *); +static void sdt_load(void); +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 *); @@ -63,12 +77,6 @@ static void sdt_kld_unload_try(void *, s static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); -static struct cdevsw sdt_cdevsw = { - .d_version = D_VERSION, - .d_open = sdt_open, - .d_name = "sdt", -}; - static dtrace_pattr_t sdt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -90,8 +98,6 @@ static dtrace_pops_t sdt_pops = { sdt_destroy, }; -static struct cdev *sdt_cdev; - static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; @@ -117,7 +123,6 @@ sdt_create_provider(struct sdt_provider newprov = malloc(sizeof(*newprov), M_SDT, M_WAITOK | M_ZERO); newprov->name = strdup(prov->name, M_SDT); prov->sdt_refs = newprov->sdt_refs = 1; - TAILQ_INIT(&newprov->probe_list); TAILQ_INSERT_TAIL(&sdt_prov_list, newprov, prov_entry); @@ -161,12 +166,14 @@ sdt_create_probe(struct sdt_probe *probe if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; - TAILQ_INSERT_TAIL(&prov->probe_list, probe, probe_entry); - (void)dtrace_probe_create(prov->id, mod, func, name, 1, probe); } -/* Probes are created through the SDT module load/unload hook. */ +/* + * Probes are created through the SDT module load/unload hook, so this function + * has nothing to do. It only exists because the DTrace provider framework + * requires one of provide_probes and provide_module to be defined. + */ static void sdt_provide_probes(void *arg, dtrace_probedesc_t *desc) { @@ -198,39 +205,39 @@ sdt_getargdesc(void *arg, dtrace_id_t id struct sdt_argtype *argtype; struct sdt_probe *probe = parg; - if (desc->dtargd_ndx < probe->n_args) { - TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { - if (desc->dtargd_ndx == argtype->ndx) { - desc->dtargd_mapping = desc->dtargd_ndx; - strlcpy(desc->dtargd_native, argtype->type, - sizeof(desc->dtargd_native)); - if (argtype->xtype != NULL) - strlcpy(desc->dtargd_xlate, - argtype->xtype, - sizeof(desc->dtargd_xlate)); - else - desc->dtargd_xlate[0] = '\0'; + if (desc->dtargd_ndx >= probe->n_args) { + desc->dtargd_ndx = DTRACE_ARGNONE; + return; + } + + TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { + if (desc->dtargd_ndx == argtype->ndx) { + desc->dtargd_mapping = desc->dtargd_ndx; + if (argtype->type == NULL) { + desc->dtargd_native[0] = '\0'; + desc->dtargd_xlate[0] = '\0'; + continue; } + strlcpy(desc->dtargd_native, argtype->type, + sizeof(desc->dtargd_native)); + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, argtype->xtype, + sizeof(desc->dtargd_xlate)); } - } else - desc->dtargd_ndx = DTRACE_ARGNONE; + } } static void sdt_destroy(void *arg, dtrace_id_t id, void *parg) { - struct sdt_probe *probe; - - probe = parg; - TAILQ_REMOVE(&probe->prov->probe_list, probe, probe_entry); } /* * Called from the kernel linker when a module is loaded, before * dtrace_module_loaded() is called. This is done so that it's possible to - * register new providers when modules are loaded. We cannot do this in the - * provide_module method since it's called with the provider lock held - * and dtrace_register() will try to acquire it again. + * register new providers when modules are loaded. The DTrace framework + * explicitly disallows calling into the framework from the provide_module + * provider method, so we cannot do this there. */ static void sdt_kld_load(void *arg __unused, struct linker_file *lf) @@ -264,14 +271,15 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; if (*error != 0) /* We already have an error, so don't do anything. */ return; - else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL)) + else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, + NULL)) /* No DTrace providers are declared in this file. */ return; @@ -281,17 +289,20 @@ sdt_kld_unload_try(void *arg __unused, s */ for (curr = begin; curr < end; curr++) { TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { - if (strcmp(prov->name, (*curr)->name) == 0) { - if (prov->sdt_refs == 1) { - TAILQ_REMOVE(&sdt_prov_list, prov, - prov_entry); - dtrace_unregister(prov->id); - free(prov->name, M_SDT); - free(prov, M_SDT); - } else - prov->sdt_refs--; - break; - } + if (strcmp(prov->name, (*curr)->name) != 0) + continue; + + if (prov->sdt_refs == 1) { + if (dtrace_unregister(prov->id) != 0) { + *error = 1; + return; + } + TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); + free(prov->name, M_SDT); + free(prov, M_SDT); + } else + prov->sdt_refs--; + break; } } } @@ -306,15 +317,11 @@ sdt_linker_file_cb(linker_file_t lf, voi } static void -sdt_load(void *arg __unused) +sdt_load() { TAILQ_INIT(&sdt_prov_list); - /* Create the /dev/dtrace/sdt entry. */ - sdt_cdev = make_dev(&sdt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/sdt"); - sdt_probe_func = dtrace_probe; sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, @@ -327,9 +334,10 @@ sdt_load(void *arg __unused) } static int -sdt_unload(void *arg __unused) +sdt_unload() { struct sdt_provider *prov, *tmp; + int ret; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); @@ -337,18 +345,17 @@ sdt_unload(void *arg __unused) sdt_probe_func = sdt_probe_stub; TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { + ret = dtrace_unregister(prov->id); + if (ret != 0) + return (ret); TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); - dtrace_unregister(prov->id); free(prov->name, M_SDT); free(prov, M_SDT); } - destroy_dev(sdt_cdev); - return (0); } -/* ARGSUSED */ static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { @@ -356,9 +363,11 @@ sdt_modevent(module_t mod __unused, int switch (type) { case MOD_LOAD: + sdt_load(); break; case MOD_UNLOAD: + error = sdt_unload(); break; case MOD_SHUTDOWN: @@ -372,18 +381,6 @@ sdt_modevent(module_t mod __unused, int return (error); } -/* ARGSUSED */ -static int -sdt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, - struct thread *td __unused) -{ - - return (0); -} - -SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); -SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); - DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 12:48:05 2014 (r262040) +++ stable/9/sys/sys/sdt.h Mon Feb 17 12:48:19 2014 (r262041) @@ -134,7 +134,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROVIDER_DEFINE(prov) \ struct sdt_provider sdt_provider_##prov[1] = { \ - { #prov, { NULL, NULL }, { NULL, NULL }, 0, 0 } \ + { #prov, { NULL, NULL }, 0, 0 } \ }; \ DATA_SET(sdt_providers_set, sdt_provider_##prov); @@ -358,7 +358,6 @@ struct sdt_provider { char *name; /* Provider name. */ TAILQ_ENTRY(sdt_provider) prov_entry; /* SDT provider list entry. */ - TAILQ_HEAD(probe_list_head, sdt_probe) probe_list; uintptr_t id; /* DTrace provider ID. */ int sdt_refs; /* Number of module references. */ }; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:57:15 2014 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 ESMTPS id D4EDAC2B; Mon, 17 Feb 2014 12:57:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B20C71D41; Mon, 17 Feb 2014 12:57:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCvFiF046171; Mon, 17 Feb 2014 12:57:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCvEg4046162; Mon, 17 Feb 2014 12:57:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171257.s1HCvEg4046162@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262042 - in stable/10/sys: amd64/amd64 cddl/dev/dtrace/amd64 i386/i386 mips/mips powerpc/aim sys x86/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:57:16 -0000 Author: avg Date: Mon Feb 17 12:57:13 2014 New Revision: 262042 URL: http://svnweb.freebsd.org/changeset/base/262042 Log: MFC r257417: Remove references to an unused fasttrap probe hook Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/10/sys/i386/i386/trap.c stable/10/sys/mips/mips/trap.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/sys/dtrace_bsd.h stable/10/sys/x86/include/trap.h Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/amd64/amd64/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -114,9 +114,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -128,7 +127,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -163,7 +162,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -255,16 +253,11 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - else if (type == T_BPTFLT && + if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) goto out; Modified: stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:57:13 2014 (r262042) @@ -142,7 +142,6 @@ dtrace_sync(void) } #ifdef notyet -int (*dtrace_fasttrap_probe_ptr)(struct regs *); int (*dtrace_pid_probe_ptr)(struct regs *); int (*dtrace_return_probe_ptr)(struct regs *); @@ -213,13 +212,6 @@ dtrace_user_probe(struct regs *rp, caddr rw_exit(rwp); rp->r_pc = npc; - } else if (rp->r_trapno == T_DTRACE_PROBE) { - rwp = &CPU->cpu_ft_lock; - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr != NULL) - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } else if (rp->r_trapno == T_BPTFLT) { uint8_t instr; rwp = &CPU->cpu_ft_lock; Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/i386/i386/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -123,9 +123,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -139,7 +138,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -174,8 +173,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ - }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -275,15 +272,10 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) Modified: stable/10/sys/mips/mips/trap.c ============================================================================== --- stable/10/sys/mips/mips/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/mips/mips/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -112,9 +112,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -639,7 +638,7 @@ trap(struct trapframe *trapframe) * function can return normally. */ /* - * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + * XXXDTRACE: add pid probe handler here (if ever) */ if (!usermode) { if (dtrace_trap_func != NULL && (*dtrace_trap_func)(trapframe, type)) Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/powerpc/aim/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -121,9 +121,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; int (*dtrace_invop_jump_addr)(struct trapframe *); @@ -208,7 +207,7 @@ trap(struct trapframe *frame) * function can return normally. */ /* - * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + * XXXDTRACE: add pid probe handler here (if ever) */ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) return; Modified: stable/10/sys/sys/dtrace_bsd.h ============================================================================== --- stable/10/sys/sys/dtrace_bsd.h Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/sys/dtrace_bsd.h Mon Feb 17 12:57:13 2014 (r262042) @@ -70,8 +70,6 @@ extern dtrace_invop_func_t dtrace_invop_ extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ -typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *); -extern dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; typedef int (*dtrace_pid_probe_ptr_t)(struct reg *); extern dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; typedef int (*dtrace_return_probe_ptr_t)(struct reg *); Modified: stable/10/sys/x86/include/trap.h ============================================================================== --- stable/10/sys/x86/include/trap.h Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/x86/include/trap.h Mon Feb 17 12:57:13 2014 (r262042) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 12:57:55 2014 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 ESMTPS id 9A250D6C; Mon, 17 Feb 2014 12:57:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84A391D4C; Mon, 17 Feb 2014 12:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCvton046273; Mon, 17 Feb 2014 12:57:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCvst4046265; Mon, 17 Feb 2014 12:57:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171257.s1HCvst4046265@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:57: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: r262043 - in stable/9/sys: amd64/amd64 amd64/include cddl/dev/dtrace/amd64 i386/i386 i386/include 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 12:57:55 -0000 Author: avg Date: Mon Feb 17 12:57:53 2014 New Revision: 262043 URL: http://svnweb.freebsd.org/changeset/base/262043 Log: MFC r257417: Remove references to an unused fasttrap probe hook Modified: stable/9/sys/amd64/amd64/trap.c stable/9/sys/amd64/include/trap.h stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/9/sys/i386/i386/trap.c stable/9/sys/i386/include/trap.h stable/9/sys/sys/dtrace_bsd.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/amd64/amd64/trap.c Mon Feb 17 12:57:53 2014 (r262043) @@ -114,9 +114,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -128,7 +127,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -163,7 +162,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -255,16 +253,11 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - else if (type == T_BPTFLT && + if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) goto out; Modified: stable/9/sys/amd64/include/trap.h ============================================================================== --- stable/9/sys/amd64/include/trap.h Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/amd64/include/trap.h Mon Feb 17 12:57:53 2014 (r262043) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:57:53 2014 (r262043) @@ -142,7 +142,6 @@ dtrace_sync(void) } #ifdef notyet -int (*dtrace_fasttrap_probe_ptr)(struct regs *); int (*dtrace_pid_probe_ptr)(struct regs *); int (*dtrace_return_probe_ptr)(struct regs *); @@ -213,13 +212,6 @@ dtrace_user_probe(struct regs *rp, caddr rw_exit(rwp); rp->r_pc = npc; - } else if (rp->r_trapno == T_DTRACE_PROBE) { - rwp = &CPU->cpu_ft_lock; - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr != NULL) - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } else if (rp->r_trapno == T_BPTFLT) { uint8_t instr; rwp = &CPU->cpu_ft_lock; Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/i386/i386/trap.c Mon Feb 17 12:57:53 2014 (r262043) @@ -123,9 +123,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -139,7 +138,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -174,8 +173,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ - }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -275,15 +272,10 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) Modified: stable/9/sys/i386/include/trap.h ============================================================================== --- stable/9/sys/i386/include/trap.h Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/i386/include/trap.h Mon Feb 17 12:57:53 2014 (r262043) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/9/sys/sys/dtrace_bsd.h ============================================================================== --- stable/9/sys/sys/dtrace_bsd.h Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/sys/dtrace_bsd.h Mon Feb 17 12:57:53 2014 (r262043) @@ -70,8 +70,6 @@ extern dtrace_invop_func_t dtrace_invop_ extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ -typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *); -extern dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; typedef int (*dtrace_pid_probe_ptr_t)(struct reg *); extern dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; typedef int (*dtrace_return_probe_ptr_t)(struct reg *); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:02:09 2014 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 ESMTPS id 99C4DF83; Mon, 17 Feb 2014 13:02:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8549E1DDB; Mon, 17 Feb 2014 13:02:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD29s8049692; Mon, 17 Feb 2014 13:02:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD29UY049691; Mon, 17 Feb 2014 13:02:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171302.s1HD29UY049691@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262044 - stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:02:09 -0000 Author: avg Date: Mon Feb 17 13:02:09 2014 New Revision: 262044 URL: http://svnweb.freebsd.org/changeset/base/262044 Log: MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 12:57:53 2014 (r262043) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:02:09 2014 (r262044) @@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le #define r_rip r_eip #define r_rflags r_eflags #define r_rsp r_esp +#define r_rbp r_ebp #endif /* @@ -1381,29 +1382,27 @@ fasttrap_pid_probe(struct reg *rp) case FASTTRAP_T_PUSHL_EBP: { int ret = 0; - uintptr_t addr = 0; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { - addr = rp->r_rsp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uintptr_t); + ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); } else { #endif #ifdef __i386__ - addr = rp->r_rsp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uint32_t); + ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); #endif #ifdef __amd64 } #endif if (ret == -1) { - fasttrap_sigsegv(p, curthread, addr); + fasttrap_sigsegv(p, curthread, rp->r_rsp); new_pc = pc; break; } - rp->r_rsp = addr; new_pc = pc + tp->ftt_size; break; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:05:27 2014 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 ESMTPS id 2EEB8230; Mon, 17 Feb 2014 13:05:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3D601DFC; Mon, 17 Feb 2014 13:05:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD5Qat050367; Mon, 17 Feb 2014 13:05:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD5QSN050366; Mon, 17 Feb 2014 13:05:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171305.s1HD5QSN050366@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262045 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:05:27 -0000 Author: avg Date: Mon Feb 17 13:05:26 2014 New Revision: 262045 URL: http://svnweb.freebsd.org/changeset/base/262045 Log: MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" Only mergeinfo for the previous commit. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:08:08 2014 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 ESMTPS id E554A667; Mon, 17 Feb 2014 13:08:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C20861E2A; Mon, 17 Feb 2014 13:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD87IG050904; Mon, 17 Feb 2014 13:08:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD87fR050902; Mon, 17 Feb 2014 13:08:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171308.s1HD87fR050902@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:08:07 +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: r262046 - in stable/9/sys/cddl/contrib/opensolaris/uts: common/sys intel/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:08:08 -0000 Author: avg Date: Mon Feb 17 13:08:07 2014 New Revision: 262046 URL: http://svnweb.freebsd.org/changeset/base/262046 Log: MFC r257679: Use suword32 and suword64 instead of copyout(9) in fasttrap Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.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/sys/fasttrap_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:05:26 2014 (r262045) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:08:07 2014 (r262046) @@ -158,15 +158,15 @@ typedef struct fasttrap_hash { */ #define fasttrap_copyout copyout #define fasttrap_fuword32 fuword32 -#define fasttrap_suword32(_k, _u) copyout((_k), (_u), sizeof(uint32_t)) -#define fasttrap_suword64(_k, _u) copyout((_k), (_u), sizeof(uint64_t)) +#define fasttrap_suword32 suword32 +#define fasttrap_suword64 suword64 #ifdef __amd64__ #define fasttrap_fulword fuword64 -#define fasttrap_sulword fasttrap_suword64 +#define fasttrap_sulword suword64 #else #define fasttrap_fulword fuword32 -#define fasttrap_sulword fasttrap_suword32 +#define fasttrap_sulword suword32 #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:05:26 2014 (r262045) +++ stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:08:07 2014 (r262046) @@ -1386,12 +1386,12 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { rp->r_rsp -= sizeof (uintptr_t); - ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_sulword((void *)rp->r_rsp, rp->r_rbp); } else { #endif #ifdef __i386__ rp->r_rsp -= sizeof (uint32_t); - ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_suword32((void *)rp->r_rsp, rp->r_rbp); #endif #ifdef __amd64 } @@ -1486,13 +1486,13 @@ fasttrap_pid_probe(struct reg *rp) if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); pcps = pc + tp->ftt_size; - ret = fasttrap_sulword((void *)addr, &pcps); + ret = fasttrap_sulword((void *)addr, pcps); } else { #endif #ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); - ret = fasttrap_suword32((void *)addr, &pcps); + ret = fasttrap_suword32((void *)addr, pcps); #endif #ifdef __amd64 } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:08:21 2014 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 ESMTPS id 331D779D; Mon, 17 Feb 2014 13:08:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01D291E32; Mon, 17 Feb 2014 13:08:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD8KLt050976; Mon, 17 Feb 2014 13:08:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD8Kf9050974; Mon, 17 Feb 2014 13:08:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171308.s1HD8Kf9050974@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262047 - in stable/10/sys/cddl/contrib/opensolaris/uts: common/sys intel/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:08:21 -0000 Author: avg Date: Mon Feb 17 13:08:20 2014 New Revision: 262047 URL: http://svnweb.freebsd.org/changeset/base/262047 Log: MFC r257679: Use suword32 and suword64 instead of copyout(9) in fasttrap Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:08:07 2014 (r262046) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:08:20 2014 (r262047) @@ -158,15 +158,15 @@ typedef struct fasttrap_hash { */ #define fasttrap_copyout copyout #define fasttrap_fuword32 fuword32 -#define fasttrap_suword32(_k, _u) copyout((_k), (_u), sizeof(uint32_t)) -#define fasttrap_suword64(_k, _u) copyout((_k), (_u), sizeof(uint64_t)) +#define fasttrap_suword32 suword32 +#define fasttrap_suword64 suword64 #ifdef __amd64__ #define fasttrap_fulword fuword64 -#define fasttrap_sulword fasttrap_suword64 +#define fasttrap_sulword suword64 #else #define fasttrap_fulword fuword32 -#define fasttrap_sulword fasttrap_suword32 +#define fasttrap_sulword suword32 #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:08:07 2014 (r262046) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:08:20 2014 (r262047) @@ -1386,12 +1386,12 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { rp->r_rsp -= sizeof (uintptr_t); - ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_sulword((void *)rp->r_rsp, rp->r_rbp); } else { #endif #ifdef __i386__ rp->r_rsp -= sizeof (uint32_t); - ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_suword32((void *)rp->r_rsp, rp->r_rbp); #endif #ifdef __amd64 } @@ -1486,13 +1486,13 @@ fasttrap_pid_probe(struct reg *rp) if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); pcps = pc + tp->ftt_size; - ret = fasttrap_sulword((void *)addr, &pcps); + ret = fasttrap_sulword((void *)addr, pcps); } else { #endif #ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); - ret = fasttrap_suword32((void *)addr, &pcps); + ret = fasttrap_suword32((void *)addr, pcps); #endif #ifdef __amd64 } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:11:16 2014 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 ESMTPS id C2D0B92F; Mon, 17 Feb 2014 13:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93CE21FAD; Mon, 17 Feb 2014 13:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDBGnn052760; Mon, 17 Feb 2014 13:11:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDBGlW052565; Mon, 17 Feb 2014 13:11:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171311.s1HDBGlW052565@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262048 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:11:16 -0000 Author: avg Date: Mon Feb 17 13:11:15 2014 New Revision: 262048 URL: http://svnweb.freebsd.org/changeset/base/262048 Log: MFC r258291: change the ioctl definition so that the fasttrap ioctl handler is responsible for copying in userland data Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:08:20 2014 (r262047) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:15 2014 (r262048) @@ -2064,20 +2064,16 @@ fasttrap_ioctl(struct cdev *dev, u_long return (EAGAIN); if (cmd == FASTTRAPIOC_MAKEPROBE) { - fasttrap_probe_spec_t *uprobe = (void *)arg; + fasttrap_probe_spec_t *uprobe = *(fasttrap_probe_spec_t **)arg; fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; int ret; char *c; -#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); -#else - noffs = uprobe->ftps_noffs; -#endif /* * Probes must have at least one tracepoint. @@ -2093,19 +2089,10 @@ fasttrap_ioctl(struct cdev *dev, u_long probe = kmem_alloc(size, KM_SLEEP); -#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } -#else - memcpy(probe, uprobe, sizeof(*probe)); - if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { - kmem_free(probe, size); - return (EFAULT); - } -#endif - /* * Verify that the function and module strings contain no Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:08:20 2014 (r262047) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:15 2014 (r262048) @@ -42,8 +42,8 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif typedef enum fasttrap_probe_type { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:11:28 2014 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 ESMTPS id CA9BEA5C; Mon, 17 Feb 2014 13:11:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD201FB0; Mon, 17 Feb 2014 13:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDBSMR054307; Mon, 17 Feb 2014 13:11:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDBSp8054305; Mon, 17 Feb 2014 13:11:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171311.s1HDBSp8054305@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:11: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: r262049 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: dtrace 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:11:28 -0000 Author: avg Date: Mon Feb 17 13:11:27 2014 New Revision: 262049 URL: http://svnweb.freebsd.org/changeset/base/262049 Log: MFC r258291: change the ioctl definition so that the fasttrap ioctl handler is responsible for copying in userland data Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:15 2014 (r262048) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:27 2014 (r262049) @@ -2056,20 +2056,16 @@ fasttrap_ioctl(struct cdev *dev, u_long return (EAGAIN); if (cmd == FASTTRAPIOC_MAKEPROBE) { - fasttrap_probe_spec_t *uprobe = (void *)arg; + fasttrap_probe_spec_t *uprobe = *(fasttrap_probe_spec_t **)arg; fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; int ret; char *c; -#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); -#else - noffs = uprobe->ftps_noffs; -#endif /* * Probes must have at least one tracepoint. @@ -2085,19 +2081,10 @@ fasttrap_ioctl(struct cdev *dev, u_long probe = kmem_alloc(size, KM_SLEEP); -#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } -#else - memcpy(probe, uprobe, sizeof(*probe)); - if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { - kmem_free(probe, size); - return (EFAULT); - } -#endif - /* * Verify that the function and module strings contain no Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:15 2014 (r262048) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:27 2014 (r262049) @@ -42,8 +42,8 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif typedef enum fasttrap_probe_type { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:19:27 2014 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 ESMTPS id DCCE9143; Mon, 17 Feb 2014 13:19:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C61034; Mon, 17 Feb 2014 13:19:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDJR6f055607; Mon, 17 Feb 2014 13:19:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDJRco055606; Mon, 17 Feb 2014 13:19:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171319.s1HDJRco055606@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262050 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:19:27 -0000 Author: avg Date: Mon Feb 17 13:19:27 2014 New Revision: 262050 URL: http://svnweb.freebsd.org/changeset/base/262050 Log: MFC r257417: Remove references to an unused fasttrap probe hook Only mergeinfo record for commit r262042 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:23:50 2014 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 ESMTPS id 33C7D8B7; Mon, 17 Feb 2014 13:23:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 204DD1106; Mon, 17 Feb 2014 13:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDNncs059103; Mon, 17 Feb 2014 13:23:49 GMT (envelope-from feld@svn.freebsd.org) Received: (from feld@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDNnQg059102; Mon, 17 Feb 2014 13:23:49 GMT (envelope-from feld@svn.freebsd.org) Message-Id: <201402171323.s1HDNnQg059102@svn.freebsd.org> From: Mark Felder Date: Mon, 17 Feb 2014 13:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262051 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:23:50 -0000 Author: feld (ports committer) Date: Mon Feb 17 13:23:49 2014 New Revision: 262051 URL: http://svnweb.freebsd.org/changeset/base/262051 Log: Fix formatting. "Manpages should start a new sentence on a new line. This makes it easier for translators to track changes." -jhb Approved by: jhb MFC after: 3 days Sponsored by: SupraNet Communications, Inc Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Feb 17 13:19:27 2014 (r262050) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Feb 17 13:23:49 2014 (r262051) @@ -1960,5 +1960,5 @@ implementation of this manual page was i The .Cm spare feature requires a utility to detect zpool degradation and initiate -disk replacement within the zpool. FreeBSD does not provide such a -utility at this time. +disk replacement within the zpool. +FreeBSD does not provide such a utility at this time. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:29:49 2014 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 ESMTPS id 4D502DBD; Mon, 17 Feb 2014 13:29:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 382F1114B; Mon, 17 Feb 2014 13:29:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDTnU3060034; Mon, 17 Feb 2014 13:29:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDTmCZ060027; Mon, 17 Feb 2014 13:29:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171329.s1HDTmCZ060027@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:29:48 +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: r262052 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:29:49 -0000 Author: avg Date: Mon Feb 17 13:29:48 2014 New Revision: 262052 URL: http://svnweb.freebsd.org/changeset/base/262052 Log: MFC r252850: Hide references to mod_lock Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.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/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:29:48 2014 (r262052) @@ -281,8 +281,6 @@ static kmutex_t dtrace_meta_lock; /* me #if !defined(sun) /* XXX FreeBSD hacks. */ -static kmutex_t mod_lock; - #define cr_suid cr_svuid #define cr_sgid cr_svgid #define ipaddr_t in_addr_t @@ -7681,7 +7679,9 @@ dtrace_unregister(dtrace_provider_id_t i } } else { mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); } @@ -7695,7 +7695,9 @@ dtrace_unregister(dtrace_provider_id_t i dtrace_anon.dta_state->dts_necbs > 0))) { if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } return (EBUSY); @@ -7729,7 +7731,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -7811,7 +7815,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -8131,6 +8137,7 @@ dtrace_probe_provide(dtrace_probedesc_t */ prv->dtpv_pops.dtps_provide(prv->dtpv_arg, desc); +#if defined(sun) /* * Now call the per-module provide operation. We will grab * mod_lock to prevent the list from being modified. Note @@ -8139,7 +8146,6 @@ dtrace_probe_provide(dtrace_probedesc_t */ mutex_enter(&mod_lock); -#if defined(sun) ctl = &modules; do { if (ctl->mod_busy || ctl->mod_mp == NULL) @@ -8148,9 +8154,9 @@ dtrace_probe_provide(dtrace_probedesc_t prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); } while ((ctl = ctl->mod_next) != &modules); -#endif mutex_exit(&mod_lock); +#endif } while (all && (prv = prv->dtpv_next) != NULL); } @@ -15143,7 +15149,9 @@ dtrace_module_loaded(modctl_t *ctl) dtrace_provider_t *prv; mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif #if defined(sun) ASSERT(ctl->mod_busy); @@ -15156,7 +15164,9 @@ dtrace_module_loaded(modctl_t *ctl) for (prv = dtrace_provider; prv != NULL; prv = prv->dtpv_next) prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); /* @@ -15218,7 +15228,9 @@ dtrace_module_unloaded(modctl_t *ctl, in #endif mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); #if !defined(sun) @@ -15239,7 +15251,9 @@ dtrace_module_unloaded(modctl_t *ctl, in * we don't have any work to do. */ mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); return; } @@ -15248,7 +15262,9 @@ dtrace_module_unloaded(modctl_t *ctl, in probe != NULL; probe = probe->dtpr_nextmod) { if (probe->dtpr_ecb != NULL) { mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); /* @@ -15320,7 +15336,9 @@ dtrace_module_unloaded(modctl_t *ctl, in } mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } Modified: stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Feb 17 13:29:48 2014 (r262052) @@ -584,19 +584,25 @@ dtrace_ioctl(struct cdev *dev, u_long cm return (EINVAL); mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); if (desc->dtargd_id > dtrace_nprobes) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } if ((probe = dtrace_probes[desc->dtargd_id - 1]) == NULL) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } @@ -620,7 +626,9 @@ dtrace_ioctl(struct cdev *dev, u_long cm probe->dtpr_id, probe->dtpr_arg, desc); } +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (0); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:29:48 2014 (r262052) @@ -63,12 +63,6 @@ dtrace_load(void *dummy) dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* - * XXX This is a short term hack to avoid having to comment - * out lots and lots of lock/unlock calls. - */ - mutex_init(&mod_lock,"XXX mod_lock hack", MUTEX_DEFAULT, NULL); - - /* * Initialise the mutexes without 'witness' because the dtrace * code is mostly written to wait for memory. To have the * witness code change a malloc() from M_WAITOK to M_NOWAIT Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:29:48 2014 (r262052) @@ -127,9 +127,6 @@ dtrace_unload() mutex_destroy(&dtrace_errlock); #endif - /* XXX Hack */ - mutex_destroy(&mod_lock); - /* Reset our hook for exceptions. */ dtrace_invop_uninit(); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:33:43 2014 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 ESMTPS id 5C91F24C; Mon, 17 Feb 2014 13:33:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D89411E5; Mon, 17 Feb 2014 13:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDXhsH063394; Mon, 17 Feb 2014 13:33:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDXgIs063390; Mon, 17 Feb 2014 13:33:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171333.s1HDXgIs063390@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:33: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: r262053 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:33:43 -0000 Author: avg Date: Mon Feb 17 13:33:42 2014 New Revision: 262053 URL: http://svnweb.freebsd.org/changeset/base/262053 Log: MFC r256148: Initialize and free the DTrace taskqueue in the dtrace module load/unload handlers Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.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/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:33:42 2014 (r262053) @@ -15754,10 +15754,6 @@ dtrace_open(struct cdev *dev, int oflags #else devfs_set_cdevpriv(state, dtrace_dtr); #endif - /* This code actually belongs in dtrace_attach() */ - if (dtrace_opens == 1) - dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, - 1, INT_MAX, 0); #endif mutex_exit(&cpu_lock); @@ -15842,11 +15838,6 @@ dtrace_close(struct cdev *dev, int flags (void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE); #else --dtrace_opens; - /* This code actually belongs in dtrace_detach() */ - if ((dtrace_opens == 0) && (dtrace_taskq != NULL)) { - taskq_destroy(dtrace_taskq); - dtrace_taskq = NULL; - } #endif mutex_exit(&dtrace_lock); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:33:42 2014 (r262053) @@ -56,6 +56,8 @@ dtrace_load(void *dummy) /* Hang our hook for exceptions. */ dtrace_invop_init(); + dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:33:42 2014 (r262053) @@ -127,6 +127,8 @@ dtrace_unload() mutex_destroy(&dtrace_errlock); #endif + taskq_destroy(dtrace_taskq); + /* Reset our hook for exceptions. */ dtrace_invop_uninit(); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:36:36 2014 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 ESMTPS id 8A9A4631; Mon, 17 Feb 2014 13:36:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77AD41221; Mon, 17 Feb 2014 13:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDaabO063878; Mon, 17 Feb 2014 13:36:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDaaj8063877; Mon, 17 Feb 2014 13:36:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171336.s1HDaaj8063877@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262054 - stable/10/sys/cddl/dev/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:36:36 -0000 Author: avg Date: Mon Feb 17 13:36:35 2014 New Revision: 262054 URL: http://svnweb.freebsd.org/changeset/base/262054 Log: MFC r260132: Allocate the probe ID unrhdr before the DTrace kld_* event handlers are registered Modified: stable/10/sys/cddl/dev/dtrace/dtrace_load.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:33:42 2014 (r262053) +++ stable/10/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:36:35 2014 (r262054) @@ -58,6 +58,8 @@ dtrace_load(void *dummy) dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); @@ -85,8 +87,6 @@ dtrace_load(void *dummy) ASSERT(MUTEX_HELD(&cpu_lock)); - dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); - dtrace_state_cache = kmem_cache_create("dtrace_state_cache", sizeof (dtrace_dstate_percpu_t) * NCPU, DTRACE_STATE_ALIGN, NULL, NULL, NULL, NULL, NULL, 0); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:36:58 2014 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 ESMTPS id 62BF2760; Mon, 17 Feb 2014 13:36:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB111225; Mon, 17 Feb 2014 13:36:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDawVk063946; Mon, 17 Feb 2014 13:36:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDawJ5063945; Mon, 17 Feb 2014 13:36:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171336.s1HDawJ5063945@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:36: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: r262055 - stable/9/sys/cddl/dev/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:36:58 -0000 Author: avg Date: Mon Feb 17 13:36:57 2014 New Revision: 262055 URL: http://svnweb.freebsd.org/changeset/base/262055 Log: MFC r260132: Allocate the probe ID unrhdr before the DTrace kld_* event handlers are registered Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:36:35 2014 (r262054) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:36:57 2014 (r262055) @@ -58,6 +58,8 @@ dtrace_load(void *dummy) dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); @@ -85,8 +87,6 @@ dtrace_load(void *dummy) ASSERT(MUTEX_HELD(&cpu_lock)); - dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); - dtrace_state_cache = kmem_cache_create("dtrace_state_cache", sizeof (dtrace_dstate_percpu_t) * NCPU, DTRACE_STATE_ALIGN, NULL, NULL, NULL, NULL, NULL, 0); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:53:03 2014 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 ESMTPS id 913FCFF3; Mon, 17 Feb 2014 13:53:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71C0A13E0; Mon, 17 Feb 2014 13:53:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDr3Hi071295; Mon, 17 Feb 2014 13:53:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDr2NA071286; Mon, 17 Feb 2014 13:53:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171353.s1HDr2NA071286@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:53: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: r262056 - in stable/9/sys: compat/linux security/mac 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:53:03 -0000 Author: avg Date: Mon Feb 17 13:53:01 2014 New Revision: 262056 URL: http://svnweb.freebsd.org/changeset/base/262056 Log: MFC r255971: Fix some typos that were causing probe argument types to show up as unknown MFC slacker: markj Modified: stable/9/sys/compat/linux/linux_futex.c stable/9/sys/compat/linux/linux_uid16.c stable/9/sys/security/mac/mac_framework.c stable/9/sys/security/mac/mac_internal.h stable/9/sys/security/mac/mac_posix_shm.c stable/9/sys/security/mac/mac_vfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_futex.c ============================================================================== --- stable/9/sys/compat/linux/linux_futex.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/compat/linux/linux_futex.c Mon Feb 17 13:53:01 2014 (r262056) @@ -119,7 +119,7 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_sleep LIN_SDT_PROBE_DEFINE3(futex, futex_wake, entry, "struct futex *", "int", "uint32_t"); LIN_SDT_PROBE_DEFINE3(futex, futex_wake, iterate, "uint32_t", - "struct waiting_proc *", "uin32_t"); + "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wake, wakeup, "struct waiting_proc *"); LIN_SDT_PROBE_DEFINE1(futex, futex_wake, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_requeue, entry, "struct futex *", "int", Modified: stable/9/sys/compat/linux/linux_uid16.c ============================================================================== --- stable/9/sys/compat/linux/linux_uid16.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/compat/linux/linux_uid16.c Mon Feb 17 13:53:01 2014 (r262056) @@ -87,7 +87,7 @@ LIN_SDT_PROBE_DEFINE1(uid16, linux_setgi LIN_SDT_PROBE_DEFINE1(uid16, linux_setgid16, return, "int"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, entry, "l_uid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, return, "int"); -LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_git16_t", "l_git16_t"); +LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_gid16_t", "l_gid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setregid16, return, "int"); LIN_SDT_PROBE_DEFINE2(uid16, linux_setreuid16, entry, "l_uid16_t", "l_uid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setreuid16, return, "int"); Modified: stable/9/sys/security/mac/mac_framework.c ============================================================================== --- stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:53:01 2014 (r262056) @@ -95,7 +95,7 @@ SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int", - "struct mac_policy_conf *mpc"); + "struct mac_policy_conf *"); SDT_PROBE_DEFINE1(mac, kernel, policy, register, register, "struct mac_policy_conf *"); SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister, Modified: stable/9/sys/security/mac/mac_internal.h ============================================================================== --- stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:53:01 2014 (r262056) @@ -119,7 +119,7 @@ SDT_PROVIDER_DECLARE(mac_framework); /* SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \ mac-grant-err, "int", arg0, arg1); \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \ - mac-grant-ok, "INT", arg0, arg1); + mac-grant-ok, "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ Modified: stable/9/sys/security/mac/mac_posix_shm.c ============================================================================== --- stable/9/sys/security/mac/mac_posix_shm.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_posix_shm.c Mon Feb 17 13:53:01 2014 (r262056) @@ -133,7 +133,7 @@ mac_posixshm_check_mmap(struct ucred *cr } MAC_CHECK_PROBE_DEFINE3(posixshm_check_open, "struct ucred *", - "struct shmfd *", "accmode_t accmode"); + "struct shmfd *", "accmode_t"); int mac_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, Modified: stable/9/sys/security/mac/mac_vfs.c ============================================================================== --- stable/9/sys/security/mac/mac_vfs.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_vfs.c Mon Feb 17 13:53:01 2014 (r262056) @@ -783,7 +783,7 @@ mac_vnode_check_revoke(struct ucred *cre } MAC_CHECK_PROBE_DEFINE4(vnode_check_setacl, "struct ucred *", - "struct vnode *", "acl_tpe_t", "struct acl *"); + "struct vnode *", "acl_type_t", "struct acl *"); int mac_vnode_check_setacl(struct ucred *cred, struct vnode *vp, acl_type_t type, From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 13:58:57 2014 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 ESMTPS id 5C1F92F5; Mon, 17 Feb 2014 13:58:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 437A91473; Mon, 17 Feb 2014 13:58:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDwvjN072099; Mon, 17 Feb 2014 13:58:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDwpZn072062; Mon, 17 Feb 2014 13:58:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171358.s1HDwpZn072062@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:58:51 +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: r262057 - in stable/9/sys: cam/ctl cddl/dev/dtrace cddl/dev/sdt compat/linux dev/xen/blkback kern net netinet opencrypto security/mac sys tools 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 13:58:57 -0000 Author: avg Date: Mon Feb 17 13:58:50 2014 New Revision: 262057 URL: http://svnweb.freebsd.org/changeset/base/262057 Log: MFC r258622,258675: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE Modified: stable/9/sys/cam/ctl/ctl_backend_block.c stable/9/sys/cddl/dev/dtrace/dtrace_test.c stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/compat/linux/linux_dtrace.h stable/9/sys/dev/xen/blkback/blkback.c stable/9/sys/kern/kern_clock.c stable/9/sys/kern/kern_exec.c stable/9/sys/kern/kern_exit.c stable/9/sys/kern/kern_fork.c stable/9/sys/kern/kern_priv.c stable/9/sys/kern/kern_proc.c stable/9/sys/kern/kern_racct.c stable/9/sys/kern/kern_sig.c stable/9/sys/kern/kern_synch.c stable/9/sys/kern/kern_thread.c stable/9/sys/kern/kern_timeout.c stable/9/sys/kern/sched_4bsd.c stable/9/sys/kern/sched_ule.c stable/9/sys/kern/subr_devstat.c stable/9/sys/kern/subr_turnstile.c stable/9/sys/kern/vfs_cache.c stable/9/sys/kern/vfs_lookup.c stable/9/sys/kern/vfs_syscalls.c stable/9/sys/net/vnet.c stable/9/sys/netinet/sctp_dtrace_define.h stable/9/sys/opencrypto/deflate.c stable/9/sys/security/mac/mac_framework.c stable/9/sys/security/mac/mac_internal.h stable/9/sys/sys/sdt.h stable/9/sys/tools/vnode_if.awk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Mon Feb 17 13:58:50 2014 (r262057) @@ -634,10 +634,10 @@ ctl_be_block_flush_file(struct ctl_be_bl ctl_complete_beio(beio); } -SDT_PROBE_DEFINE1(cbb, kernel, read, file_start, file_start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, file_start, file_start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, read, file_done, file_done,"uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, file_done, file_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, file_start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, file_start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, file_done,"uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, file_done, "uint64_t"); static void ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, @@ -968,10 +968,10 @@ ctl_be_block_cw_dispatch(struct ctl_be_b } } -SDT_PROBE_DEFINE1(cbb, kernel, read, start, start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, start, start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, read, alloc_done, alloc_done, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, alloc_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, alloc_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, "uint64_t"); static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, Modified: stable/9/sys/cddl/dev/dtrace/dtrace_test.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_test.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/cddl/dev/dtrace/dtrace_test.c Mon Feb 17 13:58:50 2014 (r262057) @@ -41,7 +41,7 @@ SDT_PROVIDER_DEFINE(test); -SDT_PROBE_DEFINE7(test, , , sdttest, sdttest, "int", "int", "int", "int", "int", +SDT_PROBE_DEFINE7(test, , , sdttest, "int", "int", "int", "int", "int", "int", "int"); /* Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 13:58:50 2014 (r262057) @@ -138,6 +138,8 @@ sdt_create_probe(struct sdt_probe *probe char mod[DTRACE_MODNAMELEN]; char func[DTRACE_FUNCNAMELEN]; char name[DTRACE_NAMELEN]; + const char *from; + char *to; size_t len; TAILQ_FOREACH(prov, &sdt_prov_list, prov_entry) @@ -161,7 +163,18 @@ sdt_create_probe(struct sdt_probe *probe * in the C compiler, so we have to respect const vs non-const. */ strlcpy(func, probe->func, sizeof(func)); - strlcpy(name, probe->name, sizeof(name)); + + from = probe->name; + to = name; + for (len = 0; len < (sizeof(name) - 1) && *from != '\0'; + len++, from++, to++) { + if (from[0] == '_' && from[1] == '_') { + *to = '-'; + from++; + } else + *to = *from; + } + *to = '\0'; if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; Modified: stable/9/sys/compat/linux/linux_dtrace.h ============================================================================== --- stable/9/sys/compat/linux/linux_dtrace.h Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/compat/linux/linux_dtrace.h Mon Feb 17 13:58:50 2014 (r262057) @@ -48,27 +48,27 @@ LINUX_DTRACE, a, b, c) #define _LIN_SDT_PROBE_DEFINE0(a, b, c, d) SDT_PROBE_DEFINE(a, \ - b, c, d, d) + b, c, d) #define LIN_SDT_PROBE_DEFINE0(a, b, c) _LIN_SDT_PROBE_DEFINE0(\ LINUX_DTRACE, a, b, c) #define _LIN_SDT_PROBE_DEFINE1(a, b, c, d, e) SDT_PROBE_DEFINE1(a, \ - b, c, d, d, e) + b, c, d, e) #define LIN_SDT_PROBE_DEFINE1(a, b, c, d) _LIN_SDT_PROBE_DEFINE1(\ LINUX_DTRACE, a, b, c, d) #define _LIN_SDT_PROBE_DEFINE2(a, b, c, d, e, f) SDT_PROBE_DEFINE2(a, \ - b, c, d, d, e, f) + b, c, d, e, f) #define LIN_SDT_PROBE_DEFINE2(a, b, c, d, e) _LIN_SDT_PROBE_DEFINE2(\ LINUX_DTRACE, a, b, c, d, e) #define _LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f, g) SDT_PROBE_DEFINE3(a, \ - b, c, d, d, e, f, g) + b, c, d, e, f, g) #define LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f) _LIN_SDT_PROBE_DEFINE3(\ LINUX_DTRACE, a, b, c, d, e, f) #define _LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g, h) SDT_PROBE_DEFINE4(a, \ - b, c, d, d, e, f, g, h) + b, c, d, e, f, g, h) #define LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g) _LIN_SDT_PROBE_DEFINE4(\ LINUX_DTRACE, a, b, c, d, e, f, g) #define _LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) \ - SDT_PROBE_DEFINE5(a, b, c, d, d, e, f, g, h, i) + SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) #define LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE_DEFINE5(\ LINUX_DTRACE, a, b, c, d, e, f, g, h) Modified: stable/9/sys/dev/xen/blkback/blkback.c ============================================================================== --- stable/9/sys/dev/xen/blkback/blkback.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/dev/xen/blkback/blkback.c Mon Feb 17 13:58:50 2014 (r262057) @@ -2037,10 +2037,10 @@ xbb_intr(void *arg) } SDT_PROVIDER_DEFINE(xbb); -SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_dev, flush, flush, "int"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, read, read, "int", "uint64_t", +SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_dev, flush, "int"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, read, "int", "uint64_t", "uint64_t"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, write, write, "int", +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, write, "int", "uint64_t", "uint64_t"); /*----------------------------- Backend Handlers -----------------------------*/ @@ -2218,10 +2218,10 @@ fail_free_bios: return (error); } -SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_file, flush, flush, "int"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, read, read, "int", "uint64_t", +SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_file, flush, "int"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, read, "int", "uint64_t", "uint64_t"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, write, write, "int", +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, write, "int", "uint64_t", "uint64_t"); /** Modified: stable/9/sys/kern/kern_clock.c ============================================================================== --- stable/9/sys/kern/kern_clock.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_clock.c Mon Feb 17 13:58:50 2014 (r262057) @@ -93,7 +93,7 @@ SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_ static struct mtx time_lock; SDT_PROVIDER_DECLARE(sched); -SDT_PROBE_DEFINE2(sched, , , tick, tick, "struct thread *", "struct proc *"); +SDT_PROBE_DEFINE2(sched, , , tick, "struct thread *", "struct proc *"); static int sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_exec.c Mon Feb 17 13:58:50 2014 (r262057) @@ -95,9 +95,9 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE1(proc, kernel, , exec, exec, "char *"); -SDT_PROBE_DEFINE1(proc, kernel, , exec_failure, exec-failure, "int"); -SDT_PROBE_DEFINE1(proc, kernel, , exec_success, exec-success, "char *"); +SDT_PROBE_DEFINE1(proc, kernel, , exec, "char *"); +SDT_PROBE_DEFINE1(proc, kernel, , exec__failure, "int"); +SDT_PROBE_DEFINE1(proc, kernel, , exec__success, "char *"); MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments"); @@ -839,7 +839,7 @@ interpret: vfs_mark_atime(imgp->vp, td->td_ucred); - SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0); + SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0); done1: /* @@ -921,7 +921,7 @@ exec_fail: p->p_flag &= ~P_INEXEC; PROC_UNLOCK(p); - SDT_PROBE(proc, kernel, , exec_failure, error, 0, 0, 0, 0); + SDT_PROBE(proc, kernel, , exec__failure, error, 0, 0, 0, 0); done2: #ifdef MAC Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_exit.c Mon Feb 17 13:58:50 2014 (r262057) @@ -94,7 +94,7 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE1(proc, kernel, , exit, exit, "int"); +SDT_PROBE_DEFINE1(proc, kernel, , exit, "int"); /* Hook for NFS teardown procedure. */ void (*nlminfo_release_p)(struct proc *p); Modified: stable/9/sys/kern/kern_fork.c ============================================================================== --- stable/9/sys/kern/kern_fork.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_fork.c Mon Feb 17 13:58:50 2014 (r262057) @@ -89,7 +89,7 @@ dtrace_fork_func_t dtrace_fasttrap_fork; #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE3(proc, kernel, , create, create, "struct proc *", +SDT_PROBE_DEFINE3(proc, kernel, , create, "struct proc *", "struct proc *", "int"); #ifndef _SYS_SYSPROTO_H_ Modified: stable/9/sys/kern/kern_priv.c ============================================================================== --- stable/9/sys/kern/kern_priv.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_priv.c Mon Feb 17 13:58:50 2014 (r262057) @@ -65,8 +65,8 @@ SYSCTL_INT(_security_bsd, OID_AUTO, unpr TUNABLE_INT("security.bsd.unprivileged_mlock", &unprivileged_mlock); SDT_PROVIDER_DEFINE(priv); -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, priv-ok, "int"); -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, priv-err, "int"); +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__ok, "int"); +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__err, "int"); /* * Check a credential for privilege. Lots of good reasons to deny privilege; @@ -160,9 +160,9 @@ priv_check_cred(struct ucred *cred, int error = EPERM; out: if (error) - SDT_PROBE1(priv, kernel, priv_check, priv_err, priv); + SDT_PROBE1(priv, kernel, priv_check, priv__err, priv); else - SDT_PROBE1(priv, kernel, priv_check, priv_ok, priv); + SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv); return (error); } Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_proc.c Mon Feb 17 13:58:50 2014 (r262057) @@ -91,17 +91,17 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(proc); -SDT_PROBE_DEFINE4(proc, kernel, ctor, entry, entry, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, kernel, ctor, entry, "struct proc *", "int", "void *", "int"); -SDT_PROBE_DEFINE4(proc, kernel, ctor, return, return, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, kernel, ctor, return, "struct proc *", "int", "void *", "int"); -SDT_PROBE_DEFINE4(proc, kernel, dtor, entry, entry, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, kernel, dtor, entry, "struct proc *", "int", "void *", "struct thread *"); -SDT_PROBE_DEFINE3(proc, kernel, dtor, return, return, "struct proc *", "int", +SDT_PROBE_DEFINE3(proc, kernel, dtor, return, "struct proc *", "int", "void *"); -SDT_PROBE_DEFINE3(proc, kernel, init, entry, entry, "struct proc *", "int", +SDT_PROBE_DEFINE3(proc, kernel, init, entry, "struct proc *", "int", "int"); -SDT_PROBE_DEFINE3(proc, kernel, init, return, return, "struct proc *", "int", +SDT_PROBE_DEFINE3(proc, kernel, init, return, "struct proc *", "int", "int"); MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); Modified: stable/9/sys/kern/kern_racct.c ============================================================================== --- stable/9/sys/kern/kern_racct.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_racct.c Mon Feb 17 13:58:50 2014 (r262057) @@ -96,29 +96,29 @@ static void racct_add_cred_locked(struct uint64_t amount); SDT_PROVIDER_DEFINE(racct); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add, add, "struct proc *", "int", +SDT_PROBE_DEFINE3(racct, kernel, rusage, add, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add_failure, add-failure, +SDT_PROBE_DEFINE3(racct, kernel, rusage, add__failure, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add_cred, add-cred, "struct ucred *", +SDT_PROBE_DEFINE3(racct, kernel, rusage, add__cred, "struct ucred *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add_force, add-force, "struct proc *", +SDT_PROBE_DEFINE3(racct, kernel, rusage, add__force, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, set, set, "struct proc *", "int", +SDT_PROBE_DEFINE3(racct, kernel, rusage, set, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, set_failure, set-failure, +SDT_PROBE_DEFINE3(racct, kernel, rusage, set__failure, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, sub, sub, "struct proc *", "int", +SDT_PROBE_DEFINE3(racct, kernel, rusage, sub, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, sub_cred, sub-cred, "struct ucred *", +SDT_PROBE_DEFINE3(racct, kernel, rusage, sub__cred, "struct ucred *", "int", "uint64_t"); -SDT_PROBE_DEFINE1(racct, kernel, racct, create, create, "struct racct *"); -SDT_PROBE_DEFINE1(racct, kernel, racct, destroy, destroy, "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, join, join, "struct racct *", +SDT_PROBE_DEFINE1(racct, kernel, racct, create, "struct racct *"); +SDT_PROBE_DEFINE1(racct, kernel, racct, destroy, "struct racct *"); +SDT_PROBE_DEFINE2(racct, kernel, racct, join, "struct racct *", "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, join_failure, join-failure, +SDT_PROBE_DEFINE2(racct, kernel, racct, join__failure, "struct racct *", "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, leave, leave, "struct racct *", +SDT_PROBE_DEFINE2(racct, kernel, racct, leave, "struct racct *", "struct racct *"); int racct_types[] = { @@ -527,7 +527,7 @@ racct_add_locked(struct proc *p, int res #ifdef RCTL error = rctl_enforce(p, resource, amount); if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE(racct, kernel, rusage, add_failure, p, resource, + SDT_PROBE(racct, kernel, rusage, add__failure, p, resource, amount, 0, 0); return (error); } @@ -558,7 +558,7 @@ racct_add_cred_locked(struct ucred *cred { struct prison *pr; - SDT_PROBE(racct, kernel, rusage, add_cred, cred, resource, amount, + SDT_PROBE(racct, kernel, rusage, add__cred, cred, resource, amount, 0, 0); racct_alloc_resource(cred->cr_ruidinfo->ui_racct, resource, amount); @@ -591,7 +591,7 @@ void racct_add_force(struct proc *p, int resource, uint64_t amount) { - SDT_PROBE(racct, kernel, rusage, add_force, p, resource, amount, 0, 0); + SDT_PROBE(racct, kernel, rusage, add__force, p, resource, amount, 0, 0); /* * We need proc lock to dereference p->p_ucred. @@ -645,7 +645,7 @@ racct_set_locked(struct proc *p, int res if (diff_proc > 0) { error = rctl_enforce(p, resource, diff_proc); if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE(racct, kernel, rusage, set_failure, p, + SDT_PROBE(racct, kernel, rusage, set__failure, p, resource, amount, 0, 0); return (error); } @@ -805,7 +805,7 @@ racct_sub_cred_locked(struct ucred *cred { struct prison *pr; - SDT_PROBE(racct, kernel, rusage, sub_cred, cred, resource, amount, + SDT_PROBE(racct, kernel, rusage, sub__cred, cred, resource, amount, 0, 0); #ifdef notyet Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_sig.c Mon Feb 17 13:58:50 2014 (r262057) @@ -93,11 +93,11 @@ __FBSDID("$FreeBSD$"); #define ONSIG 32 /* NSIG for osig* syscalls. XXX. */ SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE3(proc, kernel, , signal_send, signal-send, "struct thread *", +SDT_PROBE_DEFINE3(proc, kernel, , signal__send, "struct thread *", "struct proc *", "int"); -SDT_PROBE_DEFINE2(proc, kernel, , signal_clear, signal-clear, "int", +SDT_PROBE_DEFINE2(proc, kernel, , signal__clear, "int", "ksiginfo_t *"); -SDT_PROBE_DEFINE3(proc, kernel, , signal_discard, signal-discard, +SDT_PROBE_DEFINE3(proc, kernel, , signal__discard, "struct thread *", "struct proc *", "int"); static int coredump(struct thread *); @@ -1252,7 +1252,7 @@ kern_sigtimedwait(struct thread *td, sig reschedule_signals(p, new_block, 0); if (error == 0) { - SDT_PROBE(proc, kernel, , signal_clear, sig, ksi, 0, 0, 0); + SDT_PROBE(proc, kernel, , signal__clear, sig, ksi, 0, 0, 0); if (ksi->ksi_code == SI_TIMER) itimer_accept(p, ksi->ksi_timerid, ksi); @@ -2053,7 +2053,7 @@ tdsendsignal(struct proc *p, struct thre sigqueue = &td->td_sigqueue; } - SDT_PROBE(proc, kernel, , signal_send, td, p, sig, 0, 0 ); + SDT_PROBE(proc, kernel, , signal__send, td, p, sig, 0, 0 ); /* * If the signal is being ignored, @@ -2064,7 +2064,7 @@ tdsendsignal(struct proc *p, struct thre */ mtx_lock(&ps->ps_mtx); if (SIGISMEMBER(ps->ps_sigignore, sig)) { - SDT_PROBE(proc, kernel, , signal_discard, td, p, sig, 0, 0 ); + SDT_PROBE(proc, kernel, , signal__discard, td, p, sig, 0, 0 ); mtx_unlock(&ps->ps_mtx); if (ksi && (ksi->ksi_flags & KSI_INS)) Modified: stable/9/sys/kern/kern_synch.c ============================================================================== --- stable/9/sys/kern/kern_synch.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_synch.c Mon Feb 17 13:58:50 2014 (r262057) @@ -108,18 +108,18 @@ SYSCTL_INT(_kern, OID_AUTO, fscale, CTLF static void loadav(void *arg); SDT_PROVIDER_DECLARE(sched); -SDT_PROBE_DEFINE(sched, , , preempt, preempt); +SDT_PROBE_DEFINE(sched, , , preempt); /* * These probes reference Solaris features that are not implemented in FreeBSD. * Create the probes anyway for compatibility with existing D scripts; they'll * just never fire. */ -SDT_PROBE_DEFINE(sched, , , cpucaps_sleep, cpucaps-sleep); -SDT_PROBE_DEFINE(sched, , , cpucaps_wakeup, cpucaps-wakeup); -SDT_PROBE_DEFINE(sched, , , schedctl_nopreempt, schedctl-nopreempt); -SDT_PROBE_DEFINE(sched, , , schedctl_preempt, schedctl-preempt); -SDT_PROBE_DEFINE(sched, , , schedctl_yield, schedctl-yield); +SDT_PROBE_DEFINE(sched, , , cpucaps__sleep); +SDT_PROBE_DEFINE(sched, , , cpucaps__wakeup); +SDT_PROBE_DEFINE(sched, , , schedctl__nopreempt); +SDT_PROBE_DEFINE(sched, , , schedctl__preempt); +SDT_PROBE_DEFINE(sched, , , schedctl__yield); void sleepinit(void) Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_thread.c Mon Feb 17 13:58:50 2014 (r262057) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE(proc, , , lwp_exit, lwp-exit); +SDT_PROBE_DEFINE(proc, , , lwp__exit); /* Modified: stable/9/sys/kern/kern_timeout.c ============================================================================== --- stable/9/sys/kern/kern_timeout.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_timeout.c Mon Feb 17 13:58:50 2014 (r262057) @@ -61,9 +61,9 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(callout_execute); -SDT_PROBE_DEFINE1(callout_execute, kernel, , callout_start, callout-start, +SDT_PROBE_DEFINE1(callout_execute, kernel, , callout__start, "struct callout *"); -SDT_PROBE_DEFINE1(callout_execute, kernel, , callout_end, callout-end, +SDT_PROBE_DEFINE1(callout_execute, kernel, , callout__end, "struct callout *"); static int avg_depth; @@ -514,9 +514,9 @@ softclock_call_cc(struct callout *c, str binuptime(&bt1); #endif THREAD_NO_SLEEPING(); - SDT_PROBE(callout_execute, kernel, , callout_start, c, 0, 0, 0, 0); + SDT_PROBE(callout_execute, kernel, , callout__start, c, 0, 0, 0, 0); c_func(c_arg); - SDT_PROBE(callout_execute, kernel, , callout_end, c, 0, 0, 0, 0); + SDT_PROBE(callout_execute, kernel, , callout__end, c, 0, 0, 0, 0); THREAD_SLEEPING_OK(); #ifdef DIAGNOSTIC binuptime(&bt2); Modified: stable/9/sys/kern/sched_4bsd.c ============================================================================== --- stable/9/sys/kern/sched_4bsd.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/sched_4bsd.c Mon Feb 17 13:58:50 2014 (r262057) @@ -255,20 +255,20 @@ SYSCTL_INT(_kern_sched, OID_AUTO, follow SDT_PROVIDER_DEFINE(sched); -SDT_PROBE_DEFINE3(sched, , , change_pri, change-pri, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , change__pri, "struct thread *", "struct proc *", "uint8_t"); -SDT_PROBE_DEFINE3(sched, , , dequeue, dequeue, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , dequeue, "struct thread *", "struct proc *", "void *"); -SDT_PROBE_DEFINE4(sched, , , enqueue, enqueue, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , enqueue, "struct thread *", "struct proc *", "void *", "int"); -SDT_PROBE_DEFINE4(sched, , , lend_pri, lend-pri, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , lend__pri, "struct thread *", "struct proc *", "uint8_t", "struct thread *"); -SDT_PROBE_DEFINE2(sched, , , load_change, load-change, "int", "int"); -SDT_PROBE_DEFINE2(sched, , , off_cpu, off-cpu, "struct thread *", +SDT_PROBE_DEFINE2(sched, , , load__change, "int", "int"); +SDT_PROBE_DEFINE2(sched, , , off__cpu, "struct thread *", "struct proc *"); -SDT_PROBE_DEFINE(sched, , , on_cpu, on-cpu); -SDT_PROBE_DEFINE(sched, , , remain_cpu, remain-cpu); -SDT_PROBE_DEFINE2(sched, , , surrender, surrender, "struct thread *", +SDT_PROBE_DEFINE(sched, , , on__cpu); +SDT_PROBE_DEFINE(sched, , , remain__cpu); +SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", "struct proc *"); static __inline void @@ -277,7 +277,7 @@ sched_load_add(void) sched_tdcnt++; KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); - SDT_PROBE2(sched, , , load_change, NOCPU, sched_tdcnt); + SDT_PROBE2(sched, , , load__change, NOCPU, sched_tdcnt); } static __inline void @@ -286,7 +286,7 @@ sched_load_rem(void) sched_tdcnt--; KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); - SDT_PROBE2(sched, , , load_change, NOCPU, sched_tdcnt); + SDT_PROBE2(sched, , , load__change, NOCPU, sched_tdcnt); } /* * Arrange to reschedule if necessary, taking the priorities and @@ -836,12 +836,12 @@ sched_priority(struct thread *td, u_char KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); - SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); + SDT_PROBE3(sched, , , change__pri, td, td->td_proc, prio); if (td != curthread && prio > td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); - SDT_PROBE4(sched, , , lend_pri, td, td->td_proc, prio, + SDT_PROBE4(sched, , , lend__pri, td, td->td_proc, prio, curthread); } THREAD_LOCK_ASSERT(td, MA_OWNED); @@ -1033,7 +1033,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); + SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); @@ -1067,13 +1067,13 @@ sched_switch(struct thread *td, struct t * need to reap it. */ - SDT_PROBE0(sched, , , on_cpu); + SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif } else - SDT_PROBE0(sched, , , remain_cpu); + SDT_PROBE0(sched, , , remain__cpu); #ifdef SMP if (td->td_flags & TDF_IDLETD) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/sched_ule.c Mon Feb 17 13:58:50 2014 (r262057) @@ -333,20 +333,20 @@ SYSINIT(sched_initticks, SI_SUB_CLOCKS, SDT_PROVIDER_DEFINE(sched); -SDT_PROBE_DEFINE3(sched, , , change_pri, change-pri, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , change__pri, "struct thread *", "struct proc *", "uint8_t"); -SDT_PROBE_DEFINE3(sched, , , dequeue, dequeue, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , dequeue, "struct thread *", "struct proc *", "void *"); -SDT_PROBE_DEFINE4(sched, , , enqueue, enqueue, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , enqueue, "struct thread *", "struct proc *", "void *", "int"); -SDT_PROBE_DEFINE4(sched, , , lend_pri, lend-pri, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , lend__pri, "struct thread *", "struct proc *", "uint8_t", "struct thread *"); -SDT_PROBE_DEFINE2(sched, , , load_change, load-change, "int", "int"); -SDT_PROBE_DEFINE2(sched, , , off_cpu, off-cpu, "struct thread *", +SDT_PROBE_DEFINE2(sched, , , load__change, "int", "int"); +SDT_PROBE_DEFINE2(sched, , , off__cpu, "struct thread *", "struct proc *"); -SDT_PROBE_DEFINE(sched, , , on_cpu, on-cpu); -SDT_PROBE_DEFINE(sched, , , remain_cpu, remain-cpu); -SDT_PROBE_DEFINE2(sched, , , surrender, surrender, "struct thread *", +SDT_PROBE_DEFINE(sched, , , on__cpu); +SDT_PROBE_DEFINE(sched, , , remain__cpu); +SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", "struct proc *"); /* @@ -531,7 +531,7 @@ tdq_load_add(struct tdq *tdq, struct thr if ((td->td_flags & TDF_NOLOAD) == 0) tdq->tdq_sysload++; KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); - SDT_PROBE2(sched, , , load_change, (int)TDQ_ID(tdq), tdq->tdq_load); + SDT_PROBE2(sched, , , load__change, (int)TDQ_ID(tdq), tdq->tdq_load); } /* @@ -551,7 +551,7 @@ tdq_load_rem(struct tdq *tdq, struct thr if ((td->td_flags & TDF_NOLOAD) == 0) tdq->tdq_sysload--; KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); - SDT_PROBE2(sched, , , load_change, (int)TDQ_ID(tdq), tdq->tdq_load); + SDT_PROBE2(sched, , , load__change, (int)TDQ_ID(tdq), tdq->tdq_load); } /* @@ -1622,12 +1622,12 @@ sched_thread_priority(struct thread *td, KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); - SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); + SDT_PROBE3(sched, , , change__pri, td, td->td_proc, prio); if (td != curthread && prio < td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); - SDT_PROBE4(sched, , , lend_pri, td, td->td_proc, prio, + SDT_PROBE4(sched, , , lend__pri, td, td->td_proc, prio, curthread); } ts = td->td_sched; @@ -1880,7 +1880,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); + SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; sched_pctcpu_update(newtd->td_sched, 0); @@ -1906,14 +1906,14 @@ sched_switch(struct thread *td, struct t lock_profile_obtain_lock_success( &TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__); - SDT_PROBE0(sched, , , on_cpu); + SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif } else { thread_unblock_switch(td, mtx); - SDT_PROBE0(sched, , , remain_cpu); + SDT_PROBE0(sched, , , remain__cpu); } /* * Assert that all went well and return. Modified: stable/9/sys/kern/subr_devstat.c ============================================================================== --- stable/9/sys/kern/subr_devstat.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/subr_devstat.c Mon Feb 17 13:58:50 2014 (r262057) @@ -49,19 +49,19 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DEFINE(io); -SDT_PROBE_DEFINE2(io, , , start, start, "struct bio *", "struct devstat *"); -SDT_PROBE_DEFINE2(io, , , done, done, "struct bio *", "struct devstat *"); -SDT_PROBE_DEFINE2(io, , , wait_start, wait-start, "struct bio *", +SDT_PROBE_DEFINE2(io, , , start, "struct bio *", "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , done, "struct bio *", "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , wait__start, "struct bio *", "struct devstat *"); -SDT_PROBE_DEFINE2(io, , , wait_done, wait-done, "struct bio *", +SDT_PROBE_DEFINE2(io, , , wait__done, "struct bio *", "struct devstat *"); #define DTRACE_DEVSTAT_START() SDT_PROBE2(io, , , start, NULL, ds) #define DTRACE_DEVSTAT_BIO_START() SDT_PROBE2(io, , , start, bp, ds) #define DTRACE_DEVSTAT_DONE() SDT_PROBE2(io, , , done, NULL, ds) #define DTRACE_DEVSTAT_BIO_DONE() SDT_PROBE2(io, , , done, bp, ds) -#define DTRACE_DEVSTAT_WAIT_START() SDT_PROBE2(io, , , wait_start, NULL, ds) -#define DTRACE_DEVSTAT_WAIT_DONE() SDT_PROBE2(io, , , wait_done, NULL, ds) +#define DTRACE_DEVSTAT_WAIT_START() SDT_PROBE2(io, , , wait__start, NULL, ds) +#define DTRACE_DEVSTAT_WAIT_DONE() SDT_PROBE2(io, , , wait__done, NULL, ds) static int devstat_num_devs; static long devstat_generation = 1; Modified: stable/9/sys/kern/subr_turnstile.c ============================================================================== --- stable/9/sys/kern/subr_turnstile.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/subr_turnstile.c Mon Feb 17 13:58:50 2014 (r262057) @@ -170,8 +170,8 @@ static int turnstile_init(void *mem, int static void turnstile_fini(void *mem, int size); SDT_PROVIDER_DECLARE(sched); -SDT_PROBE_DEFINE(sched, , , sleep, sleep); -SDT_PROBE_DEFINE2(sched, , , wakeup, wakeup, "struct thread *", +SDT_PROBE_DEFINE(sched, , , sleep); +SDT_PROBE_DEFINE2(sched, , , wakeup, "struct thread *", "struct proc *"); /* Modified: stable/9/sys/kern/vfs_cache.c ============================================================================== --- stable/9/sys/kern/vfs_cache.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/vfs_cache.c Mon Feb 17 13:58:50 2014 (r262057) @@ -62,28 +62,28 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namecache, enter, done, done, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *", "char *"); -SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, entry, "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, hit, "struct vnode *", +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, miss, "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, return, "int", +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int", "struct vnode *", "char *"); -SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, hit, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, hit-negative, +SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit__negative, "struct vnode *", "char *"); -SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, miss, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *", "char *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge, done, done, "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, done, "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, done, "struct mount *"); -SDT_PROBE_DEFINE3(vfs, namecache, zap, done, done, "struct vnode *", "char *", +SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", "char *"); /* @@ -614,7 +614,7 @@ negative_success: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, nc_get_name(ncp), + SDT_PROBE(vfs, namecache, lookup, hit__negative, dvp, nc_get_name(ncp), 0, 0, 0); cache_out_ts(ncp, tsp, ticksp); CACHE_WUNLOCK(); Modified: stable/9/sys/kern/vfs_lookup.c ============================================================================== --- stable/9/sys/kern/vfs_lookup.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/vfs_lookup.c Mon Feb 17 13:58:50 2014 (r262057) @@ -70,9 +70,9 @@ __FBSDID("$FreeBSD$"); #undef NAMEI_DIAGNOSTIC SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, entry, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *", "unsigned long"); -SDT_PROBE_DEFINE2(vfs, namei, lookup, return, return, "int", "struct vnode *"); +SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *"); /* * Allocation zone for namei Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/vfs_syscalls.c Mon Feb 17 13:58:50 2014 (r262057) @@ -91,8 +91,8 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); SDT_PROVIDER_DEFINE(vfs); -SDT_PROBE_DEFINE2(vfs, , stat, mode, mode, "char *", "int"); -SDT_PROBE_DEFINE2(vfs, , stat, reg, reg, "char *", "int"); +SDT_PROBE_DEFINE2(vfs, , stat, mode, "char *", "int"); +SDT_PROBE_DEFINE2(vfs, , stat, reg, "char *", "int"); static int chroot_refuse_vdir_fds(struct filedesc *fdp); static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); Modified: stable/9/sys/net/vnet.c ============================================================================== --- stable/9/sys/net/vnet.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/net/vnet.c Mon Feb 17 13:58:50 2014 (r262057) @@ -210,14 +210,14 @@ static TAILQ_HEAD(, vnet_data_free) vnet static struct sx vnet_data_free_lock; SDT_PROVIDER_DEFINE(vnet); -SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, entry, "int"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, alloc, "int", +SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, "int"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, "int", "struct vnet *"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, return, +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, "int", "struct vnet *"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, entry, +SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, "int", "struct vnet *"); -SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, entry, +SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int"); #ifdef DDB Modified: stable/9/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/9/sys/netinet/sctp_dtrace_define.h Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/netinet/sctp_dtrace_define.h Mon Feb 17 13:58:50 2014 (r262057) @@ -45,7 +45,7 @@ SDT_PROVIDER_DEFINE(sctp); /* Cwnd probe - tracks changes in the congestion window on a netp */ /********************************************************/ /* Initial */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, init, init, +SDT_PROBE_DEFINE5(sctp, cwnd, net, init, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -56,7 +56,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, init, "int"); /* The new value of the cwnd */ /* ACK-INCREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, ack, ack, +SDT_PROBE_DEFINE5(sctp, cwnd, net, ack, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -67,14 +67,14 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, ack, "int"); /* The new value of the cwnd */ /* ACK-INCREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, rttvar, rttvar, +SDT_PROBE_DEFINE5(sctp, cwnd, net, rttvar, "uint64_t", /* The Vtag << 32 | localport << 16 | remoteport */ "uint64_t", /* obw | nbw */ "uint64_t", /* bwrtt | newrtt */ "uint64_t", /* flight */ "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, rttstep, rttstep, +SDT_PROBE_DEFINE5(sctp, cwnd, net, rttstep, "uint64_t", /* The Vtag << 32 | localport << 16 | remoteport */ "uint64_t", /* obw | nbw */ "uint64_t", /* bwrtt | newrtt */ @@ -82,7 +82,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, rttst "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ /* FastRetransmit-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, fr, fr, +SDT_PROBE_DEFINE5(sctp, cwnd, net, fr, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -93,7 +93,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, fr, f "int"); /* The new value of the cwnd */ /* TimeOut-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, to, to, +SDT_PROBE_DEFINE5(sctp, cwnd, net, to, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -104,7 +104,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, to, t "int"); /* The new value of the cwnd */ /* BurstLimit-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, bl, bl, +SDT_PROBE_DEFINE5(sctp, cwnd, net, bl, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -115,7 +115,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, bl, b "int"); /* The new value of the cwnd */ /* ECN-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn, ecn, +SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -126,7 +126,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn, "int"); /* The new value of the cwnd */ /* PacketDrop-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, pd, pd, +SDT_PROBE_DEFINE5(sctp, cwnd, net, pd, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -139,7 +139,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, pd, p /********************************************************/ /* Rwnd probe - tracks changes in the receiver window for an assoc */ /********************************************************/ -SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val, val, +SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -151,7 +151,7 @@ SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val /********************************************************/ /* flight probe - tracks changes in the flight size on a net or assoc */ /********************************************************/ -SDT_PROBE_DEFINE5(sctp, flightsize, net, val, val, +SDT_PROBE_DEFINE5(sctp, flightsize, net, val, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -164,7 +164,7 @@ SDT_PROBE_DEFINE5(sctp, flightsize, net, /********************************************************/ /* The total flight version */ /********************************************************/ -SDT_PROBE_DEFINE4(sctp, flightsize, assoc, val, val, +SDT_PROBE_DEFINE4(sctp, flightsize, assoc, val, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number Modified: stable/9/sys/opencrypto/deflate.c ============================================================================== --- stable/9/sys/opencrypto/deflate.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/opencrypto/deflate.c Mon Feb 17 13:58:50 2014 (r262057) @@ -50,13 +50,13 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(opencrypto); -SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, entry, +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, "int", "u_int32_t"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, bad, +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, iter, +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, return, +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, "int", "u_int32_t"); int window_inflate = -1 * MAX_WBITS; Modified: stable/9/sys/security/mac/mac_framework.c ============================================================================== --- stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:58:50 2014 (r262057) @@ -94,11 +94,11 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); -SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int", +SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, "int", "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, register, register, +SDT_PROBE_DEFINE1(mac, kernel, policy, register, "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister, +SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, "struct mac_policy_conf *"); /* Modified: stable/9/sys/security/mac/mac_internal.h ============================================================================== --- stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:58:50 2014 (r262057) @@ -74,35 +74,35 @@ SDT_PROVIDER_DECLARE(mac); /* MAC Frame SDT_PROVIDER_DECLARE(mac_framework); /* Entry points to MAC. */ #define MAC_CHECK_PROBE_DEFINE4(name, arg0, arg1, arg2, arg3) \ - SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_err, \ - mac-check-ok, "int", arg0, arg1, arg2, arg3); \ - SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0, arg1, arg2, arg3); + SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac__check__err, \ + "int", arg0, arg1, arg2, arg3); \ + SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0, arg1, arg2, arg3); #define MAC_CHECK_PROBE_DEFINE3(name, arg0, arg1, arg2) \ - SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_err, \ - mac-check-err, "int", arg0, arg1, arg2); \ - SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0, arg1, arg2); + SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac__check__err, \ + "int", arg0, arg1, arg2); \ + SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0, arg1, arg2); #define MAC_CHECK_PROBE_DEFINE2(name, arg0, arg1) \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_err, \ - mac-check-err, "int", arg0, arg1); \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0, arg1); + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__check__err, \ + "int", arg0, arg1); \ + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0, arg1); #define MAC_CHECK_PROBE_DEFINE1(name, arg0) \ - SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_err, \ - mac-check-err, "int", arg0); \ - SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0); + SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac__check__err, \ + "int", arg0); \ + SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0); #define MAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3) do { \ if (error) { \ - SDT_PROBE(mac_framework, kernel, name, mac_check_err, \ + SDT_PROBE(mac_framework, kernel, name, mac__check__err, \ error, arg0, arg1, arg2, arg3); \ } else { \ - SDT_PROBE(mac_framework, kernel, name, mac_check_ok, \ + SDT_PROBE(mac_framework, kernel, name, mac__check__ok, \ 0, arg0, arg1, arg2, arg3); \ } \ } while (0) @@ -116,17 +116,17 @@ SDT_PROVIDER_DECLARE(mac_framework); /* #endif #define MAC_GRANT_PROBE_DEFINE2(name, arg0, arg1) \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \ - mac-grant-err, "int", arg0, arg1); \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \ - mac-grant-ok, "int", arg0, arg1); + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__grant__err, \ + "int", arg0, arg1); \ + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__grant__ok, \ + "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ - SDT_PROBE(mac_framework, kernel, name, mac_grant_err, \ + SDT_PROBE(mac_framework, kernel, name, mac__grant__err, \ error, arg0, arg1, 0, 0); \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 14:47:54 2014 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 ESMTPS id 344C2D0F; Mon, 17 Feb 2014 14:47:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 149D91982; Mon, 17 Feb 2014 14:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HElrj3092787; Mon, 17 Feb 2014 14:47:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HElrjg092783; Mon, 17 Feb 2014 14:47:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171447.s1HElrjg092783@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 14:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262058 - in stable/10/sys: cddl/compat/opensolaris/sys kern modules/zfs sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 14:47:54 -0000 Author: avg Date: Mon Feb 17 14:47:52 2014 New Revision: 262058 URL: http://svnweb.freebsd.org/changeset/base/262058 Log: MFC r258625: sdt: add support for solaris/illumos style DTRACE_PROBE macros Note: in head KDTRACE_HOOKS is defined in opt_global.h and thus there is no need to explicitly include any header to check that option. In this branch we have to include opt_kdtrace.h and, so, this commit carries additional changes to accomodate for that difference. Sponsored by: HybridCluster Modified: stable/10/sys/cddl/compat/opensolaris/sys/sdt.h stable/10/sys/kern/kern_sdt.c stable/10/sys/modules/zfs/Makefile stable/10/sys/sys/sdt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/sys/sdt.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) @@ -29,20 +29,11 @@ #ifndef _OPENSOLARIS_SYS_SDT_H_ #define _OPENSOLARIS_SYS_SDT_H_ +#ifdef _KERNEL +#include +#endif #include_next -#undef DTRACE_PROBE -#undef DTRACE_PROBE1 -#undef DTRACE_PROBE2 -#undef DTRACE_PROBE3 -#undef DTRACE_PROBE4 - -#define DTRACE_PROBE(name) -#define DTRACE_PROBE1(name, type1, arg1) -#define DTRACE_PROBE2(name, type1, arg1, type2, arg2) -#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) -#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) - #define SET_ERROR(err) (err) #endif /* _OPENSOLARIS_SYS_SDT_H_ */ Modified: stable/10/sys/kern/kern_sdt.c ============================================================================== --- stable/10/sys/kern/kern_sdt.c Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/kern/kern_sdt.c Mon Feb 17 14:47:52 2014 (r262058) @@ -31,6 +31,8 @@ #include #include +SDT_PROVIDER_DEFINE(sdt); + /* * Hook for the DTrace probe function. The SDT provider will set this to * dtrace_probe() when it loads. Modified: stable/10/sys/modules/zfs/Makefile ============================================================================== --- stable/10/sys/modules/zfs/Makefile Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/modules/zfs/Makefile Mon Feb 17 14:47:52 2014 (r262058) @@ -4,6 +4,12 @@ KMOD= zfs SRCS= bus_if.h device_if.h vnode_if.h +.if !defined(KERNBUILDDIR) +SRCS+= opt_kdtrace.h +opt_kdtrace.h: + echo "" > ${.TARGET} +.endif + SUNW= ${.CURDIR}/../../cddl/contrib/opensolaris .PATH: ${SUNW}/common/acl Modified: stable/10/sys/sys/sdt.h ============================================================================== --- stable/10/sys/sys/sdt.h Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) @@ -126,6 +126,14 @@ arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ xarg6) +#define DTRACE_PROBE(name) +#define DTRACE_PROBE1(name, type0, arg0) +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3,\ + type4, arg4) + #else SET_DECLARE(sdt_providers_set, struct sdt_provider); @@ -313,6 +321,51 @@ SET_DECLARE(sdt_argtypes_set, struct sdt (uintptr_t)arg6); \ } while (0) +#define DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) do { \ + static SDT_PROBE_DEFINE(sdt, , , name); \ + SDT_PROBE(sdt, , , name, arg0, arg1, arg2, arg3, arg4); +#define DTRACE_PROBE_IMPL_END } while (0) + +#define DTRACE_PROBE(name) \ + DTRACE_PROBE_IMPL_START(name, 0, 0, 0, 0, 0) \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE1(name, type0, arg0) \ + DTRACE_PROBE_IMPL_START(name, arg0, 0, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3, \ + type4, arg4) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 4, #type4, NULL); \ + DTRACE_PROBE_IMPL_END + #endif /* KDTRACE_HOOKS */ /* @@ -365,6 +418,8 @@ struct sdt_provider { void sdt_probe_stub(uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +SDT_PROVIDER_DECLARE(sdt); + #endif /* _KERNEL */ #endif /* _SYS_SDT_H */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 14:48:24 2014 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 ESMTPS id 9A121E4C; Mon, 17 Feb 2014 14:48:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76B7A198C; Mon, 17 Feb 2014 14:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HEmOba092898; Mon, 17 Feb 2014 14:48:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HEmNNo092894; Mon, 17 Feb 2014 14:48:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171448.s1HEmNNo092894@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 14:48:23 +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: r262059 - in stable/9/sys: cddl/compat/opensolaris/sys kern modules/zfs 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 14:48:24 -0000 Author: avg Date: Mon Feb 17 14:48:23 2014 New Revision: 262059 URL: http://svnweb.freebsd.org/changeset/base/262059 Log: MFC r258625: sdt: add support for solaris/illumos style DTRACE_PROBE macros Note: in head KDTRACE_HOOKS is defined in opt_global.h and thus there is no need to explicitly include any header to check that option. In this branch we have to include opt_kdtrace.h and, so, this commit carries additional changes to accomodate for that difference. Sponsored by: HybridCluster Modified: stable/9/sys/cddl/compat/opensolaris/sys/sdt.h stable/9/sys/kern/kern_sdt.c stable/9/sys/modules/zfs/Makefile stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/sys/sdt.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 14:48:23 2014 (r262059) @@ -29,20 +29,11 @@ #ifndef _OPENSOLARIS_SYS_SDT_H_ #define _OPENSOLARIS_SYS_SDT_H_ +#ifdef _KERNEL +#include +#endif #include_next -#undef DTRACE_PROBE -#undef DTRACE_PROBE1 -#undef DTRACE_PROBE2 -#undef DTRACE_PROBE3 -#undef DTRACE_PROBE4 - -#define DTRACE_PROBE(name) -#define DTRACE_PROBE1(name, type1, arg1) -#define DTRACE_PROBE2(name, type1, arg1, type2, arg2) -#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) -#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) - #define SET_ERROR(err) (err) #endif /* _OPENSOLARIS_SYS_SDT_H_ */ Modified: stable/9/sys/kern/kern_sdt.c ============================================================================== --- stable/9/sys/kern/kern_sdt.c Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/kern/kern_sdt.c Mon Feb 17 14:48:23 2014 (r262059) @@ -31,6 +31,8 @@ #include #include +SDT_PROVIDER_DEFINE(sdt); + /* * Hook for the DTrace probe function. The SDT provider will set this to * dtrace_probe() when it loads. Modified: stable/9/sys/modules/zfs/Makefile ============================================================================== --- stable/9/sys/modules/zfs/Makefile Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/modules/zfs/Makefile Mon Feb 17 14:48:23 2014 (r262059) @@ -4,6 +4,12 @@ KMOD= zfs SRCS= bus_if.h device_if.h vnode_if.h +.if !defined(KERNBUILDDIR) +SRCS+= opt_kdtrace.h +opt_kdtrace.h: + echo "" > ${.TARGET} +.endif + SUNW= ${.CURDIR}/../../cddl/contrib/opensolaris .PATH: ${SUNW}/common/acl Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/sys/sdt.h Mon Feb 17 14:48:23 2014 (r262059) @@ -126,6 +126,14 @@ arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ xarg6) +#define DTRACE_PROBE(name) +#define DTRACE_PROBE1(name, type0, arg0) +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3,\ + type4, arg4) + #else SET_DECLARE(sdt_providers_set, struct sdt_provider); @@ -313,6 +321,51 @@ SET_DECLARE(sdt_argtypes_set, struct sdt (uintptr_t)arg6); \ } while (0) +#define DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) do { \ + static SDT_PROBE_DEFINE(sdt, , , name); \ + SDT_PROBE(sdt, , , name, arg0, arg1, arg2, arg3, arg4); +#define DTRACE_PROBE_IMPL_END } while (0) + +#define DTRACE_PROBE(name) \ + DTRACE_PROBE_IMPL_START(name, 0, 0, 0, 0, 0) \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE1(name, type0, arg0) \ + DTRACE_PROBE_IMPL_START(name, arg0, 0, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3, \ + type4, arg4) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 4, #type4, NULL); \ + DTRACE_PROBE_IMPL_END + #endif /* KDTRACE_HOOKS */ /* @@ -365,6 +418,8 @@ struct sdt_provider { void sdt_probe_stub(uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +SDT_PROVIDER_DECLARE(sdt); + #endif /* _KERNEL */ #endif /* _SYS_SDT_H */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 14:51:02 2014 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 ESMTPS id B1D3410C; Mon, 17 Feb 2014 14:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DDCC1A15; Mon, 17 Feb 2014 14:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HEp26t095540; Mon, 17 Feb 2014 14:51:02 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HEp2RI095539; Mon, 17 Feb 2014 14:51:02 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402171451.s1HEp2RI095539@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 14:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262060 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 14:51:02 -0000 Author: markj Date: Mon Feb 17 14:51:02 2014 New Revision: 262060 URL: http://svnweb.freebsd.org/changeset/base/262060 Log: MFC r260051: When clearing relocations to __dtrace* symbols, handle both SHT_REL and SHT_RELA sections properly instead of assuming that the relocation section is of type SHT_REL. Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:48:23 2014 (r262059) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:51:02 2014 (r262060) @@ -1620,10 +1620,17 @@ process_obj(dtrace_hdl_t *dtp, const cha * the executable file as the symbol is going to be * change from UND to ABS. */ - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; - (void) gelf_update_rela(data_rel, i, &rela); + if (shdr_rel.sh_type == SHT_RELA) { + rela.r_offset = 0; + rela.r_info = 0; + rela.r_addend = 0; + (void) gelf_update_rela(data_rel, i, &rela); + } else { + GElf_Rel rel; + rel.r_offset = 0; + rel.r_info = 0; + (void) gelf_update_rel(data_rel, i, &rel); + } #endif mod = 1; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 14:52:07 2014 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 ESMTPS id 3D93A32D; Mon, 17 Feb 2014 14:52:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 282BC1A2F; Mon, 17 Feb 2014 14:52:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HEq7aN096211; Mon, 17 Feb 2014 14:52:07 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HEq7h4096210; Mon, 17 Feb 2014 14:52:07 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402171452.s1HEq7h4096210@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 14:52:07 +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: r262061 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 14:52:07 -0000 Author: markj Date: Mon Feb 17 14:52:06 2014 New Revision: 262061 URL: http://svnweb.freebsd.org/changeset/base/262061 Log: MFC r260051: When clearing relocations to __dtrace* symbols, handle both SHT_REL and SHT_RELA sections properly instead of assuming that the relocation section is of type SHT_REL. Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:51:02 2014 (r262060) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:52:06 2014 (r262061) @@ -1539,10 +1539,17 @@ process_obj(dtrace_hdl_t *dtp, const cha * the executable file as the symbol is going to be * change from UND to ABS. */ - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; - (void) gelf_update_rela(data_rel, i, &rela); + if (shdr_rel.sh_type == SHT_RELA) { + rela.r_offset = 0; + rela.r_info = 0; + rela.r_addend = 0; + (void) gelf_update_rela(data_rel, i, &rela); + } else { + GElf_Rel rel; + rel.r_offset = 0; + rel.r_info = 0; + (void) gelf_update_rel(data_rel, i, &rel); + } #endif mod = 1; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:20:04 2014 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 ESMTPS id 167E765A; Mon, 17 Feb 2014 15:20:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01B491C9E; Mon, 17 Feb 2014 15:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFK39j006591; Mon, 17 Feb 2014 15:20:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFK3KW006590; Mon, 17 Feb 2014 15:20:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171520.s1HFK3KW006590@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:20: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: r262062 - stable/8/share/man/man9 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:20:04 -0000 Author: avg Date: Mon Feb 17 15:20:03 2014 New Revision: 262062 URL: http://svnweb.freebsd.org/changeset/base/262062 Log: MFC r214019: Update links for taskqueue(9) functions Modified: stable/8/share/man/man9/Makefile Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 17 14:52:06 2014 (r262061) +++ stable/8/share/man/man9/Makefile Mon Feb 17 15:20:03 2014 (r262062) @@ -1263,11 +1263,17 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_create.9 \ + taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ + taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ + taskqueue.9 taskqueue_drain.9 \ taskqueue.9 taskqueue_enqueue.9 \ - taskqueue.9 taskqueue_find.9 \ + taskqueue.9 taskqueue_enqueue_fast.9 \ + taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ + taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ + taskqueue.9 taskqueue_member.9 \ taskqueue.9 taskqueue_run.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:24:51 2014 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 ESMTPS id 337AC8D6; Mon, 17 Feb 2014 15:24:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1E41D32; Mon, 17 Feb 2014 15:24:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFOoNu009806; Mon, 17 Feb 2014 15:24:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFOoDg009802; Mon, 17 Feb 2014 15:24:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171524.s1HFOoDg009802@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:24:50 +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: r262063 - in stable/8: share/man/man9 sys/kern sys/sys 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:24:51 -0000 Author: avg Date: Mon Feb 17 15:24:49 2014 New Revision: 262063 URL: http://svnweb.freebsd.org/changeset/base/262063 Log: MFC r258713,262062: add taskqueue_drain_all Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/taskqueue.9 stable/8/sys/kern/subr_taskqueue.c stable/8/sys/sys/taskqueue.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/share/man/man9/Makefile Mon Feb 17 15:24:49 2014 (r262063) @@ -1262,19 +1262,22 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ + taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ + taskqueue.9 taskqueue_drain_all.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ - taskqueue.9 taskqueue_run.9 + taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 Modified: stable/8/share/man/man9/taskqueue.9 ============================================================================== --- stable/8/share/man/man9/taskqueue.9 Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/share/man/man9/taskqueue.9 Mon Feb 17 15:24:49 2014 (r262063) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2009 +.Dd January 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -69,6 +69,12 @@ struct task { .Fn taskqueue_run_fast "struct taskqueue *queue" .Ft void .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" +.Ft void +.Fn taskqueue_drain_all "struct taskqueue *queue" +.Ft void +.Fn taskqueue_block "struct taskqueue *queue" +.Ft void +.Fn taskqueue_unblock "struct taskqueue *queue" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" @@ -176,6 +182,73 @@ function is used to wait for the task to There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . +If the caller wants to put the task into a known state, +then before calling +.Fn taskqueue_drain +the caller should use out-of-band means to ensure that the task +would not be enqueued. +For example, if the task is enqueued by an interrupt filter, then +the interrupt could be disabled. +.Pp +The +.Fn taskqueue_drain_all +function is used to wait for all pending and running tasks that +are enqueued on the taskqueue to finish. +The caller must arrange that the tasks are not re-enqueued. +Note that +.Fn taskqueue_drain_all +currently does not handle tasks with delayed enqueueing. +.Pp +The +.Fn taskqueue_block +function blocks the taskqueue. +It prevents any enqueued but not running tasks from being executed. +Future calls to +.Fn taskqueue_enqueue +will enqueue tasks, but the tasks will not be run until +.Fn taskqueue_unblock +is called. +Please note that +.Fn taskqueue_block +does not wait for any currently running tasks to finish. +Thus, the +.Fn taskqueue_block +does not provide a guarantee that +.Fn taskqueue_run +is not running after +.Fn taskqueue_block +returns, but it does provide a guarantee that +.Fn taskqueue_run +will not be called again +until +.Fn taskqueue_unblock +is called. +If the caller requires a guarantee that +.Fn taskqueue_run +is not running, then this must be arranged by the caller. +Note that if +.Fn taskqueue_drain +is called on a task that is enqueued on a taskqueue that is blocked by +.Fn taskqueue_block , +then +.Fn taskqueue_drain +can not return until the taskqueue is unblocked. +This can result in a deadlock if the thread blocked in +.Fn taskqueue_drain +is the thread that is supposed to call +.Fn taskqueue_unblock . +Thus, use of +.Fn taskqueue_drain +after +.Fn taskqueue_block +is discouraged, because the state of the task can not be known in advance. +The same caveat applies to +.Fn taskqueue_drain_all . +.Pp +The +.Fn taskqueue_unblock +function unblocks the previously blocked taskqueue. +All enqueued tasks can be run after this call. .Pp The .Fn taskqueue_member Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/sys/kern/subr_taskqueue.c Mon Feb 17 15:24:49 2014 (r262063) @@ -202,6 +202,15 @@ taskqueue_enqueue(struct taskqueue *queu return 0; } +static void +taskqueue_drain_running(struct taskqueue *queue) +{ + + while (!TAILQ_EMPTY(&queue->tq_active)) + TQ_SLEEP(queue, &queue->tq_active, &queue->tq_mutex, + PWAIT, "-", 0); +} + void taskqueue_block(struct taskqueue *queue) { @@ -254,6 +263,8 @@ taskqueue_run_locked(struct taskqueue *q wakeup(task); } TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + if (TAILQ_EMPTY(&queue->tq_active)) + wakeup(&queue->tq_active); } void @@ -296,6 +307,25 @@ taskqueue_drain(struct taskqueue *queue, } } +void +taskqueue_drain_all(struct taskqueue *queue) +{ + struct task *task; + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + task = STAILQ_LAST(&queue->tq_queue, task, ta_link); + if (task != NULL) + while (task->ta_pending != 0) + TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + taskqueue_drain_running(queue); + KASSERT(STAILQ_EMPTY(&queue->tq_queue), + ("taskqueue queue is not empty after draining")); + TQ_UNLOCK(queue); +} + static void taskqueue_swi_enqueue(void *context) { Modified: stable/8/sys/sys/taskqueue.h ============================================================================== --- stable/8/sys/sys/taskqueue.h Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/sys/sys/taskqueue.h Mon Feb 17 15:24:49 2014 (r262063) @@ -55,6 +55,7 @@ int taskqueue_start_threads(struct taskq const char *name, ...) __printflike(4, 5); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); void taskqueue_drain(struct taskqueue *queue, struct task *task); +void taskqueue_drain_all(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:29:48 2014 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 ESMTPS id 33C5AB4B; Mon, 17 Feb 2014 15:29:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D5FF1D6E; Mon, 17 Feb 2014 15:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFTlc7010363; Mon, 17 Feb 2014 15:29:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFTlVG010359; Mon, 17 Feb 2014 15:29:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171529.s1HFTlVG010359@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:29: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: r262064 - in stable/9: share/man/man9 sys/kern 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:29:48 -0000 Author: avg Date: Mon Feb 17 15:29:46 2014 New Revision: 262064 URL: http://svnweb.freebsd.org/changeset/base/262064 Log: MFC r258713,262062: add taskqueue_drain_all Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/taskqueue.9 stable/9/sys/kern/subr_taskqueue.c stable/9/sys/sys/taskqueue.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/share/man/man9/Makefile Mon Feb 17 15:29:46 2014 (r262064) @@ -1308,6 +1308,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ + taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ @@ -1315,13 +1316,15 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ + taskqueue.9 taskqueue_drain_all.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ - taskqueue.9 taskqueue_run.9 + taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 Modified: stable/9/share/man/man9/taskqueue.9 ============================================================================== --- stable/9/share/man/man9/taskqueue.9 Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/share/man/man9/taskqueue.9 Mon Feb 17 15:29:46 2014 (r262064) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2012 +.Dd January 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -75,6 +75,12 @@ struct timeout_task; .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" .Ft void .Fn taskqueue_drain_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" +.Ft void +.Fn taskqueue_drain_all "struct taskqueue *queue" +.Ft void +.Fn taskqueue_block "struct taskqueue *queue" +.Ft void +.Fn taskqueue_unblock "struct taskqueue *queue" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Ft void @@ -227,6 +233,73 @@ function is used to wait for the schedul There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . +If the caller wants to put the task into a known state, +then before calling +.Fn taskqueue_drain +the caller should use out-of-band means to ensure that the task +would not be enqueued. +For example, if the task is enqueued by an interrupt filter, then +the interrupt could be disabled. +.Pp +The +.Fn taskqueue_drain_all +function is used to wait for all pending and running tasks that +are enqueued on the taskqueue to finish. +The caller must arrange that the tasks are not re-enqueued. +Note that +.Fn taskqueue_drain_all +currently does not handle tasks with delayed enqueueing. +.Pp +The +.Fn taskqueue_block +function blocks the taskqueue. +It prevents any enqueued but not running tasks from being executed. +Future calls to +.Fn taskqueue_enqueue +will enqueue tasks, but the tasks will not be run until +.Fn taskqueue_unblock +is called. +Please note that +.Fn taskqueue_block +does not wait for any currently running tasks to finish. +Thus, the +.Fn taskqueue_block +does not provide a guarantee that +.Fn taskqueue_run +is not running after +.Fn taskqueue_block +returns, but it does provide a guarantee that +.Fn taskqueue_run +will not be called again +until +.Fn taskqueue_unblock +is called. +If the caller requires a guarantee that +.Fn taskqueue_run +is not running, then this must be arranged by the caller. +Note that if +.Fn taskqueue_drain +is called on a task that is enqueued on a taskqueue that is blocked by +.Fn taskqueue_block , +then +.Fn taskqueue_drain +can not return until the taskqueue is unblocked. +This can result in a deadlock if the thread blocked in +.Fn taskqueue_drain +is the thread that is supposed to call +.Fn taskqueue_unblock . +Thus, use of +.Fn taskqueue_drain +after +.Fn taskqueue_block +is discouraged, because the state of the task can not be known in advance. +The same caveat applies to +.Fn taskqueue_drain_all . +.Pp +The +.Fn taskqueue_unblock +function unblocks the previously blocked taskqueue. +All enqueued tasks can be run after this call. .Pp The .Fn taskqueue_member Modified: stable/9/sys/kern/subr_taskqueue.c ============================================================================== --- stable/9/sys/kern/subr_taskqueue.c Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/sys/kern/subr_taskqueue.c Mon Feb 17 15:29:46 2014 (r262064) @@ -264,6 +264,15 @@ taskqueue_enqueue_timeout(struct taskque return (res); } +static void +taskqueue_drain_running(struct taskqueue *queue) +{ + + while (!TAILQ_EMPTY(&queue->tq_active)) + TQ_SLEEP(queue, &queue->tq_active, &queue->tq_mutex, + PWAIT, "-", 0); +} + void taskqueue_block(struct taskqueue *queue) { @@ -316,6 +325,8 @@ taskqueue_run_locked(struct taskqueue *q wakeup(task); } TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + if (TAILQ_EMPTY(&queue->tq_active)) + wakeup(&queue->tq_active); } void @@ -400,6 +411,25 @@ taskqueue_drain(struct taskqueue *queue, } void +taskqueue_drain_all(struct taskqueue *queue) +{ + struct task *task; + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + task = STAILQ_LAST(&queue->tq_queue, task, ta_link); + if (task != NULL) + while (task->ta_pending != 0) + TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + taskqueue_drain_running(queue); + KASSERT(STAILQ_EMPTY(&queue->tq_queue), + ("taskqueue queue is not empty after draining")); + TQ_UNLOCK(queue); +} + +void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task) { Modified: stable/9/sys/sys/taskqueue.h ============================================================================== --- stable/9/sys/sys/taskqueue.h Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/sys/sys/taskqueue.h Mon Feb 17 15:29:46 2014 (r262064) @@ -71,6 +71,7 @@ int taskqueue_cancel_timeout(struct task void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); +void taskqueue_drain_all(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:31:01 2014 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 ESMTPS id 5EFD5CC6; Mon, 17 Feb 2014 15:31:01 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 20DF01DD9; Mon, 17 Feb 2014 15:31:00 +0000 (UTC) Received: from c122-106-144-87.carlnfd1.nsw.optusnet.com.au (c122-106-144-87.carlnfd1.nsw.optusnet.com.au [122.106.144.87]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C34E8D627DF; Tue, 18 Feb 2014 02:07:07 +1100 (EST) Date: Tue, 18 Feb 2014 02:07:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Felder Subject: Re: svn commit: r262051 - head/cddl/contrib/opensolaris/cmd/zpool In-Reply-To: <201402171323.s1HDNnQg059102@svn.freebsd.org> Message-ID: <20140218015927.D1978@besplex.bde.org> References: <201402171323.s1HDNnQg059102@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=Wu4Sb7vv c=1 sm=1 tr=0 a=p/w0leo876FR0WNmYI1KeA==:117 a=PO7r1zJSAAAA:8 a=Gn0936ki9ycA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=eqykFKSQAQgA:10 a=FDc_Fc19FI4qhLbiobEA:9 a=CjuIK1q_8ugA:10 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:31:01 -0000 On Mon, 17 Feb 2014, Mark Felder wrote: > Log: > Fix formatting. > > "Manpages should start a new sentence on a new line. This makes it easier > for translators to track changes." -jhb This has very little to do with translators. This makes it possible for man(1) to format the output correctly, at least for monospaced fonts. > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Feb 17 13:19:27 2014 (r262050) > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Feb 17 13:23:49 2014 (r262051) > @@ -1960,5 +1960,5 @@ implementation of this manual page was i > The > .Cm spare > feature requires a utility to detect zpool degradation and initiate > -disk replacement within the zpool. FreeBSD does not provide such a > -utility at this time. > +disk replacement within the zpool. > +FreeBSD does not provide such a utility at this time. Not splitting the line gave a hard-coded the sentence break of 1 space. Splitting the line allows man(1) to format with the default number of spaces. The default isn't 1. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:32:09 2014 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 ESMTPS id BCC33E2A; Mon, 17 Feb 2014 15:32:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A70C61DFA; Mon, 17 Feb 2014 15:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFW9Xr013377; Mon, 17 Feb 2014 15:32:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFW8w7013373; Mon, 17 Feb 2014 15:32:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171532.s1HFW8w7013373@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262065 - in stable/10: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:32:09 -0000 Author: avg Date: Mon Feb 17 15:32:08 2014 New Revision: 262065 URL: http://svnweb.freebsd.org/changeset/base/262065 Log: MFC r258713,262062: add taskqueue_drain_all Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/taskqueue.9 stable/10/sys/kern/subr_taskqueue.c stable/10/sys/sys/taskqueue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/share/man/man9/Makefile Mon Feb 17 15:32:08 2014 (r262065) @@ -1336,6 +1336,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ + taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ @@ -1343,13 +1344,15 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ + taskqueue.9 taskqueue_drain_all.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ - taskqueue.9 taskqueue_run.9 + taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 Modified: stable/10/share/man/man9/taskqueue.9 ============================================================================== --- stable/10/share/man/man9/taskqueue.9 Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/share/man/man9/taskqueue.9 Mon Feb 17 15:32:08 2014 (r262065) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2012 +.Dd January 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -86,6 +86,12 @@ struct timeout_task; .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" .Ft void .Fn taskqueue_drain_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" +.Ft void +.Fn taskqueue_drain_all "struct taskqueue *queue" +.Ft void +.Fn taskqueue_block "struct taskqueue *queue" +.Ft void +.Fn taskqueue_unblock "struct taskqueue *queue" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Ft void @@ -255,6 +261,73 @@ function is used to wait for the schedul There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . +If the caller wants to put the task into a known state, +then before calling +.Fn taskqueue_drain +the caller should use out-of-band means to ensure that the task +would not be enqueued. +For example, if the task is enqueued by an interrupt filter, then +the interrupt could be disabled. +.Pp +The +.Fn taskqueue_drain_all +function is used to wait for all pending and running tasks that +are enqueued on the taskqueue to finish. +The caller must arrange that the tasks are not re-enqueued. +Note that +.Fn taskqueue_drain_all +currently does not handle tasks with delayed enqueueing. +.Pp +The +.Fn taskqueue_block +function blocks the taskqueue. +It prevents any enqueued but not running tasks from being executed. +Future calls to +.Fn taskqueue_enqueue +will enqueue tasks, but the tasks will not be run until +.Fn taskqueue_unblock +is called. +Please note that +.Fn taskqueue_block +does not wait for any currently running tasks to finish. +Thus, the +.Fn taskqueue_block +does not provide a guarantee that +.Fn taskqueue_run +is not running after +.Fn taskqueue_block +returns, but it does provide a guarantee that +.Fn taskqueue_run +will not be called again +until +.Fn taskqueue_unblock +is called. +If the caller requires a guarantee that +.Fn taskqueue_run +is not running, then this must be arranged by the caller. +Note that if +.Fn taskqueue_drain +is called on a task that is enqueued on a taskqueue that is blocked by +.Fn taskqueue_block , +then +.Fn taskqueue_drain +can not return until the taskqueue is unblocked. +This can result in a deadlock if the thread blocked in +.Fn taskqueue_drain +is the thread that is supposed to call +.Fn taskqueue_unblock . +Thus, use of +.Fn taskqueue_drain +after +.Fn taskqueue_block +is discouraged, because the state of the task can not be known in advance. +The same caveat applies to +.Fn taskqueue_drain_all . +.Pp +The +.Fn taskqueue_unblock +function unblocks the previously blocked taskqueue. +All enqueued tasks can be run after this call. .Pp The .Fn taskqueue_member Modified: stable/10/sys/kern/subr_taskqueue.c ============================================================================== --- stable/10/sys/kern/subr_taskqueue.c Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/sys/kern/subr_taskqueue.c Mon Feb 17 15:32:08 2014 (r262065) @@ -285,6 +285,15 @@ taskqueue_enqueue_timeout(struct taskque return (res); } +static void +taskqueue_drain_running(struct taskqueue *queue) +{ + + while (!TAILQ_EMPTY(&queue->tq_active)) + TQ_SLEEP(queue, &queue->tq_active, &queue->tq_mutex, + PWAIT, "-", 0); +} + void taskqueue_block(struct taskqueue *queue) { @@ -337,6 +346,8 @@ taskqueue_run_locked(struct taskqueue *q wakeup(task); } TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + if (TAILQ_EMPTY(&queue->tq_active)) + wakeup(&queue->tq_active); } void @@ -421,6 +432,25 @@ taskqueue_drain(struct taskqueue *queue, } void +taskqueue_drain_all(struct taskqueue *queue) +{ + struct task *task; + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + task = STAILQ_LAST(&queue->tq_queue, task, ta_link); + if (task != NULL) + while (task->ta_pending != 0) + TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + taskqueue_drain_running(queue); + KASSERT(STAILQ_EMPTY(&queue->tq_queue), + ("taskqueue queue is not empty after draining")); + TQ_UNLOCK(queue); +} + +void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task) { Modified: stable/10/sys/sys/taskqueue.h ============================================================================== --- stable/10/sys/sys/taskqueue.h Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/sys/sys/taskqueue.h Mon Feb 17 15:32:08 2014 (r262065) @@ -81,6 +81,7 @@ int taskqueue_cancel_timeout(struct task void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); +void taskqueue_drain_all(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:33:21 2014 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 ESMTPS id CA6C7F78; Mon, 17 Feb 2014 15:33:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B466F1E0F; Mon, 17 Feb 2014 15:33:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFXLW4013585; Mon, 17 Feb 2014 15:33:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFXL6S013584; Mon, 17 Feb 2014 15:33:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402171533.s1HFXL6S013584@svn.freebsd.org> From: Eitan Adler Date: Mon, 17 Feb 2014 15:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262066 - head/sys/dev/sound/pcm 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:33:21 -0000 Author: eadler Date: Mon Feb 17 15:33:21 2014 New Revision: 262066 URL: http://svnweb.freebsd.org/changeset/base/262066 Log: pcm(4): Permit non-root users to change default unit Discussed with: mav Modified: head/sys/dev/sound/pcm/sound.c Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Mon Feb 17 15:32:08 2014 (r262065) +++ head/sys/dev/sound/pcm/sound.c Mon Feb 17 15:33:21 2014 (r262066) @@ -448,8 +448,10 @@ sysctl_hw_snd_default_unit(SYSCTL_HANDLE return (error); } /* XXX: do we need a way to let the user change the default unit? */ -SYSCTL_PROC(_hw_snd, OID_AUTO, default_unit, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(int), sysctl_hw_snd_default_unit, "I", "default sound device"); +SYSCTL_PROC(_hw_snd, OID_AUTO, default_unit, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, + 0, sizeof(int), sysctl_hw_snd_default_unit, "I", + "default sound device"); static int sysctl_hw_snd_maxautovchans(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:35:25 2014 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 ESMTPS id 395B022F; Mon, 17 Feb 2014 15:35:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 251331E21; Mon, 17 Feb 2014 15:35:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFZPEG013947; Mon, 17 Feb 2014 15:35:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFZP9T013946; Mon, 17 Feb 2014 15:35:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171535.s1HFZP9T013946@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:35:24 +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: r262068 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:35:25 -0000 Author: avg Date: Mon Feb 17 15:35:24 2014 New Revision: 262068 URL: http://svnweb.freebsd.org/changeset/base/262068 Log: MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:11 2014 (r262067) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:24 2014 (r262068) @@ -733,11 +733,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); else @@ -751,11 +746,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size) { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:35:11 2014 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 ESMTPS id D53A3145; Mon, 17 Feb 2014 15:35:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C01091E1E; Mon, 17 Feb 2014 15:35:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFZBit013888; Mon, 17 Feb 2014 15:35:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFZBhV013887; Mon, 17 Feb 2014 15:35:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171535.s1HFZBhV013887@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262067 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:35:11 -0000 Author: avg Date: Mon Feb 17 15:35:11 2014 New Revision: 262067 URL: http://svnweb.freebsd.org/changeset/base/262067 Log: MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:33:21 2014 (r262066) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:11 2014 (r262067) @@ -734,11 +734,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); else @@ -752,11 +747,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size) { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:35:36 2014 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 ESMTPS id CD5873A6; Mon, 17 Feb 2014 15:35:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B76D51E22; Mon, 17 Feb 2014 15:35:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFZaLd014007; Mon, 17 Feb 2014 15:35:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFZa2U014006; Mon, 17 Feb 2014 15:35:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171535.s1HFZa2U014006@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:35:36 +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: r262069 - stable/8/cddl/contrib/opensolaris/lib/libdtrace/common 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:35:36 -0000 Author: avg Date: Mon Feb 17 15:35:36 2014 New Revision: 262069 URL: http://svnweb.freebsd.org/changeset/base/262069 Log: MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:24 2014 (r262068) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:36 2014 (r262069) @@ -730,11 +730,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); else @@ -748,11 +743,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size) { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:38:10 2014 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 ESMTPS id C5BA952B; Mon, 17 Feb 2014 15:38:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF15B1E43; Mon, 17 Feb 2014 15:38:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFcAcf014350; Mon, 17 Feb 2014 15:38:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFcAaJ014349; Mon, 17 Feb 2014 15:38:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171538.s1HFcAaJ014349@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262070 - stable/10/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:38:10 -0000 Author: avg Date: Mon Feb 17 15:38:10 2014 New Revision: 262070 URL: http://svnweb.freebsd.org/changeset/base/262070 Log: MFC r258715: opensolaris compat: add taskq_wait emulation Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:35:36 2014 (r262069) +++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:10 2014 (r262070) @@ -166,3 +166,9 @@ taskq_dispatch_ent(taskq_t *tq, task_fun TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); } + +void +taskq_wait(taskq_t *tq) +{ + taskqueue_drain_all(tq->tq_queue); +} From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:38:27 2014 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 ESMTPS id BD0B465F; Mon, 17 Feb 2014 15:38:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8C5B1E48; Mon, 17 Feb 2014 15:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFcRXX014414; Mon, 17 Feb 2014 15:38:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFcRZq014413; Mon, 17 Feb 2014 15:38:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171538.s1HFcRZq014413@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:38:27 +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: r262071 - stable/9/sys/cddl/compat/opensolaris/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:38:27 -0000 Author: avg Date: Mon Feb 17 15:38:27 2014 New Revision: 262071 URL: http://svnweb.freebsd.org/changeset/base/262071 Log: MFC r258715: opensolaris compat: add taskq_wait emulation Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:10 2014 (r262070) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:27 2014 (r262071) @@ -166,3 +166,9 @@ taskq_dispatch_ent(taskq_t *tq, task_fun TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); } + +void +taskq_wait(taskq_t *tq) +{ + taskqueue_drain_all(tq->tq_queue); +} From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:41:02 2014 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 ESMTPS id 011067DF; Mon, 17 Feb 2014 15:41:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB0421F67; Mon, 17 Feb 2014 15:41:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFf1TC015049; Mon, 17 Feb 2014 15:41:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFf1Mr015048; Mon, 17 Feb 2014 15:41:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171541.s1HFf1Mr015048@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:41: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: r262072 - stable/8/sys/cddl/compat/opensolaris/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:41:02 -0000 Author: avg Date: Mon Feb 17 15:41:01 2014 New Revision: 262072 URL: http://svnweb.freebsd.org/changeset/base/262072 Log: MFC r258715: opensolaris compat: add taskq_wait emulation Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:27 2014 (r262071) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:41:01 2014 (r262072) @@ -166,3 +166,9 @@ taskq_dispatch_ent(taskq_t *tq, task_fun TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); } + +void +taskq_wait(taskq_t *tq) +{ + taskqueue_drain_all(tq->tq_queue); +} From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:50:41 2014 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 ESMTPS id 1D2AACF4; Mon, 17 Feb 2014 15:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED0801097; Mon, 17 Feb 2014 15:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFoeqe018743; Mon, 17 Feb 2014 15:50:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFoehW018742; Mon, 17 Feb 2014 15:50:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171550.s1HFoehW018742@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:50:40 +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: r262073 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:50:41 -0000 Author: avg Date: Mon Feb 17 15:50:40 2014 New Revision: 262073 URL: http://svnweb.freebsd.org/changeset/base/262073 Log: MFC r255226: Add sysctl/tunables for various metaslab variables MFC slacker: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.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/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:41:01 2014 (r262072) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:50:40 2014 (r262073) @@ -32,6 +32,9 @@ #include #include +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); + /* * Allow allocations to switch to gang blocks quickly. We do this to * avoid having to load lots of space_maps in a given txg. There are, @@ -46,6 +49,10 @@ uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ +TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN, + &metaslab_gang_bang, 0, + "Force gang block allocation for blocks larger than or equal to this value"); /* * The in-core space map representation is more compact than its on-disk form. @@ -62,12 +69,10 @@ int zfs_condense_pct = 200; * in zio_init() unless it has been overridden in /etc/system. */ int zfs_mg_alloc_failures = 0; - -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RDTUN, +TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RWTUN, &zfs_mg_alloc_failures, 0, "Number of allowed allocation failures per vdev"); -TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); /* * The zfs_mg_noalloc_threshold defines which metaslab groups should @@ -88,6 +93,10 @@ int zfs_mg_noalloc_threshold = 0; * Metaslab debugging: when set, keeps all space maps in core to verify frees. */ static int metaslab_debug = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, + 0, + "Metaslab debugging: when set, keeps all space maps in core to verify frees"); /* * Minimum size which forces the dynamic allocator to change @@ -96,6 +105,11 @@ static int metaslab_debug = 0; * aggressive strategy (i.e search by size rather than offset). */ uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE; +TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold", + &metaslab_df_alloc_threshold); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN, + &metaslab_df_alloc_threshold, 0, + "Minimum size which forces the dynamic allocator to change it's allocation strategy"); /* * The minimum free space, in percent, which must be available @@ -104,22 +118,37 @@ uint64_t metaslab_df_alloc_threshold = S * switch to using best-fit allocations. */ int metaslab_df_free_pct = 4; +TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN, + &metaslab_df_free_pct, 0, + "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion"); /* * A metaslab is considered "free" if it contains a contiguous * segment which is greater than metaslab_min_alloc_size. */ uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; +TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size", + &metaslab_min_alloc_size); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN, + &metaslab_min_alloc_size, 0, + "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* * Max number of space_maps to prefetch. */ int metaslab_prefetch_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, + &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); /* * Percentage bonus multiplier for metaslabs that are in the bonus area. */ int metaslab_smo_bonus_pct = 150; +TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, + &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); /* * Should we be willing to write data to degraded vdevs? From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:51:20 2014 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 ESMTPS id 472D3E36; Mon, 17 Feb 2014 15:51:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25D5510F9; Mon, 17 Feb 2014 15:51:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFpK56021445; Mon, 17 Feb 2014 15:51:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFpKmX021444; Mon, 17 Feb 2014 15:51:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171551.s1HFpKmX021444@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:51:19 +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: r262074 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:51:20 -0000 Author: avg Date: Mon Feb 17 15:51:19 2014 New Revision: 262074 URL: http://svnweb.freebsd.org/changeset/base/262074 Log: MFC r255226: Add sysctl/tunables for various metaslab variables MFC slacker: pjd Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.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/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:50:40 2014 (r262073) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:51:19 2014 (r262074) @@ -32,6 +32,9 @@ #include #include +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); + /* * Allow allocations to switch to gang blocks quickly. We do this to * avoid having to load lots of space_maps in a given txg. There are, @@ -46,6 +49,10 @@ uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ +TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN, + &metaslab_gang_bang, 0, + "Force gang block allocation for blocks larger than or equal to this value"); /* * The in-core space map representation is more compact than its on-disk form. @@ -62,12 +69,10 @@ int zfs_condense_pct = 200; * in zio_init() unless it has been overridden in /etc/system. */ int zfs_mg_alloc_failures = 0; - -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RDTUN, +TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RWTUN, &zfs_mg_alloc_failures, 0, "Number of allowed allocation failures per vdev"); -TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); /* * The zfs_mg_noalloc_threshold defines which metaslab groups should @@ -88,6 +93,10 @@ int zfs_mg_noalloc_threshold = 0; * Metaslab debugging: when set, keeps all space maps in core to verify frees. */ static int metaslab_debug = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, + 0, + "Metaslab debugging: when set, keeps all space maps in core to verify frees"); /* * Minimum size which forces the dynamic allocator to change @@ -96,6 +105,11 @@ static int metaslab_debug = 0; * aggressive strategy (i.e search by size rather than offset). */ uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE; +TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold", + &metaslab_df_alloc_threshold); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN, + &metaslab_df_alloc_threshold, 0, + "Minimum size which forces the dynamic allocator to change it's allocation strategy"); /* * The minimum free space, in percent, which must be available @@ -104,22 +118,37 @@ uint64_t metaslab_df_alloc_threshold = S * switch to using best-fit allocations. */ int metaslab_df_free_pct = 4; +TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN, + &metaslab_df_free_pct, 0, + "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion"); /* * A metaslab is considered "free" if it contains a contiguous * segment which is greater than metaslab_min_alloc_size. */ uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; +TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size", + &metaslab_min_alloc_size); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN, + &metaslab_min_alloc_size, 0, + "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* * Max number of space_maps to prefetch. */ int metaslab_prefetch_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, + &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); /* * Percentage bonus multiplier for metaslabs that are in the bonus area. */ int metaslab_smo_bonus_pct = 150; +TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, + &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); /* * Should we be willing to write data to degraded vdevs? From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 15:57:17 2014 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 ESMTPS id 93598AB; Mon, 17 Feb 2014 15:57:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DBC31143; Mon, 17 Feb 2014 15:57:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFvHBN022129; Mon, 17 Feb 2014 15:57:17 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFvHDv022128; Mon, 17 Feb 2014 15:57:17 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402171557.s1HFvHDv022128@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 15:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262075 - stable/10/usr.sbin/newsyslog X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 15:57:17 -0000 Author: bdrewery Date: Mon Feb 17 15:57:16 2014 New Revision: 262075 URL: http://svnweb.freebsd.org/changeset/base/262075 Log: MFC r261401: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). Approved by: bapt (mentor, implicit) Modified: stable/10/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 15:51:19 2014 (r262074) +++ stable/10/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 15:57:16 2014 (r262075) @@ -2284,7 +2284,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:07:58 2014 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 ESMTPS id CA638688; Mon, 17 Feb 2014 16:07:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3A44123A; Mon, 17 Feb 2014 16:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HG7wRR026559; Mon, 17 Feb 2014 16:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HG7woK026558; Mon, 17 Feb 2014 16:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402171607.s1HG7woK026558@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 16:07: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: r262076 - stable/9/usr.sbin/newsyslog 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:07:58 -0000 Author: bdrewery Date: Mon Feb 17 16:07:58 2014 New Revision: 262076 URL: http://svnweb.freebsd.org/changeset/base/262076 Log: MFC r261401: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). Approved by: bapt (mentor, implicit) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 15:57:16 2014 (r262075) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 16:07:58 2014 (r262076) @@ -2282,7 +2282,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:17:57 2014 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 ESMTPS id 78F9FDBC; Mon, 17 Feb 2014 16:17:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63537132E; Mon, 17 Feb 2014 16:17:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGHv8B031180; Mon, 17 Feb 2014 16:17:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGHvQn031179; Mon, 17 Feb 2014 16:17:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171617.s1HGHvQn031179@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:17:57 +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: r262077 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:17:57 -0000 Author: avg Date: Mon Feb 17 16:17:56 2014 New Revision: 262077 URL: http://svnweb.freebsd.org/changeset/base/262077 Log: MFC r253441: Manually merge part of vendor import r238583 from Illumos Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.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/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:07:58 2014 (r262076) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:17:56 2014 (r262077) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (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); } vd->vdev_max_asize = max_asize; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:18:05 2014 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 ESMTPS id 8B173EE3; Mon, 17 Feb 2014 16:18:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76FEE1332; Mon, 17 Feb 2014 16:18:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGI5wq031252; Mon, 17 Feb 2014 16:18:05 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGI5iT031251; Mon, 17 Feb 2014 16:18:05 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402171618.s1HGI5iT031251@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 16:18:05 +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: r262078 - stable/8/usr.sbin/newsyslog 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:18:05 -0000 Author: bdrewery Date: Mon Feb 17 16:18:04 2014 New Revision: 262078 URL: http://svnweb.freebsd.org/changeset/base/262078 Log: MFC r261401: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). Approved by: bapt (mentor, implicit) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 16:17:56 2014 (r262077) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 16:18:04 2014 (r262078) @@ -2248,7 +2248,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:18:14 2014 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 ESMTPS id 6E09AFC8; Mon, 17 Feb 2014 16:18:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 591601334; Mon, 17 Feb 2014 16:18:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGIEON031308; Mon, 17 Feb 2014 16:18:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGIEAA031307; Mon, 17 Feb 2014 16:18:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171618.s1HGIEAA031307@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:18: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: r262079 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:18:14 -0000 Author: avg Date: Mon Feb 17 16:18:13 2014 New Revision: 262079 URL: http://svnweb.freebsd.org/changeset/base/262079 Log: MFC r253441: Manually merge part of vendor import r238583 from Illumos Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.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/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:18:04 2014 (r262078) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:18:13 2014 (r262079) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (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); } vd->vdev_max_asize = max_asize; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:30:06 2014 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 ESMTPS id 11D1B471; Mon, 17 Feb 2014 16:30:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFDDC1451; Mon, 17 Feb 2014 16:30:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGU5Wi035607; Mon, 17 Feb 2014 16:30:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGU1nN035561; Mon, 17 Feb 2014 16:30:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171630.s1HGU1nN035561@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:30: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: r262080 - in stable/8/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:30:06 -0000 Author: avg Date: Mon Feb 17 16:30:01 2014 New Revision: 262080 URL: http://svnweb.freebsd.org/changeset/base/262080 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Note: on this branch the commit is adjusted for absence of U64 type support in sysctl infrastructure. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h 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/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:30:01 2014 (r262080) @@ -5167,7 +5167,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 */ @@ -5407,6 +5407,8 @@ l2arc_add_vdev(spa_t *spa, vdev_t *vd) ASSERT(!l2arc_vdev_present(vd)); + vdev_ashift_optimize(vd); + /* * Create a new l2arc device entry. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:30:01 2014 (r262080) @@ -226,6 +226,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) { @@ -250,6 +271,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 @@ -389,6 +416,7 @@ metaslab_group_activate(metaslab_group_t mgnext->mg_prev = mg; } mc->mc_rotor = mg; + metaslab_class_minblocksize_update(mc); } void @@ -420,6 +448,7 @@ metaslab_group_passivate(metaslab_group_ mg->mg_prev = NULL; mg->mg_next = NULL; + metaslab_class_minblocksize_update(mc); } static void Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:30:01 2014 (r262080) @@ -3500,6 +3500,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:30:01 2014 (r262080) @@ -506,8 +506,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:30:01 2014 (r262080) @@ -50,6 +50,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:30:01 2014 (r262080) @@ -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); @@ -133,6 +133,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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_quad(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_QUAD | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_vfs_zfs_max_auto_ashift, "Q", + "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) { @@ -2503,6 +2578,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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; @@ -132,7 +132,8 @@ skip_open: } *max_psize = *psize = vattr.va_size; - *ashift = SPA_MINBLOCKSHIFT; + *logical_ashift = SPA_MINBLOCKSHIFT; + *physical_ashift = SPA_MINBLOCKSHIFT; return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:01 2014 (r262080) @@ -1091,8 +1091,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:30:01 2014 (r262080) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:30:01 2014 (r262080) @@ -620,7 +620,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; /* @@ -714,7 +715,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 Mon Feb 17 16:30:23 2014 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 ESMTPS id 2E3895B6; Mon, 17 Feb 2014 16:30:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1549614C5; Mon, 17 Feb 2014 16:30:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGUN3f035981; Mon, 17 Feb 2014 16:30:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGUINE035956; Mon, 17 Feb 2014 16:30:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171630.s1HGUINE035956@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:30:18 +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: r262081 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:30:23 -0000 Author: avg Date: Mon Feb 17 16:30:18 2014 New Revision: 262081 URL: http://svnweb.freebsd.org/changeset/base/262081 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h 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/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:30:18 2014 (r262081) @@ -5197,7 +5197,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 */ @@ -5437,6 +5437,8 @@ l2arc_add_vdev(spa_t *spa, vdev_t *vd) ASSERT(!l2arc_vdev_present(vd)); + vdev_ashift_optimize(vd); + /* * Create a new l2arc device entry. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:30:18 2014 (r262081) @@ -226,6 +226,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) { @@ -250,6 +271,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 @@ -389,6 +416,7 @@ metaslab_group_activate(metaslab_group_t mgnext->mg_prev = mg; } mc->mc_rotor = mg; + metaslab_class_minblocksize_update(mc); } void @@ -420,6 +448,7 @@ metaslab_group_passivate(metaslab_group_ mg->mg_prev = NULL; mg->mg_next = NULL; + metaslab_class_minblocksize_update(mc); } static void Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:30:18 2014 (r262081) @@ -3505,6 +3505,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:30:18 2014 (r262081) @@ -514,8 +514,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:30:18 2014 (r262081) @@ -50,6 +50,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:30:18 2014 (r262081) @@ -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); @@ -133,6 +133,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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) { @@ -2511,6 +2586,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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; @@ -132,7 +132,8 @@ skip_open: } *max_psize = *psize = vattr.va_size; - *ashift = SPA_MINBLOCKSHIFT; + *logical_ashift = SPA_MINBLOCKSHIFT; + *physical_ashift = SPA_MINBLOCKSHIFT; return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:18 2014 (r262081) @@ -1092,8 +1092,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:30:18 2014 (r262081) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:30:18 2014 (r262081) @@ -620,7 +620,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; /* @@ -714,7 +715,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 Mon Feb 17 16:33:18 2014 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 ESMTPS id C1E77752; Mon, 17 Feb 2014 16:33:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA6EE1504; Mon, 17 Feb 2014 16:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGXIGr038709; Mon, 17 Feb 2014 16:33:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGXIo5038706; Mon, 17 Feb 2014 16:33:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171633.s1HGXIo5038706@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:33:18 +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: r262082 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:33:18 -0000 Author: avg Date: Mon Feb 17 16:33:17 2014 New Revision: 262082 URL: http://svnweb.freebsd.org/changeset/base/262082 Log: MFC r252840: 3836 zio_free() can be processed immediately in the common case MFC slacker: mm Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.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/sys/zio_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:30:18 2014 (r262081) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:33:17 2014 (r262082) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _ZIO_IMPL_H @@ -38,7 +38,7 @@ extern "C" { #endif /* - * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * XXX -- Describe ZFS I/O pipeline here. Fill in as needed. * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct @@ -213,7 +213,6 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE | \ ZIO_STAGE_VDEV_IO_START | \ ZIO_STAGE_VDEV_IO_ASSESS) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:18 2014 (r262081) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:33:17 2014 (r262082) @@ -740,7 +740,21 @@ void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) { metaslab_check_free(spa, bp); - bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + + /* + * Frees that are for the currently-syncing txg, are not going to be + * deferred, and which will not need to do a read (i.e. not GANG or + * DEDUP), can be processed immediately. Otherwise, put them on the + * in-memory list for later processing. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + txg != spa->spa_syncing_txg || + spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + } else { + VERIFY0(zio_wait(zio_free_sync(NULL, spa, txg, bp, + BP_GET_PSIZE(bp), 0))); + } } zio_t * @@ -748,6 +762,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui uint64_t size, enum zio_flag flags) { zio_t *zio; + enum zio_stage stage = ZIO_FREE_PIPELINE; dprintf_bp(bp, "freeing in txg %llu, pass %u", (longlong_t)txg, spa->spa_sync_pass); @@ -759,9 +774,17 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); arc_freed(spa, bp); + /* + * GANG and DEDUP blocks can induce a read (for the gang block header, + * or the DDT), so issue them asynchronously so that this thread is + * not tied up. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + stage |= ZIO_STAGE_ISSUE_ASYNC; + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags, - NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); + NULL, 0, NULL, ZIO_STAGE_OPEN, stage); return (zio); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:33:43 2014 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 ESMTPS id B31B888C; Mon, 17 Feb 2014 16:33:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBAB150D; Mon, 17 Feb 2014 16:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGXhgW038789; Mon, 17 Feb 2014 16:33:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGXhBG038787; Mon, 17 Feb 2014 16:33:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171633.s1HGXhBG038787@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:33: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: r262083 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:33:43 -0000 Author: avg Date: Mon Feb 17 16:33:42 2014 New Revision: 262083 URL: http://svnweb.freebsd.org/changeset/base/262083 Log: MFC r252840: 3836 zio_free() can be processed immediately in the common case MFC slacker: mm Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.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/sys/zio_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:33:17 2014 (r262082) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:33:42 2014 (r262083) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _ZIO_IMPL_H @@ -38,7 +38,7 @@ extern "C" { #endif /* - * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * XXX -- Describe ZFS I/O pipeline here. Fill in as needed. * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct @@ -213,7 +213,6 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE | \ ZIO_STAGE_VDEV_IO_START | \ ZIO_STAGE_VDEV_IO_ASSESS) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:33:17 2014 (r262082) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:33:42 2014 (r262083) @@ -740,7 +740,21 @@ void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) { metaslab_check_free(spa, bp); - bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + + /* + * Frees that are for the currently-syncing txg, are not going to be + * deferred, and which will not need to do a read (i.e. not GANG or + * DEDUP), can be processed immediately. Otherwise, put them on the + * in-memory list for later processing. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + txg != spa->spa_syncing_txg || + spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + } else { + VERIFY0(zio_wait(zio_free_sync(NULL, spa, txg, bp, + BP_GET_PSIZE(bp), 0))); + } } zio_t * @@ -748,6 +762,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui uint64_t size, enum zio_flag flags) { zio_t *zio; + enum zio_stage stage = ZIO_FREE_PIPELINE; dprintf_bp(bp, "freeing in txg %llu, pass %u", (longlong_t)txg, spa->spa_sync_pass); @@ -758,9 +773,17 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); + /* + * GANG and DEDUP blocks can induce a read (for the gang block header, + * or the DDT), so issue them asynchronously so that this thread is + * not tied up. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + stage |= ZIO_STAGE_ISSUE_ASYNC; + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags, - NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); + NULL, 0, NULL, ZIO_STAGE_OPEN, stage); return (zio); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:41:46 2014 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 ESMTPS id DC27015E; Mon, 17 Feb 2014 16:41:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD6D415FA; Mon, 17 Feb 2014 16:41:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGfkpG043037; Mon, 17 Feb 2014 16:41:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGfkkn043035; Mon, 17 Feb 2014 16:41:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171641.s1HGfkkn043035@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:41:46 +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: r262084 - in stable/9: cddl/contrib/opensolaris/cmd/ztest 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:41:46 -0000 Author: avg Date: Mon Feb 17 16:41:45 2014 New Revision: 262084 URL: http://svnweb.freebsd.org/changeset/base/262084 Log: MFC r254077: MFV r254071: Fix a regression introduced by fix for Illumos bug #3834 Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:33:42 2014 (r262083) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:41:45 2014 (r262084) @@ -3607,6 +3607,9 @@ ztest_dmu_read_write(ztest_ds_t *zd, uin else dmu_tx_hold_write(tx, bigobj, bigoff, bigsize); + /* This accounts for setting the checksum/compression. */ + dmu_tx_hold_bonus(tx, bigobj); + txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG); if (txg == 0) { umem_free(packbuf, packsize); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:33:42 2014 (r262083) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:41:45 2014 (r262084) @@ -449,12 +449,12 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui blkid = off >> dn->dn_datablkshift; nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift; - if (blkid >= dn->dn_maxblkid) { + if (blkid > dn->dn_maxblkid) { rw_exit(&dn->dn_struct_rwlock); return; } if (blkid + nblks > dn->dn_maxblkid) - nblks = dn->dn_maxblkid - blkid; + nblks = dn->dn_maxblkid - blkid + 1; } l0span = nblks; /* save for later use to calc level > 1 overhead */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:41:59 2014 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 ESMTPS id 17A052CB; Mon, 17 Feb 2014 16:41:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBC751606; Mon, 17 Feb 2014 16:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGfwOS043092; Mon, 17 Feb 2014 16:41:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGfwB7043090; Mon, 17 Feb 2014 16:41:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171641.s1HGfwB7043090@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:41:58 +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: r262085 - in stable/8: cddl/contrib/opensolaris/cmd/ztest 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:41:59 -0000 Author: avg Date: Mon Feb 17 16:41:58 2014 New Revision: 262085 URL: http://svnweb.freebsd.org/changeset/base/262085 Log: MFC r254077: MFV r254071: Fix a regression introduced by fix for Illumos bug #3834 Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:41:45 2014 (r262084) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:41:58 2014 (r262085) @@ -3607,6 +3607,9 @@ ztest_dmu_read_write(ztest_ds_t *zd, uin else dmu_tx_hold_write(tx, bigobj, bigoff, bigsize); + /* This accounts for setting the checksum/compression. */ + dmu_tx_hold_bonus(tx, bigobj); + txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG); if (txg == 0) { umem_free(packbuf, packsize); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:41:45 2014 (r262084) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:41:58 2014 (r262085) @@ -449,12 +449,12 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui blkid = off >> dn->dn_datablkshift; nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift; - if (blkid >= dn->dn_maxblkid) { + if (blkid > dn->dn_maxblkid) { rw_exit(&dn->dn_struct_rwlock); return; } if (blkid + nblks > dn->dn_maxblkid) - nblks = dn->dn_maxblkid - blkid; + nblks = dn->dn_maxblkid - blkid + 1; } l0span = nblks; /* save for later use to calc level > 1 overhead */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:46:25 2014 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 ESMTPS id 7E4BD469; Mon, 17 Feb 2014 16:46:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 655231634; Mon, 17 Feb 2014 16:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGkPpK043740; Mon, 17 Feb 2014 16:46:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGkNO5043725; Mon, 17 Feb 2014 16:46:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171646.s1HGkNO5043725@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:46:23 +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: r262086 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:46:25 -0000 Author: avg Date: Mon Feb 17 16:46:23 2014 New Revision: 262086 URL: http://svnweb.freebsd.org/changeset/base/262086 Log: MFC r254112: MFV r254079: multiple ZFS issues Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h 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/dsl_scan.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:46:23 2014 (r262086) @@ -224,6 +224,7 @@ dsl_scan_setup_sync(void *arg, dmu_tx_t scn->scn_phys.scn_errors = 0; scn->scn_phys.scn_to_examine = spa->spa_root_vdev->vdev_stat.vs_alloc; scn->scn_restart_txg = 0; + scn->scn_done_txg = 0; spa_scan_stat_init(spa); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { @@ -800,7 +801,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbo * Don't scan it now unless we need to because something * under it was modified. */ - if (bp->blk_birth <= scn->scn_phys.scn_cur_max_txg) { + if (BP_PHYSICAL_BIRTH(bp) <= scn->scn_phys.scn_cur_max_txg) { scan_funcs[scn->scn_phys.scn_func](dp, bp, zb); } if (buf) @@ -1245,7 +1246,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { if (ddp->ddp_phys_birth == 0 || - ddp->ddp_phys_birth > scn->scn_phys.scn_cur_max_txg) + ddp->ddp_phys_birth > scn->scn_phys.scn_max_txg) continue; ddt_bp_create(checksum, ddk, ddp, &bp); @@ -1488,6 +1489,16 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (scn->scn_phys.scn_state != DSS_SCANNING) return; + if (scn->scn_done_txg == tx->tx_txg) { + ASSERT(!scn->scn_pausing); + /* finished with scan. */ + zfs_dbgmsg("txg %llu scan complete", tx->tx_txg); + dsl_scan_done(scn, B_TRUE, tx); + ASSERT3U(spa->spa_scrub_inflight, ==, 0); + dsl_scan_sync_state(scn, tx); + return; + } + if (scn->scn_phys.scn_ddt_bookmark.ddb_class <= scn->scn_phys.scn_ddt_class_max) { zfs_dbgmsg("doing scan sync txg %llu; " @@ -1523,9 +1534,9 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time)); if (!scn->scn_pausing) { - /* finished with scan. */ - zfs_dbgmsg("finished scan txg %llu", (longlong_t)tx->tx_txg); - dsl_scan_done(scn, B_TRUE, tx); + scn->scn_done_txg = tx->tx_txg + 1; + zfs_dbgmsg("txg %llu traversal complete, waiting till txg %llu", + tx->tx_txg, scn->scn_done_txg); } if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:46:23 2014 (r262086) @@ -4715,7 +4715,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui } /* mark the device being resilvered */ - newvd->vdev_resilvering = B_TRUE; + newvd->vdev_resilver_txg = txg; /* * If the parent is not a mirror, or if we're replacing, insert the new @@ -5579,13 +5579,6 @@ spa_vdev_resilver_done_hunt(vdev_t *vd) return (oldvd); } - if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) && - vdev_dtl_empty(vd, DTL_OUTAGE)) { - ASSERT(vd->vdev_ops->vdev_op_leaf); - vd->vdev_resilvering = B_FALSE; - vdev_config_dirty(vd->vdev_top); - } - /* * Check for a completed replacement. We always consider the first * vdev in the list to be the oldest vdev, and the last one to be @@ -5675,6 +5668,8 @@ spa_vdev_resilver_done(spa_t *spa) ASSERT(pvd->vdev_ops == &vdev_replacing_ops); sguid = ppvd->vdev_child[1]->vdev_guid; } + ASSERT(vd->vdev_resilver_txg == 0 || !vdev_dtl_required(vd)); + spa_config_exit(spa, SCL_ALL, FTAG); if (spa_vdev_detach(spa, guid, pguid, B_TRUE) != 0) return; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:46:23 2014 (r262086) @@ -22,7 +22,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 by Delphix. All rights reserved. */ #include @@ -196,7 +196,12 @@ spa_config_write(spa_config_dirent_t *dp /* * Synchronize pool configuration to disk. This must be called with the - * namespace lock held. + * namespace lock held. Synchronizing the pool cache is typically done after + * the configuration has been synced to the MOS. This exposes a window where + * the MOS config will have been updated but the cache file has not. If + * the system were to crash at that instant then the cached config may not + * contain the correct information to open the pool and an explicity import + * would be required. */ void spa_config_sync(spa_t *target, boolean_t removing, boolean_t postsysevent) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:46:23 2014 (r262086) @@ -72,11 +72,42 @@ typedef enum dsl_scan_flags { DSF_VISIT_DS_AGAIN = 1<<0, } dsl_scan_flags_t; +/* + * Every pool will have one dsl_scan_t and this structure will contain + * in-memory information about the scan and a pointer to the on-disk + * representation (i.e. dsl_scan_phys_t). Most of the state of the scan + * is contained on-disk to allow the scan to resume in the event of a reboot + * or panic. This structure maintains information about the behavior of a + * running scan, some caching information, and how it should traverse the pool. + * + * The following members of this structure direct the behavior of the scan: + * + * scn_pausing - a scan that cannot be completed in a single txg or + * has exceeded its allotted time will need to pause. + * When this flag is set the scanner will stop traversing + * the pool and write out the current state to disk. + * + * scn_restart_txg - directs the scanner to either restart or start a + * a scan at the specified txg value. + * + * scn_done_txg - when a scan completes its traversal it will set + * the completion txg to the next txg. This is necessary + * to ensure that any blocks that were freed during + * the scan but have not yet been processed (i.e deferred + * frees) are accounted for. + * + * This structure also maintains information about deferred frees which are + * a special kind of traversal. Deferred free can exist in either a bptree or + * a bpobj structure. The scn_is_bptree flag will indicate the type of + * deferred free that is in progress. If the deferred free is part of an + * asynchronous destroy then the scn_async_destroying flag will be set. + */ typedef struct dsl_scan { struct dsl_pool *scn_dp; boolean_t scn_pausing; uint64_t scn_restart_txg; + uint64_t scn_done_txg; uint64_t scn_sync_start_time; zio_t *scn_zio_root; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:46:23 2014 (r262086) @@ -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_VDEV_IMPL_H @@ -201,7 +201,7 @@ struct vdev { uint64_t vdev_faulted; /* persistent faulted state */ uint64_t vdev_degraded; /* persistent degraded state */ uint64_t vdev_removed; /* persistent removed state */ - uint64_t vdev_resilvering; /* persistent resilvering state */ + uint64_t vdev_resilver_txg; /* persistent resilvering state */ uint64_t vdev_nparity; /* number of parity devices for raidz */ char *vdev_path; /* vdev path (if any) */ char *vdev_devid; /* vdev devid (if any) */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:46:23 2014 (r262086) @@ -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_ZFS_DEBUG_H @@ -79,6 +79,7 @@ typedef struct zfs_dbgmsg { extern void zfs_dbgmsg_init(void); extern void zfs_dbgmsg_fini(void); extern void zfs_dbgmsg(const char *fmt, ...); +extern void zfs_dbgmsg_print(const char *tag); #ifdef illumos #ifndef _KERNEL Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:46:23 2014 (r262086) @@ -573,8 +573,8 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_OFFLINE, &vd->vdev_offline); - (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVERING, - &vd->vdev_resilvering); + (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + &vd->vdev_resilver_txg); /* * When importing a pool, we want to ignore the persistent fault @@ -1753,6 +1753,75 @@ vdev_dtl_empty(vdev_t *vd, vdev_dtl_type } /* + * Returns the lowest txg in the DTL range. + */ +static uint64_t +vdev_dtl_min(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_start - 1); +} + +/* + * Returns the highest txg in the DTL. + */ +static uint64_t +vdev_dtl_max(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_end); +} + +/* + * Determine if a resilvering vdev should remove any DTL entries from + * its range. If the vdev was resilvering for the entire duration of the + * scan then it should excise that range from its DTLs. Otherwise, this + * vdev is considered partially resilvered and should leave its DTL + * entries intact. The comment in vdev_dtl_reassess() describes how we + * excise the DTLs. + */ +static boolean_t +vdev_dtl_should_excise(vdev_t *vd) +{ + spa_t *spa = vd->vdev_spa; + dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; + + ASSERT0(scn->scn_phys.scn_errors); + ASSERT0(vd->vdev_children); + + if (vd->vdev_resilver_txg == 0 || + vd->vdev_dtl[DTL_MISSING].sm_space == 0) + return (B_TRUE); + + /* + * When a resilver is initiated the scan will assign the scn_max_txg + * value to the highest txg value that exists in all DTLs. If this + * device's max DTL is not part of this scan (i.e. it is not in + * the range (scn_min_txg, scn_max_txg] then it is not eligible + * for excision. + */ + if (vdev_dtl_max(vd) <= scn->scn_phys.scn_max_txg) { + ASSERT3U(scn->scn_phys.scn_min_txg, <=, vdev_dtl_min(vd)); + ASSERT3U(scn->scn_phys.scn_min_txg, <, vd->vdev_resilver_txg); + ASSERT3U(vd->vdev_resilver_txg, <=, scn->scn_phys.scn_max_txg); + return (B_TRUE); + } + return (B_FALSE); +} + +/* * Reassess DTLs after a config change or scrub completion. */ void @@ -1775,9 +1844,17 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; mutex_enter(&vd->vdev_dtl_lock); + + /* + * If we've completed a scan cleanly then determine + * if this vdev should remove any DTLs. We only want to + * excise regions on vdevs that were available during + * the entire duration of this scan. + */ if (scrub_txg != 0 && (spa->spa_scrub_started || - (scn && scn->scn_phys.scn_errors == 0))) { + (scn != NULL && scn->scn_phys.scn_errors == 0)) && + vdev_dtl_should_excise(vd)) { /* * We completed a scrub up to scrub_txg. If we * did it without rebooting, then the scrub dtl @@ -1816,6 +1893,16 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t else space_map_walk(&vd->vdev_dtl[DTL_MISSING], space_map_add, &vd->vdev_dtl[DTL_OUTAGE]); + + /* + * If the vdev was resilvering and no longer has any + * DTLs then reset its resilvering flag. + */ + if (vd->vdev_resilver_txg != 0 && + vd->vdev_dtl[DTL_MISSING].sm_space == 0 && + vd->vdev_dtl[DTL_OUTAGE].sm_space == 0) + vd->vdev_resilver_txg = 0; + mutex_exit(&vd->vdev_dtl_lock); if (txg != 0) @@ -1993,12 +2080,9 @@ vdev_resilver_needed(vdev_t *vd, uint64_ mutex_enter(&vd->vdev_dtl_lock); if (vd->vdev_dtl[DTL_MISSING].sm_space != 0 && vdev_writeable(vd)) { - space_seg_t *ss; - ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismin = ss->ss_start - 1; - ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismax = ss->ss_end; + thismin = vdev_dtl_min(vd); + thismax = vdev_dtl_max(vd); needed = B_TRUE; } mutex_exit(&vd->vdev_dtl_lock); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:46:23 2014 (r262086) @@ -222,30 +222,25 @@ vdev_config_generate(spa_t *spa, vdev_t { nvlist_t *nv = NULL; - VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); + nv = fnvlist_alloc(); - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_TYPE, - vd->vdev_ops->vdev_op_type) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_TYPE, vd->vdev_ops->vdev_op_type); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE))) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id) - == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid); if (vd->vdev_path != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PATH, - vd->vdev_path) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PATH, vd->vdev_path); if (vd->vdev_devid != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, - vd->vdev_devid) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_DEVID, vd->vdev_devid); if (vd->vdev_physpath != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, - vd->vdev_physpath) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, + vd->vdev_physpath); if (vd->vdev_fru != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_FRU, - vd->vdev_fru) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_FRU, vd->vdev_fru); if (vd->vdev_nparity != 0) { ASSERT(strcmp(vd->vdev_ops->vdev_op_type, @@ -266,59 +261,54 @@ vdev_config_generate(spa_t *spa, vdev_t * that only support a single parity device -- older software * will just ignore it. */ - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, - vd->vdev_nparity) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, vd->vdev_nparity); } if (vd->vdev_wholedisk != -1ULL) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, - vd->vdev_wholedisk) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, + vd->vdev_wholedisk); if (vd->vdev_not_present) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1); if (vd->vdev_isspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE)) && vd == vd->vdev_top) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, - vd->vdev_ms_array) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, - vd->vdev_ms_shift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, - vd->vdev_ashift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, - vd->vdev_asize) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, - vd->vdev_islog) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, + vd->vdev_ms_array); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, + vd->vdev_ms_shift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, vd->vdev_ashift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, + vd->vdev_asize); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, vd->vdev_islog); if (vd->vdev_removing) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, - vd->vdev_removing) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, + vd->vdev_removing); } if (vd->vdev_dtl_smo.smo_object != 0) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, - vd->vdev_dtl_smo.smo_object) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, + vd->vdev_dtl_smo.smo_object); if (vd->vdev_crtxg) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, - vd->vdev_crtxg) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); if (getstats) { vdev_stat_t vs; pool_scan_stat_t ps; vdev_get_stats(vd, &vs); - VERIFY(nvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)) == 0); + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, + (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)); /* provide either current or previous scan information */ if (spa_scan_get_stats(spa, &ps) == 0) { - VERIFY(nvlist_add_uint64_array(nv, + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, (uint64_t *)&ps, - sizeof (pool_scan_stat_t) / sizeof (uint64_t)) - == 0); + sizeof (pool_scan_stat_t) / sizeof (uint64_t)); } } @@ -348,8 +338,8 @@ vdev_config_generate(spa_t *spa, vdev_t } if (idx) { - VERIFY(nvlist_add_nvlist_array(nv, - ZPOOL_CONFIG_CHILDREN, child, idx) == 0); + fnvlist_add_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, + child, idx); } for (c = 0; c < idx; c++) @@ -361,26 +351,20 @@ vdev_config_generate(spa_t *spa, vdev_t const char *aux = NULL; if (vd->vdev_offline && !vd->vdev_tmpoffline) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, - B_TRUE) == 0); - if (vd->vdev_resilvering) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVERING, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, B_TRUE); + if (vd->vdev_resilver_txg != 0) + fnvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + vd->vdev_resilver_txg); if (vd->vdev_faulted) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, B_TRUE); if (vd->vdev_degraded) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, B_TRUE); if (vd->vdev_removed) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, B_TRUE); if (vd->vdev_unspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, B_TRUE); if (vd->vdev_ishole) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, B_TRUE); switch (vd->vdev_stat.vs_aux) { case VDEV_AUX_ERR_EXCEEDED: @@ -393,12 +377,11 @@ vdev_config_generate(spa_t *spa, vdev_t } if (aux != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, - aux) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, aux); if (vd->vdev_splitting && vd->vdev_orig_guid != 0LL) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, - vd->vdev_orig_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, + vd->vdev_orig_guid); } } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:46:23 2014 (r262086) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 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. */ #include @@ -94,3 +94,16 @@ zfs_dbgmsg(const char *fmt, ...) } mutex_exit(&zfs_dbgmsgs_lock); } + +void +zfs_dbgmsg_print(const char *tag) +{ + zfs_dbgmsg_t *zdm; + + (void) printf("ZFS_DBGMSG(%s):\n", tag); + mutex_enter(&zfs_dbgmsgs_lock); + for (zdm = list_head(&zfs_dbgmsgs); zdm; + zdm = list_next(&zfs_dbgmsgs, zdm)) + (void) printf("%s\n", zdm->zdm_msg); + mutex_exit(&zfs_dbgmsgs_lock); +} Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:46:23 2014 (r262086) @@ -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. * Copyright (c) 2012, Martin Matuska . All rights reserved. @@ -523,7 +523,7 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_SPLIT_GUID "split_guid" #define ZPOOL_CONFIG_SPLIT_LIST "guid_list" #define ZPOOL_CONFIG_REMOVING "removing" -#define ZPOOL_CONFIG_RESILVERING "resilvering" +#define ZPOOL_CONFIG_RESILVER_TXG "resilver_txg" #define ZPOOL_CONFIG_COMMENT "comment" #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */ #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:47:59 2014 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 ESMTPS id 81B6B5E0; Mon, 17 Feb 2014 16:47:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E428164F; Mon, 17 Feb 2014 16:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGlxvD043946; Mon, 17 Feb 2014 16:47:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGlxj4043945; Mon, 17 Feb 2014 16:47:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171647.s1HGlxj4043945@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:47:59 +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: r262087 - stable/9/cddl/contrib/opensolaris/cmd/ztest 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:47:59 -0000 Author: avg Date: Mon Feb 17 16:47:58 2014 New Revision: 262087 URL: http://svnweb.freebsd.org/changeset/base/262087 Log: MFC r254112: MFV r254079: multiple ZFS issues Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:46:23 2014 (r262086) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:47:58 2014 (r262087) @@ -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. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -769,6 +769,16 @@ ztest_kill(ztest_shared_t *zs) { zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa)); + + /* + * Before we kill off ztest, make sure that the config is updated. + * See comment above spa_config_sync(). + */ + mutex_enter(&spa_namespace_lock); + spa_config_sync(ztest_spa, B_FALSE, B_FALSE); + mutex_exit(&spa_namespace_lock); + + zfs_dbgmsg_print(FTAG); (void) kill(getpid(), SIGKILL); } @@ -2733,7 +2743,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t leaf, top; uint64_t ashift = ztest_get_ashift(); uint64_t oldguid, pguid; - size_t oldsize, newsize; + uint64_t oldsize, newsize; char oldpath[MAXPATHLEN], newpath[MAXPATHLEN]; int replacing; int oldvd_has_siblings = B_FALSE; @@ -2892,8 +2902,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, if (error != expected_error && expected_error != EBUSY) { fatal(0, "attach (%s %llu, %s %llu, %d) " "returned %d, expected %d", - oldpath, (longlong_t)oldsize, newpath, - (longlong_t)newsize, replacing, error, expected_error); + oldpath, oldsize, newpath, + newsize, replacing, error, expected_error); } VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); @@ -4803,7 +4813,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 */ if (vd0 != NULL && maxfaults != 1 && (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) || - vd0->vdev_resilvering)) { + vd0->vdev_resilver_txg != 0)) { /* * Make vd0 explicitly claim to be unreadable, * or unwriteable, or reach behind its back @@ -5654,6 +5664,7 @@ ztest_run(ztest_shared_t *zs) zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(spa)); + zfs_dbgmsg_print(FTAG); umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t)); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 16:48:13 2014 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 ESMTPS id E3B9770F; Mon, 17 Feb 2014 16:48:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C999E1651; Mon, 17 Feb 2014 16:48:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGmDSu044049; Mon, 17 Feb 2014 16:48:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGmB3b044033; Mon, 17 Feb 2014 16:48:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171648.s1HGmB3b044033@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:48:11 +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: r262088 - in stable/8: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/cddl/contrib/opensolaris/... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 16:48:14 -0000 Author: avg Date: Mon Feb 17 16:48:11 2014 New Revision: 262088 URL: http://svnweb.freebsd.org/changeset/base/262088 Log: MFC r254112: MFV r254079: multiple ZFS issues Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:48:11 2014 (r262088) @@ -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. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -769,6 +769,16 @@ ztest_kill(ztest_shared_t *zs) { zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa)); + + /* + * Before we kill off ztest, make sure that the config is updated. + * See comment above spa_config_sync(). + */ + mutex_enter(&spa_namespace_lock); + spa_config_sync(ztest_spa, B_FALSE, B_FALSE); + mutex_exit(&spa_namespace_lock); + + zfs_dbgmsg_print(FTAG); (void) kill(getpid(), SIGKILL); } @@ -2733,7 +2743,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t leaf, top; uint64_t ashift = ztest_get_ashift(); uint64_t oldguid, pguid; - size_t oldsize, newsize; + uint64_t oldsize, newsize; char oldpath[MAXPATHLEN], newpath[MAXPATHLEN]; int replacing; int oldvd_has_siblings = B_FALSE; @@ -2892,8 +2902,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, if (error != expected_error && expected_error != EBUSY) { fatal(0, "attach (%s %llu, %s %llu, %d) " "returned %d, expected %d", - oldpath, (longlong_t)oldsize, newpath, - (longlong_t)newsize, replacing, error, expected_error); + oldpath, oldsize, newpath, + newsize, replacing, error, expected_error); } VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); @@ -4803,7 +4813,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 */ if (vd0 != NULL && maxfaults != 1 && (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) || - vd0->vdev_resilvering)) { + vd0->vdev_resilver_txg != 0)) { /* * Make vd0 explicitly claim to be unreadable, * or unwriteable, or reach behind its back @@ -5654,6 +5664,7 @@ ztest_run(ztest_shared_t *zs) zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(spa)); + zfs_dbgmsg_print(FTAG); umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t)); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:48:11 2014 (r262088) @@ -224,6 +224,7 @@ dsl_scan_setup_sync(void *arg, dmu_tx_t scn->scn_phys.scn_errors = 0; scn->scn_phys.scn_to_examine = spa->spa_root_vdev->vdev_stat.vs_alloc; scn->scn_restart_txg = 0; + scn->scn_done_txg = 0; spa_scan_stat_init(spa); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { @@ -800,7 +801,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbo * Don't scan it now unless we need to because something * under it was modified. */ - if (bp->blk_birth <= scn->scn_phys.scn_cur_max_txg) { + if (BP_PHYSICAL_BIRTH(bp) <= scn->scn_phys.scn_cur_max_txg) { scan_funcs[scn->scn_phys.scn_func](dp, bp, zb); } if (buf) @@ -1245,7 +1246,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { if (ddp->ddp_phys_birth == 0 || - ddp->ddp_phys_birth > scn->scn_phys.scn_cur_max_txg) + ddp->ddp_phys_birth > scn->scn_phys.scn_max_txg) continue; ddt_bp_create(checksum, ddk, ddp, &bp); @@ -1488,6 +1489,16 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (scn->scn_phys.scn_state != DSS_SCANNING) return; + if (scn->scn_done_txg == tx->tx_txg) { + ASSERT(!scn->scn_pausing); + /* finished with scan. */ + zfs_dbgmsg("txg %llu scan complete", tx->tx_txg); + dsl_scan_done(scn, B_TRUE, tx); + ASSERT3U(spa->spa_scrub_inflight, ==, 0); + dsl_scan_sync_state(scn, tx); + return; + } + if (scn->scn_phys.scn_ddt_bookmark.ddb_class <= scn->scn_phys.scn_ddt_class_max) { zfs_dbgmsg("doing scan sync txg %llu; " @@ -1523,9 +1534,9 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time)); if (!scn->scn_pausing) { - /* finished with scan. */ - zfs_dbgmsg("finished scan txg %llu", (longlong_t)tx->tx_txg); - dsl_scan_done(scn, B_TRUE, tx); + scn->scn_done_txg = tx->tx_txg + 1; + zfs_dbgmsg("txg %llu traversal complete, waiting till txg %llu", + tx->tx_txg, scn->scn_done_txg); } if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:48:11 2014 (r262088) @@ -4710,7 +4710,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui } /* mark the device being resilvered */ - newvd->vdev_resilvering = B_TRUE; + newvd->vdev_resilver_txg = txg; /* * If the parent is not a mirror, or if we're replacing, insert the new @@ -5574,13 +5574,6 @@ spa_vdev_resilver_done_hunt(vdev_t *vd) return (oldvd); } - if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) && - vdev_dtl_empty(vd, DTL_OUTAGE)) { - ASSERT(vd->vdev_ops->vdev_op_leaf); - vd->vdev_resilvering = B_FALSE; - vdev_config_dirty(vd->vdev_top); - } - /* * Check for a completed replacement. We always consider the first * vdev in the list to be the oldest vdev, and the last one to be @@ -5670,6 +5663,8 @@ spa_vdev_resilver_done(spa_t *spa) ASSERT(pvd->vdev_ops == &vdev_replacing_ops); sguid = ppvd->vdev_child[1]->vdev_guid; } + ASSERT(vd->vdev_resilver_txg == 0 || !vdev_dtl_required(vd)); + spa_config_exit(spa, SCL_ALL, FTAG); if (spa_vdev_detach(spa, guid, pguid, B_TRUE) != 0) return; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:48:11 2014 (r262088) @@ -22,7 +22,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 by Delphix. All rights reserved. */ #include @@ -196,7 +196,12 @@ spa_config_write(spa_config_dirent_t *dp /* * Synchronize pool configuration to disk. This must be called with the - * namespace lock held. + * namespace lock held. Synchronizing the pool cache is typically done after + * the configuration has been synced to the MOS. This exposes a window where + * the MOS config will have been updated but the cache file has not. If + * the system were to crash at that instant then the cached config may not + * contain the correct information to open the pool and an explicity import + * would be required. */ void spa_config_sync(spa_t *target, boolean_t removing, boolean_t postsysevent) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:48:11 2014 (r262088) @@ -72,11 +72,42 @@ typedef enum dsl_scan_flags { DSF_VISIT_DS_AGAIN = 1<<0, } dsl_scan_flags_t; +/* + * Every pool will have one dsl_scan_t and this structure will contain + * in-memory information about the scan and a pointer to the on-disk + * representation (i.e. dsl_scan_phys_t). Most of the state of the scan + * is contained on-disk to allow the scan to resume in the event of a reboot + * or panic. This structure maintains information about the behavior of a + * running scan, some caching information, and how it should traverse the pool. + * + * The following members of this structure direct the behavior of the scan: + * + * scn_pausing - a scan that cannot be completed in a single txg or + * has exceeded its allotted time will need to pause. + * When this flag is set the scanner will stop traversing + * the pool and write out the current state to disk. + * + * scn_restart_txg - directs the scanner to either restart or start a + * a scan at the specified txg value. + * + * scn_done_txg - when a scan completes its traversal it will set + * the completion txg to the next txg. This is necessary + * to ensure that any blocks that were freed during + * the scan but have not yet been processed (i.e deferred + * frees) are accounted for. + * + * This structure also maintains information about deferred frees which are + * a special kind of traversal. Deferred free can exist in either a bptree or + * a bpobj structure. The scn_is_bptree flag will indicate the type of + * deferred free that is in progress. If the deferred free is part of an + * asynchronous destroy then the scn_async_destroying flag will be set. + */ typedef struct dsl_scan { struct dsl_pool *scn_dp; boolean_t scn_pausing; uint64_t scn_restart_txg; + uint64_t scn_done_txg; uint64_t scn_sync_start_time; zio_t *scn_zio_root; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:48:11 2014 (r262088) @@ -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_VDEV_IMPL_H @@ -201,7 +201,7 @@ struct vdev { uint64_t vdev_faulted; /* persistent faulted state */ uint64_t vdev_degraded; /* persistent degraded state */ uint64_t vdev_removed; /* persistent removed state */ - uint64_t vdev_resilvering; /* persistent resilvering state */ + uint64_t vdev_resilver_txg; /* persistent resilvering state */ uint64_t vdev_nparity; /* number of parity devices for raidz */ char *vdev_path; /* vdev path (if any) */ char *vdev_devid; /* vdev devid (if any) */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:48:11 2014 (r262088) @@ -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_ZFS_DEBUG_H @@ -79,6 +79,7 @@ typedef struct zfs_dbgmsg { extern void zfs_dbgmsg_init(void); extern void zfs_dbgmsg_fini(void); extern void zfs_dbgmsg(const char *fmt, ...); +extern void zfs_dbgmsg_print(const char *tag); #ifdef illumos #ifndef _KERNEL Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:48:11 2014 (r262088) @@ -573,8 +573,8 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_OFFLINE, &vd->vdev_offline); - (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVERING, - &vd->vdev_resilvering); + (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + &vd->vdev_resilver_txg); /* * When importing a pool, we want to ignore the persistent fault @@ -1753,6 +1753,75 @@ vdev_dtl_empty(vdev_t *vd, vdev_dtl_type } /* + * Returns the lowest txg in the DTL range. + */ +static uint64_t +vdev_dtl_min(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_start - 1); +} + +/* + * Returns the highest txg in the DTL. + */ +static uint64_t +vdev_dtl_max(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_end); +} + +/* + * Determine if a resilvering vdev should remove any DTL entries from + * its range. If the vdev was resilvering for the entire duration of the + * scan then it should excise that range from its DTLs. Otherwise, this + * vdev is considered partially resilvered and should leave its DTL + * entries intact. The comment in vdev_dtl_reassess() describes how we + * excise the DTLs. + */ +static boolean_t +vdev_dtl_should_excise(vdev_t *vd) +{ + spa_t *spa = vd->vdev_spa; + dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; + + ASSERT0(scn->scn_phys.scn_errors); + ASSERT0(vd->vdev_children); + + if (vd->vdev_resilver_txg == 0 || + vd->vdev_dtl[DTL_MISSING].sm_space == 0) + return (B_TRUE); + + /* + * When a resilver is initiated the scan will assign the scn_max_txg + * value to the highest txg value that exists in all DTLs. If this + * device's max DTL is not part of this scan (i.e. it is not in + * the range (scn_min_txg, scn_max_txg] then it is not eligible + * for excision. + */ + if (vdev_dtl_max(vd) <= scn->scn_phys.scn_max_txg) { + ASSERT3U(scn->scn_phys.scn_min_txg, <=, vdev_dtl_min(vd)); + ASSERT3U(scn->scn_phys.scn_min_txg, <, vd->vdev_resilver_txg); + ASSERT3U(vd->vdev_resilver_txg, <=, scn->scn_phys.scn_max_txg); + return (B_TRUE); + } + return (B_FALSE); +} + +/* * Reassess DTLs after a config change or scrub completion. */ void @@ -1775,9 +1844,17 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; mutex_enter(&vd->vdev_dtl_lock); + + /* + * If we've completed a scan cleanly then determine + * if this vdev should remove any DTLs. We only want to + * excise regions on vdevs that were available during + * the entire duration of this scan. + */ if (scrub_txg != 0 && (spa->spa_scrub_started || - (scn && scn->scn_phys.scn_errors == 0))) { + (scn != NULL && scn->scn_phys.scn_errors == 0)) && + vdev_dtl_should_excise(vd)) { /* * We completed a scrub up to scrub_txg. If we * did it without rebooting, then the scrub dtl @@ -1816,6 +1893,16 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t else space_map_walk(&vd->vdev_dtl[DTL_MISSING], space_map_add, &vd->vdev_dtl[DTL_OUTAGE]); + + /* + * If the vdev was resilvering and no longer has any + * DTLs then reset its resilvering flag. + */ + if (vd->vdev_resilver_txg != 0 && + vd->vdev_dtl[DTL_MISSING].sm_space == 0 && + vd->vdev_dtl[DTL_OUTAGE].sm_space == 0) + vd->vdev_resilver_txg = 0; + mutex_exit(&vd->vdev_dtl_lock); if (txg != 0) @@ -1993,12 +2080,9 @@ vdev_resilver_needed(vdev_t *vd, uint64_ mutex_enter(&vd->vdev_dtl_lock); if (vd->vdev_dtl[DTL_MISSING].sm_space != 0 && vdev_writeable(vd)) { - space_seg_t *ss; - ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismin = ss->ss_start - 1; - ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismax = ss->ss_end; + thismin = vdev_dtl_min(vd); + thismax = vdev_dtl_max(vd); needed = B_TRUE; } mutex_exit(&vd->vdev_dtl_lock); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:48:11 2014 (r262088) @@ -222,30 +222,25 @@ vdev_config_generate(spa_t *spa, vdev_t { nvlist_t *nv = NULL; - VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); + nv = fnvlist_alloc(); - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_TYPE, - vd->vdev_ops->vdev_op_type) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_TYPE, vd->vdev_ops->vdev_op_type); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE))) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id) - == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid); if (vd->vdev_path != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PATH, - vd->vdev_path) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PATH, vd->vdev_path); if (vd->vdev_devid != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, - vd->vdev_devid) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_DEVID, vd->vdev_devid); if (vd->vdev_physpath != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, - vd->vdev_physpath) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, + vd->vdev_physpath); if (vd->vdev_fru != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_FRU, - vd->vdev_fru) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_FRU, vd->vdev_fru); if (vd->vdev_nparity != 0) { ASSERT(strcmp(vd->vdev_ops->vdev_op_type, @@ -266,59 +261,54 @@ vdev_config_generate(spa_t *spa, vdev_t * that only support a single parity device -- older software * will just ignore it. */ - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, - vd->vdev_nparity) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, vd->vdev_nparity); } if (vd->vdev_wholedisk != -1ULL) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, - vd->vdev_wholedisk) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, + vd->vdev_wholedisk); if (vd->vdev_not_present) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1); if (vd->vdev_isspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE)) && vd == vd->vdev_top) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, - vd->vdev_ms_array) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, - vd->vdev_ms_shift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, - vd->vdev_ashift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, - vd->vdev_asize) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, - vd->vdev_islog) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, + vd->vdev_ms_array); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, + vd->vdev_ms_shift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, vd->vdev_ashift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, + vd->vdev_asize); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, vd->vdev_islog); if (vd->vdev_removing) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, - vd->vdev_removing) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, + vd->vdev_removing); } if (vd->vdev_dtl_smo.smo_object != 0) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, - vd->vdev_dtl_smo.smo_object) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, + vd->vdev_dtl_smo.smo_object); if (vd->vdev_crtxg) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, - vd->vdev_crtxg) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); if (getstats) { vdev_stat_t vs; pool_scan_stat_t ps; vdev_get_stats(vd, &vs); - VERIFY(nvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)) == 0); + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, + (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)); /* provide either current or previous scan information */ if (spa_scan_get_stats(spa, &ps) == 0) { - VERIFY(nvlist_add_uint64_array(nv, + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, (uint64_t *)&ps, - sizeof (pool_scan_stat_t) / sizeof (uint64_t)) - == 0); + sizeof (pool_scan_stat_t) / sizeof (uint64_t)); } } @@ -348,8 +338,8 @@ vdev_config_generate(spa_t *spa, vdev_t } if (idx) { - VERIFY(nvlist_add_nvlist_array(nv, - ZPOOL_CONFIG_CHILDREN, child, idx) == 0); + fnvlist_add_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, + child, idx); } for (c = 0; c < idx; c++) @@ -361,26 +351,20 @@ vdev_config_generate(spa_t *spa, vdev_t const char *aux = NULL; if (vd->vdev_offline && !vd->vdev_tmpoffline) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, - B_TRUE) == 0); - if (vd->vdev_resilvering) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVERING, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, B_TRUE); + if (vd->vdev_resilver_txg != 0) + fnvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + vd->vdev_resilver_txg); if (vd->vdev_faulted) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, B_TRUE); if (vd->vdev_degraded) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, B_TRUE); if (vd->vdev_removed) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, B_TRUE); if (vd->vdev_unspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, B_TRUE); if (vd->vdev_ishole) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, B_TRUE); switch (vd->vdev_stat.vs_aux) { case VDEV_AUX_ERR_EXCEEDED: @@ -393,12 +377,11 @@ vdev_config_generate(spa_t *spa, vdev_t } if (aux != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, - aux) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, aux); if (vd->vdev_splitting && vd->vdev_orig_guid != 0LL) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, - vd->vdev_orig_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, + vd->vdev_orig_guid); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:48:11 2014 (r262088) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 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. */ #include @@ -94,3 +94,16 @@ zfs_dbgmsg(const char *fmt, ...) } mutex_exit(&zfs_dbgmsgs_lock); } + +void +zfs_dbgmsg_print(const char *tag) +{ + zfs_dbgmsg_t *zdm; + + (void) printf("ZFS_DBGMSG(%s):\n", tag); + mutex_enter(&zfs_dbgmsgs_lock); + for (zdm = list_head(&zfs_dbgmsgs); zdm; + zdm = list_next(&zfs_dbgmsgs, zdm)) + (void) printf("%s\n", zdm->zdm_msg); + mutex_exit(&zfs_dbgmsgs_lock); +} Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:48:11 2014 (r262088) @@ -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. * Copyright (c) 2012, Martin Matuska . All rights reserved. @@ -523,7 +523,7 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_SPLIT_GUID "split_guid" #define ZPOOL_CONFIG_SPLIT_LIST "guid_list" #define ZPOOL_CONFIG_REMOVING "removing" -#define ZPOOL_CONFIG_RESILVERING "resilvering" +#define ZPOOL_CONFIG_RESILVER_TXG "resilver_txg" #define ZPOOL_CONFIG_COMMENT "comment" #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */ #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:00:49 2014 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 ESMTPS id CEAF69BA; Mon, 17 Feb 2014 17:00:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5327173A; Mon, 17 Feb 2014 17:00:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HH0nmC049981; Mon, 17 Feb 2014 17:00:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HH0k62049959; Mon, 17 Feb 2014 17:00:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171700.s1HH0k62049959@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:00:46 +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: r262089 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/co... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:00:49 -0000 Author: avg Date: Mon Feb 17 17:00:46 2014 New Revision: 262089 URL: http://svnweb.freebsd.org/changeset/base/262089 Log: MFC r255750: MFV r254750: Add support of Illumos dumps on zvol over RAID-Z. Note that this only adds the features. FreeBSD would still need more work to support dumping on zvols. MFC slacker: delphij Added: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h - copied unchanged from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 17:00:46 2014 (r262089) @@ -19,16 +19,16 @@ .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. -.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Bryan Drewery .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd September 20, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -885,14 +885,21 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, .Cm fletcher4 , but this may change in future releases). The value .Cm off -disables integrity checking on user data. Disabling checksums is +disables integrity checking on user data. +The value +.Cm noparity +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 .Em NOT a recommended practice. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4 Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:00:46 2014 (r262089) @@ -19,10 +19,11 @@ .\" .\" 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. .\" .\" $FreeBSD$ .\" -.Dd February 8, 2013 +.Dd September 20, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -229,6 +230,27 @@ feature. At the moment, this operation cannot be reversed. Booting off of .Sy lz4 -compressed root pools is supported. +.It Sy multi_vdev_crash_dump +.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump" +.It GUID Ta com.joyent:multi_vdev_crash_dump +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +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. +.\" TODO: this is not yet supported on FreeBSD. +.\" .Pp +.\" When the +.\" .Sy multi_vdev_crash_dump +.\" feature is set to +.\" .Sy enabled , +.\" the administrator can use the +.\" .Xr dumpon 8 +.\" command to configure a +.\" dump device on a pool comprised of multiple vdevs. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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 @@ -4020,9 +4021,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, @@ -4041,8 +4040,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) @@ -4104,12 +4107,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: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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 @@ -159,4 +160,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: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:00:46 2014 (r262089) @@ -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 @@ -53,6 +54,7 @@ static 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: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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 @@ -2795,7 +2796,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, NULL, dbuf_write_nofill_done, db, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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 @@ -1682,7 +1682,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 17:00:46 2014 (r262089) @@ -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 } Copied: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h (from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Mon Feb 17 17:00:46 2014 (r262089, copy of r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) @@ -0,0 +1,50 @@ +/* + * 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 +#ifdef illumos +#include +#ifdef _KERNEL +#include +#include +#include +#endif +#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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 17:00:46 2014 (r262089) @@ -25,6 +25,7 @@ * Copyright (c) 2012 by Delphix. 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. */ #ifndef _ZIO_H @@ -81,6 +82,7 @@ enum zio_checksum { ZIO_CHECKSUM_FLETCHER_4, ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, + ZIO_CHECKSUM_NOPARITY, ZIO_CHECKSUM_FUNCTIONS }; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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 Joyent, Inc. All rights reserved. */ #include @@ -391,8 +392,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; @@ -640,7 +662,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 17:00:46 2014 (r262089) @@ -22,15 +22,22 @@ /* * 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 +#ifdef illumos +#include +#endif +#include +#include #include #include #include #include +#include /* * Virtual device vector for RAID-Z. @@ -154,6 +161,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. */ @@ -437,14 +446,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, boolean_t dofree, + 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. */ @@ -532,13 +541,13 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT3U(rm->rm_asize - asize, ==, rm->rm_nskip << unit_shift); ASSERT3U(rm->rm_nskip, <=, nparity); - if (zio->io_type != ZIO_TYPE_FREE) { + if (!dofree) { 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 = @@ -570,7 +579,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; @@ -582,8 +591,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); } @@ -993,12 +1000,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 | @@ -1532,6 +1536,154 @@ vdev_raidz_close(vdev_t *vd) vdev_close(vd->vdev_child[c]); } +#ifdef illumos +/* + * 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 ? BIO_READ : BIO_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, B_FALSE, 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); +} +#endif + static uint64_t vdev_raidz_asize(vdev_t *vd, uint64_t psize) { @@ -1584,9 +1736,14 @@ 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, + zio->io_type == ZIO_TYPE_FREE, + 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_FREE) { @@ -1729,6 +1886,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 17:00:46 2014 (r262089) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 17:00:46 2014 (r262089) @@ -24,6 +24,7 @@ * Copyright (c) 2006-2010 Pawel Jakub Dawidek * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -77,9 +79,14 @@ #include #include #include +#include #include #include #include +#include +#include +#include + #include #include "zfs_namecheck.h" @@ -1164,27 +1171,28 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_ #ifdef sun 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)) @@ -1192,19 +1200,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)); } } @@ -1239,7 +1254,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); @@ -1259,6 +1275,7 @@ zvol_strategy(struct bio *bp) rl_t *rl; int error = 0; boolean_t doread = (bp->bio_cmd == BIO_READ); + boolean_t is_dumpified; boolean_t sync; if (zv == NULL) { @@ -1285,7 +1302,13 @@ zvol_strategy(struct bio *bp) return (0); } - sync = !doread && zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; +#ifdef illumos + is_dumpified = zv->zv_flags & ZVOL_DUMPIFIED; +#else + is_dumpified = B_FALSE; +#endif + sync = !doread && !is_dumpified && + zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; /* * There must be no buffer changes when doing a dmu_sync() because @@ -1296,7 +1319,15 @@ zvol_strategy(struct bio *bp) while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); +#ifdef illumos + if (is_dumpified) { + size = MIN(size, P2END(off, zv->zv_volblocksize) - off); + error = zvol_dumpio(zv, addr, off, size, + doread, B_FALSE); + } else if (doread) { +#else if (doread) { +#endif error = dmu_read(os, ZVOL_OBJ, off, size, addr, DMU_READ_PREFETCH); } else { @@ -1830,21 +1861,67 @@ zvol_fini(void) } #ifdef sun +/*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(&spa_namespace_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); @@ -1855,6 +1932,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 @@ -1917,7 +2002,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 Mon Feb 17 17:01:45 2014 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 ESMTPS id F1B8AB07; Mon, 17 Feb 2014 17:01:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5A1017A2; Mon, 17 Feb 2014 17:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HH1iQC051159; Mon, 17 Feb 2014 17:01:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HH1fFB051136; Mon, 17 Feb 2014 17:01:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171701.s1HH1fFB051136@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:01: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: r262090 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/co... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:01:45 -0000 Author: avg Date: Mon Feb 17 17:01:41 2014 New Revision: 262090 URL: http://svnweb.freebsd.org/changeset/base/262090 Log: MFC r255750: MFV r254750: Add support of Illumos dumps on zvol over RAID-Z. Note that this only adds the features. FreeBSD would still need more work to support dumping on zvols. MFC slacker: delphij Added: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h - copied unchanged from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 17:01:41 2014 (r262090) @@ -19,15 +19,15 @@ .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. -.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd September 20, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -884,14 +884,21 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, .Cm fletcher4 , but this may change in future releases). The value .Cm off -disables integrity checking on user data. Disabling checksums is +disables integrity checking on user data. +The value +.Cm noparity +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 .Em NOT a recommended practice. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4 Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:01:41 2014 (r262090) @@ -19,10 +19,11 @@ .\" .\" 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. .\" .\" $FreeBSD$ .\" -.Dd February 8, 2013 +.Dd September 20, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -229,6 +230,27 @@ feature. At the moment, this operation cannot be reversed. Booting off of .Sy lz4 -compressed root pools is supported. +.It Sy multi_vdev_crash_dump +.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump" +.It GUID Ta com.joyent:multi_vdev_crash_dump +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +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. +.\" TODO: this is not yet supported on FreeBSD. +.\" .Pp +.\" When the +.\" .Sy multi_vdev_crash_dump +.\" feature is set to +.\" .Sy enabled , +.\" the administrator can use the +.\" .Xr dumpon 8 +.\" command to configure a +.\" dump device on a pool comprised of multiple vdevs. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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 @@ -4020,9 +4021,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, @@ -4041,8 +4040,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) @@ -4104,12 +4107,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: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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 @@ -159,4 +160,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: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:01:41 2014 (r262090) @@ -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 @@ -53,6 +54,7 @@ static 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: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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 @@ -2795,7 +2796,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, NULL, dbuf_write_nofill_done, db, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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 @@ -1623,7 +1623,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 17:01:41 2014 (r262090) @@ -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 } Copied: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h (from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Mon Feb 17 17:01:41 2014 (r262090, copy of r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) @@ -0,0 +1,50 @@ +/* + * 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 +#ifdef illumos +#include +#ifdef _KERNEL +#include +#include +#include +#endif +#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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 17:01:41 2014 (r262090) @@ -25,6 +25,7 @@ * Copyright (c) 2012 by Delphix. 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. */ #ifndef _ZIO_H @@ -81,6 +82,7 @@ enum zio_checksum { ZIO_CHECKSUM_FLETCHER_4, ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, + ZIO_CHECKSUM_NOPARITY, ZIO_CHECKSUM_FUNCTIONS }; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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 Joyent, Inc. All rights reserved. */ #include @@ -367,8 +368,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; @@ -616,7 +638,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 17:01:41 2014 (r262090) @@ -22,15 +22,22 @@ /* * 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 +#ifdef illumos +#include +#endif +#include +#include #include #include #include #include +#include /* * Virtual device vector for RAID-Z. @@ -154,6 +161,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. */ @@ -437,14 +446,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, boolean_t dofree, + 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. */ @@ -532,13 +541,13 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT3U(rm->rm_asize - asize, ==, rm->rm_nskip << unit_shift); ASSERT3U(rm->rm_nskip, <=, nparity); - if (zio->io_type != ZIO_TYPE_FREE) { + if (!dofree) { 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 = @@ -570,7 +579,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; @@ -582,8 +591,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); } @@ -993,12 +1000,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 | @@ -1532,6 +1536,154 @@ vdev_raidz_close(vdev_t *vd) vdev_close(vd->vdev_child[c]); } +#ifdef illumos +/* + * 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 ? BIO_READ : BIO_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, B_FALSE, 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); +} +#endif + static uint64_t vdev_raidz_asize(vdev_t *vd, uint64_t psize) { @@ -1584,9 +1736,14 @@ 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, + zio->io_type == ZIO_TYPE_FREE, + 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_FREE) { @@ -1729,6 +1886,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 17:01:41 2014 (r262090) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 17:01:41 2014 (r262090) @@ -24,6 +24,7 @@ * Copyright (c) 2006-2010 Pawel Jakub Dawidek * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -77,9 +79,14 @@ #include #include #include +#include #include #include #include +#include +#include +#include + #include #include "zfs_namecheck.h" @@ -1164,27 +1171,28 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_ #ifdef sun 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)) @@ -1192,19 +1200,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)); } } @@ -1239,7 +1254,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); @@ -1259,6 +1275,7 @@ zvol_strategy(struct bio *bp) rl_t *rl; int error = 0; boolean_t doread = (bp->bio_cmd == BIO_READ); + boolean_t is_dumpified; boolean_t sync; if (zv == NULL) { @@ -1285,7 +1302,13 @@ zvol_strategy(struct bio *bp) return (0); } - sync = !doread && zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; +#ifdef illumos + is_dumpified = zv->zv_flags & ZVOL_DUMPIFIED; +#else + is_dumpified = B_FALSE; +#endif + sync = !doread && !is_dumpified && + zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; /* * There must be no buffer changes when doing a dmu_sync() because @@ -1296,7 +1319,15 @@ zvol_strategy(struct bio *bp) while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); +#ifdef illumos + if (is_dumpified) { + size = MIN(size, P2END(off, zv->zv_volblocksize) - off); + error = zvol_dumpio(zv, addr, off, size, + doread, B_FALSE); + } else if (doread) { +#else if (doread) { +#endif error = dmu_read(os, ZVOL_OBJ, off, size, addr, DMU_READ_PREFETCH); } else { @@ -1830,21 +1861,67 @@ zvol_fini(void) } #ifdef sun +/*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(&spa_namespace_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); @@ -1855,6 +1932,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 @@ -1917,7 +2002,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 Mon Feb 17 17:10:46 2014 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 ESMTPS id 34942DF2; Mon, 17 Feb 2014 17:10:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18DDE1837; Mon, 17 Feb 2014 17:10:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHAksP052914; Mon, 17 Feb 2014 17:10:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHAfVo052884; Mon, 17 Feb 2014 17:10:41 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201402171710.s1HHAfVo052884@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 17 Feb 2014 17:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262091 - in vendor-sys/acpica/dist: . generate/unix source/common source/compiler source/components/debugger source/components/dispatcher source/components/events source/components/exe... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:10:46 -0000 Author: jkim Date: Mon Feb 17 17:10:41 2014 New Revision: 262091 URL: http://svnweb.freebsd.org/changeset/base/262091 Log: Import ACPICA 20140214. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfileio.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslpredef.c vendor-sys/acpica/dist/source/compiler/aslprepkg.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/prmacros.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exsystem.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsload.c vendor-sys/acpica/dist/source/components/namespace/nsobject.c vendor-sys/acpica/dist/source/components/namespace/nsprepkg.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psobject.c vendor-sys/acpica/dist/source/components/resources/rscalc.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsinfo.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/utglobal.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/include/acapps.h vendor-sys/acpica/dist/source/include/acbuffer.h vendor-sys/acpica/dist/source/include/acconfig.h vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acdispat.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/achware.h vendor-sys/acpica/dist/source/include/acinterp.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acparser.h vendor-sys/acpica/dist/source/include/acpiosxf.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/acresrc.h vendor-sys/acpica/dist/source/include/acrestyp.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/actables.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/amlcode.h vendor-sys/acpica/dist/source/include/amlresrc.h vendor-sys/acpica/dist/source/os_specific/service_layers/oswindir.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/changes.txt Mon Feb 17 17:10:41 2014 (r262091) @@ -1,4 +1,69 @@ ---------------------------------------- +14 February 2014. Summary of changes for version 20140214: + +1) ACPICA kernel-resident subsystem: + +Implemented a new mechanism to proactively prevent problems with ill- +behaved reentrant control methods that create named ACPI objects. This +behavior is illegal as per the ACPI specification, but is nonetheless +frequently seen in the field. Previously, this could lead to an +AE_ALREADY_EXISTS exception if the method was actually entered by more +than one thread. This new mechanism detects such methods at table load +time and marks them "serialized" to prevent reentrancy. A new global +option, AcpiGbl_AutoSerializeMethods, has been added to disable this +feature if desired. This mechanism and global option obsoletes and +supersedes the previous AcpiGbl_SerializeAllMethods option. + +Added the "Windows 2013" string to the _OSI support. ACPICA will now +respond TRUE to _OSI queries with this string. It is the stated policy of +ACPICA to add new strings to the _OSI support as soon as possible after +they are defined. See the full ACPICA _OSI policy which has been added to +the utilities/utosi.c file. + +Hardened/updated the _PRT return value auto-repair code: +1) Do not abort the repair on a single subpackage failure, continue to +check all subpackages. +2) Add check for the minimum subpackage length (4). +3) Properly handle extraneous NULL package elements. + +Added support to avoid the possibility of infinite loops when traversing +object linked lists. Never allow an infinite loop, even in the face of +corrupted object lists. + +ACPICA headers: Deployed the use of #pragma pack(push) and #pragma +pack(pop) directives to ensure that the ACPICA headers are independent of +compiler settings or other host headers. + +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.5K Code, 27.2K Data, 123.7K Total + Debug Version: 188.6K Code, 79.0K Data, 267.6K Total + Previous Release: + Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total + Debug Version: 187.5K Code, 78.3K Data, 265.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Table-compiler: Fixed a problem with support for the SPMI table. The +first reserved field was incorrectly forced to have a value of zero. This +change correctly forces the field to have a value of one. ACPICA BZ 1081. + +Debugger: Added missing support for the "Extra" and "Data" subobjects +when displaying object data. + +Debugger: Added support to display entire object linked lists when +displaying object data. + +iASL: Removed the obsolete -g option to obtain ACPI tables from the +Windows registry. This feature has been superseded by the acpidump +utility. + +---------------------------------------- 14 January 2014. Summary of changes for version 20140114: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Mon Feb 17 17:10:41 2014 (r262091) @@ -161,14 +161,15 @@ CWARNINGFLAGS = \ CWARNINGFLAGS += \ -Waddress\ -Waggregate-return\ - -Wchar-subscripts\ + -Winit-self\ + -Winline\ -Wmissing-declarations\ -Wmissing-field-initializers\ -Wnested-externs\ -Wold-style-definition\ + -Woverride-init\ -Wno-format-nonliteral\ -Wredundant-decls - # # Per-host flags and exclusions # Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/common/adisasm.c Mon Feb 17 17:10:41 2014 (r262091) @@ -250,7 +250,6 @@ AdInitialize ( * OutToFile - TRUE if output should go to a file * Prefix - Path prefix for output * OutFilename - where the filename is returned - * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -263,8 +262,7 @@ AdAmlDisassemble ( BOOLEAN OutToFile, char *Filename, char *Prefix, - char **OutFilename, - BOOLEAN GetAllTables) + char **OutFilename) { ACPI_STATUS Status; char *DisasmFilename = NULL; @@ -348,7 +346,7 @@ AdAmlDisassemble ( } else { - Status = AdGetLocalTables (Filename, GetAllTables); + Status = AdGetLocalTables (); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get ACPI tables, %s\n", @@ -746,8 +744,7 @@ AdDisplayTables ( * * FUNCTION: AdGetLocalTables * - * PARAMETERS: Filename - Not used - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: None * * RETURN: Status * @@ -757,105 +754,36 @@ AdDisplayTables ( ACPI_STATUS AdGetLocalTables ( - char *Filename, - BOOLEAN GetAllTables) + void) { ACPI_STATUS Status; ACPI_TABLE_HEADER TableHeader; ACPI_TABLE_HEADER *NewTable; - UINT32 NumTables; - UINT32 PointerSize; UINT32 TableIndex; - if (GetAllTables) - { - ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_RSDT); - AcpiOsTableOverride (&TableHeader, &NewTable); - if (!NewTable) - { - fprintf (stderr, "Could not obtain RSDT\n"); - return (AE_NO_ACPI_TABLES); - } - else - { - AdWriteTable (NewTable, NewTable->Length, - ACPI_SIG_RSDT, NewTable->OemTableId); - } - - if (ACPI_COMPARE_NAME (NewTable->Signature, ACPI_SIG_RSDT)) - { - PointerSize = sizeof (UINT32); - } - else - { - PointerSize = sizeof (UINT64); - } - - /* - * Determine the number of tables pointed to by the RSDT/XSDT. - * This is defined by the ACPI Specification to be the number of - * pointers contained within the RSDT/XSDT. The size of the pointers - * is architecture-dependent. - */ - NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize; - AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n", - NumTables, NewTable->Signature); - - /* Get the FADT */ - - ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_FADT); - AcpiOsTableOverride (&TableHeader, &NewTable); - if (NewTable) - { - AdWriteTable (NewTable, NewTable->Length, - ACPI_SIG_FADT, NewTable->OemTableId); - } - AcpiOsPrintf ("\n"); - - /* Don't bother with FACS, it is usually all zeros */ - } - - /* Always get the DSDT */ + /* Get the DSDT via table override */ ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT); AcpiOsTableOverride (&TableHeader, &NewTable); - if (NewTable) - { - AdWriteTable (NewTable, NewTable->Length, - ACPI_SIG_DSDT, NewTable->OemTableId); - - /* Store DSDT in the Table Manager */ - - Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, - 0, &TableIndex); - if (ACPI_FAILURE (Status)) - { - fprintf (stderr, "Could not store DSDT\n"); - return (AE_NO_ACPI_TABLES); - } - } - else + if (!NewTable) { fprintf (stderr, "Could not obtain DSDT\n"); return (AE_NO_ACPI_TABLES); } -#if 0 - /* TBD: Future implementation */ - - AcpiOsPrintf ("\n"); + AdWriteTable (NewTable, NewTable->Length, + ACPI_SIG_DSDT, NewTable->OemTableId); - /* Get all SSDTs */ + /* Store DSDT in the Table Manager */ - ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_SSDT); - do + Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, + 0, &TableIndex); + if (ACPI_FAILURE (Status)) { - NewTable = NULL; - Status = AcpiOsTableOverride (&TableHeader, &NewTable); - - } while (NewTable); -#endif + fprintf (stderr, "Could not store DSDT\n"); + return (AE_NO_ACPI_TABLES); + } return (AE_OK); } Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/common/dmextern.c Mon Feb 17 17:10:41 2014 (r262091) @@ -1265,10 +1265,16 @@ AcpiDmUnresolvedWarning ( " * were not specified. This resulting disassembler output file may not\n" " * compile because the disassembler did not know how many arguments\n" " * to assign to these methods. To specify the tables needed to resolve\n" - " * external control method references, use the one of the following\n" - " * example iASL invocations:\n" - " * iasl -e -d \n" - " * iasl -e -d \n" + " * external control method references, the -e option can be used to\n" + " * specify the filenames. Example iASL invocations:\n" + " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" + " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" + " * iasl -e ssdt*.aml -d dsdt.aml\n" + " *\n" + " * In addition, the -fe option can be used to specify a file containing\n" + " * control method external declarations with the associated method\n" + " * argument counts. Each line of the file must be of the form:\n" + " * External (, MethodObj, )\n" " */\n", AcpiGbl_NumExternalMethods); } @@ -1279,10 +1285,15 @@ AcpiDmUnresolvedWarning ( AcpiOsPrintf (" /*\n" " * iASL Warning: There were %u external control methods found during\n" " * disassembly, but only %u %s resolved (%u unresolved). Additional\n" - " * ACPI tables are required to properly disassemble the code. This\n" + " * ACPI tables may be required to properly disassemble the code. This\n" " * resulting disassembler output file may not compile because the\n" " * disassembler did not know how many arguments to assign to the\n" " * unresolved methods.\n" + " *\n" + " * If necessary, the -fe option can be used to specify a file containing\n" + " * control method external declarations with the associated method\n" + " * argument counts. Each line of the file must be of the form:\n" + " * External (, MethodObj, )\n" " */\n", AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), @@ -1301,10 +1312,16 @@ AcpiDmUnresolvedWarning ( "were not specified. The resulting disassembler output file may not\n" "compile because the disassembler did not know how many arguments\n" "to assign to these methods. To specify the tables needed to resolve\n" - "external control method references, use the one of the following\n" - "example iASL invocations:\n" - " iasl -e -d \n" - " iasl -e -d \n", + "external control method references, the -e option can be used to\n" + "specify the filenames. Example iASL invocations:\n" + " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" + " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" + " iasl -e ssdt*.aml -d dsdt.aml\n" + "\n" + "In addition, the -fe option can be used to specify a file containing\n" + "control method external declarations with the associated method\n" + "argument counts. Each line of the file must be of the form:\n" + " External (, MethodObj, )\n", AcpiGbl_NumExternalMethods); } else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods) @@ -1314,10 +1331,15 @@ AcpiDmUnresolvedWarning ( fprintf (stderr, "\n" "iASL Warning: There were %u external control methods found during\n" "disassembly, but only %u %s resolved (%u unresolved). Additional\n" - "ACPI tables are required to properly disassemble the code. The\n" + "ACPI tables may be required to properly disassemble the code. The\n" "resulting disassembler output file may not compile because the\n" "disassembler did not know how many arguments to assign to the\n" - "unresolved methods.\n", + "unresolved methods.\n" + "\n" + "If necessary, the -fe option can be used to specify a file containing\n" + "control method external declarations with the associated method\n" + "argument counts. Each line of the file must be of the form:\n" + " External (, MethodObj, )\n", AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Mon Feb 17 17:10:41 2014 (r262091) @@ -1940,7 +1940,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] = { {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0}, - {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */ {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0}, Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Feb 17 17:10:41 2014 (r262091) @@ -280,6 +280,10 @@ ApCheckRegMethod ( * aslerror - error handling/reporting */ void +AslAbort ( + void); + +void AslError ( UINT8 Level, UINT8 MessageId, @@ -703,10 +707,6 @@ TrLinkPeerNodes ( * aslfiles - File I/O support */ void -AslAbort ( - void); - -void FlAddIncludeDirectory ( char *Dir); Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Mon Feb 17 17:10:41 2014 (r262091) @@ -56,6 +56,36 @@ AeAddToErrorLog ( /******************************************************************************* * + * FUNCTION: AslAbort + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Dump the error log and abort the compiler. Used for serious + * I/O errors. + * + ******************************************************************************/ + +void +AslAbort ( + void) +{ + + AePrintErrorLog (ASL_FILE_STDERR); + if (Gbl_DebugFlag) + { + /* Print error summary to stdout also */ + + AePrintErrorLog (ASL_FILE_STDOUT); + } + + exit (1); +} + + +/******************************************************************************* + * * FUNCTION: AeClearErrorLog * * PARAMETERS: None @@ -817,7 +847,8 @@ AslError ( /* Check if user wants to ignore this exception */ - if (AslIsExceptionDisabled (Level, MessageId)) + if (Gbl_AllExceptionsDisabled || + AslIsExceptionDisabled (Level, MessageId)) { return; } Modified: vendor-sys/acpica/dist/source/compiler/aslfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfileio.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslfileio.c Mon Feb 17 17:10:41 2014 (r262091) @@ -46,35 +46,9 @@ #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfileio") - -/******************************************************************************* - * - * FUNCTION: AslAbort - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Dump the error log and abort the compiler. Used for serious - * I/O errors. - * - ******************************************************************************/ - -void -AslAbort ( - void) -{ - - AePrintErrorLog (ASL_FILE_STDERR); - if (Gbl_DebugFlag) - { - /* Print error summary to stdout also */ - - AePrintErrorLog (ASL_FILE_STDOUT); - } - - exit (1); -} +long +UtGetFileSize ( + FILE *fp); /******************************************************************************* @@ -141,13 +115,73 @@ FlOpenFile ( /******************************************************************************* * + * FUNCTION: UtGetFileSize + * + * PARAMETERS: fp - Open file handle + * + * RETURN: File Size. -1 on error. + * + * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * TBD: This function should be used to replace other similar + * functions in ACPICA. + * + ******************************************************************************/ + +long +UtGetFileSize ( + FILE *fp) +{ + long FileSize; + long CurrentOffset; + + + CurrentOffset = ftell (fp); + if (CurrentOffset < 0) + { + goto OffsetError; + } + + if (fseek (fp, 0, SEEK_END)) + { + goto SeekError; + } + + FileSize = ftell (fp); + if (FileSize < 0) + { + goto OffsetError; + } + + /* Restore file pointer */ + + if (fseek (fp, CurrentOffset, SEEK_SET)) + { + goto SeekError; + } + + return (FileSize); + + +OffsetError: + perror ("Could not get file offset"); + return (-1); + +SeekError: + perror ("Could not seek file"); + return (-1); +} + + +/******************************************************************************* + * * FUNCTION: FlGetFileSize * * PARAMETERS: FileId - Index into file info array * * RETURN: File Size * - * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * DESCRIPTION: Get current file size. Uses common seek-to-EOF function. + * File must be open. Aborts compiler on error. * ******************************************************************************/ @@ -155,21 +189,16 @@ UINT32 FlGetFileSize ( UINT32 FileId) { - FILE *fp; - UINT32 FileSize; - long Offset; - + long FileSize; - fp = Gbl_Files[FileId].Handle; - Offset = ftell (fp); - fseek (fp, 0, SEEK_END); - FileSize = (UINT32) ftell (fp); - - /* Restore file pointer */ + FileSize = UtGetFileSize (Gbl_Files[FileId].Handle); + if (FileSize == -1) + { + AslAbort(); + } - fseek (fp, Offset, SEEK_SET); - return (FileSize); + return ((UINT32) FileSize); } Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Feb 17 17:10:41 2014 (r262091) @@ -159,7 +159,6 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); -ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE); @@ -170,6 +169,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE); #define HEX_OUTPUT_NONE 0 Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Feb 17 17:10:41 2014 (r262091) @@ -158,7 +158,6 @@ Usage ( 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"); @@ -319,16 +318,6 @@ main ( /* Perform global actions first/only */ - if (Gbl_GetAllTables) - { - Status = AslDoOneFile (NULL); - if (ACPI_FAILURE (Status)) - { - return (-1); - } - return (0); - } - if (Gbl_DisassembleAll) { while (argv[Index1]) Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Mon Feb 17 17:10:41 2014 (r262091) @@ -445,7 +445,7 @@ char *AslMessages /* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", /* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", /* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents", -/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", +/* ASL_MSG_RESERVED_VALUE */ "Reserved field", /* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined", /* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", /* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloptions.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/asloptions.c Mon Feb 17 17:10:41 2014 (r262091) @@ -118,8 +118,7 @@ AslCommandLine ( /* Next parameter must be the input filename */ if (!argv[AcpiGbl_Optind] && - !Gbl_DisasmFlag && - !Gbl_GetAllTables) + !Gbl_DisasmFlag) { printf ("Missing input filename\n"); BadCommandLine = TRUE; @@ -318,9 +317,8 @@ AslDoOptions ( case 'g': /* Get all ACPI tables */ - Gbl_GetAllTables = TRUE; - Gbl_DoCompile = FALSE; - break; + printf ("-g option is deprecated, use acpidump utility instead\n"); + exit (1); case 'h': Modified: vendor-sys/acpica/dist/source/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpredef.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslpredef.c Mon Feb 17 17:10:41 2014 (r262091) @@ -251,10 +251,16 @@ ApCheckPredefinedReturnValue ( const ACPI_PREDEFINED_INFO *ThisName; - /* Check parent method for a match against the predefined name list */ - + /* + * Check parent method for a match against the predefined name list. + * + * Note: Disable compiler errors/warnings because any errors will be + * caught when analyzing the parent method. Eliminates duplicate errors. + */ + Gbl_AllExceptionsDisabled = TRUE; Index = ApCheckForPredefinedName (MethodInfo->Op, MethodInfo->Op->Asl.NameSeg); + Gbl_AllExceptionsDisabled = FALSE; switch (Index) { Modified: vendor-sys/acpica/dist/source/compiler/aslprepkg.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprepkg.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslprepkg.c Mon Feb 17 17:10:41 2014 (r262091) @@ -169,7 +169,7 @@ ApCheckPackage ( { case ACPI_PTYPE1_FIXED: /* - * The package count is fixed and there are no sub-packages + * The package count is fixed and there are no subpackages * * If package is too small, exit. * If package is larger than expected, issue warning but continue @@ -194,7 +194,7 @@ ApCheckPackage ( case ACPI_PTYPE1_VAR: /* - * The package count is variable, there are no sub-packages, + * The package count is variable, there are no subpackages, * and all elements must be of the same type */ for (i = 0; i < Count; i++) @@ -207,7 +207,7 @@ ApCheckPackage ( case ACPI_PTYPE1_OPTION: /* - * The package count is variable, there are no sub-packages. + * The package count is variable, there are no subpackages. * There are a fixed number of required elements, and a variable * number of optional elements. * @@ -251,7 +251,7 @@ ApCheckPackage ( Op = Op->Asl.Next; Count--; - /* Examine the sub-packages */ + /* Examine the subpackages */ ApCheckPackageList (Predefined->Info.Name, Op, Package, 1, Count); @@ -259,7 +259,7 @@ ApCheckPackage ( case ACPI_PTYPE2_PKG_COUNT: - /* First element is the (Integer) count of sub-packages to follow */ + /* First element is the (Integer) count of subpackages to follow */ Status = ApCheckObjectType (Predefined->Info.Name, Op, ACPI_RTYPE_INTEGER, 0); @@ -283,7 +283,7 @@ ApCheckPackage ( Op = Op->Asl.Next; - /* Examine the sub-packages */ + /* Examine the subpackages */ ApCheckPackageList (Predefined->Info.Name, Op, Package, 1, Count); @@ -296,10 +296,10 @@ ApCheckPackage ( case ACPI_PTYPE2_FIX_VAR: /* * These types all return a single Package that consists of a - * variable number of sub-Packages. + * variable number of subpackages. */ - /* Examine the sub-packages */ + /* Examine the subpackages */ ApCheckPackageList (Predefined->Info.Name, Op, Package, 0, Count); @@ -494,7 +494,7 @@ ApCheckPackageList ( case ACPI_PTYPE2_FIXED: - /* Each sub-package has a fixed length */ + /* Each subpackage has a fixed length */ ExpectedCount = Package->RetInfo2.Count; if (Count < ExpectedCount) @@ -517,7 +517,7 @@ ApCheckPackageList ( case ACPI_PTYPE2_MIN: - /* Each sub-package has a variable but minimum length */ + /* Each subpackage has a variable but minimum length */ ExpectedCount = Package->RetInfo.Count1; if (Count < ExpectedCount) @@ -527,7 +527,7 @@ ApCheckPackageList ( break; } - /* Check the type of each sub-package element */ + /* Check the type of each subpackage element */ ApCheckPackageElements (PredefinedName, Op, Package->RetInfo.ObjectType1, Count, 0, 0); @@ -576,7 +576,7 @@ ApCheckPackageList ( Count = ExpectedCount; } - /* Check the type of each sub-package element */ + /* Check the type of each subpackage element */ Op = Op->Asl.Next; ApCheckPackageElements (PredefinedName, Op, Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstartup.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Mon Feb 17 17:10:41 2014 (r262091) @@ -251,7 +251,7 @@ AslDoDisassembly ( AcpiGbl_DbOpt_disasm = TRUE; Status = AdAmlDisassemble (AslToFile, Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix, - &Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables); + &Gbl_Files[ASL_FILE_INPUT].Filename); if (ACPI_FAILURE (Status)) { return (Status); @@ -331,7 +331,7 @@ AslDoOneFile ( /* * AML Disassembly (Optional) */ - if (Gbl_DisasmFlag || Gbl_GetAllTables) + if (Gbl_DisasmFlag) { Status = AslDoDisassembly (); if (Status != AE_CTRL_CONTINUE) Modified: vendor-sys/acpica/dist/source/compiler/asltransform.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltransform.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/asltransform.c Mon Feb 17 17:10:41 2014 (r262091) @@ -450,10 +450,6 @@ TrDoSwitch ( { /* Add an ELSE to complete the previous CASE */ - if (!Conditional) - { - return; - } NewOp = TrCreateLeafNode (PARSEOP_ELSE); NewOp->Asl.Parent = Conditional->Asl.Parent; TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent); @@ -620,11 +616,6 @@ TrDoSwitch ( { /* Convert the DEFAULT node to an ELSE */ - if (!Conditional) - { - return; - } - TrAmlInitNode (DefaultOp, PARSEOP_ELSE); DefaultOp->Asl.Parent = Conditional->Asl.Parent; Modified: vendor-sys/acpica/dist/source/compiler/dtfield.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtfield.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/dtfield.c Mon Feb 17 17:10:41 2014 (r262091) @@ -311,21 +311,37 @@ DtCompileInteger ( return; } - /* Ensure that reserved fields are set to zero */ - /* TBD: should we set to zero, or just make this an ERROR? */ - /* TBD: Probably better to use a flag */ + /* + * Ensure that reserved fields are set properly. Note: uses + * the DT_NON_ZERO flag to indicate that the reserved value + * must be exactly one. Otherwise, the value must be zero. + * This is sufficient for now. + */ + + /* TBD: Should use a flag rather than compare "Reserved" */ - if (!ACPI_STRCMP (Field->Name, "Reserved") && - (Value != 0)) + if (!ACPI_STRCMP (Field->Name, "Reserved")) { - DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, - "Setting to zero"); - Value = 0; + if (Flags & DT_NON_ZERO) + { + if (Value != 1) + { + DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, + "Must be one, setting to one"); + Value = 1; + } + } + else if (Value != 0) + { + DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, + "Must be zero, setting to zero"); + Value = 0; + } } /* Check if the value must be non-zero */ - if ((Value == 0) && (Flags & DT_NON_ZERO)) + else if ((Flags & DT_NON_ZERO) && (Value == 0)) { DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL); } Modified: vendor-sys/acpica/dist/source/compiler/dttemplate.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttemplate.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/dttemplate.h Mon Feb 17 17:10:41 2014 (r262091) @@ -897,10 +897,10 @@ const unsigned char TemplateSpcr[] = const unsigned char TemplateSpmi[] = { 0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */ - 0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ Modified: vendor-sys/acpica/dist/source/compiler/prmacros.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/prmacros.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/prmacros.c Mon Feb 17 17:10:41 2014 (r262091) @@ -360,7 +360,7 @@ PrAddMacro ( if (ArgCount >= PR_MAX_MACRO_ARGS) { PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, TokenOffset); - return; + goto ErrorExit; } } @@ -400,7 +400,7 @@ PrAddMacro ( PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, THIS_TOKEN_OFFSET (Token)); - return; + goto ErrorExit; } break; } @@ -432,7 +432,7 @@ AddMacroToList: THIS_TOKEN_OFFSET (Name)); } - return; + goto ErrorExit; } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID @@ -451,6 +451,13 @@ AddMacroToList: DefineInfo->Args = Args; DefineInfo->ArgCount = ArgCount; } + + return; + + +ErrorExit: + ACPI_FREE (Args); + return; } Modified: vendor-sys/acpica/dist/source/components/debugger/dbdisply.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbdisply.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/components/debugger/dbdisply.c Mon Feb 17 17:10:41 2014 (r262091) @@ -303,6 +303,10 @@ AcpiDbDecodeAndDisplayObject ( /* Is not a recognizeable object */ + AcpiOsPrintf ( + "Not a known ACPI internal object, descriptor type %2.2X\n", + ACPI_GET_DESCRIPTOR_TYPE (ObjPtr)); + Size = 16; if (AcpiOsReadable (ObjPtr, 64)) { Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c Mon Feb 17 17:10:41 2014 (r262091) @@ -52,6 +52,7 @@ #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsinit") + /* Local prototypes */ static ACPI_STATUS @@ -91,8 +92,8 @@ AcpiDsInitOneObject ( { ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context; ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_OBJECT_TYPE Type; ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; ACPI_FUNCTION_ENTRY (); @@ -111,9 +112,7 @@ AcpiDsInitOneObject ( /* And even then, we are only interested in a few object types */ - Type = AcpiNsGetType (ObjHandle); - - switch (Type) + switch (AcpiNsGetType (ObjHandle)) { case ACPI_TYPE_REGION: @@ -129,8 +128,45 @@ AcpiDsInitOneObject ( break; case ACPI_TYPE_METHOD: - + /* + * Auto-serialization support. We will examine each method that is + * NotSerialized to determine if it creates any Named objects. If + * it does, it will be marked serialized to prevent problems if + * the method is entered by two or more threads and an attempt is + * made to create the same named object twice -- which results in + * an AE_ALREADY_EXISTS exception and method abort. + */ Info->MethodCount++; + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + break; + } + + /* Ignore if already serialized */ + + if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED) + { + Info->SerialMethodCount++; + break; + } + + if (AcpiGbl_AutoSerializeMethods) + { + /* Parse/scan method and serialize it if necessary */ + + AcpiDsAutoSerializeMethod (Node, ObjDesc); + if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED) + { + /* Method was just converted to Serialized */ + + Info->SerialMethodCount++; + Info->SerializedMethodCount++; + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:11:33 2014 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 ESMTPS id 38980FFA; Mon, 17 Feb 2014 17:11:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0ABA51899; Mon, 17 Feb 2014 17:11:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHBWrd055521; Mon, 17 Feb 2014 17:11:32 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHBW0L055520; Mon, 17 Feb 2014 17:11:32 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201402171711.s1HHBW0L055520@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 17 Feb 2014 17:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262092 - vendor-sys/acpica/20140214 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:11:33 -0000 Author: jkim Date: Mon Feb 17 17:11:32 2014 New Revision: 262092 URL: http://svnweb.freebsd.org/changeset/base/262092 Log: Tag ACPICA 20140214. Added: vendor-sys/acpica/20140214/ - copied from r262091, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:11:40 2014 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 ESMTPS id 53E06148; Mon, 17 Feb 2014 17:11:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D890189C; Mon, 17 Feb 2014 17:11:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHBeeD055589; Mon, 17 Feb 2014 17:11:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHBc5f055576; Mon, 17 Feb 2014 17:11:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171711.s1HHBc5f055576@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262093 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/o... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:11:40 -0000 Author: avg Date: Mon Feb 17 17:11:38 2014 New Revision: 262093 URL: http://svnweb.freebsd.org/changeset/base/262093 Log: MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow for fine-grained control Added: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:38 2014 (r262093) @@ -242,7 +242,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -263,7 +263,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -316,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -517,26 +517,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -548,10 +607,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -559,10 +618,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -570,15 +629,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -586,33 +647,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -801,9 +874,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -833,17 +906,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2172,39 +2244,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2259,11 +2309,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2286,7 +2346,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2489,7 +2562,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2659,6 +2732,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:38 2014 (r262093) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 08, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -251,6 +251,24 @@ configuration. .\" .Xr dumpon 8 .\" command to configure a .\" dump device on a pool comprised of multiple vdevs. +.It Sy spacemap_histogram +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram" +.It GUID Ta com.delphix:spacemap_histogram +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is +.Sy enabled , +ZFS will +set this feature to +.Sy active +when a new space map object is created or +an existing space map is upgraded to the new format. +Once the feature is +.Sy active , +it will remain in that state until the pool is destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:38 2014 (r262093) @@ -5339,7 +5339,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:38 2014 (r262093) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. 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. */ @@ -163,4 +163,7 @@ zpool_feature_init(void) 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); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:38 2014 (r262093) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. 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. */ @@ -55,6 +55,7 @@ static enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:38 2014 (r262093) @@ -21,7 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # @@ -62,6 +63,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -72,6 +74,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:38 2014 (r262093) @@ -1339,7 +1339,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:38 2014 (r262093) @@ -31,6 +31,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -47,6 +48,11 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); @@ -61,6 +67,11 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; +TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); +SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, + &zfs_condense_pct, 0, + "Condense on-disk spacemap when it is more than this many percents" + " of in-memory counterpart"); /* * This value defines the number of allowed allocation failures per vdev. @@ -88,15 +99,29 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_ * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; +TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, + &zfs_mg_noalloc_threshold, 0, + "Percentage of metaslab group size that should be free" + " to make it eligible for allocation"); /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, - 0, - "Metaslab debugging: when set, keeps all space maps in core to verify frees"); +int metaslab_debug_load = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, + &metaslab_debug_load, 0, + "Load all metaslabs when pool is first opened"); + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, + &metaslab_debug_unload, 0, + "Prevent metaslabs from being unloaded"); /* * Minimum size which forces the dynamic allocator to change @@ -135,20 +160,24 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* - * Max number of space_maps to prefetch. - */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, - &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); - -/* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_smo_bonus_pct = 150; -TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, - &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); +int metaslab_load_pct = 50; +TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, + &metaslab_load_pct, 0, + "Percentage of cpus that can be used by the metaslab taskq"); + +/* + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. + */ +int metaslab_unload_delay = TXG_SIZE * 2; +TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, + &metaslab_unload_delay, 0, + "Number of TXGs that an unused metaslab can be kept in memory"); /* * Should we be willing to write data to degraded vdevs? @@ -159,12 +188,41 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_ TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, + &metaslab_preload_limit, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, + &metaslab_preload_enabled, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; +TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", + &metaslab_weight_factor_enable); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, + &metaslab_weight_factor_enable, 0, + "Enable additional weight factor for each metaslab"); + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -295,9 +353,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -365,6 +423,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -434,6 +495,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -514,130 +577,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + metaslab_t *msp = arg; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } - - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + metaslab_t *msp = arg; - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } + metaslab_t *msp = arg; - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -646,29 +779,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:12:00 2014 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 ESMTPS id 4D47A2CA; Mon, 17 Feb 2014 17:12:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 350B918A4; Mon, 17 Feb 2014 17:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHC0BA055679; Mon, 17 Feb 2014 17:12:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHBwI6055658; Mon, 17 Feb 2014 17:11:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171711.s1HHBwI6055658@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:11: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: r262094 - in stable/9: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:12:00 -0000 Author: avg Date: Mon Feb 17 17:11:58 2014 New Revision: 262094 URL: http://svnweb.freebsd.org/changeset/base/262094 Log: MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow for fine-grained control Added: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:58 2014 (r262094) @@ -242,7 +242,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -263,7 +263,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -316,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -517,26 +517,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -548,10 +607,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -559,10 +618,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -570,15 +629,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -586,33 +647,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -801,9 +874,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -833,17 +906,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2172,39 +2244,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2259,11 +2309,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2286,7 +2346,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2489,7 +2562,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2659,6 +2732,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:58 2014 (r262094) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 08, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -251,6 +251,24 @@ configuration. .\" .Xr dumpon 8 .\" command to configure a .\" dump device on a pool comprised of multiple vdevs. +.It Sy spacemap_histogram +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram" +.It GUID Ta com.delphix:spacemap_histogram +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is +.Sy enabled , +ZFS will +set this feature to +.Sy active +when a new space map object is created or +an existing space map is upgraded to the new format. +Once the feature is +.Sy active , +it will remain in that state until the pool is destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:58 2014 (r262094) @@ -5339,7 +5339,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:58 2014 (r262094) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. 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. */ @@ -163,4 +163,7 @@ zpool_feature_init(void) 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); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:58 2014 (r262094) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. 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. */ @@ -55,6 +55,7 @@ static enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:58 2014 (r262094) @@ -21,7 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # @@ -62,6 +63,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -72,6 +74,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:58 2014 (r262094) @@ -1339,7 +1339,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:58 2014 (r262094) @@ -31,6 +31,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -47,6 +48,11 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); @@ -61,6 +67,11 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; +TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); +SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, + &zfs_condense_pct, 0, + "Condense on-disk spacemap when it is more than this many percents" + " of in-memory counterpart"); /* * This value defines the number of allowed allocation failures per vdev. @@ -88,15 +99,29 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_ * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; +TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, + &zfs_mg_noalloc_threshold, 0, + "Percentage of metaslab group size that should be free" + " to make it eligible for allocation"); /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, - 0, - "Metaslab debugging: when set, keeps all space maps in core to verify frees"); +int metaslab_debug_load = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, + &metaslab_debug_load, 0, + "Load all metaslabs when pool is first opened"); + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, + &metaslab_debug_unload, 0, + "Prevent metaslabs from being unloaded"); /* * Minimum size which forces the dynamic allocator to change @@ -135,20 +160,24 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* - * Max number of space_maps to prefetch. - */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, - &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); - -/* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_smo_bonus_pct = 150; -TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, - &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); +int metaslab_load_pct = 50; +TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, + &metaslab_load_pct, 0, + "Percentage of cpus that can be used by the metaslab taskq"); + +/* + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. + */ +int metaslab_unload_delay = TXG_SIZE * 2; +TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, + &metaslab_unload_delay, 0, + "Number of TXGs that an unused metaslab can be kept in memory"); /* * Should we be willing to write data to degraded vdevs? @@ -160,12 +189,41 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_ TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, + &metaslab_preload_limit, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, + &metaslab_preload_enabled, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; +TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", + &metaslab_weight_factor_enable); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, + &metaslab_weight_factor_enable, 0, + "Enable additional weight factor for each metaslab"); + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -296,9 +354,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -366,6 +424,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -435,6 +496,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -515,130 +578,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + metaslab_t *msp = arg; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } - - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + metaslab_t *msp = arg; - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } + metaslab_t *msp = arg; - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -647,29 +780,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:12:13 2014 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 ESMTPS id A0F2E411; Mon, 17 Feb 2014 17:12:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 886AE18AE; Mon, 17 Feb 2014 17:12:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHCDif055784; Mon, 17 Feb 2014 17:12:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHCCxb055774; Mon, 17 Feb 2014 17:12:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171712.s1HHCCxb055774@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:12:11 +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: r262095 - in stable/8: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:12:13 -0000 Author: avg Date: Mon Feb 17 17:12:11 2014 New Revision: 262095 URL: http://svnweb.freebsd.org/changeset/base/262095 Log: MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow for fine-grained control Added: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:12:11 2014 (r262095) @@ -242,7 +242,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -263,7 +263,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -316,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -517,26 +517,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -548,10 +607,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -559,10 +618,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -570,15 +629,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -586,33 +647,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -801,9 +874,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -833,17 +906,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2172,39 +2244,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2259,11 +2309,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2286,7 +2346,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2489,7 +2562,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2659,6 +2732,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:12:11 2014 (r262095) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 08, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -251,6 +251,24 @@ configuration. .\" .Xr dumpon 8 .\" command to configure a .\" dump device on a pool comprised of multiple vdevs. +.It Sy spacemap_histogram +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram" +.It GUID Ta com.delphix:spacemap_histogram +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is +.Sy enabled , +ZFS will +set this feature to +.Sy active +when a new space map object is created or +an existing space map is upgraded to the new format. +Once the feature is +.Sy active , +it will remain in that state until the pool is destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:12:11 2014 (r262095) @@ -5339,7 +5339,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:12:11 2014 (r262095) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. 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. */ @@ -163,4 +163,7 @@ zpool_feature_init(void) 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); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:12:11 2014 (r262095) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. 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. */ @@ -55,6 +55,7 @@ static enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:12:11 2014 (r262095) @@ -21,7 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # @@ -62,6 +63,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -72,6 +74,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:12:11 2014 (r262095) @@ -1339,7 +1339,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:12:11 2014 (r262095) @@ -31,6 +31,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -47,6 +48,11 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); @@ -61,6 +67,11 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; +TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); +SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, + &zfs_condense_pct, 0, + "Condense on-disk spacemap when it is more than this many percents" + " of in-memory counterpart"); /* * This value defines the number of allowed allocation failures per vdev. @@ -88,15 +99,29 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_ * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; +TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, + &zfs_mg_noalloc_threshold, 0, + "Percentage of metaslab group size that should be free" + " to make it eligible for allocation"); /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, - 0, - "Metaslab debugging: when set, keeps all space maps in core to verify frees"); +int metaslab_debug_load = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, + &metaslab_debug_load, 0, + "Load all metaslabs when pool is first opened"); + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, + &metaslab_debug_unload, 0, + "Prevent metaslabs from being unloaded"); /* * Minimum size which forces the dynamic allocator to change @@ -135,20 +160,24 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* - * Max number of space_maps to prefetch. - */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, - &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); - -/* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_smo_bonus_pct = 150; -TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, - &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); +int metaslab_load_pct = 50; +TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, + &metaslab_load_pct, 0, + "Percentage of cpus that can be used by the metaslab taskq"); + +/* + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. + */ +int metaslab_unload_delay = TXG_SIZE * 2; +TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, + &metaslab_unload_delay, 0, + "Number of TXGs that an unused metaslab can be kept in memory"); /* * Should we be willing to write data to degraded vdevs? @@ -160,12 +189,41 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_ TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, + &metaslab_preload_limit, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, + &metaslab_preload_enabled, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; +TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", + &metaslab_weight_factor_enable); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, + &metaslab_weight_factor_enable, 0, + "Enable additional weight factor for each metaslab"); + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -296,9 +354,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -366,6 +424,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -435,6 +496,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -515,130 +578,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + metaslab_t *msp = arg; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } - - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + metaslab_t *msp = arg; - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } + metaslab_t *msp = arg; - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -647,29 +780,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:27:52 2014 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 ESMTPS id C36B3E96; Mon, 17 Feb 2014 17:27:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADE661A27; Mon, 17 Feb 2014 17:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHRqcj060576; Mon, 17 Feb 2014 17:27:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHRq69060575; Mon, 17 Feb 2014 17:27:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171727.s1HHRq69060575@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262096 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:27:52 -0000 Author: avg Date: Mon Feb 17 17:27:52 2014 New Revision: 262096 URL: http://svnweb.freebsd.org/changeset/base/262096 Log: MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_remove Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:12:11 2014 (r262095) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:27:52 2014 (r262096) @@ -6745,14 +6745,16 @@ vop_deleteextattr { UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { ZFS_EXIT(zfsvfs); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ENOENT) error = ENOATTR; return (error); } + error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); + NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (vp == nd.ni_dvp) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:28:06 2014 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 ESMTPS id 926F5FCC; Mon, 17 Feb 2014 17:28:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA761A2D; Mon, 17 Feb 2014 17:28:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHS68h060651; Mon, 17 Feb 2014 17:28:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHS6hJ060650; Mon, 17 Feb 2014 17:28:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171728.s1HHS6hJ060650@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:28:06 +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: r262097 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:28:06 -0000 Author: avg Date: Mon Feb 17 17:28:06 2014 New Revision: 262097 URL: http://svnweb.freebsd.org/changeset/base/262097 Log: MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_remove Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:27:52 2014 (r262096) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:28:06 2014 (r262097) @@ -6672,14 +6672,16 @@ vop_deleteextattr { UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { ZFS_EXIT(zfsvfs); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ENOENT) error = ENOATTR; return (error); } + error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); + NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (vp == nd.ni_dvp) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:28:20 2014 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 ESMTPS id 19946178; Mon, 17 Feb 2014 17:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02ABB1A31; Mon, 17 Feb 2014 17:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHSJYj060711; Mon, 17 Feb 2014 17:28:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHSJwK060710; Mon, 17 Feb 2014 17:28:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171728.s1HHSJwK060710@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:28:19 +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: r262098 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:28:20 -0000 Author: avg Date: Mon Feb 17 17:28:19 2014 New Revision: 262098 URL: http://svnweb.freebsd.org/changeset/base/262098 Log: MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_remove Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:28:06 2014 (r262097) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:28:19 2014 (r262098) @@ -6456,14 +6456,16 @@ vop_deleteextattr { UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { ZFS_EXIT(zfsvfs); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ENOENT) error = ENOATTR; return (error); } + error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); + NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (vp == nd.ni_dvp) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:42:35 2014 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 ESMTPS id 21E9E75D; Mon, 17 Feb 2014 17:42:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0A81BED; Mon, 17 Feb 2014 17:42:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHgYFp067677; Mon, 17 Feb 2014 17:42:34 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHgYLI067669; Mon, 17 Feb 2014 17:42:34 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171742.s1HHgYLI067669@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:42:34 +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: r262099 - in stable/8/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common lib/libzpool/common lib/libzpool/common/sys 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:42:35 -0000 Author: avg Date: Mon Feb 17 17:42:33 2014 New Revision: 262099 URL: http://svnweb.freebsd.org/changeset/base/262099 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Missed userland bits. Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:42:33 2014 (r262099) @@ -1304,12 +1304,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; @@ -1318,7 +1319,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) { @@ -1372,6 +1373,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); @@ -1414,6 +1419,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, @@ -4277,6 +4288,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: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:42:33 2014 (r262099) @@ -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: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:42:33 2014 (r262099) @@ -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: stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:42:33 2014 (r262099) @@ -623,6 +623,12 @@ dprintf_setup(int *argc, char **argv) dprintf_print_all = 1; } +int +sysctl_handle_64(SYSCTL_HANDLER_ARGS) +{ + return (0); +} + /* * ========================================================================= * debug printfs Modified: stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:42:33 2014 (r262099) @@ -684,11 +684,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(...) #ifdef TUNABLE_INT #undef TUNABLE_INT @@ -699,6 +743,8 @@ typedef uint32_t idmap_rid_t; #define TUNABLE_ULONG(...) #define TUNABLE_QUAD(...) +int sysctl_handle_64(SYSCTL_HANDLER_ARGS); + /* Errors */ #ifndef ERESTART From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:43:15 2014 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 ESMTPS id 19A4889A; Mon, 17 Feb 2014 17:43:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02CCE1BFA; Mon, 17 Feb 2014 17:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHhErM067883; Mon, 17 Feb 2014 17:43:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHhDtZ067878; Mon, 17 Feb 2014 17:43:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171743.s1HHhDtZ067878@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:43: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: r262100 - in stable/9/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common lib/libzpool/common lib/libzpool/common/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:43:15 -0000 Author: avg Date: Mon Feb 17 17:43:13 2014 New Revision: 262100 URL: http://svnweb.freebsd.org/changeset/base/262100 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Missed userland bits. Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:43:13 2014 (r262100) @@ -1294,12 +1294,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; @@ -1308,7 +1309,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) { @@ -1362,6 +1363,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); @@ -1404,6 +1409,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, @@ -4267,6 +4278,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: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:43:13 2014 (r262100) @@ -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: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:43:13 2014 (r262100) @@ -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: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:43:13 2014 (r262100) @@ -626,6 +626,12 @@ dprintf_setup(int *argc, char **argv) dprintf_print_all = 1; } +int +sysctl_handle_64(SYSCTL_HANDLER_ARGS) +{ + return (0); +} + /* * ========================================================================= * debug printfs Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:43:13 2014 (r262100) @@ -688,11 +688,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 @@ -704,6 +748,8 @@ typedef uint32_t idmap_rid_t; #define TUNABLE_ULONG(...) #define TUNABLE_QUAD(...) +int sysctl_handle_64(SYSCTL_HANDLER_ARGS); + /* Errors */ #ifndef ERESTART From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:46:16 2014 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 ESMTPS id 8B0CFAEE; Mon, 17 Feb 2014 17:46:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 757911C24; Mon, 17 Feb 2014 17:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHkGIb068717; Mon, 17 Feb 2014 17:46:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHkGuJ068715; Mon, 17 Feb 2014 17:46:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171746.s1HHkGuJ068715@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262101 - in stable/10/cddl: contrib/opensolaris/cmd/zinject usr.bin/zinject X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:46:16 -0000 Author: avg Date: Mon Feb 17 17:46:15 2014 New Revision: 262101 URL: http://svnweb.freebsd.org/changeset/base/262101 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/10/cddl/usr.bin/zinject/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:43:13 2014 (r262100) +++ stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:15 2014 (r262101) @@ -148,6 +148,7 @@ #include #include +#include #undef verify /* both libzfs.h and zfs_context.h want to define this */ Modified: stable/10/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zinject/Makefile Mon Feb 17 17:43:13 2014 (r262100) +++ stable/10/cddl/usr.bin/zinject/Makefile Mon Feb 17 17:46:15 2014 (r262101) @@ -16,6 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:46:26 2014 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 ESMTPS id 03600C15; Mon, 17 Feb 2014 17:46:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3B141C28; Mon, 17 Feb 2014 17:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHkPLk068783; Mon, 17 Feb 2014 17:46:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHkP4J068782; Mon, 17 Feb 2014 17:46:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171746.s1HHkP4J068782@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:46: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: r262102 - stable/9/cddl/contrib/opensolaris/cmd/zinject 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:46:26 -0000 Author: avg Date: Mon Feb 17 17:46:25 2014 New Revision: 262102 URL: http://svnweb.freebsd.org/changeset/base/262102 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:15 2014 (r262101) +++ stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:25 2014 (r262102) @@ -148,6 +148,7 @@ #include #include +#include #undef verify /* both libzfs.h and zfs_context.h want to define this */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:46:33 2014 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 ESMTPS id D4D82D49; Mon, 17 Feb 2014 17:46:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0F931C2A; Mon, 17 Feb 2014 17:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHkX4r068847; Mon, 17 Feb 2014 17:46:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHkXdn068846; Mon, 17 Feb 2014 17:46:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171746.s1HHkXdn068846@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:46:33 +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: r262103 - stable/8/cddl/contrib/opensolaris/cmd/zinject 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:46:33 -0000 Author: avg Date: Mon Feb 17 17:46:33 2014 New Revision: 262103 URL: http://svnweb.freebsd.org/changeset/base/262103 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:25 2014 (r262102) +++ stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:33 2014 (r262103) @@ -147,6 +147,7 @@ #include #include +#include #undef verify /* both libzfs.h and zfs_context.h want to define this */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:48:38 2014 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 ESMTPS id EA577EA2; Mon, 17 Feb 2014 17:48:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5E101C3E; Mon, 17 Feb 2014 17:48:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHmctG069312; Mon, 17 Feb 2014 17:48:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHmcQv069311; Mon, 17 Feb 2014 17:48:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171748.s1HHmcQv069311@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262104 - stable/10/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:48:39 -0000 Author: avg Date: Mon Feb 17 17:48:38 2014 New Revision: 262104 URL: http://svnweb.freebsd.org/changeset/base/262104 Log: MFC r260811: zdb -R: do not treat numeric parameters to a flag as more flags Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:46:33 2014 (r262103) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:38 2014 (r262104) @@ -2960,6 +2960,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:48:51 2014 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 ESMTPS id 56BBBFD5; Mon, 17 Feb 2014 17:48:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 424191C43; Mon, 17 Feb 2014 17:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHmpMF069386; Mon, 17 Feb 2014 17:48:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHmp6a069385; Mon, 17 Feb 2014 17:48:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171748.s1HHmp6a069385@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:48:51 +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: r262105 - stable/9/cddl/contrib/opensolaris/cmd/zdb 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:48:51 -0000 Author: avg Date: Mon Feb 17 17:48:50 2014 New Revision: 262105 URL: http://svnweb.freebsd.org/changeset/base/262105 Log: MFC r260811: zdb -R: do not treat numeric parameters to a flag as more flags Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:38 2014 (r262104) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:50 2014 (r262105) @@ -2960,6 +2960,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:49:04 2014 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 ESMTPS id 657AA17E; Mon, 17 Feb 2014 17:49:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 514201C47; Mon, 17 Feb 2014 17:49:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHn43K069485; Mon, 17 Feb 2014 17:49:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHn4KQ069484; Mon, 17 Feb 2014 17:49:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171749.s1HHn4KQ069484@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:49: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: r262106 - stable/8/cddl/contrib/opensolaris/cmd/zdb 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:49:04 -0000 Author: avg Date: Mon Feb 17 17:49:03 2014 New Revision: 262106 URL: http://svnweb.freebsd.org/changeset/base/262106 Log: MFC r260811: zdb -R: do not treat numeric parameters to a flag as more flags Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:50 2014 (r262105) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:49:03 2014 (r262106) @@ -2960,6 +2960,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:51:50 2014 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 ESMTPS id AC521533; Mon, 17 Feb 2014 17:51:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9682F1CE3; Mon, 17 Feb 2014 17:51:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHpoUF072791; Mon, 17 Feb 2014 17:51:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHpo2o072790; Mon, 17 Feb 2014 17:51:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171751.s1HHpo2o072790@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262107 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:51:50 -0000 Author: avg Date: Mon Feb 17 17:51:50 2014 New Revision: 262107 URL: http://svnweb.freebsd.org/changeset/base/262107 Log: MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before DMU_USERUSED_OBJECT Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:49:03 2014 (r262106) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:50 2014 (r262107) @@ -329,9 +329,9 @@ traverse_visitbp(traverse_data_t *td, co prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { - prefetch_dnode_metadata(td, &osp->os_userused_dnode, - zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + zb->zb_objset, DMU_GROUPUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_userused_dnode, zb->zb_objset, DMU_USERUSED_OBJECT); } @@ -342,18 +342,18 @@ traverse_visitbp(traverse_data_t *td, co err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_userused_dnode; + dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_USERUSED_OBJECT); + DMU_GROUPUSED_OBJECT); } if (err && hard) { lasterr = err; err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_groupused_dnode; + dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_GROUPUSED_OBJECT); + DMU_USERUSED_OBJECT); } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:52:00 2014 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 ESMTPS id 5C571661; Mon, 17 Feb 2014 17:52:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47C0B1CE4; Mon, 17 Feb 2014 17:52:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHq0sb072866; Mon, 17 Feb 2014 17:52:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHq0xR072865; Mon, 17 Feb 2014 17:52:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171752.s1HHq0xR072865@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:52:00 +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: r262108 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:52:00 -0000 Author: avg Date: Mon Feb 17 17:51:59 2014 New Revision: 262108 URL: http://svnweb.freebsd.org/changeset/base/262108 Log: MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before DMU_USERUSED_OBJECT Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.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/dmu_traverse.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:50 2014 (r262107) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:59 2014 (r262108) @@ -329,9 +329,9 @@ traverse_visitbp(traverse_data_t *td, co prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { - prefetch_dnode_metadata(td, &osp->os_userused_dnode, - zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + zb->zb_objset, DMU_GROUPUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_userused_dnode, zb->zb_objset, DMU_USERUSED_OBJECT); } @@ -342,18 +342,18 @@ traverse_visitbp(traverse_data_t *td, co err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_userused_dnode; + dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_USERUSED_OBJECT); + DMU_GROUPUSED_OBJECT); } if (err && hard) { lasterr = err; err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_groupused_dnode; + dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_GROUPUSED_OBJECT); + DMU_USERUSED_OBJECT); } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:52:15 2014 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 ESMTPS id 4B6358AE; Mon, 17 Feb 2014 17:52:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E92A1CF6; Mon, 17 Feb 2014 17:52:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHqEuV072975; Mon, 17 Feb 2014 17:52:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHqE8S072974; Mon, 17 Feb 2014 17:52:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171752.s1HHqE8S072974@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:52: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: r262109 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:52:15 -0000 Author: avg Date: Mon Feb 17 17:52:14 2014 New Revision: 262109 URL: http://svnweb.freebsd.org/changeset/base/262109 Log: MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before DMU_USERUSED_OBJECT Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.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/dmu_traverse.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:59 2014 (r262108) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:52:14 2014 (r262109) @@ -329,9 +329,9 @@ traverse_visitbp(traverse_data_t *td, co prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { - prefetch_dnode_metadata(td, &osp->os_userused_dnode, - zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + zb->zb_objset, DMU_GROUPUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_userused_dnode, zb->zb_objset, DMU_USERUSED_OBJECT); } @@ -342,18 +342,18 @@ traverse_visitbp(traverse_data_t *td, co err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_userused_dnode; + dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_USERUSED_OBJECT); + DMU_GROUPUSED_OBJECT); } if (err && hard) { lasterr = err; err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_groupused_dnode; + dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_GROUPUSED_OBJECT); + DMU_USERUSED_OBJECT); } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:59:52 2014 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 ESMTPS id 93789691; Mon, 17 Feb 2014 17:59:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 711391DFC; Mon, 17 Feb 2014 17:59:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHxqBJ074285; Mon, 17 Feb 2014 17:59:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHxp3U074282; Mon, 17 Feb 2014 17:59:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171759.s1HHxp3U074282@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:59:51 +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: r262110 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 17:59:52 -0000 Author: avg Date: Mon Feb 17 17:59:51 2014 New Revision: 262110 URL: http://svnweb.freebsd.org/changeset/base/262110 Log: MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of a zfs transaction Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 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_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 17:52:14 2014 (r262109) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 17:59:51 2014 (r262110) @@ -951,6 +951,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * return (SET_ERROR(EDQUOT)); } + getnewvnode_reserve(1); + tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -985,6 +987,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + *xvpp = ZTOV(xzp); return (0); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:52:14 2014 (r262109) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:59:51 2014 (r262110) @@ -1644,6 +1644,9 @@ zfs_create(vnode_t *dvp, char *name, vat return (error); } } + + getnewvnode_reserve(1); + top: *vpp = NULL; @@ -1672,6 +1675,7 @@ top: zfs_acl_ids_free(&acl_ids); if (strcmp(name, "..") == 0) error = SET_ERROR(EISDIR); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1740,6 +1744,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1806,6 +1811,7 @@ top: } } out: + getnewvnode_drop_reserve(); if (dl) zfs_dirent_unlock(dl); @@ -2149,6 +2155,9 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + /* * First make sure the new directory doesn't exist. * @@ -2162,6 +2171,7 @@ top: if (error = zfs_dirent_lock(&dl, dzp, dirname, &zp, zf, NULL, NULL)) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2169,6 +2179,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2176,6 +2187,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -2208,6 +2220,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2237,6 +2250,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) @@ -4120,6 +4135,9 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + top: /* * Attempt to lock directory; fail if entry already exists. @@ -4127,6 +4145,7 @@ top: error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg, NULL, NULL); if (error) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4134,6 +4153,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4141,6 +4161,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -4168,6 +4189,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4206,6 +4228,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) 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 Mon Feb 17 17:52:14 2014 (r262109) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 17:59:51 2014 (r262110) @@ -624,6 +624,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + KASSERT(curthread->td_vp_reserv > 0, + ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -832,7 +834,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } - getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1019,7 +1020,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); - getnewvnode_drop_reserve(); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:00:04 2014 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 ESMTPS id F2B587BA; Mon, 17 Feb 2014 18:00:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1F341E03; Mon, 17 Feb 2014 18:00:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI03pR074534; Mon, 17 Feb 2014 18:00:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI03Qs074525; Mon, 17 Feb 2014 18:00:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171800.s1HI03Qs074525@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:00:03 +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: r262111 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:00:04 -0000 Author: avg Date: Mon Feb 17 18:00:02 2014 New Revision: 262111 URL: http://svnweb.freebsd.org/changeset/base/262111 Log: MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of a zfs transaction Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 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_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 17:59:51 2014 (r262110) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 18:00:02 2014 (r262111) @@ -951,6 +951,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * return (SET_ERROR(EDQUOT)); } + getnewvnode_reserve(1); + tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -985,6 +987,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + *xvpp = ZTOV(xzp); return (0); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:59:51 2014 (r262110) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 18:00:02 2014 (r262111) @@ -1620,6 +1620,9 @@ zfs_create(vnode_t *dvp, char *name, vat return (error); } } + + getnewvnode_reserve(1); + top: *vpp = NULL; @@ -1648,6 +1651,7 @@ top: zfs_acl_ids_free(&acl_ids); if (strcmp(name, "..") == 0) error = SET_ERROR(EISDIR); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1716,6 +1720,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1782,6 +1787,7 @@ top: } } out: + getnewvnode_drop_reserve(); if (dl) zfs_dirent_unlock(dl); @@ -2125,6 +2131,9 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + /* * First make sure the new directory doesn't exist. * @@ -2138,6 +2147,7 @@ top: if (error = zfs_dirent_lock(&dl, dzp, dirname, &zp, zf, NULL, NULL)) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2145,6 +2155,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2152,6 +2163,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -2184,6 +2196,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2213,6 +2226,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) @@ -4096,6 +4111,9 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + top: /* * Attempt to lock directory; fail if entry already exists. @@ -4103,6 +4121,7 @@ top: error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg, NULL, NULL); if (error) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4110,6 +4129,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4117,6 +4137,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -4144,6 +4165,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4182,6 +4204,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) 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 Mon Feb 17 17:59:51 2014 (r262110) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 18:00:02 2014 (r262111) @@ -624,6 +624,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + KASSERT(curthread->td_vp_reserv > 0, + ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -832,7 +834,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } - getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1019,7 +1020,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); - getnewvnode_drop_reserve(); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:00:25 2014 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 ESMTPS id 9C83890A; Mon, 17 Feb 2014 18:00:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CDD91E10; Mon, 17 Feb 2014 18:00:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI0PPs076277; Mon, 17 Feb 2014 18:00:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI0OME076271; Mon, 17 Feb 2014 18:00:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171800.s1HI0OME076271@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262112 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:00:25 -0000 Author: avg Date: Mon Feb 17 18:00:24 2014 New Revision: 262112 URL: http://svnweb.freebsd.org/changeset/base/262112 Log: MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of a zfs transaction Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 18:00:02 2014 (r262111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 18:00:24 2014 (r262112) @@ -951,6 +951,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * return (SET_ERROR(EDQUOT)); } + getnewvnode_reserve(1); + tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -985,6 +987,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + *xvpp = ZTOV(xzp); return (0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 18:00:02 2014 (r262111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 18:00:24 2014 (r262112) @@ -1625,6 +1625,9 @@ zfs_create(vnode_t *dvp, char *name, vat return (error); } } + + getnewvnode_reserve(1); + top: *vpp = NULL; @@ -1653,6 +1656,7 @@ top: zfs_acl_ids_free(&acl_ids); if (strcmp(name, "..") == 0) error = SET_ERROR(EISDIR); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1721,6 +1725,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1787,6 +1792,7 @@ top: } } out: + getnewvnode_drop_reserve(); if (dl) zfs_dirent_unlock(dl); @@ -2130,6 +2136,9 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + /* * First make sure the new directory doesn't exist. * @@ -2143,6 +2152,7 @@ top: if (error = zfs_dirent_lock(&dl, dzp, dirname, &zp, zf, NULL, NULL)) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2150,6 +2160,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2157,6 +2168,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -2189,6 +2201,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2218,6 +2231,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) @@ -4109,6 +4124,9 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + top: /* * Attempt to lock directory; fail if entry already exists. @@ -4116,6 +4134,7 @@ top: error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg, NULL, NULL); if (error) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4123,6 +4142,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4130,6 +4150,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -4157,6 +4178,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4195,6 +4217,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 18:00:02 2014 (r262111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 18:00:24 2014 (r262112) @@ -624,6 +624,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + KASSERT(curthread->td_vp_reserv > 0, + ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -832,7 +834,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } - getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1019,7 +1020,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); - getnewvnode_drop_reserve(); } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:06:38 2014 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 ESMTPS id 68E5CDD8; Mon, 17 Feb 2014 18:06:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54A2F1FD3; Mon, 17 Feb 2014 18:06:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI6cfS078432; Mon, 17 Feb 2014 18:06:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI6cCN078431; Mon, 17 Feb 2014 18:06:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171806.s1HI6cCN078431@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:06: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: r262113 - stable/9/cddl/usr.bin/zinject 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:06:38 -0000 Author: avg Date: Mon Feb 17 18:06:37 2014 New Revision: 262113 URL: http://svnweb.freebsd.org/changeset/base/262113 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/9/cddl/usr.bin/zinject/Makefile Directory Properties: stable/9/cddl/usr.bin/zinject/ (props changed) Modified: stable/9/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/9/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:00:24 2014 (r262112) +++ stable/9/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:06:37 2014 (r262113) @@ -16,6 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:07:08 2014 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 ESMTPS id 73792188; Mon, 17 Feb 2014 18:07:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F3651FF7; Mon, 17 Feb 2014 18:07:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI78H2078562; Mon, 17 Feb 2014 18:07:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI78mC078561; Mon, 17 Feb 2014 18:07:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171807.s1HI78mC078561@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:07:08 +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: r262114 - stable/8/cddl/usr.bin/zinject 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:07:08 -0000 Author: avg Date: Mon Feb 17 18:07:07 2014 New Revision: 262114 URL: http://svnweb.freebsd.org/changeset/base/262114 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/8/cddl/usr.bin/zinject/Makefile Directory Properties: stable/8/cddl/usr.bin/zinject/ (props changed) Modified: stable/8/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/8/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:06:37 2014 (r262113) +++ stable/8/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:07:07 2014 (r262114) @@ -15,6 +15,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:16:26 2014 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 ESMTPS id 002AE5E9; Mon, 17 Feb 2014 18:16:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCC5E111D; Mon, 17 Feb 2014 18:16:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIGPcU082722; Mon, 17 Feb 2014 18:16:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIGP5E082721; Mon, 17 Feb 2014 18:16:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171816.s1HIGP5E082721@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262115 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:16:26 -0000 Author: avg Date: Mon Feb 17 18:16:25 2014 New Revision: 262115 URL: http://svnweb.freebsd.org/changeset/base/262115 Log: MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:07:07 2014 (r262114) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:25 2014 (r262115) @@ -21,7 +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 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4593,6 +4593,13 @@ l2arc_write_done(zio_t *zio) */ for (ab = list_prev(buflist, head); ab; ab = ab_prev) { ab_prev = list_prev(buflist, ab); + abl2 = ab->b_l2hdr; + + /* + * Release the temporary compressed buffer as soon as possible. + */ + if (abl2->b_compress != ZIO_COMPRESS_OFF) + l2arc_release_cdata_buf(ab); hash_lock = HDR_LOCK(ab); if (!mutex_tryenter(hash_lock)) { @@ -4605,14 +4612,6 @@ l2arc_write_done(zio_t *zio) continue; } - abl2 = ab->b_l2hdr; - - /* - * Release the temporary compressed buffer as soon as possible. - */ - if (abl2->b_compress != ZIO_COMPRESS_OFF) - l2arc_release_cdata_buf(ab); - if (zio->io_error != 0) { /* * Error - drop L2ARC entry. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:16:37 2014 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 ESMTPS id 80325714; Mon, 17 Feb 2014 18:16:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6969C1120; Mon, 17 Feb 2014 18:16:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIGbla082779; Mon, 17 Feb 2014 18:16:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIGbeX082778; Mon, 17 Feb 2014 18:16:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171816.s1HIGbeX082778@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:16: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: r262116 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:16:37 -0000 Author: avg Date: Mon Feb 17 18:16:36 2014 New Revision: 262116 URL: http://svnweb.freebsd.org/changeset/base/262116 Log: MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:25 2014 (r262115) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:36 2014 (r262116) @@ -21,7 +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 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4593,6 +4593,13 @@ l2arc_write_done(zio_t *zio) */ for (ab = list_prev(buflist, head); ab; ab = ab_prev) { ab_prev = list_prev(buflist, ab); + abl2 = ab->b_l2hdr; + + /* + * Release the temporary compressed buffer as soon as possible. + */ + if (abl2->b_compress != ZIO_COMPRESS_OFF) + l2arc_release_cdata_buf(ab); hash_lock = HDR_LOCK(ab); if (!mutex_tryenter(hash_lock)) { @@ -4605,14 +4612,6 @@ l2arc_write_done(zio_t *zio) continue; } - abl2 = ab->b_l2hdr; - - /* - * Release the temporary compressed buffer as soon as possible. - */ - if (abl2->b_compress != ZIO_COMPRESS_OFF) - l2arc_release_cdata_buf(ab); - if (zio->io_error != 0) { /* * Error - drop L2ARC entry. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:16:51 2014 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 ESMTPS id 27646841; Mon, 17 Feb 2014 18:16:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11EA11126; Mon, 17 Feb 2014 18:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIGo7e082838; Mon, 17 Feb 2014 18:16:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIGo7H082836; Mon, 17 Feb 2014 18:16:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171816.s1HIGo7H082836@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:16:50 +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: r262117 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:16:51 -0000 Author: avg Date: Mon Feb 17 18:16:50 2014 New Revision: 262117 URL: http://svnweb.freebsd.org/changeset/base/262117 Log: MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:36 2014 (r262116) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:50 2014 (r262117) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * 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) 2014 by Saso Kiselkov. All rights reserved. */ /* @@ -4563,6 +4563,13 @@ l2arc_write_done(zio_t *zio) */ for (ab = list_prev(buflist, head); ab; ab = ab_prev) { ab_prev = list_prev(buflist, ab); + abl2 = ab->b_l2hdr; + + /* + * Release the temporary compressed buffer as soon as possible. + */ + if (abl2->b_compress != ZIO_COMPRESS_OFF) + l2arc_release_cdata_buf(ab); hash_lock = HDR_LOCK(ab); if (!mutex_tryenter(hash_lock)) { @@ -4575,14 +4582,6 @@ l2arc_write_done(zio_t *zio) continue; } - abl2 = ab->b_l2hdr; - - /* - * Release the temporary compressed buffer as soon as possible. - */ - if (abl2->b_compress != ZIO_COMPRESS_OFF) - l2arc_release_cdata_buf(ab); - if (zio->io_error != 0) { /* * Error - drop L2ARC entry. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:24:26 2014 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 ESMTPS id DD19AF41; Mon, 17 Feb 2014 18:24:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD44D11D5; Mon, 17 Feb 2014 18:24:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIOQmh086913; Mon, 17 Feb 2014 18:24:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIOP4N086907; Mon, 17 Feb 2014 18:24:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171824.s1HIOP4N086907@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:24: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: r262118 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:24:26 -0000 Author: avg Date: Mon Feb 17 18:24:25 2014 New Revision: 262118 URL: http://svnweb.freebsd.org/changeset/base/262118 Log: MFC r260185: MFV r260155: 4391 panic system rather than corrupting pool if we hit bug 4390 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h 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/bptree.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:25 2014 (r262118) @@ -180,6 +180,7 @@ bptree_iterate(objset_t *os, uint64_t ob err = 0; for (i = ba.ba_phys->bt_begin; i < ba.ba_phys->bt_end; i++) { bptree_entry_phys_t bte; + int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; ASSERT(!free || i == ba.ba_phys->bt_begin); @@ -188,13 +189,13 @@ bptree_iterate(objset_t *os, uint64_t ob if (err != 0) break; + if (zfs_recover) + flags |= TRAVERSE_HARD; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, - TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - ASSERT(err == 0 || err == ERESTART); - if (err != 0) { + if (err == ERESTART) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); @@ -202,11 +203,21 @@ bptree_iterate(objset_t *os, uint64_t ob dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); break; - } else { - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); } + if (err != 0) { + /* + * We can not properly handle an i/o + * error, because the traversal code + * does not know how to resume from an + * arbitrary bookmark. + */ + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); + } + + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); } } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:25 2014 (r262118) @@ -361,7 +361,7 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:25 2014 (r262118) @@ -1347,6 +1347,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s { uint64_t elapsed_nanosecs; + if (zfs_recover) + return (B_FALSE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:25 2014 (r262118) @@ -252,6 +252,8 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * zfs_recover can be set to nonzero to attempt to recover from * otherwise-fatal errors, typically caused by on-disk corruption. When * set, calls to zfs_panic_recover() will turn into warning messages. + * This should only be used as a last resort, as it typically results + * in leaked space, or worse. */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:25 2014 (r262118) @@ -49,6 +49,7 @@ extern "C" { #endif extern int zfs_flags; +extern int zfs_recover; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:24:39 2014 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 ESMTPS id 3E7AEE9; Mon, 17 Feb 2014 18:24:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE5411D9; Mon, 17 Feb 2014 18:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIOcMv086975; Mon, 17 Feb 2014 18:24:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIOcXO086968; Mon, 17 Feb 2014 18:24:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171824.s1HIOcXO086968@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:24:38 +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: r262119 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:24:39 -0000 Author: avg Date: Mon Feb 17 18:24:37 2014 New Revision: 262119 URL: http://svnweb.freebsd.org/changeset/base/262119 Log: MFC r260185: MFV r260155: 4391 panic system rather than corrupting pool if we hit bug 4390 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h 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/bptree.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:37 2014 (r262119) @@ -180,6 +180,7 @@ bptree_iterate(objset_t *os, uint64_t ob err = 0; for (i = ba.ba_phys->bt_begin; i < ba.ba_phys->bt_end; i++) { bptree_entry_phys_t bte; + int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; ASSERT(!free || i == ba.ba_phys->bt_begin); @@ -188,13 +189,13 @@ bptree_iterate(objset_t *os, uint64_t ob if (err != 0) break; + if (zfs_recover) + flags |= TRAVERSE_HARD; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, - TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - ASSERT(err == 0 || err == ERESTART); - if (err != 0) { + if (err == ERESTART) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); @@ -202,11 +203,21 @@ bptree_iterate(objset_t *os, uint64_t ob dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); break; - } else { - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); } + if (err != 0) { + /* + * We can not properly handle an i/o + * error, because the traversal code + * does not know how to resume from an + * arbitrary bookmark. + */ + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); + } + + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:37 2014 (r262119) @@ -361,7 +361,7 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:37 2014 (r262119) @@ -1347,6 +1347,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s { uint64_t elapsed_nanosecs; + if (zfs_recover) + return (B_FALSE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:37 2014 (r262119) @@ -252,6 +252,8 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * zfs_recover can be set to nonzero to attempt to recover from * otherwise-fatal errors, typically caused by on-disk corruption. When * set, calls to zfs_panic_recover() will turn into warning messages. + * This should only be used as a last resort, as it typically results + * in leaked space, or worse. */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:37 2014 (r262119) @@ -49,6 +49,7 @@ extern "C" { #endif extern int zfs_flags; +extern int zfs_recover; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:25:43 2014 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 ESMTPS id 69E3222C; Mon, 17 Feb 2014 18:25:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8C11E4; Mon, 17 Feb 2014 18:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIPhai087169; Mon, 17 Feb 2014 18:25:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIPgES087164; Mon, 17 Feb 2014 18:25:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171825.s1HIPgES087164@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262120 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:25:43 -0000 Author: avg Date: Mon Feb 17 18:25:41 2014 New Revision: 262120 URL: http://svnweb.freebsd.org/changeset/base/262120 Log: MFC r260185: MFV r260155: 4391 panic system rather than corrupting pool if we hit bug 4390 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:25:41 2014 (r262120) @@ -180,6 +180,7 @@ bptree_iterate(objset_t *os, uint64_t ob err = 0; for (i = ba.ba_phys->bt_begin; i < ba.ba_phys->bt_end; i++) { bptree_entry_phys_t bte; + int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; ASSERT(!free || i == ba.ba_phys->bt_begin); @@ -188,13 +189,13 @@ bptree_iterate(objset_t *os, uint64_t ob if (err != 0) break; + if (zfs_recover) + flags |= TRAVERSE_HARD; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, - TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - ASSERT(err == 0 || err == ERESTART); - if (err != 0) { + if (err == ERESTART) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); @@ -202,11 +203,21 @@ bptree_iterate(objset_t *os, uint64_t ob dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); break; - } else { - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); } + if (err != 0) { + /* + * We can not properly handle an i/o + * error, because the traversal code + * does not know how to resume from an + * arbitrary bookmark. + */ + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); + } + + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); } } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:25:41 2014 (r262120) @@ -361,7 +361,7 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:25:41 2014 (r262120) @@ -1347,6 +1347,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s { uint64_t elapsed_nanosecs; + if (zfs_recover) + return (B_FALSE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:25:41 2014 (r262120) @@ -252,6 +252,8 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * zfs_recover can be set to nonzero to attempt to recover from * otherwise-fatal errors, typically caused by on-disk corruption. When * set, calls to zfs_panic_recover() will turn into warning messages. + * This should only be used as a last resort, as it typically results + * in leaked space, or worse. */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:25:41 2014 (r262120) @@ -49,6 +49,7 @@ extern "C" { #endif extern int zfs_flags; +extern int zfs_recover; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 18:50:06 2014 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 ESMTPS id 4DEF29F8; Mon, 17 Feb 2014 18:50:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 363F413D5; Mon, 17 Feb 2014 18:50:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIo6Ib095829; Mon, 17 Feb 2014 18:50:06 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIo4vf095817; Mon, 17 Feb 2014 18:50:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402171850.s1HIo4vf095817@svn.freebsd.org> From: Ed Maste Date: Mon, 17 Feb 2014 18:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262121 - in head: contrib/llvm/tools/lldb/include/lldb/Expression contrib/llvm/tools/lldb/source/Core contrib/llvm/tools/lldb/source/Expression contrib/llvm/tools/lldb/source/Host/comm... 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 18:50:06 -0000 Author: emaste Date: Mon Feb 17 18:50:03 2014 New Revision: 262121 URL: http://svnweb.freebsd.org/changeset/base/262121 Log: Update lldb for clang/llvm 3.4 import This commit largely restores the lldb source to the upstream r196259 snapshot with the addition of threaded inferior support and a few bug fixes. Specific upstream lldb revisions restored include: SVN git 181387 779e6ac 181703 7bef4e2 182099 b31044e 182650 f2dcf35 182683 0d91b80 183862 15c1774 183929 99447a6 184177 0b2934b 184948 4dc3761 184954 007e7bc 186990 eebd175 Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.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 head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp head/usr.bin/clang/lldb/Makefile Modified: head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/include/lldb/Expression/IRExecutionUnit.h Mon Feb 17 18:50:03 2014 (r262121) @@ -18,7 +18,6 @@ #include // Other libraries and framework includes -#include "llvm/ADT/StringRef.h" #include "llvm/IR/Module.h" // Project includes @@ -288,7 +287,8 @@ private: /// Allocated space. //------------------------------------------------------------------ virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID); + unsigned SectionID, + llvm::StringRef SectionName); //------------------------------------------------------------------ /// Allocate space for data, and add it to the m_spaceBlocks map @@ -309,7 +309,9 @@ private: /// Allocated space. //------------------------------------------------------------------ virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID, bool IsReadOnly); + unsigned SectionID, + llvm::StringRef SectionName, + bool IsReadOnly); //------------------------------------------------------------------ /// Allocate space for a global variable, and add it to the @@ -337,7 +339,13 @@ private: /// @return /// True in case of failure, false in case of success. //------------------------------------------------------------------ - bool applyPermissions(std::string *ErrMsg) { return false; } + 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; + } //------------------------------------------------------------------ /// Passthrough interface stub @@ -347,38 +355,6 @@ 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(); } @@ -416,7 +392,7 @@ private: } virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) { - return m_default_mm_ap->registerEHFrames(llvm::StringRef((const char *)Addr, Size)); + return m_default_mm_ap->registerEHFrames(Addr, LoadAddr, Size); } //------------------------------------------------------------------ Modified: head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -158,60 +158,60 @@ ArchSpec::AutoComplete (const char *name #define SUBTYPE_MASK 0x00FFFFFFu static const ArchDefinitionEntry g_macho_arch_entries[] = { - { ArchSpec::eCore_arm_generic , llvm::MachO::CPUTypeARM , CPU_ANY, UINT32_MAX , UINT32_MAX }, - { ArchSpec::eCore_arm_generic , llvm::MachO::CPUTypeARM , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv4 , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv4t , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv6 , llvm::MachO::CPUTypeARM , 6 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv6m , llvm::MachO::CPUTypeARM , 14 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv5 , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv5e , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv5t , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_xscale , llvm::MachO::CPUTypeARM , 8 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7 , llvm::MachO::CPUTypeARM , 9 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7f , llvm::MachO::CPUTypeARM , 10 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7s , llvm::MachO::CPUTypeARM , 11 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7k , llvm::MachO::CPUTypeARM , 12 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7m , llvm::MachO::CPUTypeARM , 15 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_arm_armv7em , llvm::MachO::CPUTypeARM , 16 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumb , llvm::MachO::CPUTypeARM , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv4t , llvm::MachO::CPUTypeARM , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv5 , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv5e , llvm::MachO::CPUTypeARM , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv6 , llvm::MachO::CPUTypeARM , 6 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv6m , llvm::MachO::CPUTypeARM , 14 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7 , llvm::MachO::CPUTypeARM , 9 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7f , llvm::MachO::CPUTypeARM , 10 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7s , llvm::MachO::CPUTypeARM , 11 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7k , llvm::MachO::CPUTypeARM , 12 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7m , llvm::MachO::CPUTypeARM , 15 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_thumbv7em , llvm::MachO::CPUTypeARM , 16 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_generic , llvm::MachO::CPUTypePowerPC , CPU_ANY, UINT32_MAX , UINT32_MAX }, - { ArchSpec::eCore_ppc_generic , llvm::MachO::CPUTypePowerPC , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc601 , llvm::MachO::CPUTypePowerPC , 1 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc602 , llvm::MachO::CPUTypePowerPC , 2 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc603 , llvm::MachO::CPUTypePowerPC , 3 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc603e , llvm::MachO::CPUTypePowerPC , 4 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc603ev , llvm::MachO::CPUTypePowerPC , 5 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc604 , llvm::MachO::CPUTypePowerPC , 6 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc604e , llvm::MachO::CPUTypePowerPC , 7 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc620 , llvm::MachO::CPUTypePowerPC , 8 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc750 , llvm::MachO::CPUTypePowerPC , 9 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc7400 , llvm::MachO::CPUTypePowerPC , 10 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc7450 , llvm::MachO::CPUTypePowerPC , 11 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc_ppc970 , llvm::MachO::CPUTypePowerPC , 100 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc64_generic , llvm::MachO::CPUTypePowerPC64 , 0 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_ppc64_ppc970_64 , llvm::MachO::CPUTypePowerPC64 , 100 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPUTypeI386 , 3 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i486 , llvm::MachO::CPUTypeI386 , 4 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i486sx , llvm::MachO::CPUTypeI386 , 0x84 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPUTypeI386 , CPU_ANY, UINT32_MAX , UINT32_MAX }, - { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , 3 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , 4 , UINT32_MAX , SUBTYPE_MASK }, - { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPUTypeX86_64 , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_arm_generic , llvm::MachO::CPU_TYPE_ARM , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_arm_generic , llvm::MachO::CPU_TYPE_ARM , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv4 , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv4t , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv6 , llvm::MachO::CPU_TYPE_ARM , 6 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv6m , llvm::MachO::CPU_TYPE_ARM , 14 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv5 , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv5e , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv5t , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_xscale , llvm::MachO::CPU_TYPE_ARM , 8 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7 , llvm::MachO::CPU_TYPE_ARM , 9 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7f , llvm::MachO::CPU_TYPE_ARM , 10 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7s , llvm::MachO::CPU_TYPE_ARM , 11 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7k , llvm::MachO::CPU_TYPE_ARM , 12 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7m , llvm::MachO::CPU_TYPE_ARM , 15 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_arm_armv7em , llvm::MachO::CPU_TYPE_ARM , 16 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumb , llvm::MachO::CPU_TYPE_ARM , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv4t , llvm::MachO::CPU_TYPE_ARM , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv5 , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv5e , llvm::MachO::CPU_TYPE_ARM , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv6 , llvm::MachO::CPU_TYPE_ARM , 6 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv6m , llvm::MachO::CPU_TYPE_ARM , 14 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7 , llvm::MachO::CPU_TYPE_ARM , 9 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7f , llvm::MachO::CPU_TYPE_ARM , 10 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7s , llvm::MachO::CPU_TYPE_ARM , 11 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7k , llvm::MachO::CPU_TYPE_ARM , 12 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7m , llvm::MachO::CPU_TYPE_ARM , 15 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_thumbv7em , llvm::MachO::CPU_TYPE_ARM , 16 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_generic , llvm::MachO::CPU_TYPE_POWERPC , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_ppc_generic , llvm::MachO::CPU_TYPE_POWERPC , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc601 , llvm::MachO::CPU_TYPE_POWERPC , 1 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc602 , llvm::MachO::CPU_TYPE_POWERPC , 2 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc603 , llvm::MachO::CPU_TYPE_POWERPC , 3 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc603e , llvm::MachO::CPU_TYPE_POWERPC , 4 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc603ev , llvm::MachO::CPU_TYPE_POWERPC , 5 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc604 , llvm::MachO::CPU_TYPE_POWERPC , 6 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc604e , llvm::MachO::CPU_TYPE_POWERPC , 7 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc620 , llvm::MachO::CPU_TYPE_POWERPC , 8 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc750 , llvm::MachO::CPU_TYPE_POWERPC , 9 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc7400 , llvm::MachO::CPU_TYPE_POWERPC , 10 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc7450 , llvm::MachO::CPU_TYPE_POWERPC , 11 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc_ppc970 , llvm::MachO::CPU_TYPE_POWERPC , 100 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc64_generic , llvm::MachO::CPU_TYPE_POWERPC64 , 0 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_ppc64_ppc970_64 , llvm::MachO::CPU_TYPE_POWERPC64 , 100 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPU_TYPE_I386 , 3 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i486 , llvm::MachO::CPU_TYPE_I386 , 4 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i486sx , llvm::MachO::CPU_TYPE_I386 , 0x84 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_32_i386 , llvm::MachO::CPU_TYPE_I386 , CPU_ANY, UINT32_MAX , UINT32_MAX }, + { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , 3 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , 4 , UINT32_MAX , SUBTYPE_MASK }, + { ArchSpec::eCore_x86_64_x86_64 , llvm::MachO::CPU_TYPE_X86_64 , CPU_ANY, UINT32_MAX , UINT32_MAX }, // Catch any unknown mach architectures so we can always use the object and symbol mach-o files - { ArchSpec::eCore_uknownMach32 , 0 , 0 , 0xFF000000u, 0x00000000u }, - { ArchSpec::eCore_uknownMach64 , llvm::MachO::CPUArchABI64 , 0 , 0xFF000000u, 0x00000000u } + { ArchSpec::eCore_uknownMach32 , 0 , 0 , 0xFF000000u, 0x00000000u }, + { ArchSpec::eCore_uknownMach64 , llvm::MachO::CPU_ARCH_ABI64 , 0 , 0xFF000000u, 0x00000000u } }; static const ArchDefinition g_macho_arch_def = { eArchTypeMachO, Modified: head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -52,7 +52,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/PathV1.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/TargetSelect.h" #if defined (USE_STANDARD_JIT) @@ -77,19 +77,16 @@ using namespace lldb_private; //===----------------------------------------------------------------------===// std::string GetBuiltinIncludePath(const char *Argv0) { - 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 - + 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 + // Get foo/lib/clang//include - P.appendComponent("lib"); - P.appendComponent("clang"); - P.appendComponent(CLANG_VERSION_STRING); - P.appendComponent("include"); + llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING, + "include"); } return P.str(); Modified: head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -490,11 +490,12 @@ IRExecutionUnit::MemoryManager::allocate uint8_t * IRExecutionUnit::MemoryManager::allocateCodeSection(uintptr_t Size, unsigned Alignment, - unsigned SectionID) + unsigned SectionID, + llvm::StringRef SectionName) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - uint8_t *return_value = m_default_mm_ap->allocateCodeSection(Size, Alignment, SectionID); + uint8_t *return_value = m_default_mm_ap->allocateCodeSection(Size, Alignment, SectionID, SectionName); m_parent.m_records.push_back(AllocationRecord((uintptr_t)return_value, lldb::ePermissionsReadable | lldb::ePermissionsExecutable, @@ -515,11 +516,12 @@ uint8_t * IRExecutionUnit::MemoryManager::allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, + llvm::StringRef SectionName, bool IsReadOnly) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - uint8_t *return_value = m_default_mm_ap->allocateDataSection(Size, Alignment, SectionID, IsReadOnly); + uint8_t *return_value = m_default_mm_ap->allocateDataSection(Size, Alignment, SectionID, SectionName, IsReadOnly); m_parent.m_records.push_back(AllocationRecord((uintptr_t)return_value, lldb::ePermissionsReadable | lldb::ePermissionsWritable, @@ -563,28 +565,6 @@ 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/Expression/IRForTarget.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -357,6 +357,20 @@ 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(llvm::Attribute::NoBuiltin)) { + llvm::Attribute builtin = llvm::Attribute::get(fun->getContext(), llvm::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); } Modified: head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Host/common/FileSpec.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -570,9 +570,8 @@ FileSpec::ResolveExecutableLocation () if (file_cstr) { const std::string file_str (file_cstr); - 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); + std::string path = llvm::sys::FindProgramByName (file_str); + llvm::StringRef dir_ref = llvm::sys::path::parent_path(path); //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 Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -10,6 +10,7 @@ #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" @@ -17,6 +18,7 @@ #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" @@ -430,23 +432,30 @@ DisassemblerLLVMC::LLVMCDisassembler::LL m_subtarget_info_ap.reset(curr_target->createMCSubtargetInfo(triple, "", features_str)); - m_asm_info_ap.reset(curr_target->createMCAsmInfo(triple)); - + m_asm_info_ap.reset(curr_target->createMCAsmInfo(*curr_target->createMCRegInfo(triple), 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()) + if (m_disasm_ap.get() && m_context_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()); + DisassemblerLLVMC::SymbolLookupCallback, + (void *) &owner, + m_context_ap.get(), + RelInfo); 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 Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -25,7 +25,7 @@ #include "Utility/ARM_DWARF_Registers.h" #include "llvm/Support/MathExtras.h" // for SignExtend32 template function - // and CountTrailingZeros_32 function + // and countTrailingZeros 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_32(ITMask); + uint32_t TZ = llvm::countTrailingZeros(ITMask); if (TZ > 3) { #ifdef LLDB_CONFIGURATION_DEBUG Modified: head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Mon Feb 17 18:25:41 2014 (r262120) +++ head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Mon Feb 17 18:50:03 2014 (r262121) @@ -1476,6 +1476,9 @@ ClangASTType::GetTypeClass () const case clang::Type::Decltype: break; case clang::Type::TemplateSpecialization: break; case clang::Type::Atomic: break; + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: break; } // We don't know hot to display this type... return lldb::eTypeClassOther; @@ -1912,6 +1915,9 @@ ClangASTType::GetEncoding (uint64_t &cou case clang::Type::Decltype: case clang::Type::TemplateSpecialization: case clang::Type::Atomic: + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: break; } count = 0; @@ -2041,6 +2047,10 @@ ClangASTType::GetFormat () const case clang::Type::TemplateSpecialization: case clang::Type::Atomic: break; + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: + break; } // We don't know hot to display this type... return lldb::eFormatBytes; @@ -5227,6 +5237,9 @@ ClangASTType::GetDeclContextForType () c case clang::Type::InjectedClassName: break; case clang::Type::DependentName: break; case clang::Type::Atomic: break; + + // pointer type decayed from an array or function type. + case clang::Type::Decayed: break; } // No DeclContext in this type... return NULL; Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Mon Feb 17 18:25:41 2014 (r262120) +++ head/usr.bin/clang/lldb/Makefile Mon Feb 17 18:50:03 2014 (r262121) @@ -77,6 +77,7 @@ LIBDEPS=\ clangbasic \ clanglex \ \ + llvmoption \ llvmarmasmparser \ llvmarmcodegen \ llvminstrumentation \ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:04:17 2014 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 ESMTPS id 020C7E89; Mon, 17 Feb 2014 20:04:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFFF11AC6; Mon, 17 Feb 2014 20:04:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HK4GvV026079; Mon, 17 Feb 2014 20:04:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HK4GPZ026078; Mon, 17 Feb 2014 20:04:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402172004.s1HK4GPZ026078@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 20:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262122 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:04:17 -0000 Author: mav Date: Mon Feb 17 20:04:16 2014 New Revision: 262122 URL: http://svnweb.freebsd.org/changeset/base/262122 Log: MFC r260486: Remove very low default limit of 4 nfsd threads. nfsd's own default is 8 * hw.ncpu, that sounds more appropriate for these SMP/NCQ/... days. Modified: stable/10/etc/defaults/rc.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Mon Feb 17 18:50:03 2014 (r262121) +++ stable/10/etc/defaults/rc.conf Mon Feb 17 20:04:16 2014 (r262122) @@ -315,7 +315,7 @@ nfs_client_enable="NO" # This host is a nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). -nfs_server_flags="-u -t -n 4" # Flags to nfsd (if enabled). +nfs_server_flags="-u -t" # Flags to nfsd (if enabled). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:04:57 2014 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 ESMTPS id CE8DBFBF; Mon, 17 Feb 2014 20:04:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9B1A1AD0; Mon, 17 Feb 2014 20:04:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HK4v0Y026205; Mon, 17 Feb 2014 20:04:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HK4vgk026204; Mon, 17 Feb 2014 20:04:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402172004.s1HK4vgk026204@svn.freebsd.org> From: Ian Lepore Date: Mon, 17 Feb 2014 20:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262123 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:04:57 -0000 Author: ian Date: Mon Feb 17 20:04:57 2014 New Revision: 262123 URL: http://svnweb.freebsd.org/changeset/base/262123 Log: Give the fdt helper routines static linkage since no global definition of them is provided anywhere. (gcc was nice enough to warn about this, clang didn't for some reason.) Modified: head/sys/arm/include/physmem.h Modified: head/sys/arm/include/physmem.h ============================================================================== --- head/sys/arm/include/physmem.h Mon Feb 17 20:04:16 2014 (r262122) +++ head/sys/arm/include/physmem.h Mon Feb 17 20:04:57 2014 (r262123) @@ -65,7 +65,7 @@ void arm_physmem_print_tables(void); #include -inline void +static inline void arm_physmem_hardware_regions(struct mem_region * mrptr, int mrcount) { while (mrcount--) { @@ -74,7 +74,7 @@ arm_physmem_hardware_regions(struct mem_ } } -inline void +static inline void arm_physmem_exclude_regions(struct mem_region * mrptr, int mrcount, uint32_t exflags) { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:06:09 2014 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 ESMTPS id BB8C51A4; Mon, 17 Feb 2014 20:06:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4E201AE3; Mon, 17 Feb 2014 20:06:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HK69uJ026463; Mon, 17 Feb 2014 20:06:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HK69Lk026462; Mon, 17 Feb 2014 20:06:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402172006.s1HK69Lk026462@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 20:06: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: r262124 - stable/9/etc/defaults 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:06:09 -0000 Author: mav Date: Mon Feb 17 20:06:09 2014 New Revision: 262124 URL: http://svnweb.freebsd.org/changeset/base/262124 Log: MFC r260486: Remove very low default limit of 4 nfsd threads. nfsd's own default is 8 * hw.ncpu, that sounds more appropriate for these SMP/NCQ/... days. Modified: stable/9/etc/defaults/rc.conf Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Mon Feb 17 20:04:57 2014 (r262123) +++ stable/9/etc/defaults/rc.conf Mon Feb 17 20:06:09 2014 (r262124) @@ -327,7 +327,7 @@ nfs_client_enable="NO" # This host is a nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). -nfs_server_flags="-u -t -n 4" # Flags to nfsd (if enabled). +nfs_server_flags="-u -t" # Flags to nfsd (if enabled). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:08:12 2014 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 ESMTPS id 51964300; Mon, 17 Feb 2014 20:08:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8F31AF7; Mon, 17 Feb 2014 20:08:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HK8CL6026823; Mon, 17 Feb 2014 20:08:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HK8CqL026822; Mon, 17 Feb 2014 20:08:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172008.s1HK8CqL026822@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262125 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:08:12 -0000 Author: dim Date: Mon Feb 17 20:08:11 2014 New Revision: 262125 URL: http://svnweb.freebsd.org/changeset/base/262125 Log: In sys/dev/usb/controller/uss820dci.c, similar to r261977, fix a warning about uss820dci_odevd being unused, by adding it to the part that handles getting descriptors. Reported by: loos Reviewed by: hselasky MFC after: 3 days Modified: head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Mon Feb 17 20:06:09 2014 (r262124) +++ head/sys/dev/usb/controller/uss820dci.c Mon Feb 17 20:08:11 2014 (r262125) @@ -2005,6 +2005,13 @@ tr_handle_get_descriptor: len = sizeof(uss820dci_devd); ptr = (const void *)&uss820dci_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(uss820dci_odevd); + ptr = (const void *)&uss820dci_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:19:11 2014 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 ESMTPS id DA65470B; Mon, 17 Feb 2014 20:19:11 +0000 (UTC) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [IPv6:2a00:1450:400c:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00B791BE5; Mon, 17 Feb 2014 20:19:10 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id x12so2591058wgg.8 for ; Mon, 17 Feb 2014 12:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/ZxJRmKmCGa26r7nE54RmekMb6YaNnRvfhg9dUxBB7g=; b=aaKNpM3ETf2p3frzs+qZ4wunYms2kfouz9hitrvJDXXExPuD5natSQt4URGm+Ei4n5 3qu7g8E4o7rfDWvdm7h568dFQU9iW4KBbHmJ3NxZt5kQxmiZ8voCSwSbmv8IQrLqUKdQ Di1yuWJezwqRUI7hG2bMUbVFc5Z9RxtBaEXufEIL/SXgtNzSHSMpGg8tDSgrBMmrqOfz a6soRNge0IOXFuKdSPA5MhK7cRoxVjWZHTR+q7mnJi/DIIpw9UxIyAErROUVHgNesRwl ZSWYMV6pUne8m7bK6C6h853ia7GmJgeUTbZWkXj62J+zfoT/7xfFQv6BdeWlknqccFdg W/Kg== MIME-Version: 1.0 X-Received: by 10.194.174.4 with SMTP id bo4mr3750402wjc.62.1392668349355; Mon, 17 Feb 2014 12:19:09 -0800 (PST) Received: by 10.216.188.132 with HTTP; Mon, 17 Feb 2014 12:19:09 -0800 (PST) In-Reply-To: <201402172008.s1HK8CqL026822@svn.freebsd.org> References: <201402172008.s1HK8CqL026822@svn.freebsd.org> Date: Mon, 17 Feb 2014 17:19:09 -0300 Message-ID: Subject: Re: svn commit: r262125 - head/sys/dev/usb/controller From: Luiz Otavio O Souza To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:19:11 -0000 On Mon, Feb 17, 2014 at 5:08 PM, Dimitry Andric wrote: > Author: dim > Date: Mon Feb 17 20:08:11 2014 > New Revision: 262125 > URL: http://svnweb.freebsd.org/changeset/base/262125 > > Log: > In sys/dev/usb/controller/uss820dci.c, similar to r261977, fix a warning > about uss820dci_odevd being unused, by adding it to the part that > handles getting descriptors. > > Thanks for the quick fix! Luiz From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:19:35 2014 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 ESMTPS id 9F092851; Mon, 17 Feb 2014 20:19:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0F51BF0; Mon, 17 Feb 2014 20:19:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKJZvk031041; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKJZ0o031039; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172019.s1HKJZ0o031039@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:19:35 +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: r262126 - in stable: 10/sys/conf 10/sys/modules/wlan 9/sys/conf 9/sys/modules/wlan 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:19:35 -0000 Author: dim Date: Mon Feb 17 20:19:34 2014 New Revision: 262126 URL: http://svnweb.freebsd.org/changeset/base/262126 Log: MFC r261899: Similar to r260026, disable warning about unused functions for ieee80211_adhoc.c, ieee80211_hostap.c and ieee80211_sta.c. Modified: stable/9/sys/conf/files stable/9/sys/modules/wlan/Makefile Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/files stable/10/sys/modules/wlan/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 20:08:11 2014 (r262125) +++ stable/9/sys/conf/files Mon Feb 17 20:19:34 2014 (r262126) @@ -2747,7 +2747,8 @@ net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan net80211/ieee80211_ageq.c optional wlan -net80211/ieee80211_adhoc.c optional wlan +net80211/ieee80211_adhoc.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_amrr.c optional wlan | wlan_amrr net80211/ieee80211_crypto.c optional wlan \ @@ -2759,7 +2760,8 @@ net80211/ieee80211_crypto_wep.c optional net80211/ieee80211_ddb.c optional wlan ddb net80211/ieee80211_dfs.c optional wlan net80211/ieee80211_freebsd.c optional wlan -net80211/ieee80211_hostap.c optional wlan +net80211/ieee80211_hostap.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ht.c optional wlan net80211/ieee80211_hwmp.c optional wlan ieee80211_support_mesh net80211/ieee80211_input.c optional wlan @@ -2779,7 +2781,8 @@ net80211/ieee80211_regdomain.c optional net80211/ieee80211_rssadapt.c optional wlan wlan_rssadapt net80211/ieee80211_scan.c optional wlan net80211/ieee80211_scan_sta.c optional wlan -net80211/ieee80211_sta.c optional wlan +net80211/ieee80211_sta.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_superg.c optional wlan ieee80211_support_superg net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma net80211/ieee80211_wds.c optional wlan Modified: stable/9/sys/modules/wlan/Makefile ============================================================================== --- stable/9/sys/modules/wlan/Makefile Mon Feb 17 20:08:11 2014 (r262125) +++ stable/9/sys/modules/wlan/Makefile Mon Feb 17 20:19:34 2014 (r262126) @@ -31,6 +31,9 @@ opt_ddb.h: .include +CWARNFLAGS.ieee80211_adhoc.c= -Wno-unused-function CWARNFLAGS.ieee80211_crypto.c= -Wno-unused-function +CWARNFLAGS.ieee80211_hostap.c= -Wno-unused-function CWARNFLAGS.ieee80211_mesh.c= -Wno-unused-function +CWARNFLAGS.ieee80211_sta.c= -Wno-unused-function CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:19:36 2014 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 ESMTPS id 30319852; Mon, 17 Feb 2014 20:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1056A1BF1; Mon, 17 Feb 2014 20:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKJZlk031048; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKJZsa031046; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172019.s1HKJZsa031046@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262126 - in stable: 10/sys/conf 10/sys/modules/wlan 9/sys/conf 9/sys/modules/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:19:36 -0000 Author: dim Date: Mon Feb 17 20:19:34 2014 New Revision: 262126 URL: http://svnweb.freebsd.org/changeset/base/262126 Log: MFC r261899: Similar to r260026, disable warning about unused functions for ieee80211_adhoc.c, ieee80211_hostap.c and ieee80211_sta.c. Modified: stable/10/sys/conf/files stable/10/sys/modules/wlan/Makefile Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/files stable/9/sys/modules/wlan/Makefile Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 20:08:11 2014 (r262125) +++ stable/10/sys/conf/files Mon Feb 17 20:19:34 2014 (r262126) @@ -3140,7 +3140,8 @@ net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan net80211/ieee80211_ageq.c optional wlan -net80211/ieee80211_adhoc.c optional wlan +net80211/ieee80211_adhoc.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_amrr.c optional wlan | wlan_amrr net80211/ieee80211_crypto.c optional wlan \ @@ -3152,7 +3153,8 @@ net80211/ieee80211_crypto_wep.c optional net80211/ieee80211_ddb.c optional wlan ddb net80211/ieee80211_dfs.c optional wlan net80211/ieee80211_freebsd.c optional wlan -net80211/ieee80211_hostap.c optional wlan +net80211/ieee80211_hostap.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ht.c optional wlan net80211/ieee80211_hwmp.c optional wlan ieee80211_support_mesh net80211/ieee80211_input.c optional wlan @@ -3172,7 +3174,8 @@ net80211/ieee80211_regdomain.c optional net80211/ieee80211_rssadapt.c optional wlan wlan_rssadapt net80211/ieee80211_scan.c optional wlan net80211/ieee80211_scan_sta.c optional wlan -net80211/ieee80211_sta.c optional wlan +net80211/ieee80211_sta.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_superg.c optional wlan ieee80211_support_superg net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma net80211/ieee80211_wds.c optional wlan Modified: stable/10/sys/modules/wlan/Makefile ============================================================================== --- stable/10/sys/modules/wlan/Makefile Mon Feb 17 20:08:11 2014 (r262125) +++ stable/10/sys/modules/wlan/Makefile Mon Feb 17 20:19:34 2014 (r262126) @@ -32,6 +32,9 @@ opt_ddb.h: .include +CWARNFLAGS.ieee80211_adhoc.c= -Wno-unused-function CWARNFLAGS.ieee80211_crypto.c= -Wno-unused-function +CWARNFLAGS.ieee80211_hostap.c= -Wno-unused-function CWARNFLAGS.ieee80211_mesh.c= -Wno-unused-function +CWARNFLAGS.ieee80211_sta.c= -Wno-unused-function CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:25:17 2014 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 ESMTPS id DDEB7C1F; Mon, 17 Feb 2014 20:25:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C89931C97; Mon, 17 Feb 2014 20:25:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKPHWq034484; Mon, 17 Feb 2014 20:25:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKPH9d034483; Mon, 17 Feb 2014 20:25:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172025.s1HKPH9d034483@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262127 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:25:18 -0000 Author: dim Date: Mon Feb 17 20:25:17 2014 New Revision: 262127 URL: http://svnweb.freebsd.org/changeset/base/262127 Log: MFC r261896: After r251709, avoid a clang 3.4 warning about an unused static const variable (uma_max_ipers), when asserts are disabled. Reviewed by: glebius Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Mon Feb 17 20:19:34 2014 (r262126) +++ stable/10/sys/vm/uma_core.c Mon Feb 17 20:25:17 2014 (r262127) @@ -150,9 +150,6 @@ static int booted = 0; #define UMA_STARTUP 1 #define UMA_STARTUP2 2 -/* Maximum number of allowed items-per-slab if the slab header is OFFPAGE */ -static const u_int uma_max_ipers = SLAB_SETSIZE; - /* * Only mbuf clusters use ref zones. Just provide enough references * to support the one user. New code should not use the ref facility. @@ -1388,7 +1385,7 @@ keg_cachespread_init(uma_keg_t keg) keg->uk_slabsize = UMA_SLAB_SIZE; keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; - KASSERT(keg->uk_ipers <= uma_max_ipers, + KASSERT(keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, keg->uk_ipers)); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:26:13 2014 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 ESMTPS id DC1F9DD8; Mon, 17 Feb 2014 20:26:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C53AD1CA4; Mon, 17 Feb 2014 20:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKQDL9034622; Mon, 17 Feb 2014 20:26:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKQD8M034621; Mon, 17 Feb 2014 20:26:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402172026.s1HKQD8M034621@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Feb 2014 20:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262128 - head/sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:26:13 -0000 Author: hselasky Date: Mon Feb 17 20:26:13 2014 New Revision: 262128 URL: http://svnweb.freebsd.org/changeset/base/262128 Log: Adjust USB quirk. MFC after: 1 week Submitted by: Volodymyr Kostyrko Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Feb 17 20:25:17 2014 (r262127) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Feb 17 20:26:13 2014 (r262128) @@ -454,8 +454,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_ATAPI), USB_QUIRK(MEIZU, M6_SL, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY, UQ_MSC_NO_SYNC_CACHE), - - USB_QUIRK(TOSHIBA, TRANSMEMORY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(TOSHIBA, TRANSMEMORY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, + UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(VIALABS, USB30SATABRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), /* Non-standard USB MIDI devices */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:30:30 2014 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 ESMTPS id 69B83AD; Mon, 17 Feb 2014 20:30:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54A141CD3; Mon, 17 Feb 2014 20:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKUUJU036843; Mon, 17 Feb 2014 20:30:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKUUE8036842; Mon, 17 Feb 2014 20:30:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402172030.s1HKUUE8036842@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Feb 2014 20:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262129 - head/sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:30:30 -0000 Author: hselasky Date: Mon Feb 17 20:30:29 2014 New Revision: 262129 URL: http://svnweb.freebsd.org/changeset/base/262129 Log: Our quirk table is almost full. Add some room for more quirks. MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Feb 17 20:26:13 2014 (r262128) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Feb 17 20:30:29 2014 (r262129) @@ -59,7 +59,7 @@ MODULE_DEPEND(usb_quirk, usb, 1, 1, 1); MODULE_VERSION(usb_quirk, 1); -#define USB_DEV_QUIRKS_MAX 256 +#define USB_DEV_QUIRKS_MAX 320 #define USB_SUB_QUIRKS_MAX 8 struct usb_quirk_entry { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:31:55 2014 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 ESMTPS id 7B6E220F; Mon, 17 Feb 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64E681D46; Mon, 17 Feb 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKVtEK037991; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKVtgB037990; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172031.s1HKVtgB037990@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:31:55 +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: r262130 - in stable: 10/sys/conf 9/sys/conf 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:31:55 -0000 Author: dim Date: Mon Feb 17 20:31:54 2014 New Revision: 262130 URL: http://svnweb.freebsd.org/changeset/base/262130 Log: MFC r261902: In r260111, in sys/conf/files, I disabled warning about unused functions for the wrong mcg.c, the one in ofed/drivers/infiniband/hw/mlx4. Disable the warning for ofed/drivers/net/mlx4/mcg.c instead. Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 20:30:29 2014 (r262129) +++ stable/9/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) @@ -3242,7 +3242,7 @@ ofed/drivers/net/mlx4/main.c optional compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" ofed/drivers/net/mlx4/mcg.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ -Wno-unused" ofed/drivers/net/mlx4/mr.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:31:55 2014 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 ESMTPS id E8331210; Mon, 17 Feb 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B90551D47; Mon, 17 Feb 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKVtO4037997; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKVtma037996; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172031.s1HKVtma037996@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262130 - in stable: 10/sys/conf 9/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:31:56 -0000 Author: dim Date: Mon Feb 17 20:31:54 2014 New Revision: 262130 URL: http://svnweb.freebsd.org/changeset/base/262130 Log: MFC r261902: In r260111, in sys/conf/files, I disabled warning about unused functions for the wrong mcg.c, the one in ofed/drivers/infiniband/hw/mlx4. Disable the warning for ofed/drivers/net/mlx4/mcg.c instead. Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 20:30:29 2014 (r262129) +++ stable/10/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) @@ -3584,7 +3584,7 @@ ofed/drivers/infiniband/hw/mlx4/alias_GU compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/mcg.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/ -Wno-unused" + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/sysfs.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" @@ -3648,7 +3648,7 @@ ofed/drivers/net/mlx4/main.c optional compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" ofed/drivers/net/mlx4/mcg.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ -Wno-unused" ofed/drivers/net/mlx4/mr.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:37:16 2014 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 ESMTPS id 2EB72696; Mon, 17 Feb 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 195401D8E; Mon, 17 Feb 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKbFqo038765; Mon, 17 Feb 2014 20:37:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKbFG1038764; Mon, 17 Feb 2014 20:37:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172037.s1HKbFG1038764@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:37:15 +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: r262131 - in stable: 10/sys/conf 9/sys/conf 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:37:16 -0000 Author: dim Date: Mon Feb 17 20:37:15 2014 New Revision: 262131 URL: http://svnweb.freebsd.org/changeset/base/262131 Log: MFC r261903: Disable warning about unused static const variables for sys/pci/ncr.c. Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) +++ stable/9/sys/conf/files Mon Feb 17 20:37:15 2014 (r262131) @@ -3349,7 +3349,8 @@ pci/amdpm.c optional amdpm pci | nfpm pci/amdsmb.c optional amdsmb pci pci/if_rl.c optional rl pci pci/intpm.c optional intpm pci -pci/ncr.c optional ncr pci +pci/ncr.c optional ncr pci \ + compile-with "${NORMAL_C} -Wno-unused" pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:37:16 2014 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 ESMTPS id 85417697; Mon, 17 Feb 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6E01D8F; Mon, 17 Feb 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKbGBe038772; Mon, 17 Feb 2014 20:37:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKbGFq038771; Mon, 17 Feb 2014 20:37:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172037.s1HKbGFq038771@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262131 - in stable: 10/sys/conf 9/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:37:16 -0000 Author: dim Date: Mon Feb 17 20:37:15 2014 New Revision: 262131 URL: http://svnweb.freebsd.org/changeset/base/262131 Log: MFC r261903: Disable warning about unused static const variables for sys/pci/ncr.c. Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) +++ stable/10/sys/conf/files Mon Feb 17 20:37:15 2014 (r262131) @@ -3758,7 +3758,8 @@ pci/amdpm.c optional amdpm pci | nfpm pci/amdsmb.c optional amdsmb pci pci/if_rl.c optional rl pci pci/intpm.c optional intpm pci -pci/ncr.c optional ncr pci +pci/ncr.c optional ncr pci \ + compile-with "${NORMAL_C} -Wno-unused" pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 20:45:40 2014 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 ESMTPS id 69199BA2; Mon, 17 Feb 2014 20:45:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51E401F58; Mon, 17 Feb 2014 20:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKjeRY042482; Mon, 17 Feb 2014 20:45:40 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKjeNp042481; Mon, 17 Feb 2014 20:45:40 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172045.s1HKjeNp042481@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262132 - stable/10/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 20:45:40 -0000 Author: dim Date: Mon Feb 17 20:45:39 2014 New Revision: 262132 URL: http://svnweb.freebsd.org/changeset/base/262132 Log: MFC r261907: In cxgbe, conditionalize the t4_pgprot_wc() function, since it is only used when DOT5 is defined. Reviewed by: np Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Feb 17 20:37:15 2014 (r262131) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Feb 17 20:45:39 2014 (r262132) @@ -113,10 +113,12 @@ static struct ib_ucontext *c4iw_alloc_uc return &context->ibucontext; } +#ifdef DOT5 static inline pgprot_t t4_pgprot_wc(pgprot_t prot) { return pgprot_writecombine(prot); } +#endif static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) { From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:06:53 2014 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 ESMTPS id 5F19DD67; Mon, 17 Feb 2014 22:06:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 489541654; Mon, 17 Feb 2014 22:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HM6rPl073782; Mon, 17 Feb 2014 22:06:53 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HM6rs9073781; Mon, 17 Feb 2014 22:06:53 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201402172206.s1HM6rs9073781@svn.freebsd.org> From: Alan Somers Date: Mon, 17 Feb 2014 22:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262133 - head/tests/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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:06:53 -0000 Author: asomers Date: Mon Feb 17 22:06:52 2014 New Revision: 262133 URL: http://svnweb.freebsd.org/changeset/base/262133 Log: test_eagain_*_* should've been using nonblocking sockets instead of blocking sockets. The error was not exposed as long as the kernel suffered from PR kern/185812. Now corrected, these tests pass on DragonFlyBSD 3.6.0. PR: kern/185812 Sponsored by: Spectra Logic Corporation MFC after: 2 weeks Modified: head/tests/sys/kern/unix_seqpacket_test.c Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Mon Feb 17 20:45:39 2014 (r262132) +++ head/tests/sys/kern/unix_seqpacket_test.c Mon Feb 17 22:06:52 2014 (r262133) @@ -136,7 +136,7 @@ test_eagain(size_t sndbufsize, size_t rc ssize_t ssize, rsize; /* setup the socket pair */ - do_socketpair(sv); + do_socketpair_nonblocking(sv); /* Setup the buffers */ ATF_REQUIRE_EQ(0, setsockopt(sv[0], SOL_SOCKET, SO_SNDBUF, &sndbufsize, sizeof(sndbufsize))); From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:14:39 2014 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 ESMTPS id 73D16113; Mon, 17 Feb 2014 22:14:39 +0000 (UTC) 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 48E611703; Mon, 17 Feb 2014 22:14:39 +0000 (UTC) Received: from pippin.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 95F34B94C; Mon, 17 Feb 2014 17:14:35 -0500 (EST) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r262051 - head/cddl/contrib/opensolaris/cmd/zpool Date: Mon, 17 Feb 2014 17:12:48 -0500 Message-ID: <4039559.iRvSyCHsfX@pippin.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/11.0-CURRENT; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140218015927.D1978@besplex.bde.org> References: <201402171323.s1HDNnQg059102@svn.freebsd.org> <20140218015927.D1978@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 17 Feb 2014 17:14:35 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark Felder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:14:39 -0000 On Tuesday 18 February 2014 02:07:06 Bruce Evans wrote: > On Mon, 17 Feb 2014, Mark Felder wrote: > > Log: > > Fix formatting. > > > > "Manpages should start a new sentence on a new line. This makes it easier > > for translators to track changes." -jhb > > This has very little to do with translators. > > This makes it possible for man(1) to format the output correctly, at least > for monospaced fonts. My bad. I knew the rule, but not the correct reason. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:19:52 2014 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 ESMTPS id 7B2F63D2; Mon, 17 Feb 2014 22:19:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 485561756; Mon, 17 Feb 2014 22:19:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMJqM9078289; Mon, 17 Feb 2014 22:19:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMJpQc078283; Mon, 17 Feb 2014 22:19:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402172219.s1HMJpQc078283@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Feb 2014 22:19:51 +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: r262134 - in stable: 10/sys/dev/pci 10/sys/sys 10/usr.sbin/pciconf 8/sys/dev/pci 8/sys/sys 8/usr.sbin/pciconf 9/sys/dev/pci 9/sys/sys 9/usr.sbin/pciconf 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:19:52 -0000 Author: jhb Date: Mon Feb 17 22:19:49 2014 New Revision: 262134 URL: http://svnweb.freebsd.org/changeset/base/262134 Log: MFC 260926: Add support for displaying VPD for PCI devices via pciconf. - Store the length of each read-only VPD value since not all values are guaranteed to be ASCII values (though most are). - Add a new pciio ioctl to fetch VPD for a single PCI device. The values are returned as a list of variable length records, one for the device name and each keyword. - Add a new -V flag to pciconf's list mode which displays VPD data for each device. Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/sys/pciio.h stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_user.c stable/10/sys/dev/pci/pcivar.h stable/10/sys/sys/pciio.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_user.c stable/9/sys/dev/pci/pcivar.h stable/9/sys/sys/pciio.h stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/dev/pci/pci.c Mon Feb 17 22:19:49 2014 (r262134) @@ -978,7 +978,7 @@ pci_read_vpd(device_t pcib, pcicfgregs * state = -2; break; } - dflen = byte2; + cfg->vpd.vpd_ros[off].len = dflen = byte2; if (dflen == 0 && strncmp(cfg->vpd.vpd_ros[off].keyword, "RV", 2) == 0) { @@ -1179,6 +1179,17 @@ pci_get_vpd_readonly_method(device_t dev return (ENXIO); } +struct pcicfg_vpd * +pci_fetch_vpd_list(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + pcicfgregs *cfg = &dinfo->cfg; + + if (!cfg->vpd.vpd_cached && cfg->vpd.vpd_reg != 0) + pci_read_vpd(device_get_parent(device_get_parent(dev)), cfg); + return (&cfg->vpd); +} + /* * Find the requested extended capability and return the offset in * configuration space via the pointer provided. The function returns Modified: stable/8/sys/dev/pci/pci_user.c ============================================================================== --- stable/8/sys/dev/pci/pci_user.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/dev/pci/pci_user.c Mon Feb 17 22:19:49 2014 (r262134) @@ -298,6 +298,89 @@ pci_conf_match_old(struct pci_match_conf #endif static int +pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) +{ + struct pci_vpd_element vpd_element, *vpd_user; + struct pcicfg_vpd *vpd; + size_t len; + int error, i; + + vpd = pci_fetch_vpd_list(dev); + if (vpd->vpd_reg == 0 || vpd->vpd_ident == NULL) + return (ENXIO); + + /* + * Calculate the amount of space needed in the data buffer. An + * identifier element is always present followed by the read-only + * and read-write keywords. + */ + len = sizeof(struct pci_vpd_element) + strlen(vpd->vpd_ident); + for (i = 0; i < vpd->vpd_rocnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_ros[i].len; + for (i = 0; i < vpd->vpd_wcnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_w[i].len; + + if (lvio->plvi_len == 0) { + lvio->plvi_len = len; + return (0); + } + if (lvio->plvi_len < len) { + lvio->plvi_len = len; + return (ENOMEM); + } + + /* + * Copyout the identifier string followed by each keyword and + * value. + */ + vpd_user = lvio->plvi_data; + vpd_element.pve_keyword[0] = '\0'; + vpd_element.pve_keyword[1] = '\0'; + vpd_element.pve_flags = PVE_FLAG_IDENT; + vpd_element.pve_datalen = strlen(vpd->vpd_ident); + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ident, vpd_user->pve_data, + strlen(vpd->vpd_ident)); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + vpd_element.pve_flags = 0; + for (i = 0; i < vpd->vpd_rocnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_ros[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_ros[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ros[i].value, vpd_user->pve_data, + vpd->vpd_ros[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + vpd_element.pve_flags = PVE_FLAG_RW; + for (i = 0; i < vpd->vpd_wcnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_w[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_w[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_w[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_w[i].value, vpd_user->pve_data, + vpd->vpd_w[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, + ("length mismatch")); + lvio->plvi_len = len; + return (0); +} + +static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev, brdev; @@ -308,6 +391,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_devinfo *dinfo; struct pci_io *io; struct pci_bar_io *bio; + struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; size_t confsz, iolen, pbufsz; @@ -320,16 +404,23 @@ pci_ioctl(struct cdev *dev, u_long cmd, io_old = NULL; pattern_buf_old = NULL; +#endif - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && - cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD) - return EPERM; -#else - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && cmd != PCIOCGETCONF) - return EPERM; + if (!(flag & FWRITE)) { + switch (cmd) { +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: #endif + case PCIOCGETCONF: + case PCIOCGETBAR: + case PCIOCLISTVPD: + break; + default: + return (EPERM); + } + } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: /* FALLTHROUGH */ @@ -694,6 +785,22 @@ getconfexit: bio->pbi_enabled = pci_bar_enabled(pcidev, pm); error = 0; break; + case PCIOCLISTVPD: + lvio = (struct pci_list_vpd_io *)data; + + /* + * Assume that the user-level bus number is + * in fact the physical PCI bus number. + */ + pcidev = pci_find_dbsf(lvio->plvi_sel.pc_domain, + lvio->plvi_sel.pc_bus, lvio->plvi_sel.pc_dev, + lvio->plvi_sel.pc_func); + if (pcidev == NULL) { + error = ENODEV; + break; + } + error = pci_list_vpd(pcidev, lvio); + break; default: error = ENOTTY; break; Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/dev/pci/pcivar.h Mon Feb 17 22:19:49 2014 (r262134) @@ -57,6 +57,7 @@ struct pci_map { struct vpd_readonly { char keyword[2]; char *value; + int len; }; struct vpd_write { @@ -488,5 +489,6 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +struct pcicfg_vpd *pci_fetch_vpd_list(device_t dev); #endif /* _PCIVAR_H_ */ Modified: stable/8/sys/sys/pciio.h ============================================================================== --- stable/8/sys/sys/pciio.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/sys/pciio.h Mon Feb 17 22:19:49 2014 (r262134) @@ -116,10 +116,31 @@ struct pci_bar_io { uint64_t pbi_length; /* length of BAR */ }; +struct pci_vpd_element { + char pve_keyword[2]; + uint8_t pve_flags; + uint8_t pve_datalen; + uint8_t pve_data[0]; +}; + +#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */ +#define PVE_FLAG_RW 0x02 /* Element is read/write */ + +#define PVE_NEXT(pve) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (pve)->pve_datalen)) + +struct pci_list_vpd_io { + struct pcisel plvi_sel; /* device to operate on */ + size_t plvi_len; /* size of the data area */ + struct pci_vpd_element *plvi_data; +}; + #define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io) #define PCIOCREAD _IOWR('p', 2, struct pci_io) #define PCIOCWRITE _IOWR('p', 3, struct pci_io) #define PCIOCATTACHED _IOWR('p', 4, struct pci_io) #define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io) +#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io) #endif /* !_SYS_PCIIO_H_ */ Modified: stable/8/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:19:49 2014 (r262134) @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcev Oc Op Ar device +.Fl l Oo Fl bcevV Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -170,6 +170,28 @@ option is supplied, will attempt to load the vendor/device information database, and print vendor, device, class and subclass identification strings for each device. .Pp +If the +.Fl V +option is supplied, +.Nm +will list any vital product data +.Pq VPD +provided by each device. +Each VPD keyword is enumerated via a line in the following format: +.Bd -literal + VPD ro PN = '110114640C0 ' +.Ed +.Pp +The first string after the +.Dq Li VPD +prefix indicates if the keyword is read-only +.Dq ro +or read-write +.Dq rw . +The second string provides the keyword name. +The text after the the equals sign lists the value of the keyword which is +usually an ASCII string. +.Pp If the optional .Ar device argument is given with the Modified: stable/8/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:19:49 2014 (r262134) @@ -71,8 +71,9 @@ TAILQ_HEAD(,pci_vendor_info) pci_vendors static struct pcisel getsel(const char *str); static void list_bars(int fd, struct pci_conf *p); static void list_devs(const char *name, int verbose, int bars, int caps, - int errors); + int errors, int vpd); static void list_verbose(struct pci_conf *p); +static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); static int load_vendors(void); @@ -86,7 +87,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcev] [device]", + "usage: pciconf -l [-bcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -98,13 +99,13 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose; + int bars, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = byte = isshort = 0; + bars = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -143,6 +144,10 @@ main(int argc, char **argv) verbose = 1; break; + case 'V': + vpd = 1; + break; + default: usage(); } @@ -156,7 +161,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors); + bars, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -173,7 +178,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors) +list_devs(const char *name, int verbose, int bars, int caps, int errors, + int vpd) { int fd; struct pci_conf_io pc; @@ -246,6 +252,8 @@ list_devs(const char *name, int verbose, list_caps(fd, p); if (errors) list_errors(fd, p); + if (vpd) + list_vpd(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); @@ -339,6 +347,63 @@ list_verbose(struct pci_conf *p) printf(" subclass = %s\n", dp); } +static void +list_vpd(int fd, struct pci_conf *p) +{ + struct pci_list_vpd_io list; + struct pci_vpd_element *vpd, *end; + + list.plvi_sel = p->pc_sel; + list.plvi_len = 0; + list.plvi_data = NULL; + if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0) + return; + + list.plvi_data = malloc(list.plvi_len); + if (ioctl(fd, PCIOCLISTVPD, &list) < 0) { + free(list.plvi_data); + return; + } + + vpd = list.plvi_data; + end = (struct pci_vpd_element *)((char *)vpd + list.plvi_len); + for (; vpd < end; vpd = PVE_NEXT(vpd)) { + if (vpd->pve_flags == PVE_FLAG_IDENT) { + printf(" VPD ident = '%.*s'\n", + (int)vpd->pve_datalen, vpd->pve_data); + continue; + } + + /* Ignore the checksum keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "RV", 2) == 0) + continue; + + /* Ignore remaining read-write space. */ + if (vpd->pve_flags & PVE_FLAG_RW && + memcmp(vpd->pve_keyword, "RW", 2) == 0) + continue; + + /* Handle extended capability keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "CP", 2) == 0) { + printf(" VPD ro CP = ID %02x in map 0x%x[0x%x]\n", + (unsigned int)vpd->pve_data[0], + PCIR_BAR((unsigned int)vpd->pve_data[1]), + (unsigned int)vpd->pve_data[3] << 8 | + (unsigned int)vpd->pve_data[2]); + continue; + } + + /* Remaining keywords should all have ASCII values. */ + printf(" VPD %s %c%c = '%.*s'\n", + vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", + vpd->pve_keyword[0], vpd->pve_keyword[1], + (int)vpd->pve_datalen, vpd->pve_data); + } + free(list.plvi_data); +} + /* * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c. */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:19:50 2014 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 ESMTPS id EFF7B3D1; Mon, 17 Feb 2014 22:19:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8E6A1755; Mon, 17 Feb 2014 22:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMJorp078278; Mon, 17 Feb 2014 22:19:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMJnKl078272; Mon, 17 Feb 2014 22:19:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402172219.s1HMJnKl078272@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Feb 2014 22:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262134 - in stable: 10/sys/dev/pci 10/sys/sys 10/usr.sbin/pciconf 8/sys/dev/pci 8/sys/sys 8/usr.sbin/pciconf 9/sys/dev/pci 9/sys/sys 9/usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:19:51 -0000 Author: jhb Date: Mon Feb 17 22:19:49 2014 New Revision: 262134 URL: http://svnweb.freebsd.org/changeset/base/262134 Log: MFC 260926: Add support for displaying VPD for PCI devices via pciconf. - Store the length of each read-only VPD value since not all values are guaranteed to be ASCII values (though most are). - Add a new pciio ioctl to fetch VPD for a single PCI device. The values are returned as a list of variable length records, one for the device name and each keyword. - Add a new -V flag to pciconf's list mode which displays VPD data for each device. Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_user.c stable/10/sys/dev/pci/pcivar.h stable/10/sys/sys/pciio.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/sys/pciio.h stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_user.c stable/9/sys/dev/pci/pcivar.h stable/9/sys/sys/pciio.h stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/dev/pci/pci.c Mon Feb 17 22:19:49 2014 (r262134) @@ -985,7 +985,7 @@ pci_read_vpd(device_t pcib, pcicfgregs * state = -2; break; } - dflen = byte2; + cfg->vpd.vpd_ros[off].len = dflen = byte2; if (dflen == 0 && strncmp(cfg->vpd.vpd_ros[off].keyword, "RV", 2) == 0) { @@ -1179,6 +1179,17 @@ pci_get_vpd_readonly_method(device_t dev return (ENXIO); } +struct pcicfg_vpd * +pci_fetch_vpd_list(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + pcicfgregs *cfg = &dinfo->cfg; + + if (!cfg->vpd.vpd_cached && cfg->vpd.vpd_reg != 0) + pci_read_vpd(device_get_parent(device_get_parent(dev)), cfg); + return (&cfg->vpd); +} + /* * Find the requested HyperTransport capability and return the offset * in configuration space via the pointer provided. The function Modified: stable/10/sys/dev/pci/pci_user.c ============================================================================== --- stable/10/sys/dev/pci/pci_user.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/dev/pci/pci_user.c Mon Feb 17 22:19:49 2014 (r262134) @@ -407,6 +407,89 @@ pci_conf_match_old32(struct pci_match_co #endif /* PRE7_COMPAT */ static int +pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) +{ + struct pci_vpd_element vpd_element, *vpd_user; + struct pcicfg_vpd *vpd; + size_t len; + int error, i; + + vpd = pci_fetch_vpd_list(dev); + if (vpd->vpd_reg == 0 || vpd->vpd_ident == NULL) + return (ENXIO); + + /* + * Calculate the amount of space needed in the data buffer. An + * identifier element is always present followed by the read-only + * and read-write keywords. + */ + len = sizeof(struct pci_vpd_element) + strlen(vpd->vpd_ident); + for (i = 0; i < vpd->vpd_rocnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_ros[i].len; + for (i = 0; i < vpd->vpd_wcnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_w[i].len; + + if (lvio->plvi_len == 0) { + lvio->plvi_len = len; + return (0); + } + if (lvio->plvi_len < len) { + lvio->plvi_len = len; + return (ENOMEM); + } + + /* + * Copyout the identifier string followed by each keyword and + * value. + */ + vpd_user = lvio->plvi_data; + vpd_element.pve_keyword[0] = '\0'; + vpd_element.pve_keyword[1] = '\0'; + vpd_element.pve_flags = PVE_FLAG_IDENT; + vpd_element.pve_datalen = strlen(vpd->vpd_ident); + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ident, vpd_user->pve_data, + strlen(vpd->vpd_ident)); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + vpd_element.pve_flags = 0; + for (i = 0; i < vpd->vpd_rocnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_ros[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_ros[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ros[i].value, vpd_user->pve_data, + vpd->vpd_ros[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + vpd_element.pve_flags = PVE_FLAG_RW; + for (i = 0; i < vpd->vpd_wcnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_w[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_w[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_w[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_w[i].value, vpd_user->pve_data, + vpd->vpd_w[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, + ("length mismatch")); + lvio->plvi_len = len; + return (0); +} + +static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev, brdev; @@ -417,6 +500,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_devinfo *dinfo; struct pci_io *io; struct pci_bar_io *bio; + struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; size_t confsz, iolen, pbufsz; @@ -433,19 +517,29 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_match_conf_old *pattern_buf_old = NULL; io_old = NULL; +#endif - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && - cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD) - return EPERM; -#else - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && cmd != PCIOCGETCONF) - return EPERM; + if (!(flag & FWRITE)) { + switch (cmd) { +#ifdef PRE7_COMPAT +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: +#endif + case PCIOCGETCONF_OLD: #endif + case PCIOCGETCONF: + case PCIOCGETBAR: + case PCIOCLISTVPD: + break; + default: + return (EPERM); + } + } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_OLD32: cio32 = (struct pci_conf_io32 *)data; cio = malloc(sizeof(struct pci_conf_io), M_TEMP, M_WAITOK); cio->pat_buf_len = cio32->pat_buf_len; @@ -466,7 +560,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, cio = (struct pci_conf_io *)data; } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF_OLD32: @@ -912,6 +1006,22 @@ getconfexit: else error = ENODEV; break; + case PCIOCLISTVPD: + lvio = (struct pci_list_vpd_io *)data; + + /* + * Assume that the user-level bus number is + * in fact the physical PCI bus number. + */ + pcidev = pci_find_dbsf(lvio->plvi_sel.pc_domain, + lvio->plvi_sel.pc_bus, lvio->plvi_sel.pc_dev, + lvio->plvi_sel.pc_func); + if (pcidev == NULL) { + error = ENODEV; + break; + } + error = pci_list_vpd(pcidev, lvio); + break; default: error = ENOTTY; break; Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/dev/pci/pcivar.h Mon Feb 17 22:19:49 2014 (r262134) @@ -57,6 +57,7 @@ struct pci_map { struct vpd_readonly { char keyword[2]; char *value; + int len; }; struct vpd_write { @@ -525,6 +526,7 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +struct pcicfg_vpd *pci_fetch_vpd_list(device_t dev); #define VGA_PCI_BIOS_SHADOW_ADDR 0xC0000 #define VGA_PCI_BIOS_SHADOW_SIZE 131072 Modified: stable/10/sys/sys/pciio.h ============================================================================== --- stable/10/sys/sys/pciio.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/sys/pciio.h Mon Feb 17 22:19:49 2014 (r262134) @@ -116,10 +116,31 @@ struct pci_bar_io { uint64_t pbi_length; /* length of BAR */ }; +struct pci_vpd_element { + char pve_keyword[2]; + uint8_t pve_flags; + uint8_t pve_datalen; + uint8_t pve_data[0]; +}; + +#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */ +#define PVE_FLAG_RW 0x02 /* Element is read/write */ + +#define PVE_NEXT(pve) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (pve)->pve_datalen)) + +struct pci_list_vpd_io { + struct pcisel plvi_sel; /* device to operate on */ + size_t plvi_len; /* size of the data area */ + struct pci_vpd_element *plvi_data; +}; + #define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io) #define PCIOCREAD _IOWR('p', 2, struct pci_io) #define PCIOCWRITE _IOWR('p', 3, struct pci_io) #define PCIOCATTACHED _IOWR('p', 4, struct pci_io) #define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io) +#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io) #endif /* !_SYS_PCIIO_H_ */ Modified: stable/10/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:19:49 2014 (r262134) @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcev Oc Op Ar device +.Fl l Oo Fl bcevV Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -182,6 +182,28 @@ option is supplied, will attempt to load the vendor/device information database, and print vendor, device, class and subclass identification strings for each device. .Pp +If the +.Fl V +option is supplied, +.Nm +will list any vital product data +.Pq VPD +provided by each device. +Each VPD keyword is enumerated via a line in the following format: +.Bd -literal + VPD ro PN = '110114640C0 ' +.Ed +.Pp +The first string after the +.Dq Li VPD +prefix indicates if the keyword is read-only +.Dq ro +or read-write +.Dq rw . +The second string provides the keyword name. +The text after the the equals sign lists the value of the keyword which is +usually an ASCII string. +.Pp If the optional .Ar device argument is given with the Modified: stable/10/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:19:49 2014 (r262134) @@ -71,8 +71,9 @@ TAILQ_HEAD(,pci_vendor_info) pci_vendors static struct pcisel getsel(const char *str); static void list_bars(int fd, struct pci_conf *p); static void list_devs(const char *name, int verbose, int bars, int caps, - int errors); + int errors, int vpd); static void list_verbose(struct pci_conf *p); +static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); static int load_vendors(void); @@ -86,7 +87,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcev] [device]", + "usage: pciconf -l [-bcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -98,13 +99,13 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose; + int bars, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = byte = isshort = 0; + bars = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -143,6 +144,10 @@ main(int argc, char **argv) verbose = 1; break; + case 'V': + vpd = 1; + break; + default: usage(); } @@ -156,7 +161,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors); + bars, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -173,7 +178,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors) +list_devs(const char *name, int verbose, int bars, int caps, int errors, + int vpd) { int fd; struct pci_conf_io pc; @@ -246,6 +252,8 @@ list_devs(const char *name, int verbose, list_caps(fd, p); if (errors) list_errors(fd, p); + if (vpd) + list_vpd(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); @@ -339,6 +347,63 @@ list_verbose(struct pci_conf *p) printf(" subclass = %s\n", dp); } +static void +list_vpd(int fd, struct pci_conf *p) +{ + struct pci_list_vpd_io list; + struct pci_vpd_element *vpd, *end; + + list.plvi_sel = p->pc_sel; + list.plvi_len = 0; + list.plvi_data = NULL; + if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0) + return; + + list.plvi_data = malloc(list.plvi_len); + if (ioctl(fd, PCIOCLISTVPD, &list) < 0) { + free(list.plvi_data); + return; + } + + vpd = list.plvi_data; + end = (struct pci_vpd_element *)((char *)vpd + list.plvi_len); + for (; vpd < end; vpd = PVE_NEXT(vpd)) { + if (vpd->pve_flags == PVE_FLAG_IDENT) { + printf(" VPD ident = '%.*s'\n", + (int)vpd->pve_datalen, vpd->pve_data); + continue; + } + + /* Ignore the checksum keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "RV", 2) == 0) + continue; + + /* Ignore remaining read-write space. */ + if (vpd->pve_flags & PVE_FLAG_RW && + memcmp(vpd->pve_keyword, "RW", 2) == 0) + continue; + + /* Handle extended capability keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "CP", 2) == 0) { + printf(" VPD ro CP = ID %02x in map 0x%x[0x%x]\n", + (unsigned int)vpd->pve_data[0], + PCIR_BAR((unsigned int)vpd->pve_data[1]), + (unsigned int)vpd->pve_data[3] << 8 | + (unsigned int)vpd->pve_data[2]); + continue; + } + + /* Remaining keywords should all have ASCII values. */ + printf(" VPD %s %c%c = '%.*s'\n", + vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", + vpd->pve_keyword[0], vpd->pve_keyword[1], + (int)vpd->pve_datalen, vpd->pve_data); + } + free(list.plvi_data); +} + /* * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c. */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:19:53 2014 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 ESMTPS id AD0443D3; Mon, 17 Feb 2014 22:19:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 945CC1757; Mon, 17 Feb 2014 22:19:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMJr3q078301; Mon, 17 Feb 2014 22:19:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMJq7U078294; Mon, 17 Feb 2014 22:19:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402172219.s1HMJq7U078294@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Feb 2014 22:19: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: r262134 - in stable: 10/sys/dev/pci 10/sys/sys 10/usr.sbin/pciconf 8/sys/dev/pci 8/sys/sys 8/usr.sbin/pciconf 9/sys/dev/pci 9/sys/sys 9/usr.sbin/pciconf 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:19:53 -0000 Author: jhb Date: Mon Feb 17 22:19:49 2014 New Revision: 262134 URL: http://svnweb.freebsd.org/changeset/base/262134 Log: MFC 260926: Add support for displaying VPD for PCI devices via pciconf. - Store the length of each read-only VPD value since not all values are guaranteed to be ASCII values (though most are). - Add a new pciio ioctl to fetch VPD for a single PCI device. The values are returned as a list of variable length records, one for the device name and each keyword. - Add a new -V flag to pciconf's list mode which displays VPD data for each device. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_user.c stable/9/sys/dev/pci/pcivar.h stable/9/sys/sys/pciio.h stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_user.c stable/10/sys/dev/pci/pcivar.h stable/10/sys/sys/pciio.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/sys/pciio.h stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/dev/pci/pci.c Mon Feb 17 22:19:49 2014 (r262134) @@ -995,7 +995,7 @@ pci_read_vpd(device_t pcib, pcicfgregs * state = -2; break; } - dflen = byte2; + cfg->vpd.vpd_ros[off].len = dflen = byte2; if (dflen == 0 && strncmp(cfg->vpd.vpd_ros[off].keyword, "RV", 2) == 0) { @@ -1196,6 +1196,17 @@ pci_get_vpd_readonly_method(device_t dev return (ENXIO); } +struct pcicfg_vpd * +pci_fetch_vpd_list(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + pcicfgregs *cfg = &dinfo->cfg; + + if (!cfg->vpd.vpd_cached && cfg->vpd.vpd_reg != 0) + pci_read_vpd(device_get_parent(device_get_parent(dev)), cfg); + return (&cfg->vpd); +} + /* * Find the requested extended capability and return the offset in * configuration space via the pointer provided. The function returns Modified: stable/9/sys/dev/pci/pci_user.c ============================================================================== --- stable/9/sys/dev/pci/pci_user.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/dev/pci/pci_user.c Mon Feb 17 22:19:49 2014 (r262134) @@ -407,6 +407,89 @@ pci_conf_match_old32(struct pci_match_co #endif /* PRE7_COMPAT */ static int +pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) +{ + struct pci_vpd_element vpd_element, *vpd_user; + struct pcicfg_vpd *vpd; + size_t len; + int error, i; + + vpd = pci_fetch_vpd_list(dev); + if (vpd->vpd_reg == 0 || vpd->vpd_ident == NULL) + return (ENXIO); + + /* + * Calculate the amount of space needed in the data buffer. An + * identifier element is always present followed by the read-only + * and read-write keywords. + */ + len = sizeof(struct pci_vpd_element) + strlen(vpd->vpd_ident); + for (i = 0; i < vpd->vpd_rocnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_ros[i].len; + for (i = 0; i < vpd->vpd_wcnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_w[i].len; + + if (lvio->plvi_len == 0) { + lvio->plvi_len = len; + return (0); + } + if (lvio->plvi_len < len) { + lvio->plvi_len = len; + return (ENOMEM); + } + + /* + * Copyout the identifier string followed by each keyword and + * value. + */ + vpd_user = lvio->plvi_data; + vpd_element.pve_keyword[0] = '\0'; + vpd_element.pve_keyword[1] = '\0'; + vpd_element.pve_flags = PVE_FLAG_IDENT; + vpd_element.pve_datalen = strlen(vpd->vpd_ident); + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ident, vpd_user->pve_data, + strlen(vpd->vpd_ident)); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + vpd_element.pve_flags = 0; + for (i = 0; i < vpd->vpd_rocnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_ros[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_ros[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ros[i].value, vpd_user->pve_data, + vpd->vpd_ros[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + vpd_element.pve_flags = PVE_FLAG_RW; + for (i = 0; i < vpd->vpd_wcnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_w[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_w[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_w[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_w[i].value, vpd_user->pve_data, + vpd->vpd_w[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, + ("length mismatch")); + lvio->plvi_len = len; + return (0); +} + +static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev, brdev; @@ -417,6 +500,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_devinfo *dinfo; struct pci_io *io; struct pci_bar_io *bio; + struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; size_t confsz, iolen, pbufsz; @@ -433,19 +517,29 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_match_conf_old *pattern_buf_old = NULL; io_old = NULL; +#endif - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && - cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD) - return EPERM; -#else - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && cmd != PCIOCGETCONF) - return EPERM; + if (!(flag & FWRITE)) { + switch (cmd) { +#ifdef PRE7_COMPAT +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: +#endif + case PCIOCGETCONF_OLD: #endif + case PCIOCGETCONF: + case PCIOCGETBAR: + case PCIOCLISTVPD: + break; + default: + return (EPERM); + } + } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_OLD32: cio32 = (struct pci_conf_io32 *)data; cio = malloc(sizeof(struct pci_conf_io), M_TEMP, M_WAITOK); cio->pat_buf_len = cio32->pat_buf_len; @@ -466,7 +560,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, cio = (struct pci_conf_io *)data; } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF_OLD32: @@ -912,6 +1006,22 @@ getconfexit: else error = ENODEV; break; + case PCIOCLISTVPD: + lvio = (struct pci_list_vpd_io *)data; + + /* + * Assume that the user-level bus number is + * in fact the physical PCI bus number. + */ + pcidev = pci_find_dbsf(lvio->plvi_sel.pc_domain, + lvio->plvi_sel.pc_bus, lvio->plvi_sel.pc_dev, + lvio->plvi_sel.pc_func); + if (pcidev == NULL) { + error = ENODEV; + break; + } + error = pci_list_vpd(pcidev, lvio); + break; default: error = ENOTTY; break; Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/dev/pci/pcivar.h Mon Feb 17 22:19:49 2014 (r262134) @@ -57,6 +57,7 @@ struct pci_map { struct vpd_readonly { char keyword[2]; char *value; + int len; }; struct vpd_write { @@ -489,6 +490,7 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +struct pcicfg_vpd *pci_fetch_vpd_list(device_t dev); #define VGA_PCI_BIOS_SHADOW_ADDR 0xC0000 #define VGA_PCI_BIOS_SHADOW_SIZE 131072 Modified: stable/9/sys/sys/pciio.h ============================================================================== --- stable/9/sys/sys/pciio.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/sys/pciio.h Mon Feb 17 22:19:49 2014 (r262134) @@ -116,10 +116,31 @@ struct pci_bar_io { uint64_t pbi_length; /* length of BAR */ }; +struct pci_vpd_element { + char pve_keyword[2]; + uint8_t pve_flags; + uint8_t pve_datalen; + uint8_t pve_data[0]; +}; + +#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */ +#define PVE_FLAG_RW 0x02 /* Element is read/write */ + +#define PVE_NEXT(pve) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (pve)->pve_datalen)) + +struct pci_list_vpd_io { + struct pcisel plvi_sel; /* device to operate on */ + size_t plvi_len; /* size of the data area */ + struct pci_vpd_element *plvi_data; +}; + #define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io) #define PCIOCREAD _IOWR('p', 2, struct pci_io) #define PCIOCWRITE _IOWR('p', 3, struct pci_io) #define PCIOCATTACHED _IOWR('p', 4, struct pci_io) #define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io) +#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io) #endif /* !_SYS_PCIIO_H_ */ Modified: stable/9/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:19:49 2014 (r262134) @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcev Oc Op Ar device +.Fl l Oo Fl bcevV Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -182,6 +182,28 @@ option is supplied, will attempt to load the vendor/device information database, and print vendor, device, class and subclass identification strings for each device. .Pp +If the +.Fl V +option is supplied, +.Nm +will list any vital product data +.Pq VPD +provided by each device. +Each VPD keyword is enumerated via a line in the following format: +.Bd -literal + VPD ro PN = '110114640C0 ' +.Ed +.Pp +The first string after the +.Dq Li VPD +prefix indicates if the keyword is read-only +.Dq ro +or read-write +.Dq rw . +The second string provides the keyword name. +The text after the the equals sign lists the value of the keyword which is +usually an ASCII string. +.Pp If the optional .Ar device argument is given with the Modified: stable/9/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:19:49 2014 (r262134) @@ -71,8 +71,9 @@ TAILQ_HEAD(,pci_vendor_info) pci_vendors static struct pcisel getsel(const char *str); static void list_bars(int fd, struct pci_conf *p); static void list_devs(const char *name, int verbose, int bars, int caps, - int errors); + int errors, int vpd); static void list_verbose(struct pci_conf *p); +static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); static int load_vendors(void); @@ -86,7 +87,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcev] [device]", + "usage: pciconf -l [-bcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -98,13 +99,13 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose; + int bars, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = byte = isshort = 0; + bars = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -143,6 +144,10 @@ main(int argc, char **argv) verbose = 1; break; + case 'V': + vpd = 1; + break; + default: usage(); } @@ -156,7 +161,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors); + bars, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -173,7 +178,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors) +list_devs(const char *name, int verbose, int bars, int caps, int errors, + int vpd) { int fd; struct pci_conf_io pc; @@ -246,6 +252,8 @@ list_devs(const char *name, int verbose, list_caps(fd, p); if (errors) list_errors(fd, p); + if (vpd) + list_vpd(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); @@ -339,6 +347,63 @@ list_verbose(struct pci_conf *p) printf(" subclass = %s\n", dp); } +static void +list_vpd(int fd, struct pci_conf *p) +{ + struct pci_list_vpd_io list; + struct pci_vpd_element *vpd, *end; + + list.plvi_sel = p->pc_sel; + list.plvi_len = 0; + list.plvi_data = NULL; + if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0) + return; + + list.plvi_data = malloc(list.plvi_len); + if (ioctl(fd, PCIOCLISTVPD, &list) < 0) { + free(list.plvi_data); + return; + } + + vpd = list.plvi_data; + end = (struct pci_vpd_element *)((char *)vpd + list.plvi_len); + for (; vpd < end; vpd = PVE_NEXT(vpd)) { + if (vpd->pve_flags == PVE_FLAG_IDENT) { + printf(" VPD ident = '%.*s'\n", + (int)vpd->pve_datalen, vpd->pve_data); + continue; + } + + /* Ignore the checksum keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "RV", 2) == 0) + continue; + + /* Ignore remaining read-write space. */ + if (vpd->pve_flags & PVE_FLAG_RW && + memcmp(vpd->pve_keyword, "RW", 2) == 0) + continue; + + /* Handle extended capability keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "CP", 2) == 0) { + printf(" VPD ro CP = ID %02x in map 0x%x[0x%x]\n", + (unsigned int)vpd->pve_data[0], + PCIR_BAR((unsigned int)vpd->pve_data[1]), + (unsigned int)vpd->pve_data[3] << 8 | + (unsigned int)vpd->pve_data[2]); + continue; + } + + /* Remaining keywords should all have ASCII values. */ + printf(" VPD %s %c%c = '%.*s'\n", + vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", + vpd->pve_keyword[0], vpd->pve_keyword[1], + (int)vpd->pve_datalen, vpd->pve_data); + } + free(list.plvi_data); +} + /* * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c. */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:26:22 2014 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 ESMTPS id C36E9950; Mon, 17 Feb 2014 22:26:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC82C1827; Mon, 17 Feb 2014 22:26:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMQMPq081799; Mon, 17 Feb 2014 22:26:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMQLji081791; Mon, 17 Feb 2014 22:26:21 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402172226.s1HMQLji081791@svn.freebsd.org> From: Christian Brueffer Date: Mon, 17 Feb 2014 22:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262135 - in head/libexec: fingerd rbootd 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:26:22 -0000 Author: brueffer Date: Mon Feb 17 22:26:21 2014 New Revision: 262135 URL: http://svnweb.freebsd.org/changeset/base/262135 Log: Add $FreeBSD$. MFC after: 1 week Modified: head/libexec/fingerd/pathnames.h head/libexec/rbootd/pathnames.h head/libexec/rbootd/rmp.h head/libexec/rbootd/rmp_var.h Modified: head/libexec/fingerd/pathnames.h ============================================================================== --- head/libexec/fingerd/pathnames.h Mon Feb 17 22:19:49 2014 (r262134) +++ head/libexec/fingerd/pathnames.h Mon Feb 17 22:26:21 2014 (r262135) @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 + * + * $FreeBSD$ */ #define _PATH_FINGER "/usr/bin/finger" Modified: head/libexec/rbootd/pathnames.h ============================================================================== --- head/libexec/rbootd/pathnames.h Mon Feb 17 22:19:49 2014 (r262134) +++ head/libexec/rbootd/pathnames.h Mon Feb 17 22:26:21 2014 (r262135) @@ -42,6 +42,8 @@ * * From: Utah Hdr: pathnames.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS + * + * $FreeBSD$ */ #define _PATH_BPF "/dev/bpf%d" Modified: head/libexec/rbootd/rmp.h ============================================================================== --- head/libexec/rbootd/rmp.h Mon Feb 17 22:19:49 2014 (r262134) +++ head/libexec/rbootd/rmp.h Mon Feb 17 22:26:21 2014 (r262135) @@ -42,6 +42,8 @@ * * From: Utah Hdr: rmp.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS + * + * $FreeBSD$ */ /* Modified: head/libexec/rbootd/rmp_var.h ============================================================================== --- head/libexec/rbootd/rmp_var.h Mon Feb 17 22:19:49 2014 (r262134) +++ head/libexec/rbootd/rmp_var.h Mon Feb 17 22:26:21 2014 (r262135) @@ -42,6 +42,8 @@ * * from: Utah Hdr: rmp_var.h 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS + * + * $FreeBSD$ */ /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:27:44 2014 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 ESMTPS id B25E2AC0; Mon, 17 Feb 2014 22:27:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A78B1844; Mon, 17 Feb 2014 22:27:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMRiek082027; Mon, 17 Feb 2014 22:27:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMRXDX081960; Mon, 17 Feb 2014 22:27:33 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402172227.s1HMRXDX081960@svn.freebsd.org> From: Christian Brueffer Date: Mon, 17 Feb 2014 22:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262136 - in head/libexec: bootpd comsat fingerd ftpd getty mknetid rbootd revnetgroup rlogind rpc.rstatd rpc.rusersd rpc.rwalld rshd rtld-elf talkd tftpd 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:27:44 -0000 Author: brueffer Date: Mon Feb 17 22:27:32 2014 New Revision: 262136 URL: http://svnweb.freebsd.org/changeset/base/262136 Log: Remove the 3rd clause ("advertising clause") of the BSD license as permitted by the University of Berkeley on July 22, 1999. Reviewed by: imp MFC after: 1 week Modified: head/libexec/bootpd/rtmsg.c head/libexec/comsat/comsat.8 head/libexec/comsat/comsat.c head/libexec/fingerd/fingerd.8 head/libexec/fingerd/fingerd.c head/libexec/fingerd/pathnames.h head/libexec/ftpd/extern.h head/libexec/ftpd/ftpcmd.y head/libexec/ftpd/ftpd.8 head/libexec/ftpd/ftpd.c head/libexec/ftpd/logwtmp.c head/libexec/ftpd/pathnames.h head/libexec/ftpd/popen.c head/libexec/getty/extern.h head/libexec/getty/getty.8 head/libexec/getty/gettytab.5 head/libexec/getty/gettytab.h head/libexec/getty/init.c head/libexec/getty/main.c head/libexec/getty/pathnames.h head/libexec/getty/subr.c head/libexec/getty/ttys.5 head/libexec/mknetid/parse_group.c head/libexec/rbootd/bpf.c head/libexec/rbootd/conf.c head/libexec/rbootd/defs.h head/libexec/rbootd/parseconf.c head/libexec/rbootd/pathnames.h head/libexec/rbootd/rbootd.8 head/libexec/rbootd/rbootd.c head/libexec/rbootd/rmp.h head/libexec/rbootd/rmp_var.h head/libexec/rbootd/rmpproto.c head/libexec/rbootd/utils.c head/libexec/revnetgroup/parse_netgroup.c head/libexec/rlogind/rlogind.8 head/libexec/rlogind/rlogind.c head/libexec/rpc.rstatd/rpc.rstatd.8 head/libexec/rpc.rstatd/rstatd.c head/libexec/rpc.rusersd/extern.h head/libexec/rpc.rusersd/rpc.rusersd.8 head/libexec/rpc.rusersd/rusers_proc.c head/libexec/rpc.rusersd/rusersd.c head/libexec/rpc.rwalld/rpc.rwalld.8 head/libexec/rshd/rshd.8 head/libexec/rshd/rshd.c head/libexec/rtld-elf/malloc.c head/libexec/talkd/announce.c head/libexec/talkd/print.c head/libexec/talkd/process.c head/libexec/talkd/table.c head/libexec/talkd/talkd.8 head/libexec/talkd/talkd.c head/libexec/tftpd/tftpd.8 head/libexec/tftpd/tftpd.c Modified: head/libexec/bootpd/rtmsg.c ============================================================================== --- head/libexec/bootpd/rtmsg.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/bootpd/rtmsg.c Mon Feb 17 22:27:32 2014 (r262136) @@ -16,11 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/comsat/comsat.8 ============================================================================== --- head/libexec/comsat/comsat.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/comsat/comsat.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/comsat/comsat.c ============================================================================== --- head/libexec/comsat/comsat.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/comsat/comsat.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/fingerd/fingerd.8 ============================================================================== --- head/libexec/fingerd/fingerd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/fingerd/fingerd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/fingerd/fingerd.c ============================================================================== --- head/libexec/fingerd/fingerd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/fingerd/fingerd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/fingerd/pathnames.h ============================================================================== --- head/libexec/fingerd/pathnames.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/fingerd/pathnames.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/ftpd/extern.h ============================================================================== --- head/libexec/ftpd/extern.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/extern.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/ftpd/ftpcmd.y ============================================================================== --- head/libexec/ftpd/ftpcmd.y Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/ftpcmd.y Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/ftpd/ftpd.8 ============================================================================== --- head/libexec/ftpd/ftpd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/ftpd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/ftpd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/ftpd/logwtmp.c ============================================================================== --- head/libexec/ftpd/logwtmp.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/logwtmp.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/ftpd/pathnames.h ============================================================================== --- head/libexec/ftpd/pathnames.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/pathnames.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/ftpd/popen.c ============================================================================== --- head/libexec/ftpd/popen.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/ftpd/popen.c Mon Feb 17 22:27:32 2014 (r262136) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/extern.h ============================================================================== --- head/libexec/getty/extern.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/extern.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/getty.8 ============================================================================== --- head/libexec/getty/getty.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/getty.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/getty/gettytab.5 ============================================================================== --- head/libexec/getty/gettytab.5 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/gettytab.5 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/getty/gettytab.h ============================================================================== --- head/libexec/getty/gettytab.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/gettytab.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/init.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/main.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/pathnames.h ============================================================================== --- head/libexec/getty/pathnames.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/pathnames.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/subr.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/getty/ttys.5 ============================================================================== --- head/libexec/getty/ttys.5 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/getty/ttys.5 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/mknetid/parse_group.c ============================================================================== --- head/libexec/mknetid/parse_group.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/mknetid/parse_group.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/bpf.c ============================================================================== --- head/libexec/rbootd/bpf.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/bpf.c Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/conf.c ============================================================================== --- head/libexec/rbootd/conf.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/conf.c Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/defs.h ============================================================================== --- head/libexec/rbootd/defs.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/defs.h Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/parseconf.c ============================================================================== --- head/libexec/rbootd/parseconf.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/parseconf.c Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/pathnames.h ============================================================================== --- head/libexec/rbootd/pathnames.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/pathnames.h Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/rbootd.8 ============================================================================== --- head/libexec/rbootd/rbootd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/rbootd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -17,11 +17,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/rbootd/rbootd.c ============================================================================== --- head/libexec/rbootd/rbootd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/rbootd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/rmp.h ============================================================================== --- head/libexec/rbootd/rmp.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/rmp.h Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/rmp_var.h ============================================================================== --- head/libexec/rbootd/rmp_var.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/rmp_var.h Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/rmpproto.c ============================================================================== --- head/libexec/rbootd/rmpproto.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/rmpproto.c Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rbootd/utils.c ============================================================================== --- head/libexec/rbootd/utils.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rbootd/utils.c Mon Feb 17 22:27:32 2014 (r262136) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/revnetgroup/parse_netgroup.c ============================================================================== --- head/libexec/revnetgroup/parse_netgroup.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/revnetgroup/parse_netgroup.c Mon Feb 17 22:27:32 2014 (r262136) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rlogind/rlogind.8 ============================================================================== --- head/libexec/rlogind/rlogind.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rlogind/rlogind.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/rlogind/rlogind.c ============================================================================== --- head/libexec/rlogind/rlogind.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rlogind/rlogind.c Mon Feb 17 22:27:32 2014 (r262136) @@ -17,11 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rpc.rstatd/rpc.rstatd.8 ============================================================================== --- head/libexec/rpc.rstatd/rpc.rstatd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rstatd/rpc.rstatd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -11,11 +11,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/rpc.rstatd/rstatd.c ============================================================================== --- head/libexec/rpc.rstatd/rstatd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rstatd/rstatd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rpc.rusersd/extern.h ============================================================================== --- head/libexec/rpc.rusersd/extern.h Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rusersd/extern.h Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rpc.rusersd/rpc.rusersd.8 ============================================================================== --- head/libexec/rpc.rusersd/rpc.rusersd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rusersd/rpc.rusersd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -11,11 +11,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/rpc.rusersd/rusers_proc.c ============================================================================== --- head/libexec/rpc.rusersd/rusers_proc.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rusersd/rusers_proc.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rpc.rusersd/rusersd.c ============================================================================== --- head/libexec/rpc.rusersd/rusersd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rusersd/rusersd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rpc.rwalld/rpc.rwalld.8 ============================================================================== --- head/libexec/rpc.rwalld/rpc.rwalld.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rpc.rwalld/rpc.rwalld.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -11,11 +11,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/rshd/rshd.8 ============================================================================== --- head/libexec/rshd/rshd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rshd/rshd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/rshd/rshd.c ============================================================================== --- head/libexec/rshd/rshd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rshd/rshd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -17,11 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/rtld-elf/malloc.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/talkd/announce.c ============================================================================== --- head/libexec/talkd/announce.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/talkd/announce.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/talkd/print.c ============================================================================== --- head/libexec/talkd/print.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/talkd/print.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/talkd/process.c ============================================================================== --- head/libexec/talkd/process.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/talkd/process.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/talkd/table.c ============================================================================== --- head/libexec/talkd/table.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/talkd/table.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/talkd/talkd.8 ============================================================================== --- head/libexec/talkd/talkd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/talkd/talkd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/talkd/talkd.c ============================================================================== --- head/libexec/talkd/talkd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/talkd/talkd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/tftpd/tftpd.8 Mon Feb 17 22:27:32 2014 (r262136) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. 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. .\" Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Mon Feb 17 22:26:21 2014 (r262135) +++ head/libexec/tftpd/tftpd.c Mon Feb 17 22:27:32 2014 (r262136) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. 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. * From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:40:06 2014 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 ESMTPS id 76DE01AE; Mon, 17 Feb 2014 22:40:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E52E1960; Mon, 17 Feb 2014 22:40:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMe64I086820; Mon, 17 Feb 2014 22:40:06 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMe5aG086811; Mon, 17 Feb 2014 22:40:05 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402172240.s1HMe5aG086811@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 22:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262137 - in stable/10: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/axge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:40:06 -0000 Author: markj Date: Mon Feb 17 22:40:05 2014 New Revision: 262137 URL: http://svnweb.freebsd.org/changeset/base/262137 Log: MFC r258036: Add IDs for the ASIX 88179 and 88178A USB to GigE adapters. MFC r258331: Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179 supports USB 3.0. MFC r258617 (by lwhsu): Also note to add xhci(4) to kernel configuration to utilize USB 3.0 MFC r258618 (by lwhsu): Mention axge(4) Added: stable/10/share/man/man4/axge.4 - copied, changed from r258331, head/share/man/man4/axge.4 stable/10/sys/dev/usb/net/if_axge.c - copied unchanged from r258331, head/sys/dev/usb/net/if_axge.c stable/10/sys/dev/usb/net/if_axgereg.h - copied unchanged from r258331, head/sys/dev/usb/net/if_axgereg.h stable/10/sys/modules/usb/axge/ - copied from r258331, head/sys/modules/usb/axge/ Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/usb.4 stable/10/sys/conf/files stable/10/sys/dev/usb/usbdevs stable/10/sys/modules/usb/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Mon Feb 17 22:27:32 2014 (r262136) +++ stable/10/share/man/man4/Makefile Mon Feb 17 22:40:05 2014 (r262137) @@ -67,6 +67,7 @@ MAN= aac.4 \ auditpipe.4 \ aue.4 \ axe.4 \ + axge.4 \ bce.4 \ bfe.4 \ bge.4 \ Copied and modified: stable/10/share/man/man4/axge.4 (from r258331, head/share/man/man4/axge.4) ============================================================================== --- head/share/man/man4/axge.4 Tue Nov 19 00:37:53 2013 (r258331, copy source) +++ stable/10/share/man/man4/axge.4 Mon Feb 17 22:40:05 2014 (r262137) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2013 +.Dd November 22, 2013 .Dt AXGE 4 .Os .Sh NAME @@ -41,6 +41,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device xhci" .Cd "device ehci" .Cd "device uhci" .Cd "device ohci" Modified: stable/10/share/man/man4/usb.4 ============================================================================== --- stable/10/share/man/man4/usb.4 Mon Feb 17 22:27:32 2014 (r262136) +++ stable/10/share/man/man4/usb.4 Mon Feb 17 22:40:05 2014 (r262137) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2009 +.Dd November 26, 2013 .Dt USB 4 .Os .Sh NAME @@ -147,6 +147,7 @@ specifications can be found at: .Xr usbdi 4 , .Xr aue 4 , .Xr axe 4 , +.Xr axge 4 , .Xr cue 4 , .Xr ehci 4 , .Xr kue 4 , Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 22:27:32 2014 (r262136) +++ stable/10/sys/conf/files Mon Feb 17 22:40:05 2014 (r262137) @@ -2342,6 +2342,7 @@ dev/usb/usb_util.c optional usb # dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe +dev/usb/net/if_axge.c optional axge dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth @@ -2352,8 +2353,8 @@ dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie dev/usb/net/ruephy.c optional rue -dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ - rue | smsc | udav | ipheth +dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ + mos | rue | smsc | udav | ipheth dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Copied: stable/10/sys/dev/usb/net/if_axge.c (from r258331, head/sys/dev/usb/net/if_axge.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/usb/net/if_axge.c Mon Feb 17 22:40:05 2014 (r262137, copy of r258331, head/sys/dev/usb/net/if_axge.c) @@ -0,0 +1,1023 @@ +/*- + * Copyright (c) 2013 Kevin Lo + * 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$"); + +/* + * ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR axge_debug +#include +#include + +#include +#include + +/* + * Various supported device vendors/products. + */ + +static const STRUCT_USB_HOST_ID axge_devs[] = { +#define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } + AXGE_DEV(ASIX, AX88178A), + AXGE_DEV(ASIX, AX88179), + /* AXGE_DEV(SITECOMEU, LN032), */ +#undef AXGE_DEV +}; + +static const struct { + unsigned char ctrl, timer_l, timer_h, size, ifg; +} AX88179_BULKIN_SIZE[] = { + {7, 0x4f, 0, 0x12, 0xff}, + {7, 0x20, 3, 0x16, 0xff}, + {7, 0xae, 7, 0x18, 0xff}, + {7, 0xcc, 0x4c, 0x18, 8}, +}; + +/* prototypes */ + +static device_probe_t axge_probe; +static device_attach_t axge_attach; +static device_detach_t axge_detach; + +static usb_callback_t axge_bulk_read_callback; +static usb_callback_t axge_bulk_write_callback; + +static miibus_readreg_t axge_miibus_readreg; +static miibus_writereg_t axge_miibus_writereg; +static miibus_statchg_t axge_miibus_statchg; + +static uether_fn_t axge_attach_post; +static uether_fn_t axge_init; +static uether_fn_t axge_stop; +static uether_fn_t axge_start; +static uether_fn_t axge_tick; +static uether_fn_t axge_setmulti; +static uether_fn_t axge_setpromisc; + +static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t); +static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint8_t); +static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint16_t); +static void axge_chip_init(struct axge_softc *); +static void axge_reset(struct axge_softc *); + +static int axge_attach_post_sub(struct usb_ether *); +static int axge_ifmedia_upd(struct ifnet *); +static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int axge_ioctl(struct ifnet *, u_long, caddr_t); +static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); +static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, + unsigned int, unsigned int, struct axge_csum_hdr *); +static void axge_csum_cfg(struct usb_ether *); + +#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +#ifdef USB_DEBUG +static int axge_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW, 0, "USB axge"); +SYSCTL_INT(_hw_usb_axge, OID_AUTO, debug, CTLFLAG_RW, &axge_debug, 0, + "Debug level"); +#endif + +static const struct usb_config axge_config[AXGE_N_TRANSFER] = { + [AXGE_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .frames = 16, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = axge_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + [AXGE_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 20480, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = axge_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, +}; + +static device_method_t axge_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, axge_probe), + DEVMETHOD(device_attach, axge_attach), + DEVMETHOD(device_detach, axge_detach), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, axge_miibus_readreg), + DEVMETHOD(miibus_writereg, axge_miibus_writereg), + DEVMETHOD(miibus_statchg, axge_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t axge_driver = { + .name = "axge", + .methods = axge_methods, + .size = sizeof(struct axge_softc), +}; + +static devclass_t axge_devclass; + +DRIVER_MODULE(axge, uhub, axge_driver, axge_devclass, NULL, NULL); +DRIVER_MODULE(miibus, axge, miibus_driver, miibus_devclass, NULL, NULL); +MODULE_DEPEND(axge, uether, 1, 1, 1); +MODULE_DEPEND(axge, usb, 1, 1, 1); +MODULE_DEPEND(axge, ether, 1, 1, 1); +MODULE_DEPEND(axge, miibus, 1, 1, 1); +MODULE_VERSION(axge, 1); + +static const struct usb_ether_methods axge_ue_methods = { + .ue_attach_post = axge_attach_post, + .ue_attach_post_sub = axge_attach_post_sub, + .ue_start = axge_start, + .ue_init = axge_init, + .ue_stop = axge_stop, + .ue_tick = axge_tick, + .ue_setmulti = axge_setmulti, + .ue_setpromisc = axge_setpromisc, + .ue_mii_upd = axge_ifmedia_upd, + .ue_mii_sts = axge_ifmedia_sts, +}; + +static int +axge_read_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + return (uether_do_request(&sc->sc_ue, &req, buf, 1000)); +} + +static void +axge_write_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + if (uether_do_request(&sc->sc_ue, &req, buf, 1000)) { + /* Error ignored. */ + } +} + +static uint16_t +axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg) +{ + uint8_t val[2]; + + axge_read_mem(sc, cmd, index, reg, &val, 2); + return (UGETW(val)); +} + +static void +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint8_t val) +{ + axge_write_mem(sc, cmd, index, reg, &val, 1); +} + +static void +axge_write_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint16_t val) +{ + uint8_t temp[2]; + + USETW(temp, val); + axge_write_mem(sc, cmd, index, reg, &temp, 2); +} + +static int +axge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct axge_softc *sc; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + val = axge_read_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy); + + if (!locked) + AXGE_UNLOCK(sc); + + return (val); +} + +static int +axge_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct axge_softc *sc; + int locked; + + sc = device_get_softc(dev); + if (sc->sc_phyno != phy) + return (0); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + axge_write_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy, val); + + if (!locked) + AXGE_UNLOCK(sc); + + return (0); +} + +static void +axge_miibus_statchg(device_t dev) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + mii = GET_MII(sc); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + ifp = uether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + sc->sc_flags &= ~AXGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: + sc->sc_flags |= AXGE_FLAG_LINK; + break; + default: + break; + } + } + + /* Lost link, do nothing. */ + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) + goto done; + + val = 0; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + val |= AXGE_MEDIUM_FULL_DUPLEX; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + } + val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + val |= AXGE_MEDIUM_GIGAMODE; + case IFM_100_TX: + val |= AXGE_MEDIUM_PS; + case IFM_10_T: + /* Doesn't need to be handled. */ + break; + } + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); + +done: + if (!locked) + AXGE_UNLOCK(sc); +} + +static void +axge_chip_init(struct axge_softc *sc) +{ + /* Power up ethernet PHY. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, + AXGE_PHYPWR_RSTCTL_IPRL); + uether_pause(&sc->sc_ue, hz / 4); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); + uether_pause(&sc->sc_ue, hz / 10); +} + +static void +axge_reset(struct axge_softc *sc) +{ + struct usb_config_descriptor *cd; + usb_error_t err; + + cd = usbd_get_config_descriptor(sc->sc_ue.ue_udev); + + err = usbd_req_set_config(sc->sc_ue.ue_udev, &sc->sc_mtx, + cd->bConfigurationValue); + if (err) + DPRINTF("reset failed (ignored)\n"); + + /* Wait a little while for the chip to get its brains in order. */ + uether_pause(&sc->sc_ue, hz / 100); + + /* Reinitialize controller to achieve full reset. */ + axge_chip_init(sc); +} + +static void +axge_attach_post(struct usb_ether *ue) +{ + struct axge_softc *sc; + uint8_t tmp[5]; + + sc = uether_getsc(ue); + sc->sc_phyno = 3; + + /* Initialize controller and get station address. */ + axge_chip_init(sc); + + memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + ue->ue_eaddr, ETHER_ADDR_LEN); +} + +static int +axge_attach_post_sub(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + int error; + + sc = uether_getsc(ue); + ifp = ue->ue_ifp; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = uether_start; + ifp->if_ioctl = axge_ioctl; + ifp->if_init = uether_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = AXGE_CSUM_FEATURES; + ifp->if_capenable = ifp->if_capabilities; + + mtx_lock(&Giant); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + mtx_unlock(&Giant); + + return (error); +} + +/* + * Set media options. + */ +static int +axge_ifmedia_upd(struct ifnet *ifp) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + + return (error); +} + +/* + * Report current media status. + */ +static void +axge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + AXGE_UNLOCK(sc); +} + +/* + * Probe for a AX88179 chip. + */ +static int +axge_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != AXGE_CONFIG_IDX) + return (ENXIO); + if (uaa->info.bIfaceIndex != AXGE_IFACE_IDX) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(axge_devs, sizeof(axge_devs), uaa)); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +axge_attach(device_t dev) +{ + struct usb_attach_arg *uaa; + struct axge_softc *sc; + struct usb_ether *ue; + uint8_t iface_index; + int error; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + ue = &sc->sc_ue; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + iface_index = AXGE_IFACE_IDX; + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(dev, "allocating USB transfers failed\n"); + goto detach; + } + + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &axge_ue_methods; + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); /* success */ + +detach: + axge_detach(dev); + return (ENXIO); /* failure */ +} + +static int +axge_detach(device_t dev) +{ + struct axge_softc *sc; + struct usb_ether *ue; + + sc = device_get_softc(dev); + ue = &sc->sc_ue; + usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +axge_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct usb_ether *ue; + struct usb_page_cache *pc; + int actlen; + + sc = usbd_xfer_softc(xfer); + ue = &sc->sc_ue; + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(xfer, 0); + axge_rx_frame(ue, pc, actlen); + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(ue); + return; + + default: + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct usb_page_cache *pc; + struct mbuf *m; + uint32_t txhdr; + uint32_t txhdr2; + int nframes; + int frm_len; + + sc = usbd_xfer_softc(xfer); + ifp = uether_getifp(&sc->sc_ue); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { + /* + * Don't send anything if there is no link or + * controller is busy. + */ + return; + } + + for (nframes = 0; nframes < 16 && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, + nframes); + frm_len = 0; + pc = usbd_xfer_get_frame(xfer, nframes); + + txhdr = m->m_pkthdr.len; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); + frm_len += sizeof(txhdr); + + txhdr2 = 0; + if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % + usbd_xfer_max_framelen(xfer) == 0) { + txhdr2 |= 0x80008000; + } + txhdr2 = htole32(txhdr2); + usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); + frm_len += sizeof(txhdr2); + + /* Next copy in the actual packet. */ + usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); + frm_len += m->m_pkthdr.len; + + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* + * if there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + m_freem(m); + + /* Set frame length. */ + usbd_xfer_set_frame_len(xfer, nframes, frm_len); + } + if (nframes != 0) { + usbd_xfer_set_frames(xfer, nframes); + usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + return; + /* NOTREACHED */ + default: + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_tick(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = uether_getsc(ue); + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + mii_tick(mii); + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { + axge_miibus_statchg(ue->ue_dev); + if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) + axge_start(ue); + } +} + +static void +axge_setmulti(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h; + uint16_t rxmode; + uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + h = 0; + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + rxmode |= AXGE_RX_CTL_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + return; + } + rxmode &= ~AXGE_RX_CTL_AMALL; + + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashtbl[h / 8] |= 1 << (h % 8); + } + if_maddr_runlock(ifp); + + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, + (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); +} + +static void +axge_setpromisc(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + else + rxmode &= ~AXGE_RX_CTL_PRO; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_setmulti(ue); +} + +static void +axge_start(struct usb_ether *ue) +{ + struct axge_softc *sc; + + sc = uether_getsc(ue); + /* + * Start the USB transfers, if not already started. + */ + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_RD]); + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_WR]); +} + +static void +axge_init(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* + * Cancel pending I/O and free all RX/TX buffers. + */ + axge_stop(ue); + + axge_reset(sc); + + /* Set MAC address. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + IF_LLADDR(ifp), ETHER_ADDR_LEN); + + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH, + 0x52); + + /* Configure TX/RX checksum offloading. */ + axge_csum_cfg(ue); + + /* Configure RX settings. */ + rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START); + + /* If we want promiscuous mode, set the allframes bit. */ + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= AXGE_RX_CTL_AB; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + + /* Load the multicast filter. */ + axge_setmulti(ue); + + usbd_xfer_set_stall(sc->sc_xfer[AXGE_BULK_DT_WR]); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + /* Switch to selected media. */ + axge_ifmedia_upd(ifp); +} + +static void +axge_stop(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->sc_flags &= ~AXGE_FLAG_LINK; + + /* + * Stop all the transfers, if not already stopped: + */ + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_RD]); +} + +static int +axge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct usb_ether *ue; + struct axge_softc *sc; + struct ifreq *ifr; + int error, mask, reinit; + + ue = ifp->if_softc; + sc = uether_getsc(ue); + ifr = (struct ifreq *)data; + error = 0; + reinit = 0; + if (cmd == SIOCSIFCAP) { + AXGE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= AXGE_CSUM_FEATURES; + else + ifp->if_hwassist &= ~AXGE_CSUM_FEATURES; + reinit++; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; + reinit++; + } + if (reinit > 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + else + reinit = 0; + AXGE_UNLOCK(sc); + if (reinit > 0) + uether_init(ue); + } else + error = uether_ioctl(ifp, cmd, data); + + return (error); +} + +static int +axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) +{ + struct axge_softc *sc; + struct axge_csum_hdr csum_hdr; + int error, len, pos; + int pkt_cnt; + uint32_t rxhdr; + uint16_t hdr_off; + uint16_t pktlen; + + sc = uether_getsc(ue); + pos = 0; + len = 0; + error = 0; + + usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); + actlen -= sizeof(rxhdr); + rxhdr = le32toh(rxhdr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:43:08 2014 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 ESMTPS id A4ABD30E; Mon, 17 Feb 2014 22:43:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C78A19D4; Mon, 17 Feb 2014 22:43:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMh8GM089484; Mon, 17 Feb 2014 22:43:08 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMh7qm089476; Mon, 17 Feb 2014 22:43:07 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402172243.s1HMh7qm089476@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 22:43:07 +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: r262138 - in stable/9: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/axge 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:43:08 -0000 Author: markj Date: Mon Feb 17 22:43:07 2014 New Revision: 262138 URL: http://svnweb.freebsd.org/changeset/base/262138 Log: MFC r258036: Add IDs for the ASIX 88179 and 88178A USB to GigE adapters. MFC r258331: Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179 supports USB 3.0. MFC r258617 (by lwhsu): Also note to add xhci(4) to kernel configuration to utilize USB 3.0 MFC r258618 (by lwhsu): Mention axge(4) Added: stable/9/share/man/man4/axge.4 - copied, changed from r258331, head/share/man/man4/axge.4 stable/9/sys/dev/usb/net/if_axge.c - copied unchanged from r258331, head/sys/dev/usb/net/if_axge.c stable/9/sys/dev/usb/net/if_axgereg.h - copied unchanged from r258331, head/sys/dev/usb/net/if_axgereg.h stable/9/sys/modules/usb/axge/ - copied from r258331, head/sys/modules/usb/axge/ Modified: stable/9/share/man/man4/Makefile stable/9/share/man/man4/usb.4 stable/9/sys/conf/files stable/9/sys/dev/usb/usbdevs stable/9/sys/modules/usb/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Feb 17 22:40:05 2014 (r262137) +++ stable/9/share/man/man4/Makefile Mon Feb 17 22:43:07 2014 (r262138) @@ -62,6 +62,7 @@ MAN= aac.4 \ auditpipe.4 \ aue.4 \ axe.4 \ + axge.4 \ bce.4 \ bfe.4 \ bge.4 \ Copied and modified: stable/9/share/man/man4/axge.4 (from r258331, head/share/man/man4/axge.4) ============================================================================== --- head/share/man/man4/axge.4 Tue Nov 19 00:37:53 2013 (r258331, copy source) +++ stable/9/share/man/man4/axge.4 Mon Feb 17 22:43:07 2014 (r262138) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2013 +.Dd November 22, 2013 .Dt AXGE 4 .Os .Sh NAME @@ -41,6 +41,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device xhci" .Cd "device ehci" .Cd "device uhci" .Cd "device ohci" Modified: stable/9/share/man/man4/usb.4 ============================================================================== --- stable/9/share/man/man4/usb.4 Mon Feb 17 22:40:05 2014 (r262137) +++ stable/9/share/man/man4/usb.4 Mon Feb 17 22:43:07 2014 (r262138) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2009 +.Dd November 26, 2013 .Dt USB 4 .Os .Sh NAME @@ -147,6 +147,7 @@ specifications can be found at: .Xr usbdi 4 , .Xr aue 4 , .Xr axe 4 , +.Xr axge 4 , .Xr cue 4 , .Xr ehci 4 , .Xr kue 4 , Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 22:40:05 2014 (r262137) +++ stable/9/sys/conf/files Mon Feb 17 22:43:07 2014 (r262138) @@ -2013,6 +2013,7 @@ dev/usb/usb_util.c optional usb # dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe +dev/usb/net/if_axge.c optional axge dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth @@ -2022,8 +2023,8 @@ dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie dev/usb/net/ruephy.c optional rue -dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ - rue | udav | ipheth +dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ + mos | rue | udav | ipheth dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Copied: stable/9/sys/dev/usb/net/if_axge.c (from r258331, head/sys/dev/usb/net/if_axge.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/usb/net/if_axge.c Mon Feb 17 22:43:07 2014 (r262138, copy of r258331, head/sys/dev/usb/net/if_axge.c) @@ -0,0 +1,1023 @@ +/*- + * Copyright (c) 2013 Kevin Lo + * 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$"); + +/* + * ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR axge_debug +#include +#include + +#include +#include + +/* + * Various supported device vendors/products. + */ + +static const STRUCT_USB_HOST_ID axge_devs[] = { +#define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } + AXGE_DEV(ASIX, AX88178A), + AXGE_DEV(ASIX, AX88179), + /* AXGE_DEV(SITECOMEU, LN032), */ +#undef AXGE_DEV +}; + +static const struct { + unsigned char ctrl, timer_l, timer_h, size, ifg; +} AX88179_BULKIN_SIZE[] = { + {7, 0x4f, 0, 0x12, 0xff}, + {7, 0x20, 3, 0x16, 0xff}, + {7, 0xae, 7, 0x18, 0xff}, + {7, 0xcc, 0x4c, 0x18, 8}, +}; + +/* prototypes */ + +static device_probe_t axge_probe; +static device_attach_t axge_attach; +static device_detach_t axge_detach; + +static usb_callback_t axge_bulk_read_callback; +static usb_callback_t axge_bulk_write_callback; + +static miibus_readreg_t axge_miibus_readreg; +static miibus_writereg_t axge_miibus_writereg; +static miibus_statchg_t axge_miibus_statchg; + +static uether_fn_t axge_attach_post; +static uether_fn_t axge_init; +static uether_fn_t axge_stop; +static uether_fn_t axge_start; +static uether_fn_t axge_tick; +static uether_fn_t axge_setmulti; +static uether_fn_t axge_setpromisc; + +static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t); +static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint8_t); +static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint16_t); +static void axge_chip_init(struct axge_softc *); +static void axge_reset(struct axge_softc *); + +static int axge_attach_post_sub(struct usb_ether *); +static int axge_ifmedia_upd(struct ifnet *); +static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int axge_ioctl(struct ifnet *, u_long, caddr_t); +static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); +static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, + unsigned int, unsigned int, struct axge_csum_hdr *); +static void axge_csum_cfg(struct usb_ether *); + +#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +#ifdef USB_DEBUG +static int axge_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW, 0, "USB axge"); +SYSCTL_INT(_hw_usb_axge, OID_AUTO, debug, CTLFLAG_RW, &axge_debug, 0, + "Debug level"); +#endif + +static const struct usb_config axge_config[AXGE_N_TRANSFER] = { + [AXGE_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .frames = 16, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = axge_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + [AXGE_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 20480, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = axge_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, +}; + +static device_method_t axge_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, axge_probe), + DEVMETHOD(device_attach, axge_attach), + DEVMETHOD(device_detach, axge_detach), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, axge_miibus_readreg), + DEVMETHOD(miibus_writereg, axge_miibus_writereg), + DEVMETHOD(miibus_statchg, axge_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t axge_driver = { + .name = "axge", + .methods = axge_methods, + .size = sizeof(struct axge_softc), +}; + +static devclass_t axge_devclass; + +DRIVER_MODULE(axge, uhub, axge_driver, axge_devclass, NULL, NULL); +DRIVER_MODULE(miibus, axge, miibus_driver, miibus_devclass, NULL, NULL); +MODULE_DEPEND(axge, uether, 1, 1, 1); +MODULE_DEPEND(axge, usb, 1, 1, 1); +MODULE_DEPEND(axge, ether, 1, 1, 1); +MODULE_DEPEND(axge, miibus, 1, 1, 1); +MODULE_VERSION(axge, 1); + +static const struct usb_ether_methods axge_ue_methods = { + .ue_attach_post = axge_attach_post, + .ue_attach_post_sub = axge_attach_post_sub, + .ue_start = axge_start, + .ue_init = axge_init, + .ue_stop = axge_stop, + .ue_tick = axge_tick, + .ue_setmulti = axge_setmulti, + .ue_setpromisc = axge_setpromisc, + .ue_mii_upd = axge_ifmedia_upd, + .ue_mii_sts = axge_ifmedia_sts, +}; + +static int +axge_read_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + return (uether_do_request(&sc->sc_ue, &req, buf, 1000)); +} + +static void +axge_write_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + if (uether_do_request(&sc->sc_ue, &req, buf, 1000)) { + /* Error ignored. */ + } +} + +static uint16_t +axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg) +{ + uint8_t val[2]; + + axge_read_mem(sc, cmd, index, reg, &val, 2); + return (UGETW(val)); +} + +static void +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint8_t val) +{ + axge_write_mem(sc, cmd, index, reg, &val, 1); +} + +static void +axge_write_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint16_t val) +{ + uint8_t temp[2]; + + USETW(temp, val); + axge_write_mem(sc, cmd, index, reg, &temp, 2); +} + +static int +axge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct axge_softc *sc; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + val = axge_read_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy); + + if (!locked) + AXGE_UNLOCK(sc); + + return (val); +} + +static int +axge_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct axge_softc *sc; + int locked; + + sc = device_get_softc(dev); + if (sc->sc_phyno != phy) + return (0); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + axge_write_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy, val); + + if (!locked) + AXGE_UNLOCK(sc); + + return (0); +} + +static void +axge_miibus_statchg(device_t dev) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + mii = GET_MII(sc); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + ifp = uether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + sc->sc_flags &= ~AXGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: + sc->sc_flags |= AXGE_FLAG_LINK; + break; + default: + break; + } + } + + /* Lost link, do nothing. */ + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) + goto done; + + val = 0; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + val |= AXGE_MEDIUM_FULL_DUPLEX; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + } + val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + val |= AXGE_MEDIUM_GIGAMODE; + case IFM_100_TX: + val |= AXGE_MEDIUM_PS; + case IFM_10_T: + /* Doesn't need to be handled. */ + break; + } + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); + +done: + if (!locked) + AXGE_UNLOCK(sc); +} + +static void +axge_chip_init(struct axge_softc *sc) +{ + /* Power up ethernet PHY. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, + AXGE_PHYPWR_RSTCTL_IPRL); + uether_pause(&sc->sc_ue, hz / 4); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); + uether_pause(&sc->sc_ue, hz / 10); +} + +static void +axge_reset(struct axge_softc *sc) +{ + struct usb_config_descriptor *cd; + usb_error_t err; + + cd = usbd_get_config_descriptor(sc->sc_ue.ue_udev); + + err = usbd_req_set_config(sc->sc_ue.ue_udev, &sc->sc_mtx, + cd->bConfigurationValue); + if (err) + DPRINTF("reset failed (ignored)\n"); + + /* Wait a little while for the chip to get its brains in order. */ + uether_pause(&sc->sc_ue, hz / 100); + + /* Reinitialize controller to achieve full reset. */ + axge_chip_init(sc); +} + +static void +axge_attach_post(struct usb_ether *ue) +{ + struct axge_softc *sc; + uint8_t tmp[5]; + + sc = uether_getsc(ue); + sc->sc_phyno = 3; + + /* Initialize controller and get station address. */ + axge_chip_init(sc); + + memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + ue->ue_eaddr, ETHER_ADDR_LEN); +} + +static int +axge_attach_post_sub(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + int error; + + sc = uether_getsc(ue); + ifp = ue->ue_ifp; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = uether_start; + ifp->if_ioctl = axge_ioctl; + ifp->if_init = uether_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = AXGE_CSUM_FEATURES; + ifp->if_capenable = ifp->if_capabilities; + + mtx_lock(&Giant); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + mtx_unlock(&Giant); + + return (error); +} + +/* + * Set media options. + */ +static int +axge_ifmedia_upd(struct ifnet *ifp) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + + return (error); +} + +/* + * Report current media status. + */ +static void +axge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + AXGE_UNLOCK(sc); +} + +/* + * Probe for a AX88179 chip. + */ +static int +axge_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != AXGE_CONFIG_IDX) + return (ENXIO); + if (uaa->info.bIfaceIndex != AXGE_IFACE_IDX) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(axge_devs, sizeof(axge_devs), uaa)); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +axge_attach(device_t dev) +{ + struct usb_attach_arg *uaa; + struct axge_softc *sc; + struct usb_ether *ue; + uint8_t iface_index; + int error; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + ue = &sc->sc_ue; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + iface_index = AXGE_IFACE_IDX; + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(dev, "allocating USB transfers failed\n"); + goto detach; + } + + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &axge_ue_methods; + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); /* success */ + +detach: + axge_detach(dev); + return (ENXIO); /* failure */ +} + +static int +axge_detach(device_t dev) +{ + struct axge_softc *sc; + struct usb_ether *ue; + + sc = device_get_softc(dev); + ue = &sc->sc_ue; + usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +axge_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct usb_ether *ue; + struct usb_page_cache *pc; + int actlen; + + sc = usbd_xfer_softc(xfer); + ue = &sc->sc_ue; + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(xfer, 0); + axge_rx_frame(ue, pc, actlen); + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(ue); + return; + + default: + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct usb_page_cache *pc; + struct mbuf *m; + uint32_t txhdr; + uint32_t txhdr2; + int nframes; + int frm_len; + + sc = usbd_xfer_softc(xfer); + ifp = uether_getifp(&sc->sc_ue); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { + /* + * Don't send anything if there is no link or + * controller is busy. + */ + return; + } + + for (nframes = 0; nframes < 16 && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, + nframes); + frm_len = 0; + pc = usbd_xfer_get_frame(xfer, nframes); + + txhdr = m->m_pkthdr.len; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); + frm_len += sizeof(txhdr); + + txhdr2 = 0; + if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % + usbd_xfer_max_framelen(xfer) == 0) { + txhdr2 |= 0x80008000; + } + txhdr2 = htole32(txhdr2); + usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); + frm_len += sizeof(txhdr2); + + /* Next copy in the actual packet. */ + usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); + frm_len += m->m_pkthdr.len; + + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* + * if there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + m_freem(m); + + /* Set frame length. */ + usbd_xfer_set_frame_len(xfer, nframes, frm_len); + } + if (nframes != 0) { + usbd_xfer_set_frames(xfer, nframes); + usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + return; + /* NOTREACHED */ + default: + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_tick(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = uether_getsc(ue); + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + mii_tick(mii); + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { + axge_miibus_statchg(ue->ue_dev); + if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) + axge_start(ue); + } +} + +static void +axge_setmulti(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h; + uint16_t rxmode; + uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + h = 0; + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + rxmode |= AXGE_RX_CTL_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + return; + } + rxmode &= ~AXGE_RX_CTL_AMALL; + + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashtbl[h / 8] |= 1 << (h % 8); + } + if_maddr_runlock(ifp); + + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, + (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); +} + +static void +axge_setpromisc(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + else + rxmode &= ~AXGE_RX_CTL_PRO; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_setmulti(ue); +} + +static void +axge_start(struct usb_ether *ue) +{ + struct axge_softc *sc; + + sc = uether_getsc(ue); + /* + * Start the USB transfers, if not already started. + */ + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_RD]); + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_WR]); +} + +static void +axge_init(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* + * Cancel pending I/O and free all RX/TX buffers. + */ + axge_stop(ue); + + axge_reset(sc); + + /* Set MAC address. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + IF_LLADDR(ifp), ETHER_ADDR_LEN); + + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH, + 0x52); + + /* Configure TX/RX checksum offloading. */ + axge_csum_cfg(ue); + + /* Configure RX settings. */ + rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START); + + /* If we want promiscuous mode, set the allframes bit. */ + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= AXGE_RX_CTL_AB; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + + /* Load the multicast filter. */ + axge_setmulti(ue); + + usbd_xfer_set_stall(sc->sc_xfer[AXGE_BULK_DT_WR]); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + /* Switch to selected media. */ + axge_ifmedia_upd(ifp); +} + +static void +axge_stop(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->sc_flags &= ~AXGE_FLAG_LINK; + + /* + * Stop all the transfers, if not already stopped: + */ + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_RD]); +} + +static int +axge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct usb_ether *ue; + struct axge_softc *sc; + struct ifreq *ifr; + int error, mask, reinit; + + ue = ifp->if_softc; + sc = uether_getsc(ue); + ifr = (struct ifreq *)data; + error = 0; + reinit = 0; + if (cmd == SIOCSIFCAP) { + AXGE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= AXGE_CSUM_FEATURES; + else + ifp->if_hwassist &= ~AXGE_CSUM_FEATURES; + reinit++; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; + reinit++; + } + if (reinit > 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + else + reinit = 0; + AXGE_UNLOCK(sc); + if (reinit > 0) + uether_init(ue); + } else + error = uether_ioctl(ifp, cmd, data); + + return (error); +} + +static int +axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) +{ + struct axge_softc *sc; + struct axge_csum_hdr csum_hdr; + int error, len, pos; + int pkt_cnt; + uint32_t rxhdr; + uint16_t hdr_off; + uint16_t pktlen; + + sc = uether_getsc(ue); + pos = 0; + len = 0; + error = 0; + + usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); + actlen -= sizeof(rxhdr); + rxhdr = le32toh(rxhdr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 22:57:52 2014 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 ESMTPS id 5274D76F; Mon, 17 Feb 2014 22:57:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA821B18; Mon, 17 Feb 2014 22:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMvqPv093840; Mon, 17 Feb 2014 22:57:52 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMvq4C093839; Mon, 17 Feb 2014 22:57:52 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402172257.s1HMvq4C093839@svn.freebsd.org> From: Neel Natu Date: Mon, 17 Feb 2014 22:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262139 - head/sys/amd64/vmm/io 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 22:57:52 -0000 Author: neel Date: Mon Feb 17 22:57:51 2014 New Revision: 262139 URL: http://svnweb.freebsd.org/changeset/base/262139 Log: Use spinlocks to lock accesses to the vioapic. This is necessary because if the vlapic is configured in x2apic mode the vioapic_process_eoi() function is called inside the critical section established by vm_run(). Modified: head/sys/amd64/vmm/io/vioapic.c Modified: head/sys/amd64/vmm/io/vioapic.c ============================================================================== --- head/sys/amd64/vmm/io/vioapic.c Mon Feb 17 22:43:07 2014 (r262138) +++ head/sys/amd64/vmm/io/vioapic.c Mon Feb 17 22:57:51 2014 (r262139) @@ -64,8 +64,8 @@ struct vioapic { } rtbl[REDIR_ENTRIES]; }; -#define VIOAPIC_LOCK(vioapic) mtx_lock(&((vioapic)->mtx)) -#define VIOAPIC_UNLOCK(vioapic) mtx_unlock(&((vioapic)->mtx)) +#define VIOAPIC_LOCK(vioapic) mtx_lock_spin(&((vioapic)->mtx)) +#define VIOAPIC_UNLOCK(vioapic) mtx_unlock_spin(&((vioapic)->mtx)) #define VIOAPIC_LOCKED(vioapic) mtx_owned(&((vioapic)->mtx)) static MALLOC_DEFINE(M_VIOAPIC, "vioapic", "bhyve virtual ioapic"); @@ -476,7 +476,7 @@ vioapic_init(struct vm *vm) vioapic = malloc(sizeof(struct vioapic), M_VIOAPIC, M_WAITOK | M_ZERO); vioapic->vm = vm; - mtx_init(&vioapic->mtx, "vioapic lock", NULL, MTX_DEF); + mtx_init(&vioapic->mtx, "vioapic lock", NULL, MTX_SPIN); /* Initialize all redirection entries to mask all interrupts */ for (i = 0; i < REDIR_ENTRIES; i++) From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 23:07:17 2014 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 ESMTPS id 9A1F7A2A; Mon, 17 Feb 2014 23:07:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 865E31BDB; Mon, 17 Feb 2014 23:07:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HN7H00098052; Mon, 17 Feb 2014 23:07:17 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HN7HuN098049; Mon, 17 Feb 2014 23:07:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402172307.s1HN7HuN098049@svn.freebsd.org> From: Neel Natu Date: Mon, 17 Feb 2014 23:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262140 - head/sys/amd64/vmm/io 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.17 Precedence: list List-Id: "SVN commit messages 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, 17 Feb 2014 23:07:17 -0000 Author: neel Date: Mon Feb 17 23:07:16 2014 New Revision: 262140 URL: http://svnweb.freebsd.org/changeset/base/262140 Log: Handle writes to the SELF_IPI MSR by the guest when the vlapic is configured in x2apic mode. Reads to this MSR are currently ignored but should cause a general proctection exception to be injected into the vcpu. All accesses to the corresponding offset in xAPIC mode are ignored. Also, do not panic the host if there is mismatch between the trigger mode programmed in the TMR and the actual interrupt being delivered. Instead the anomaly is logged to aid debugging and to prevent a misbehaving guest from panicking the host. Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic_priv.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Mon Feb 17 22:57:51 2014 (r262139) +++ head/sys/amd64/vmm/io/vlapic.c Mon Feb 17 23:07:16 2014 (r262140) @@ -289,9 +289,11 @@ vlapic_set_intr_ready(struct vlapic *vla * the vlapic TMR registers. */ tmrptr = &lapic->tmr0; - KASSERT((tmrptr[idx] & mask) == (level ? mask : 0), - ("vlapic TMR[%d] is 0x%08x but interrupt is %s-triggered", - idx / 4, tmrptr[idx], level ? "level" : "edge")); + if ((tmrptr[idx] & mask) != (level ? mask : 0)) { + VLAPIC_CTR3(vlapic, "vlapic TMR[%d] is 0x%08x but " + "interrupt is %s-triggered", idx / 4, tmrptr[idx], + level ? "level" : "edge"); + } VLAPIC_CTR_IRR(vlapic, "vlapic_set_intr_ready"); return (1); @@ -997,6 +999,18 @@ vlapic_icrlo_write_handler(struct vlapic return (1); } +static void +vlapic_self_ipi_handler(struct vlapic *vlapic, uint64_t val) +{ + int vec; + + vec = val & 0xff; + lapic_intr_edge(vlapic->vm, vlapic->vcpuid, vec); + vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, IPIS_SENT, + vlapic->vcpuid, 1); + VLAPIC_CTR1(vlapic, "vlapic self-ipi %d", vec); +} + int vlapic_pending_intr(struct vlapic *vlapic, int *vecptr) { @@ -1190,6 +1204,12 @@ vlapic_read(struct vlapic *vlapic, uint6 case APIC_OFFSET_TIMER_DCR: *data = lapic->dcr_timer; break; + case APIC_OFFSET_SELF_IPI: + /* + * XXX generate a GP fault if vlapic is in x2apic mode + */ + *data = 0; + break; case APIC_OFFSET_RRR: default: *data = 0; @@ -1270,6 +1290,12 @@ vlapic_write(struct vlapic *vlapic, uint case APIC_OFFSET_ESR: vlapic_esr_write_handler(vlapic); break; + + case APIC_OFFSET_SELF_IPI: + if (x2apic(vlapic)) + vlapic_self_ipi_handler(vlapic, data); + break; + case APIC_OFFSET_VER: case APIC_OFFSET_APR: case APIC_OFFSET_PPR: Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Mon Feb 17 22:57:51 2014 (r262139) +++ head/sys/amd64/vmm/io/vlapic_priv.h Mon Feb 17 23:07:16 2014 (r262140) @@ -81,6 +81,7 @@ #define APIC_OFFSET_TIMER_ICR 0x380 /* Timer's Initial Count */ #define APIC_OFFSET_TIMER_CCR 0x390 /* Timer's Current Count */ #define APIC_OFFSET_TIMER_DCR 0x3E0 /* Timer's Divide Configuration */ +#define APIC_OFFSET_SELF_IPI 0x3F0 /* Self IPI register */ #define VLAPIC_CTR0(vlapic, format) \ VCPU_CTR0((vlapic)->vm, (vlapic)->vcpuid, format) @@ -91,6 +92,9 @@ #define VLAPIC_CTR2(vlapic, format, p1, p2) \ VCPU_CTR2((vlapic)->vm, (vlapic)->vcpuid, format, p1, p2) +#define VLAPIC_CTR3(vlapic, format, p1, p2, p3) \ + VCPU_CTR3((vlapic)->vm, (vlapic)->vcpuid, format, p1, p2, p3) + #define VLAPIC_CTR_IRR(vlapic, msg) \ do { \ uint32_t *irrptr = &(vlapic)->apic_page->irr0; \ From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 01:15:34 2014 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 ESMTPS id A3C8BA89; Tue, 18 Feb 2014 01:15:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B7D815B8; Tue, 18 Feb 2014 01:15:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I1FY4v049336; Tue, 18 Feb 2014 01:15:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I1FWh1049330; Tue, 18 Feb 2014 01:15:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402180115.s1I1FWh1049330@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 01:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262141 - in stable/10/sys: amd64/include i386/include x86/acpica x86/include x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 01:15:34 -0000 Author: jhb Date: Tue Feb 18 01:15:32 2014 New Revision: 262141 URL: http://svnweb.freebsd.org/changeset/base/262141 Log: MFC 259140: Move constants for indices in the local APIC's local vector table from apicvar.h to apicreg.h. Modified: stable/10/sys/amd64/include/apicvar.h stable/10/sys/i386/include/apicvar.h stable/10/sys/x86/acpica/madt.c stable/10/sys/x86/include/apicreg.h stable/10/sys/x86/x86/local_apic.c stable/10/sys/x86/x86/mptable.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/apicvar.h ============================================================================== --- stable/10/sys/amd64/include/apicvar.h Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/amd64/include/apicvar.h Tue Feb 18 01:15:32 2014 (r262141) @@ -136,15 +136,6 @@ */ #define APIC_SPURIOUS_INT 255 -#define LVT_LINT0 0 -#define LVT_LINT1 1 -#define LVT_TIMER 2 -#define LVT_ERROR 3 -#define LVT_PMC 4 -#define LVT_THERMAL 5 -#define LVT_CMCI 6 -#define LVT_MAX LVT_CMCI - #ifndef LOCORE #define APIC_IPI_DEST_SELF -1 Modified: stable/10/sys/i386/include/apicvar.h ============================================================================== --- stable/10/sys/i386/include/apicvar.h Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/i386/include/apicvar.h Tue Feb 18 01:15:32 2014 (r262141) @@ -135,15 +135,6 @@ */ #define APIC_SPURIOUS_INT 255 -#define LVT_LINT0 0 -#define LVT_LINT1 1 -#define LVT_TIMER 2 -#define LVT_ERROR 3 -#define LVT_PMC 4 -#define LVT_THERMAL 5 -#define LVT_CMCI 6 -#define LVT_MAX LVT_CMCI - #ifndef LOCORE #define APIC_IPI_DEST_SELF -1 Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/acpica/madt.c Tue Feb 18 01:15:32 2014 (r262141) @@ -517,9 +517,9 @@ madt_parse_local_nmi(ACPI_MADT_LOCAL_API return; } if (nmi->Lint == 0) - pin = LVT_LINT0; + pin = APIC_LVT_LINT0; else - pin = LVT_LINT1; + pin = APIC_LVT_LINT1; lapic_set_lvt_mode(apic_id, pin, APIC_LVT_DM_NMI); if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) lapic_set_lvt_triggermode(apic_id, pin, Modified: stable/10/sys/x86/include/apicreg.h ============================================================================== --- stable/10/sys/x86/include/apicreg.h Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/include/apicreg.h Tue Feb 18 01:15:32 2014 (r262141) @@ -357,6 +357,16 @@ typedef struct IOAPIC ioapic_t; #define APIC_TDCR_128 0x0a #define APIC_TDCR_1 0x0b +/* LVT table indices */ +#define APIC_LVT_LINT0 0 +#define APIC_LVT_LINT1 1 +#define APIC_LVT_TIMER 2 +#define APIC_LVT_ERROR 3 +#define APIC_LVT_PMC 4 +#define APIC_LVT_THERMAL 5 +#define APIC_LVT_CMCI 6 +#define APIC_LVT_MAX APIC_LVT_CMCI + /****************************************************************************** * I/O APIC defines */ Modified: stable/10/sys/x86/x86/local_apic.c ============================================================================== --- stable/10/sys/x86/x86/local_apic.c Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/x86/local_apic.c Tue Feb 18 01:15:32 2014 (r262141) @@ -112,7 +112,7 @@ struct lvt { }; struct lapic { - struct lvt la_lvts[LVT_MAX + 1]; + struct lvt la_lvts[APIC_LVT_MAX + 1]; u_int la_id:8; u_int la_cluster:4; u_int la_cluster_id:2; @@ -126,7 +126,7 @@ struct lapic { } static lapics[MAX_APIC_ID + 1]; /* Global defaults for local APIC LVT entries. */ -static struct lvt lvts[LVT_MAX + 1] = { +static struct lvt lvts[APIC_LVT_MAX + 1] = { { 1, 1, 1, 1, APIC_LVT_DM_EXTINT, 0 }, /* LINT0: masked ExtINT */ { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* LINT1: NMI */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT }, /* Timer */ @@ -180,7 +180,7 @@ lvt_mode(struct lapic *la, u_int pin, ui { struct lvt *lvt; - KASSERT(pin <= LVT_MAX, ("%s: pin %u out of range", __func__, pin)); + KASSERT(pin <= APIC_LVT_MAX, ("%s: pin %u out of range", __func__, pin)); if (la->la_lvts[pin].lvt_active) lvt = &la->la_lvts[pin]; else @@ -301,7 +301,7 @@ lapic_create(u_int apic_id, int boot_cpu */ lapics[apic_id].la_present = 1; lapics[apic_id].la_id = apic_id; - for (i = 0; i <= LVT_MAX; i++) { + for (i = 0; i <= APIC_LVT_MAX; i++) { lapics[apic_id].la_lvts[i] = lvts[i]; lapics[apic_id].la_lvts[i].lvt_active = 0; } @@ -340,10 +340,10 @@ lapic_dump(const char* str) lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); - if (maxlvt >= LVT_PMC) + if (maxlvt >= APIC_LVT_PMC) printf(" pmc: 0x%08x", lapic->lvt_pcint); printf("\n"); - if (maxlvt >= LVT_CMCI) + if (maxlvt >= APIC_LVT_CMCI) printf(" cmci: 0x%08x\n", lapic->lvt_cmci); } @@ -367,16 +367,16 @@ lapic_setup(int boot) lapic_enable(); /* Program LINT[01] LVT entries. */ - lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); - lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + lapic->lvt_lint0 = lvt_mode(la, APIC_LVT_LINT0, lapic->lvt_lint0); + lapic->lvt_lint1 = lvt_mode(la, APIC_LVT_LINT1, lapic->lvt_lint1); /* Program the PMC LVT entry if present. */ - if (maxlvt >= LVT_PMC) - lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); + if (maxlvt >= APIC_LVT_PMC) + lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); /* Program timer LVT and setup handler. */ la->lvt_timer_cache = lapic->lvt_timer = - lvt_mode(la, LVT_TIMER, lapic->lvt_timer); + lvt_mode(la, APIC_LVT_TIMER, lapic->lvt_timer); if (boot) { snprintf(buf, sizeof(buf), "cpu%d:timer", PCPU_GET(cpuid)); intrcnt_add(buf, &la->la_timer_count); @@ -394,14 +394,14 @@ lapic_setup(int boot) } /* Program error LVT and clear any existing errors. */ - lapic->lvt_error = lvt_mode(la, LVT_ERROR, lapic->lvt_error); + lapic->lvt_error = lvt_mode(la, APIC_LVT_ERROR, lapic->lvt_error); lapic->esr = 0; /* XXX: Thermal LVT */ /* Program the CMCI LVT entry if present. */ - if (maxlvt >= LVT_CMCI) - lapic->lvt_cmci = lvt_mode(la, LVT_CMCI, lapic->lvt_cmci); + if (maxlvt >= APIC_LVT_CMCI) + lapic->lvt_cmci = lvt_mode(la, APIC_LVT_CMCI, lapic->lvt_cmci); intr_restore(saveintr); } @@ -425,7 +425,7 @@ lapic_update_pmc(void *dummy) struct lapic *la; la = &lapics[lapic_id()]; - lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); + lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); } #endif @@ -441,10 +441,10 @@ lapic_enable_pmc(void) /* Fail if the PMC LVT is not present. */ maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; - if (maxlvt < LVT_PMC) + if (maxlvt < APIC_LVT_PMC) return (0); - lvts[LVT_PMC].lvt_masked = 0; + lvts[APIC_LVT_PMC].lvt_masked = 0; #ifdef SMP /* @@ -475,10 +475,10 @@ lapic_disable_pmc(void) /* Fail if the PMC LVT is not present. */ maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; - if (maxlvt < LVT_PMC) + if (maxlvt < APIC_LVT_PMC) return; - lvts[LVT_PMC].lvt_masked = 1; + lvts[APIC_LVT_PMC].lvt_masked = 1; #ifdef SMP /* The APs should always be started when hwpmc is unloaded. */ @@ -618,7 +618,7 @@ int lapic_set_lvt_mask(u_int apic_id, u_int pin, u_char masked) { - if (pin > LVT_MAX) + if (pin > APIC_LVT_MAX) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_masked = masked; @@ -642,7 +642,7 @@ lapic_set_lvt_mode(u_int apic_id, u_int { struct lvt *lvt; - if (pin > LVT_MAX) + if (pin > APIC_LVT_MAX) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvt = &lvts[pin]; @@ -697,7 +697,7 @@ int lapic_set_lvt_polarity(u_int apic_id, u_int pin, enum intr_polarity pol) { - if (pin > LVT_MAX || pol == INTR_POLARITY_CONFORM) + if (pin > APIC_LVT_MAX || pol == INTR_POLARITY_CONFORM) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_activehi = (pol == INTR_POLARITY_HIGH); @@ -722,7 +722,7 @@ int lapic_set_lvt_triggermode(u_int apic_id, u_int pin, enum intr_trigger trigger) { - if (pin > LVT_MAX || trigger == INTR_TRIGGER_CONFORM) + if (pin > APIC_LVT_MAX || trigger == INTR_TRIGGER_CONFORM) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_edgetrigger = (trigger == INTR_TRIGGER_EDGE); @@ -895,8 +895,8 @@ lapic_enable_cmc(void) apic_id = PCPU_GET(apic_id); KASSERT(lapics[apic_id].la_present, ("%s: missing APIC %u", __func__, apic_id)); - lapics[apic_id].la_lvts[LVT_CMCI].lvt_masked = 0; - lapics[apic_id].la_lvts[LVT_CMCI].lvt_active = 1; + lapics[apic_id].la_lvts[APIC_LVT_CMCI].lvt_masked = 0; + lapics[apic_id].la_lvts[APIC_LVT_CMCI].lvt_active = 1; if (bootverbose) printf("lapic%u: CMCI unmasked\n", apic_id); } Modified: stable/10/sys/x86/x86/mptable.c ============================================================================== --- stable/10/sys/x86/x86/mptable.c Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/x86/mptable.c Tue Feb 18 01:15:32 2014 (r262141) @@ -786,9 +786,9 @@ mptable_parse_local_int(int_entry_ptr in else apic_id = intr->dst_apic_id; if (intr->dst_apic_int == 0) - pin = LVT_LINT0; + pin = APIC_LVT_LINT0; else - pin = LVT_LINT1; + pin = APIC_LVT_LINT1; switch (intr->int_type) { case INTENTRY_TYPE_INT: #if 1 @@ -902,8 +902,9 @@ mptable_parse_ints(void) /* Is this a pre-defined config? */ if (mpfps->config_type != 0) { /* Configure LINT pins. */ - lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT0, APIC_LVT_DM_EXTINT); - lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT1, APIC_LVT_DM_NMI); + lapic_set_lvt_mode(APIC_ID_ALL, APIC_LVT_LINT0, + APIC_LVT_DM_EXTINT); + lapic_set_lvt_mode(APIC_ID_ALL, APIC_LVT_LINT1, APIC_LVT_DM_NMI); /* Configure I/O APIC pins. */ mptable_parse_default_config_ints(); From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 01:20:27 2014 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 ESMTPS id 20D16F87; Tue, 18 Feb 2014 01:20:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CDC0165A; Tue, 18 Feb 2014 01:20:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I1KQjD051929; Tue, 18 Feb 2014 01:20:26 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I1KQWI051928; Tue, 18 Feb 2014 01:20:26 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201402180120.s1I1KQWI051928@svn.freebsd.org> From: Craig Rodrigues Date: Tue, 18 Feb 2014 01:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262142 - head/sys/dev/usb/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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 01:20:27 -0000 Author: rodrigc Date: Tue Feb 18 01:20:26 2014 New Revision: 262142 URL: http://svnweb.freebsd.org/changeset/base/262142 Log: In ue_attach_post_task(), initialize curvnet to vnet0 before calling if_attach(). Before this patch, curvnet was NULL. When the VIMAGE kernel option is enabled, this eliminates kernel panics when USB ethernet devices are plugged in. PR: 183835 Submitted by: Hiroo Oono Modified: head/sys/dev/usb/net/usb_ethernet.c Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Tue Feb 18 01:15:32 2014 (r262141) +++ head/sys/dev/usb/net/usb_ethernet.c Tue Feb 18 01:20:26 2014 (r262142) @@ -208,6 +208,7 @@ ue_attach_post_task(struct usb_proc_msg sysctl_ctx_init(&ue->ue_sysctl_ctx); error = 0; + CURVNET_SET_QUIET(vnet0); ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(ue->ue_dev, "could not allocate ifnet\n"); @@ -254,6 +255,8 @@ ue_attach_post_task(struct usb_proc_msg if (ifp->if_capabilities & IFCAP_VLAN_MTU) ifp->if_hdrlen = sizeof(struct ether_vlan_header); + CURVNET_RESTORE(); + snprintf(num, sizeof(num), "%u", ue->ue_unit); ue->ue_sysctl_oid = SYSCTL_ADD_NODE(&ue->ue_sysctl_ctx, &SYSCTL_NODE_CHILDREN(_net, ue), @@ -267,6 +270,7 @@ ue_attach_post_task(struct usb_proc_msg return; fail: + CURVNET_RESTORE(); free_unr(ueunit, ue->ue_unit); if (ue->ue_ifp != NULL) { if_free(ue->ue_ifp); From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 03:00:21 2014 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 ESMTPS id 4F376B64; Tue, 18 Feb 2014 03:00:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC811CA4; Tue, 18 Feb 2014 03:00:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I30Lgj089011; Tue, 18 Feb 2014 03:00:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I30Kwv089009; Tue, 18 Feb 2014 03:00:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402180300.s1I30Kwv089009@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 03:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262143 - head/usr.sbin/bhyve 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 03:00:21 -0000 Author: jhb Date: Tue Feb 18 03:00:20 2014 New Revision: 262143 URL: http://svnweb.freebsd.org/changeset/base/262143 Log: Tweak the handling of PCI capabilities in emulated devices to remove the non-standard zero capability list terminator. Instead, track the start and end of the most recently added capability and use that to adjust the previous capability's next pointer when a capability is added and to determine the range of config registers belonging to PCI capability registers. Reviewed by: neel Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Tue Feb 18 01:20:26 2014 (r262142) +++ head/usr.sbin/bhyve/pci_emul.c Tue Feb 18 03:00:20 2014 (r262143) @@ -630,48 +630,39 @@ pci_emul_alloc_pbar(struct pci_devinst * static int pci_emul_add_capability(struct pci_devinst *pi, u_char *capdata, int caplen) { - int i, capoff, capid, reallen; + int i, capoff, reallen; uint16_t sts; - static u_char endofcap[4] = { - PCIY_RESERVED, 0, 0, 0 - }; - - assert(caplen > 0 && capdata[0] != PCIY_RESERVED); + assert(caplen > 0); reallen = roundup2(caplen, 4); /* dword aligned */ sts = pci_get_cfgdata16(pi, PCIR_STATUS); - if ((sts & PCIM_STATUS_CAPPRESENT) == 0) { + if ((sts & PCIM_STATUS_CAPPRESENT) == 0) capoff = CAP_START_OFFSET; - pci_set_cfgdata8(pi, PCIR_CAP_PTR, capoff); - pci_set_cfgdata16(pi, PCIR_STATUS, sts|PCIM_STATUS_CAPPRESENT); - } else { - capoff = pci_get_cfgdata8(pi, PCIR_CAP_PTR); - while (1) { - assert((capoff & 0x3) == 0); - capid = pci_get_cfgdata8(pi, capoff); - if (capid == PCIY_RESERVED) - break; - capoff = pci_get_cfgdata8(pi, capoff + 1); - } - } + else + capoff = pi->pi_capend + 1; /* Check if we have enough space */ - if (capoff + reallen + sizeof(endofcap) > PCI_REGMAX + 1) + if (capoff + reallen > PCI_REGMAX + 1) return (-1); + /* Set the previous capability pointer */ + if ((sts & PCIM_STATUS_CAPPRESENT) == 0) { + pci_set_cfgdata8(pi, PCIR_CAP_PTR, capoff); + pci_set_cfgdata16(pi, PCIR_STATUS, sts|PCIM_STATUS_CAPPRESENT); + } else + pci_set_cfgdata8(pi, pi->pi_prevcap + 1, capoff); + /* Copy the capability */ for (i = 0; i < caplen; i++) pci_set_cfgdata8(pi, capoff + i, capdata[i]); /* Set the next capability pointer */ - pci_set_cfgdata8(pi, capoff + 1, capoff + reallen); - - /* Copy of the reserved capability which serves as the end marker */ - for (i = 0; i < sizeof(endofcap); i++) - pci_set_cfgdata8(pi, capoff + reallen + i, endofcap[i]); + pci_set_cfgdata8(pi, capoff + 1, 0); + pi->pi_prevcap = capoff; + pi->pi_capend = capoff + reallen - 1; return (0); } @@ -756,7 +747,7 @@ pci_emul_add_msicap(struct pci_devinst * static void pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum, - uint32_t msix_tab_size, int nextptr) + uint32_t msix_tab_size) { CTASSERT(sizeof(struct msixcap) == 12); @@ -764,7 +755,6 @@ pci_populate_msixcap(struct msixcap *msi bzero(msixcap, sizeof(struct msixcap)); msixcap->capid = PCIY_MSIX; - msixcap->nextptr = nextptr; /* * Message Control Register, all fields set to @@ -826,7 +816,7 @@ pci_emul_add_msixcap(struct pci_devinst pci_msix_table_init(pi, msgnum); - pci_populate_msixcap(&msixcap, msgnum, barnum, tab_size, 0); + pci_populate_msixcap(&msixcap, msgnum, barnum, tab_size); /* allocate memory for MSI-X Table and PBA */ pci_emul_alloc_bar(pi, barnum, PCIBAR_MEM32, @@ -949,11 +939,9 @@ pci_emul_capwrite(struct pci_devinst *pi /* Find the capability that we want to update */ capoff = CAP_START_OFFSET; while (1) { - capid = pci_get_cfgdata8(pi, capoff); - if (capid == PCIY_RESERVED) - break; - nextoff = pci_get_cfgdata8(pi, capoff + 1); + if (nextoff == 0) + break; if (offset >= capoff && offset < nextoff) break; @@ -976,6 +964,7 @@ pci_emul_capwrite(struct pci_devinst *pi return; } + capid = pci_get_cfgdata8(pi, capoff); switch (capid) { case PCIY_MSI: msicap_cfgwrite(pi, capoff, offset, bytes, val); @@ -994,25 +983,14 @@ pci_emul_capwrite(struct pci_devinst *pi static int pci_emul_iscap(struct pci_devinst *pi, int offset) { - int found; uint16_t sts; - uint8_t capid, lastoff; - found = 0; sts = pci_get_cfgdata16(pi, PCIR_STATUS); if ((sts & PCIM_STATUS_CAPPRESENT) != 0) { - lastoff = pci_get_cfgdata8(pi, PCIR_CAP_PTR); - while (1) { - assert((lastoff & 0x3) == 0); - capid = pci_get_cfgdata8(pi, lastoff); - if (capid == PCIY_RESERVED) - break; - lastoff = pci_get_cfgdata8(pi, lastoff + 1); - } - if (offset >= CAP_START_OFFSET && offset <= lastoff) - found = 1; + if (offset >= CAP_START_OFFSET && offset <= pi->pi_capend) + return (1); } - return (found); + return (0); } static int Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Tue Feb 18 01:20:26 2014 (r262142) +++ head/usr.sbin/bhyve/pci_emul.h Tue Feb 18 03:00:20 2014 (r262143) @@ -39,7 +39,6 @@ #include #define PCI_BARMAX PCIR_MAX_BAR_0 /* BAR registers in a Type 0 header */ -#define PCIY_RESERVED 0x00 struct vmctx; struct pci_devinst; @@ -115,6 +114,8 @@ struct pci_devinst { uint8_t pi_bus, pi_slot, pi_func; char pi_name[PI_NAMESZ]; int pi_bar_getsize; + int pi_prevcap; + int pi_capend; struct { int8_t pin; From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 03:07:37 2014 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 ESMTPS id 71B14209; Tue, 18 Feb 2014 03:07:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5BFD311B4; Tue, 18 Feb 2014 03:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I37boc093282; Tue, 18 Feb 2014 03:07:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I37aUO093278; Tue, 18 Feb 2014 03:07:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402180307.s1I37aUO093278@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 03:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262144 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 03:07:37 -0000 Author: jhb Date: Tue Feb 18 03:07:36 2014 New Revision: 262144 URL: http://svnweb.freebsd.org/changeset/base/262144 Log: A first pass at adding support for injecting hardware exceptions for emulated instructions. - Add helper routines to inject interrupt information for a hardware exception from the VM exit callback routines. - Use the new routines to inject GP and UD exceptions for invalid operations when emulating the xsetbv instruction. - Don't directly manipulate the entry interrupt info when a user event is injected. Instead, store the event info in the vmx state and only apply it during a VM entry if a hardware exception or NMI is not already pending. - While here, use HANDLED/UNHANDLED instead of 1/0 in a couple of routines. Reviewed by: neel Modified: head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Tue Feb 18 03:00:20 2014 (r262143) +++ head/sys/amd64/vmm/intel/vmcs.h Tue Feb 18 03:07:36 2014 (r262144) @@ -345,6 +345,8 @@ vmcs_write(uint32_t encoding, uint64_t v #define VMCS_INTR_T_MASK 0x700 /* Interruption-info type */ #define VMCS_INTR_T_HWINTR (0 << 8) #define VMCS_INTR_T_NMI (2 << 8) +#define VMCS_INTR_T_HWEXCEPTION (3 << 8) +#define VMCS_INTR_DEL_ERRCODE (1 << 11) /* * VMCS IDT-Vectoring information fields Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Feb 18 03:00:20 2014 (r262143) +++ head/sys/amd64/vmm/intel/vmx.c Tue Feb 18 03:07:36 2014 (r262144) @@ -884,6 +884,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmx->state[i].lastcpu = -1; vmx->state[i].vpid = vpid[i]; + vmx->state[i].user_event.intr_info = 0; msr_save_area_init(vmx->guest_msrs[i], &guest_msr_count); @@ -1062,6 +1063,66 @@ vmx_clear_nmi_window_exiting(struct vmx VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING) static void +vmx_inject_user_event(struct vmx *vmx, int vcpu) +{ + struct vmxevent *user_event; + uint32_t info; + + user_event = &vmx->state[vcpu].user_event; + + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + KASSERT((info & VMCS_INTR_VALID) == 0, ("vmx_inject_user_event: invalid " + "VM-entry interruption information %#x", info)); + + vmcs_write(VMCS_ENTRY_INTR_INFO, user_event->intr_info); + if (user_event->intr_info & VMCS_INTR_DEL_ERRCODE) + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, user_event->error_code); + user_event->intr_info = 0; +} + +static void +vmx_inject_exception(struct vmx *vmx, int vcpu, struct vm_exit *vmexit, + int fault, int errvalid, int errcode) +{ + uint32_t info; + + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + KASSERT((info & VMCS_INTR_VALID) == 0, ("vmx_inject_exception: invalid " + "VM-entry interruption information %#x", info)); + + /* + * Although INTR_T_HWEXCEPTION does not advance %rip, vmx_run() + * always advances it, so we clear the instruction length to zero + * explicitly. + */ + vmexit->inst_length = 0; + info = fault | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; + if (errvalid) { + info |= VMCS_INTR_DEL_ERRCODE; + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, errcode); + } + vmcs_write(VMCS_ENTRY_INTR_INFO, info); + + VCPU_CTR2(vmx->vm, vcpu, "Injecting fault %d (errcode %d)", fault, + errcode); +} + +/* All GP# faults VMM injects use an error code of 0. */ +static void +vmx_inject_gp(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) +{ + + vmx_inject_exception(vmx, vcpu, vmexit, IDT_GP, 1, 0); +} + +static void +vmx_inject_ud(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) +{ + + vmx_inject_exception(vmx, vcpu, vmexit, IDT_UD, 0, 0); +} + +static void vmx_inject_nmi(struct vmx *vmx, int vcpu) { uint32_t gi, info; @@ -1126,6 +1187,24 @@ vmx_inject_interrupts(struct vmx *vmx, i vmx_set_nmi_window_exiting(vmx, vcpu); } + /* + * If there is a user injection event pending and there isn't + * an interrupt queued already, inject the user event. + */ + if (vmx->state[vcpu].user_event.intr_info & VMCS_INTR_VALID) { + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + if ((info & VMCS_INTR_VALID) == 0) { + vmx_inject_user_event(vmx, vcpu); + } else { + /* + * XXX: Do we need to force an exit so this can + * be injected? + */ + VCPU_CTR1(vmx->vm, vcpu, "Cannot inject user event " + "due to VM-entry intr info %#x", info); + } + } + if (virtual_interrupt_delivery) { vmx_inject_pir(vlapic); return; @@ -1228,7 +1307,7 @@ vmx_clear_nmi_blocking(struct vmx *vmx, } static int -vmx_emulate_xsetbv(struct vmx *vmx, int vcpu) +vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { struct vmxctx *vmxctx; uint64_t xcrval; @@ -1237,20 +1316,40 @@ vmx_emulate_xsetbv(struct vmx *vmx, int vmxctx = &vmx->ctx[vcpu]; limits = vmm_get_xsave_limits(); - /* We only handle xcr0 if the host has XSAVE enabled. */ - if (vmxctx->guest_rcx != 0 || !limits->xsave_enabled) - return (UNHANDLED); + /* + * Note that the processor raises a GP# fault on its own if + * xsetbv is executed for CPL != 0, so we do not have to + * emulate that fault here. + */ + + /* Only xcr0 is supported. */ + if (vmxctx->guest_rcx != 0) { + vmx_inject_gp(vmx, vcpu, vmexit); + return (HANDLED); + } + + /* We only handle xcr0 if both the host and guest have XSAVE enabled. */ + if (!limits->xsave_enabled || !(vmcs_read(VMCS_GUEST_CR4) & CR4_XSAVE)) { + vmx_inject_ud(vmx, vcpu, vmexit); + return (HANDLED); + } xcrval = vmxctx->guest_rdx << 32 | (vmxctx->guest_rax & 0xffffffff); - if ((xcrval & ~limits->xcr0_allowed) != 0) - return (UNHANDLED); + if ((xcrval & ~limits->xcr0_allowed) != 0) { + vmx_inject_gp(vmx, vcpu, vmexit); + return (HANDLED); + } - if (!(xcrval & XFEATURE_ENABLED_X87)) - return (UNHANDLED); + if (!(xcrval & XFEATURE_ENABLED_X87)) { + vmx_inject_gp(vmx, vcpu, vmexit); + return (HANDLED); + } if ((xcrval & (XFEATURE_ENABLED_AVX | XFEATURE_ENABLED_SSE)) == - XFEATURE_ENABLED_AVX) - return (UNHANDLED); + XFEATURE_ENABLED_AVX) { + vmx_inject_gp(vmx, vcpu, vmexit); + return (HANDLED); + } /* * This runs "inside" vmrun() with the guest's FPU state, so @@ -1448,7 +1547,7 @@ vmx_handle_apic_write(struct vlapic *vla if (!virtual_interrupt_delivery) return (UNHANDLED); - handled = 1; + handled = HANDLED; offset = APIC_WRITE_OFFSET(qual); switch (offset) { case APIC_OFFSET_ID: @@ -1470,7 +1569,7 @@ vmx_handle_apic_write(struct vlapic *vla retu = false; error = vlapic_icrlo_write_handler(vlapic, &retu); if (error != 0 || retu) - handled = 0; + handled = UNHANDLED; break; case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: @@ -1483,7 +1582,7 @@ vmx_handle_apic_write(struct vlapic *vla vlapic_dcr_write_handler(vlapic); break; default: - handled = 0; + handled = UNHANDLED; break; } return (handled); @@ -1583,7 +1682,7 @@ vmx_exit_process(struct vmx *vmx, int vc CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_NMI_EXITING) != 0); - handled = 0; + handled = UNHANDLED; vmxctx = &vmx->ctx[vcpu]; qual = vmexit->u.vmx.exit_qualification; @@ -1646,7 +1745,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->exitcode = VM_EXITCODE_RDMSR; vmexit->u.msr.code = ecx; } else if (!retu) { - handled = 1; + handled = HANDLED; } else { /* Return to userspace with a valid exitcode */ KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, @@ -1666,7 +1765,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.msr.code = ecx; vmexit->u.msr.wval = (uint64_t)edx << 32 | eax; } else if (!retu) { - handled = 1; + handled = HANDLED; } else { /* Return to userspace with a valid exitcode */ KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, @@ -1809,7 +1908,7 @@ vmx_exit_process(struct vmx *vmx, int vc handled = vmx_handle_apic_write(vlapic, qual); break; case EXIT_REASON_XSETBV: - handled = vmx_emulate_xsetbv(vmx, vcpu); + handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); break; default: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_UNKNOWN, 1); @@ -2239,10 +2338,8 @@ static int vmx_inject(void *arg, int vcpu, int type, int vector, uint32_t code, int code_valid) { - int error; - uint64_t info; struct vmx *vmx = arg; - struct vmcs *vmcs = &vmx->vmcs[vcpu]; + struct vmxevent *user_event = &vmx->state[vcpu].user_event; static uint32_t type_map[VM_EVENT_MAX] = { 0x1, /* VM_EVENT_NONE */ @@ -2258,25 +2355,15 @@ vmx_inject(void *arg, int vcpu, int type * If there is already an exception pending to be delivered to the * vcpu then just return. */ - error = vmcs_getreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), &info); - if (error) - return (error); - - if (info & VMCS_INTR_VALID) + if (user_event->intr_info & VMCS_INTR_VALID) return (EAGAIN); - info = vector | (type_map[type] << 8) | (code_valid ? 1 << 11 : 0); - info |= VMCS_INTR_VALID; - error = vmcs_setreg(vmcs, 0, VMCS_IDENT(VMCS_ENTRY_INTR_INFO), info); - if (error != 0) - return (error); - + user_event->intr_info = vector | (type_map[type] << 8) | VMCS_INTR_VALID; if (code_valid) { - error = vmcs_setreg(vmcs, 0, - VMCS_IDENT(VMCS_ENTRY_EXCEPTION_ERROR), - code); + user_event->intr_info |= VMCS_INTR_DEL_ERRCODE; + user_event->error_code = code; } - return (error); + return (0); } static int Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Tue Feb 18 03:00:20 2014 (r262143) +++ head/sys/amd64/vmm/intel/vmx.h Tue Feb 18 03:07:36 2014 (r262144) @@ -80,9 +80,15 @@ struct vmxcap { uint32_t proc_ctls2; }; +struct vmxevent { + uint32_t intr_info; + uint32_t error_code; +}; + struct vmxstate { int lastcpu; /* host cpu that this 'vcpu' last ran on */ uint16_t vpid; + struct vmxevent user_event; }; struct apic_page { From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 03:33:52 2014 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 ESMTPS id 639E78E2; Tue, 18 Feb 2014 03:33:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7BD149D; Tue, 18 Feb 2014 03:33:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3XqqU004599; Tue, 18 Feb 2014 03:33:52 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3Xq5S004598; Tue, 18 Feb 2014 03:33:52 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180333.s1I3Xq5S004598@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262145 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 03:33:52 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:33:51 2014 New Revision: 262145 URL: http://svnweb.freebsd.org/changeset/base/262145 Log: MFC r261800: Remove obsolete vnode(9) man page references. Modified: stable/10/share/man/man9/vnode.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/vnode.9 ============================================================================== --- stable/10/share/man/man9/vnode.9 Tue Feb 18 03:07:36 2014 (r262144) +++ stable/10/share/man/man9/vnode.9 Tue Feb 18 03:33:51 2014 (r262145) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2010 +.Dd February 12, 2014 .Dt VNODE 9 .Os .Sh NAME @@ -69,11 +69,8 @@ and the .Va v_holdcnt of a vnode reaches zero then the vnode will be put on the freelist and may be reused for another file, possibly in another file system. -The transition to and from the freelist is handled by -.Xr getnewvnode 9 , -.Xr vfree 9 -and -.Xr vbusy 9 . +The transition from the freelist is handled by +.Xr getnewvnode 9 . The third is a count of the number of clients which are writing into the file. It is maintained by the @@ -82,9 +79,9 @@ and .Xr close 2 system calls. .Pp -Any call which returns a vnode (e.g.\& +Any call which returns a vnode (e.g.,\& .Xr vget 9 , -.Xr VOP_LOOKUP 9 +.Xr VOP_LOOKUP 9 , etc.) will increase the .Va v_usecount From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 03:37:21 2014 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 ESMTPS id 02F8AAE0; Tue, 18 Feb 2014 03:37:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E178914ED; Tue, 18 Feb 2014 03:37:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3bKW7005041; Tue, 18 Feb 2014 03:37:20 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3bKHx005040; Tue, 18 Feb 2014 03:37:20 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180337.s1I3bKHx005040@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:37: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: r262146 - stable/9/share/man/man9 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 03:37:21 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:37:20 2014 New Revision: 262146 URL: http://svnweb.freebsd.org/changeset/base/262146 Log: MFC r261800: Remove obsolete vnode(9) man page references. Modified: stable/9/share/man/man9/vnode.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/vnode.9 ============================================================================== --- stable/9/share/man/man9/vnode.9 Tue Feb 18 03:33:51 2014 (r262145) +++ stable/9/share/man/man9/vnode.9 Tue Feb 18 03:37:20 2014 (r262146) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2010 +.Dd February 12, 2014 .Dt VNODE 9 .Os .Sh NAME @@ -69,11 +69,8 @@ and the .Va v_holdcnt of a vnode reaches zero then the vnode will be put on the freelist and may be reused for another file, possibly in another file system. -The transition to and from the freelist is handled by -.Xr getnewvnode 9 , -.Xr vfree 9 -and -.Xr vbusy 9 . +The transition from the freelist is handled by +.Xr getnewvnode 9 . The third is a count of the number of clients which are writing into the file. It is maintained by the @@ -82,9 +79,9 @@ and .Xr close 2 system calls. .Pp -Any call which returns a vnode (e.g.\& +Any call which returns a vnode (e.g.,\& .Xr vget 9 , -.Xr VOP_LOOKUP 9 +.Xr VOP_LOOKUP 9 , etc.) will increase the .Va v_usecount From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 03:39:21 2014 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 ESMTPS id 58C74C8B; Tue, 18 Feb 2014 03:39:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC1C151A; Tue, 18 Feb 2014 03:39:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3dLDY005311; Tue, 18 Feb 2014 03:39:21 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3dLtW005310; Tue, 18 Feb 2014 03:39:21 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180339.s1I3dLtW005310@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262147 - stable/10/usr.bin/passwd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 03:39:21 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:39:20 2014 New Revision: 262147 URL: http://svnweb.freebsd.org/changeset/base/262147 Log: MFC r261895: Remove mention of minimum password length and upper/lower case checking, patch supplied by Allan Jude . Add xref to pam_passwdqc(8), where that testing is now done. Modified: stable/10/usr.bin/passwd/passwd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/passwd/passwd.1 ============================================================================== --- stable/10/usr.bin/passwd/passwd.1 Tue Feb 18 03:37:20 2014 (r262146) +++ stable/10/usr.bin/passwd/passwd.1 Tue Feb 18 03:39:20 2014 (r262147) @@ -28,7 +28,7 @@ .\" @(#)passwd.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 14, 2014 .Dt PASSWD 1 .Os .Sh NAME @@ -59,27 +59,10 @@ The .Nm utility prompts for the new password twice in order to detect typing errors. .Pp -The new password should be at least six characters long (which -may be overridden using the -.Xr login.conf 5 -.Dq minpasswordlen -setting for a user's login class) and not purely alphabetic. -Its total length must be less than +The total length of the password must be less than .Dv _PASSWORD_LEN (currently 128 characters). .Pp -The new password should contain a mixture of upper and lower case -characters (which may be overridden using the -.Xr login.conf 5 -.Dq mixpasswordcase -setting for a user's login class). -Allowing lower case passwords may -be useful where the password file will be used in situations where only -lower case passwords are permissible, such as when using Samba to -authenticate Windows clients. -In all other situations, numbers, upper -case letters and meta characters are encouraged. -.Pp Once the password has been verified, .Nm communicates the new password information to @@ -230,6 +213,7 @@ login class capabilities database .Xr passwd 5 , .Xr kerberos 8 , .Xr kpasswdd 8 , +.Xr pam_passwdqc 8 , .Xr pw 8 , .Xr pwd_mkdb 8 , .Xr vipw 8 From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 03:42:50 2014 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 ESMTPS id 9AA57F5D; Tue, 18 Feb 2014 03:42:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A94D15E5; Tue, 18 Feb 2014 03:42:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3goXq008356; Tue, 18 Feb 2014 03:42:50 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3goi9008355; Tue, 18 Feb 2014 03:42:50 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180342.s1I3goi9008355@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:42: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: r262148 - stable/9/usr.bin/passwd 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 03:42:50 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:42:49 2014 New Revision: 262148 URL: http://svnweb.freebsd.org/changeset/base/262148 Log: MFC r261895: Remove mention of minimum password length and upper/lower case checking, patch supplied by Allan Jude . Add xref to pam_passwdqc(8), where that testing is now done. Modified: stable/9/usr.bin/passwd/passwd.1 Directory Properties: stable/9/usr.bin/passwd/ (props changed) Modified: stable/9/usr.bin/passwd/passwd.1 ============================================================================== --- stable/9/usr.bin/passwd/passwd.1 Tue Feb 18 03:39:20 2014 (r262147) +++ stable/9/usr.bin/passwd/passwd.1 Tue Feb 18 03:42:49 2014 (r262148) @@ -28,7 +28,7 @@ .\" @(#)passwd.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 14, 2014 .Dt PASSWD 1 .Os .Sh NAME @@ -59,27 +59,10 @@ The .Nm utility prompts for the new password twice in order to detect typing errors. .Pp -The new password should be at least six characters long (which -may be overridden using the -.Xr login.conf 5 -.Dq minpasswordlen -setting for a user's login class) and not purely alphabetic. -Its total length must be less than +The total length of the password must be less than .Dv _PASSWORD_LEN (currently 128 characters). .Pp -The new password should contain a mixture of upper and lower case -characters (which may be overridden using the -.Xr login.conf 5 -.Dq mixpasswordcase -setting for a user's login class). -Allowing lower case passwords may -be useful where the password file will be used in situations where only -lower case passwords are permissible, such as when using Samba to -authenticate Windows clients. -In all other situations, numbers, upper -case letters and meta characters are encouraged. -.Pp Once the password has been verified, .Nm communicates the new password information to @@ -230,6 +213,7 @@ login class capabilities database .Xr passwd 5 , .Xr kerberos 8 , .Xr kpasswdd 8 , +.Xr pam_passwdqc 8 , .Xr pw 8 , .Xr pwd_mkdb 8 , .Xr vipw 8 From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 04:27:42 2014 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 ESMTPS id 30900A89; Tue, 18 Feb 2014 04:27:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0249A1912; Tue, 18 Feb 2014 04:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I4RfO2024876; Tue, 18 Feb 2014 04:27:41 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I4RfiZ024875; Tue, 18 Feb 2014 04:27:41 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180427.s1I4RfiZ024875@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 04:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262149 - head/sys/dev/netmap 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 04:27:42 -0000 Author: luigi Date: Tue Feb 18 04:27:41 2014 New Revision: 262149 URL: http://svnweb.freebsd.org/changeset/base/262149 Log: two small changes: - intercept FIONBIO and FIOASYNC ioctls on netmap file descriptors. libpcap calls them to set non blocking I/O on the file descriptor, for netmap this is a no-op because there is no read/write, but not intercepting would cause fcntl() to return -1 - rate limit and put under netmap.verbose some messages that occur when threads use concurrently the same file descriptor. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Feb 18 03:42:49 2014 (r262148) +++ head/sys/dev/netmap/netmap.c Tue Feb 18 04:27:41 2014 (r262149) @@ -137,6 +137,7 @@ ports attached to the switch) #include /* defines used in kernel.h */ #include /* types used in module initialization */ #include /* cdevsw struct, UID, GID */ +#include /* FIONBIO */ #include #include /* struct socket */ #include @@ -1827,6 +1828,11 @@ netmap_ioctl(struct cdev *dev, u_long cm break; #ifdef __FreeBSD__ + case FIONBIO: + case FIOASYNC: + ND("FIONBIO/FIOASYNC are no-ops"); + break; + case BIOCIMMEDIATE: case BIOCGHDRCMPLT: case BIOCSHDRCMPLT: @@ -2002,7 +2008,9 @@ flush_tx: continue; /* only one thread does txsync */ if (nm_kr_tryget(kring)) { - D("%p lost race on txring %d, ok", priv, i); + if (netmap_verbose) + RD(2, "%p lost race on txring %d, ok", + priv, i); continue; } if (nm_txsync_prologue(kring) >= kring->nkr_num_slots) { @@ -2049,7 +2057,9 @@ do_retry_rx: kring = &na->rx_rings[i]; if (nm_kr_tryget(kring)) { - D("%p lost race on rxring %d, ok", priv, i); + if (netmap_verbose) + RD(2, "%p lost race on rxring %d, ok", + priv, i); continue; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 04:38:26 2014 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 ESMTPS id C3A8AEAC; Tue, 18 Feb 2014 04:38:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB9571A00; Tue, 18 Feb 2014 04:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I4cQh6028803; Tue, 18 Feb 2014 04:38:26 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I4cQvM028802; Tue, 18 Feb 2014 04:38:26 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180438.s1I4cQvM028802@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 04:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262150 - head/release/picobsd/floppy.tree/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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 04:38:26 -0000 Author: luigi Date: Tue Feb 18 04:38:26 2014 New Revision: 262150 URL: http://svnweb.freebsd.org/changeset/base/262150 Log: enable rfc1323 and rfc1644 by default in picobsd images. I disabled it some 15 years ago but it is useful to have them on when doing tcp throughput tests. Modified: head/release/picobsd/floppy.tree/etc/rc.conf (contents, props changed) Modified: head/release/picobsd/floppy.tree/etc/rc.conf ============================================================================== --- head/release/picobsd/floppy.tree/etc/rc.conf Tue Feb 18 04:27:41 2014 (r262149) +++ head/release/picobsd/floppy.tree/etc/rc.conf Tue Feb 18 04:38:26 2014 (r262150) @@ -1,6 +1,8 @@ # Sample rc.conf file for PicoBSD # you should mostly set variables here, see rc.conf.defaults. +tcp_extensions=YES # enable rfc1323 and rfc1644 + case ${hostname} in *) echo "processing rc.conf for ${hostname}" From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 05:01:06 2014 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 ESMTPS id 14B461FF; Tue, 18 Feb 2014 05:01:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25FAC1B99; Tue, 18 Feb 2014 05:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I515lN038762; Tue, 18 Feb 2014 05:01:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I515E3038759; Tue, 18 Feb 2014 05:01:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180501.s1I515E3038759@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 05:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262151 - in stable/10: share/man/man4 sys/conf sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/modules/netmap sys/net tools/tools/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 05:01:06 -0000 Author: luigi Date: Tue Feb 18 05:01:04 2014 New Revision: 262151 URL: http://svnweb.freebsd.org/changeset/base/262151 Log: MFH: sync the netmap code with the one in HEAD (enhanced VALE switch, netmap pipes, emulated netmap mode). See details in the log for svn 261909. Deleted: stable/10/tools/tools/netmap/click-test.cfg stable/10/tools/tools/netmap/nm_util.c stable/10/tools/tools/netmap/nm_util.h stable/10/tools/tools/netmap/pcap.c Modified: stable/10/share/man/man4/netmap.4 stable/10/sys/conf/files stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/netmap/if_em_netmap.h stable/10/sys/dev/netmap/if_igb_netmap.h stable/10/sys/dev/netmap/if_lem_netmap.h stable/10/sys/dev/netmap/if_re_netmap.h stable/10/sys/dev/netmap/ixgbe_netmap.h stable/10/sys/dev/netmap/netmap.c stable/10/sys/dev/netmap/netmap_kern.h stable/10/sys/dev/netmap/netmap_mem2.c stable/10/sys/dev/re/if_re.c stable/10/sys/modules/netmap/Makefile stable/10/sys/net/netmap.h stable/10/sys/net/netmap_user.h stable/10/tools/tools/netmap/Makefile stable/10/tools/tools/netmap/README stable/10/tools/tools/netmap/bridge.c stable/10/tools/tools/netmap/pkt-gen.c stable/10/tools/tools/netmap/vale-ctl.c Modified: stable/10/share/man/man4/netmap.4 ============================================================================== --- stable/10/share/man/man4/netmap.4 Tue Feb 18 04:38:26 2014 (r262150) +++ stable/10/share/man/man4/netmap.4 Tue Feb 18 05:01:04 2014 (r262151) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa +.\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -21,230 +21,636 @@ .\" 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. -.\" +.\" .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" .\" $FreeBSD$ -.\" $Id: netmap.4 11563 2012-08-02 08:59:12Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ .\" -.Dd September 23, 2013 +.Dd February 13, 2014 .Dt NETMAP 4 .Os .Sh NAME .Nm netmap .Nd a framework for fast packet I/O +.br +.Nm VALE +.Nd a fast VirtuAl Local Ethernet using the netmap API +.br +.Nm netmap pipes +.Nd a shared memory packet transport channel .Sh SYNOPSIS .Cd device netmap .Sh DESCRIPTION .Nm -is a framework for fast and safe access to network devices -(reaching 14.88 Mpps at less than 1 GHz). -.Nm -uses memory mapped buffers and metadata -(buffer indexes and lengths) to communicate with the kernel, -which is in charge of validating information through -.Pa ioctl() +is a framework for extremely fast and efficient packet I/O +for both userspace and kernel clients. +It runs on FreeBSD and Linux, +and includes +.Nm VALE , +a very fast and modular in-kernel software switch/dataplane, +and +.Nm netmap pipes , +a shared memory packet transport channel. +All these are accessed interchangeably with the same API. +.Pp +.Nm , VALE and -.Pa select()/poll(). +.Nm netmap pipes +are at least one order of magnitude faster than +standard OS mechanisms +(sockets, bpf, tun/tap interfaces, native switches, pipes), +reaching 14.88 million packets per second (Mpps) +with much less than one core on a 10 Gbit NIC, +about 20 Mpps per core for VALE ports, +and over 100 Mpps for netmap pipes. +.Pp +Userspace clients can dynamically switch NICs into .Nm -can exploit the parallelism in multiqueue devices and -multicore systems. +mode and send and receive raw packets through +memory mapped buffers. +Similarly, +.Nm VALE +switch instances and ports, and +.Nm netmap pipes +can be created dynamically, +providing high speed packet I/O between processes, +virtual machines, NICs and the host stack. .Pp .Nm +suports both non-blocking I/O through +.Xr ioctls() , +synchronization and blocking I/O through a file descriptor +and standard OS mechanisms such as +.Xr select 2 , +.Xr poll 2 , +.Xr epoll 2 , +.Xr kqueue 2 . +.Nm VALE +and +.Nm netmap pipes +are implemented by a single kernel module, which also emulates the +.Nm +API over standard drivers for devices without native +.Nm +support. +For best performance, +.Nm requires explicit support in device drivers. -For a list of supported devices, see the end of this manual page. -.Sh OPERATION +.Pp +In the rest of this (long) manual page we document +various aspects of the .Nm -clients must first open the -.Pa open("/dev/netmap") , -and then issue an -.Pa ioctl(...,NIOCREGIF,...) -to bind the file descriptor to a network device. -.Pp -When a device is put in -.Nm -mode, its data path is disconnected from the host stack. -The processes owning the file descriptor -can exchange packets with the device, or with the host stack, -through an mmapped memory region that contains pre-allocated -buffers and metadata. +and +.Nm VALE +architecture, features and usage. +.Pp +.Sh ARCHITECTURE +.Nm +supports raw packet I/O through a +.Em port , +which can be connected to a physical interface +.Em ( NIC ) , +to the host stack, +or to a +.Nm VALE +switch). +Ports use preallocated circular queues of buffers +.Em ( rings ) +residing in an mmapped region. +There is one ring for each transmit/receive queue of a +NIC or virtual port. +An additional ring pair connects to the host stack. +.Pp +After binding a file descriptor to a port, a +.Nm +client can send or receive packets in batches through +the rings, and possibly implement zero-copy forwarding +between ports. +.Pp +All NICs operating in +.Nm +mode use the same memory region, +accessible to all processes who own +.Nm /dev/netmap +file descriptors bound to NICs. +Independent +.Nm VALE +and +.Nm netmap pipe +ports +by default use separate memory regions, +but can be independently configured to share memory. +.Pp +.Sh ENTERING AND EXITING NETMAP MODE +The following section describes the system calls to create +and control +.Nm netmap +ports (including +.Nm VALE +and +.Nm netmap pipe +ports). +Simpler, higher level functions are described in section +.Xr LIBRARIES . +.Pp +Ports and rings are created and controlled through a file descriptor, +created by opening a special device +.Dl fd = open("/dev/netmap"); +and then bound to a specific port with an +.Dl ioctl(fd, NIOCREGIF, (struct nmreq *)arg); +.Pp +.Nm +has multiple modes of operation controlled by the +.Vt struct nmreq +argument. +.Va arg.nr_name +specifies the port name, as follows: +.Bl -tag -width XXXX +.It Dv OS network interface name (e.g. 'em0', 'eth1', ... ) +the data path of the NIC is disconnected from the host stack, +and the file descriptor is bound to the NIC (one or all queues), +or to the host stack; +.It Dv valeXXX:YYY (arbitrary XXX and YYY) +the file descriptor is bound to port YYY of a VALE switch called XXX, +both dynamically created if necessary. +The string cannot exceed IFNAMSIZ characters, and YYY cannot +be the name of any existing OS network interface. +.El +.Pp +On return, +.Va arg +indicates the size of the shared memory region, +and the number, size and location of all the +.Nm +data structures, which can be accessed by mmapping the memory +.Dl char *mem = mmap(0, arg.nr_memsize, fd); .Pp Non blocking I/O is done with special -.Pa ioctl()'s , -whereas the file descriptor can be passed to -.Pa select()/poll() -to be notified about incoming packet or available transmit buffers. -.Ss Data structures -All data structures for all devices in -.Nm -mode are in a memory -region shared by the kernel and all processes -who open -.Pa /dev/netmap -(NOTE: visibility may be restricted in future implementations). -All references between the shared data structure -are relative (offsets or indexes). Some macros help converting -them into actual pointers. +.Xr ioctl 2 +.Xr select 2 +and +.Xr poll 2 +on the file descriptor permit blocking I/O. +.Xr epoll 2 +and +.Xr kqueue 2 +are not supported on +.Nm +file descriptors. .Pp -The data structures in shared memory are the following: +While a NIC is in +.Nm +mode, the OS will still believe the interface is up and running. +OS-generated packets for that NIC end up into a +.Nm +ring, and another ring is used to send packets into the OS network stack. +A +.Xr close 2 +on the file descriptor removes the binding, +and returns the NIC to normal mode (reconnecting the data path +to the host stack), or destroys the virtual port. +.Pp +.Sh DATA STRUCTURES +The data structures in the mmapped memory region are detailed in +.Xr sys/net/netmap.h , +which is the ultimate reference for the +.Nm +API. The main structures and fields are indicated below: .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) -indicates the number of rings supported by an interface, their -sizes, and the offsets of the -.Pa netmap_rings -associated to the interface. -The offset of a -.Pa struct netmap_if -in the shared memory region is indicated by the -.Pa nr_offset -field in the structure returned by the -.Pa NIOCREGIF -(see below). .Bd -literal struct netmap_if { - char ni_name[IFNAMSIZ]; /* name of the interface. */ - const u_int ni_num_queues; /* number of hw ring pairs */ - const ssize_t ring_ofs[]; /* offset of tx and rx rings */ + ... + const uint32_t ni_flags; /* properties */ + ... + const uint32_t ni_tx_rings; /* NIC tx rings */ + const uint32_t ni_rx_rings; /* NIC rx rings */ + uint32_t ni_bufs_head; /* head of extra bufs list */ + ... }; .Ed +.Pp +Indicates the number of available rings +.Pa ( struct netmap_rings ) +and their position in the mmapped region. +The number of tx and rx rings +.Pa ( ni_tx_rings , ni_rx_rings ) +normally depends on the hardware. +NICs also have an extra tx/rx ring pair connected to the host stack. +.Em NIOCREGIF +can also request additional unbound buffers in the same memory space, +to be used as temporary storage for packets. +.Pa ni_bufs_head +contains the index of the first of these free rings, +which are connected in a list (the first uint32_t of each +buffer being the index of the next buffer in the list). +A 0 indicates the end of the list. +.Pp .It Dv struct netmap_ring (one per ring) -contains the index of the current read or write slot (cur), -the number of slots available for reception or transmission (avail), -and an array of -.Pa slots -describing the buffers. -There is one ring pair for each of the N hardware ring pairs -supported by the card (numbered 0..N-1), plus -one ring pair (numbered N) for packets from/to the host stack. .Bd -literal struct netmap_ring { - const ssize_t buf_ofs; - const uint32_t num_slots; /* number of slots in the ring. */ - uint32_t avail; /* number of usable slots */ - uint32_t cur; /* 'current' index for the user side */ - uint32_t reserved; /* not refilled before current */ - - const uint16_t nr_buf_size; - uint16_t flags; - struct netmap_slot slot[0]; /* array of slots. */ + ... + const uint32_t num_slots; /* slots in each ring */ + const uint32_t nr_buf_size; /* size of each buffer */ + ... + uint32_t head; /* (u) first buf owned by user */ + uint32_t cur; /* (u) wakeup position */ + const uint32_t tail; /* (k) first buf owned by kernel */ + ... + uint32_t flags; + struct timeval ts; /* (k) time of last rxsync() */ + ... + struct netmap_slot slot[0]; /* array of slots */ } .Ed -.It Dv struct netmap_slot (one per packet) -contains the metadata for a packet: a buffer index (buf_idx), -a buffer length (len), and some flags. +.Pp +Implements transmit and receive rings, with read/write +pointers, metadata and and an array of +.Pa slots +describing the buffers. +.Pp +.It Dv struct netmap_slot (one per buffer) .Bd -literal struct netmap_slot { - uint32_t buf_idx; /* buffer index */ - uint16_t len; /* packet length */ - uint16_t flags; /* buf changed, etc. */ -#define NS_BUF_CHANGED 0x0001 /* must resync, buffer changed */ -#define NS_REPORT 0x0002 /* tell hw to report results - * e.g. by generating an interrupt - */ + uint32_t buf_idx; /* buffer index */ + uint16_t len; /* packet length */ + uint16_t flags; /* buf changed, etc. */ + uint64_t ptr; /* address for indirect buffers */ }; .Ed +.Pp +Describes a packet buffer, which normally is identified by +an index and resides in the mmapped region. .It Dv packet buffers -are fixed size (approximately 2k) buffers allocated by the kernel -that contain packet data. Buffers addresses are computed through -macros. +Fixed size (normally 2 KB) packet buffers allocated by the kernel. .El .Pp -Some macros support the access to objects in the shared memory -region. In particular: +The offset of the +.Pa struct netmap_if +in the mmapped region is indicated by the +.Pa nr_offset +field in the structure returned by +.Pa NIOCREGIF . +From there, all other objects are reachable through +relative references (offsets or indexes). +Macros and functions in +help converting them into actual pointers: +.Pp +.Dl struct netmap_if *nifp = NETMAP_IF(mem, arg.nr_offset); +.Dl struct netmap_ring *txr = NETMAP_TXRING(nifp, ring_index); +.Dl struct netmap_ring *rxr = NETMAP_RXRING(nifp, ring_index); +.Pp +.Dl char *buf = NETMAP_BUF(ring, buffer_index); +.Sh RINGS, BUFFERS AND DATA I/O +.Va Rings +are circular queues of packets with three indexes/pointers +.Va ( head , cur , tail ) ; +one slot is always kept empty. +The ring size +.Va ( num_slots ) +should not be assumed to be a power of two. +.br +(NOTE: older versions of netmap used head/count format to indicate +the content of a ring). +.Pp +.Va head +is the first slot available to userspace; +.br +.Va cur +is the wakeup point: +select/poll will unblock when +.Va tail +passes +.Va cur ; +.br +.Va tail +is the first slot reserved to the kernel. +.Pp +Slot indexes MUST only move forward; +for convenience, the function +.Dl nm_ring_next(ring, index) +returns the next index modulo the ring size. +.Pp +.Va head +and +.Va cur +are only modified by the user program; +.Va tail +is only modified by the kernel. +The kernel only reads/writes the +.Vt struct netmap_ring +slots and buffers +during the execution of a netmap-related system call. +The only exception are slots (and buffers) in the range +.Va tail\ . . . head-1 , +that are explicitly assigned to the kernel. +.Pp +.Ss TRANSMIT RINGS +On transmit rings, after a +.Nm +system call, slots in the range +.Va head\ . . . tail-1 +are available for transmission. +User code should fill the slots sequentially +and advance +.Va head +and +.Va cur +past slots ready to transmit. +.Va cur +may be moved further ahead if the user code needs +more slots before further transmissions (see +.Sx SCATTER GATHER I/O ) . +.Pp +At the next NIOCTXSYNC/select()/poll(), +slots up to +.Va head-1 +are pushed to the port, and +.Va tail +may advance if further slots have become available. +Below is an example of the evolution of a TX ring: +.Pp .Bd -literal -struct netmap_if *nifp; -struct netmap_ring *txring = NETMAP_TXRING(nifp, i); -struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); -int i = txring->slot[txring->cur].buf_idx; -char *buf = NETMAP_BUF(txring, i); + after the syscall, slots between cur and tail are (a)vailable + head=cur tail + | | + v v + TX [.....aaaaaaaaaaa.............] + + user creates new packets to (T)ransmit + head=cur tail + | | + v v + TX [.....TTTTTaaaaaa.............] + + NIOCTXSYNC/poll()/select() sends packets and reports new slots + head=cur tail + | | + v v + TX [..........aaaaaaaaaaa........] +.Ed +.Pp +select() and poll() wlll block if there is no space in the ring, i.e. +.Dl ring->cur == ring->tail +and return when new slots have become available. +.Pp +High speed applications may want to amortize the cost of system calls +by preparing as many packets as possible before issuing them. +.Pp +A transmit ring with pending transmissions has +.Dl ring->head != ring->tail + 1 (modulo the ring size). +The function +.Va int nm_tx_pending(ring) +implements this test. +.Pp +.Ss RECEIVE RINGS +On receive rings, after a +.Nm +system call, the slots in the range +.Va head\& . . . tail-1 +contain received packets. +User code should process them and advance +.Va head +and +.Va cur +past slots it wants to return to the kernel. +.Va cur +may be moved further ahead if the user code wants to +wait for more packets +without returning all the previous slots to the kernel. +.Pp +At the next NIOCRXSYNC/select()/poll(), +slots up to +.Va head-1 +are returned to the kernel for further receives, and +.Va tail +may advance to report new incoming packets. +.br +Below is an example of the evolution of an RX ring: +.Bd -literal + after the syscall, there are some (h)eld and some (R)eceived slots + head cur tail + | | | + v v v + RX [..hhhhhhRRRRRRRR..........] + + user advances head and cur, releasing some slots and holding others + head cur tail + | | | + v v v + RX [..*****hhhRRRRRR...........] + + NICRXSYNC/poll()/select() recovers slots and reports new packets + head cur tail + | | | + v v v + RX [.......hhhRRRRRRRRRRRR....] .Ed +.Pp +.Sh SLOTS AND PACKET BUFFERS +Normally, packets should be stored in the netmap-allocated buffers +assigned to slots when ports are bound to a file descriptor. +One packet is fully contained in a single buffer. +.Pp +The following flags affect slot and buffer processing: +.Bl -tag -width XXX +.It NS_BUF_CHANGED +it MUST be used when the buf_idx in the slot is changed. +This can be used to implement +zero-copy forwarding, see +.Sx ZERO-COPY FORWARDING . +.Pp +.It NS_REPORT +reports when this buffer has been transmitted. +Normally, +.Nm +notifies transmit completions in batches, hence signals +can be delayed indefinitely. This flag helps detecting +when packets have been send and a file descriptor can be closed. +.It NS_FORWARD +When a ring is in 'transparent' mode (see +.Sx TRANSPARENT MODE ) , +packets marked with this flags are forwarded to the other endpoint +at the next system call, thus restoring (in a selective way) +the connection between a NIC and the host stack. +.It NS_NO_LEARN +tells the forwarding code that the SRC MAC address for this +packet must not be used in the learning bridge code. +.It NS_INDIRECT +indicates that the packet's payload is in a user-supplied buffer, +whose user virtual address is in the 'ptr' field of the slot. +The size can reach 65535 bytes. +.br +This is only supported on the transmit ring of +.Nm VALE +ports, and it helps reducing data copies in the interconnection +of virtual machines. +.It NS_MOREFRAG +indicates that the packet continues with subsequent buffers; +the last buffer in a packet must have the flag clear. +.El +.Sh SCATTER GATHER I/O +Packets can span multiple slots if the +.Va NS_MOREFRAG +flag is set in all but the last slot. +The maximum length of a chain is 64 buffers. +This is normally used with +.Nm VALE +ports when connecting virtual machines, as they generate large +TSO segments that are not split unless they reach a physical device. +.Pp +NOTE: The length field always refers to the individual +fragment; there is no place with the total length of a packet. +.Pp +On receive rings the macro +.Va NS_RFRAGS(slot) +indicates the remaining number of slots for this packet, +including the current one. +Slots with a value greater than 1 also have NS_MOREFRAG set. .Sh IOCTLS .Nm -supports some ioctl() to synchronize the state of the rings -between the kernel and the user processes, plus some -to query and configure the interface. -The former do not require any argument, whereas the latter -use a -.Pa struct netmap_req -defined as follows: +uses two ioctls (NIOCTXSYNC, NIOCRXSYNC) +for non-blocking I/O. They take no argument. +Two more ioctls (NIOCGINFO, NIOCREGIF) are used +to query and configure ports, with the following argument: .Bd -literal struct nmreq { - char nr_name[IFNAMSIZ]; - uint32_t nr_version; /* API version */ -#define NETMAP_API 3 /* current version */ - uint32_t nr_offset; /* nifp offset in the shared region */ - uint32_t nr_memsize; /* size of the shared region */ - uint32_t nr_tx_slots; /* slots in tx rings */ - uint32_t nr_rx_slots; /* slots in rx rings */ - uint16_t nr_tx_rings; /* number of tx rings */ - uint16_t nr_rx_rings; /* number of tx rings */ - uint16_t nr_ringid; /* ring(s) we care about */ -#define NETMAP_HW_RING 0x4000 /* low bits indicate one hw ring */ -#define NETMAP_SW_RING 0x2000 /* we process the sw ring */ -#define NETMAP_NO_TX_POLL 0x1000 /* no gratuitous txsync on poll */ -#define NETMAP_RING_MASK 0xfff /* the actual ring number */ - uint16_t spare1; - uint32_t spare2[4]; + char nr_name[IFNAMSIZ]; /* (i) port name */ + uint32_t nr_version; /* (i) API version */ + uint32_t nr_offset; /* (o) nifp offset in mmap region */ + uint32_t nr_memsize; /* (o) size of the mmap region */ + uint32_t nr_tx_slots; /* (i/o) slots in tx rings */ + uint32_t nr_rx_slots; /* (i/o) slots in rx rings */ + uint16_t nr_tx_rings; /* (i/o) number of tx rings */ + uint16_t nr_rx_rings; /* (i/o) number of tx rings */ + uint16_t nr_ringid; /* (i/o) ring(s) we care about */ + uint16_t nr_cmd; /* (i) special command */ + uint16_t nr_arg1; /* (i/o) extra arguments */ + uint16_t nr_arg2; /* (i/o) extra arguments */ + uint32_t nr_arg3; /* (i/o) extra arguments */ + uint32_t nr_flags /* (i/o) open mode */ + ... }; - .Ed -A device descriptor obtained through +.Pp +A file descriptor obtained through .Pa /dev/netmap -also supports the ioctl supported by network devices. +also supports the ioctl supported by network devices, see +.Xr netintro 4 . .Pp -The netmap-specific -.Xr ioctl 2 -command codes below are defined in -.In net/netmap.h -and are: .Bl -tag -width XXXX .It Dv NIOCGINFO -returns information about the interface named in nr_name. -On return, nr_memsize indicates the size of the shared netmap -memory region (this is device-independent), -nr_tx_slots and nr_rx_slots indicates how many buffers are in a -transmit and receive ring, -nr_tx_rings and nr_rx_rings indicates the number of transmit -and receive rings supported by the hardware. +returns EINVAL if the named port does not support netmap. +Otherwise, it returns 0 and (advisory) information +about the port. +Note that all the information below can change before the +interface is actually put in netmap mode. .Pp -If the device does not support netmap, the ioctl returns EINVAL. +.Bl -tag -width XX +.It Pa nr_memsize +indicates the size of the +.Nm +memory region. NICs in +.Nm +mode all share the same memory region, +whereas +.Nm VALE +ports have independent regions for each port. +.It Pa nr_tx_slots , nr_rx_slots +indicate the size of transmit and receive rings. +.It Pa nr_tx_rings , nr_rx_rings +indicate the number of transmit +and receive rings. +Both ring number and sizes may be configured at runtime +using interface-specific functions (e.g. +.Xr ethtool +). +.El .It Dv NIOCREGIF -puts the interface named in nr_name into netmap mode, disconnecting -it from the host stack, and/or defines which rings are controlled -through this file descriptor. -On return, it gives the same info as NIOCGINFO, and nr_ringid -indicates the identity of the rings controlled through the file +binds the port named in +.Va nr_name +to the file descriptor. For a physical device this also switches it into +.Nm +mode, disconnecting +it from the host stack. +Multiple file descriptors can be bound to the same port, +with proper synchronization left to the user. +.Pp +.Dv NIOCREGIF can also bind a file descriptor to one endpoint of a +.Em netmap pipe , +consisting of two netmap ports with a crossover connection. +A netmap pipe share the same memory space of the parent port, +and is meant to enable configuration where a master process acts +as a dispatcher towards slave processes. +.Pp +To enable this function, the +.Pa nr_arg1 +field of the structure can be used as a hint to the kernel to +indicate how many pipes we expect to use, and reserve extra space +in the memory region. +.Pp +On return, it gives the same info as NIOCGINFO, +with +.Pa nr_ringid +and +.Pa nr_flags +indicating the identity of the rings controlled through the file descriptor. .Pp -Possible values for nr_ringid are +.Va nr_flags +.Va nr_ringid +selects which rings are controlled through this file descriptor. +Possible values of +.Pa nr_flags +are indicated below, together with the naming schemes +that application libraries (such as the +.Nm nm_open +indicated below) can use to indicate the specific set of rings. +In the example below, "netmap:foo" is any valid netmap port name. +.Pp .Bl -tag -width XXXXX -.It 0 -default, all hardware rings -.It NETMAP_SW_RING -the ``host rings'' connecting to the host stack -.It NETMAP_HW_RING + i -the i-th hardware ring +.It NR_REG_ALL_NIC "netmap:foo" +(default) all hardware ring pairs +.It NR_REG_SW_NIC "netmap:foo^" +the ``host rings'', connecting to the host stack. +.It NR_RING_NIC_SW "netmap:foo+ +all hardware rings and the host rings +.It NR_REG_ONE_NIC "netmap:foo-i" +only the i-th hardware ring pair, where the number is in +.Pa nr_ringid ; +.It NR_REG_PIPE_MASTER "netmap:foo{i" +the master side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid ; +.It NR_REG_PIPE_SLAVE "netmap:foo}i" +the slave side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid . +.Pp +The identifier of a pipe must be thought as part of the pipe name, +and does not need to be sequential. On return the pipe +will only have a single ring pair with index 0, +irrespective of the value of i. .El +.Pp By default, a -.Nm poll +.Xr poll 2 or -.Nm select +.Xr select 2 call pushes out any pending packets on the transmit ring, even if no write events are specified. The feature can be disabled by or-ing -.Nm NETMAP_NO_TX_SYNC -to nr_ringid. -But normally you should keep this feature unless you are using -separate file descriptors for the send and receive rings, because -otherwise packets are pushed out only if NETMAP_TXSYNC is called, -or the send queue is full. -.Pp -.Pa NIOCREGIF -can be used multiple times to change the association of a -file descriptor to a ring pair, always within the same device. -.It Dv NIOCUNREGIF -brings an interface back to normal mode. +.Va NETMAP_NO_TX_SYNC +to the value written to +.Va nr_ringid. +When this feature is used, +packets are transmitted only on +.Va ioctl(NIOCTXSYNC) +or select()/poll() are called with a write event (POLLOUT/wfdset) or a full ring. +.Pp +When registering a virtual interface that is dynamically created to a +.Xr vale 4 +switch, we can specify the desired number of rings (1 by default, +and currently up to 16) on it using nr_tx_rings and nr_rx_rings fields. .It Dv NIOCTXSYNC tells the hardware of new packets to transmit, and updates the number of slots available for transmission. @@ -252,54 +658,387 @@ number of slots available for transmissi tells the hardware of consumed packets, and asks for newly available packets. .El +.Sh SELECT, POLL, EPOLL, KQUEUE. +.Xr select 2 +and +.Xr poll 2 +on a +.Nm +file descriptor process rings as indicated in +.Sx TRANSMIT RINGS +and +.Sx RECEIVE RINGS , +respectively when write (POLLOUT) and read (POLLIN) events are requested. +Both block if no slots are available in the ring +.Va ( ring->cur == ring->tail ) . +Depending on the platform, +.Xr epoll 2 +and +.Xr kqueue 2 +are supported too. +.Pp +Packets in transmit rings are normally pushed out +(and buffers reclaimed) even without +requesting write events. Passing the NETMAP_NO_TX_SYNC flag to +.Em NIOCREGIF +disables this feature. +By default, receive rings are processed only if read +events are requested. Passing the NETMAP_DO_RX_SYNC flag to +.Em NIOCREGIF updates receive rings even without read events. +Note that on epoll and kqueue, NETMAP_NO_TX_SYNC and NETMAP_DO_RX_SYNC +only have an effect when some event is posted for the file descriptor. +.Sh LIBRARIES +The +.Nm +API is supposed to be used directly, both because of its simplicity and +for efficient integration with applications. +.Pp +For conveniency, the +.Va +header provides a few macros and functions to ease creating +a file descriptor and doing I/O with a +.Nm +port. These are loosely modeled after the +.Xr pcap 3 +API, to ease porting of libpcap-based applications to +.Nm . +To use these extra functions, programs should +.Dl #define NETMAP_WITH_LIBS +before +.Dl #include +.Pp +The following functions are available: +.Bl -tag -width XXXXX +.It Va struct nm_desc * nm_open(const char *ifname, const struct nmreq *req, uint64_t flags, const struct nm_desc *arg) +similar to +.Xr pcap_open , +binds a file descriptor to a port. +.Bl -tag -width XX +.It Va ifname +is a port name, in the form "netmap:XXX" for a NIC and "valeXXX:YYY" for a +.Nm VALE +port. +.It Va req +provides the initial values for the argument to the NIOCREGIF ioctl. +The nm_flags and nm_ringid values are overwritten by parsing +ifname and flags, and other fields can be overridden through +the other two arguments. +.It Va arg +points to a struct nm_desc containing arguments (e.g. from a previously +open file descriptor) that should override the defaults. +The fields are used as described below +.It Va flags +can be set to a combination of the following flags: +.Va NETMAP_NO_TX_POLL , +.Va NETMAP_DO_RX_POLL +(copied into nr_ringid); +.Va NM_OPEN_NO_MMAP (if arg points to the same memory region, +avoids the mmap and uses the values from it); +.Va NM_OPEN_IFNAME (ignores ifname and uses the values in arg); +.Va NM_OPEN_ARG1 , +.Va NM_OPEN_ARG2 , +.Va NM_OPEN_ARG3 (uses the fields from arg); +.Va NM_OPEN_RING_CFG (uses the ring number and sizes from arg). +.El +.It Va int nm_close(struct nm_desc *d) +closes the file descriptor, unmaps memory, frees resources. +.It Va int nm_inject(struct nm_desc *d, const void *buf, size_t size) +similar to pcap_inject(), pushes a packet to a ring, returns the size +of the packet is successful, or 0 on error; +.It Va int nm_dispatch(struct nm_desc *d, int cnt, nm_cb_t cb, u_char *arg) +similar to pcap_dispatch(), applies a callback to incoming packets +.It Va u_char * nm_nextpkt(struct nm_desc *d, struct nm_pkthdr *hdr) +similar to pcap_next(), fetches the next packet +.Pp +.El +.Sh SUPPORTED DEVICES +.Nm +natively supports the following devices: +.Pp +On FreeBSD: +.Xr em 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr lem 4 , +.Xr re 4 . +.Pp +On Linux +.Xr e1000 4 , +.Xr e1000e 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr mlx4 4 , +.Xr forcedeth 4 , +.Xr r8169 4 . +.Pp +NICs without native support can still be used in +.Nm +mode through emulation. Performance is inferior to native netmap +mode but still significantly higher than sockets, and approaching +that of in-kernel solutions such as Linux's +.Xr pktgen . +.Pp +Emulation is also available for devices with native netmap support, +which can be used for testing or performance comparison. +The sysctl variable +.Va dev.netmap.admode +globally controls how netmap mode is implemented. +.Sh SYSCTL VARIABLES AND MODULE PARAMETERS +Some aspect of the operation of +.Nm +are controlled through sysctl variables on FreeBSD +.Em ( dev.netmap.* ) +and module parameters on Linux +.Em ( /sys/module/netmap_lin/parameters/* ) : +.Pp +.Bl -tag -width indent +.It Va dev.netmap.admode: 0 +Controls the use of native or emulated adapter mode. +0 uses the best available option, 1 forces native and +fails if not available, 2 forces emulated hence never fails. +.It Va dev.netmap.generic_ringsize: 1024 +Ring size used for emulated netmap mode +.It Va dev.netmap.generic_mit: 100000 +Controls interrupt moderation for emulated mode +.It Va dev.netmap.mmap_unreg: 0 +.It Va dev.netmap.fwd: 0 +Forces NS_FORWARD mode +.It Va dev.netmap.flags: 0 +.It Va dev.netmap.txsync_retry: 2 +.It Va dev.netmap.no_pendintr: 1 +Forces recovery of transmit buffers on system calls +.It Va dev.netmap.mitigate: 1 +Propagates interrupt mitigation to user processes +.It Va dev.netmap.no_timestamp: 0 +Disables the update of the timestamp in the netmap ring +.It Va dev.netmap.verbose: 0 +Verbose kernel messages +.It Va dev.netmap.buf_num: 163840 +.It Va dev.netmap.buf_size: 2048 +.It Va dev.netmap.ring_num: 200 +.It Va dev.netmap.ring_size: 36864 +.It Va dev.netmap.if_num: 100 +.It Va dev.netmap.if_size: 1024 +Sizes and number of objects (netmap_if, netmap_ring, buffers) +for the global memory region. The only parameter worth modifying is +.Va dev.netmap.buf_num +as it impacts the total amount of memory used by netmap. +.It Va dev.netmap.buf_curr_num: 0 +.It Va dev.netmap.buf_curr_size: 0 +.It Va dev.netmap.ring_curr_num: 0 +.It Va dev.netmap.ring_curr_size: 0 +.It Va dev.netmap.if_curr_num: 0 +.It Va dev.netmap.if_curr_size: 0 +Actual values in use. +.It Va dev.netmap.bridge_batch: 1024 +Batch size used when moving packets across a +.Nm VALE +switch. Values above 64 generally guarantee good +performance. +.El .Sh SYSTEM CALLS .Nm uses -.Nm select +.Xr select 2 , +.Xr poll 2 , +.Xr epoll and -.Nm poll -to wake up processes when significant events occur. +.Xr kqueue +to wake up processes when significant events occur, and +.Xr mmap 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 05:46:19 2014 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 ESMTPS id EA4D0878; Tue, 18 Feb 2014 05:46:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D24561DEE; Tue, 18 Feb 2014 05:46:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I5kJDl055516; Tue, 18 Feb 2014 05:46:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I5kJXv055512; Tue, 18 Feb 2014 05:46:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180546.s1I5kJXv055512@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 05:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262152 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 05:46:20 -0000 Author: luigi Date: Tue Feb 18 05:46:19 2014 New Revision: 262152 URL: http://svnweb.freebsd.org/changeset/base/262152 Log: missing files from previous commit... Added: stable/10/sys/dev/netmap/netmap_freebsd.c (contents, props changed) stable/10/sys/dev/netmap/netmap_generic.c (contents, props changed) stable/10/sys/dev/netmap/netmap_mbq.c (contents, props changed) stable/10/sys/dev/netmap/netmap_mbq.h (contents, props changed) stable/10/sys/dev/netmap/netmap_mem2.h (contents, props changed) stable/10/sys/dev/netmap/netmap_offloadings.c (contents, props changed) stable/10/sys/dev/netmap/netmap_pipe.c (contents, props changed) stable/10/sys/dev/netmap/netmap_vale.c (contents, props changed) Added: stable/10/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/netmap/netmap_freebsd.c Tue Feb 18 05:46:19 2014 (r262152) @@ -0,0 +1,655 @@ +/* + * Copyright (C) 2013-2014 Universita` di Pisa. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#include +#include +#include +#include /* defines used in kernel.h */ +#include /* POLLIN, POLLOUT */ +#include /* types used in module initialization */ +#include /* DEV_MODULE */ +#include + +#include + +#include /* vtophys */ +#include /* vtophys */ +#include +#include +#include +#include +#include + + +#include +#include /* sockaddrs */ +#include +#include +#include +#include /* bus_dmamap_* */ +#include /* in6_cksum_pseudo() */ +#include /* in_pseudo(), in_cksum_hdr() */ + +#include +#include +#include + + +/* ======================== FREEBSD-SPECIFIC ROUTINES ================== */ + +rawsum_t nm_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) +{ + /* TODO XXX please use the FreeBSD implementation for this. */ + uint16_t *words = (uint16_t *)data; + int nw = len / 2; + int i; + + for (i = 0; i < nw; i++) + cur_sum += be16toh(words[i]); + + if (len & 1) + cur_sum += (data[len-1] << 8); + + return cur_sum; +} + +/* Fold a raw checksum: 'cur_sum' is in host byte order, while the + * return value is in network byte order. + */ +uint16_t nm_csum_fold(rawsum_t cur_sum) +{ + /* TODO XXX please use the FreeBSD implementation for this. */ + while (cur_sum >> 16) + cur_sum = (cur_sum & 0xFFFF) + (cur_sum >> 16); + + return htobe16((~cur_sum) & 0xFFFF); +} + +uint16_t nm_csum_ipv4(struct nm_iphdr *iph) +{ +#if 0 + return in_cksum_hdr((void *)iph); +#else + return nm_csum_fold(nm_csum_raw((uint8_t*)iph, sizeof(struct nm_iphdr), 0)); +#endif +} + +void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, + size_t datalen, uint16_t *check) +{ + uint16_t pseudolen = datalen + iph->protocol; + + /* Compute and insert the pseudo-header cheksum. */ + *check = in_pseudo(iph->saddr, iph->daddr, + htobe16(pseudolen)); + /* Compute the checksum on TCP/UDP header + payload + * (includes the pseudo-header). + */ + *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +} + +void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, + size_t datalen, uint16_t *check) +{ +#ifdef INET6 + *check = in6_cksum_pseudo((void*)ip6h, datalen, ip6h->nexthdr, 0); + *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet6 segmentation not supported"); + } +#endif +} + + +/* + * Intercept the rx routine in the standard device driver. + * Second argument is non-zero to intercept, 0 to restore + */ +int +netmap_catch_rx(struct netmap_adapter *na, int intercept) +{ + struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; + struct ifnet *ifp = na->ifp; + + if (intercept) { + if (gna->save_if_input) { + D("cannot intercept again"); + return EINVAL; /* already set */ + } + gna->save_if_input = ifp->if_input; + ifp->if_input = generic_rx_handler; + } else { + if (!gna->save_if_input){ + D("cannot restore"); + return EINVAL; /* not saved */ + } + ifp->if_input = gna->save_if_input; + gna->save_if_input = NULL; + } + + return 0; +} + + +/* + * Intercept the packet steering routine in the tx path, + * so that we can decide which queue is used for an mbuf. + * Second argument is non-zero to intercept, 0 to restore. + * On freebsd we just intercept if_transmit. + */ +void +netmap_catch_tx(struct netmap_generic_adapter *gna, int enable) +{ + struct netmap_adapter *na = &gna->up.up; + struct ifnet *ifp = na->ifp; + + if (enable) { + na->if_transmit = ifp->if_transmit; + ifp->if_transmit = netmap_transmit; + } else { + ifp->if_transmit = na->if_transmit; + } +} + + +/* + * Transmit routine used by generic_netmap_txsync(). Returns 0 on success + * and non-zero on error (which may be packet drops or other errors). + * addr and len identify the netmap buffer, m is the (preallocated) + * mbuf to use for transmissions. + * + * We should add a reference to the mbuf so the m_freem() at the end + * of the transmission does not consume resources. + * + * On FreeBSD, and on multiqueue cards, we can force the queue using + * if ((m->m_flags & M_FLOWID) != 0) + * i = m->m_pkthdr.flowid % adapter->num_queues; + * else + * i = curcpu % adapter->num_queues; + * + */ +int +generic_xmit_frame(struct ifnet *ifp, struct mbuf *m, + void *addr, u_int len, u_int ring_nr) +{ + int ret; + + m->m_len = m->m_pkthdr.len = 0; + + // copy data to the mbuf + m_copyback(m, 0, len, addr); + // inc refcount. We are alone, so we can skip the atomic + atomic_fetchadd_int(m->m_ext.ref_cnt, 1); + m->m_flags |= M_FLOWID; + m->m_pkthdr.flowid = ring_nr; + m->m_pkthdr.rcvif = ifp; /* used for tx notification */ + ret = NA(ifp)->if_transmit(ifp, m); + return ret; +} + + +/* + * The following two functions are empty until we have a generic + * way to extract the info from the ifp + */ +int +generic_find_num_desc(struct ifnet *ifp, unsigned int *tx, unsigned int *rx) +{ + D("called"); + return 0; +} + + +void +generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq) +{ + D("called"); + *txq = netmap_generic_rings; + *rxq = netmap_generic_rings; +} + + +void netmap_mitigation_init(struct nm_generic_mit *mit, struct netmap_adapter *na) +{ + ND("called"); + mit->mit_pending = 0; + mit->mit_na = na; +} + + +void netmap_mitigation_start(struct nm_generic_mit *mit) +{ + ND("called"); +} + + +void netmap_mitigation_restart(struct nm_generic_mit *mit) +{ + ND("called"); +} + + +int netmap_mitigation_active(struct nm_generic_mit *mit) +{ + ND("called"); + return 0; +} + + +void netmap_mitigation_cleanup(struct nm_generic_mit *mit) +{ + ND("called"); +} + + +/* + * In order to track whether pages are still mapped, we hook into + * the standard cdev_pager and intercept the constructor and + * destructor. + */ + +struct netmap_vm_handle_t { + struct cdev *dev; + struct netmap_priv_d *priv; +}; + + +static int +netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + struct netmap_vm_handle_t *vmh = handle; + + if (netmap_verbose) + D("handle %p size %jd prot %d foff %jd", + handle, (intmax_t)size, prot, (intmax_t)foff); + dev_ref(vmh->dev); + return 0; +} + + +static void +netmap_dev_pager_dtor(void *handle) +{ + struct netmap_vm_handle_t *vmh = handle; + struct cdev *dev = vmh->dev; + struct netmap_priv_d *priv = vmh->priv; + + if (netmap_verbose) + D("handle %p", handle); + netmap_dtor(priv); + free(vmh, M_DEVBUF); + dev_rel(dev); +} + + +static int +netmap_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, + int prot, vm_page_t *mres) +{ + struct netmap_vm_handle_t *vmh = object->handle; + struct netmap_priv_d *priv = vmh->priv; + vm_paddr_t paddr; + vm_page_t page; + vm_memattr_t memattr; + vm_pindex_t pidx; + + ND("object %p offset %jd prot %d mres %p", + object, (intmax_t)offset, prot, mres); + memattr = object->memattr; + pidx = OFF_TO_IDX(offset); + paddr = netmap_mem_ofstophys(priv->np_mref, offset); + if (paddr == 0) + return VM_PAGER_FAIL; + + if (((*mres)->flags & PG_FICTITIOUS) != 0) { + /* + * If the passed in result page is a fake page, update it with + * the new physical address. + */ + page = *mres; + vm_page_updatefake(page, paddr, memattr); + } else { + /* + * Replace the passed in reqpage page with our own fake page and + * free up the all of the original pages. + */ +#ifndef VM_OBJECT_WUNLOCK /* FreeBSD < 10.x */ +#define VM_OBJECT_WUNLOCK VM_OBJECT_UNLOCK +#define VM_OBJECT_WLOCK VM_OBJECT_LOCK +#endif /* VM_OBJECT_WUNLOCK */ + + VM_OBJECT_WUNLOCK(object); + page = vm_page_getfake(paddr, memattr); + VM_OBJECT_WLOCK(object); + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); + *mres = page; + vm_page_insert(page, object, pidx); + } + page->valid = VM_PAGE_BITS_ALL; + return (VM_PAGER_OK); +} + + +static struct cdev_pager_ops netmap_cdev_pager_ops = { + .cdev_pg_ctor = netmap_dev_pager_ctor, + .cdev_pg_dtor = netmap_dev_pager_dtor, + .cdev_pg_fault = netmap_dev_pager_fault, +}; + + +static int +netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, + vm_size_t objsize, vm_object_t *objp, int prot) +{ + int error; + struct netmap_vm_handle_t *vmh; + struct netmap_priv_d *priv; + vm_object_t obj; + + if (netmap_verbose) + D("cdev %p foff %jd size %jd objp %p prot %d", cdev, + (intmax_t )*foff, (intmax_t )objsize, objp, prot); + + vmh = malloc(sizeof(struct netmap_vm_handle_t), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (vmh == NULL) + return ENOMEM; + vmh->dev = cdev; + + NMG_LOCK(); + error = devfs_get_cdevpriv((void**)&priv); + if (error) + goto err_unlock; + vmh->priv = priv; + priv->np_refcount++; + NMG_UNLOCK(); + + error = netmap_get_memory(priv); + if (error) + goto err_deref; + + obj = cdev_pager_allocate(vmh, OBJT_DEVICE, + &netmap_cdev_pager_ops, objsize, prot, + *foff, NULL); + if (obj == NULL) { + D("cdev_pager_allocate failed"); + error = EINVAL; + goto err_deref; + } + + *objp = obj; + return 0; + +err_deref: + NMG_LOCK(); + priv->np_refcount--; +err_unlock: + NMG_UNLOCK(); +// err: + free(vmh, M_DEVBUF); + return error; +} + + +// XXX can we remove this ? +static int +netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + if (netmap_verbose) + D("dev %p fflag 0x%x devtype %d td %p", + dev, fflag, devtype, td); + return 0; +} + + +static int +netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct netmap_priv_d *priv; + int error; + + (void)dev; + (void)oflags; + (void)devtype; + (void)td; + + // XXX wait or nowait ? + priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (priv == NULL) + return ENOMEM; + + error = devfs_set_cdevpriv(priv, netmap_dtor); + if (error) + return error; + + priv->np_refcount = 1; + + return 0; +} + +/******************** kqueue support ****************/ + +/* + * The OS_selwakeup also needs to issue a KNOTE_UNLOCKED. + * We use a non-zero argument to distinguish the call from the one + * in kevent_scan() which instead also needs to run netmap_poll(). + * The knote uses a global mutex for the time being. We might + * try to reuse the one in the si, but it is not allocated + * permanently so it might be a bit tricky. + * + * The *kqfilter function registers one or another f_event + * depending on read or write mode. + * In the call to f_event() td_fpop is NULL so any child function + * calling devfs_get_cdevpriv() would fail - and we need it in + * netmap_poll(). As a workaround we store priv into kn->kn_hook + * and pass it as first argument to netmap_poll(), which then + * uses the failure to tell that we are called from f_event() + * and do not need the selrecord(). + */ + +void freebsd_selwakeup(struct selinfo *si, int pri); + +void +freebsd_selwakeup(struct selinfo *si, int pri) +{ + if (netmap_verbose) + D("on knote %p", &si->si_note); + selwakeuppri(si, pri); + /* use a non-zero hint to tell the notification from the + * call done in kqueue_scan() which uses 0 + */ + KNOTE_UNLOCKED(&si->si_note, 0x100 /* notification */); +} + +static void +netmap_knrdetach(struct knote *kn) +{ + struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; + struct selinfo *si = priv->np_rxsi; + + D("remove selinfo %p", si); + knlist_remove(&si->si_note, kn, 0); +} + +static void +netmap_knwdetach(struct knote *kn) +{ + struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; + struct selinfo *si = priv->np_txsi; + + D("remove selinfo %p", si); + knlist_remove(&si->si_note, kn, 0); +} + +/* + * callback from notifies (generated externally) and our + * calls to kevent(). The former we just return 1 (ready) + * since we do not know better. + * In the latter we call netmap_poll and return 0/1 accordingly. + */ +static int +netmap_knrw(struct knote *kn, long hint, int events) +{ + struct netmap_priv_d *priv; + int revents; + + if (hint != 0) { + ND(5, "call from notify"); + return 1; /* assume we are ready */ + } + priv = kn->kn_hook; + /* the notification may come from an external thread, + * in which case we do not want to run the netmap_poll + * This should be filtered above, but check just in case. + */ + if (curthread != priv->np_td) { /* should not happen */ + RD(5, "curthread changed %p %p", curthread, priv->np_td); + return 1; + } else { + revents = netmap_poll((void *)priv, events, curthread); + return (events & revents) ? 1 : 0; + } +} + +static int +netmap_knread(struct knote *kn, long hint) +{ + return netmap_knrw(kn, hint, POLLIN); +} + +static int +netmap_knwrite(struct knote *kn, long hint) +{ + return netmap_knrw(kn, hint, POLLOUT); +} + +static struct filterops netmap_rfiltops = { + .f_isfd = 1, + .f_detach = netmap_knrdetach, + .f_event = netmap_knread, +}; + +static struct filterops netmap_wfiltops = { + .f_isfd = 1, + .f_detach = netmap_knwdetach, + .f_event = netmap_knwrite, +}; + + +/* + * This is called when a thread invokes kevent() to record + * a change in the configuration of the kqueue(). + * The 'priv' should be the same as in the netmap device. + */ +static int +netmap_kqfilter(struct cdev *dev, struct knote *kn) +{ + struct netmap_priv_d *priv; + int error; + struct netmap_adapter *na; + struct selinfo *si; + int ev = kn->kn_filter; + + if (ev != EVFILT_READ && ev != EVFILT_WRITE) { + D("bad filter request %d", ev); + return 1; + } + error = devfs_get_cdevpriv((void**)&priv); + if (error) { + D("device not yet setup"); + return 1; + } + na = priv->np_na; + if (na == NULL) { + D("no netmap adapter for this file descriptor"); + return 1; + } + /* the si is indicated in the priv */ + si = (ev == EVFILT_WRITE) ? priv->np_txsi : priv->np_rxsi; + // XXX lock(priv) ? + kn->kn_fop = (ev == EVFILT_WRITE) ? + &netmap_wfiltops : &netmap_rfiltops; + kn->kn_hook = priv; + knlist_add(&si->si_note, kn, 1); + // XXX unlock(priv) + ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", + na, na->ifp->if_xname, curthread, priv, kn, + priv->np_nifp, + kn->kn_fp == curthread->td_fpop ? "match" : "MISMATCH"); + return 0; +} + +struct cdevsw netmap_cdevsw = { + .d_version = D_VERSION, + .d_name = "netmap", + .d_open = netmap_open, + .d_mmap_single = netmap_mmap_single, + .d_ioctl = netmap_ioctl, + .d_poll = netmap_poll, + .d_kqfilter = netmap_kqfilter, + .d_close = netmap_close, +}; +/*--- end of kqueue support ----*/ + +/* + * Kernel entry point. + * + * Initialize/finalize the module and return. + * + * Return 0 on success, errno on failure. + */ +static int +netmap_loader(__unused struct module *module, int event, __unused void *arg) +{ + int error = 0; + + switch (event) { + case MOD_LOAD: + error = netmap_init(); + break; + + case MOD_UNLOAD: + netmap_fini(); + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + + +DEV_MODULE(netmap, netmap_loader, NULL); Added: stable/10/sys/dev/netmap/netmap_generic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/netmap/netmap_generic.c Tue Feb 18 05:46:19 2014 (r262152) @@ -0,0 +1,806 @@ +/* + * Copyright (C) 2013-2014 Universita` di Pisa. 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. + */ + +/* + * This module implements netmap support on top of standard, + * unmodified device drivers. + * + * A NIOCREGIF request is handled here if the device does not + * have native support. TX and RX rings are emulated as follows: + * + * NIOCREGIF + * We preallocate a block of TX mbufs (roughly as many as + * tx descriptors; the number is not critical) to speed up + * operation during transmissions. The refcount on most of + * these buffers is artificially bumped up so we can recycle + * them more easily. Also, the destructor is intercepted + * so we use it as an interrupt notification to wake up + * processes blocked on a poll(). + * + * For each receive ring we allocate one "struct mbq" + * (an mbuf tailq plus a spinlock). We intercept packets + * (through if_input) + * on the receive path and put them in the mbq from which + * netmap receive routines can grab them. + * + * TX: + * in the generic_txsync() routine, netmap buffers are copied + * (or linked, in a future) to the preallocated mbufs + * and pushed to the transmit queue. Some of these mbufs + * (those with NS_REPORT, or otherwise every half ring) + * have the refcount=1, others have refcount=2. + * When the destructor is invoked, we take that as + * a notification that all mbufs up to that one in + * the specific ring have been completed, and generate + * the equivalent of a transmit interrupt. + * + * RX: + * + */ + +#ifdef __FreeBSD__ + +#include /* prerequisite */ +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include /* PROT_EXEC */ +#include +#include /* sockaddrs */ +#include +#include +#include +#include /* bus_dmamap_* in netmap_kern.h */ + +// XXX temporary - D() defined here +#include +#include +#include + +#define rtnl_lock() D("rtnl_lock called"); +#define rtnl_unlock() D("rtnl_unlock called"); +#define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) +#define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) +#define smp_mb() + +/* + * mbuf wrappers + */ + +/* + * we allocate an EXT_PACKET + */ +#define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE) + +/* mbuf destructor, also need to change the type to EXT_EXTREF, + * add an M_NOFREE flag, and then clear the flag and + * chain into uma_zfree(zone_pack, mf) + * (or reinstall the buffer ?) + */ +#define SET_MBUF_DESTRUCTOR(m, fn) do { \ + (m)->m_ext.ext_free = (void *)fn; \ + (m)->m_ext.ext_type = EXT_EXTREF; \ +} while (0) + + +#define GET_MBUF_REFCNT(m) ((m)->m_ext.ref_cnt ? *(m)->m_ext.ref_cnt : -1) + + + +#else /* linux */ + +#include "bsd_glue.h" + +#include /* rtnl_[un]lock() */ +#include /* struct ethtool_ops, get_ringparam */ +#include + +//#define RATE /* Enables communication statistics. */ + +//#define REG_RESET + +#endif /* linux */ + + +/* Common headers. */ +#include +#include +#include + + + +/* ======================== usage stats =========================== */ + +#ifdef RATE +#define IFRATE(x) x +struct rate_stats { + unsigned long txpkt; + unsigned long txsync; + unsigned long txirq; + unsigned long rxpkt; + unsigned long rxirq; + unsigned long rxsync; +}; + +struct rate_context { + unsigned refcount; + struct timer_list timer; + struct rate_stats new; + struct rate_stats old; +}; + +#define RATE_PRINTK(_NAME_) \ + printk( #_NAME_ " = %lu Hz\n", (cur._NAME_ - ctx->old._NAME_)/RATE_PERIOD); +#define RATE_PERIOD 2 +static void rate_callback(unsigned long arg) +{ + struct rate_context * ctx = (struct rate_context *)arg; + struct rate_stats cur = ctx->new; + int r; + + RATE_PRINTK(txpkt); + RATE_PRINTK(txsync); + RATE_PRINTK(txirq); + RATE_PRINTK(rxpkt); + RATE_PRINTK(rxsync); + RATE_PRINTK(rxirq); + printk("\n"); + + ctx->old = cur; + r = mod_timer(&ctx->timer, jiffies + + msecs_to_jiffies(RATE_PERIOD * 1000)); + if (unlikely(r)) + D("[v1000] Error: mod_timer()"); +} + +static struct rate_context rate_ctx; + +#else /* !RATE */ +#define IFRATE(x) +#endif /* !RATE */ + + +/* =============== GENERIC NETMAP ADAPTER SUPPORT ================= */ +#define GENERIC_BUF_SIZE netmap_buf_size /* Size of the mbufs in the Tx pool. */ + +/* + * Wrapper used by the generic adapter layer to notify + * the poller threads. Differently from netmap_rx_irq(), we check + * only IFCAP_NETMAP instead of NAF_NATIVE_ON to enable the irq. + */ +static void +netmap_generic_irq(struct ifnet *ifp, u_int q, u_int *work_done) +{ + if (unlikely(!(ifp->if_capenable & IFCAP_NETMAP))) + return; + + netmap_common_irq(ifp, q, work_done); +} + + +/* Enable/disable netmap mode for a generic network interface. */ +static int +generic_netmap_register(struct netmap_adapter *na, int enable) +{ + struct ifnet *ifp = na->ifp; + struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; + struct mbuf *m; + int error; + int i, r; + + if (!na) + return EINVAL; + +#ifdef REG_RESET + error = ifp->netdev_ops->ndo_stop(ifp); + if (error) { + return error; + } +#endif /* REG_RESET */ + + if (enable) { /* Enable netmap mode. */ + /* Init the mitigation support. */ + gna->mit = malloc(na->num_rx_rings * sizeof(struct nm_generic_mit), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!gna->mit) { + D("mitigation allocation failed"); + error = ENOMEM; + goto out; + } + for (r=0; rnum_rx_rings; r++) + netmap_mitigation_init(&gna->mit[r], na); + + /* Initialize the rx queue, as generic_rx_handler() can + * be called as soon as netmap_catch_rx() returns. + */ + for (r=0; rnum_rx_rings; r++) { + mbq_safe_init(&na->rx_rings[r].rx_queue); + } + + /* + * Preallocate packet buffers for the tx rings. + */ + for (r=0; rnum_tx_rings; r++) + na->tx_rings[r].tx_pool = NULL; + for (r=0; rnum_tx_rings; r++) { + na->tx_rings[r].tx_pool = malloc(na->num_tx_desc * sizeof(struct mbuf *), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!na->tx_rings[r].tx_pool) { + D("tx_pool allocation failed"); + error = ENOMEM; + goto free_tx_pools; + } + for (i=0; inum_tx_desc; i++) + na->tx_rings[r].tx_pool[i] = NULL; + for (i=0; inum_tx_desc; i++) { + m = netmap_get_mbuf(GENERIC_BUF_SIZE); + if (!m) { + D("tx_pool[%d] allocation failed", i); + error = ENOMEM; + goto free_tx_pools; + } + na->tx_rings[r].tx_pool[i] = m; + } + } + rtnl_lock(); + /* Prepare to intercept incoming traffic. */ + error = netmap_catch_rx(na, 1); + if (error) { + D("netdev_rx_handler_register() failed (%d)", error); + goto register_handler; + } + ifp->if_capenable |= IFCAP_NETMAP; + + /* Make netmap control the packet steering. */ + netmap_catch_tx(gna, 1); + + rtnl_unlock(); + +#ifdef RATE + if (rate_ctx.refcount == 0) { + D("setup_timer()"); + memset(&rate_ctx, 0, sizeof(rate_ctx)); + setup_timer(&rate_ctx.timer, &rate_callback, (unsigned long)&rate_ctx); + if (mod_timer(&rate_ctx.timer, jiffies + msecs_to_jiffies(1500))) { + D("Error: mod_timer()"); + } + } + rate_ctx.refcount++; +#endif /* RATE */ + + } else if (na->tx_rings[0].tx_pool) { + /* Disable netmap mode. We enter here only if the previous + generic_netmap_register(na, 1) was successfull. + If it was not, na->tx_rings[0].tx_pool was set to NULL by the + error handling code below. */ + rtnl_lock(); + + ifp->if_capenable &= ~IFCAP_NETMAP; + + /* Release packet steering control. */ + netmap_catch_tx(gna, 0); + + /* Do not intercept packets on the rx path. */ + netmap_catch_rx(na, 0); + + rtnl_unlock(); + + /* Free the mbufs going to the netmap rings */ + for (r=0; rnum_rx_rings; r++) { + mbq_safe_purge(&na->rx_rings[r].rx_queue); + mbq_safe_destroy(&na->rx_rings[r].rx_queue); + } + + for (r=0; rnum_rx_rings; r++) + netmap_mitigation_cleanup(&gna->mit[r]); + free(gna->mit, M_DEVBUF); + + for (r=0; rnum_tx_rings; r++) { + for (i=0; inum_tx_desc; i++) { + m_freem(na->tx_rings[r].tx_pool[i]); + } + free(na->tx_rings[r].tx_pool, M_DEVBUF); + } + +#ifdef RATE + if (--rate_ctx.refcount == 0) { + D("del_timer()"); + del_timer(&rate_ctx.timer); + } +#endif + } + +#ifdef REG_RESET + error = ifp->netdev_ops->ndo_open(ifp); + if (error) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 05:58:36 2014 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 ESMTPS id DEF1DB06; Tue, 18 Feb 2014 05:58:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C54DC1FA6; Tue, 18 Feb 2014 05:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I5waso060273; Tue, 18 Feb 2014 05:58:36 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I5wa0f060271; Tue, 18 Feb 2014 05:58:36 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180558.s1I5wa0f060271@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 05:58:36 +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: r262153 - in stable/9: share/man/man4 sys/conf sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 05:58:37 -0000 Author: luigi Date: Tue Feb 18 05:58:36 2014 New Revision: 262153 URL: http://svnweb.freebsd.org/changeset/base/262153 Log: MFH: sync the netmap code with the one in HEAD (enhanced VALE switch, netmap pipes, emulated netmap mode). See details in the log for svn 261909. Added: stable/9/sys/dev/netmap/netmap_freebsd.c (contents, props changed) stable/9/sys/dev/netmap/netmap_generic.c (contents, props changed) stable/9/sys/dev/netmap/netmap_mbq.c (contents, props changed) stable/9/sys/dev/netmap/netmap_mbq.h (contents, props changed) stable/9/sys/dev/netmap/netmap_offloadings.c (contents, props changed) stable/9/sys/dev/netmap/netmap_pipe.c (contents, props changed) stable/9/sys/dev/netmap/netmap_vale.c (contents, props changed) stable/9/sys/modules/netmap/Makefile (contents, props changed) Replaced: stable/9/sys/dev/netmap/netmap_mem2.h (contents, props changed) stable/9/sys/modules/netmap/ Deleted: stable/9/tools/tools/netmap/click-test.cfg stable/9/tools/tools/netmap/nm_util.c stable/9/tools/tools/netmap/nm_util.h stable/9/tools/tools/netmap/pcap.c Modified: stable/9/share/man/man4/netmap.4 stable/9/sys/conf/files stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/netmap/if_em_netmap.h stable/9/sys/dev/netmap/if_igb_netmap.h stable/9/sys/dev/netmap/if_lem_netmap.h stable/9/sys/dev/netmap/if_re_netmap.h stable/9/sys/dev/netmap/ixgbe_netmap.h stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h stable/9/sys/dev/netmap/netmap_mem2.c stable/9/sys/net/netmap.h stable/9/sys/net/netmap_user.h stable/9/tools/tools/netmap/Makefile stable/9/tools/tools/netmap/README stable/9/tools/tools/netmap/bridge.c stable/9/tools/tools/netmap/pkt-gen.c stable/9/tools/tools/netmap/vale-ctl.c Modified: stable/9/share/man/man4/netmap.4 ============================================================================== --- stable/9/share/man/man4/netmap.4 Tue Feb 18 05:46:19 2014 (r262152) +++ stable/9/share/man/man4/netmap.4 Tue Feb 18 05:58:36 2014 (r262153) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa +.\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,219 +26,631 @@ .\" distributed with 4.3BSD Unix. .\" .\" $FreeBSD$ -.\" $Id: netmap.4 9662 2011-11-16 13:18:06Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ .\" -.Dd November 16, 2011 +.Dd February 13, 2014 .Dt NETMAP 4 .Os .Sh NAME .Nm netmap .Nd a framework for fast packet I/O +.br +.Nm VALE +.Nd a fast VirtuAl Local Ethernet using the netmap API +.br +.Nm netmap pipes +.Nd a shared memory packet transport channel .Sh SYNOPSIS .Cd device netmap .Sh DESCRIPTION .Nm -is a framework for fast and safe access to network devices -(reaching 14.88 Mpps at less than 1 GHz). +is a framework for extremely fast and efficient packet I/O +for both userspace and kernel clients. +It runs on FreeBSD and Linux, +and includes +.Nm VALE , +a very fast and modular in-kernel software switch/dataplane, +and +.Nm netmap pipes , +a shared memory packet transport channel. +All these are accessed interchangeably with the same API. +.Pp +.Nm , VALE +and +.Nm netmap pipes +are at least one order of magnitude faster than +standard OS mechanisms +(sockets, bpf, tun/tap interfaces, native switches, pipes), +reaching 14.88 million packets per second (Mpps) +with much less than one core on a 10 Gbit NIC, +about 20 Mpps per core for VALE ports, +and over 100 Mpps for netmap pipes. +.Pp +Userspace clients can dynamically switch NICs into +.Nm +mode and send and receive raw packets through +memory mapped buffers. +Similarly, +.Nm VALE +switch instances and ports, and +.Nm netmap pipes +can be created dynamically, +providing high speed packet I/O between processes, +virtual machines, NICs and the host stack. +.Pp .Nm -uses memory mapped buffers and metadata -(buffer indexes and lengths) to communicate with the kernel, -which is in charge of validating information through -.Pa ioctl() +suports both non-blocking I/O through +.Xr ioctls() , +synchronization and blocking I/O through a file descriptor +and standard OS mechanisms such as +.Xr select 2 , +.Xr poll 2 , +.Xr epoll 2 , +.Xr kqueue 2 . +.Nm VALE and -.Pa select()/poll() . +.Nm netmap pipes +are implemented by a single kernel module, which also emulates the +.Nm +API over standard drivers for devices without native +.Nm +support. +For best performance, +.Nm +requires explicit support in device drivers. +.Pp +In the rest of this (long) manual page we document +various aspects of the .Nm -can exploit the parallelism in multiqueue devices and -multicore systems. +and +.Nm VALE +architecture, features and usage. .Pp +.Sh ARCHITECTURE +.Nm +supports raw packet I/O through a +.Em port , +which can be connected to a physical interface +.Em ( NIC ) , +to the host stack, +or to a +.Nm VALE +switch). +Ports use preallocated circular queues of buffers +.Em ( rings ) +residing in an mmapped region. +There is one ring for each transmit/receive queue of a +NIC or virtual port. +An additional ring pair connects to the host stack. .Pp +After binding a file descriptor to a port, a .Nm -requires explicit support in device drivers. -For a list of supported devices, see the end of this manual page. -.Sh OPERATION +client can send or receive packets in batches through +the rings, and possibly implement zero-copy forwarding +between ports. +.Pp +All NICs operating in .Nm -clients must first open the -.Pa open("/dev/netmap") , -and then issue an -.Pa ioctl(...,NIOCREGIF,...) -to bind the file descriptor to a network device. -.Pp -When a device is put in -.Nm -mode, its data path is disconnected from the host stack. -The processes owning the file descriptor -can exchange packets with the device, or with the host stack, -through an mmapped memory region that contains pre-allocated -buffers and metadata. +mode use the same memory region, +accessible to all processes who own +.Nm /dev/netmap +file descriptors bound to NICs. +Independent +.Nm VALE +and +.Nm netmap pipe +ports +by default use separate memory regions, +but can be independently configured to share memory. +.Pp +.Sh ENTERING AND EXITING NETMAP MODE +The following section describes the system calls to create +and control +.Nm netmap +ports (including +.Nm VALE +and +.Nm netmap pipe +ports). +Simpler, higher level functions are described in section +.Xr LIBRARIES . +.Pp +Ports and rings are created and controlled through a file descriptor, +created by opening a special device +.Dl fd = open("/dev/netmap"); +and then bound to a specific port with an +.Dl ioctl(fd, NIOCREGIF, (struct nmreq *)arg); +.Pp +.Nm +has multiple modes of operation controlled by the +.Vt struct nmreq +argument. +.Va arg.nr_name +specifies the port name, as follows: +.Bl -tag -width XXXX +.It Dv OS network interface name (e.g. 'em0', 'eth1', ... ) +the data path of the NIC is disconnected from the host stack, +and the file descriptor is bound to the NIC (one or all queues), +or to the host stack; +.It Dv valeXXX:YYY (arbitrary XXX and YYY) +the file descriptor is bound to port YYY of a VALE switch called XXX, +both dynamically created if necessary. +The string cannot exceed IFNAMSIZ characters, and YYY cannot +be the name of any existing OS network interface. +.El +.Pp +On return, +.Va arg +indicates the size of the shared memory region, +and the number, size and location of all the +.Nm +data structures, which can be accessed by mmapping the memory +.Dl char *mem = mmap(0, arg.nr_memsize, fd); .Pp Non blocking I/O is done with special -.Pa ioctl()'s , -whereas the file descriptor can be passed to -.Pa select()/poll() -to be notified about incoming packet or available transmit buffers. -.Ss Data structures -All data structures for all devices in -.Nm -mode are in a memory -region shared by the kernel and all processes -who open -.Pa /dev/netmap -(NOTE: visibility may be restricted in future implementations). -All references between the shared data structure -are relative (offsets or indexes). Some macros help converting -them into actual pointers. +.Xr ioctl 2 +.Xr select 2 +and +.Xr poll 2 +on the file descriptor permit blocking I/O. +.Xr epoll 2 +and +.Xr kqueue 2 +are not supported on +.Nm +file descriptors. .Pp -The data structures in shared memory are the following: +While a NIC is in +.Nm +mode, the OS will still believe the interface is up and running. +OS-generated packets for that NIC end up into a +.Nm +ring, and another ring is used to send packets into the OS network stack. +A +.Xr close 2 +on the file descriptor removes the binding, +and returns the NIC to normal mode (reconnecting the data path +to the host stack), or destroys the virtual port. .Pp +.Sh DATA STRUCTURES +The data structures in the mmapped memory region are detailed in +.Xr sys/net/netmap.h , +which is the ultimate reference for the +.Nm +API. The main structures and fields are indicated below: .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) -indicates the number of rings supported by an interface, their -sizes, and the offsets of the -.Pa netmap_rings -associated to the interface. -The offset of a -.Pa struct netmap_if -in the shared memory region is indicated by the -.Pa nr_offset -field in the structure returned by the -.Pa NIOCREGIF -(see below). .Bd -literal struct netmap_if { - char ni_name[IFNAMSIZ]; /* name of the interface. */ - const u_int ni_num_queues; /* number of hw ring pairs */ - const ssize_t ring_ofs[]; /* offset of tx and rx rings */ + ... + const uint32_t ni_flags; /* properties */ + ... + const uint32_t ni_tx_rings; /* NIC tx rings */ + const uint32_t ni_rx_rings; /* NIC rx rings */ + uint32_t ni_bufs_head; /* head of extra bufs list */ + ... }; .Ed +.Pp +Indicates the number of available rings +.Pa ( struct netmap_rings ) +and their position in the mmapped region. +The number of tx and rx rings +.Pa ( ni_tx_rings , ni_rx_rings ) +normally depends on the hardware. +NICs also have an extra tx/rx ring pair connected to the host stack. +.Em NIOCREGIF +can also request additional unbound buffers in the same memory space, +to be used as temporary storage for packets. +.Pa ni_bufs_head +contains the index of the first of these free rings, +which are connected in a list (the first uint32_t of each +buffer being the index of the next buffer in the list). +A 0 indicates the end of the list. +.Pp .It Dv struct netmap_ring (one per ring) -contains the index of the current read or write slot (cur), -the number of slots available for reception or transmission (avail), -and an array of -.Pa slots -describing the buffers. -There is one ring pair for each of the N hardware ring pairs -supported by the card (numbered 0..N-1), plus -one ring pair (numbered N) for packets from/to the host stack. .Bd -literal struct netmap_ring { - const ssize_t buf_ofs; - const uint32_t num_slots; /* number of slots in the ring. */ - uint32_t avail; /* number of usable slots */ - uint32_t cur; /* 'current' index for the user side */ - - const uint16_t nr_buf_size; - uint16_t flags; - struct netmap_slot slot[0]; /* array of slots. */ + ... + const uint32_t num_slots; /* slots in each ring */ + const uint32_t nr_buf_size; /* size of each buffer */ + ... + uint32_t head; /* (u) first buf owned by user */ + uint32_t cur; /* (u) wakeup position */ + const uint32_t tail; /* (k) first buf owned by kernel */ + ... + uint32_t flags; + struct timeval ts; /* (k) time of last rxsync() */ + ... + struct netmap_slot slot[0]; /* array of slots */ } .Ed -.It Dv struct netmap_slot (one per packet) -contains the metadata for a packet: a buffer index (buf_idx), -a buffer length (len), and some flags. +.Pp +Implements transmit and receive rings, with read/write +pointers, metadata and and an array of +.Pa slots +describing the buffers. +.Pp +.It Dv struct netmap_slot (one per buffer) .Bd -literal struct netmap_slot { - uint32_t buf_idx; /* buffer index */ - uint16_t len; /* packet length */ - uint16_t flags; /* buf changed, etc. */ -#define NS_BUF_CHANGED 0x0001 /* must resync, buffer changed */ -#define NS_REPORT 0x0002 /* tell hw to report results - * e.g. by generating an interrupt - */ + uint32_t buf_idx; /* buffer index */ + uint16_t len; /* packet length */ + uint16_t flags; /* buf changed, etc. */ + uint64_t ptr; /* address for indirect buffers */ }; .Ed +.Pp +Describes a packet buffer, which normally is identified by +an index and resides in the mmapped region. .It Dv packet buffers -are fixed size (approximately 2k) buffers allocated by the kernel -that contain packet data. Buffers addresses are computed through -macros. +Fixed size (normally 2 KB) packet buffers allocated by the kernel. .El .Pp -Some macros support the access to objects in the shared memory -region. In particular: +The offset of the +.Pa struct netmap_if +in the mmapped region is indicated by the +.Pa nr_offset +field in the structure returned by +.Pa NIOCREGIF . +From there, all other objects are reachable through +relative references (offsets or indexes). +Macros and functions in +help converting them into actual pointers: +.Pp +.Dl struct netmap_if *nifp = NETMAP_IF(mem, arg.nr_offset); +.Dl struct netmap_ring *txr = NETMAP_TXRING(nifp, ring_index); +.Dl struct netmap_ring *rxr = NETMAP_RXRING(nifp, ring_index); +.Pp +.Dl char *buf = NETMAP_BUF(ring, buffer_index); +.Sh RINGS, BUFFERS AND DATA I/O +.Va Rings +are circular queues of packets with three indexes/pointers +.Va ( head , cur , tail ) ; +one slot is always kept empty. +The ring size +.Va ( num_slots ) +should not be assumed to be a power of two. +.br +(NOTE: older versions of netmap used head/count format to indicate +the content of a ring). +.Pp +.Va head +is the first slot available to userspace; +.br +.Va cur +is the wakeup point: +select/poll will unblock when +.Va tail +passes +.Va cur ; +.br +.Va tail +is the first slot reserved to the kernel. +.Pp +Slot indexes MUST only move forward; +for convenience, the function +.Dl nm_ring_next(ring, index) +returns the next index modulo the ring size. +.Pp +.Va head +and +.Va cur +are only modified by the user program; +.Va tail +is only modified by the kernel. +The kernel only reads/writes the +.Vt struct netmap_ring +slots and buffers +during the execution of a netmap-related system call. +The only exception are slots (and buffers) in the range +.Va tail\ . . . head-1 , +that are explicitly assigned to the kernel. +.Pp +.Ss TRANSMIT RINGS +On transmit rings, after a +.Nm +system call, slots in the range +.Va head\ . . . tail-1 +are available for transmission. +User code should fill the slots sequentially +and advance +.Va head +and +.Va cur +past slots ready to transmit. +.Va cur +may be moved further ahead if the user code needs +more slots before further transmissions (see +.Sx SCATTER GATHER I/O ) . +.Pp +At the next NIOCTXSYNC/select()/poll(), +slots up to +.Va head-1 +are pushed to the port, and +.Va tail +may advance if further slots have become available. +Below is an example of the evolution of a TX ring: +.Pp .Bd -literal -struct netmap_if *nifp; -struct netmap_ring *txring = NETMAP_TXRING(nifp, i); -struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); -int i = txring->slot[txring->cur].buf_idx; -char *buf = NETMAP_BUF(txring, i); + after the syscall, slots between cur and tail are (a)vailable + head=cur tail + | | + v v + TX [.....aaaaaaaaaaa.............] + + user creates new packets to (T)ransmit + head=cur tail + | | + v v + TX [.....TTTTTaaaaaa.............] + + NIOCTXSYNC/poll()/select() sends packets and reports new slots + head=cur tail + | | + v v + TX [..........aaaaaaaaaaa........] .Ed -.Ss IOCTLS .Pp +select() and poll() wlll block if there is no space in the ring, i.e. +.Dl ring->cur == ring->tail +and return when new slots have become available. +.Pp +High speed applications may want to amortize the cost of system calls +by preparing as many packets as possible before issuing them. +.Pp +A transmit ring with pending transmissions has +.Dl ring->head != ring->tail + 1 (modulo the ring size). +The function +.Va int nm_tx_pending(ring) +implements this test. +.Pp +.Ss RECEIVE RINGS +On receive rings, after a +.Nm +system call, the slots in the range +.Va head\& . . . tail-1 +contain received packets. +User code should process them and advance +.Va head +and +.Va cur +past slots it wants to return to the kernel. +.Va cur +may be moved further ahead if the user code wants to +wait for more packets +without returning all the previous slots to the kernel. +.Pp +At the next NIOCRXSYNC/select()/poll(), +slots up to +.Va head-1 +are returned to the kernel for further receives, and +.Va tail +may advance to report new incoming packets. +.br +Below is an example of the evolution of an RX ring: +.Bd -literal + after the syscall, there are some (h)eld and some (R)eceived slots + head cur tail + | | | + v v v + RX [..hhhhhhRRRRRRRR..........] + + user advances head and cur, releasing some slots and holding others + head cur tail + | | | + v v v + RX [..*****hhhRRRRRR...........] + + NICRXSYNC/poll()/select() recovers slots and reports new packets + head cur tail + | | | + v v v + RX [.......hhhRRRRRRRRRRRR....] +.Ed +.Pp +.Sh SLOTS AND PACKET BUFFERS +Normally, packets should be stored in the netmap-allocated buffers +assigned to slots when ports are bound to a file descriptor. +One packet is fully contained in a single buffer. +.Pp +The following flags affect slot and buffer processing: +.Bl -tag -width XXX +.It NS_BUF_CHANGED +it MUST be used when the buf_idx in the slot is changed. +This can be used to implement +zero-copy forwarding, see +.Sx ZERO-COPY FORWARDING . +.Pp +.It NS_REPORT +reports when this buffer has been transmitted. +Normally, +.Nm +notifies transmit completions in batches, hence signals +can be delayed indefinitely. This flag helps detecting +when packets have been send and a file descriptor can be closed. +.It NS_FORWARD +When a ring is in 'transparent' mode (see +.Sx TRANSPARENT MODE ) , +packets marked with this flags are forwarded to the other endpoint +at the next system call, thus restoring (in a selective way) +the connection between a NIC and the host stack. +.It NS_NO_LEARN +tells the forwarding code that the SRC MAC address for this +packet must not be used in the learning bridge code. +.It NS_INDIRECT +indicates that the packet's payload is in a user-supplied buffer, +whose user virtual address is in the 'ptr' field of the slot. +The size can reach 65535 bytes. +.br +This is only supported on the transmit ring of +.Nm VALE +ports, and it helps reducing data copies in the interconnection +of virtual machines. +.It NS_MOREFRAG +indicates that the packet continues with subsequent buffers; +the last buffer in a packet must have the flag clear. +.El +.Sh SCATTER GATHER I/O +Packets can span multiple slots if the +.Va NS_MOREFRAG +flag is set in all but the last slot. +The maximum length of a chain is 64 buffers. +This is normally used with +.Nm VALE +ports when connecting virtual machines, as they generate large +TSO segments that are not split unless they reach a physical device. +.Pp +NOTE: The length field always refers to the individual +fragment; there is no place with the total length of a packet. +.Pp +On receive rings the macro +.Va NS_RFRAGS(slot) +indicates the remaining number of slots for this packet, +including the current one. +Slots with a value greater than 1 also have NS_MOREFRAG set. +.Sh IOCTLS .Nm -supports some ioctl() to synchronize the state of the rings -between the kernel and the user processes, plus some -to query and configure the interface. -The former do not require any argument, whereas the latter -use a -.Pa struct netmap_req -defined as follows: +uses two ioctls (NIOCTXSYNC, NIOCRXSYNC) +for non-blocking I/O. They take no argument. +Two more ioctls (NIOCGINFO, NIOCREGIF) are used +to query and configure ports, with the following argument: .Bd -literal struct nmreq { - char nr_name[IFNAMSIZ]; - uint32_t nr_offset; /* nifp offset in the shared region */ - uint32_t nr_memsize; /* size of the shared region */ - uint32_t nr_numdescs; /* descriptors per queue */ - uint16_t nr_numqueues; - uint16_t nr_ringid; /* ring(s) we care about */ -#define NETMAP_HW_RING 0x4000 /* low bits indicate one hw ring */ -#define NETMAP_SW_RING 0x2000 /* we process the sw ring */ -#define NETMAP_NO_TX_POLL 0x1000 /* no gratuitous txsync on poll */ -#define NETMAP_RING_MASK 0xfff /* the actual ring number */ + char nr_name[IFNAMSIZ]; /* (i) port name */ + uint32_t nr_version; /* (i) API version */ + uint32_t nr_offset; /* (o) nifp offset in mmap region */ + uint32_t nr_memsize; /* (o) size of the mmap region */ + uint32_t nr_tx_slots; /* (i/o) slots in tx rings */ + uint32_t nr_rx_slots; /* (i/o) slots in rx rings */ + uint16_t nr_tx_rings; /* (i/o) number of tx rings */ + uint16_t nr_rx_rings; /* (i/o) number of tx rings */ + uint16_t nr_ringid; /* (i/o) ring(s) we care about */ + uint16_t nr_cmd; /* (i) special command */ + uint16_t nr_arg1; /* (i/o) extra arguments */ + uint16_t nr_arg2; /* (i/o) extra arguments */ + uint32_t nr_arg3; /* (i/o) extra arguments */ + uint32_t nr_flags /* (i/o) open mode */ + ... }; - .Ed -A device descriptor obtained through +.Pp +A file descriptor obtained through .Pa /dev/netmap -also supports the ioctl supported by network devices. +also supports the ioctl supported by network devices, see +.Xr netintro 4 . .Pp -The netmap-specific -.Xr ioctl 2 -command codes below are defined in -.In net/netmap.h -and are: .Bl -tag -width XXXX .It Dv NIOCGINFO -returns information about the interface named in nr_name. -On return, nr_memsize indicates the size of the shared netmap -memory region (this is device-independent), -nr_numslots indicates how many buffers are in a ring, -nr_numrings indicates the number of rings supported by the hardware. +returns EINVAL if the named port does not support netmap. +Otherwise, it returns 0 and (advisory) information +about the port. +Note that all the information below can change before the +interface is actually put in netmap mode. .Pp -If the device does not support netmap, the ioctl returns EINVAL. +.Bl -tag -width XX +.It Pa nr_memsize +indicates the size of the +.Nm +memory region. NICs in +.Nm +mode all share the same memory region, +whereas +.Nm VALE +ports have independent regions for each port. +.It Pa nr_tx_slots , nr_rx_slots +indicate the size of transmit and receive rings. +.It Pa nr_tx_rings , nr_rx_rings +indicate the number of transmit +and receive rings. +Both ring number and sizes may be configured at runtime +using interface-specific functions (e.g. +.Xr ethtool +). +.El .It Dv NIOCREGIF -puts the interface named in nr_name into netmap mode, disconnecting -it from the host stack, and/or defines which rings are controlled -through this file descriptor. -On return, it gives the same info as NIOCGINFO, and nr_ringid -indicates the identity of the rings controlled through the file +binds the port named in +.Va nr_name +to the file descriptor. For a physical device this also switches it into +.Nm +mode, disconnecting +it from the host stack. +Multiple file descriptors can be bound to the same port, +with proper synchronization left to the user. +.Pp +.Dv NIOCREGIF can also bind a file descriptor to one endpoint of a +.Em netmap pipe , +consisting of two netmap ports with a crossover connection. +A netmap pipe share the same memory space of the parent port, +and is meant to enable configuration where a master process acts +as a dispatcher towards slave processes. +.Pp +To enable this function, the +.Pa nr_arg1 +field of the structure can be used as a hint to the kernel to +indicate how many pipes we expect to use, and reserve extra space +in the memory region. +.Pp +On return, it gives the same info as NIOCGINFO, +with +.Pa nr_ringid +and +.Pa nr_flags +indicating the identity of the rings controlled through the file descriptor. .Pp -Possible values for nr_ringid are +.Va nr_flags +.Va nr_ringid +selects which rings are controlled through this file descriptor. +Possible values of +.Pa nr_flags +are indicated below, together with the naming schemes +that application libraries (such as the +.Nm nm_open +indicated below) can use to indicate the specific set of rings. +In the example below, "netmap:foo" is any valid netmap port name. +.Pp .Bl -tag -width XXXXX -.It 0 -default, all hardware rings -.It NETMAP_SW_RING -the ``host rings'' connecting to the host stack -.It NETMAP_HW_RING + i -the i-th hardware ring +.It NR_REG_ALL_NIC "netmap:foo" +(default) all hardware ring pairs +.It NR_REG_SW_NIC "netmap:foo^" +the ``host rings'', connecting to the host stack. +.It NR_RING_NIC_SW "netmap:foo+ +all hardware rings and the host rings +.It NR_REG_ONE_NIC "netmap:foo-i" +only the i-th hardware ring pair, where the number is in +.Pa nr_ringid ; +.It NR_REG_PIPE_MASTER "netmap:foo{i" +the master side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid ; +.It NR_REG_PIPE_SLAVE "netmap:foo}i" +the slave side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid . +.Pp +The identifier of a pipe must be thought as part of the pipe name, +and does not need to be sequential. On return the pipe +will only have a single ring pair with index 0, +irrespective of the value of i. .El +.Pp By default, a -.Nm poll +.Xr poll 2 or -.Nm select +.Xr select 2 call pushes out any pending packets on the transmit ring, even if no write events are specified. The feature can be disabled by or-ing -.Nm NETMAP_NO_TX_SYNC -to nr_ringid. -But normally you should keep this feature unless you are using -separate file descriptors for the send and receive rings, because -otherwise packets are pushed out only if NETMAP_TXSYNC is called, -or the send queue is full. -.Pp -.Pa NIOCREGIF -can be used multiple times to change the association of a -file descriptor to a ring pair, always within the same device. -.It Dv NIOCUNREGIF -brings an interface back to normal mode. +.Va NETMAP_NO_TX_SYNC +to the value written to +.Va nr_ringid. +When this feature is used, +packets are transmitted only on +.Va ioctl(NIOCTXSYNC) +or select()/poll() are called with a write event (POLLOUT/wfdset) or a full ring. +.Pp +When registering a virtual interface that is dynamically created to a +.Xr vale 4 +switch, we can specify the desired number of rings (1 by default, +and currently up to 16) on it using nr_tx_rings and nr_rx_rings fields. .It Dv NIOCTXSYNC tells the hardware of new packets to transmit, and updates the number of slots available for transmission. @@ -246,54 +658,418 @@ number of slots available for transmissi tells the hardware of consumed packets, and asks for newly available packets. .El -.Ss SYSTEM CALLS +.Sh SELECT, POLL, EPOLL, KQUEUE. +.Xr select 2 +and +.Xr poll 2 +on a +.Nm +file descriptor process rings as indicated in +.Sx TRANSMIT RINGS +and +.Sx RECEIVE RINGS , +respectively when write (POLLOUT) and read (POLLIN) events are requested. +Both block if no slots are available in the ring +.Va ( ring->cur == ring->tail ) . +Depending on the platform, +.Xr epoll 2 +and +.Xr kqueue 2 +are supported too. +.Pp +Packets in transmit rings are normally pushed out +(and buffers reclaimed) even without +requesting write events. Passing the NETMAP_NO_TX_SYNC flag to +.Em NIOCREGIF +disables this feature. +By default, receive rings are processed only if read +events are requested. Passing the NETMAP_DO_RX_SYNC flag to +.Em NIOCREGIF updates receive rings even without read events. +Note that on epoll and kqueue, NETMAP_NO_TX_SYNC and NETMAP_DO_RX_SYNC +only have an effect when some event is posted for the file descriptor. +.Sh LIBRARIES +The +.Nm +API is supposed to be used directly, both because of its simplicity and +for efficient integration with applications. +.Pp +For conveniency, the +.Va +header provides a few macros and functions to ease creating +a file descriptor and doing I/O with a +.Nm +port. These are loosely modeled after the +.Xr pcap 3 +API, to ease porting of libpcap-based applications to +.Nm . +To use these extra functions, programs should +.Dl #define NETMAP_WITH_LIBS +before +.Dl #include +.Pp +The following functions are available: +.Bl -tag -width XXXXX +.It Va struct nm_desc * nm_open(const char *ifname, const struct nmreq *req, uint64_t flags, const struct nm_desc *arg) +similar to +.Xr pcap_open , +binds a file descriptor to a port. +.Bl -tag -width XX +.It Va ifname +is a port name, in the form "netmap:XXX" for a NIC and "valeXXX:YYY" for a +.Nm VALE +port. +.It Va req +provides the initial values for the argument to the NIOCREGIF ioctl. +The nm_flags and nm_ringid values are overwritten by parsing +ifname and flags, and other fields can be overridden through +the other two arguments. +.It Va arg +points to a struct nm_desc containing arguments (e.g. from a previously +open file descriptor) that should override the defaults. +The fields are used as described below +.It Va flags +can be set to a combination of the following flags: +.Va NETMAP_NO_TX_POLL , +.Va NETMAP_DO_RX_POLL +(copied into nr_ringid); +.Va NM_OPEN_NO_MMAP (if arg points to the same memory region, +avoids the mmap and uses the values from it); +.Va NM_OPEN_IFNAME (ignores ifname and uses the values in arg); +.Va NM_OPEN_ARG1 , +.Va NM_OPEN_ARG2 , +.Va NM_OPEN_ARG3 (uses the fields from arg); +.Va NM_OPEN_RING_CFG (uses the ring number and sizes from arg). +.El +.It Va int nm_close(struct nm_desc *d) +closes the file descriptor, unmaps memory, frees resources. +.It Va int nm_inject(struct nm_desc *d, const void *buf, size_t size) +similar to pcap_inject(), pushes a packet to a ring, returns the size +of the packet is successful, or 0 on error; +.It Va int nm_dispatch(struct nm_desc *d, int cnt, nm_cb_t cb, u_char *arg) +similar to pcap_dispatch(), applies a callback to incoming packets +.It Va u_char * nm_nextpkt(struct nm_desc *d, struct nm_pkthdr *hdr) +similar to pcap_next(), fetches the next packet +.Pp +.El +.Sh SUPPORTED DEVICES +.Nm +natively supports the following devices: +.Pp +On FreeBSD: +.Xr em 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr lem 4 , +.Xr re 4 . +.Pp +On Linux +.Xr e1000 4 , +.Xr e1000e 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr mlx4 4 , +.Xr forcedeth 4 , +.Xr r8169 4 . +.Pp +NICs without native support can still be used in +.Nm +mode through emulation. Performance is inferior to native netmap +mode but still significantly higher than sockets, and approaching +that of in-kernel solutions such as Linux's +.Xr pktgen . +.Pp +Emulation is also available for devices with native netmap support, +which can be used for testing or performance comparison. +The sysctl variable +.Va dev.netmap.admode +globally controls how netmap mode is implemented. +.Sh SYSCTL VARIABLES AND MODULE PARAMETERS +Some aspect of the operation of +.Nm +are controlled through sysctl variables on FreeBSD +.Em ( dev.netmap.* ) +and module parameters on Linux +.Em ( /sys/module/netmap_lin/parameters/* ) : +.Pp +.Bl -tag -width indent +.It Va dev.netmap.admode: 0 +Controls the use of native or emulated adapter mode. +0 uses the best available option, 1 forces native and +fails if not available, 2 forces emulated hence never fails. +.It Va dev.netmap.generic_ringsize: 1024 +Ring size used for emulated netmap mode +.It Va dev.netmap.generic_mit: 100000 +Controls interrupt moderation for emulated mode +.It Va dev.netmap.mmap_unreg: 0 +.It Va dev.netmap.fwd: 0 +Forces NS_FORWARD mode +.It Va dev.netmap.flags: 0 +.It Va dev.netmap.txsync_retry: 2 +.It Va dev.netmap.no_pendintr: 1 +Forces recovery of transmit buffers on system calls +.It Va dev.netmap.mitigate: 1 +Propagates interrupt mitigation to user processes +.It Va dev.netmap.no_timestamp: 0 +Disables the update of the timestamp in the netmap ring +.It Va dev.netmap.verbose: 0 +Verbose kernel messages +.It Va dev.netmap.buf_num: 163840 +.It Va dev.netmap.buf_size: 2048 +.It Va dev.netmap.ring_num: 200 +.It Va dev.netmap.ring_size: 36864 +.It Va dev.netmap.if_num: 100 +.It Va dev.netmap.if_size: 1024 +Sizes and number of objects (netmap_if, netmap_ring, buffers) +for the global memory region. The only parameter worth modifying is +.Va dev.netmap.buf_num +as it impacts the total amount of memory used by netmap. +.It Va dev.netmap.buf_curr_num: 0 +.It Va dev.netmap.buf_curr_size: 0 +.It Va dev.netmap.ring_curr_num: 0 +.It Va dev.netmap.ring_curr_size: 0 +.It Va dev.netmap.if_curr_num: 0 +.It Va dev.netmap.if_curr_size: 0 +Actual values in use. +.It Va dev.netmap.bridge_batch: 1024 +Batch size used when moving packets across a +.Nm VALE +switch. Values above 64 generally guarantee good +performance. +.El +.Sh SYSTEM CALLS .Nm uses -.Nm select +.Xr select 2 , +.Xr poll 2 , +.Xr epoll and -.Nm poll -to wake up processes when significant events occur. +.Xr kqueue +to wake up processes when significant events occur, and +.Xr mmap 2 +to map memory. +.Xr ioctl 2 +is used to configure ports and +.Nm VALE switches . +.Pp +Applications may need to create threads and bind them to +specific cores to improve performance, using standard +OS primitives, see +.Xr pthread 3 . +In particular, +.Xr pthread_setaffinity_np 3 +may be of use. +.Sh CAVEATS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 13:48:51 2014 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 ESMTPS id 5DC328A0; Tue, 18 Feb 2014 13:48:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46B3116C2; Tue, 18 Feb 2014 13:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDmpA2047442; Tue, 18 Feb 2014 13:48:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDmpA8047441; Tue, 18 Feb 2014 13:48:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181348.s1IDmpA8047441@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:48:51 +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: r262154 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 13:48:51 -0000 Author: avg Date: Tue Feb 18 13:48:50 2014 New Revision: 262154 URL: http://svnweb.freebsd.org/changeset/base/262154 Log: MFC r240829: remove cache entries associated with the source and the target of rename() MFC slacker: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 05:58:36 2014 (r262153) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 13:48:50 2014 (r262154) @@ -4025,6 +4025,9 @@ top: if (error == 0) { cache_purge(sdvp); cache_purge(tdvp); + cache_purge(ZTOV(szp)); + if (tzp) + cache_purge(ZTOV(tzp)); } #endif } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 13:49:04 2014 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 ESMTPS id 4D89E9D0; Tue, 18 Feb 2014 13:49:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33D4316C4; Tue, 18 Feb 2014 13:49:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDn3v1047516; Tue, 18 Feb 2014 13:49:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDn3ps047515; Tue, 18 Feb 2014 13:49:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181349.s1IDn3ps047515@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:49: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: r262155 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 13:49:04 -0000 Author: avg Date: Tue Feb 18 13:49:03 2014 New Revision: 262155 URL: http://svnweb.freebsd.org/changeset/base/262155 Log: MFC r240829: remove cache entries associated with the source and the target of rename() Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 13:48:50 2014 (r262154) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 13:49:03 2014 (r262155) @@ -4049,6 +4049,9 @@ top: if (error == 0) { cache_purge(sdvp); cache_purge(tdvp); + cache_purge(ZTOV(szp)); + if (tzp) + cache_purge(ZTOV(tzp)); } #endif } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 13:58:55 2014 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 ESMTPS id A918ECD0; Tue, 18 Feb 2014 13:58:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93D8B179C; Tue, 18 Feb 2014 13:58:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDwtDQ051485; Tue, 18 Feb 2014 13:58:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDwtJM051484; Tue, 18 Feb 2014 13:58:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181358.s1IDwtJM051484@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:58:55 +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: r262156 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 13:58:55 -0000 Author: avg Date: Tue Feb 18 13:58:55 2014 New Revision: 262156 URL: http://svnweb.freebsd.org/changeset/base/262156 Log: MFC r250149: In case ZFS doesn't use UMA for buffers there's no need to waste memory Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.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/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:49:03 2014 (r262155) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:58:55 2014 (r262156) @@ -130,6 +130,8 @@ zio_init(void) sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); zio_link_cache = kmem_cache_create("zio_link_cache", sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + if (!zio_use_uma) + goto out; /* * For small buffers, we want a cache for each multiple of @@ -193,6 +195,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } +out: /* * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 13:59:06 2014 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 ESMTPS id D5EB8DFE; Tue, 18 Feb 2014 13:59:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1C66179D; Tue, 18 Feb 2014 13:59:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDx6j3051559; Tue, 18 Feb 2014 13:59:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDx6Hh051558; Tue, 18 Feb 2014 13:59:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181359.s1IDx6Hh051558@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:59:06 +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: r262157 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 13:59:06 -0000 Author: avg Date: Tue Feb 18 13:59:06 2014 New Revision: 262157 URL: http://svnweb.freebsd.org/changeset/base/262157 Log: MFC r250149: In case ZFS doesn't use UMA for buffers there's no need to waste memory Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.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/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:58:55 2014 (r262156) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:59:06 2014 (r262157) @@ -130,6 +130,8 @@ zio_init(void) sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); zio_link_cache = kmem_cache_create("zio_link_cache", sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + if (!zio_use_uma) + goto out; /* * For small buffers, we want a cache for each multiple of @@ -193,6 +195,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } +out: /* * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:06:43 2014 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 ESMTPS id 3B9B72A4; Tue, 18 Feb 2014 14:06:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D513188B; Tue, 18 Feb 2014 14:06:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IE6gvV063920; Tue, 18 Feb 2014 14:06:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IE6fpd063912; Tue, 18 Feb 2014 14:06:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181406.s1IE6fpd063912@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:06:41 +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: r262158 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:06:43 -0000 Author: avg Date: Tue Feb 18 14:06:41 2014 New Revision: 262158 URL: http://svnweb.freebsd.org/changeset/base/262158 Log: MFC r253819: MFV r253781 + r253871: 3894 zfs should not allow snapshot of inconsistent dataset MFC slacker: delphij Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 14:06:41 2014 (r262158) @@ -3519,6 +3519,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void int rv = 0; int error; + if (sd->sd_recursive && + zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) { + zfs_close(zhp); + return (0); + } + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); if (error == -1) nomem(); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 14:06:41 2014 (r262158) @@ -1885,6 +1885,10 @@ get_numeric_property(zfs_handle_t *zhp, zcmd_free_nvlists(&zc); break; + case ZFS_PROP_INCONSISTENT: + *val = zhp->zfs_dmustats.dds_inconsistent; + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: @@ -3379,13 +3383,16 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void char name[ZFS_MAXNAMELEN]; int rv = 0; - (void) snprintf(name, sizeof (name), - "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) { + (void) snprintf(name, sizeof (name), + "%s@%s", zfs_get_name(zhp), sd->sd_snapname); - fnvlist_add_boolean(sd->sd_nvl, name); + fnvlist_add_boolean(sd->sd_nvl, name); - rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + } zfs_close(zhp); + return (rv); } Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 14:06:41 2014 (r262158) @@ -397,6 +397,8 @@ zfs_prop_init(void) PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); + zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:41 2014 (r262158) @@ -1648,7 +1648,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1656,7 +1656,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); } return (error); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:41 2014 (r262158) @@ -994,7 +994,7 @@ typedef struct dsl_dataset_snapshot_arg int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx) + dmu_tx_t *tx, boolean_t recv) { int error; uint64_t value; @@ -1020,6 +1020,18 @@ dsl_dataset_snapshot_check_impl(dsl_data if (error != ENOENT) return (error); + /* + * We don't allow taking snapshots of inconsistent datasets, such as + * those into which we are currently receiving. However, if we are + * creating this snapshot as part of a receive, this check will be + * executed atomically with respect to the completion of the receive + * itself but prior to the clearing of DS_FLAG_INCONSISTENT; in this + * case we ignore this, knowing it will be fixed up for us shortly in + * dmu_recv_end_sync(). + */ + if (!recv && DS_IS_INCONSISTENT(ds)) + return (SET_ERROR(EBUSY)); + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1056,7 +1068,7 @@ dsl_dataset_snapshot_check(void *arg, dm error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx); + atp + 1, tx, B_FALSE); dsl_dataset_rele(ds, FTAG); } @@ -1322,7 +1334,8 @@ dsl_dataset_snapshot_tmp_check(void *arg if (error != 0) return (error); - error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, tx); + error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, + tx, B_FALSE); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:41 2014 (r262158) @@ -251,7 +251,7 @@ int dsl_dataset_clone_swap_check_impl(ds void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx); + dmu_tx_t *tx, boolean_t recv); void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 14:06:41 2014 (r262158) @@ -143,6 +143,7 @@ typedef enum { ZFS_PROP_CLONES, ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, + ZFS_PROP_INCONSISTENT, /* not exposed to the user */ ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:07:01 2014 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 ESMTPS id 14F513E3; Tue, 18 Feb 2014 14:07:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E67291895; Tue, 18 Feb 2014 14:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IE70Wx064014; Tue, 18 Feb 2014 14:07:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IE6x66063993; Tue, 18 Feb 2014 14:06:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181406.s1IE6x66063993@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:06:59 +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: r262159 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:07:01 -0000 Author: avg Date: Tue Feb 18 14:06:59 2014 New Revision: 262159 URL: http://svnweb.freebsd.org/changeset/base/262159 Log: MFC r253819: MFV r253781 + r253871: 3894 zfs should not allow snapshot of inconsistent dataset Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 14:06:59 2014 (r262159) @@ -3519,6 +3519,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void int rv = 0; int error; + if (sd->sd_recursive && + zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) { + zfs_close(zhp); + return (0); + } + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); if (error == -1) nomem(); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 14:06:59 2014 (r262159) @@ -1885,6 +1885,10 @@ get_numeric_property(zfs_handle_t *zhp, zcmd_free_nvlists(&zc); break; + case ZFS_PROP_INCONSISTENT: + *val = zhp->zfs_dmustats.dds_inconsistent; + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: @@ -3379,13 +3383,16 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void char name[ZFS_MAXNAMELEN]; int rv = 0; - (void) snprintf(name, sizeof (name), - "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) { + (void) snprintf(name, sizeof (name), + "%s@%s", zfs_get_name(zhp), sd->sd_snapname); - fnvlist_add_boolean(sd->sd_nvl, name); + fnvlist_add_boolean(sd->sd_nvl, name); - rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + } zfs_close(zhp); + return (rv); } Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 14:06:59 2014 (r262159) @@ -397,6 +397,8 @@ zfs_prop_init(void) PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); + zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:59 2014 (r262159) @@ -1648,7 +1648,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1656,7 +1656,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); } return (error); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:59 2014 (r262159) @@ -994,7 +994,7 @@ typedef struct dsl_dataset_snapshot_arg int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx) + dmu_tx_t *tx, boolean_t recv) { int error; uint64_t value; @@ -1020,6 +1020,18 @@ dsl_dataset_snapshot_check_impl(dsl_data if (error != ENOENT) return (error); + /* + * We don't allow taking snapshots of inconsistent datasets, such as + * those into which we are currently receiving. However, if we are + * creating this snapshot as part of a receive, this check will be + * executed atomically with respect to the completion of the receive + * itself but prior to the clearing of DS_FLAG_INCONSISTENT; in this + * case we ignore this, knowing it will be fixed up for us shortly in + * dmu_recv_end_sync(). + */ + if (!recv && DS_IS_INCONSISTENT(ds)) + return (SET_ERROR(EBUSY)); + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1056,7 +1068,7 @@ dsl_dataset_snapshot_check(void *arg, dm error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx); + atp + 1, tx, B_FALSE); dsl_dataset_rele(ds, FTAG); } @@ -1322,7 +1334,8 @@ dsl_dataset_snapshot_tmp_check(void *arg if (error != 0) return (error); - error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, tx); + error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, + tx, B_FALSE); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:59 2014 (r262159) @@ -251,7 +251,7 @@ int dsl_dataset_clone_swap_check_impl(ds void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx); + dmu_tx_t *tx, boolean_t recv); void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 14:06:59 2014 (r262159) @@ -143,6 +143,7 @@ typedef enum { ZFS_PROP_CLONES, ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, + ZFS_PROP_INCONSISTENT, /* not exposed to the user */ ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:11:06 2014 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 ESMTPS id 323B6586; Tue, 18 Feb 2014 14:11:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12D9118BF; Tue, 18 Feb 2014 14:11:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEB5nX067105; Tue, 18 Feb 2014 14:11:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEB5rT067097; Tue, 18 Feb 2014 14:11:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181411.s1IEB5rT067097@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:11:05 +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: r262160 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:11:06 -0000 Author: avg Date: Tue Feb 18 14:11:04 2014 New Revision: 262160 URL: http://svnweb.freebsd.org/changeset/base/262160 Log: MFC r253820: MFV r253782: 3888 zfs recv -F should destroy any snapshots created since the incremental source MFC slacker: delphij Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h 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/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:11:04 2014 (r262160) @@ -723,6 +723,7 @@ typedef struct dmu_recv_begin_arg { const char *drba_origin; dmu_recv_cookie_t *drba_cookie; cred_t *drba_cred; + uint64_t drba_snapobj; } dmu_recv_begin_arg_t; static int @@ -733,11 +734,6 @@ recv_begin_check_existing_impl(dmu_recv_ int error; dsl_pool_t *dp = ds->ds_dir->dd_pool; - /* must not have any changes since most recent snapshot */ - if (!drba->drba_cookie->drc_force && - dsl_dataset_modified_since_lastsnap(ds)) - return (SET_ERROR(ETXTBSY)); - /* temporary clone name must not exist */ error = zap_lookup(dp->dp_meta_objset, ds->ds_dir->dd_phys->dd_child_dir_zapobj, recv_clone_name, @@ -753,41 +749,47 @@ recv_begin_check_existing_impl(dmu_recv_ return (error == 0 ? EEXIST : error); if (fromguid != 0) { - /* if incremental, most recent snapshot must match fromguid */ - if (ds->ds_prev == NULL) + dsl_dataset_t *snap; + uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + + /* Find snapshot in this dir that matches fromguid. */ + while (obj != 0) { + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (SET_ERROR(ENODEV)); + if (snap->ds_dir != ds->ds_dir) { + dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ENODEV)); + } + if (snap->ds_phys->ds_guid == fromguid) + break; + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + } + if (obj == 0) return (SET_ERROR(ENODEV)); - /* - * most recent snapshot must match fromguid, or there are no - * changes since the fromguid one - */ - if (ds->ds_prev->ds_phys->ds_guid != fromguid) { - uint64_t birth = ds->ds_prev->ds_phys->ds_bp.blk_birth; - uint64_t obj = ds->ds_prev->ds_phys->ds_prev_snap_obj; - while (obj != 0) { - dsl_dataset_t *snap; - error = dsl_dataset_hold_obj(dp, obj, FTAG, - &snap); - if (error != 0) - return (SET_ERROR(ENODEV)); - if (snap->ds_phys->ds_creation_txg < birth) { - dsl_dataset_rele(snap, FTAG); - return (SET_ERROR(ENODEV)); - } - if (snap->ds_phys->ds_guid == fromguid) { - dsl_dataset_rele(snap, FTAG); - break; /* it's ok */ - } - obj = snap->ds_phys->ds_prev_snap_obj; + if (drba->drba_cookie->drc_force) { + drba->drba_snapobj = obj; + } else { + /* + * If we are not forcing, there must be no + * changes since fromsnap. + */ + if (dsl_dataset_modified_since_snap(ds, snap)) { dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ETXTBSY)); } - if (obj == 0) - return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_prev->ds_object; } + + dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; } return (0); @@ -896,8 +898,14 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* create temporary clone */ + dsl_dataset_t *snap = NULL; + if (drba->drba_snapobj != 0) { + VERIFY0(dsl_dataset_hold_obj(dp, + drba->drba_snapobj, FTAG, &snap)); + } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, - ds->ds_prev, crflags, drba->drba_cred, tx); + snap, crflags, drba->drba_cred, tx); + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; @@ -1641,6 +1649,32 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head); if (error != 0) return (error); + if (drc->drc_force) { + /* + * We will destroy any snapshots in tofs (i.e. before + * origin_head) that are after the origin (which is + * the snap before drc_ds, because drc_ds can not + * have any snaps of its own). + */ + uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; + while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + dsl_dataset_t *snap; + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (error); + if (snap->ds_dir != origin_head->ds_dir) + error = SET_ERROR(EINVAL); + if (error == 0) { + error = dsl_destroy_snapshot_check_impl( + snap, B_FALSE); + } + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + if (error != 0) + return (error); + } + } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { @@ -1675,6 +1709,27 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t VERIFY0(dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head)); + + if (drc->drc_force) { + /* + * Destroy any snapshots of drc_tofs (origin_head) + * after the origin (the snap before drc_ds). + */ + uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; + while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + dsl_dataset_t *snap; + VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, + &snap)); + ASSERT3P(snap->ds_dir, ==, origin_head->ds_dir); + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_destroy_snapshot_sync_impl(snap, + B_FALSE, tx); + dsl_dataset_rele(snap, FTAG); + } + } + VERIFY3P(drc->drc_ds->ds_prev, ==, + origin_head->ds_prev); + dsl_dataset_clone_swap_sync_impl(drc->drc_ds, origin_head, tx); dsl_dataset_snapshot_sync_impl(origin_head, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:11:04 2014 (r262160) @@ -1593,16 +1593,16 @@ dsl_dataset_space(dsl_dataset_t *ds, } boolean_t -dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) +dsl_dataset_modified_since_snap(dsl_dataset_t *ds, dsl_dataset_t *snap) { dsl_pool_t *dp = ds->ds_dir->dd_pool; ASSERT(dsl_pool_config_held(dp)); - if (ds->ds_prev == NULL) + if (snap == NULL) return (B_FALSE); if (ds->ds_phys->ds_bp.blk_birth > - ds->ds_prev->ds_phys->ds_creation_txg) { - objset_t *os, *os_prev; + snap->ds_phys->ds_creation_txg) { + objset_t *os, *os_snap; /* * It may be that only the ZIL differs, because it was * reset in the head. Don't count that as being @@ -1610,10 +1610,10 @@ dsl_dataset_modified_since_lastsnap(dsl_ */ if (dmu_objset_from_ds(ds, &os) != 0) return (B_TRUE); - if (dmu_objset_from_ds(ds->ds_prev, &os_prev) != 0) + if (dmu_objset_from_ds(snap, &os_snap) != 0) return (B_TRUE); return (bcmp(&os->os_phys->os_meta_dnode, - &os_prev->os_phys->os_meta_dnode, + &os_snap->os_phys->os_meta_dnode, sizeof (os->os_phys->os_meta_dnode)) != 0); } return (B_FALSE); @@ -2436,15 +2436,14 @@ dsl_dataset_clone_swap_check_impl(dsl_da dsl_dataset_is_snapshot(origin_head)) return (SET_ERROR(EINVAL)); - /* the branch point should be just before them */ - if (clone->ds_prev != origin_head->ds_prev) + /* if we are not forcing, the branch point should be just before them */ + if (!force && clone->ds_prev != origin_head->ds_prev) return (SET_ERROR(EINVAL)); /* clone should be the clone (unless they are unrelated) */ if (clone->ds_prev != NULL && clone->ds_prev != clone->ds_dir->dd_pool->dp_origin_snap && - origin_head->ds_object != - clone->ds_prev->ds_phys->ds_next_snap_obj) + origin_head->ds_dir != clone->ds_prev->ds_dir) return (SET_ERROR(EINVAL)); /* the clone should be a child of the origin */ @@ -2452,7 +2451,8 @@ dsl_dataset_clone_swap_check_impl(dsl_da return (SET_ERROR(EINVAL)); /* origin_head shouldn't be modified unless 'force' */ - if (!force && dsl_dataset_modified_since_lastsnap(origin_head)) + if (!force && + dsl_dataset_modified_since_snap(origin_head, origin_head->ds_prev)) return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ @@ -2489,6 +2489,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat ASSERT(clone->ds_reserved == 0); ASSERT(origin_head->ds_quota == 0 || clone->ds_phys->ds_unique_bytes <= origin_head->ds_quota); + ASSERT3P(clone->ds_prev, ==, origin_head->ds_prev); dmu_buf_will_dirty(clone->ds_dbuf, tx); dmu_buf_will_dirty(origin_head->ds_dbuf, tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:11:04 2014 (r262160) @@ -46,10 +46,7 @@ typedef struct dmu_snapshots_destroy_arg nvlist_t *dsda_errlist; } dmu_snapshots_destroy_arg_t; -/* - * ds must be owned. - */ -static int +int dsl_destroy_snapshot_check_impl(dsl_dataset_t *ds, boolean_t defer) { if (!dsl_dataset_is_snapshot(ds)) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:11:04 2014 (r262160) @@ -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. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -206,7 +206,8 @@ void dsl_dataset_set_blkptr(dsl_dataset_ spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); -boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds); +boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds, + dsl_dataset_t *snap); void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:11:04 2014 (r262160) @@ -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. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -35,15 +35,16 @@ struct nvlist; struct dsl_dataset; struct dmu_tx; -int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer, - struct nvlist *errlist); -int dsl_destroy_snapshot(const char *name, boolean_t defer); -int dsl_destroy_head(const char *name); -int dsl_destroy_head_check_impl(struct dsl_dataset *ds, int expected_holds); -void dsl_destroy_head_sync_impl(struct dsl_dataset *ds, struct dmu_tx *tx); -int dsl_destroy_inconsistent(const char *dsname, void *arg); -void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *ds, - boolean_t defer, struct dmu_tx *tx); +int dsl_destroy_snapshots_nvl(struct nvlist *, boolean_t, + struct nvlist *); +int dsl_destroy_snapshot(const char *, boolean_t); +int dsl_destroy_head(const char *); +int dsl_destroy_head_check_impl(struct dsl_dataset *, int); +void dsl_destroy_head_sync_impl(struct dsl_dataset *, struct dmu_tx *); +int dsl_destroy_inconsistent(const char *, void *); +int dsl_destroy_snapshot_check_impl(struct dsl_dataset *, boolean_t); +void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *, + boolean_t, struct dmu_tx *); #ifdef __cplusplus } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:11:20 2014 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 ESMTPS id 8BFAD675; Tue, 18 Feb 2014 14:11:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C94D191B; Tue, 18 Feb 2014 14:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEBKqE067185; Tue, 18 Feb 2014 14:11:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEBJ4v067176; Tue, 18 Feb 2014 14:11:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181411.s1IEBJ4v067176@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:11:19 +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: r262161 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:11:20 -0000 Author: avg Date: Tue Feb 18 14:11:19 2014 New Revision: 262161 URL: http://svnweb.freebsd.org/changeset/base/262161 Log: MFC r253820: MFV r253782: 3888 zfs recv -F should destroy any snapshots created since the incremental source Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h 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/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:11:19 2014 (r262161) @@ -723,6 +723,7 @@ typedef struct dmu_recv_begin_arg { const char *drba_origin; dmu_recv_cookie_t *drba_cookie; cred_t *drba_cred; + uint64_t drba_snapobj; } dmu_recv_begin_arg_t; static int @@ -733,11 +734,6 @@ recv_begin_check_existing_impl(dmu_recv_ int error; dsl_pool_t *dp = ds->ds_dir->dd_pool; - /* must not have any changes since most recent snapshot */ - if (!drba->drba_cookie->drc_force && - dsl_dataset_modified_since_lastsnap(ds)) - return (SET_ERROR(ETXTBSY)); - /* temporary clone name must not exist */ error = zap_lookup(dp->dp_meta_objset, ds->ds_dir->dd_phys->dd_child_dir_zapobj, recv_clone_name, @@ -753,41 +749,47 @@ recv_begin_check_existing_impl(dmu_recv_ return (error == 0 ? EEXIST : error); if (fromguid != 0) { - /* if incremental, most recent snapshot must match fromguid */ - if (ds->ds_prev == NULL) + dsl_dataset_t *snap; + uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + + /* Find snapshot in this dir that matches fromguid. */ + while (obj != 0) { + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (SET_ERROR(ENODEV)); + if (snap->ds_dir != ds->ds_dir) { + dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ENODEV)); + } + if (snap->ds_phys->ds_guid == fromguid) + break; + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + } + if (obj == 0) return (SET_ERROR(ENODEV)); - /* - * most recent snapshot must match fromguid, or there are no - * changes since the fromguid one - */ - if (ds->ds_prev->ds_phys->ds_guid != fromguid) { - uint64_t birth = ds->ds_prev->ds_phys->ds_bp.blk_birth; - uint64_t obj = ds->ds_prev->ds_phys->ds_prev_snap_obj; - while (obj != 0) { - dsl_dataset_t *snap; - error = dsl_dataset_hold_obj(dp, obj, FTAG, - &snap); - if (error != 0) - return (SET_ERROR(ENODEV)); - if (snap->ds_phys->ds_creation_txg < birth) { - dsl_dataset_rele(snap, FTAG); - return (SET_ERROR(ENODEV)); - } - if (snap->ds_phys->ds_guid == fromguid) { - dsl_dataset_rele(snap, FTAG); - break; /* it's ok */ - } - obj = snap->ds_phys->ds_prev_snap_obj; + if (drba->drba_cookie->drc_force) { + drba->drba_snapobj = obj; + } else { + /* + * If we are not forcing, there must be no + * changes since fromsnap. + */ + if (dsl_dataset_modified_since_snap(ds, snap)) { dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ETXTBSY)); } - if (obj == 0) - return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_prev->ds_object; } + + dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; } return (0); @@ -896,8 +898,14 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* create temporary clone */ + dsl_dataset_t *snap = NULL; + if (drba->drba_snapobj != 0) { + VERIFY0(dsl_dataset_hold_obj(dp, + drba->drba_snapobj, FTAG, &snap)); + } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, - ds->ds_prev, crflags, drba->drba_cred, tx); + snap, crflags, drba->drba_cred, tx); + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; @@ -1641,6 +1649,32 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head); if (error != 0) return (error); + if (drc->drc_force) { + /* + * We will destroy any snapshots in tofs (i.e. before + * origin_head) that are after the origin (which is + * the snap before drc_ds, because drc_ds can not + * have any snaps of its own). + */ + uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; + while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + dsl_dataset_t *snap; + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (error); + if (snap->ds_dir != origin_head->ds_dir) + error = SET_ERROR(EINVAL); + if (error == 0) { + error = dsl_destroy_snapshot_check_impl( + snap, B_FALSE); + } + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + if (error != 0) + return (error); + } + } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { @@ -1675,6 +1709,27 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t VERIFY0(dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head)); + + if (drc->drc_force) { + /* + * Destroy any snapshots of drc_tofs (origin_head) + * after the origin (the snap before drc_ds). + */ + uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; + while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + dsl_dataset_t *snap; + VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, + &snap)); + ASSERT3P(snap->ds_dir, ==, origin_head->ds_dir); + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_destroy_snapshot_sync_impl(snap, + B_FALSE, tx); + dsl_dataset_rele(snap, FTAG); + } + } + VERIFY3P(drc->drc_ds->ds_prev, ==, + origin_head->ds_prev); + dsl_dataset_clone_swap_sync_impl(drc->drc_ds, origin_head, tx); dsl_dataset_snapshot_sync_impl(origin_head, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:11:19 2014 (r262161) @@ -1593,16 +1593,16 @@ dsl_dataset_space(dsl_dataset_t *ds, } boolean_t -dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) +dsl_dataset_modified_since_snap(dsl_dataset_t *ds, dsl_dataset_t *snap) { dsl_pool_t *dp = ds->ds_dir->dd_pool; ASSERT(dsl_pool_config_held(dp)); - if (ds->ds_prev == NULL) + if (snap == NULL) return (B_FALSE); if (ds->ds_phys->ds_bp.blk_birth > - ds->ds_prev->ds_phys->ds_creation_txg) { - objset_t *os, *os_prev; + snap->ds_phys->ds_creation_txg) { + objset_t *os, *os_snap; /* * It may be that only the ZIL differs, because it was * reset in the head. Don't count that as being @@ -1610,10 +1610,10 @@ dsl_dataset_modified_since_lastsnap(dsl_ */ if (dmu_objset_from_ds(ds, &os) != 0) return (B_TRUE); - if (dmu_objset_from_ds(ds->ds_prev, &os_prev) != 0) + if (dmu_objset_from_ds(snap, &os_snap) != 0) return (B_TRUE); return (bcmp(&os->os_phys->os_meta_dnode, - &os_prev->os_phys->os_meta_dnode, + &os_snap->os_phys->os_meta_dnode, sizeof (os->os_phys->os_meta_dnode)) != 0); } return (B_FALSE); @@ -2436,15 +2436,14 @@ dsl_dataset_clone_swap_check_impl(dsl_da dsl_dataset_is_snapshot(origin_head)) return (SET_ERROR(EINVAL)); - /* the branch point should be just before them */ - if (clone->ds_prev != origin_head->ds_prev) + /* if we are not forcing, the branch point should be just before them */ + if (!force && clone->ds_prev != origin_head->ds_prev) return (SET_ERROR(EINVAL)); /* clone should be the clone (unless they are unrelated) */ if (clone->ds_prev != NULL && clone->ds_prev != clone->ds_dir->dd_pool->dp_origin_snap && - origin_head->ds_object != - clone->ds_prev->ds_phys->ds_next_snap_obj) + origin_head->ds_dir != clone->ds_prev->ds_dir) return (SET_ERROR(EINVAL)); /* the clone should be a child of the origin */ @@ -2452,7 +2451,8 @@ dsl_dataset_clone_swap_check_impl(dsl_da return (SET_ERROR(EINVAL)); /* origin_head shouldn't be modified unless 'force' */ - if (!force && dsl_dataset_modified_since_lastsnap(origin_head)) + if (!force && + dsl_dataset_modified_since_snap(origin_head, origin_head->ds_prev)) return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ @@ -2489,6 +2489,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat ASSERT(clone->ds_reserved == 0); ASSERT(origin_head->ds_quota == 0 || clone->ds_phys->ds_unique_bytes <= origin_head->ds_quota); + ASSERT3P(clone->ds_prev, ==, origin_head->ds_prev); dmu_buf_will_dirty(clone->ds_dbuf, tx); dmu_buf_will_dirty(origin_head->ds_dbuf, tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:11:19 2014 (r262161) @@ -46,10 +46,7 @@ typedef struct dmu_snapshots_destroy_arg nvlist_t *dsda_errlist; } dmu_snapshots_destroy_arg_t; -/* - * ds must be owned. - */ -static int +int dsl_destroy_snapshot_check_impl(dsl_dataset_t *ds, boolean_t defer) { if (!dsl_dataset_is_snapshot(ds)) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:11:19 2014 (r262161) @@ -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. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -206,7 +206,8 @@ void dsl_dataset_set_blkptr(dsl_dataset_ spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); -boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds); +boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds, + dsl_dataset_t *snap); void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:11:19 2014 (r262161) @@ -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. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -35,15 +35,16 @@ struct nvlist; struct dsl_dataset; struct dmu_tx; -int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer, - struct nvlist *errlist); -int dsl_destroy_snapshot(const char *name, boolean_t defer); -int dsl_destroy_head(const char *name); -int dsl_destroy_head_check_impl(struct dsl_dataset *ds, int expected_holds); -void dsl_destroy_head_sync_impl(struct dsl_dataset *ds, struct dmu_tx *tx); -int dsl_destroy_inconsistent(const char *dsname, void *arg); -void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *ds, - boolean_t defer, struct dmu_tx *tx); +int dsl_destroy_snapshots_nvl(struct nvlist *, boolean_t, + struct nvlist *); +int dsl_destroy_snapshot(const char *, boolean_t); +int dsl_destroy_head(const char *); +int dsl_destroy_head_check_impl(struct dsl_dataset *, int); +void dsl_destroy_head_sync_impl(struct dsl_dataset *, struct dmu_tx *); +int dsl_destroy_inconsistent(const char *, void *); +int dsl_destroy_snapshot_check_impl(struct dsl_dataset *, boolean_t); +void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *, + boolean_t, struct dmu_tx *); #ifdef __cplusplus } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:21:27 2014 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 ESMTPS id 279B3B33; Tue, 18 Feb 2014 14:21:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 139251A07; Tue, 18 Feb 2014 14:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IELQxn071292; Tue, 18 Feb 2014 14:21:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IELQl5071291; Tue, 18 Feb 2014 14:21:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402181421.s1IELQl5071291@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Feb 2014 14:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262162 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:21:27 -0000 Author: glebius Date: Tue Feb 18 14:21:26 2014 New Revision: 262162 URL: http://svnweb.freebsd.org/changeset/base/262162 Log: Fix incorrect assertions. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Tue Feb 18 14:11:19 2014 (r262161) +++ head/sys/net/flowtable.c Tue Feb 18 14:21:26 2014 (r262162) @@ -634,7 +634,8 @@ flowtable_insert(struct flowtable *ft, u * preempted by another thread handling this flow */ SLIST_FOREACH(iter, flist, f_next) { - KASSERT(iter->f_hash == hash, ("%s: wrong hash", __func__)); + KASSERT(iter->f_hash % ft->ft_size == hash % ft->ft_size, + ("%s: wrong hash", __func__)); if (flow_matches(iter, key, keylen, fibnum)) { /* * We probably migrated to an other CPU after @@ -714,7 +715,8 @@ flowtable_lookup_common(struct flowtable critical_enter(); flist = flowtable_list(ft, hash); SLIST_FOREACH(fle, flist, f_next) { - KASSERT(fle->f_hash == hash, ("%s: wrong hash", __func__)); + KASSERT(fle->f_hash % ft->ft_size == hash % ft->ft_size, + ("%s: wrong hash", __func__)); if (flow_matches(fle, key, keylen, fibnum)) { fle->f_uptime = time_uptime; #ifdef FLOWTABLE_HASH_ALL From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:46:40 2014 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 ESMTPS id 13667AB0; Tue, 18 Feb 2014 14:46:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5C6B1C6E; Tue, 18 Feb 2014 14:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEkdSE091908; Tue, 18 Feb 2014 14:46:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEkdVf091906; Tue, 18 Feb 2014 14:46:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181446.s1IEkdVf091906@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:46:39 +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: r262163 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:46:40 -0000 Author: mav Date: Tue Feb 18 14:46:39 2014 New Revision: 262163 URL: http://svnweb.freebsd.org/changeset/base/262163 Log: MFC r253992: Disable r252840 when ZFS TRIM is enabled (vfs.zfs.trim.enabled=1) and really disable TRIM otherwise. r252840 (illumos bug 3836) is based on assumption that zio_free_sync() has no lock dependencies and should complete immediately. Unfortunately, with our TRIM implementation that is not true due to ZIO_STAGE_VDEV_IO_START added to the ZIO_FREE_PIPELINE, which, while not really accessing devices, still acquires SCL_ZIO lock for read to be sure devices won't disappear. When TRIM is disabled, this patch enables direct free execution from r252840 and removes ZIO_STAGE_VDEV_IO_START and ZIO_STAGE_VDEV_IO_ASSESS stages from the pipeline to avoid lock acquisition. Otherwise it queues free request as it was before r252840. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Tue Feb 18 14:21:26 2014 (r262162) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Tue Feb 18 14:46:39 2014 (r262163) @@ -213,9 +213,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_DVA_FREE | \ - ZIO_STAGE_VDEV_IO_START | \ - ZIO_STAGE_VDEV_IO_ASSESS) + ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 14:21:26 2014 (r262162) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 14:46:39 2014 (r262163) @@ -750,7 +750,7 @@ zio_free(spa_t *spa, uint64_t txg, const * DEDUP), can be processed immediately. Otherwise, put them on the * in-memory list for later processing. */ - if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + if (zfs_trim_enabled || BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || txg != spa->spa_syncing_txg || spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); @@ -777,12 +777,15 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); arc_freed(spa, bp); + if (zfs_trim_enabled) + stage |= ZIO_STAGE_ISSUE_ASYNC | ZIO_STAGE_VDEV_IO_START | + ZIO_STAGE_VDEV_IO_ASSESS; /* * GANG and DEDUP blocks can induce a read (for the gang block header, * or the DDT), so issue them asynchronously so that this thread is * not tied up. */ - if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + else if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) stage |= ZIO_STAGE_ISSUE_ASYNC; zio = zio_create(pio, spa, txg, bp, NULL, size, From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:50:32 2014 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 ESMTPS id 793A1C4C; Tue, 18 Feb 2014 14:50:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 630FC1CF2; Tue, 18 Feb 2014 14:50:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEoWVp092729; Tue, 18 Feb 2014 14:50:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEoV87092723; Tue, 18 Feb 2014 14:50:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181450.s1IEoV87092723@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:50:31 +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: r262164 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:50:32 -0000 Author: mav Date: Tue Feb 18 14:50:31 2014 New Revision: 262164 URL: http://svnweb.freebsd.org/changeset/base/262164 Log: MFC: r258137 Introduce allocation cache to store LZ4 compression contexts without kicking VM subsystem twice for every written record. Tests on 24-core system show double reduction of CPU time spent on copying single large well-compressed file. This patch is not really needed on illumos (while not harm either) since their memory allocator by default uses caching for all requests up to 128K. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Tue Feb 18 14:46:39 2014 (r262163) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Tue Feb 18 14:50:31 2014 (r262164) @@ -44,6 +44,8 @@ static int LZ4_compressCtx(void *ctx, co static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest, int isize, int osize); +static kmem_cache_t *lz4_ctx_cache; + /*ARGSUSED*/ size_t lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) @@ -840,7 +842,7 @@ static int real_LZ4_compress(const char *source, char *dest, int isize, int osize) { #if HEAPMODE - void *ctx = kmem_zalloc(sizeof (struct refTables), KM_NOSLEEP); + void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP); int result; /* @@ -850,12 +852,13 @@ real_LZ4_compress(const char *source, ch if (ctx == NULL) return (0); + bzero(ctx, sizeof(struct refTables)); if (isize < LZ4_64KLIMIT) result = LZ4_compress64kCtx(ctx, source, dest, isize, osize); else result = LZ4_compressCtx(ctx, source, dest, isize, osize); - kmem_free(ctx, sizeof (struct refTables)); + kmem_cache_free(lz4_ctx_cache, ctx); return (result); #else if (isize < (int)LZ4_64KLIMIT) @@ -1001,3 +1004,22 @@ LZ4_uncompress_unknownOutputSize(const c _output_error: return (int)(-(((char *)ip) - source)); } + +extern void +lz4_init(void) +{ + +#if HEAPMODE + lz4_ctx_cache = kmem_cache_create("lz4_ctx", sizeof(struct refTables), + 0, NULL, NULL, NULL, NULL, NULL, 0); +#endif +} + +extern void +lz4_fini(void) +{ + +#if HEAPMODE + kmem_cache_destroy(lz4_ctx_cache); +#endif +} Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 14:46:39 2014 (r262163) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 14:50:31 2014 (r262164) @@ -1766,6 +1766,7 @@ spa_init(int mode) unique_init(); range_tree_init(); zio_init(); + lz4_init(); dmu_init(); zil_init(); vdev_cache_stat_init(); @@ -1791,6 +1792,7 @@ spa_fini(void) vdev_cache_stat_fini(); zil_fini(); dmu_fini(); + lz4_fini(); zio_fini(); range_tree_fini(); unique_fini(); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 14:46:39 2014 (r262163) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 14:50:31 2014 (r262164) @@ -70,6 +70,8 @@ extern size_t zle_compress(void *src, vo int level); extern int zle_decompress(void *src, void *dst, size_t s_len, size_t d_len, int level); +extern void lz4_init(void); +extern void lz4_fini(void); extern size_t lz4_compress(void *src, void *dst, size_t s_len, size_t d_len, int level); extern int lz4_decompress(void *src, void *dst, size_t s_len, size_t d_len, From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:53:37 2014 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 ESMTPS id 3AEC0EDF; Tue, 18 Feb 2014 14:53:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 111C61D40; Tue, 18 Feb 2014 14:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IErax6095908; Tue, 18 Feb 2014 14:53:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IErael095906; Tue, 18 Feb 2014 14:53:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181453.s1IErael095906@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:53:36 +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: r262165 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:53:37 -0000 Author: mav Date: Tue Feb 18 14:53:36 2014 New Revision: 262165 URL: http://svnweb.freebsd.org/changeset/base/262165 Log: MFC r259168: Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE (64MB). Even if we would find one somehow, ZFS kernel code rejects such devices. It is funny to look on attempts to read 4 256K vdev labels from 1.44MB floppy, though it is not very practical and quite slow. Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Feb 18 14:50:31 2014 (r262164) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Feb 18 14:53:36 2014 (r262165) @@ -995,10 +995,10 @@ nozpool_all_slices(avl_tree_t *r, const #endif /* sun */ } +#ifdef sun static void check_slices(avl_tree_t *r, int fd, const char *sname) { -#ifdef sun struct extvtoc vtoc; struct dk_gpt *gpt; char diskname[MAXNAMELEN]; @@ -1028,8 +1028,8 @@ check_slices(avl_tree_t *r, int fd, cons check_one_slice(r, diskname, i, 0, 1); efi_free(gpt); } -#endif /* sun */ } +#endif /* sun */ static void zpool_open_func(void *arg) @@ -1059,6 +1059,7 @@ zpool_open_func(void *arg) return; } /* this file is too small to hold a zpool */ +#ifdef sun if (S_ISREG(statbuf.st_mode) && statbuf.st_size < SPA_MINDEVSIZE) { (void) close(fd); @@ -1070,6 +1071,12 @@ zpool_open_func(void *arg) */ check_slices(rn->rn_avl, fd, rn->rn_name); } +#else /* !sun */ + if (statbuf.st_size < SPA_MINDEVSIZE) { + (void) close(fd); + return; + } +#endif /* sun */ if ((zpool_read_label(fd, &config)) != 0) { (void) close(fd); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 18 14:50:31 2014 (r262164) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 18 14:53:36 2014 (r262165) @@ -370,10 +370,16 @@ vdev_geom_attach_taster(struct g_consume if (pp->flags & G_PF_WITHER) return (EINVAL); - if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) - return (EINVAL); g_attach(cp, pp); error = g_access(cp, 1, 0, 0); + if (error == 0) { + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) + error = EINVAL; + else if (pp->mediasize < SPA_MINDEVSIZE) + error = EINVAL; + if (error != 0) + g_access(cp, -1, 0, 0); + } if (error != 0) g_detach(cp); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:54:56 2014 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 ESMTPS id DAB519F; Tue, 18 Feb 2014 14:54:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C66511D50; Tue, 18 Feb 2014 14:54:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEsup1096096; Tue, 18 Feb 2014 14:54:56 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEsuVN096094; Tue, 18 Feb 2014 14:54:56 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201402181454.s1IEsuVN096094@svn.freebsd.org> From: Jonathan Anderson Date: Tue, 18 Feb 2014 14:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262166 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:54:56 -0000 Author: jonathan Date: Tue Feb 18 14:54:56 2014 New Revision: 262166 URL: http://svnweb.freebsd.org/changeset/base/262166 Log: Add more __BEGIN_DECLS / __END_DECLS to . capability.h currently only wraps some of its declarations in __BEGIN_DECLS/__END_DECLS, so cap_enter(), cap_sandboxed(), etc. are usable from C++ code but cap_rights_init(), cap_rights_is_valid() etc. are not. This commit fixes this distinction. Approved by: rwatson (mentor) MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/sys/capability.h Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Tue Feb 18 14:53:36 2014 (r262165) +++ head/sys/sys/capability.h Tue Feb 18 14:54:56 2014 (r262166) @@ -315,6 +315,8 @@ #define CAP_IOCTLS_ALL SSIZE_MAX +__BEGIN_DECLS + #define cap_rights_init(...) \ __cap_rights_init(CAP_RIGHTS_VERSION, __VA_ARGS__, 0ULL) cap_rights_t *__cap_rights_init(int version, cap_rights_t *rights, ...); @@ -336,6 +338,8 @@ cap_rights_t *cap_rights_merge(cap_right cap_rights_t *cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); +__END_DECLS + #ifdef _KERNEL #include From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:56:45 2014 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 ESMTPS id 8C334234; Tue, 18 Feb 2014 14:56:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76C7C1D77; Tue, 18 Feb 2014 14:56:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEujJA096428; Tue, 18 Feb 2014 14:56:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEujgZ096427; Tue, 18 Feb 2014 14:56:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181456.s1IEujgZ096427@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262167 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:56:45 -0000 Author: mav Date: Tue Feb 18 14:56:44 2014 New Revision: 262167 URL: http://svnweb.freebsd.org/changeset/base/262167 Log: MFC r260236: In dmu_zfetch_stream_reclaim() replace division with multiplication and move it out of the loop and lock. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:54:56 2014 (r262166) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:56:44 2014 (r262167) @@ -604,14 +604,16 @@ static zstream_t * dmu_zfetch_stream_reclaim(zfetch_t *zf) { zstream_t *zs; + clock_t ticks; + ticks = zfetch_min_sec_reap * hz; if (! rw_tryenter(&zf->zf_rwlock, RW_WRITER)) return (0); for (zs = list_head(&zf->zf_stream); zs; zs = list_next(&zf->zf_stream, zs)) { - if (((ddi_get_lbolt() - zs->zst_last)/hz) > zfetch_min_sec_reap) + if (ddi_get_lbolt() - zs->zst_last > ticks) break; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 14:58:38 2014 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 ESMTPS id 4A4293C2; Tue, 18 Feb 2014 14:58:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3529C1DA4; Tue, 18 Feb 2014 14:58:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEwcK5096679; Tue, 18 Feb 2014 14:58:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEwcHj096678; Tue, 18 Feb 2014 14:58:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181458.s1IEwcHj096678@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:58: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: r262168 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 14:58:38 -0000 Author: mav Date: Tue Feb 18 14:58:37 2014 New Revision: 262168 URL: http://svnweb.freebsd.org/changeset/base/262168 Log: MFC r260236: In dmu_zfetch_stream_reclaim() replace division with multiplication and move it out of the loop and lock. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:56:44 2014 (r262167) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:58:37 2014 (r262168) @@ -604,14 +604,16 @@ static zstream_t * dmu_zfetch_stream_reclaim(zfetch_t *zf) { zstream_t *zs; + clock_t ticks; + ticks = zfetch_min_sec_reap * hz; if (! rw_tryenter(&zf->zf_rwlock, RW_WRITER)) return (0); for (zs = list_head(&zf->zf_stream); zs; zs = list_next(&zf->zf_stream, zs)) { - if (((ddi_get_lbolt() - zs->zst_last)/hz) > zfetch_min_sec_reap) + if (ddi_get_lbolt() - zs->zst_last > ticks) break; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:05:10 2014 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 ESMTPS id A54B26F7; Tue, 18 Feb 2014 15:05:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8559E1F8D; Tue, 18 Feb 2014 15:05:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IF5Asl000530; Tue, 18 Feb 2014 15:05:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IF59dV000526; Tue, 18 Feb 2014 15:05:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181505.s1IF59dV000526@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:05:09 +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: r262169 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:05:10 -0000 Author: avg Date: Tue Feb 18 15:05:09 2014 New Revision: 262169 URL: http://svnweb.freebsd.org/changeset/base/262169 Log: MFC r254608: Add kstat entries for ZFS compression statistics Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.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/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 14:58:37 2014 (r262168) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 15:05:09 2014 (r262169) @@ -1834,6 +1834,7 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); + zio_compress_init(); l2arc_init(); arc_init(); } @@ -1844,6 +1845,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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 14:58:37 2014 (r262168) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 15:05:09 2014 (r262169) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 14:58:37 2014 (r262168) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 15:05:09 2014 (r262169) @@ -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 Tue Feb 18 15:07:26 2014 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 ESMTPS id 0E58B87C; Tue, 18 Feb 2014 15:07:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1C821FB9; Tue, 18 Feb 2014 15:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IF7P2K000816; Tue, 18 Feb 2014 15:07:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IF7Pi2000811; Tue, 18 Feb 2014 15:07:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181507.s1IF7Pi2000811@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:07: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: r262170 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:07:26 -0000 Author: avg Date: Tue Feb 18 15:07:24 2014 New Revision: 262170 URL: http://svnweb.freebsd.org/changeset/base/262170 Log: MFC r254608: Add kstat entries for ZFS compression statistics MFC slacker: gibbs Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.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/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 15:05:09 2014 (r262169) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 15:07:24 2014 (r262170) @@ -1893,6 +1893,7 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); + zio_compress_init(); l2arc_init(); arc_init(); } @@ -1903,6 +1904,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 15:05:09 2014 (r262169) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 15:07:24 2014 (r262170) @@ -85,6 +85,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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 15:05:09 2014 (r262169) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 15:07:24 2014 (r262170) @@ -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 Tue Feb 18 15:18:09 2014 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 ESMTPS id ACCA4D1B; Tue, 18 Feb 2014 15:18:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88A781128; Tue, 18 Feb 2014 15:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFI9of005180; Tue, 18 Feb 2014 15:18:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFI9j5005178; Tue, 18 Feb 2014 15:18:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181518.s1IFI9j5005178@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r262171 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:18:09 -0000 Author: avg Date: Tue Feb 18 15:18:08 2014 New Revision: 262171 URL: http://svnweb.freebsd.org/changeset/base/262171 Log: MFC r254757: MFV r254749: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended MFC slacker: delphij Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.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/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:07:24 2014 (r262170) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:18:08 2014 (r262171) @@ -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: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:07:24 2014 (r262170) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:18:08 2014 (r262171) @@ -836,11 +836,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); @@ -849,7 +859,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; @@ -882,8 +891,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); @@ -891,17 +898,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 Tue Feb 18 15:18:22 2014 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 ESMTPS id 9E1B9E4C; Tue, 18 Feb 2014 15:18:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E16E112B; Tue, 18 Feb 2014 15:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFIMxL005250; Tue, 18 Feb 2014 15:18:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFIMUA005247; Tue, 18 Feb 2014 15:18:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181518.s1IFIMUA005247@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:18:22 +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: r262172 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:18:22 -0000 Author: avg Date: Tue Feb 18 15:18:21 2014 New Revision: 262172 URL: http://svnweb.freebsd.org/changeset/base/262172 Log: MFC r254757: MFV r254749: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.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/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:18:08 2014 (r262171) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:18:21 2014 (r262172) @@ -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: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:18:08 2014 (r262171) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:18:21 2014 (r262172) @@ -836,11 +836,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); @@ -849,7 +859,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; @@ -882,8 +891,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); @@ -891,17 +898,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 Tue Feb 18 15:24:49 2014 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 ESMTPS id D276D557; Tue, 18 Feb 2014 15:24:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAAB011FD; Tue, 18 Feb 2014 15:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFOnn8009230; Tue, 18 Feb 2014 15:24:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFOnsh009229; Tue, 18 Feb 2014 15:24:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181524.s1IFOnsh009229@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:24:49 +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: r262173 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:24:49 -0000 Author: avg Date: Tue Feb 18 15:24:49 2014 New Revision: 262173 URL: http://svnweb.freebsd.org/changeset/base/262173 Log: MFC r256889: Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:18:21 2014 (r262172) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:24:49 2014 (r262173) @@ -5196,7 +5196,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, (size_t)SPA_MINBLOCKSIZE); + cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); if (csize == 0) { /* zero block, indicate that there's nothing to write */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:25:00 2014 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 ESMTPS id 5D2B7684; Tue, 18 Feb 2014 15:25:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4792B1200; Tue, 18 Feb 2014 15:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFP0w4009294; Tue, 18 Feb 2014 15:25:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFP0Tb009293; Tue, 18 Feb 2014 15:25:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181525.s1IFP0Tb009293@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:25:00 +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: r262174 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:25:00 -0000 Author: avg Date: Tue Feb 18 15:24:59 2014 New Revision: 262174 URL: http://svnweb.freebsd.org/changeset/base/262174 Log: MFC r256889: Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:24:49 2014 (r262173) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:24:59 2014 (r262174) @@ -5166,7 +5166,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, (size_t)SPA_MINBLOCKSIZE); + cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); if (csize == 0) { /* zero block, indicate that there's nothing to write */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:29:54 2014 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 ESMTPS id 0BCC493C; Tue, 18 Feb 2014 15:29:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB669123C; Tue, 18 Feb 2014 15:29:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFTrda009948; Tue, 18 Feb 2014 15:29:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFTrtc009947; Tue, 18 Feb 2014 15:29:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181529.s1IFTrtc009947@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:29: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: r262175 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:29:54 -0000 Author: avg Date: Tue Feb 18 15:29:53 2014 New Revision: 262175 URL: http://svnweb.freebsd.org/changeset/base/262175 Log: MFC r258294: Fix ZFS deadlock when sending a snapshot which is mounted MFC slacker: smh Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.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/dsl_userhold.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:24:59 2014 (r262174) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:29:53 2014 (r262175) @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t * ddura.ddura_holdfunc = dsl_dataset_hold_obj_string; pool = spa_name(tmpdp->dp_spa); #ifdef _KERNEL - dsl_pool_config_enter(tmpdp, FTAG); for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; pair = nvlist_next_nvpair(holds, pair)) { dsl_dataset_t *ds; + dsl_pool_config_enter(tmpdp, FTAG); error = dsl_dataset_hold_obj_string(tmpdp, nvpair_name(pair), FTAG, &ds); if (error == 0) { char name[MAXNAMELEN]; dsl_dataset_name(ds, name); + dsl_pool_config_exit(tmpdp, FTAG); dsl_dataset_rele(ds, FTAG); (void) zfs_unmount_snap(name); + } else { + dsl_pool_config_exit(tmpdp, FTAG); } } - dsl_pool_config_exit(tmpdp, FTAG); #endif } else { /* Non-temporary holds are specified by name. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:30:12 2014 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 ESMTPS id 06852AEC; Tue, 18 Feb 2014 15:30:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E623B1249; Tue, 18 Feb 2014 15:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFUBES010543; Tue, 18 Feb 2014 15:30:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFUBke010542; Tue, 18 Feb 2014 15:30:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181530.s1IFUBke010542@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:30:11 +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: r262176 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:30:12 -0000 Author: avg Date: Tue Feb 18 15:30:11 2014 New Revision: 262176 URL: http://svnweb.freebsd.org/changeset/base/262176 Log: MFC r258294: Fix ZFS deadlock when sending a snapshot which is mounted Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.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/dsl_userhold.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:29:53 2014 (r262175) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:30:11 2014 (r262176) @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t * ddura.ddura_holdfunc = dsl_dataset_hold_obj_string; pool = spa_name(tmpdp->dp_spa); #ifdef _KERNEL - dsl_pool_config_enter(tmpdp, FTAG); for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; pair = nvlist_next_nvpair(holds, pair)) { dsl_dataset_t *ds; + dsl_pool_config_enter(tmpdp, FTAG); error = dsl_dataset_hold_obj_string(tmpdp, nvpair_name(pair), FTAG, &ds); if (error == 0) { char name[MAXNAMELEN]; dsl_dataset_name(ds, name); + dsl_pool_config_exit(tmpdp, FTAG); dsl_dataset_rele(ds, FTAG); (void) zfs_unmount_snap(name); + } else { + dsl_pool_config_exit(tmpdp, FTAG); } } - dsl_pool_config_exit(tmpdp, FTAG); #endif } else { /* Non-temporary holds are specified by name. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:38:51 2014 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 ESMTPS id 039D0149; Tue, 18 Feb 2014 15:38:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E37171333; Tue, 18 Feb 2014 15:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFcoVX013999; Tue, 18 Feb 2014 15:38:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFcoKT013998; Tue, 18 Feb 2014 15:38:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181538.s1IFcoKT013998@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:38:50 +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: r262178 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:38:51 -0000 Author: avg Date: Tue Feb 18 15:38:50 2014 New Revision: 262178 URL: http://svnweb.freebsd.org/changeset/base/262178 Log: MFC r259052: Expose spa_asize_inflation Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.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/spa_misc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:43 2014 (r262177) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:50 2014 (r262178) @@ -304,6 +304,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; +TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, + &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); #ifndef illumos #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:38:43 2014 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 ESMTPS id 938FBFF5; Tue, 18 Feb 2014 15:38:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5CA1332; Tue, 18 Feb 2014 15:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFchlx013949; Tue, 18 Feb 2014 15:38:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFchhf013948; Tue, 18 Feb 2014 15:38:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181538.s1IFchhf013948@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:38: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: r262177 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:38:43 -0000 Author: avg Date: Tue Feb 18 15:38:43 2014 New Revision: 262177 URL: http://svnweb.freebsd.org/changeset/base/262177 Log: MFC r259052: Expose spa_asize_inflation Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.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/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:30:11 2014 (r262176) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:43 2014 (r262177) @@ -304,6 +304,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; +TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, + &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); #ifndef illumos #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:40:00 2014 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 ESMTPS id 8347C2E8; Tue, 18 Feb 2014 15:40:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EAB41348; Tue, 18 Feb 2014 15:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFe0w1014219; Tue, 18 Feb 2014 15:40:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFe0p5014217; Tue, 18 Feb 2014 15:40:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181540.s1IFe0p5014217@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262179 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:40:00 -0000 Author: avg Date: Tue Feb 18 15:39:59 2014 New Revision: 262179 URL: http://svnweb.freebsd.org/changeset/base/262179 Log: MFC r259052: Expose spa_asize_inflation Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:50 2014 (r262178) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:39:59 2014 (r262179) @@ -304,6 +304,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; +TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, + &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); #ifndef illumos #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:45:03 2014 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 ESMTPS id 60A995E3; Tue, 18 Feb 2014 15:45:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A52E13E5; Tue, 18 Feb 2014 15:45:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFj3Hx017613; Tue, 18 Feb 2014 15:45:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFj3O0017612; Tue, 18 Feb 2014 15:45:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181545.s1IFj3O0017612@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:45:03 +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: r262180 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:45:03 -0000 Author: avg Date: Tue Feb 18 15:45:02 2014 New Revision: 262180 URL: http://svnweb.freebsd.org/changeset/base/262180 Log: MFC r259576: MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.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/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:39:59 2014 (r262179) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:45:02 2014 (r262180) @@ -636,9 +636,16 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t start = off >> shift; uint64_t end = (off + len) >> shift; - ASSERT(dn->dn_datablkshift != 0); ASSERT(dn->dn_indblkshift != 0); + /* + * dnode_reallocate() can result in an object with indirect + * blocks having an odd data block size. In this case, + * just check the single block. + */ + if (dn->dn_datablkshift == 0) + start = end = 0; + zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 15:45:16 2014 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 ESMTPS id F3383718; Tue, 18 Feb 2014 15:45:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBED1141A; Tue, 18 Feb 2014 15:45:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFjFqp017677; Tue, 18 Feb 2014 15:45:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFjFwY017676; Tue, 18 Feb 2014 15:45:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181545.s1IFjFwY017676@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:45:15 +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: r262181 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 15:45:16 -0000 Author: avg Date: Tue Feb 18 15:45:15 2014 New Revision: 262181 URL: http://svnweb.freebsd.org/changeset/base/262181 Log: MFC r259576: MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.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/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:45:02 2014 (r262180) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:45:15 2014 (r262181) @@ -636,9 +636,16 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t start = off >> shift; uint64_t end = (off + len) >> shift; - ASSERT(dn->dn_datablkshift != 0); ASSERT(dn->dn_indblkshift != 0); + /* + * dnode_reallocate() can result in an object with indirect + * blocks having an odd data block size. In this case, + * just check the single block. + */ + if (dn->dn_datablkshift == 0) + start = end = 0; + zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 16:23:16 2014 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 ESMTPS id 6D05F848; Tue, 18 Feb 2014 16:23:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54BD317DD; Tue, 18 Feb 2014 16:23:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IGNGqA034345; Tue, 18 Feb 2014 16:23:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IGNBg8034318; Tue, 18 Feb 2014 16:23:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402181623.s1IGNBg8034318@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Feb 2014 16:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262182 - in vendor/lldb/dist: include/lldb include/lldb/API include/lldb/Breakpoint include/lldb/Core include/lldb/DataFormatters include/lldb/Expression include/lldb/Host include/lldb... 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 16:23:16 -0000 Author: emaste Date: Tue Feb 18 16:23:10 2014 New Revision: 262182 URL: http://svnweb.freebsd.org/changeset/base/262182 Log: Import lldb as of SVN r201577 (git 2bdc2f6) (A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL Added: vendor/lldb/dist/include/lldb/API/SBQueue.h (contents, props changed) vendor/lldb/dist/include/lldb/API/SBQueueItem.h (contents, props changed) vendor/lldb/dist/include/lldb/Core/IOHandler.h (contents, props changed) vendor/lldb/dist/include/lldb/DataFormatters/FormattersContainer.h (contents, props changed) vendor/lldb/dist/include/lldb/Host/Editline.h (contents, props changed) vendor/lldb/dist/include/lldb/Host/HostGetOpt.h (contents, props changed) vendor/lldb/dist/include/lldb/Target/Queue.h (contents, props changed) vendor/lldb/dist/include/lldb/Target/QueueItem.h (contents, props changed) vendor/lldb/dist/include/lldb/Target/QueueList.h (contents, props changed) vendor/lldb/dist/include/lldb/Target/SectionLoadHistory.h (contents, props changed) vendor/lldb/dist/source/API/SBQueue.cpp (contents, props changed) vendor/lldb/dist/source/API/SBQueueItem.cpp (contents, props changed) vendor/lldb/dist/source/Commands/CommandObjectGUI.cpp (contents, props changed) vendor/lldb/dist/source/Commands/CommandObjectGUI.h (contents, props changed) vendor/lldb/dist/source/Core/IOHandler.cpp (contents, props changed) vendor/lldb/dist/source/Host/common/Editline.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp (contents, props changed) vendor/lldb/dist/source/Plugins/Process/FreeBSD/FreeBSDThread.h (contents, props changed) vendor/lldb/dist/source/Target/Queue.cpp (contents, props changed) vendor/lldb/dist/source/Target/QueueItem.cpp (contents, props changed) vendor/lldb/dist/source/Target/QueueList.cpp (contents, props changed) vendor/lldb/dist/source/Target/SectionLoadHistory.cpp (contents, props changed) vendor/lldb/dist/tools/lldb-platform/exports Deleted: vendor/lldb/dist/include/lldb/API/SBInputReader.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/DataFormatters/FormatNavigator.h vendor/lldb/dist/source/API/SBInputReader.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/tools/driver/ELWrapper.cpp vendor/lldb/dist/tools/driver/ELWrapper.h vendor/lldb/dist/tools/driver/GetOptWrapper.cpp vendor/lldb/dist/tools/driver/GetOptWrapper.h vendor/lldb/dist/tools/driver/IOChannel.cpp vendor/lldb/dist/tools/driver/IOChannel.h Modified: vendor/lldb/dist/include/lldb/API/LLDB.h vendor/lldb/dist/include/lldb/API/SBAddress.h vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h vendor/lldb/dist/include/lldb/API/SBDebugger.h vendor/lldb/dist/include/lldb/API/SBDefines.h vendor/lldb/dist/include/lldb/API/SBError.h vendor/lldb/dist/include/lldb/API/SBModule.h vendor/lldb/dist/include/lldb/API/SBProcess.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/SBTypeFormat.h vendor/lldb/dist/include/lldb/Breakpoint/Breakpoint.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocation.h vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocationList.h vendor/lldb/dist/include/lldb/Core/ArchSpec.h vendor/lldb/dist/include/lldb/Core/Communication.h vendor/lldb/dist/include/lldb/Core/ConnectionFileDescriptor.h vendor/lldb/dist/include/lldb/Core/Debugger.h vendor/lldb/dist/include/lldb/Core/Disassembler.h vendor/lldb/dist/include/lldb/Core/MappedHash.h vendor/lldb/dist/include/lldb/Core/Module.h vendor/lldb/dist/include/lldb/Core/Opcode.h vendor/lldb/dist/include/lldb/Core/SourceManager.h vendor/lldb/dist/include/lldb/Core/StreamAsynchronousIO.h vendor/lldb/dist/include/lldb/Core/StringList.h vendor/lldb/dist/include/lldb/Core/ValueObject.h vendor/lldb/dist/include/lldb/Core/ValueObjectList.h vendor/lldb/dist/include/lldb/DataFormatters/CXXFormatterFunctions.h vendor/lldb/dist/include/lldb/DataFormatters/FormatManager.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/TypeSynthetic.h vendor/lldb/dist/include/lldb/DataFormatters/ValueObjectPrinter.h vendor/lldb/dist/include/lldb/Expression/ClangFunction.h vendor/lldb/dist/include/lldb/Expression/IRForTarget.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/SocketAddress.h vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h vendor/lldb/dist/include/lldb/Interpreter/PythonDataObjects.h vendor/lldb/dist/include/lldb/Interpreter/ScriptInterpreter.h vendor/lldb/dist/include/lldb/Interpreter/ScriptInterpreterPython.h vendor/lldb/dist/include/lldb/Symbol/FuncUnwinders.h vendor/lldb/dist/include/lldb/Symbol/Function.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/Type.h vendor/lldb/dist/include/lldb/Symbol/UnwindTable.h vendor/lldb/dist/include/lldb/Target/DynamicLoader.h vendor/lldb/dist/include/lldb/Target/ExecutionContext.h vendor/lldb/dist/include/lldb/Target/Platform.h vendor/lldb/dist/include/lldb/Target/Process.h vendor/lldb/dist/include/lldb/Target/SectionLoadList.h vendor/lldb/dist/include/lldb/Target/SystemRuntime.h vendor/lldb/dist/include/lldb/Target/Target.h vendor/lldb/dist/include/lldb/Target/Thread.h vendor/lldb/dist/include/lldb/Target/ThreadList.h vendor/lldb/dist/include/lldb/Target/ThreadPlanStepInRange.h vendor/lldb/dist/include/lldb/Target/UnwindAssembly.h vendor/lldb/dist/include/lldb/Utility/Iterable.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-log.h vendor/lldb/dist/source/API/SBBreakpoint.cpp vendor/lldb/dist/source/API/SBCommandInterpreter.cpp vendor/lldb/dist/source/API/SBDebugger.cpp vendor/lldb/dist/source/API/SBFrame.cpp vendor/lldb/dist/source/API/SBModule.cpp vendor/lldb/dist/source/API/SBProcess.cpp vendor/lldb/dist/source/API/SBTarget.cpp vendor/lldb/dist/source/API/SBType.cpp vendor/lldb/dist/source/API/SBTypeCategory.cpp vendor/lldb/dist/source/API/SBTypeFormat.cpp vendor/lldb/dist/source/API/SBValue.cpp vendor/lldb/dist/source/Breakpoint/Breakpoint.cpp vendor/lldb/dist/source/Breakpoint/BreakpointLocation.cpp vendor/lldb/dist/source/Breakpoint/BreakpointLocationList.cpp vendor/lldb/dist/source/Breakpoint/BreakpointResolverName.cpp 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/CommandObjectDisassemble.cpp vendor/lldb/dist/source/Commands/CommandObjectExpression.cpp vendor/lldb/dist/source/Commands/CommandObjectExpression.h vendor/lldb/dist/source/Commands/CommandObjectMultiword.cpp vendor/lldb/dist/source/Commands/CommandObjectProcess.cpp vendor/lldb/dist/source/Commands/CommandObjectQuit.cpp vendor/lldb/dist/source/Commands/CommandObjectRegister.cpp vendor/lldb/dist/source/Commands/CommandObjectSource.cpp vendor/lldb/dist/source/Commands/CommandObjectTarget.cpp vendor/lldb/dist/source/Commands/CommandObjectType.cpp vendor/lldb/dist/source/Commands/CommandObjectWatchpointCommand.cpp vendor/lldb/dist/source/Commands/CommandObjectWatchpointCommand.h vendor/lldb/dist/source/Core/Address.cpp vendor/lldb/dist/source/Core/ArchSpec.cpp vendor/lldb/dist/source/Core/Broadcaster.cpp vendor/lldb/dist/source/Core/Communication.cpp vendor/lldb/dist/source/Core/ConnectionFileDescriptor.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/Log.cpp vendor/lldb/dist/source/Core/Mangled.cpp vendor/lldb/dist/source/Core/Module.cpp vendor/lldb/dist/source/Core/Opcode.cpp vendor/lldb/dist/source/Core/Section.cpp vendor/lldb/dist/source/Core/SourceManager.cpp vendor/lldb/dist/source/Core/StreamAsynchronousIO.cpp vendor/lldb/dist/source/Core/StringList.cpp vendor/lldb/dist/source/Core/Value.cpp vendor/lldb/dist/source/Core/ValueObject.cpp vendor/lldb/dist/source/Core/ValueObjectChild.cpp vendor/lldb/dist/source/Core/ValueObjectVariable.cpp vendor/lldb/dist/source/DataFormatters/DataVisualization.cpp vendor/lldb/dist/source/DataFormatters/FormatManager.cpp vendor/lldb/dist/source/DataFormatters/LibCxx.cpp vendor/lldb/dist/source/DataFormatters/LibCxxUnorderedMap.cpp vendor/lldb/dist/source/DataFormatters/TypeCategory.cpp vendor/lldb/dist/source/DataFormatters/TypeFormat.cpp vendor/lldb/dist/source/DataFormatters/ValueObjectPrinter.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/ClangUserExpression.cpp vendor/lldb/dist/source/Expression/DWARFExpression.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/Materializer.cpp vendor/lldb/dist/source/Host/common/File.cpp vendor/lldb/dist/source/Host/common/Host.cpp vendor/lldb/dist/source/Host/common/OptionParser.cpp vendor/lldb/dist/source/Host/common/SocketAddress.cpp vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp vendor/lldb/dist/source/Interpreter/CommandObject.cpp vendor/lldb/dist/source/Interpreter/Options.cpp vendor/lldb/dist/source/Interpreter/PythonDataObjects.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/Disassembler/llvm/DisassemblerLLVMC.cpp 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/DynamicLoaderStatic.cpp vendor/lldb/dist/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp vendor/lldb/dist/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp vendor/lldb/dist/source/Plugins/ObjectFile/ELF/ObjectFileELF.h vendor/lldb/dist/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp vendor/lldb/dist/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h vendor/lldb/dist/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp vendor/lldb/dist/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h vendor/lldb/dist/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp vendor/lldb/dist/source/Plugins/Platform/POSIX/PlatformPOSIX.h 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/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/POSIXThread.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessPOSIX.cpp vendor/lldb/dist/source/Plugins/Process/POSIX/ProcessPOSIX.h vendor/lldb/dist/source/Plugins/Process/Utility/HistoryThread.cpp vendor/lldb/dist/source/Plugins/Process/Utility/HistoryThread.h vendor/lldb/dist/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp 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/UnwindLLDB.cpp vendor/lldb/dist/source/Plugins/Process/Utility/UnwindLLDB.h vendor/lldb/dist/source/Plugins/Process/elf-core/ProcessElfCore.cpp vendor/lldb/dist/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp vendor/lldb/dist/source/Plugins/Process/elf-core/ThreadElfCore.cpp 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/ProcessGDBRemote.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp vendor/lldb/dist/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp vendor/lldb/dist/source/Symbol/ClangASTContext.cpp vendor/lldb/dist/source/Symbol/ClangASTType.cpp vendor/lldb/dist/source/Symbol/FuncUnwinders.cpp vendor/lldb/dist/source/Symbol/Function.cpp vendor/lldb/dist/source/Symbol/Symbol.cpp vendor/lldb/dist/source/Symbol/Type.cpp vendor/lldb/dist/source/Symbol/Variable.cpp vendor/lldb/dist/source/Target/ExecutionContext.cpp vendor/lldb/dist/source/Target/LanguageRuntime.cpp vendor/lldb/dist/source/Target/Platform.cpp vendor/lldb/dist/source/Target/Process.cpp vendor/lldb/dist/source/Target/SectionLoadList.cpp vendor/lldb/dist/source/Target/StopInfo.cpp vendor/lldb/dist/source/Target/SystemRuntime.cpp vendor/lldb/dist/source/Target/Target.cpp vendor/lldb/dist/source/Target/Thread.cpp vendor/lldb/dist/source/Target/ThreadList.cpp vendor/lldb/dist/source/Target/ThreadPlanStepInRange.cpp vendor/lldb/dist/source/Target/ThreadPlanStepThrough.cpp vendor/lldb/dist/source/Target/ThreadPlanTracer.cpp vendor/lldb/dist/source/Target/UnwindAssembly.cpp vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.cpp vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.h vendor/lldb/dist/source/lldb-log.cpp vendor/lldb/dist/source/lldb.cpp vendor/lldb/dist/tools/driver/Driver.cpp vendor/lldb/dist/tools/driver/Driver.h vendor/lldb/dist/tools/driver/Platform.h vendor/lldb/dist/tools/lldb-platform/lldb-platform.cpp Modified: vendor/lldb/dist/include/lldb/API/LLDB.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/LLDB.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/LLDB.h Tue Feb 18 16:23:10 2014 (r262182) @@ -33,13 +33,14 @@ #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/SBQueue.h" +#include "lldb/API/SBQueueItem.h" #include "lldb/API/SBSourceManager.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBStringList.h" Modified: vendor/lldb/dist/include/lldb/API/SBAddress.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBAddress.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBAddress.h Tue Feb 18 16:23:10 2014 (r262182) @@ -118,6 +118,7 @@ protected: friend class SBTarget; friend class SBThread; friend class SBValue; + friend class SBQueueItem; lldb_private::Address * operator->(); Modified: vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBCommandInterpreter.h Tue Feb 18 16:23:10 2014 (r262182) @@ -122,6 +122,36 @@ public: SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr = NULL); // Access using SBDebugger::GetCommandInterpreter(); + //---------------------------------------------------------------------- + /// Return true if the command interpreter is the active IO handler. + /// + /// This indicates that any input coming into the debugger handles will + /// go to the command interpreter and will result in LLDB command line + /// commands being executed. + //---------------------------------------------------------------------- + bool + IsActive (); + + //---------------------------------------------------------------------- + /// Get the string that needs to be written to the debugger stdin file + /// handle when a control character is typed. + /// + /// Some GUI programs will intercept "control + char" sequences and want + /// to have them do what normally would happen when using a real + /// terminal, so this function allows GUI programs to emulate this + /// functionality. + /// + /// @param[in] ch + /// The character that was typed along with the control key + /// + /// @return + /// The string that should be written into the file handle that is + /// feeding the input stream for the debugger, or NULL if there is + /// no string for this control key. + //---------------------------------------------------------------------- + const char * + GetIOHandlerControlSequence(char ch); + protected: lldb_private::CommandInterpreter & Modified: vendor/lldb/dist/include/lldb/API/SBDebugger.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBDebugger.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBDebugger.h Tue Feb 18 16:23:10 2014 (r262182) @@ -17,6 +17,16 @@ namespace lldb { + +class SBInputReader +{ +public: + SBInputReader(); + ~SBInputReader(); + SBError Initialize(lldb::SBDebugger&, unsigned long (*)(void*, lldb::SBInputReader*, lldb::InputReaderAction, char const*, unsigned long), void*, lldb::InputReaderGranularity, char const*, char const*, bool); + void SetIsDone(bool); + bool IsActive() const; +}; class SBDebugger { public: @@ -231,12 +241,6 @@ public: void PushInputReader (lldb::SBInputReader &reader); - void - NotifyTopInputReader (lldb::InputReaderAction notification); - - bool - InputReaderIsTopReader (const lldb::SBInputReader &reader); - const char * GetInstanceName (); @@ -313,6 +317,10 @@ public: GetSyntheticForType (SBTypeNameSpecifier); #endif + void + RunCommandInterpreter (bool auto_handle_events, + bool spawn_thread); + private: friend class SBCommandInterpreter; Modified: vendor/lldb/dist/include/lldb/API/SBDefines.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBDefines.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBDefines.h Tue Feb 18 16:23:10 2014 (r262182) @@ -48,7 +48,6 @@ class SBFileSpecList; class SBFrame; class SBFunction; class SBHostOS; -class SBInputReader; class SBInstruction; class SBInstructionList; class SBLineEntry; Modified: vendor/lldb/dist/include/lldb/API/SBError.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBError.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBError.h Tue Feb 18 16:23:10 2014 (r262182) @@ -71,7 +71,6 @@ protected: friend class SBDebugger; friend class SBCommunication; friend class SBHostOS; - friend class SBInputReader; friend class SBPlatform; friend class SBProcess; friend class SBThread; Modified: vendor/lldb/dist/include/lldb/API/SBModule.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBModule.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBModule.h Tue Feb 18 16:23:10 2014 (r262182) @@ -235,6 +235,25 @@ public: lldb::SBTypeList FindTypes (const char* type); + //------------------------------------------------------------------ + /// Get a type using its type ID. + /// + /// Each symbol file reader will assign different user IDs to their + /// types, but it is sometimes useful when debugging type issues to + /// be able to grab a type using its type ID. + /// + /// For DWARF debug info, the type ID is the DIE offset. + /// + /// @param[in] uid + /// The type user ID. + /// + /// @return + /// An SBType for the given type ID, or an empty SBType if the + /// type was not found. + //------------------------------------------------------------------ + lldb::SBType + GetTypeByID (lldb::user_id_t uid); + lldb::SBType GetBasicType(lldb::BasicType type); Modified: vendor/lldb/dist/include/lldb/API/SBProcess.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBProcess.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBProcess.h Tue Feb 18 16:23:10 2014 (r262182) @@ -13,6 +13,7 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBError.h" #include "lldb/API/SBTarget.h" +#include "lldb/API/SBQueue.h" #include namespace lldb { @@ -142,6 +143,15 @@ public: SetSelectedThreadByIndexID (uint32_t index_id); //------------------------------------------------------------------ + // Queue related functions + //------------------------------------------------------------------ + uint32_t + GetNumQueues (); + + lldb::SBQueue + GetQueueAtIndex (size_t index); + + //------------------------------------------------------------------ // Stepping related functions //------------------------------------------------------------------ @@ -312,6 +322,7 @@ protected: friend class SBTarget; friend class SBThread; friend class SBValue; + friend class lldb_private::QueueImpl; lldb::ProcessSP GetSP() const; Added: vendor/lldb/dist/include/lldb/API/SBQueue.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBQueue.h Tue Feb 18 16:23:10 2014 (r262182) @@ -0,0 +1,83 @@ +//===-- SBQueue.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_SBQueue_h_ +#define LLDB_SBQueue_h_ + +#include + +#include "lldb/lldb-forward.h" +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBQueueItem.h" + +namespace lldb { + +class SBQueue +{ +public: + SBQueue (); + + SBQueue (const QueueSP& queue_sp); + + SBQueue (const SBQueue& rhs); + + const SBQueue & + operator= (const lldb::SBQueue& rhs); + + ~SBQueue(); + + bool + IsValid() const; + + void + Clear (); + + lldb::SBProcess + GetProcess (); + + lldb::queue_id_t + GetQueueID () const; + + const char * + GetName () const; + + uint32_t + GetIndexID () const; + + uint32_t + GetNumThreads (); + + lldb::SBThread + GetThreadAtIndex (uint32_t); + + uint32_t + GetNumPendingItems (); + + lldb::SBQueueItem + GetPendingItemAtIndex (uint32_t); + +protected: + friend class SBProcess; + + void + SetQueue (const lldb::QueueSP& queue_sp); + + void + FetchThreads (); + + void + FetchItems (); + +private: + std::shared_ptr m_opaque_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBQueue_h_ Added: vendor/lldb/dist/include/lldb/API/SBQueueItem.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/API/SBQueueItem.h Tue Feb 18 16:23:10 2014 (r262182) @@ -0,0 +1,58 @@ +//===-- SBQueueItem.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_SBQueueItem_h_ +#define LLDB_SBQueueItem_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBAddress.h" +#include "lldb/API/SBThread.h" + +namespace lldb { + +class SBQueueItem +{ +public: + SBQueueItem (); + + SBQueueItem (const lldb::QueueItemSP& queue_item_sp); + + ~SBQueueItem(); + + bool + IsValid() const; + + void + Clear (); + + lldb::QueueItemKind + GetKind () const; + + void + SetKind (lldb::QueueItemKind kind); + + lldb::SBAddress + GetAddress () const; + + void + SetAddress (lldb::SBAddress addr); + + void + SetQueueItem (const lldb::QueueItemSP& queue_item_sp); + + SBThread + GetExtendedBacktraceThread (const char *type); + +private: + lldb::QueueItemSP m_queue_item_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBQueueItem_h_ Modified: vendor/lldb/dist/include/lldb/API/SBTarget.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBTarget.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBTarget.h Tue Feb 18 16:23:10 2014 (r262182) @@ -646,9 +646,47 @@ public: void Clear (); + //------------------------------------------------------------------ + /// Resolve a current load address into a section offset address. + /// + /// @param[in] vm_addr + /// A virtual address from the current process state that is to + /// be translated into a section offset address. + /// + /// @return + /// An SBAddress which will be valid if \a vm_addr was + /// successfully resolved into a section offset address, or an + /// invalid SBAddress if \a vm_addr doesn't resolve to a section + /// in a module. + //------------------------------------------------------------------ lldb::SBAddress ResolveLoadAddress (lldb::addr_t vm_addr); + //------------------------------------------------------------------ + /// Resolve a current load address into a section offset address + /// using the process stop ID to identify a time in the past. + /// + /// @param[in] stop_id + /// Each time a process stops, the process stop ID integer gets + /// incremented. These stop IDs are used to identify past times + /// and can be used in history objects as a cheap way to store + /// the time at which the sample was taken. Specifying + /// UINT32_MAX will always resolve the address using the + /// currently loaded sections. + /// + /// @param[in] vm_addr + /// A virtual address from the current process state that is to + /// be translated into a section offset address. + /// + /// @return + /// An SBAddress which will be valid if \a vm_addr was + /// successfully resolved into a section offset address, or an + /// invalid SBAddress if \a vm_addr doesn't resolve to a section + /// in a module. + //------------------------------------------------------------------ + lldb::SBAddress + ResolvePastLoadAddress (uint32_t stop_id, lldb::addr_t vm_addr); + SBSymbolContext ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope); Modified: vendor/lldb/dist/include/lldb/API/SBThread.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBThread.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBThread.h Tue Feb 18 16:23:10 2014 (r262182) @@ -214,6 +214,8 @@ protected: friend class SBProcess; friend class SBDebugger; friend class SBValue; + friend class lldb_private::QueueImpl; + friend class SBQueueItem; void SetThread (const lldb::ThreadSP& lldb_object_sp); Modified: vendor/lldb/dist/include/lldb/API/SBType.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBType.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBType.h Tue Feb 18 16:23:10 2014 (r262182) @@ -106,6 +106,9 @@ public: GetReferenceType(); lldb::SBType + GetTypedefedType(); + + lldb::SBType GetDereferencedType(); lldb::SBType Modified: vendor/lldb/dist/include/lldb/API/SBTypeFormat.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBTypeFormat.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/API/SBTypeFormat.h Tue Feb 18 16:23:10 2014 (r262182) @@ -22,6 +22,9 @@ public: SBTypeFormat (lldb::Format format, uint32_t options = 0); // see lldb::eTypeOption values + + SBTypeFormat (const char* type, + uint32_t options = 0); // see lldb::eTypeOption values SBTypeFormat (const lldb::SBTypeFormat &rhs); @@ -33,6 +36,9 @@ public: lldb::Format GetFormat (); + const char* + GetTypeName (); + uint32_t GetOptions(); @@ -40,6 +46,9 @@ public: SetFormat (lldb::Format); void + SetTypeName (const char*); + + void SetOptions (uint32_t); bool @@ -73,8 +82,15 @@ protected: SBTypeFormat (const lldb::TypeFormatImplSP &); + enum class Type + { + eTypeKeepSame, + eTypeFormat, + eTypeEnum + }; + bool - CopyOnWrite_Impl(); + CopyOnWrite_Impl(Type); }; Modified: vendor/lldb/dist/include/lldb/Breakpoint/Breakpoint.h ============================================================================== --- vendor/lldb/dist/include/lldb/Breakpoint/Breakpoint.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Breakpoint/Breakpoint.h Tue Feb 18 16:23:10 2014 (r262182) @@ -612,12 +612,30 @@ protected: /// Only the Target can make a breakpoint, and it owns the breakpoint lifespans. /// The constructor takes a filter and a resolver. Up in Target there are convenience /// variants that make breakpoints for some common cases. + /// + /// @param[in] target + /// The target in which the breakpoint will be set. + /// + /// @param[in] filter_sp + /// Shared pointer to the search filter that restricts the search domain of the breakpoint. + /// + /// @param[in] resolver_sp + /// Shared pointer to the resolver object that will determine breakpoint matches. + /// + /// @param hardware + /// If true, request a hardware breakpoint to be used to implement the breakpoint locations. + /// + /// @param resolve_indirect_symbols + /// If true, and the address of a given breakpoint location in this breakpoint is set on an + /// indirect symbol (i.e. Symbol::IsIndirect returns true) then the actual breakpoint site will + /// be set on the target of the indirect symbol. //------------------------------------------------------------------ // This is the generic constructor Breakpoint(Target &target, lldb::SearchFilterSP &filter_sp, lldb::BreakpointResolverSP &resolver_sp, - bool hardware); + bool hardware, + bool resolve_indirect_symbols = true); friend class BreakpointLocation; // To call the following two when determining whether to stop. @@ -643,6 +661,7 @@ private: BreakpointOptions m_options; // Settable breakpoint options BreakpointLocationList m_locations; // The list of locations currently found for this breakpoint. std::string m_kind_description; + bool m_resolve_indirect_symbols; void SendBreakpointChangedEvent (lldb::BreakpointEventType eventKind); Modified: vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocation.h ============================================================================== --- vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocation.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocation.h Tue Feb 18 16:23:10 2014 (r262182) @@ -321,7 +321,59 @@ public: //------------------------------------------------------------------ bool InvokeCallback (StoppointCallbackContext *context); + + //------------------------------------------------------------------ + /// Returns whether we should resolve Indirect functions in setting the breakpoint site + /// for this location. + /// + /// @return + /// \b true if the breakpoint SITE for this location should be set on the + /// resolved location for Indirect functions. + //------------------------------------------------------------------ + bool + ShouldResolveIndirectFunctions () + { + return m_should_resolve_indirect_functions; + } + //------------------------------------------------------------------ + /// Returns whether the address set in the breakpoint site for this location was found by resolving + /// an indirect symbol. + /// + /// @return + /// \b true or \b false as given in the description above. + //------------------------------------------------------------------ + bool + IsIndirect () + { + return m_is_indirect; + } + + void + SetIsIndirect (bool is_indirect) + { + m_is_indirect = is_indirect; + } + + //------------------------------------------------------------------ + /// Returns whether the address set in the breakpoint location was re-routed to the target of a + /// re-exported symbol. + /// + /// @return + /// \b true or \b false as given in the description above. + //------------------------------------------------------------------ + bool + IsReExported () + { + return m_is_reexported; + } + + void + SetIsReExported (bool is_reexported) + { + m_is_reexported = is_reexported; + } + protected: friend class BreakpointLocationList; friend class Process; @@ -375,12 +427,16 @@ private: Breakpoint &owner, const Address &addr, lldb::tid_t tid, - bool hardware); - + bool hardware, + bool check_for_resolver = true); + //------------------------------------------------------------------ // Data members: //------------------------------------------------------------------ bool m_being_created; + bool m_should_resolve_indirect_functions; + bool m_is_reexported; + bool m_is_indirect; Address m_address; ///< The address defining this location. Breakpoint &m_owner; ///< The breakpoint that produced this object. std::unique_ptr m_options_ap; ///< Breakpoint options pointer, NULL if we're using our breakpoint's options. @@ -390,6 +446,12 @@ private: size_t m_condition_hash; ///< For testing whether the condition source code changed. void + SetShouldResolveIndirectFunctions (bool do_resolve) + { + m_should_resolve_indirect_functions = do_resolve; + } + + void SendBreakpointLocationChangedEvent (lldb::BreakpointEventType eventKind); DISALLOW_COPY_AND_ASSIGN (BreakpointLocation); Modified: vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocationList.h ============================================================================== --- vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocationList.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Breakpoint/BreakpointLocationList.h Tue Feb 18 16:23:10 2014 (r262182) @@ -236,7 +236,7 @@ protected: /// Returns breakpoint location id. //------------------------------------------------------------------ lldb::BreakpointLocationSP - Create (const Address &addr); + Create (const Address &addr, bool resolve_indirect_symbols); void StartRecordingNewLocations(BreakpointLocationCollection &new_locations); @@ -246,6 +246,7 @@ protected: lldb::BreakpointLocationSP AddLocation (const Address &addr, + bool resolve_indirect_symbols, bool *new_location = NULL); bool Modified: vendor/lldb/dist/include/lldb/Core/ArchSpec.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/ArchSpec.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Core/ArchSpec.h Tue Feb 18 16:23:10 2014 (r262182) @@ -13,6 +13,7 @@ #if defined(__cplusplus) #include "lldb/lldb-private.h" +#include "lldb/Core/ConstString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" @@ -90,6 +91,7 @@ public: eCore_x86_32_i486sx, eCore_x86_64_x86_64, + eCore_x86_64_x86_64h, // Haswell enabled x86_64 eCore_uknownMach32, eCore_uknownMach64, kNumCores, @@ -203,6 +205,27 @@ public: GetMachine () const; //------------------------------------------------------------------ + /// Returns the distribution id of the architecture. + /// + /// This will be something like "ubuntu", "fedora", etc. on Linux. + /// + /// @return A ConstString ref containing the distribution id, + /// potentially empty. + //------------------------------------------------------------------ + const ConstString& + GetDistributionId () const; + + //------------------------------------------------------------------ + /// Set the distribution id of the architecture. + /// + /// This will be something like "ubuntu", "fedora", etc. on Linux. + /// This should be the same value returned by + /// Host::GetDistributionId (). + ///------------------------------------------------------------------ + void + SetDistributionId (const char* distribution_id); + + //------------------------------------------------------------------ /// Tests if this ArchSpec is valid. /// /// @return True if the current architecture is valid, false @@ -400,6 +423,8 @@ protected: Core m_core; lldb::ByteOrder m_byte_order; + ConstString m_distribution_id; + // Called when m_def or m_entry are changed. Fills in all remaining // members with default values. void Modified: vendor/lldb/dist/include/lldb/Core/Communication.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/Communication.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Core/Communication.h Tue Feb 18 16:23:10 2014 (r262182) @@ -286,6 +286,8 @@ public: virtual bool StopReadThread (Error *error_ptr = NULL); + virtual bool + JoinReadThread (Error *error_ptr = NULL); //------------------------------------------------------------------ /// Checks if there is a currently running read thread. /// Modified: vendor/lldb/dist/include/lldb/Core/ConnectionFileDescriptor.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/ConnectionFileDescriptor.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Core/ConnectionFileDescriptor.h Tue Feb 18 16:23:10 2014 (r262182) @@ -11,9 +11,7 @@ #define liblldb_ConnectionFileDescriptor_h_ // C Includes -#ifdef _WIN32 -typedef unsigned short in_port_t; -#else +#ifndef _WIN32 #include #include #include @@ -68,14 +66,17 @@ public: // If the read file descriptor is a socket, then return // the port number that is being used by the socket. - in_port_t + uint16_t GetReadPort () const; // If the write file descriptor is a socket, then return // the port number that is being used by the socket. - in_port_t + uint16_t GetWritePort () const; + uint16_t + GetBoundPort (uint32_t timeout_sec); + protected: typedef enum @@ -95,7 +96,7 @@ protected: BytesAvailable (uint32_t timeout_usec, Error *error_ptr); lldb::ConnectionStatus - SocketListen (uint16_t listen_port_num, Error *error_ptr); + SocketListen (const char *host_and_port, Error *error_ptr); lldb::ConnectionStatus ConnectTCP (const char *host_and_port, Error *error_ptr); @@ -117,15 +118,16 @@ protected: FDType m_fd_send_type; FDType m_fd_recv_type; std::unique_ptr m_udp_send_sockaddr; - bool m_should_close_fd; // True if this class should close the file descriptor when it goes away. uint32_t m_socket_timeout_usec; int m_pipe_read; // A pipe that we select on the reading end of along with int m_pipe_write; // m_fd_recv so we can force ourselves out of the select. - Mutex m_mutex; + Mutex m_mutex; + Predicate m_port_predicate; // Used when binding to port zero to wait for the thread that creates the socket, binds and listens to resolve the port number + bool m_should_close_fd; // True if this class should close the file descriptor when it goes away. bool m_shutting_down; // This marks that we are shutting down so if we get woken up from BytesAvailable // to disconnect, we won't try to read again. - static in_port_t + static uint16_t GetSocketPort (int fd); static int Modified: vendor/lldb/dist/include/lldb/Core/Debugger.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/Debugger.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Core/Debugger.h Tue Feb 18 16:23:10 2014 (r262182) @@ -19,9 +19,8 @@ #include "lldb/lldb-public.h" #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Communication.h" -#include "lldb/Core/InputReaderStack.h" +#include "lldb/Core/IOHandler.h" #include "lldb/Core/Listener.h" -#include "lldb/Core/StreamFile.h" #include "lldb/Core/SourceManager.h" #include "lldb/Core/UserID.h" #include "lldb/Core/UserSettingsController.h" @@ -91,23 +90,25 @@ public: void SetAsyncExecution (bool async); - File & + lldb::StreamFileSP GetInputFile () { - return m_input_file.GetFile(); + return m_input_file_sp; } - File & + lldb::StreamFileSP GetOutputFile () { - return m_output_file.GetFile(); + return m_output_file_sp; } - File & + lldb::StreamFileSP GetErrorFile () { - return m_error_file.GetFile(); + return m_error_file_sp; } + + void SetInputFileHandle (FILE *fh, bool tranfer_ownership); @@ -124,18 +125,6 @@ public: void RestoreInputTerminalState(); - Stream& - GetOutputStream () - { - return m_output_file; - } - - Stream& - GetErrorStream () - { - return m_error_file; - } - lldb::StreamSP GetAsyncOutputStream (); @@ -200,24 +189,38 @@ public: void DispatchInputEndOfFile (); + //------------------------------------------------------------------ + // If any of the streams are not set, set them to the in/out/err + // stream of the top most input reader to ensure they at least have + // something + //------------------------------------------------------------------ void - DispatchInput (const char *bytes, size_t bytes_len); + AdoptTopIOHandlerFilesIfInvalid (lldb::StreamFileSP &in, + lldb::StreamFileSP &out, + lldb::StreamFileSP &err); void - WriteToDefaultReader (const char *bytes, size_t bytes_len); + PushIOHandler (const lldb::IOHandlerSP& reader_sp); + bool + PopIOHandler (const lldb::IOHandlerSP& reader_sp); + + // Synchronously run an input reader until it is done void - PushInputReader (const lldb::InputReaderSP& reader_sp); + RunIOHandler (const lldb::IOHandlerSP& reader_sp); + + bool + IsTopIOHandler (const lldb::IOHandlerSP& reader_sp); + + ConstString + GetTopIOHandlerControlSequence(char ch); bool - PopInputReader (const lldb::InputReaderSP& reader_sp); + HideTopIOHandler(); void - NotifyTopInputReader (lldb::InputReaderAction notification); + RefreshTopIOHandler(); - bool - InputReaderIsTopReader (const lldb::InputReaderSP& reader_sp); - static lldb::DebuggerSP FindDebuggerWithID (lldb::user_id_t id); @@ -240,7 +243,7 @@ public: void - CleanUpInputReaders (); + ClearIOHandlers (); static int TestDebuggerRefCount (); @@ -338,29 +341,65 @@ public: bool LoadPlugin (const FileSpec& spec, Error& error); + void + ExecuteIOHanders(); + + bool + IsForwardingEvents (); + + void + EnableForwardEvents (const lldb::ListenerSP &listener_sp); + + void + CancelForwardEvents (const lldb::ListenerSP &listener_sp); protected: - static void - DispatchInputCallback (void *baton, const void *bytes, size_t bytes_len); + friend class CommandInterpreter; + + bool + StartEventHandlerThread(); - lldb::InputReaderSP - GetCurrentInputReader (); - void - ActivateInputReader (const lldb::InputReaderSP &reader_sp); + StopEventHandlerThread(); + + static lldb::thread_result_t + EventHandlerThread (lldb::thread_arg_t arg); bool - CheckIfTopInputReaderIsDone (); + StartIOHandlerThread(); + + void + StopIOHandlerThread(); + static lldb::thread_result_t + IOHandlerThread (lldb::thread_arg_t arg); + + void + DefaultEventHandler(); + + void + HandleBreakpointEvent (const lldb::EventSP &event_sp); + + void + HandleProcessEvent (const lldb::EventSP &event_sp); + + void + HandleThreadEvent (const lldb::EventSP &event_sp); + + size_t + GetProcessSTDOUT (Process *process, Stream *stream); + + size_t + GetProcessSTDERR (Process *process, Stream *stream); + SourceManager::SourceFileCache & GetSourceFileCache () { return m_source_file_cache; } - Communication m_input_comm; - StreamFile m_input_file; - StreamFile m_output_file; - StreamFile m_error_file; + lldb::StreamFileSP m_input_file_sp; + lldb::StreamFileSP m_output_file_sp; + lldb::StreamFileSP m_error_file_sp; TerminalState m_terminal_state; TargetList m_target_list; PlatformList m_platform_list; @@ -370,8 +409,7 @@ protected: // source file cache. std::unique_ptr m_command_interpreter_ap; - InputReaderStack m_input_reader_stack; - std::string m_input_reader_data; + IOHandlerStack m_input_reader_stack; typedef std::map LogStreamMap; LogStreamMap m_log_streams; lldb::StreamSP m_log_callback_stream_sp; @@ -379,7 +417,10 @@ protected: static LoadPluginCallbackType g_load_plugin_callback; typedef std::vector LoadedPluginsList; LoadedPluginsList m_loaded_plugins; - + lldb::thread_t m_event_handler_thread; + lldb::thread_t m_io_handler_thread; + lldb::ListenerSP m_forward_listener_sp; + bool m_event_handler_thread_alive; void InstanceInitialize (); Modified: vendor/lldb/dist/include/lldb/Core/Disassembler.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/Disassembler.h Tue Feb 18 15:45:15 2014 (r262181) +++ vendor/lldb/dist/include/lldb/Core/Disassembler.h Tue Feb 18 16:23:10 2014 (r262182) @@ -175,6 +175,9 @@ public: uint32_t GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target); + uint32_t + GetIndexOfInstructionAtAddress (const Address &addr); + void Clear(); Added: vendor/lldb/dist/include/lldb/Core/IOHandler.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/include/lldb/Core/IOHandler.h Tue Feb 18 16:23:10 2014 (r262182) @@ -0,0 +1,646 @@ +//===-- IOHandler.h ---------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_IOHandler_h_ +#define liblldb_IOHandler_h_ + +#include + +#include + +#include "lldb/lldb-public.h" +#include "lldb/lldb-enumerations.h" +#include "lldb/Core/ConstString.h" +#include "lldb/Core/Error.h" +#include "lldb/Core/Flags.h" +#include "lldb/Core/StringList.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 16:26:19 2014 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 ESMTPS id F1E5CB65; Tue, 18 Feb 2014 16:26:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C125F181D; Tue, 18 Feb 2014 16:26:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IGQIbN034897; Tue, 18 Feb 2014 16:26:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IGQIWH034896; Tue, 18 Feb 2014 16:26:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402181626.s1IGQIWH034896@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Feb 2014 16:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262183 - vendor/lldb/lldb-r201577 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 16:26:19 -0000 Author: emaste Date: Tue Feb 18 16:26:18 2014 New Revision: 262183 URL: http://svnweb.freebsd.org/changeset/base/262183 Log: Tag lldb r201577 Added: vendor/lldb/lldb-r201577/ - copied from r262182, vendor/lldb/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 19:00:16 2014 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 ESMTPS id 37B1F24E; Tue, 18 Feb 2014 19:00:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 235251769; Tue, 18 Feb 2014 19:00:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IJ0FoT096157; Tue, 18 Feb 2014 19:00:15 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IJ0Fnr096154; Tue, 18 Feb 2014 19:00:15 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402181900.s1IJ0Fnr096154@svn.freebsd.org> From: Neel Natu Date: Tue, 18 Feb 2014 19:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262184 - head/usr.sbin/bhyve 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 19:00:16 -0000 Author: neel Date: Tue Feb 18 19:00:15 2014 New Revision: 262184 URL: http://svnweb.freebsd.org/changeset/base/262184 Log: Add a check to validate that memory BARs of passthru devices are 4KB aligned. Also, the MSI-x table offset is not required to be 4KB aligned so take this into account when computing the pages occupied by the MSI-x tables. Modified: head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Tue Feb 18 16:26:18 2014 (r262183) +++ head/usr.sbin/bhyve/pci_emul.c Tue Feb 18 19:00:15 2014 (r262184) @@ -792,7 +792,6 @@ pci_msix_table_init(struct pci_devinst * int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum) { - uint16_t pba_index; uint32_t tab_size; struct msixcap msixcap; @@ -809,10 +808,7 @@ pci_emul_add_msixcap(struct pci_devinst pi->pi_msix.table_offset = 0; pi->pi_msix.table_count = msgnum; pi->pi_msix.pba_offset = tab_size; - - /* calculate the MMIO size required for MSI-X PBA */ - pba_index = (msgnum - 1) / (PBA_TABLE_ENTRY_SIZE * 8); - pi->pi_msix.pba_size = (pba_index + 1) * PBA_TABLE_ENTRY_SIZE; + pi->pi_msix.pba_size = PBA_SIZE(msgnum); pci_msix_table_init(pi, msgnum); Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Tue Feb 18 16:26:18 2014 (r262183) +++ head/usr.sbin/bhyve/pci_emul.h Tue Feb 18 19:00:15 2014 (r262184) @@ -100,7 +100,7 @@ struct msix_table_entry { */ #define MSIX_TABLE_ENTRY_SIZE 16 #define MAX_MSIX_TABLE_ENTRIES 2048 -#define PBA_TABLE_ENTRY_SIZE 8 +#define PBA_SIZE(msgnum) (roundup2((msgnum), 64) / 8) enum lintr_stat { IDLE, @@ -135,10 +135,10 @@ struct pci_devinst { int enabled; int table_bar; int pba_bar; - size_t table_offset; + uint32_t table_offset; int table_count; - size_t pba_offset; - size_t pba_size; + uint32_t pba_offset; + int pba_size; int function_mask; struct msix_table_entry *table; /* allocated at runtime */ } pi_msix; Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Tue Feb 18 16:26:18 2014 (r262183) +++ head/usr.sbin/bhyve/pci_passthru.c Tue Feb 18 19:00:15 2014 (r262184) @@ -228,6 +228,7 @@ cfginitmsi(struct passthru_softc *sc) pi->pi_msix.table_offset = msixcap.table_info & ~PCIM_MSIX_BIR_MASK; pi->pi_msix.table_count = MSIX_TABLE_COUNT(msixcap.msgctrl); + pi->pi_msix.pba_size = PBA_SIZE(pi->pi_msix.table_count); /* Allocate the emulated MSI-X table array */ table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; @@ -279,8 +280,10 @@ msix_table_read(struct passthru_softc *s int index; pi = sc->psc_pi; - offset -= pi->pi_msix.table_offset; + if (offset < pi->pi_msix.table_offset) + return (-1); + offset -= pi->pi_msix.table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; if (index >= pi->pi_msix.table_count) return (-1); @@ -324,8 +327,10 @@ msix_table_write(struct vmctx *ctx, int int error, index; pi = sc->psc_pi; - offset -= pi->pi_msix.table_offset; + if (offset < pi->pi_msix.table_offset) + return; + offset -= pi->pi_msix.table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; if (index >= pi->pi_msix.table_count) return; @@ -358,7 +363,9 @@ init_msix_table(struct vmctx *ctx, struc { int b, s, f; int error, idx; - size_t len, remaining, table_size; + size_t len, remaining; + uint32_t table_size, table_offset; + uint32_t pba_size, pba_offset; vm_paddr_t start; struct pci_devinst *pi = sc->psc_pi; @@ -374,24 +381,37 @@ init_msix_table(struct vmctx *ctx, struc * either resides in its own page within the region, * or it resides in a page shared with only the PBA. */ - if (pi->pi_msix.pba_bar == pi->pi_msix.table_bar && - ((pi->pi_msix.pba_offset - pi->pi_msix.table_offset) < 4096)) { - /* Need to also emulate the PBA, not supported yet */ - printf("Unsupported MSI-X configuration: %d/%d/%d\n", b, s, f); - return (-1); - } + table_offset = rounddown2(pi->pi_msix.table_offset, 4096); - /* Compute the MSI-X table size */ - table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; + table_size = pi->pi_msix.table_offset - table_offset; + table_size += pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; table_size = roundup2(table_size, 4096); + if (pi->pi_msix.pba_bar == pi->pi_msix.table_bar) { + pba_offset = pi->pi_msix.pba_offset; + pba_size = pi->pi_msix.pba_size; + if (pba_offset >= table_offset + table_size || + table_offset >= pba_offset + pba_size) { + /* + * The PBA can reside in the same BAR as the MSI-x + * tables as long as it does not overlap with any + * naturally aligned page occupied by the tables. + */ + } else { + /* Need to also emulate the PBA, not supported yet */ + printf("Unsupported MSI-X configuration: %d/%d/%d\n", + b, s, f); + return (-1); + } + } + idx = pi->pi_msix.table_bar; start = pi->pi_bar[idx].addr; remaining = pi->pi_bar[idx].size; /* Map everything before the MSI-X table */ - if (pi->pi_msix.table_offset > 0) { - len = pi->pi_msix.table_offset; + if (table_offset > 0) { + len = table_offset; error = vm_map_pptdev_mmio(ctx, b, s, f, start, len, base); if (error) return (error); @@ -424,7 +444,7 @@ cfginitbar(struct vmctx *ctx, struct pas struct pci_devinst *pi; struct pci_bar_io bar; enum pcibar_type bartype; - uint64_t base; + uint64_t base, size; pi = sc->psc_pi; @@ -453,15 +473,25 @@ cfginitbar(struct vmctx *ctx, struct pas } base = bar.pbi_base & PCIM_BAR_MEM_BASE; } + size = bar.pbi_length; + + if (bartype != PCIBAR_IO) { + if (((base | size) & PAGE_MASK) != 0) { + printf("passthru device %d/%d/%d BAR %d: " + "base %#lx or size %#lx not page aligned\n", + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, + sc->psc_sel.pc_func, i, base, size); + return (-1); + } + } /* Cache information about the "real" BAR */ sc->psc_bar[i].type = bartype; - sc->psc_bar[i].size = bar.pbi_length; + sc->psc_bar[i].size = size; sc->psc_bar[i].addr = base; /* Allocate the BAR in the guest I/O or MMIO space */ - error = pci_emul_alloc_pbar(pi, i, base, bartype, - bar.pbi_length); + error = pci_emul_alloc_pbar(pi, i, base, bartype, size); if (error) return (-1); @@ -471,7 +501,7 @@ cfginitbar(struct vmctx *ctx, struct pas if (error) return (-1); } else if (bartype != PCIBAR_IO) { - /* Map the physical MMIO space in the guest MMIO space */ + /* Map the physical BAR in the guest MMIO space */ error = vm_map_pptdev_mmio(ctx, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_bar[i].addr, pi->pi_bar[i].size, base); From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 19:46:46 2014 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 ESMTPS id 6575524B; Tue, 18 Feb 2014 19:46:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 502331C6E; Tue, 18 Feb 2014 19:46:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IJkkFb015720; Tue, 18 Feb 2014 19:46:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IJkkwf015719; Tue, 18 Feb 2014 19:46:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402181946.s1IJkkwf015719@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Feb 2014 19:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262186 - head/contrib/llvm/tools/lldb/source/Symbol 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 19:46:46 -0000 Author: emaste Date: Tue Feb 18 19:46:45 2014 New Revision: 262186 URL: http://svnweb.freebsd.org/changeset/base/262186 Log: Fix mismerge in r262121 A break statement was lost in the merge. The error had no functional impact, but restore it to reduce the diff against upstream. Modified: head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Modified: head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Tue Feb 18 19:11:24 2014 (r262185) +++ head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp Tue Feb 18 19:46:45 2014 (r262186) @@ -1915,6 +1915,7 @@ ClangASTType::GetEncoding (uint64_t &cou case clang::Type::Decltype: case clang::Type::TemplateSpecialization: case clang::Type::Atomic: + break; // pointer type decayed from an array or function type. case clang::Type::Decayed: From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 20:16:33 2014 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 ESMTPS id A293DFF; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 724431FFE; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGX8x027980; Tue, 18 Feb 2014 20:16:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGXMB027979; Tue, 18 Feb 2014 20:16:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGXMB027979@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16:33 +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: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/9/share/man/man3/stdarg.3 Directory Properties: stable/9/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/stdarg.3 stable/8/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/stdarg.3 ============================================================================== --- stable/9/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/9/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 20:16:33 2014 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 ESMTPS id F14E8FD; Tue, 18 Feb 2014 20:16:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C23FA1FFC; Tue, 18 Feb 2014 20:16:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGW4x027966; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGW3U027965; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGW3U027965@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/10/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/man/man3/stdarg.3 stable/9/share/man/man3/stdarg.3 Directory Properties: stable/8/share/man/man3/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/10/share/man/man3/stdarg.3 ============================================================================== --- stable/10/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/10/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 20:16:33 2014 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 ESMTPS id 4D7BCFE; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1621FFD; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGW6V027974; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGWBv027973; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGWBv027973@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16:32 +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: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/8/share/man/man3/stdarg.3 Directory Properties: stable/8/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/stdarg.3 stable/9/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/stdarg.3 ============================================================================== --- stable/8/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/8/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 20:27:22 2014 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 ESMTPS id B0B8A9DA; Tue, 18 Feb 2014 20:27:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9836A1112; Tue, 18 Feb 2014 20:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKRMoV032170; Tue, 18 Feb 2014 20:27:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKRIKM032140; Tue, 18 Feb 2014 20:27:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182027.s1IKRIKM032140@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262192 - in stable: 10/sbin/hastd 10/sys/amd64/include 10/sys/boot/i386/cdboot 10/sys/boot/i386/pxeldr 10/sys/dev/pci 10/sys/i386/include 10/sys/kern 10/sys/sys 10/sys/x86/acpica 10/sy... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 20:27:22 -0000 Author: jhb Date: Tue Feb 18 20:27:17 2014 New Revision: 262192 URL: http://svnweb.freebsd.org/changeset/base/262192 Log: MFC 261517,261520: Convert the license on files where I am the sole copyright holder to 2 clause BSD licenses. Modified: stable/10/sbin/hastd/refcnt.h stable/10/sys/amd64/include/apicvar.h stable/10/sys/boot/i386/cdboot/cdboot.S stable/10/sys/boot/i386/pxeldr/pxeldr.S stable/10/sys/dev/pci/vga_pci.c stable/10/sys/i386/include/apicvar.h stable/10/sys/kern/kern_ktr.c stable/10/sys/kern/kern_rwlock.c stable/10/sys/kern/subr_lock.c stable/10/sys/kern/subr_sleepqueue.c stable/10/sys/kern/subr_smp.c stable/10/sys/sys/_rwlock.h stable/10/sys/sys/refcount.h stable/10/sys/sys/rwlock.h stable/10/sys/sys/sleepqueue.h stable/10/sys/sys/turnstile.h stable/10/sys/x86/acpica/madt.c stable/10/sys/x86/isa/atpic.c stable/10/sys/x86/isa/elcr.c stable/10/sys/x86/x86/intr_machdep.c stable/10/sys/x86/x86/io_apic.c stable/10/sys/x86/x86/mptable_pci.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/hastd/refcnt.h stable/9/sys/amd64/include/apicvar.h stable/9/sys/boot/i386/cdboot/cdboot.S stable/9/sys/boot/i386/pxeldr/pxeldr.S stable/9/sys/dev/pci/vga_pci.c stable/9/sys/i386/include/apicvar.h stable/9/sys/kern/kern_ktr.c stable/9/sys/kern/kern_rwlock.c stable/9/sys/kern/subr_lock.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_smp.c stable/9/sys/sys/_rwlock.h stable/9/sys/sys/refcount.h stable/9/sys/sys/rwlock.h stable/9/sys/sys/sleepqueue.h stable/9/sys/sys/turnstile.h stable/9/sys/x86/acpica/madt.c stable/9/sys/x86/isa/atpic.c stable/9/sys/x86/isa/elcr.c stable/9/sys/x86/x86/intr_machdep.c stable/9/sys/x86/x86/io_apic.c stable/9/sys/x86/x86/mptable_pci.c Directory Properties: stable/9/sbin/hastd/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/10/sbin/hastd/refcnt.h ============================================================================== --- stable/10/sbin/hastd/refcnt.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sbin/hastd/refcnt.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/amd64/include/apicvar.h ============================================================================== --- stable/10/sys/amd64/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/amd64/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/boot/i386/cdboot/cdboot.S ============================================================================== --- stable/10/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- stable/10/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:27:17 2014 (r262192) @@ -2,15 +2,26 @@ * Copyright (c) 2000 John Baldwin * All rights reserved. * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. + * 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 "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: stable/10/sys/dev/pci/vga_pci.c ============================================================================== --- stable/10/sys/dev/pci/vga_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/dev/pci/vga_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/i386/include/apicvar.h ============================================================================== --- stable/10/sys/i386/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/i386/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/kern_ktr.c ============================================================================== --- stable/10/sys/kern/kern_ktr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/kern_ktr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/kern_rwlock.c ============================================================================== --- stable/10/sys/kern/kern_rwlock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/kern_rwlock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/subr_lock.c ============================================================================== --- stable/10/sys/kern/subr_lock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/subr_lock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/10/sys/kern/subr_sleepqueue.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/subr_sleepqueue.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/subr_smp.c ============================================================================== --- stable/10/sys/kern/subr_smp.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/subr_smp.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/_rwlock.h ============================================================================== --- stable/10/sys/sys/_rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/_rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/refcount.h ============================================================================== --- stable/10/sys/sys/refcount.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/refcount.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/rwlock.h ============================================================================== --- stable/10/sys/sys/rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/sleepqueue.h ============================================================================== --- stable/10/sys/sys/sleepqueue.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/sleepqueue.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/turnstile.h ============================================================================== --- stable/10/sys/sys/turnstile.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/turnstile.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/acpica/madt.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/isa/atpic.c ============================================================================== --- stable/10/sys/x86/isa/atpic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/isa/atpic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/isa/elcr.c ============================================================================== --- stable/10/sys/x86/isa/elcr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/isa/elcr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/10/sys/x86/x86/intr_machdep.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/x86/intr_machdep.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/x86/io_apic.c ============================================================================== --- stable/10/sys/x86/x86/io_apic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/x86/io_apic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/x86/mptable_pci.c ============================================================================== --- stable/10/sys/x86/x86/mptable_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/x86/mptable_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 20:27:27 2014 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 ESMTPS id 69CEF9DE; Tue, 18 Feb 2014 20:27:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5186B1114; Tue, 18 Feb 2014 20:27:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKRRJ8032203; Tue, 18 Feb 2014 20:27:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKRMFm032175; Tue, 18 Feb 2014 20:27:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182027.s1IKRMFm032175@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:27:22 +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: r262192 - in stable: 10/sbin/hastd 10/sys/amd64/include 10/sys/boot/i386/cdboot 10/sys/boot/i386/pxeldr 10/sys/dev/pci 10/sys/i386/include 10/sys/kern 10/sys/sys 10/sys/x86/acpica 10/sy... 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 20:27:27 -0000 Author: jhb Date: Tue Feb 18 20:27:17 2014 New Revision: 262192 URL: http://svnweb.freebsd.org/changeset/base/262192 Log: MFC 261517,261520: Convert the license on files where I am the sole copyright holder to 2 clause BSD licenses. Modified: stable/9/sbin/hastd/refcnt.h stable/9/sys/amd64/include/apicvar.h stable/9/sys/boot/i386/cdboot/cdboot.S stable/9/sys/boot/i386/pxeldr/pxeldr.S stable/9/sys/dev/pci/vga_pci.c stable/9/sys/i386/include/apicvar.h stable/9/sys/kern/kern_ktr.c stable/9/sys/kern/kern_rwlock.c stable/9/sys/kern/subr_lock.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_smp.c stable/9/sys/sys/_rwlock.h stable/9/sys/sys/refcount.h stable/9/sys/sys/rwlock.h stable/9/sys/sys/sleepqueue.h stable/9/sys/sys/turnstile.h stable/9/sys/x86/acpica/madt.c stable/9/sys/x86/isa/atpic.c stable/9/sys/x86/isa/elcr.c stable/9/sys/x86/x86/intr_machdep.c stable/9/sys/x86/x86/io_apic.c stable/9/sys/x86/x86/mptable_pci.c Directory Properties: stable/9/sbin/hastd/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/hastd/refcnt.h stable/10/sys/amd64/include/apicvar.h stable/10/sys/boot/i386/cdboot/cdboot.S stable/10/sys/boot/i386/pxeldr/pxeldr.S stable/10/sys/dev/pci/vga_pci.c stable/10/sys/i386/include/apicvar.h stable/10/sys/kern/kern_ktr.c stable/10/sys/kern/kern_rwlock.c stable/10/sys/kern/subr_lock.c stable/10/sys/kern/subr_sleepqueue.c stable/10/sys/kern/subr_smp.c stable/10/sys/sys/_rwlock.h stable/10/sys/sys/refcount.h stable/10/sys/sys/rwlock.h stable/10/sys/sys/sleepqueue.h stable/10/sys/sys/turnstile.h stable/10/sys/x86/acpica/madt.c stable/10/sys/x86/isa/atpic.c stable/10/sys/x86/isa/elcr.c stable/10/sys/x86/x86/intr_machdep.c stable/10/sys/x86/x86/io_apic.c stable/10/sys/x86/x86/mptable_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sbin/hastd/refcnt.h ============================================================================== --- stable/9/sbin/hastd/refcnt.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sbin/hastd/refcnt.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/amd64/include/apicvar.h ============================================================================== --- stable/9/sys/amd64/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/amd64/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/boot/i386/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- stable/9/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:27:17 2014 (r262192) @@ -2,15 +2,26 @@ * Copyright (c) 2000 John Baldwin * All rights reserved. * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. + * 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 "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: stable/9/sys/dev/pci/vga_pci.c ============================================================================== --- stable/9/sys/dev/pci/vga_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/dev/pci/vga_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/i386/include/apicvar.h ============================================================================== --- stable/9/sys/i386/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/i386/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/kern_ktr.c ============================================================================== --- stable/9/sys/kern/kern_ktr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/kern_ktr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/kern_rwlock.c ============================================================================== --- stable/9/sys/kern/kern_rwlock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/kern_rwlock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/subr_lock.c ============================================================================== --- stable/9/sys/kern/subr_lock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/subr_lock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/9/sys/kern/subr_sleepqueue.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/subr_sleepqueue.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/subr_smp.c ============================================================================== --- stable/9/sys/kern/subr_smp.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/subr_smp.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/_rwlock.h ============================================================================== --- stable/9/sys/sys/_rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/_rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/refcount.h ============================================================================== --- stable/9/sys/sys/refcount.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/refcount.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/rwlock.h ============================================================================== --- stable/9/sys/sys/rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/sleepqueue.h ============================================================================== --- stable/9/sys/sys/sleepqueue.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/sleepqueue.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/turnstile.h ============================================================================== --- stable/9/sys/sys/turnstile.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/turnstile.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/acpica/madt.c ============================================================================== --- stable/9/sys/x86/acpica/madt.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/acpica/madt.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/isa/atpic.c ============================================================================== --- stable/9/sys/x86/isa/atpic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/isa/atpic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/isa/elcr.c ============================================================================== --- stable/9/sys/x86/isa/elcr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/isa/elcr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/9/sys/x86/x86/intr_machdep.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/x86/intr_machdep.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/x86/io_apic.c ============================================================================== --- stable/9/sys/x86/x86/io_apic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/x86/io_apic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/x86/mptable_pci.c ============================================================================== --- stable/9/sys/x86/x86/mptable_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/x86/mptable_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 21:29:30 2014 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 ESMTPS id C5FFA3F8; Tue, 18 Feb 2014 21:29:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1FDE16F0; Tue, 18 Feb 2014 21:29:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1ILTUMV056945; Tue, 18 Feb 2014 21:29:30 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1ILTU5b056944; Tue, 18 Feb 2014 21:29:30 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402182129.s1ILTU5b056944@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 18 Feb 2014 21:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262194 - head/sys/dev/gpio 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 21:29:30 -0000 Author: loos Date: Tue Feb 18 21:29:30 2014 New Revision: 262194 URL: http://svnweb.freebsd.org/changeset/base/262194 Log: Remove an unnecessary header. Reported by: nwhitehorn Approved by: adrian (mentor, implicit) Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Tue Feb 18 20:31:51 2014 (r262193) +++ head/sys/dev/gpio/ofw_gpiobus.c Tue Feb 18 21:29:30 2014 (r262194) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 22:17:13 2014 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 ESMTPS id 0CEDA653; Tue, 18 Feb 2014 22:17:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDE3B1B6C; Tue, 18 Feb 2014 22:17:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IMHCsS077357; Tue, 18 Feb 2014 22:17:12 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IMHCeM077356; Tue, 18 Feb 2014 22:17:12 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201402182217.s1IMHCeM077356@svn.freebsd.org> From: Martin Matuska Date: Tue, 18 Feb 2014 22:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262196 - head/sys/netpfil/pf 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 22:17:13 -0000 Author: mm Date: Tue Feb 18 22:17:12 2014 New Revision: 262196 URL: http://svnweb.freebsd.org/changeset/base/262196 Log: De-virtualize pf_mtag_z [1] Process V_pf_overloadqueue in vnet context [2] This fixes two VIMAGE kernel panics and allows to simultaneously run host-pf and vnet jails. pf inside jails remains broken. PR: kern/182964 Submitted by: glebius@FreeBSD.org [2], myself [1] Tested by: rodrigc@FreeBSD.org, myself MFC after: 2 weeks Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Feb 18 22:16:24 2014 (r262195) +++ head/sys/netpfil/pf/pf.c Tue Feb 18 22:17:12 2014 (r262196) @@ -172,7 +172,10 @@ struct pf_overload_entry { struct pf_rule *rule; }; -SLIST_HEAD(pf_overload_head, pf_overload_entry); +struct pf_overload_head { + SLIST_HEAD(, pf_overload_entry) head; + struct vnet *vnet; +}; static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); #define V_pf_overloadqueue VNET(pf_overloadqueue) static VNET_DEFINE(struct task, pf_overloadtask); @@ -187,8 +190,7 @@ struct mtx pf_unlnkdrules_mtx; static VNET_DEFINE(uma_zone_t, pf_sources_z); #define V_pf_sources_z VNET(pf_sources_z) -static VNET_DEFINE(uma_zone_t, pf_mtag_z); -#define V_pf_mtag_z VNET(pf_mtag_z) +uma_zone_t pf_mtag_z; VNET_DEFINE(uma_zone_t, pf_state_z); VNET_DEFINE(uma_zone_t, pf_state_key_z); @@ -510,7 +512,7 @@ pf_src_connlimit(struct pf_state **state pfoe->rule = (*state)->rule.ptr; pfoe->dir = (*state)->direction; PF_OVERLOADQ_LOCK(); - SLIST_INSERT_HEAD(&V_pf_overloadqueue, pfoe, next); + SLIST_INSERT_HEAD(&V_pf_overloadqueue.head, pfoe, next); PF_OVERLOADQ_UNLOCK(); taskqueue_enqueue(taskqueue_swi, &V_pf_overloadtask); @@ -527,11 +529,13 @@ pf_overload_task(void *c, int pending) PF_OVERLOADQ_LOCK(); queue = *(struct pf_overload_head *)c; - SLIST_INIT((struct pf_overload_head *)c); + SLIST_INIT(&((struct pf_overload_head *)c)->head); PF_OVERLOADQ_UNLOCK(); + CURVNET_SET(queue.vnet); + bzero(&p, sizeof(p)); - SLIST_FOREACH(pfoe, &queue, next) { + SLIST_FOREACH(pfoe, &queue.head, next) { V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("%s: blocking address ", __func__); @@ -563,16 +567,18 @@ pf_overload_task(void *c, int pending) /* * Remove those entries, that don't need flushing. */ - SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) + SLIST_FOREACH_SAFE(pfoe, &queue.head, next, pfoe1) if (pfoe->rule->flush == 0) { - SLIST_REMOVE(&queue, pfoe, pf_overload_entry, next); + SLIST_REMOVE(&queue.head, pfoe, pf_overload_entry, next); free(pfoe, M_PFTEMP); } else V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; /* If nothing to flush, return. */ - if (SLIST_EMPTY(&queue)) + if (SLIST_EMPTY(&queue.head)) { + CURVNET_RESTORE(); return; + } for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; @@ -582,7 +588,7 @@ pf_overload_task(void *c, int pending) PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) { sk = s->key[PF_SK_WIRE]; - SLIST_FOREACH(pfoe, &queue, next) + SLIST_FOREACH(pfoe, &queue.head, next) if (sk->af == pfoe->af && ((pfoe->rule->flush & PF_FLUSH_GLOBAL) || pfoe->rule == s->rule.ptr) && @@ -597,10 +603,12 @@ pf_overload_task(void *c, int pending) } PF_HASHROW_UNLOCK(ih); } - SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) + SLIST_FOREACH_SAFE(pfoe, &queue.head, next, pfoe1) free(pfoe, M_PFTEMP); if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: %u states killed", __func__, killed); + + CURVNET_RESTORE(); } /* @@ -790,14 +798,16 @@ pf_initialize() V_pf_altqs_inactive = &V_pf_altqs[1]; /* Mbuf tags */ - V_pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + - sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, - UMA_ALIGN_PTR, 0); + if (IS_DEFAULT_VNET(curvnet)) + pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + + sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, + UMA_ALIGN_PTR, 0); /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); - SLIST_INIT(&V_pf_overloadqueue); + SLIST_INIT(&V_pf_overloadqueue.head); TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); + V_pf_overloadqueue.vnet = curvnet; mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, MTX_DEF); @@ -844,7 +854,8 @@ pf_cleanup() mtx_destroy(&pf_overloadqueue_mtx); mtx_destroy(&pf_unlnkdrules_mtx); - uma_zdestroy(V_pf_mtag_z); + if (IS_DEFAULT_VNET(curvnet)) + uma_zdestroy(pf_mtag_z); uma_zdestroy(V_pf_sources_z); uma_zdestroy(V_pf_state_z); uma_zdestroy(V_pf_state_key_z); @@ -868,7 +879,7 @@ static void pf_mtag_free(struct m_tag *t) { - uma_zfree(V_pf_mtag_z, t); + uma_zfree(pf_mtag_z, t); } struct pf_mtag * @@ -879,7 +890,7 @@ pf_get_mtag(struct mbuf *m) if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) != NULL) return ((struct pf_mtag *)(mtag + 1)); - mtag = uma_zalloc(V_pf_mtag_z, M_NOWAIT); + mtag = uma_zalloc(pf_mtag_z, M_NOWAIT); if (mtag == NULL) return (NULL); bzero(mtag + 1, sizeof(struct pf_mtag)); @@ -1675,7 +1686,7 @@ pf_purge_unlinked_rules() * an already unlinked rule. */ PF_OVERLOADQ_LOCK(); - if (!SLIST_EMPTY(&V_pf_overloadqueue)) { + if (!SLIST_EMPTY(&V_pf_overloadqueue.head)) { PF_OVERLOADQ_UNLOCK(); return; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 23:18:34 2014 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 ESMTPS id 95BA8A66; Tue, 18 Feb 2014 23:18:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E39B1214; Tue, 18 Feb 2014 23:18:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1INIYDa001106; Tue, 18 Feb 2014 23:18:34 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1INIWDd001094; Tue, 18 Feb 2014 23:18:32 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402182318.s1INIWDd001094@svn.freebsd.org> From: Robert Watson Date: Tue, 18 Feb 2014 23:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262197 - in head/sys/boot/mips: . beri beri/boot2 beri/common beri/loader 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 23:18:34 -0000 Author: rwatson Date: Tue Feb 18 23:18:32 2014 New Revision: 262197 URL: http://svnweb.freebsd.org/changeset/base/262197 Log: Commit a first cut at ports of boot2 and loader to 64-bit MIPS, with a particular interest in (and support for) SRI International and the University of Cambridge's BERI FPGA soft-core processor. This includes micro device drivers for the Altera JTAG UART console, memory-mapped flash, and the Altera SD Card IP core in both boot2 and loader. boot2 can be written to the on-board Intel StrataFlash on the DE4 board, and loader can be placed in StrataFlash or the SD Card. Plenty of XXX comments, but works quite well locally in practice and I am using it daily. Although I had originally ported the ARM version of boot2, the current version is x86-derived as that proved more feature-complete. As we don't currently use partitions on our flash disks, support for that has been commented out relative to x86, but would be easy to add back. FDT support has not yet been hooked up, although some skeleton parts have been put in place for that. This may well be a useful starting point for ports to other 32-bit and 64-bit MIPS-ISA systems. This merge is synchronised to CheriBSD github commit e41d74fd719525d4dd7a7ee499114679165eeaf6, but with some additions of $FreeBSD. MFC after: 3 weeks Sponsored by: DARPA, AFRAL Added: head/sys/boot/mips/ head/sys/boot/mips/Makefile (contents, props changed) head/sys/boot/mips/Makefile.inc (contents, props changed) head/sys/boot/mips/beri/ head/sys/boot/mips/beri/Makefile (contents, props changed) head/sys/boot/mips/beri/Makefile.inc (contents, props changed) head/sys/boot/mips/beri/boot2/ head/sys/boot/mips/beri/boot2/Makefile (contents, props changed) head/sys/boot/mips/beri/boot2/boot2.c (contents, props changed) head/sys/boot/mips/beri/boot2/flashboot.ldscript (contents, props changed) head/sys/boot/mips/beri/boot2/jtagboot.ldscript (contents, props changed) head/sys/boot/mips/beri/boot2/relocate.S (contents, props changed) head/sys/boot/mips/beri/boot2/start.S (contents, props changed) head/sys/boot/mips/beri/common/ head/sys/boot/mips/beri/common/altera_jtag_uart.c (contents, props changed) head/sys/boot/mips/beri/common/beri.h (contents, props changed) head/sys/boot/mips/beri/common/cfi.c (contents, props changed) head/sys/boot/mips/beri/common/cfi.h (contents, props changed) head/sys/boot/mips/beri/common/common.ldscript (contents, props changed) head/sys/boot/mips/beri/common/cons.h (contents, props changed) head/sys/boot/mips/beri/common/mips.h (contents, props changed) head/sys/boot/mips/beri/common/sdcard.c (contents, props changed) head/sys/boot/mips/beri/common/sdcard.h (contents, props changed) head/sys/boot/mips/beri/loader/ head/sys/boot/mips/beri/loader/Makefile (contents, props changed) head/sys/boot/mips/beri/loader/arch.c (contents, props changed) head/sys/boot/mips/beri/loader/beri_console.c (contents, props changed) head/sys/boot/mips/beri/loader/beri_disk_cfi.c (contents, props changed) head/sys/boot/mips/beri/loader/beri_disk_sdcard.c (contents, props changed) head/sys/boot/mips/beri/loader/devicename.c (contents, props changed) head/sys/boot/mips/beri/loader/exec.c (contents, props changed) head/sys/boot/mips/beri/loader/help.mips (contents, props changed) head/sys/boot/mips/beri/loader/loader.h (contents, props changed) head/sys/boot/mips/beri/loader/loader.ldscript (contents, props changed) head/sys/boot/mips/beri/loader/main.c (contents, props changed) head/sys/boot/mips/beri/loader/metadata.c (contents, props changed) head/sys/boot/mips/beri/loader/start.S (contents, props changed) head/sys/boot/mips/beri/loader/version (contents, props changed) Added: head/sys/boot/mips/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/Makefile Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= beri + +.include Added: head/sys/boot/mips/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/Makefile.inc Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Added: head/sys/boot/mips/beri/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/Makefile Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= boot2 loader + +.include Added: head/sys/boot/mips/beri/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/Makefile.inc Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +BINDIR?= /boot +CFLAGS+= -ffreestanding +LDFLAGS+= -nostdlib + +.include "../Makefile.inc" Added: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/boot2/Makefile Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,86 @@ +#- +# Copyright (c) 2013-2014 Robert N. M. Watson +# All rights reserved. +# +# This software was developed by SRI International and the University of +# Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +# ("CTSRD"), as part of the DARPA CRASH research programme. +# +# @BERI_LICENSE_HEADER_START@ +# +# Licensed to BERI Open Systems C.I.C (BERI) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. BERI licenses this +# file to you under the BERI Hardware-Software License, Version 1.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# +# http://www.beri-open-systems.org/legal/license-1-0.txt +# +# Unless required by applicable law or agreed to in writing, Work distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# @BERI_LICENSE_HEADER_END@ +# +# $FreeBSD$ + +BINDIR?= /boot +INSTALLFLAGS= -b + +LOADERS= flashboot jtagboot +FILES= ${LOADERS} ${LOADERS:S/$/.md5/} + +SRCS= relocate.S \ + start.S \ + boot2.c \ + altera_jtag_uart.c \ + cfi.c \ + sdcard.c + +NO_MAN= + +AFLAGS= -G0 + +CFLAGS= -ffreestanding \ + -I${.CURDIR} \ + -I${.CURDIR}/../../../common \ + -I${.CURDIR}/../../../.. \ + -D_KERNEL \ + -Wall \ + -G0 -Xassembler -G0 \ + -fno-pic -mno-abicalls \ + -msoft-float \ + -g + +# where to get libstand from +CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ +LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a + +LDFLAGS= -nostdlib \ + -static \ + -N \ + -G0 \ + -L${.CURDIR} + +.PATH: ${.CURDIR}/../common +CFLAGS+= -I${.CURDIR}/../common + +flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o + ${LD} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ + ${.ALLSRC} ${LIBSTAND} +flashboot: flashboot.elf + objcopy -S -O binary ${.TARGET}.elf ${.TARGET} +flashboot.md5: flashboot + md5 flashboot > flashboot.md5 + +jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o + ${LD} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ + ${.ALLSRC} ${LIBSTAND} +jtagboot.md5: jtagboot + md5 jtagboot > jtagboot.md5 + +CLEANFILES+= flashboot.elf + +.include Added: head/sys/boot/mips/beri/boot2/boot2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/boot2/boot2.c Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,701 @@ +/*- + * Copyright (c) 2013-2014 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +static int beri_argc; +static const char **beri_argv, **beri_envv; +static uint64_t beri_memsize; + +#define IO_KEYBOARD 1 +#define IO_SERIAL 2 + +#define SECOND 1 /* Circa that many ticks in a second. */ + +#define RBX_ASKNAME 0x0 /* -a */ +#define RBX_SINGLE 0x1 /* -s */ +/* 0x2 is reserved for log2(RB_NOSYNC). */ +/* 0x3 is reserved for log2(RB_HALT). */ +/* 0x4 is reserved for log2(RB_INITNAME). */ +#define RBX_DFLTROOT 0x5 /* -r */ +#define RBX_KDB 0x6 /* -d */ +/* 0x7 is reserved for log2(RB_RDONLY). */ +/* 0x8 is reserved for log2(RB_DUMP). */ +/* 0x9 is reserved for log2(RB_MINIROOT). */ +#define RBX_CONFIG 0xa /* -c */ +#define RBX_VERBOSE 0xb /* -v */ +#define RBX_SERIAL 0xc /* -h */ +#define RBX_CDROM 0xd /* -C */ +/* 0xe is reserved for log2(RB_POWEROFF). */ +#define RBX_GDB 0xf /* -g */ +#define RBX_MUTE 0x10 /* -m */ +/* 0x11 is reserved for log2(RB_SELFTEST). */ +/* 0x12 is reserved for boot programs. */ +/* 0x13 is reserved for boot programs. */ +#define RBX_PAUSE 0x14 /* -p */ +#define RBX_QUIET 0x15 /* -q */ +#define RBX_NOINTR 0x1c /* -n */ +/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ +#define RBX_DUAL 0x1d /* -D */ +/* 0x1f is reserved for log2(RB_BOOTINFO). */ + +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ + OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ + OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ + OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" +#define PATH_BOOT3 "/boot/loader" +#define PATH_KERNEL "/boot/kernel/kernel" + +#define ARGS 0x900 +#define NOPT 14 +#define MEM_BASE 0x12 +#define MEM_EXT 0x15 + +/* + * XXXRW: I think this has to do with whether boot2 expects a partition + * table? + */ +#define DRV_HARD 0x80 +#define DRV_MASK 0x7f + +/* Default to using CFI flash. */ +#define TYPE_DEFAULT BOOTINFO_DEV_TYPE_SDCARD + +/* Hard-coded assumption about location of JTAG-loaded kernel. */ +#define DRAM_KERNEL_ADDR ((void *)mips_phys_to_cached(0x20000)) + +#define OPT_SET(opt) (1 << (opt)) +#define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) + +extern uint32_t _end; + +static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ +static const unsigned char flags[NOPT] = { + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE +}; + +/* These must match BOOTINFO_DEV_TYPE constants. */ +static const char *const dev_nm[] = {"dram", "cfi", "sdcard"}; +static const u_int dev_nm_count = sizeof(dev_nm) / sizeof(dev_nm[0]); + +static struct dmadat __dmadat; + +static struct dsk { + unsigned type; /* BOOTINFO_DEV_TYPE_x object type. */ + uintptr_t unitptr; /* Unit number or pointer to object. */ + uint8_t slice; + uint8_t part; +#if 0 + unsigned start; + int init; +#endif +} dsk; +static char cmd[512], cmddup[512], knamebuf[1024]; +static const char *kname; +static uint32_t opts; +#if 0 +static int comspeed = SIOSPD; +#endif +struct bootinfo bootinfo; +static uint8_t ioctrl = IO_KEYBOARD; + +void exit(int); +void putchar(int); +static void boot_fromdram(void); +static void boot_fromfs(void); +static void load(void); +static int parse(void); +static int dskread(void *, unsigned, unsigned); +static int xputc(int); +static int xgetc(int); + + +#define UFS_SMALL_CGBASE +#include "ufsread.c" + +static inline int +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) +{ + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return -1; + } + return 0; +} + +static inline void +getstr(void) +{ + char *s; + int c; + + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + putchar('\n'); + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } + } +} + +int +main(u_int argc, const char *argv[], const char *envv[], uint64_t memsize) +{ + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; + + /* Arguments from Miniboot. */ + beri_argc = argc; + beri_argv = argv; + beri_envv = envv; + beri_memsize = memsize; + + dmadat = &__dmadat; +#if 0 + /* XXXRW: more here. */ + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); +#endif + dsk.type = TYPE_DEFAULT; +#if 0 + dsk.unit = dsk.drive & DRV_MASK; + dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; +#endif + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); + + /* Process configuration file */ + + autoboot = 1; + + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } + + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } + + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ + + if (!kname) { + kname = PATH_BOOT3; + if (autoboot && !keyhit(3*SECOND)) { + boot_fromfs(); + kname = PATH_KERNEL; + } + } + + /* Present the user with the boot2 prompt. */ + + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/mips boot\n" + "Default: %s%ju:%s\n" + "boot: ", + dev_nm[dsk.type], dsk.unitptr, kname); +#if 0 + if (ioctrl & IO_SERIAL) + sio_flush(); +#endif + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } +} + +/* XXX - Needed for btxld to link the boot2 binary; do not remove. */ +void +exit(int x) +{ +} + +static void +boot(void *entryp, int argc, const char *argv[], const char *envv[]) +{ + + bootinfo.bi_kernelname = (bi_ptr_t)kname; + bootinfo.bi_boot2opts = opts & RBX_MASK; + bootinfo.bi_boot_dev_type = dsk.type; + bootinfo.bi_boot_dev_unitptr = dsk.unitptr; + bootinfo.bi_memsize = beri_memsize; +#if 0 + /* + * XXXRW: A possible future way to distinguish Miniboot passing a memory + * size vs DTB..? + */ + if (beri_memsize <= BERI_MEMVSDTB) + bootinfo.bi_memsize = beri_memsize; + else + bootinfo.bi_dtb = beri_memsize; +#endif + ((void(*)(int, const char **, const char **, void *))entryp)(argc, argv, + envv, &bootinfo); +} + +/* + * Boot a kernel that has mysteriously (i.e., by JTAG) appeared in DRAM; + * assume that it is already properly relocated, etc, and invoke its entry + * address without question or concern. + */ +static void +boot_fromdram(void) +{ + void *kaddr = DRAM_KERNEL_ADDR; /* XXXRW: Something better here. */ + Elf64_Ehdr *ehp = kaddr; + + if (!IS_ELF(*ehp)) { + printf("Invalid %s\n", "format"); + return; + } + boot((void *)ehp->e_entry, beri_argc, beri_argv, beri_envv); +} + +static void +boot_fromfs(void) +{ + union { + Elf64_Ehdr eh; + } hdr; + static Elf64_Phdr ep[2]; +#if 0 + static Elf64_Shdr es[2]; +#endif + caddr_t p; + ufs_ino_t ino; + uint64_t addr; + int i, j; + + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); + return; + } + if (xfsread(ino, &hdr, sizeof(hdr))) + return; + + if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = (caddr_t)ep[i].p_paddr; + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); +#if 0 + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } +#endif + addr = hdr.eh.e_entry; +#if 0 + bootinfo.bi_esymtab = VTOP(p); +#endif + } else { + printf("Invalid %s\n", "format"); + return; + } + boot((void *)addr, beri_argc, beri_argv, beri_envv); +} + +static void +load(void) +{ + + switch (dsk.type) { + case BOOTINFO_DEV_TYPE_DRAM: + boot_fromdram(); + break; + + default: + boot_fromfs(); + break; + } +} + +static int +parse() +{ + char *arg = cmd; + char *ep, *p, *q; + char unit; + size_t len; + const char *cp; +#if 0 + int c, i, j; +#else + int c, i; +#endif + + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + cp = "yes"; +#if 0 + } else { + opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); + cp = "no"; + } +#endif + printf("Keyboard: %s\n", cp); + continue; +#if 0 + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* Fall through to error below ('S' not in optstr[]). */ +#endif + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return -1; + opts ^= OPT_SET(flags[i]); + } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; +#if 0 + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } +#endif + } else { + /*- + * Parse a device/kernel name. Format(s): + * + * path + * deviceX:path + * + * NB: Utterly incomprehensible but space-efficient ARM/i386 + * parsing removed in favour of larger but easier-to-read C. This + * is still not great, however -- e.g., relating to unit handling. + * + * TODO: it would be nice if a DRAM pointer could be specified + * here. + * + * XXXRW: Pick up pieces here. + */ + + /* + * Search for a parens; if none, then it's just a path. + * Otherwise, it's a devicename. + */ + arg--; + q = strsep(&arg, ":"); + if (arg != NULL) { + len = strlen(q); + if (len < 2) { + printf("Invalid device: name too short\n"); + return (-1); + } + + /* + * First, handle one-digit unit. + */ + unit = q[len-1]; + if (unit < '0' || unit > '9') { + printf("Invalid device: invalid unit\n", q, + unit); + return (-1); + } + unit -= '0'; + q[len-1] = '\0'; + + /* + * Next, find matching device. + */ + for (i = 0; i < dev_nm_count; i++) { + if (strcmp(q, dev_nm[i]) == 0) + break; + } + if (i == dev_nm_count) { + printf("Invalid device: no driver match\n"); + return (-1); + } + dsk.type = i; + dsk.unitptr = unit; /* Someday: also a DRAM pointer? */ + } else + arg = q; + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } + } + arg = p; + } + return 0; +} + +static int +drvread(void *buf, unsigned lba, unsigned nblk) +{ + + /* XXXRW: eventually, we may want to pass 'drive' and 'unit' here. */ + switch (dsk.type) { + case BOOTINFO_DEV_TYPE_CFI: + return (cfi_read(buf, lba, nblk)); + + case BOOTINFO_DEV_TYPE_SDCARD: + return (altera_sdcard_read(buf, lba, nblk)); + + default: + return (-1); + } +} + +static int +dskread(void *buf, unsigned lba, unsigned nblk) +{ +#if 0 + /* + * XXXRW: For now, assume no partition table around the file system; it's + * just in raw flash. + */ + struct dos_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + + if (!dsk_meta) { + sec = dmadat->secbuf; + dsk.start = 0; + if (drvread(sec, DOSBBSECTOR, 1)) + return -1; + dp = (void *)(sec + DOSPARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < NDOSPART; i++) + if (dp[i].dp_typ == DOSPTYP_386BSD && + (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { + sl = BASE_SLICE + i; + if (dp[i].dp_flag & 0x80 || + dsk.slice == COMPATIBILITY_SLICE) + break; + } + if (dsk.slice == WHOLE_DISK_SLICE) + dsk.slice = sl; + } + if (sl != WHOLE_DISK_SLICE) { + if (sl != COMPATIBILITY_SLICE) + dp += sl - BASE_SLICE; + if (dp->dp_typ != DOSPTYP_386BSD) { + printf("Invalid %s\n", "slice"); + return -1; + } + dsk.start = le32toh(dp->dp_start); + } + if (drvread(sec, dsk.start + LABELSECTOR, 1)) + return -1; + d = (void *)(sec + LABELOFFSET); + if (le32toh(d->d_magic) != DISKMAGIC || + le32toh(d->d_magic2) != DISKMAGIC) { + if (dsk.part != RAW_PART) { + printf("Invalid %s\n", "label"); + return -1; + } + } else { + if (!dsk.init) { + if (le16toh(d->d_type) == DTYPE_SCSI) + dsk.type = TYPE_DA; + dsk.init++; + } + if (dsk.part >= le16toh(d->d_npartitions) || + !(le32toh(d->d_partitions[dsk.part].p_size))) { + printf("Invalid %s\n", "partition"); + return -1; + } + dsk.start += le32toh(d->d_partitions[dsk.part].p_offset); + dsk.start -= le32toh(d->d_partitions[RAW_PART].p_offset); + } + } + return drvread(buf, dsk.start + lba, nblk); +#else + return drvread(buf, lba, nblk); +#endif +} + +void +putchar(int c) +{ + if (c == '\n') + xputc('\r'); + xputc(c); +} + +static int +xputc(int c) +{ + if (ioctrl & IO_KEYBOARD) + putc(c); +#if 0 + if (ioctrl & IO_SERIAL) + sio_putc(c); +#endif + return c; +} + +static int +xgetc(int fn) +{ + if (OPT_CHECK(RBX_NOINTR)) + return 0; + for (;;) { + if (ioctrl & IO_KEYBOARD && keyhit(0)) + return fn ? 1 : getc(); +#if 0 + if (ioctrl & IO_SERIAL && sio_ischar()) + return fn ? 1 : sio_getc(); +#endif + if (fn) + return 0; + } +} Added: head/sys/boot/mips/beri/boot2/flashboot.ldscript ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/boot2/flashboot.ldscript Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2011-2014 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +INCLUDE ../common/common.ldscript + +/* + * When boot2 is loaded via JTAG, it's dropped at 0x10000, and will not need + * to self-relocate, since it will be in DRAM. + */ +__boot2_base__ = 0x100000; +__boot2_base_vaddr__ = __mips64_xkphys_cached__ + __boot2_base__; + +/* + * XXXRW: Currently, miniboot interprets the ELF header rather than jumping + * straight into the loader. For now, give the location where we know it will + * be. + */ +ENTRY(prerelocate_start) +SECTIONS +{ + . = __boot2_base_vaddr__; + . += SIZEOF_HEADERS; + .text ALIGN(0x8): { + relocate.o(.text) + start.o(.text) + *(EXCLUDE_FILE (relocate.o start.o) .text) + } + .data ALIGN(0x8): { *(.data)} + .bss ALIGN(0x8): { *(.bss) } + + __heap = ALIGN(0x8); /* 64-bit aligned heap pointer */ + __data_end = .; + __boot_loader_len__ = . - __boot2_base_vaddr__; + __bss_start = ADDR(.bss); + __bss_end = ALIGN(__bss_start + SIZEOF(.bss), 0x8); +} Added: head/sys/boot/mips/beri/boot2/jtagboot.ldscript ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/boot2/jtagboot.ldscript Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2011-2014 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +INCLUDE ../common/common.ldscript + +/* + * When boot2 is loaded via JTAG, it's dropped at 0x10000, and will not need + * to self-relocate, since it will be in DRAM. + */ +__boot2_base__ = 0x100000; +__boot2_base_vaddr__ = __mips64_xkphys_cached__ + __boot2_base__; + +/* + * XXXRW: Currently, miniboot interprets the ELF header rather than jumping + * straight into the loader. For now, give the location where we know it will + * be. + */ +ENTRY(start) +SECTIONS +{ + . = __boot2_base_vaddr__; + . += SIZEOF_HEADERS; + .text ALIGN(0x8): { + start.o(.text) + *(EXCLUDE_FILE (start.o) .text) + } + .data ALIGN(0x8): { *(.data)} + .bss ALIGN(0x8): { *(.bss) } + + __heap = ALIGN(0x8); /* 64-bit aligned heap pointer */ + __data_end = .; + __boot_loader_len__ = . - __boot2_base_vaddr__; + __bss_start = ADDR(.bss); + __bss_end = ALIGN(__bss_start + SIZEOF(.bss), 0x8); +} Added: head/sys/boot/mips/beri/boot2/relocate.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/mips/beri/boot2/relocate.S Tue Feb 18 23:18:32 2014 (r262197) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2013-2014 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +.set mips64 +.set noreorder +.set nobopt +.set noat + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 18 23:22:55 2014 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 ESMTPS id C9201D0F; Tue, 18 Feb 2014 23:22:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4D6012B6; Tue, 18 Feb 2014 23:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1INMtps004287; Tue, 18 Feb 2014 23:22:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1INMtJ9004285; Tue, 18 Feb 2014 23:22:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402182322.s1INMtJ9004285@svn.freebsd.org> From: Robert Watson Date: Tue, 18 Feb 2014 23:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262198 - in head/sys/boot/mips/beri: boot2 loader 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.17 Precedence: list List-Id: "SVN commit messages 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, 18 Feb 2014 23:22:56 -0000 Author: rwatson Date: Tue Feb 18 23:22:54 2014 New Revision: 262198 URL: http://svnweb.freebsd.org/changeset/base/262198 Log: Replace Apache-style license on two Makefiles with stock 2-clause BSD; license, although the former is pretty safe, it wasn't intended to be used in the version of MIPS boot2/loader upstreamed to FreeBSD. MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Tue Feb 18 23:18:32 2014 (r262197) +++ head/sys/boot/mips/beri/boot2/Makefile Tue Feb 18 23:22:54 2014 (r262198) @@ -6,25 +6,28 @@ # Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) # ("CTSRD"), as part of the DARPA CRASH research programme. # -# @BERI_LICENSE_HEADER_START@ +# 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. # -# Licensed to BERI Open Systems C.I.C (BERI) under one or more contributor -# license agreements. See the NOTICE file distributed with this work for -# additional information regarding copyright ownership. BERI licenses this -# file to you under the BERI Hardware-Software License, Version 1.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at: -# -# http://www.beri-open-systems.org/legal/license-1-0.txt -# -# Unless required by applicable law or agreed to in writing, Work distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# @BERI_LICENSE_HEADER_END@ -# -# $FreeBSD$ +# $FreeBSD$ BINDIR?= /boot INSTALLFLAGS= -b Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Tue Feb 18 23:18:32 2014 (r262197) +++ head/sys/boot/mips/beri/loader/Makefile Tue Feb 18 23:22:54 2014 (r262198) @@ -6,25 +6,27 @@ # Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) # ("CTSRD"), as part of the DARPA CRASH research programme. # -# @BERI_LICENSE_HEADER_START@ +# 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. # -# Licensed to BERI Open Systems C.I.C (BERI) under one or more contributor -# license agreements. See the NOTICE file distributed with this work for -# additional information regarding copyright ownership. BERI licenses this -# file to you under the BERI Hardware-Software License, Version 1.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at: -# -# http://www.beri-open-systems.org/legal/license-1-0.txt -# -# Unless required by applicable law or agreed to in writing, Work distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# -# @BERI_LICENSE_HEADER_END@ -# - # $FreeBSD$ .include From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 04:23:02 2014 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 ESMTPS id 78CB3AA1; Wed, 19 Feb 2014 04:23:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62E2A1517; Wed, 19 Feb 2014 04:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J4N2eG024300; Wed, 19 Feb 2014 04:23:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J4N2IL024298; Wed, 19 Feb 2014 04:23:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190423.s1J4N2IL024298@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 04:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262200 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 04:23:02 -0000 Author: adrian Date: Wed Feb 19 04:23:01 2014 New Revision: 262200 URL: http://svnweb.freebsd.org/changeset/base/262200 Log: Add in a flag to control whether the low or high data word of a register access is latched in first. The AR8327 apparently requires the low data word be latched in first. Obtained from: Linux OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Wed Feb 19 00:35:27 2014 (r262199) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Wed Feb 19 04:23:01 2014 (r262200) @@ -172,10 +172,21 @@ arswitch_readreg(device_t dev, int addr) int arswitch_writereg(device_t dev, int addr, int value) { + struct arswitch_softc *sc; + int r; + + sc = device_get_softc(dev); /* XXX Check the first write too? */ - arswitch_writereg_msb(dev, addr, value); - return (arswitch_writereg_lsb(dev, addr, value)); + if (sc->mii_lo_first) { + r = arswitch_writereg_lsb(dev, addr, value); + r |= arswitch_writereg_msb(dev, addr, value); + } else { + r = arswitch_writereg_msb(dev, addr, value); + r |= arswitch_writereg_lsb(dev, addr, value); + } + + return r; } int Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 00:35:27 2014 (r262199) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 04:23:01 2014 (r262200) @@ -53,6 +53,7 @@ struct arswitch_softc { int is_mii; /* PHY mode is MII (XXX which PHY?) */ int page; int is_internal_switch; + int mii_lo_first; ar8x16_switch_type sc_switchtype; char *ifname[AR8X16_NUM_PHYS]; device_t miibus[AR8X16_NUM_PHYS]; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 04:30:54 2014 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 ESMTPS id 57D87455; Wed, 19 Feb 2014 04:30:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42B22163D; Wed, 19 Feb 2014 04:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J4Us7Y025348; Wed, 19 Feb 2014 04:30:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J4Ur2d025346; Wed, 19 Feb 2014 04:30:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190430.s1J4Ur2d025346@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 04:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262201 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 04:30:54 -0000 Author: adrian Date: Wed Feb 19 04:30:53 2014 New Revision: 262201 URL: http://svnweb.freebsd.org/changeset/base/262201 Log: Store away the chip version and revision; some AR8327 code depends upon the chip revision. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 04:23:01 2014 (r262200) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 04:30:53 2014 (r262201) @@ -112,6 +112,8 @@ arswitch_probe(device_t dev) /* AR8xxx probe */ id = arswitch_readreg(dev, AR8X16_REG_MASK_CTRL); + sc->chip_rev = (id & AR8X16_MASK_CTRL_REV_MASK); + sc->chip_ver = (id & AR8X16_MASK_CTRL_VER_MASK) > AR8X16_MASK_CTRL_VER_SHIFT; switch (id & (AR8X16_MASK_CTRL_VER_MASK | AR8X16_MASK_CTRL_REV_MASK)) { case 0x0101: chipname = "AR8216"; Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 04:23:01 2014 (r262200) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 04:30:53 2014 (r262201) @@ -53,6 +53,8 @@ struct arswitch_softc { int is_mii; /* PHY mode is MII (XXX which PHY?) */ int page; int is_internal_switch; + int chip_ver; + int chip_rev; int mii_lo_first; ar8x16_switch_type sc_switchtype; char *ifname[AR8X16_NUM_PHYS]; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 05:09:48 2014 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 ESMTPS id 5C741DA1; Wed, 19 Feb 2014 05:09:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 480F81886; Wed, 19 Feb 2014 05:09:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J59mXv041013; Wed, 19 Feb 2014 05:09:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J59ls8041011; Wed, 19 Feb 2014 05:09:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190509.s1J59ls8041011@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 05:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262202 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 05:09:48 -0000 Author: adrian Date: Wed Feb 19 05:09:47 2014 New Revision: 262202 URL: http://svnweb.freebsd.org/changeset/base/262202 Log: Add in the AR8327 probe/attach code and switch type. It detects fine, but (as expected) it won't attach just yet, let alone pass traffic. Tested: * DB120, AR8327 switch Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 04:30:53 2014 (r262201) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 05:09:47 2014 (r262202) @@ -129,6 +129,11 @@ arswitch_probe(device_t dev) chipname = "AR8316"; sc->sc_switchtype = AR8X16_SWITCH_AR8316; break; + case 0x1202: + chipname = "AR8327"; + sc->sc_switchtype = AR8X16_SWITCH_AR8327; + sc->mii_lo_first = 1; + break; default: chipname = NULL; } Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 04:30:53 2014 (r262201) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 05:09:47 2014 (r262202) @@ -35,6 +35,8 @@ typedef enum { AR8X16_SWITCH_AR8226, AR8X16_SWITCH_AR8316, AR8X16_SWITCH_AR9340, + AR8X16_SWITCH_AR8327, + AR8X16_SWITCH_AR8337, } ar8x16_switch_type; /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 05:35:42 2014 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 ESMTPS id 651BE499; Wed, 19 Feb 2014 05:35:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35EFA1A7B; Wed, 19 Feb 2014 05:35:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J5ZgAb052743; Wed, 19 Feb 2014 05:35:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J5ZgOE052742; Wed, 19 Feb 2014 05:35:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190535.s1J5ZgOE052742@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 05:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262203 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 05:35:42 -0000 Author: adrian Date: Wed Feb 19 05:35:41 2014 New Revision: 262203 URL: http://svnweb.freebsd.org/changeset/base/262203 Log: Change arswitch_ports_init() to arswitch_port_init(), and teach it to take a single port to setup. This may end up later being used as part of some logic to program the PHY for a single port, rather than having to reinitialise them all at once. Tested: * DB120 Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 05:09:47 2014 (r262202) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 05:35:41 2014 (r262203) @@ -224,24 +224,23 @@ arswitch_set_vlan_mode(struct arswitch_s } static void -arswitch_ports_init(struct arswitch_softc *sc) +arswitch_port_init(struct arswitch_softc *sc, int port) { - int port; /* Port0 - CPU */ - arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), - (AR8X16_IS_SWITCH(sc, AR8216) ? - AR8X16_PORT_STS_SPEED_100 : AR8X16_PORT_STS_SPEED_1000) | - (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_RXFLOW) | - (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_TXFLOW) | - AR8X16_PORT_STS_RXMAC | - AR8X16_PORT_STS_TXMAC | - AR8X16_PORT_STS_DUPLEX); - arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), - arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & - ~AR8X16_PORT_CTRL_HEADER); - - for (port = 1; port <= sc->numphys; port++) { + if (port == AR8X16_PORT_CPU) { + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(0), + (AR8X16_IS_SWITCH(sc, AR8216) ? + AR8X16_PORT_STS_SPEED_100 : AR8X16_PORT_STS_SPEED_1000) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_RXFLOW) | + (AR8X16_IS_SWITCH(sc, AR8216) ? 0 : AR8X16_PORT_STS_TXFLOW) | + AR8X16_PORT_STS_RXMAC | + AR8X16_PORT_STS_TXMAC | + AR8X16_PORT_STS_DUPLEX); + arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0), + arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(0)) & + ~AR8X16_PORT_CTRL_HEADER); + } else { /* Set ports to auto negotiation. */ arswitch_writereg(sc->sc_dev, AR8X16_REG_PORT_STS(port), AR8X16_PORT_STS_LINK_AUTO); @@ -256,6 +255,7 @@ arswitch_attach(device_t dev) { struct arswitch_softc *sc; int err = 0; + int port; sc = device_get_softc(dev); @@ -319,7 +319,9 @@ arswitch_attach(device_t dev) return (err); /* Initialize the switch ports. */ - arswitch_ports_init(sc); + for (port = 0; port <= sc->numphys; port++) { + arswitch_port_init(sc, port); + } /* * Attach the PHYs and complete the bus enumeration. From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 06:01:41 2014 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 ESMTPS id 3A6A1B31; Wed, 19 Feb 2014 06:01:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25B2B1C60; Wed, 19 Feb 2014 06:01:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J61fJD063763; Wed, 19 Feb 2014 06:01:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J61fjF063762; Wed, 19 Feb 2014 06:01:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190601.s1J61fjF063762@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 06:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262204 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 06:01:41 -0000 Author: adrian Date: Wed Feb 19 06:01:40 2014 New Revision: 262204 URL: http://svnweb.freebsd.org/changeset/base/262204 Log: Add a new method to set up the individual port in question. The AR8327 requires some different setup code. Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 05:35:41 2014 (r262203) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 06:01:40 2014 (r262204) @@ -70,8 +70,12 @@ struct arswitch_softc { uint32_t vlan_mode; struct { + /* Global setup */ int (* arswitch_hw_setup) (struct arswitch_softc *); int (* arswitch_hw_global_setup) (struct arswitch_softc *); + + /* Port functions */ + void (* arswitch_port_init) (struct arswitch_softc *, int); } hal; }; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 06:02:48 2014 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 ESMTPS id 938EBC8B; Wed, 19 Feb 2014 06:02:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64F2A1C70; Wed, 19 Feb 2014 06:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J62m89063962; Wed, 19 Feb 2014 06:02:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J62mD6063961; Wed, 19 Feb 2014 06:02:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190602.s1J62mD6063961@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 06:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262205 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 06:02:48 -0000 Author: adrian Date: Wed Feb 19 06:02:47 2014 New Revision: 262205 URL: http://svnweb.freebsd.org/changeset/base/262205 Log: Teach the PHY register path about the different MDIO bus address for the AR8327. Tested: * AR8327, DB120 Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Wed Feb 19 06:01:40 2014 (r262204) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Wed Feb 19 06:02:47 2014 (r262205) @@ -76,6 +76,7 @@ arswitch_readphy(device_t dev, int phy, struct arswitch_softc *sc; uint32_t data = 0, ctrl; int err, timeout; + uint32_t a; sc = device_get_softc(dev); ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); @@ -85,8 +86,13 @@ arswitch_readphy(device_t dev, int phy, if (reg < 0 || reg >= 32) return (ENXIO); + if (AR8X16_IS_SWITCH(sc, AR8327)) + a = AR8327_REG_MDIO_CTRL; + else + a = AR8X16_REG_MDIO_CTRL; + ARSWITCH_LOCK(sc); - err = arswitch_writereg_msb(dev, AR8X16_REG_MDIO_CTRL, + err = arswitch_writereg_msb(dev, a, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_READ | (phy << AR8X16_MDIO_CTRL_PHY_ADDR_SHIFT) | @@ -95,13 +101,13 @@ arswitch_readphy(device_t dev, int phy, if (err != 0) goto fail; for (timeout = 100; timeout--; ) { - ctrl = arswitch_readreg_msb(dev, AR8X16_REG_MDIO_CTRL); + ctrl = arswitch_readreg_msb(dev, a); if ((ctrl & AR8X16_MDIO_CTRL_BUSY) == 0) break; } if (timeout < 0) goto fail; - data = arswitch_readreg_lsb(dev, AR8X16_REG_MDIO_CTRL) & + data = arswitch_readreg_lsb(dev, a) & AR8X16_MDIO_CTRL_DATA_MASK; ARSWITCH_UNLOCK(sc); return (data); @@ -117,6 +123,7 @@ arswitch_writephy(device_t dev, int phy, struct arswitch_softc *sc; uint32_t ctrl; int err, timeout; + uint32_t a; sc = device_get_softc(dev); ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); @@ -124,8 +131,13 @@ arswitch_writephy(device_t dev, int phy, if (reg < 0 || reg >= 32) return (ENXIO); + if (AR8X16_IS_SWITCH(sc, AR8327)) + a = AR8327_REG_MDIO_CTRL; + else + a = AR8X16_REG_MDIO_CTRL; + ARSWITCH_LOCK(sc); - err = arswitch_writereg(dev, AR8X16_REG_MDIO_CTRL, + err = arswitch_writereg(dev, a, AR8X16_MDIO_CTRL_BUSY | AR8X16_MDIO_CTRL_MASTER_EN | AR8X16_MDIO_CTRL_CMD_WRITE | @@ -135,7 +147,7 @@ arswitch_writephy(device_t dev, int phy, if (err != 0) goto out; for (timeout = 100; timeout--; ) { - ctrl = arswitch_readreg(dev, AR8X16_REG_MDIO_CTRL); + ctrl = arswitch_readreg(dev, a); if ((ctrl & AR8X16_MDIO_CTRL_BUSY) == 0) break; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 06:03:59 2014 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 ESMTPS id 5F3CDDDC; Wed, 19 Feb 2014 06:03:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE2D1C78; Wed, 19 Feb 2014 06:03:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J63xLR064156; Wed, 19 Feb 2014 06:03:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J63xK3064155; Wed, 19 Feb 2014 06:03:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190603.s1J63xK3064155@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 06:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262206 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 06:03:59 -0000 Author: adrian Date: Wed Feb 19 06:03:58 2014 New Revision: 262206 URL: http://svnweb.freebsd.org/changeset/base/262206 Log: Turn the port init function into a HAL method and initialise it to the default port init code. This needs to be overridden for the AR8327. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 06:02:47 2014 (r262205) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 06:03:58 2014 (r262206) @@ -224,7 +224,7 @@ arswitch_set_vlan_mode(struct arswitch_s } static void -arswitch_port_init(struct arswitch_softc *sc, int port) +arswitch_port_init_8xxx(struct arswitch_softc *sc, int port) { /* Port0 - CPU */ @@ -266,6 +266,9 @@ arswitch_attach(device_t dev) strlcpy(sc->info.es_name, device_get_desc(dev), sizeof(sc->info.es_name)); + /* Default HAL methods */ + sc->hal.arswitch_port_init = arswitch_port_init_8xxx; + /* * Attach switch related functions */ @@ -320,7 +323,7 @@ arswitch_attach(device_t dev) /* Initialize the switch ports. */ for (port = 0; port <= sc->numphys; port++) { - arswitch_port_init(sc, port); + sc->hal.arswitch_port_init(sc, port); } /* @@ -459,8 +462,15 @@ arswitch_miipollstat(struct arswitch_sof if (sc->miibus[i] == NULL) continue; mii = device_get_softc(sc->miibus[i]); - portstatus = arswitch_readreg(sc->sc_dev, - AR8X16_REG_PORT_STS(arswitch_portforphy(i))); + /* XXX This would be nice to have abstracted out to be per-chip */ + /* AR8327/AR8337 has a different register base */ + if (AR8X16_IS_SWITCH(sc, AR8327)) + portstatus = arswitch_readreg(sc->sc_dev, + AR8327_REG_PORT_STATUS(arswitch_portforphy(i))); + else + portstatus = arswitch_readreg(sc->sc_dev, + AR8X16_REG_PORT_STS(arswitch_portforphy(i))); + #if 0 DPRINTF(sc->sc_dev, "p[%d]=%b\n", i, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 06:35:17 2014 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 ESMTPS id D09E590C; Wed, 19 Feb 2014 06:35:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBF211FBA; Wed, 19 Feb 2014 06:35:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J6ZHID076773; Wed, 19 Feb 2014 06:35:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J6ZHN3076772; Wed, 19 Feb 2014 06:35:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190635.s1J6ZHN3076772@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 06:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262207 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 06:35:17 -0000 Author: adrian Date: Wed Feb 19 06:35:17 2014 New Revision: 262207 URL: http://svnweb.freebsd.org/changeset/base/262207 Log: Add methods for the VLAN port set/get routines. The registers (and perhaps the flags) are different for the AR8327, so I'll stub those out until they're written. Tested: * DB120 - both on-chip AR9340 and AR8327 switches. Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 06:03:58 2014 (r262206) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Wed Feb 19 06:35:17 2014 (r262207) @@ -76,6 +76,12 @@ struct arswitch_softc { /* Port functions */ void (* arswitch_port_init) (struct arswitch_softc *, int); + + /* VLAN functions */ + int (* arswitch_port_vlan_setup) (struct arswitch_softc *, + etherswitch_port_t *); + int (* arswitch_port_vlan_get) (struct arswitch_softc *, + etherswitch_port_t *); } hal; }; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 06:43:53 2014 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 ESMTPS id 5B094E2A; Wed, 19 Feb 2014 06:43:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36D0F109F; Wed, 19 Feb 2014 06:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J6hr6e080320; Wed, 19 Feb 2014 06:43:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J6hrQM080319; Wed, 19 Feb 2014 06:43:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402190643.s1J6hrQM080319@svn.freebsd.org> From: Adrian Chadd Date: Wed, 19 Feb 2014 06:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262208 - head/sys/dev/etherswitch/arswitch 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 06:43:53 -0000 Author: adrian Date: Wed Feb 19 06:43:52 2014 New Revision: 262208 URL: http://svnweb.freebsd.org/changeset/base/262208 Log: Extract out the port VLAN flags/setup code and throw it into two new HAL methods. This allows the AR8327 code to override it as appropriate. Tested: * DB120 - AR8327 and AR9340 on-board switch; only running 'etherswitchcfg' to check configs. The actual VLAN programming wasn't tested. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 06:35:17 2014 (r262207) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed Feb 19 06:43:52 2014 (r262208) @@ -80,6 +80,10 @@ static inline int arswitch_portforphy(in static void arswitch_tick(void *arg); static int arswitch_ifmedia_upd(struct ifnet *); static void arswitch_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int ar8xxx_port_vlan_setup(struct arswitch_softc *sc, + etherswitch_port_t *p); +static int ar8xxx_port_vlan_get(struct arswitch_softc *sc, + etherswitch_port_t *p); static int arswitch_probe(device_t dev) @@ -224,7 +228,7 @@ arswitch_set_vlan_mode(struct arswitch_s } static void -arswitch_port_init_8xxx(struct arswitch_softc *sc, int port) +ar8xxx_port_init(struct arswitch_softc *sc, int port) { /* Port0 - CPU */ @@ -267,7 +271,9 @@ arswitch_attach(device_t dev) sizeof(sc->info.es_name)); /* Default HAL methods */ - sc->hal.arswitch_port_init = arswitch_port_init_8xxx; + sc->hal.arswitch_port_init = ar8xxx_port_init; + sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; + sc->hal.arswitch_port_vlan_get = ar8xxx_port_vlan_get; /* * Attach switch related functions @@ -525,17 +531,9 @@ arswitch_getinfo(device_t dev) } static int -arswitch_getport(device_t dev, etherswitch_port_t *p) +ar8xxx_port_vlan_get(struct arswitch_softc *sc, etherswitch_port_t *p) { - struct arswitch_softc *sc; - struct ifmediareq *ifmr; - struct mii_data *mii; uint32_t reg; - int err; - - sc = device_get_softc(dev); - if (p->es_port < 0 || p->es_port > sc->numphys) - return (ENXIO); ARSWITCH_LOCK(sc); @@ -553,9 +551,29 @@ arswitch_getport(device_t dev, etherswit p->es_flags |= ETHERSWITCH_PORT_STRIPTAG; ARSWITCH_UNLOCK(sc); + return (0); +} + +static int +arswitch_getport(device_t dev, etherswitch_port_t *p) +{ + struct arswitch_softc *sc; + struct mii_data *mii; + struct ifmediareq *ifmr; + int err; + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port > sc->numphys) + return (ENXIO); + + err = sc->hal.arswitch_port_vlan_get(sc, p); + if (err != 0) + return (err); + mii = arswitch_miiforport(sc, p->es_port); - if (p->es_port == 0) { + if (p->es_port == AR8X16_PORT_CPU) { /* fill in fixed values for CPU port */ + /* XXX is this valid in all cases? */ p->es_flags |= ETHERSWITCH_PORT_CPU; ifmr = &p->es_ifmr; ifmr->ifm_count = 0; @@ -575,10 +593,47 @@ arswitch_getport(device_t dev, etherswit } static int +ar8xxx_port_vlan_setup(struct arswitch_softc *sc, etherswitch_port_t *p) +{ + uint32_t reg; + int err; + + ARSWITCH_LOCK(sc); + + /* Set the PVID. */ + if (p->es_pvid != 0) + arswitch_set_pvid(sc, p->es_port, p->es_pvid); + + /* Mutually exclusive. */ + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && + p->es_flags & ETHERSWITCH_PORT_STRIPTAG) { + ARSWITCH_UNLOCK(sc); + return (EINVAL); + } + + reg = 0; + if (p->es_flags & ETHERSWITCH_PORT_DOUBLE_TAG) + reg |= AR8X16_PORT_CTRL_DOUBLE_TAG; + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + if (p->es_flags & ETHERSWITCH_PORT_STRIPTAG) + reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP << + AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; + + err = arswitch_modifyreg(sc->sc_dev, + AR8X16_REG_PORT_CTRL(p->es_port), + 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | + AR8X16_PORT_CTRL_DOUBLE_TAG, reg); + + ARSWITCH_UNLOCK(sc); + return (err); +} + +static int arswitch_setport(device_t dev, etherswitch_port_t *p) { int err; - uint32_t reg; struct arswitch_softc *sc; struct ifmedia *ifm; struct mii_data *mii; @@ -590,38 +645,10 @@ arswitch_setport(device_t dev, etherswit /* Port flags. */ if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { - - ARSWITCH_LOCK(sc); - /* Set the PVID. */ - if (p->es_pvid != 0) - arswitch_set_pvid(sc, p->es_port, p->es_pvid); - - /* Mutually exclusive. */ - if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && - p->es_flags & ETHERSWITCH_PORT_STRIPTAG) { - ARSWITCH_UNLOCK(sc); - return (EINVAL); - } - - reg = 0; - if (p->es_flags & ETHERSWITCH_PORT_DOUBLE_TAG) - reg |= AR8X16_PORT_CTRL_DOUBLE_TAG; - if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) - reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_ADD << - AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; - if (p->es_flags & ETHERSWITCH_PORT_STRIPTAG) - reg |= AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_STRIP << - AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT; - - err = arswitch_modifyreg(sc->sc_dev, - AR8X16_REG_PORT_CTRL(p->es_port), - 0x3 << AR8X16_PORT_CTRL_EGRESS_VLAN_MODE_SHIFT | - AR8X16_PORT_CTRL_DOUBLE_TAG, reg); - - ARSWITCH_UNLOCK(sc); + err = sc->hal.arswitch_port_vlan_setup(sc, p); if (err) return (err); - } + } /* Do not allow media changes on CPU port. */ if (p->es_port == AR8X16_PORT_CPU) From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 07:09:15 2014 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 ESMTPS id 85C4D311; Wed, 19 Feb 2014 07:09:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6011215; Wed, 19 Feb 2014 07:09:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J79FbT089078; Wed, 19 Feb 2014 07:09:15 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J79ENP089072; Wed, 19 Feb 2014 07:09:14 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402190709.s1J79ENP089072@svn.freebsd.org> From: Peter Wemm Date: Wed, 19 Feb 2014 07:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262209 - in head/kerberos5/lib: libasn1 libgssapi_spnego libhdb libhx509 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 07:09:15 -0000 Author: peter Date: Wed Feb 19 07:09:14 2014 New Revision: 262209 URL: http://svnweb.freebsd.org/changeset/base/262209 Log: Really (I think) fix the sporadic heimdal build failures with high -j levels. The root of the problem was that make was attempting to run up to three concurrent asn1_compile commands to produce the three outputs that it was declared to produce. The failure was caused when the asn1_compiles were started out of sync and a later one was truncating the files that another thread was trying to copy. In reality it is supposed to be run exactly once and all three outputs are produced in one pass. Use the same hack as for the parent's Makefile.inc for the compile_et multi-output rule. Modified: head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_spnego/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libhx509/Makefile Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Wed Feb 19 06:43:52 2014 (r262208) +++ head/kerberos5/lib/libasn1/Makefile Wed Feb 19 07:09:14 2014 (r262209) @@ -56,10 +56,12 @@ INCS+= krb5_asn1.h \ digest_asn1.h \ kx509_asn1.h +.ORDER: ${GEN_CMS} ${GEN_CMS}: cms.asn1 cms.opt ${ASN1_COMPILE} --one-code-file \ --option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1 +.ORDER: ${GEN_RFC2459} ${GEN_RFC2459}: rfc2459.asn1 ${ASN1_COMPILE} \ --one-code-file \ @@ -70,32 +72,39 @@ ${GEN_RFC2459}: rfc2459.asn1 --sequence=Extensions \ --sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1 +.ORDER: ${GEN_K5} ${GEN_K5}: krb5.asn1 krb5.opt ${ASN1_COMPILE} \ --one-code-file \ --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} krb5_asn1 +.ORDER: ${GEN_PKINIT} ${GEN_PKINIT}: pkinit.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkinit_asn1 +.ORDER: ${GEN_PKCS8} ${GEN_PKCS8}: pkcs8.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs8_asn1 +.ORDER: ${GEN_PKCS9} ${GEN_PKCS9}: pkcs9.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs9_asn1 +.ORDER: ${GEN_PKCS12} ${GEN_PKCS12}: pkcs12.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs12_asn1 +.ORDER: ${GEN_DIGEST} ${GEN_DIGEST}: digest.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} digest_asn1 +.ORDER: ${GEN_KX509} ${GEN_KX509}: kx509.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} kx509_asn1 Modified: head/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_spnego/Makefile Wed Feb 19 06:43:52 2014 (r262208) +++ head/kerberos5/lib/libgssapi_spnego/Makefile Wed Feb 19 07:09:14 2014 (r262209) @@ -38,6 +38,7 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I. CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} \ spnego_asn1_files spnego_asn1-template.c +.ORDER: ${GEN} ${GEN}: spnego.asn1 spnego.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} spnego_asn1 Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Wed Feb 19 06:43:52 2014 (r262208) +++ head/kerberos5/lib/libhdb/Makefile Wed Feb 19 07:09:14 2014 (r262209) @@ -84,6 +84,7 @@ GEN= asn1_Salt.x \ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} hdb_asn1_files \ hdb_asn1-template.[ch]* +.ORDER: ${GEN} ${GEN}: hdb.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} hdb_asn1 Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Wed Feb 19 06:43:52 2014 (r262208) +++ head/kerberos5/lib/libhx509/Makefile Wed Feb 19 07:09:14 2014 (r262209) @@ -269,14 +269,17 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx INCS+= ocsp_asn1.h pkcs10_asn1.h crmf_asn1.h +.ORDER: ${GEN_OSCP} ${GEN_OCSP}: ocsp.asn1 ocsp.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} ocsp_asn1 +.ORDER: ${GEN_PKCS10} ${GEN_PKCS10}: pkcs10.asn1 pkcs10.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} pkcs10_asn1 +.ORDER: ${GEN_CRMF} ${GEN_CRMF}: crmf.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} crmf_asn1 From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 07:52:00 2014 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 ESMTPS id 19B64C33; Wed, 19 Feb 2014 07:52:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF3A815F6; Wed, 19 Feb 2014 07:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7pxhF007624; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7pxgo007620; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190751.s1J7pxgo007620@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262210 - in stable: 10/sys/netpfil/ipfw 9/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 07:52:00 -0000 Author: dim Date: Wed Feb 19 07:51:58 2014 New Revision: 262210 URL: http://svnweb.freebsd.org/changeset/base/262210 Log: MFC r261915: Under sys/netpfil/ipfw, surround two IPv6-specific static functions with #ifdef INET6, since they are unused when INET6 is disabled. Modified: stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c stable/10/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c stable/9/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:51:58 2014 (r262210) @@ -231,6 +231,7 @@ SYSEND #endif /* SYSCTL_NODE */ +#ifdef INET6 static __inline int hash_packet6(struct ipfw_flow_id *id) { @@ -242,6 +243,7 @@ hash_packet6(struct ipfw_flow_id *id) (id->dst_port) ^ (id->src_port); return i; } +#endif /* * IMPORTANT: the hash function for dynamic rules must be commutative Modified: stable/10/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/10/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:51:58 2014 (r262210) @@ -123,6 +123,7 @@ struct table_xentry { #define OFF_LEN_IFACE (8 * offsetof(struct xaddr_iface, ifname)) +#ifdef INET6 static inline void ipv6_writemask(struct in6_addr *addr6, uint8_t mask) { @@ -132,6 +133,7 @@ ipv6_writemask(struct in6_addr *addr6, u *cp++ = 0xFFFFFFFF; *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); } +#endif int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 07:51:59 2014 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 ESMTPS id 89161C32; Wed, 19 Feb 2014 07:51:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 593FF15F5; Wed, 19 Feb 2014 07:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7pxJJ007613; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7pxiN007610; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190751.s1J7pxiN007610@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:51: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: r262210 - in stable: 10/sys/netpfil/ipfw 9/sys/netpfil/ipfw 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 07:51:59 -0000 Author: dim Date: Wed Feb 19 07:51:58 2014 New Revision: 262210 URL: http://svnweb.freebsd.org/changeset/base/262210 Log: MFC r261915: Under sys/netpfil/ipfw, surround two IPv6-specific static functions with #ifdef INET6, since they are unused when INET6 is disabled. Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c stable/9/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c stable/10/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:51:58 2014 (r262210) @@ -231,6 +231,7 @@ SYSEND #endif /* SYSCTL_NODE */ +#ifdef INET6 static __inline int hash_packet6(struct ipfw_flow_id *id) { @@ -242,6 +243,7 @@ hash_packet6(struct ipfw_flow_id *id) (id->dst_port) ^ (id->src_port); return i; } +#endif /* * IMPORTANT: the hash function for dynamic rules must be commutative Modified: stable/9/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/9/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:51:58 2014 (r262210) @@ -123,6 +123,7 @@ struct table_xentry { #define OFF_LEN_IFACE (8 * offsetof(struct xaddr_iface, ifname)) +#ifdef INET6 static inline void ipv6_writemask(struct in6_addr *addr6, uint8_t mask) { @@ -132,6 +133,7 @@ ipv6_writemask(struct in6_addr *addr6, u *cp++ = 0xFFFFFFFF; *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); } +#endif int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 07:55:29 2014 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 ESMTPS id 28E14F42; Wed, 19 Feb 2014 07:55:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 147891647; Wed, 19 Feb 2014 07:55:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7tSVb008147; Wed, 19 Feb 2014 07:55:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7tSWp008146; Wed, 19 Feb 2014 07:55:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190755.s1J7tSWp008146@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262211 - stable/10/sys/fs/nandfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 07:55:29 -0000 Author: dim Date: Wed Feb 19 07:55:28 2014 New Revision: 262211 URL: http://svnweb.freebsd.org/changeset/base/262211 Log: MFC r261914: In sys/fs/nandfs/nandfs_vfsops.c, #if 0 an unused static function. Modified: stable/10/sys/fs/nandfs/nandfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- stable/10/sys/fs/nandfs/nandfs_vfsops.c Wed Feb 19 07:51:58 2014 (r262210) +++ stable/10/sys/fs/nandfs/nandfs_vfsops.c Wed Feb 19 07:55:28 2014 (r262211) @@ -285,6 +285,7 @@ nandfs_sblocks_in_block(struct nandfs_de return (fsdev->nd_devblocksize / sizeof(struct nandfs_super_block)); } +#if 0 static __inline int nandfs_sblocks_in_first_block(struct nandfs_device *fsdev) { @@ -297,6 +298,7 @@ nandfs_sblocks_in_first_block(struct nan return (n); } +#endif static int nandfs_write_superblock_at(struct nandfs_device *fsdev, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 07:59:51 2014 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 ESMTPS id EE646277; Wed, 19 Feb 2014 07:59:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D81CD1690; Wed, 19 Feb 2014 07:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7xpWT008625; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7xpp3008624; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190759.s1J7xpp3008624@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262212 - in stable: 10/sys/dev/xen/console 9/sys/dev/xen/console X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 07:59:52 -0000 Author: dim Date: Wed Feb 19 07:59:50 2014 New Revision: 262212 URL: http://svnweb.freebsd.org/changeset/base/262212 Log: MFC r261916: In sys/dev/xen/console/console.c, #if 0 an unused static function. Modified: stable/10/sys/dev/xen/console/console.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/xen/console/console.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/xen/console/console.c ============================================================================== --- stable/10/sys/dev/xen/console/console.c Wed Feb 19 07:55:28 2014 (r262211) +++ stable/10/sys/dev/xen/console/console.c Wed Feb 19 07:59:50 2014 (r262212) @@ -356,6 +356,7 @@ xcclose(struct tty *tp) xen_console_up = 0; } +#if 0 static inline int __xencons_put_char(int ch) { @@ -365,6 +366,7 @@ __xencons_put_char(int ch) wbuf[WBUF_MASK(wp++)] = _ch; return 1; } +#endif static void From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 07:59:51 2014 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 ESMTPS id 98FE5276; Wed, 19 Feb 2014 07:59:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81721168F; Wed, 19 Feb 2014 07:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7xpgP008619; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7xp7x008618; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190759.s1J7xp7x008618@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:59:51 +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: r262212 - in stable: 10/sys/dev/xen/console 9/sys/dev/xen/console 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 07:59:51 -0000 Author: dim Date: Wed Feb 19 07:59:50 2014 New Revision: 262212 URL: http://svnweb.freebsd.org/changeset/base/262212 Log: MFC r261916: In sys/dev/xen/console/console.c, #if 0 an unused static function. Modified: stable/9/sys/dev/xen/console/console.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/xen/console/console.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/xen/console/console.c ============================================================================== --- stable/9/sys/dev/xen/console/console.c Wed Feb 19 07:55:28 2014 (r262211) +++ stable/9/sys/dev/xen/console/console.c Wed Feb 19 07:59:50 2014 (r262212) @@ -358,6 +358,7 @@ xcclose(struct tty *tp) xen_console_up = 0; } +#if 0 static inline int __xencons_put_char(int ch) { @@ -367,6 +368,7 @@ __xencons_put_char(int ch) wbuf[WBUF_MASK(wp++)] = _ch; return 1; } +#endif static void From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 08:05:43 2014 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 ESMTPS id 135927B3; Wed, 19 Feb 2014 08:05:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0F7E1743; Wed, 19 Feb 2014 08:05:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J85gMf012501; Wed, 19 Feb 2014 08:05:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J85gkg012500; Wed, 19 Feb 2014 08:05:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190805.s1J85gkg012500@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 08:05: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: r262213 - in stable: 10/sys/dev/usb/controller 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 08:05:43 -0000 Author: dim Date: Wed Feb 19 08:05:42 2014 New Revision: 262213 URL: http://svnweb.freebsd.org/changeset/base/262213 Log: MFC r261977: In sys/dev/usb/controller/musb_otg.c, fix a warning about musbotg_odevd being unused, by adding it to the part that handles getting descriptors. Reviewed by: hselasky Modified: stable/9/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/9/sys/dev/usb/controller/musb_otg.c Wed Feb 19 07:59:50 2014 (r262212) +++ stable/9/sys/dev/usb/controller/musb_otg.c Wed Feb 19 08:05:42 2014 (r262213) @@ -3776,6 +3776,13 @@ tr_handle_get_descriptor: len = sizeof(musbotg_devd); ptr = (const void *)&musbotg_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(musbotg_odevd); + ptr = (const void *)&musbotg_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 08:05:43 2014 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 ESMTPS id 65BDE7B5; Wed, 19 Feb 2014 08:05:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5189C1744; Wed, 19 Feb 2014 08:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J85hPi012507; Wed, 19 Feb 2014 08:05:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J85haY012506; Wed, 19 Feb 2014 08:05:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190805.s1J85haY012506@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 08:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262213 - in stable: 10/sys/dev/usb/controller 9/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 08:05:43 -0000 Author: dim Date: Wed Feb 19 08:05:42 2014 New Revision: 262213 URL: http://svnweb.freebsd.org/changeset/base/262213 Log: MFC r261977: In sys/dev/usb/controller/musb_otg.c, fix a warning about musbotg_odevd being unused, by adding it to the part that handles getting descriptors. Reviewed by: hselasky Modified: stable/10/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/musb_otg.c Wed Feb 19 07:59:50 2014 (r262212) +++ stable/10/sys/dev/usb/controller/musb_otg.c Wed Feb 19 08:05:42 2014 (r262213) @@ -3776,6 +3776,13 @@ tr_handle_get_descriptor: len = sizeof(musbotg_devd); ptr = (const void *)&musbotg_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(musbotg_odevd); + ptr = (const void *)&musbotg_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 08:15:10 2014 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 ESMTPS id 4C344D3D; Wed, 19 Feb 2014 08:15:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37EA41818; Wed, 19 Feb 2014 08:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J8FAvd017297; Wed, 19 Feb 2014 08:15:10 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J8FAfl017296; Wed, 19 Feb 2014 08:15:10 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402190815.s1J8FAfl017296@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 19 Feb 2014 08:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262214 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 08:15:10 -0000 Author: luigi Date: Wed Feb 19 08:15:09 2014 New Revision: 262214 URL: http://svnweb.freebsd.org/changeset/base/262214 Log: allow building without INET Modified: stable/10/sys/dev/netmap/netmap_freebsd.c Modified: stable/10/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_freebsd.c Wed Feb 19 08:05:42 2014 (r262213) +++ stable/10/sys/dev/netmap/netmap_freebsd.c Wed Feb 19 08:15:09 2014 (r262214) @@ -101,6 +101,7 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { +#ifdef INET uint16_t pseudolen = datalen + iph->protocol; /* Compute and insert the pseudo-header cheksum. */ @@ -110,6 +111,13 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr * (includes the pseudo-header). */ *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet4 segmentation not supported"); + } +#endif } void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 08:29:08 2014 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 ESMTPS id 2A001341; Wed, 19 Feb 2014 08:29:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 163DB18DD; Wed, 19 Feb 2014 08:29:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J8T7Dd021910; Wed, 19 Feb 2014 08:29:07 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J8T7fQ021909; Wed, 19 Feb 2014 08:29:07 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201402190829.s1J8T7fQ021909@svn.freebsd.org> From: Marko Zec Date: Wed, 19 Feb 2014 08:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262215 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 08:29:08 -0000 Author: zec Date: Wed Feb 19 08:29:07 2014 New Revision: 262215 URL: http://svnweb.freebsd.org/changeset/base/262215 Log: V_irtualize rtsock refcounting, which reduces the chances for panics on teardown of vnets without active routing sockets while at least one routing socket is active elsewhere. Tested by: Vijay Singh MFC after: 3 days Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Feb 19 08:15:09 2014 (r262214) +++ head/sys/net/rtsock.c Wed Feb 19 08:29:07 2014 (r262215) @@ -154,12 +154,14 @@ int (*carp_get_vhid_p)(struct ifaddr *); */ #define RTS_FILTER_FIB M_PROTO8 -static struct { +typedef struct { int ip_count; /* attached w/ AF_INET */ int ip6_count; /* attached w/ AF_INET6 */ int ipx_count; /* attached w/ AF_IPX */ int any_count; /* total attached */ -} route_cb; +} route_cb_t; +static VNET_DEFINE(route_cb_t, route_cb); +#define V_route_cb VNET(route_cb) struct mtx rtsock_mtx; MTX_SYSINIT(rtsock, &rtsock_mtx, "rtsock route_cb lock", MTX_DEF); @@ -317,16 +319,16 @@ rts_attach(struct socket *so, int proto, RTSOCK_LOCK(); switch(rp->rcb_proto.sp_protocol) { case AF_INET: - route_cb.ip_count++; + V_route_cb.ip_count++; break; case AF_INET6: - route_cb.ip6_count++; + V_route_cb.ip6_count++; break; case AF_IPX: - route_cb.ipx_count++; + V_route_cb.ipx_count++; break; } - route_cb.any_count++; + V_route_cb.any_count++; RTSOCK_UNLOCK(); soisconnected(so); so->so_options |= SO_USELOOPBACK; @@ -360,16 +362,16 @@ rts_detach(struct socket *so) RTSOCK_LOCK(); switch(rp->rcb_proto.sp_protocol) { case AF_INET: - route_cb.ip_count--; + V_route_cb.ip_count--; break; case AF_INET6: - route_cb.ip6_count--; + V_route_cb.ip6_count--; break; case AF_IPX: - route_cb.ipx_count--; + V_route_cb.ipx_count--; break; } - route_cb.any_count--; + V_route_cb.any_count--; RTSOCK_UNLOCK(); raw_usrreqs.pru_detach(so); } @@ -943,7 +945,7 @@ flush: * Check to see if we don't want our own messages. */ if ((so->so_options & SO_USELOOPBACK) == 0) { - if (route_cb.any_count <= 1) { + if (V_route_cb.any_count <= 1) { if (rtm) Free(rtm); m_freem(m); @@ -1274,7 +1276,7 @@ rt_missmsg_fib(int type, struct rt_addri struct mbuf *m; struct sockaddr *sa = rtinfo->rti_info[RTAX_DST]; - if (route_cb.any_count == 0) + if (V_route_cb.any_count == 0) return; m = rt_msg1(type, rtinfo); if (m == NULL) @@ -1312,7 +1314,7 @@ rt_ifmsg(struct ifnet *ifp) struct mbuf *m; struct rt_addrinfo info; - if (route_cb.any_count == 0) + if (V_route_cb.any_count == 0) return; bzero((caddr_t)&info, sizeof(info)); m = rt_msg1(RTM_IFINFO, &info); @@ -1342,7 +1344,7 @@ rtsock_addrmsg(int cmd, struct ifaddr *i struct ifa_msghdr *ifam; struct ifnet *ifp = ifa->ifa_ifp; - if (route_cb.any_count == 0) + if (V_route_cb.any_count == 0) return (0); ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR; @@ -1390,7 +1392,7 @@ rtsock_routemsg(int cmd, struct ifnet *i struct mbuf *m; struct rt_msghdr *rtm; - if (route_cb.any_count == 0) + if (V_route_cb.any_count == 0) return (0); bzero((caddr_t)&info, sizeof(info)); @@ -1428,7 +1430,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiad struct ifnet *ifp = ifma->ifma_ifp; struct ifma_msghdr *ifmam; - if (route_cb.any_count == 0) + if (V_route_cb.any_count == 0) return; bzero((caddr_t)&info, sizeof(info)); @@ -1457,7 +1459,7 @@ rt_makeifannouncemsg(struct ifnet *ifp, struct if_announcemsghdr *ifan; struct mbuf *m; - if (route_cb.any_count == 0) + if (V_route_cb.any_count == 0) return NULL; bzero((caddr_t)info, sizeof(*info)); m = rt_msg1(type, info); From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 09:19:10 2014 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 ESMTPS id 6A66E3CD; Wed, 19 Feb 2014 09:19:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 485FF1D8B; Wed, 19 Feb 2014 09:19:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J9JAX2044292; Wed, 19 Feb 2014 09:19:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J9JAAJ044291; Wed, 19 Feb 2014 09:19:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402190919.s1J9JAAJ044291@svn.freebsd.org> From: Robert Watson Date: Wed, 19 Feb 2014 09:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262217 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 09:19:10 -0000 Author: rwatson Date: Wed Feb 19 09:19:09 2014 New Revision: 262217 URL: http://svnweb.freebsd.org/changeset/base/262217 Log: Update MIPS bootinfo.h to reflect the actual MIPS boot2/loader boot-time interface. MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/mips/include/bootinfo.h Modified: head/sys/mips/include/bootinfo.h ============================================================================== --- head/sys/mips/include/bootinfo.h Wed Feb 19 09:13:55 2014 (r262216) +++ head/sys/mips/include/bootinfo.h Wed Feb 19 09:19:09 2014 (r262217) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2013 Robert N. M. Watson * Copyright (C) 1994 by Rodney W. Grimes, Milwaukie, Oregon 97222 * All rights reserved. * @@ -36,33 +37,15 @@ #define _MACHINE_BOOTINFO_H_ /* Only change the version number if you break compatibility. */ -#define BOOTINFO_VERSION 1 - -#define N_BIOS_GEOM 8 +#define BOOTINFO_VERSION 2 #define MIPS_BOOTINFO_MAGIC 0xCDEACDEA -/* Extended OLV bootinfo struct. The data area includes a list of named - OIDs and associated data values. The format is: - - NUL-terminated dotted-string name - 2 byte length, in big-endian order - LENGTH bytes of data - [...] - - The two magic fields are used to guard against other bootloaders that - may place other sorts of data here. */ - -struct bootinfo_ext { -#define BOOTINFO_EXT_MAGIC1 0x55aa00ff - unsigned int magic1; - unsigned char *data; - unsigned int size; -#define BOOTINFO_EXT_MAGIC2 0x32719187 - unsigned int magic2; -}; - -#define BOOTINFO_EXT_MAX_SIZE 16384 +#if defined(__mips_n32) || defined(__mips_n64) +typedef uint64_t bi_ptr_t; +#else +typedef uint32_t bi_ptr_t; +#endif /* * A zero bootinfo field often means that there is no info available. @@ -70,73 +53,33 @@ struct bootinfo_ext { * normal value. */ struct bootinfo { - u_int32_t bi_version; - u_int32_t bi_kernelname; /* represents a char * */ - u_int32_t bi_nfs_diskless; /* struct nfs_diskless * */ - /* End of fields that are always present. */ -#define bi_endcommon bi_n_bios_used - u_int32_t bi_n_bios_used; - u_int32_t bi_bios_geom[N_BIOS_GEOM]; - u_int32_t bi_size; - u_int8_t bi_memsizes_valid; - u_int8_t bi_bios_dev; /* bootdev BIOS unit number */ - u_int8_t bi_pad[2]; - u_int32_t bi_basemem; - u_int32_t bi_extmem; - u_int32_t bi_symtab; /* struct symtab * */ - u_int32_t bi_esymtab; /* struct symtab * */ - /* Items below only from advanced bootloader */ - u_int32_t bi_kernend; /* end of kernel space */ - u_int32_t bi_envp; /* environment */ - u_int32_t bi_modulep; /* preloaded modules */ + /* bootinfo meta-data. */ + uint32_t bi_version; + uint32_t bi_size; + + /* bootinfo contents. */ + uint64_t bi_boot2opts; /* boot2 flags to loader. */ + bi_ptr_t bi_kernelname; /* Pointer to name. */ + bi_ptr_t bi_nfs_diskless;/* Pointer to NFS data. */ + bi_ptr_t bi_dtb; /* Pointer to dtb. */ + bi_ptr_t bi_memsize; /* Physical memory size in bytes. */ + bi_ptr_t bi_modulep; /* Preloaded modules. */ + bi_ptr_t bi_boot_dev_type; /* Boot-device type. */ + bi_ptr_t bi_boot_dev_unitptr; /* Boot-device unit/pointer. */ }; +/* + * Possible boot-device types passed from boot2 to loader, loader to kernel. + * In most cases, the object pointed to will hold a filesystem; one exception + * is BOOTINFO_DEV_TYPE_DRAM, which points to a pre-loaded object (e.g., + * loader, kernel). + */ +#define BOOTINFO_DEV_TYPE_DRAM 0 /* DRAM loader/kernel (ptr). */ +#define BOOTINFO_DEV_TYPE_CFI 1 /* CFI flash (unit). */ +#define BOOTINFO_DEV_TYPE_SDCARD 2 /* SD card (unit). */ + #ifdef _KERNEL extern struct bootinfo bootinfo; #endif -/* - * Constants for converting boot-style device number to type, - * adaptor (uba, mba, etc), unit number and partition number. - * Type (== major device number) is in the low byte - * for backward compatibility. Except for that of the "magic - * number", each mask applies to the shifted value. - * Format: - * (4) (4) (4) (4) (8) (8) - * -------------------------------- - * |MA | AD| CT| UN| PART | TYPE | - * -------------------------------- - */ -#define B_ADAPTORSHIFT 24 -#define B_ADAPTORMASK 0x0f -#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK) -#define B_CONTROLLERSHIFT 20 -#define B_CONTROLLERMASK 0xf -#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK) -#define B_SLICESHIFT 20 -#define B_SLICEMASK 0xff -#define B_SLICE(val) (((val)>>B_SLICESHIFT) & B_SLICEMASK) -#define B_UNITSHIFT 16 -#define B_UNITMASK 0xf -#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK) -#define B_PARTITIONSHIFT 8 -#define B_PARTITIONMASK 0xff -#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK) -#define B_TYPESHIFT 0 -#define B_TYPEMASK 0xff -#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK) - -#define B_MAGICMASK 0xf0000000 -#define B_DEVMAGIC 0xa0000000 - -#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \ - (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \ - ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \ - ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC) - -#define BASE_SLICE 2 -#define COMPATIBILITY_SLICE 0 -#define MAX_SLICES 32 -#define WHOLE_DISK_SLICE 1 - #endif /* !_MACHINE_BOOTINFO_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 10:17:44 2014 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 ESMTPS id 1D61F5FF; Wed, 19 Feb 2014 10:17:44 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9971113CF; Wed, 19 Feb 2014 10:17:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s1JAHaCf074822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Feb 2014 14:17:36 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1JAHacb074821; Wed, 19 Feb 2014 14:17:36 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 19 Feb 2014 14:17:36 +0400 From: Gleb Smirnoff To: Martin Matuska Subject: Re: svn commit: r262196 - head/sys/netpfil/pf Message-ID: <20140219101736.GX63039@glebius.int.ru> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402182217.s1IMHCeM077356@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 10:17:44 -0000 Martin, On Tue, Feb 18, 2014 at 10:17:12PM +0000, Martin Matuska wrote: M> Author: mm M> Date: Tue Feb 18 22:17:12 2014 M> New Revision: 262196 M> URL: http://svnweb.freebsd.org/changeset/base/262196 M> M> Log: M> De-virtualize pf_mtag_z [1] M> Process V_pf_overloadqueue in vnet context [2] M> M> This fixes two VIMAGE kernel panics and allows to simultaneously run host-pf M> and vnet jails. pf inside jails remains broken. M> M> PR: kern/182964 M> Submitted by: glebius@FreeBSD.org [2], myself [1] M> Tested by: rodrigc@FreeBSD.org, myself M> MFC after: 2 weeks I've sent your patch to Nikos, who is working on pf+vimage. He also accumulates his work on pf+vimage in projects/pf branch, planning to do it properly and then merge to head in one go. I was waiting for his review. Yes, he is slow with reviews, but that's not a reason to commit w/o review. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 13:01:24 2014 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 ESMTPS id DD3FCCD6; Wed, 19 Feb 2014 13:01:24 +0000 (UTC) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:150:6101::4]) by mx1.freebsd.org (Postfix) with ESMTP id 859D914B3; Wed, 19 Feb 2014 13:01:24 +0000 (UTC) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id B543CDD25; Wed, 19 Feb 2014 14:01:23 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id SRo5SYNWmO9R; Wed, 19 Feb 2014 14:01:23 +0100 (CET) Received: from mail.vx.sk (localhost [IPv6:::1]) by mail.vx.sk (Postfix) with ESMTPSA id 2662DDD13; Wed, 19 Feb 2014 14:01:23 +0100 (CET) Received: from 10.0.0.18 ([10.0.0.18]) by mail.vx.sk (Horde Framework) with HTTP; Wed, 19 Feb 2014 14:01:23 +0100 Date: Wed, 19 Feb 2014 14:01:23 +0100 Message-ID: <20140219140123.Horde.zrXx5GqkiiaAfGIetc98KQ1@mail.vx.sk> From: Martin Matuska To: Gleb Smirnoff Subject: Re: svn commit: r262196 - head/sys/netpfil/pf References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219101736.GX63039@glebius.int.ru> In-Reply-To: <20140219101736.GX63039@glebius.int.ru> User-Agent: Internet Messaging Program (IMP) H5 (6.1.6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Description: =?utf-8?b?U3Byw6F2YQ==?= s =?utf-8?b?xI1pc3TDvW0=?= textom X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 13:01:24 -0000 Hi Gleb, I understand your point - if anything is broken (or more broken than before) I can revert this patch anytime. FreeNAS and other folks may fork separate branches and we can wait until about FreeBSD 12.0 for the patch being reviewed so we can commit it around 14.0 - maybe we have switched to a completely different firewall at that time and this issue becomes obsolete anyway. Best regards, mm Quoting Gleb Smirnoff : > Martin, > > On Tue, Feb 18, 2014 at 10:17:12PM +0000, Martin Matuska wrote: > M> Author: mm > M> Date: Tue Feb 18 22:17:12 2014 > M> New Revision: 262196 > M> URL: http://svnweb.freebsd.org/changeset/base/262196 > M> > M> Log: > M>   De-virtualize pf_mtag_z [1] > M>   Process V_pf_overloadqueue in vnet context [2] > M> > M>   This fixes two VIMAGE kernel panics and allows to simultaneously > run host-pf > M>   and vnet jails. pf inside jails remains broken. > M> > M>   PR:                kern/182964 > M>   Submitted by:        glebius@FreeBSD.org [2], myself [1] > M>   Tested by:        rodrigc@FreeBSD.org, myself > M>   MFC after:        2 weeks > > I've sent your patch to Nikos, who is working on pf+vimage. He > also accumulates his work on pf+vimage in projects/pf branch, > planning to do it properly and then merge to head in one go. > I was waiting for his review. Yes, he is slow with reviews, > but that's not a reason to commit w/o review. > > --Totus tuus, Glebius. -- Martin Matuska FreeBSD committer http://blog.vx.sk From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 13:06:50 2014 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 ESMTPS id B7EF5EB3; Wed, 19 Feb 2014 13:06:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3B3014F8; Wed, 19 Feb 2014 13:06:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JD6o2L038348; Wed, 19 Feb 2014 13:06:50 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JD6o5g038347; Wed, 19 Feb 2014 13:06:50 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402191306.s1JD6o5g038347@svn.freebsd.org> From: Bryan Drewery Date: Wed, 19 Feb 2014 13:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262220 - head/share/termcap 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 13:06:50 -0000 Author: bdrewery Date: Wed Feb 19 13:06:50 2014 New Revision: 262220 URL: http://svnweb.freebsd.org/changeset/base/262220 Log: Add missing Save Cursor support for VT520 Submitted by: IWAMOTO Kouichi PR: conf/174937 Obtained from: http://web.mit.edu/dosathena/doc/www/ek-vt520-rm.pdf Approved by: bapt (mentor) MFC after: 2 weeks Modified: head/share/termcap/termcap.src Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Wed Feb 19 09:56:00 2014 (r262219) +++ head/share/termcap/termcap.src Wed Feb 19 13:06:50 2014 (r262220) @@ -2729,7 +2729,7 @@ vt520|DEC VT520 :\ :kb=\b:kd=\E[B:ke=\E>:kl=\E[D:\ :kr=\E[C:ks=\E=:ku=\E[A:nd=\E[C:\ :rc=\E8:rf=/usr/lib/tabset/vt100:\ - :se=\E[m:so=\E[7m:\ + :sc=\E7:se=\E[m:so=\E[7m:\ :sr=\EM:ue=\E[m:up=\E[A:us=\E[4m:nl=\E[B:ko=do,nd,up: # vt520nam|vt520-nam|v520n|DEC VT520 with no automargins:\ From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 15:00:56 2014 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 ESMTPS id 7AD6C8B9; Wed, 19 Feb 2014 15:00:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6545E1FA7; Wed, 19 Feb 2014 15:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JF0uDK085048; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JF0uQ2085047; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191500.s1JF0uQ2085047@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 15:00:56 +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: r262221 - in stable: 8/lib/libthr/thread 9/lib/libthr/thread 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 15:00:56 -0000 Author: jhb Date: Wed Feb 19 15:00:55 2014 New Revision: 262221 URL: http://svnweb.freebsd.org/changeset/base/262221 Log: MFC 250691: Return one-based key so that user can check if the key is ever allocated in the first place. Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Changes in other areas also in this revision: Modified: stable/9/lib/libthr/thread/thr_spec.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/8/lib/libthr/thread/thr_spec.c Wed Feb 19 13:06:50 2014 (r262220) +++ stable/8/lib/libthr/thread/thr_spec.c Wed Feb 19 15:00:55 2014 (r262221) @@ -69,7 +69,7 @@ _pthread_key_create(pthread_key_t *key, /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); - *key = i; + *key = i + 1; return (0); } @@ -80,9 +80,10 @@ _pthread_key_create(pthread_key_t *key, } int -_pthread_key_delete(pthread_key_t key) +_pthread_key_delete(pthread_key_t userkey) { struct pthread *curthread = _get_curthread(); + int key = userkey - 1; int ret = 0; if ((unsigned int)key < PTHREAD_KEYS_MAX) { @@ -177,9 +178,10 @@ pthread_key_allocate_data(void) } int -_pthread_setspecific(pthread_key_t key, const void *value) +_pthread_setspecific(pthread_key_t userkey, const void *value) { struct pthread *pthread; + pthread_key_t key = userkey - 1; int ret = 0; /* Point to the running thread: */ @@ -208,9 +210,10 @@ _pthread_setspecific(pthread_key_t key, } void * -_pthread_getspecific(pthread_key_t key) +_pthread_getspecific(pthread_key_t userkey) { struct pthread *pthread; + pthread_key_t key = userkey - 1; const void *data; /* Point to the running thread: */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 15:00:56 2014 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 ESMTPS id CF1468BA; Wed, 19 Feb 2014 15:00:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8DB01FA8; Wed, 19 Feb 2014 15:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JF0ux1085054; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JF0u1v085053; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191500.s1JF0u1v085053@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 15:00:56 +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: r262221 - in stable: 8/lib/libthr/thread 9/lib/libthr/thread 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 15:00:56 -0000 Author: jhb Date: Wed Feb 19 15:00:55 2014 New Revision: 262221 URL: http://svnweb.freebsd.org/changeset/base/262221 Log: MFC 250691: Return one-based key so that user can check if the key is ever allocated in the first place. Modified: stable/9/lib/libthr/thread/thr_spec.c Directory Properties: stable/9/lib/libthr/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/9/lib/libthr/thread/thr_spec.c Wed Feb 19 13:06:50 2014 (r262220) +++ stable/9/lib/libthr/thread/thr_spec.c Wed Feb 19 15:00:55 2014 (r262221) @@ -70,7 +70,7 @@ _pthread_key_create(pthread_key_t *key, /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); - *key = i; + *key = i + 1; return (0); } @@ -81,9 +81,10 @@ _pthread_key_create(pthread_key_t *key, } int -_pthread_key_delete(pthread_key_t key) +_pthread_key_delete(pthread_key_t userkey) { struct pthread *curthread = _get_curthread(); + int key = userkey - 1; int ret = 0; if ((unsigned int)key < PTHREAD_KEYS_MAX) { @@ -178,9 +179,10 @@ pthread_key_allocate_data(void) } int -_pthread_setspecific(pthread_key_t key, const void *value) +_pthread_setspecific(pthread_key_t userkey, const void *value) { struct pthread *pthread; + pthread_key_t key = userkey - 1; int ret = 0; /* Point to the running thread: */ @@ -209,9 +211,10 @@ _pthread_setspecific(pthread_key_t key, } void * -_pthread_getspecific(pthread_key_t key) +_pthread_getspecific(pthread_key_t userkey) { struct pthread *pthread; + pthread_key_t key = userkey - 1; const void *data; /* Point to the running thread: */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 15:32:31 2014 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 ESMTPS id E4E8E8B6; Wed, 19 Feb 2014 15:32:30 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AEE91307; Wed, 19 Feb 2014 15:32:29 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s1JFWFW7076483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Feb 2014 19:32:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1JFWFw6076482; Wed, 19 Feb 2014 19:32:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 19 Feb 2014 19:32:15 +0400 From: Gleb Smirnoff To: Martin Matuska Subject: Re: svn commit: r262196 - head/sys/netpfil/pf Message-ID: <20140219153215.GD63039@FreeBSD.org> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219101736.GX63039@glebius.int.ru> <20140219140123.Horde.zrXx5GqkiiaAfGIetc98KQ1@mail.vx.sk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140219140123.Horde.zrXx5GqkiiaAfGIetc98KQ1@mail.vx.sk> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 15:32:31 -0000 Martin, M> > On Tue, Feb 18, 2014 at 10:17:12PM +0000, Martin Matuska wrote: M> > M> Author: mm M> > M> Date: Tue Feb 18 22:17:12 2014 M> > M> New Revision: 262196 M> > M> URL: http://svnweb.freebsd.org/changeset/base/262196 M> > M> M> > M> Log: M> > M>   De-virtualize pf_mtag_z [1] M> > M>   Process V_pf_overloadqueue in vnet context [2] M> > M> M> > M>   This fixes two VIMAGE kernel panics and allows to simultaneously M> > run host-pf M> > M>   and vnet jails. pf inside jails remains broken. M> > M> M> > M>   PR:                kern/182964 M> > M>   Submitted by:        glebius@FreeBSD.org [2], myself [1] M> > M>   Tested by:        rodrigc@FreeBSD.org, myself M> > M>   MFC after:        2 weeks M> > M> > I've sent your patch to Nikos, who is working on pf+vimage. He M> > also accumulates his work on pf+vimage in projects/pf branch, M> > planning to do it properly and then merge to head in one go. M> > I was waiting for his review. Yes, he is slow with reviews, M> > but that's not a reason to commit w/o review. On Wed, Feb 19, 2014 at 02:01:23PM +0100, Martin Matuska wrote: M> I understand your point - if anything is broken (or more broken than M> before) I can revert this patch anytime. M> M> FreeNAS and other folks may fork separate branches and we can wait until M> about FreeBSD 12.0 for the patch being reviewed so we can commit it around M> 14.0 - maybe we have switched to a completely different firewall at that M> time and this issue becomes obsolete anyway. No need for sarcasm and top quoting. Since you already got sharp in your reply, let me too. First of all. I did not submitted you [2], right now I just checked my sent mail to ensure that. I submitted you other patch, that later was rejected by zec@, and that patch was very unlike [2]. So statement in commit message is not true. Second, these two changes are absolutely unrelated. They shouldn't been committed as one patch. Third. As you already know, there is projects/pf branch, where Nicos is getting things right wrt pf+VIMAGE. The patches should first go to this branch and tested in it. Committing to head (even a good code), you are creating conflicts for Nicos. You are fixing two particular problems that hurt you, while Nicos tries to get things right in general, for everyones sake. My approach on taskqueue context (that was rejected by Marko), was also an attempt to create a good and generic way of dealing with the problem. Unfortunately, Marko didn't suggest good alternatives. Anyway this is not a reason to plumb problems in place. As you may notice yourself the code you added: if (IS_DEFAULT_VNET(curvnet)) pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, UMA_ALIGN_PTR, 0); Is quite not like the rest of the code of the function. That is because in head/ the per-VNET initialization in pf isn't separated from global initialization. This is a generic problem, that Nikos is solving in projects/pf. Making pf mtag zone in projects/pf would be more clean than in head. And of course after your change merge of head to projects/pf would fail. You could join Nikos efforts, but instead you are just putting obstacles on his way. And mine too, since I would do next merge. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 16:06:27 2014 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 ESMTPS id C00EF5D5; Wed, 19 Feb 2014 16:06:27 +0000 (UTC) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4921699; Wed, 19 Feb 2014 16:06:27 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id v10so556301pde.0 for ; Wed, 19 Feb 2014 08:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=z+dgbdEA0hz1wuHJx9L/hrBOZvaZGMfKzvMk7Qr5wLg=; b=X3sOGTUzpeiJei8VUHaxMa69yKl5rCqYTrLmBTlNiEcVRQmbyX5/DOSN9m/LuYImKe Nsuq6edB0Nf0tLi/wO/zmFzO4t63+WgLZc2RNsoU0cp5ji0fX9j851qd6hLk76MRpznQ Wvv9YZX2ut/8tWhHXsEs47/AfdSvV0i+TvpY7xDRZSJvH6hIIvLrZeHUkpvrzNrvoPPA ZtzB1VMHBye/zu4m0GMkoKnkVu4I16dWazIvXgPWVTYBym6lClPNfyJAr2mbQqtTWpQU wZXgByobQUARyWq2Z2GrYXf3LQJWhxIfboInzKDOi/6MEJWyL8xHTgI40eUrKPAt1UjA w1dg== MIME-Version: 1.0 X-Received: by 10.68.129.201 with SMTP id ny9mr3178159pbb.70.1392825987096; Wed, 19 Feb 2014 08:06:27 -0800 (PST) Sender: ermal.luci@gmail.com Received: by 10.70.6.36 with HTTP; Wed, 19 Feb 2014 08:06:27 -0800 (PST) In-Reply-To: <20140219153215.GD63039@FreeBSD.org> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219101736.GX63039@glebius.int.ru> <20140219140123.Horde.zrXx5GqkiiaAfGIetc98KQ1@mail.vx.sk> <20140219153215.GD63039@FreeBSD.org> Date: Wed, 19 Feb 2014 17:06:27 +0100 X-Google-Sender-Auth: 3NjY7VA1iImMZmy5RwrQpV1mtxE Message-ID: Subject: Re: svn commit: r262196 - head/sys/netpfil/pf From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis , src-committers@freebsd.org, Martin Matuska X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 16:06:27 -0000 On Wed, Feb 19, 2014 at 4:32 PM, Gleb Smirnoff wrote: > Martin, > > M> > On Tue, Feb 18, 2014 at 10:17:12PM +0000, Martin Matuska wrote: > M> > M> Author: mm > M> > M> Date: Tue Feb 18 22:17:12 2014 > M> > M> New Revision: 262196 > M> > M> URL: http://svnweb.freebsd.org/changeset/base/262196 > M> > M> > M> > M> Log: > M> > M> De-virtualize pf_mtag_z [1] > M> > M> Process V_pf_overloadqueue in vnet context [2] > M> > M> > M> > M> This fixes two VIMAGE kernel panics and allows to simultaneously > M> > run host-pf > M> > M> and vnet jails. pf inside jails remains broken. > M> > M> > M> > M> PR: kern/182964 > M> > M> Submitted by: glebius@FreeBSD.org [2], myself [1] > M> > M> Tested by: rodrigc@FreeBSD.org, myself > M> > M> MFC after: 2 weeks > M> > > M> > I've sent your patch to Nikos, who is working on pf+vimage. He > M> > also accumulates his work on pf+vimage in projects/pf branch, > M> > planning to do it properly and then merge to head in one go. > M> > I was waiting for his review. Yes, he is slow with reviews, > M> > but that's not a reason to commit w/o review. > > On Wed, Feb 19, 2014 at 02:01:23PM +0100, Martin Matuska wrote: > M> I understand your point - if anything is broken (or more broken than > M> before) I can revert this patch anytime. > M> > M> FreeNAS and other folks may fork separate branches and we can wait until > M> about FreeBSD 12.0 for the patch being reviewed so we can commit it > around > M> 14.0 - maybe we have switched to a completely different firewall at that > M> time and this issue becomes obsolete anyway. > > No need for sarcasm and top quoting. Since you already got sharp in > your reply, let me too. > > First of all. I did not submitted you [2], right now I just checked > my sent mail to ensure that. I submitted you other patch, that later > was rejected by zec@, and that patch was very unlike [2]. So > statement in commit message is not true. > > Second, these two changes are absolutely unrelated. They shouldn't > been committed as one patch. > > Third. As you already know, there is projects/pf branch, where Nicos > is getting things right wrt pf+VIMAGE. The patches should first go > to this branch and tested in it. Committing to head (even a good > code), you are creating conflicts for Nicos. You are fixing two > particular problems that hurt you, while Nicos tries to get things > right in general, for everyones sake. My approach on taskqueue > context (that was rejected by Marko), was also an attempt to > create a good and generic way of dealing with the problem. Unfortunately, > Marko didn't suggest good alternatives. > > Anyway this is not a reason to plumb problems in place. > > As you may notice yourself the code you added: > > if (IS_DEFAULT_VNET(curvnet)) > pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + > sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, > UMA_ALIGN_PTR, 0); > > Is quite not like the rest of the code of the function. That is because > in head/ the per-VNET initialization in pf isn't separated from global > initialization. This is a generic problem, that Nikos is solving in > projects/pf. Making pf mtag zone in projects/pf would be more clean > than in head. And of course after your change merge of head to > projects/pf would fail. You could join Nikos efforts, but instead > you are just putting obstacles on his way. And mine too, since I > would do next merge. > > Well go do some work instead of runting around. You did not listen to me as well when you started doing work on pf. > -- > Totus tuus, Glebius. > -- Ermal From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 17:06:05 2014 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 ESMTPS id 6C9C16C0; Wed, 19 Feb 2014 17:06:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE8E1CA1; Wed, 19 Feb 2014 17:06:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JH65tw068414; Wed, 19 Feb 2014 17:06:05 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JH65Nd068413; Wed, 19 Feb 2014 17:06:05 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201402191706.s1JH65Nd068413@svn.freebsd.org> From: Martin Matuska Date: Wed, 19 Feb 2014 17:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262222 - head/sys/netpfil/pf 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 17:06:05 -0000 Author: mm Date: Wed Feb 19 17:06:04 2014 New Revision: 262222 URL: http://svnweb.freebsd.org/changeset/base/262222 Log: Revert r262196 I am going to split this into two individual patches and test it with the projects/pf branch that may get merged later. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Feb 19 15:00:55 2014 (r262221) +++ head/sys/netpfil/pf/pf.c Wed Feb 19 17:06:04 2014 (r262222) @@ -172,10 +172,7 @@ struct pf_overload_entry { struct pf_rule *rule; }; -struct pf_overload_head { - SLIST_HEAD(, pf_overload_entry) head; - struct vnet *vnet; -}; +SLIST_HEAD(pf_overload_head, pf_overload_entry); static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); #define V_pf_overloadqueue VNET(pf_overloadqueue) static VNET_DEFINE(struct task, pf_overloadtask); @@ -190,7 +187,8 @@ struct mtx pf_unlnkdrules_mtx; static VNET_DEFINE(uma_zone_t, pf_sources_z); #define V_pf_sources_z VNET(pf_sources_z) -uma_zone_t pf_mtag_z; +static VNET_DEFINE(uma_zone_t, pf_mtag_z); +#define V_pf_mtag_z VNET(pf_mtag_z) VNET_DEFINE(uma_zone_t, pf_state_z); VNET_DEFINE(uma_zone_t, pf_state_key_z); @@ -512,7 +510,7 @@ pf_src_connlimit(struct pf_state **state pfoe->rule = (*state)->rule.ptr; pfoe->dir = (*state)->direction; PF_OVERLOADQ_LOCK(); - SLIST_INSERT_HEAD(&V_pf_overloadqueue.head, pfoe, next); + SLIST_INSERT_HEAD(&V_pf_overloadqueue, pfoe, next); PF_OVERLOADQ_UNLOCK(); taskqueue_enqueue(taskqueue_swi, &V_pf_overloadtask); @@ -529,13 +527,11 @@ pf_overload_task(void *c, int pending) PF_OVERLOADQ_LOCK(); queue = *(struct pf_overload_head *)c; - SLIST_INIT(&((struct pf_overload_head *)c)->head); + SLIST_INIT((struct pf_overload_head *)c); PF_OVERLOADQ_UNLOCK(); - CURVNET_SET(queue.vnet); - bzero(&p, sizeof(p)); - SLIST_FOREACH(pfoe, &queue.head, next) { + SLIST_FOREACH(pfoe, &queue, next) { V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("%s: blocking address ", __func__); @@ -567,18 +563,16 @@ pf_overload_task(void *c, int pending) /* * Remove those entries, that don't need flushing. */ - SLIST_FOREACH_SAFE(pfoe, &queue.head, next, pfoe1) + SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) if (pfoe->rule->flush == 0) { - SLIST_REMOVE(&queue.head, pfoe, pf_overload_entry, next); + SLIST_REMOVE(&queue, pfoe, pf_overload_entry, next); free(pfoe, M_PFTEMP); } else V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; /* If nothing to flush, return. */ - if (SLIST_EMPTY(&queue.head)) { - CURVNET_RESTORE(); + if (SLIST_EMPTY(&queue)) return; - } for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; @@ -588,7 +582,7 @@ pf_overload_task(void *c, int pending) PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) { sk = s->key[PF_SK_WIRE]; - SLIST_FOREACH(pfoe, &queue.head, next) + SLIST_FOREACH(pfoe, &queue, next) if (sk->af == pfoe->af && ((pfoe->rule->flush & PF_FLUSH_GLOBAL) || pfoe->rule == s->rule.ptr) && @@ -603,12 +597,10 @@ pf_overload_task(void *c, int pending) } PF_HASHROW_UNLOCK(ih); } - SLIST_FOREACH_SAFE(pfoe, &queue.head, next, pfoe1) + SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) free(pfoe, M_PFTEMP); if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: %u states killed", __func__, killed); - - CURVNET_RESTORE(); } /* @@ -798,16 +790,14 @@ pf_initialize() V_pf_altqs_inactive = &V_pf_altqs[1]; /* Mbuf tags */ - if (IS_DEFAULT_VNET(curvnet)) - pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + - sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, - UMA_ALIGN_PTR, 0); + V_pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + + sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, + UMA_ALIGN_PTR, 0); /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); - SLIST_INIT(&V_pf_overloadqueue.head); + SLIST_INIT(&V_pf_overloadqueue); TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); - V_pf_overloadqueue.vnet = curvnet; mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, MTX_DEF); @@ -854,8 +844,7 @@ pf_cleanup() mtx_destroy(&pf_overloadqueue_mtx); mtx_destroy(&pf_unlnkdrules_mtx); - if (IS_DEFAULT_VNET(curvnet)) - uma_zdestroy(pf_mtag_z); + uma_zdestroy(V_pf_mtag_z); uma_zdestroy(V_pf_sources_z); uma_zdestroy(V_pf_state_z); uma_zdestroy(V_pf_state_key_z); @@ -879,7 +868,7 @@ static void pf_mtag_free(struct m_tag *t) { - uma_zfree(pf_mtag_z, t); + uma_zfree(V_pf_mtag_z, t); } struct pf_mtag * @@ -890,7 +879,7 @@ pf_get_mtag(struct mbuf *m) if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) != NULL) return ((struct pf_mtag *)(mtag + 1)); - mtag = uma_zalloc(pf_mtag_z, M_NOWAIT); + mtag = uma_zalloc(V_pf_mtag_z, M_NOWAIT); if (mtag == NULL) return (NULL); bzero(mtag + 1, sizeof(struct pf_mtag)); @@ -1686,7 +1675,7 @@ pf_purge_unlinked_rules() * an already unlinked rule. */ PF_OVERLOADQ_LOCK(); - if (!SLIST_EMPTY(&V_pf_overloadqueue.head)) { + if (!SLIST_EMPTY(&V_pf_overloadqueue)) { PF_OVERLOADQ_UNLOCK(); return; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 17:45:00 2014 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 ESMTPS id 3C03E62C; Wed, 19 Feb 2014 17:45:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA981129; Wed, 19 Feb 2014 17:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JHixXN084257; Wed, 19 Feb 2014 17:44:59 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JHixlE084256; Wed, 19 Feb 2014 17:44:59 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402191744.s1JHixlE084256@svn.freebsd.org> From: Robert Watson Date: Wed, 19 Feb 2014 17:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262224 - head/sys/boot 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 17:45:00 -0000 Author: rwatson Date: Wed Feb 19 17:44:59 2014 New Revision: 262224 URL: http://svnweb.freebsd.org/changeset/base/262224 Log: Do build boot-loader FDT code on MIPS. MFC after: 3 weeks Sponsored by: DARPA, AFRL Added: head/sys/boot/Makefile.mips (contents, props changed) Added: head/sys/boot/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/Makefile.mips Wed Feb 19 17:44:59 2014 (r262224) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 18:34:48 2014 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 ESMTPS id 436D6157; Wed, 19 Feb 2014 18:34:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2211B158F; Wed, 19 Feb 2014 18:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIYlPd004175; Wed, 19 Feb 2014 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIYlaB004172; Wed, 19 Feb 2014 18:34:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191834.s1JIYlaB004172@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262225 - in stable: 10/sys/dev/pci 9/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 18:34:48 -0000 Author: jhb Date: Wed Feb 19 18:34:47 2014 New Revision: 262225 URL: http://svnweb.freebsd.org/changeset/base/262225 Log: MFC 261524,261526,261527: - Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. - Simplify pci_reserve_map() by calling resource_list_reserve() to allocate the resource after creating a resource list entry rather than reimplementing it by hand. - Add two tunables to ignore certain firmware-assigned resources. These are mostly useful for debugging. - hw.pci.clear_bars ignores all firmware-assigned ranges for BARs when set. - hw.pci.clear_pcib ignores all firmware-assigned ranges for PCI-PCI bridge I/O windows when set. Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_pci.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/10/sys/dev/pci/pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -332,6 +332,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); +static int pci_clear_bars; +TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, + "Ignore firmware-assigned resources for BARs."); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -2742,7 +2747,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2848,7 +2853,10 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; - if (basezero || base == pci_mapbase(testval)) { + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; + if (basezero || base == pci_mapbase(testval) || pci_clear_bars) { start = 0; /* Let the parent decide. */ end = ~0ul; } else { @@ -2864,7 +2872,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2875,7 +2883,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* @@ -4174,7 +4182,6 @@ pci_reserve_map(device_t dev, device_t c { struct pci_devinfo *dinfo = device_get_ivars(child); struct resource_list *rl = &dinfo->resources; - struct resource_list_entry *rle; struct resource *res; struct pci_map *pm; pci_addr_t map, testval; @@ -4247,23 +4254,16 @@ pci_reserve_map(device_t dev, device_t c * Allocate enough resource, and then write back the * appropriate BAR for that resource. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, - start, end, count, flags & ~RF_ACTIVE); + resource_list_add(rl, type, *rid, start, end, count); + res = resource_list_reserve(rl, dev, child, type, rid, start, end, + count, flags & ~RF_ACTIVE); if (res == NULL) { + resource_list_delete(rl, type, *rid); device_printf(child, "%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n", count, *rid, type, start, end); goto out; } - resource_list_add(rl, type, *rid, start, end, count); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - panic("pci_reserve_map: unexpectedly can't find resource."); - rle->res = res; - rle->start = rman_get_start(res); - rle->end = rman_get_end(res); - rle->count = count; - rle->flags = RLE_RESERVED; if (bootverbose) device_printf(child, "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", Modified: stable/10/sys/dev/pci/pci_pci.c ============================================================================== --- stable/10/sys/dev/pci/pci_pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/10/sys/dev/pci/pci_pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -103,6 +103,12 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); #ifdef NEW_PCIB +SYSCTL_DECL(_hw_pci); + +static int pci_clear_pcib; +TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, + "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); /* * Is a resource from a child device sub-allocated from one of our @@ -416,6 +422,19 @@ pcib_probe_windows(struct pcib_softc *sc dev = sc->dev; + if (pci_clear_pcib) { + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); + pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); + pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); + pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); + } + /* Determine if the I/O port window is implemented. */ val = pci_read_config(dev, PCIR_IOBASEL_1, 1); if (val == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 18:34:48 2014 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 ESMTPS id C92D0158; Wed, 19 Feb 2014 18:34:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8B3F1592; Wed, 19 Feb 2014 18:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIYm46004182; Wed, 19 Feb 2014 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIYmQo004180; Wed, 19 Feb 2014 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191834.s1JIYmQo004180@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:34:48 +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: r262225 - in stable: 10/sys/dev/pci 9/sys/dev/pci 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 18:34:48 -0000 Author: jhb Date: Wed Feb 19 18:34:47 2014 New Revision: 262225 URL: http://svnweb.freebsd.org/changeset/base/262225 Log: MFC 261524,261526,261527: - Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. - Simplify pci_reserve_map() by calling resource_list_reserve() to allocate the resource after creating a resource list entry rather than reimplementing it by hand. - Add two tunables to ignore certain firmware-assigned resources. These are mostly useful for debugging. - hw.pci.clear_bars ignores all firmware-assigned ranges for BARs when set. - hw.pci.clear_pcib ignores all firmware-assigned ranges for PCI-PCI bridge I/O windows when set. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/9/sys/dev/pci/pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -345,6 +345,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); +static int pci_clear_bars; +TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, + "Ignore firmware-assigned resources for BARs."); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -2675,7 +2680,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2781,7 +2786,10 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; - if (basezero || base == pci_mapbase(testval)) { + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; + if (basezero || base == pci_mapbase(testval) || pci_clear_bars) { start = 0; /* Let the parent decide. */ end = ~0ul; } else { @@ -2797,7 +2805,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2808,7 +2816,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* @@ -4079,7 +4087,6 @@ pci_reserve_map(device_t dev, device_t c { struct pci_devinfo *dinfo = device_get_ivars(child); struct resource_list *rl = &dinfo->resources; - struct resource_list_entry *rle; struct resource *res; struct pci_map *pm; pci_addr_t map, testval; @@ -4152,23 +4159,16 @@ pci_reserve_map(device_t dev, device_t c * Allocate enough resource, and then write back the * appropriate BAR for that resource. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, - start, end, count, flags & ~RF_ACTIVE); + resource_list_add(rl, type, *rid, start, end, count); + res = resource_list_reserve(rl, dev, child, type, rid, start, end, + count, flags & ~RF_ACTIVE); if (res == NULL) { + resource_list_delete(rl, type, *rid); device_printf(child, "%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n", count, *rid, type, start, end); goto out; } - resource_list_add(rl, type, *rid, start, end, count); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - panic("pci_reserve_map: unexpectedly can't find resource."); - rle->res = res; - rle->start = rman_get_start(res); - rle->end = rman_get_end(res); - rle->count = count; - rle->flags = RLE_RESERVED; if (bootverbose) device_printf(child, "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", Modified: stable/9/sys/dev/pci/pci_pci.c ============================================================================== --- stable/9/sys/dev/pci/pci_pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/9/sys/dev/pci/pci_pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -103,6 +103,12 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); #ifdef NEW_PCIB +SYSCTL_DECL(_hw_pci); + +static int pci_clear_pcib; +TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, + "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); /* * Is a resource from a child device sub-allocated from one of our @@ -416,6 +422,19 @@ pcib_probe_windows(struct pcib_softc *sc dev = sc->dev; + if (pci_clear_pcib) { + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); + pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); + pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); + pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); + } + /* Determine if the I/O port window is implemented. */ val = pci_read_config(dev, PCIR_IOBASEL_1, 1); if (val == 0) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 18:35:22 2014 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 ESMTPS id EE2AD8AE; Wed, 19 Feb 2014 18:35:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFCA915B4; Wed, 19 Feb 2014 18:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIZM5S004836; Wed, 19 Feb 2014 18:35:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIZMRo004835; Wed, 19 Feb 2014 18:35:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191835.s1JIZMRo004835@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:35:22 +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: r262226 - stable/8/sys/dev/pci 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 18:35:23 -0000 Author: jhb Date: Wed Feb 19 18:35:22 2014 New Revision: 262226 URL: http://svnweb.freebsd.org/changeset/base/262226 Log: MFC 261524: Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Wed Feb 19 18:34:47 2014 (r262225) +++ stable/8/sys/dev/pci/pci.c Wed Feb 19 18:35:22 2014 (r262226) @@ -2637,7 +2637,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2743,6 +2743,9 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ end = ~0ul; @@ -2759,7 +2762,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_alloc(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2770,7 +2773,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_alloc(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 18:36:54 2014 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 ESMTPS id 82ED0B9C; Wed, 19 Feb 2014 18:36:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1B315D6; Wed, 19 Feb 2014 18:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIas8M005034; Wed, 19 Feb 2014 18:36:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIasJX005032; Wed, 19 Feb 2014 18:36:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191836.s1JIasJX005032@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262227 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 18:36:54 -0000 Author: jhb Date: Wed Feb 19 18:36:53 2014 New Revision: 262227 URL: http://svnweb.freebsd.org/changeset/base/262227 Log: MFC 261607: Mark the I/O ports used by the bhyve console and debug devices as system resources. Modified: stable/10/usr.sbin/bhyve/consport.c stable/10/usr.sbin/bhyve/dbgport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/consport.c ============================================================================== --- stable/10/usr.sbin/bhyve/consport.c Wed Feb 19 18:35:22 2014 (r262226) +++ stable/10/usr.sbin/bhyve/consport.c Wed Feb 19 18:36:53 2014 (r262227) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "inout.h" +#include "pci_lpc.h" #define BVM_CONSOLE_PORT 0x220 #define BVM_CONS_SIG ('b' << 8 | 'v') @@ -125,6 +126,8 @@ console_handler(struct vmctx *ctx, int v return (0); } +SYSRES_IO(BVM_CONSOLE_PORT, 4); + static struct inout_port consport = { "bvmcons", BVM_CONSOLE_PORT, Modified: stable/10/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/10/usr.sbin/bhyve/dbgport.c Wed Feb 19 18:35:22 2014 (r262226) +++ stable/10/usr.sbin/bhyve/dbgport.c Wed Feb 19 18:36:53 2014 (r262227) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "inout.h" #include "dbgport.h" +#include "pci_lpc.h" #define BVM_DBG_PORT 0x224 #define BVM_DBG_SIG ('B' << 8 | 'V') @@ -110,6 +111,8 @@ static struct inout_port dbgport = { dbg_handler }; +SYSRES_IO(BVM_DBG_PORT, 4); + void init_dbgport(int sport) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 18:49:06 2014 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 ESMTPS id DC49679; Wed, 19 Feb 2014 18:49:06 +0000 (UTC) Received: from mail-ea0-x22b.google.com (mail-ea0-x22b.google.com [IPv6:2a00:1450:4013: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 F1F9F16B9; Wed, 19 Feb 2014 18:49:05 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id f15so556540eak.2 for ; Wed, 19 Feb 2014 10:49:04 -0800 (PST) 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=5bkqIIsBRbi2jBertnQj2Yy+D3w1/oTQAbzfK2W4wJg=; b=D51tBpbtaadoPPasJTQu6R4RH8vEfKqQ8oqN7YWdNK+fElObT5dmtTOI/nN/RE+rxE hlTmbzLeb82sF/151rCbxuGWzXbiXcteMb1SglMR6KsxAmjpoDsNzcXnzYMnY9f32bLU pZgasjhu+NDYaP7iSRNRy8v0x+Ck806ZPdwK3A5YSqd1GLOl6B5w0SueFVvwd8wuU4wa hG1P92L/MPLsZsPxruSPuEcajr31KSeBr9hCo9HsfrHJeeUWyjx/najO4dkmw3d/mix7 k9K1xSFn/bOsG7hJ882moAtd1JPMdH6bSUpXvwWWN7VgySk0K9/gNzRPKtPBtamGX9hu mKHA== X-Received: by 10.15.81.196 with SMTP id x44mr41297244eey.31.1392835744327; Wed, 19 Feb 2014 10:49:04 -0800 (PST) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id u6sm3871838eep.11.2014.02.19.10.49.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Feb 2014 10:49:03 -0800 (PST) Sender: Mikolaj Golub Date: Wed, 19 Feb 2014 20:49:01 +0200 From: Mikolaj Golub To: Martin Matuska Subject: Re: svn commit: r262196 - head/sys/netpfil/pf Message-ID: <20140219184859.GA3844@gmail.com> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402182217.s1IMHCeM077356@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 18:49:06 -0000 On Tue, Feb 18, 2014 at 10:17:12PM +0000, Martin Matuska wrote: > Author: mm > Date: Tue Feb 18 22:17:12 2014 > New Revision: 262196 > URL: http://svnweb.freebsd.org/changeset/base/262196 > > Log: > De-virtualize pf_mtag_z [1] > Process V_pf_overloadqueue in vnet context [2] Martin I saw you reverted it but it looks you are going to work on it still, so one comment below. ... > -SLIST_HEAD(pf_overload_head, pf_overload_entry); > +struct pf_overload_head { > + SLIST_HEAD(, pf_overload_entry) head; > + struct vnet *vnet; > +}; > static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); > #define V_pf_overloadqueue VNET(pf_overloadqueue) ... > - SLIST_INIT(&V_pf_overloadqueue); > + SLIST_INIT(&V_pf_overloadqueue.head); > TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); > + V_pf_overloadqueue.vnet = curvnet; Why not pass vnet as a context to pf_overload_task instead of &V_pf_overloadqueue? Then you would not need this hack with storing a vnet inside a vnet variable. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 18:58:34 2014 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 ESMTPS id 961302F8; Wed, 19 Feb 2014 18:58:34 +0000 (UTC) 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 69876176D; Wed, 19 Feb 2014 18:58:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3F71DB918; Wed, 19 Feb 2014 13:58:33 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r262221 - in stable: 8/lib/libthr/thread 9/lib/libthr/thread Date: Wed, 19 Feb 2014 13:21:56 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402191500.s1JF0u1v085053@svn.freebsd.org> In-Reply-To: <201402191500.s1JF0u1v085053@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201402191321.56516.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 19 Feb 2014 13:58:33 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 18:58:34 -0000 On Wednesday, February 19, 2014 10:00:56 am John Baldwin wrote: > Author: jhb > Date: Wed Feb 19 15:00:55 2014 > New Revision: 262221 > URL: http://svnweb.freebsd.org/changeset/base/262221 > > Log: > MFC 250691: > Return one-based key so that user can check if the key is ever allocated > in the first place. This also works around potential application bugs if an application calls pthread_key_delete() on an uninitialized key. (QT 4.7 is one such offender) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:11:15 2014 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 ESMTPS id 95DDC9DC; Wed, 19 Feb 2014 19:11:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64C5118D0; Wed, 19 Feb 2014 19:11:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJBFQK020277; Wed, 19 Feb 2014 19:11:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJBE5L020268; Wed, 19 Feb 2014 19:11:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191911.s1JJBE5L020268@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262228 - in stable: 10/sys/kern 10/sys/sys 10/usr.bin/procstat 9/sys/kern 9/sys/sys 9/usr.bin/procstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:11:15 -0000 Author: jhb Date: Wed Feb 19 19:11:14 2014 New Revision: 262228 URL: http://svnweb.freebsd.org/changeset/base/262228 Log: MFC 261780: Expose OBJT_MGTDEVICE VM objects used for GEM/TTM with drm2 as an explicit object type. Modified: stable/10/sys/kern/kern_proc.c stable/10/sys/sys/user.h stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat_vm.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.bin/procstat/ (props changed) Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/sys/kern/kern_proc.c Wed Feb 19 19:11:14 2014 (r262228) @@ -2256,6 +2256,9 @@ kern_proc_vmmap_out(struct proc *p, stru case OBJT_SG: kve->kve_type = KVME_TYPE_SG; break; + case OBJT_MGTDEVICE: + kve->kve_type = KVME_TYPE_MGTDEVICE; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: stable/10/sys/sys/user.h ============================================================================== --- stable/10/sys/sys/user.h Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/sys/sys/user.h Wed Feb 19 19:11:14 2014 (r262228) @@ -414,6 +414,7 @@ struct kinfo_file { #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 #define KVME_TYPE_SG 7 +#define KVME_TYPE_MGTDEVICE 8 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Modified: stable/10/usr.bin/procstat/procstat.1 ============================================================================== --- stable/10/usr.bin/procstat/procstat.1 Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/usr.bin/procstat/procstat.1 Wed Feb 19 19:11:14 2014 (r262228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2013 +.Dd February 11, 2014 .Dt PROCSTAT 1 .Os .Sh NAME @@ -416,6 +416,9 @@ dead default .It dv device +.It md +device with managed pages +.Pq GEM/TTM .It ph physical .It sg Modified: stable/10/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/10/usr.bin/procstat/procstat_vm.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/usr.bin/procstat/procstat_vm.c Wed Feb 19 19:11:14 2014 (r262228) @@ -100,6 +100,9 @@ procstat_vm(struct procstat *procstat, s case KVME_TYPE_SG: str = "sg"; break; + case KVME_TYPE_MGTDEVICE: + str = "md"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:11:16 2014 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 ESMTPS id 8E9079DD; Wed, 19 Feb 2014 19:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F2BC18D1; Wed, 19 Feb 2014 19:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJBGnY020289; Wed, 19 Feb 2014 19:11:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJBFNm020283; Wed, 19 Feb 2014 19:11:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191911.s1JJBFNm020283@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:11:15 +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: r262228 - in stable: 10/sys/kern 10/sys/sys 10/usr.bin/procstat 9/sys/kern 9/sys/sys 9/usr.bin/procstat 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:11:16 -0000 Author: jhb Date: Wed Feb 19 19:11:14 2014 New Revision: 262228 URL: http://svnweb.freebsd.org/changeset/base/262228 Log: MFC 261780: Expose OBJT_MGTDEVICE VM objects used for GEM/TTM with drm2 as an explicit object type. Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.bin/procstat/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_proc.c stable/10/sys/sys/user.h stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat_vm.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/sys/kern/kern_proc.c Wed Feb 19 19:11:14 2014 (r262228) @@ -2261,6 +2261,9 @@ kern_proc_vmmap_out(struct proc *p, stru case OBJT_SG: kve->kve_type = KVME_TYPE_SG; break; + case OBJT_MGTDEVICE: + kve->kve_type = KVME_TYPE_MGTDEVICE; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: stable/9/sys/sys/user.h ============================================================================== --- stable/9/sys/sys/user.h Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/sys/sys/user.h Wed Feb 19 19:11:14 2014 (r262228) @@ -409,6 +409,7 @@ struct kinfo_file { #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 #define KVME_TYPE_SG 7 +#define KVME_TYPE_MGTDEVICE 8 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Modified: stable/9/usr.bin/procstat/procstat.1 ============================================================================== --- stable/9/usr.bin/procstat/procstat.1 Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/usr.bin/procstat/procstat.1 Wed Feb 19 19:11:14 2014 (r262228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2013 +.Dd February 11, 2014 .Dt PROCSTAT 1 .Os .Sh NAME @@ -418,6 +418,9 @@ dead default .It dv device +.It md +device with managed pages +.Pq GEM/TTM .It ph physical .It sg Modified: stable/9/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_vm.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/usr.bin/procstat/procstat_vm.c Wed Feb 19 19:11:14 2014 (r262228) @@ -100,6 +100,9 @@ procstat_vm(struct procstat *procstat, s case KVME_TYPE_SG: str = "sg"; break; + case KVME_TYPE_MGTDEVICE: + str = "md"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:28:51 2014 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 ESMTPS id 183D61E5; Wed, 19 Feb 2014 19:28:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 024791A32; Wed, 19 Feb 2014 19:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJSon7025551; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJSov4025550; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191928.s1JJSov4025550@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:28: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: r262229 - in stable: 10/usr.bin/nfsstat 8/usr.bin/nfsstat 9/usr.bin/nfsstat 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:28:51 -0000 Author: jhb Date: Wed Feb 19 19:28:49 2014 New Revision: 262229 URL: http://svnweb.freebsd.org/changeset/base/262229 Log: MFC 261512,261514: - Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. - Use the DELTA() macro to tidy the server-side interval stats code a bit. Modified: stable/9/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/9/usr.bin/nfsstat/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/nfsstat/nfsstat.c stable/8/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/10/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) Modified: stable/9/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/9/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:11:14 2014 (r262228) +++ stable/9/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:28:49 2014 (r262229) @@ -604,14 +604,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -993,15 +994,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -1025,24 +1026,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); lastst = nfsstats; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:28:50 2014 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 ESMTPS id 642E81E3; Wed, 19 Feb 2014 19:28:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DEE81A30; Wed, 19 Feb 2014 19:28:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJSojW025538; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJSoDU025537; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191928.s1JJSoDU025537@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262229 - in stable: 10/usr.bin/nfsstat 8/usr.bin/nfsstat 9/usr.bin/nfsstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:28:50 -0000 Author: jhb Date: Wed Feb 19 19:28:49 2014 New Revision: 262229 URL: http://svnweb.freebsd.org/changeset/base/262229 Log: MFC 261512,261514: - Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. - Use the DELTA() macro to tidy the server-side interval stats code a bit. Modified: stable/10/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/nfsstat/nfsstat.c stable/9/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) stable/9/usr.bin/nfsstat/ (props changed) Modified: stable/10/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/10/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:11:14 2014 (r262228) +++ stable/10/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:28:49 2014 (r262229) @@ -604,14 +604,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -993,15 +994,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -1024,24 +1025,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); } lastst = nfsstats; From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:28:50 2014 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 ESMTPS id B78DD1E4; Wed, 19 Feb 2014 19:28:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A24D71A31; Wed, 19 Feb 2014 19:28:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJSo6o025545; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJSoBN025544; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191928.s1JJSoBN025544@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:28:50 +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: r262229 - in stable: 10/usr.bin/nfsstat 8/usr.bin/nfsstat 9/usr.bin/nfsstat 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:28:50 -0000 Author: jhb Date: Wed Feb 19 19:28:49 2014 New Revision: 262229 URL: http://svnweb.freebsd.org/changeset/base/262229 Log: MFC 261512,261514: - Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. - Use the DELTA() macro to tidy the server-side interval stats code a bit. Modified: stable/8/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/nfsstat/nfsstat.c stable/9/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/10/ (props changed) stable/9/usr.bin/nfsstat/ (props changed) Modified: stable/8/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/8/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:11:14 2014 (r262228) +++ stable/8/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:28:49 2014 (r262229) @@ -436,14 +436,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -825,15 +826,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -857,24 +858,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); lastst = nfsstats; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:38:26 2014 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 ESMTPS id 7F75BAC0; Wed, 19 Feb 2014 19:38:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B6711B5D; Wed, 19 Feb 2014 19:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJcQMp029662; Wed, 19 Feb 2014 19:38:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJcQtf029661; Wed, 19 Feb 2014 19:38:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402191938.s1JJcQtf029661@svn.freebsd.org> From: Eitan Adler Date: Wed, 19 Feb 2014 19:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262230 - stable/10/sys/dev/ppc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:38:26 -0000 Author: eadler Date: Wed Feb 19 19:38:25 2014 New Revision: 262230 URL: http://svnweb.freebsd.org/changeset/base/262230 Log: MFC r257883: Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1) PR: kern/182217 Modified: stable/10/sys/dev/ppc/ppc_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ppc/ppc_pci.c ============================================================================== --- stable/10/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:28:49 2014 (r262229) +++ stable/10/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:38:25 2014 (r262230) @@ -88,6 +88,7 @@ static struct pci_id pci_ids[] = { { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, + { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x98659710, "MosChip MCS9865 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:46:44 2014 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 ESMTPS id 9BBEA18C; Wed, 19 Feb 2014 19:46:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 868B61C40; Wed, 19 Feb 2014 19:46:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJki3H033641; Wed, 19 Feb 2014 19:46:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJkiYR033640; Wed, 19 Feb 2014 19:46:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402191946.s1JJkiYR033640@svn.freebsd.org> From: Eitan Adler Date: Wed, 19 Feb 2014 19:46: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: r262231 - stable/9/sys/dev/ppc 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:46:44 -0000 Author: eadler Date: Wed Feb 19 19:46:44 2014 New Revision: 262231 URL: http://svnweb.freebsd.org/changeset/base/262231 Log: MFC r257883: Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1) PR: kern/182217 Modified: stable/9/sys/dev/ppc/ppc_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ppc/ppc_pci.c ============================================================================== --- stable/9/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:38:25 2014 (r262230) +++ stable/9/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:46:44 2014 (r262231) @@ -88,6 +88,7 @@ static struct pci_id pci_ids[] = { { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, + { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x98659710, "MosChip MCS9865 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 19:47:08 2014 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 ESMTPS id 953C52CD; Wed, 19 Feb 2014 19:47:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA0C1C47; Wed, 19 Feb 2014 19:47:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJl8ud033730; Wed, 19 Feb 2014 19:47:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJl8r9033729; Wed, 19 Feb 2014 19:47:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402191947.s1JJl8r9033729@svn.freebsd.org> From: Eitan Adler Date: Wed, 19 Feb 2014 19:47:08 +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: r262232 - stable/8/sys/dev/ppc 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 19:47:08 -0000 Author: eadler Date: Wed Feb 19 19:47:08 2014 New Revision: 262232 URL: http://svnweb.freebsd.org/changeset/base/262232 Log: MFC r257883: Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1) PR: kern/182217 Modified: stable/8/sys/dev/ppc/ppc_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ppc/ (props changed) Modified: stable/8/sys/dev/ppc/ppc_pci.c ============================================================================== --- stable/8/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:46:44 2014 (r262231) +++ stable/8/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:47:08 2014 (r262232) @@ -88,6 +88,7 @@ static struct pci_id pci_ids[] = { { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, + { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0xffff } From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 20:02:53 2014 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 ESMTPS id 5E87EA6D; Wed, 19 Feb 2014 20:02:53 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB9ED1DE7; Wed, 19 Feb 2014 20:02:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s1JK2o36077802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 20 Feb 2014 00:02:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1JK2oFA077801; Thu, 20 Feb 2014 00:02:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 20 Feb 2014 00:02:50 +0400 From: Gleb Smirnoff To: Mikolaj Golub Subject: Re: svn commit: r262196 - head/sys/netpfil/pf Message-ID: <20140219200250.GB77637@FreeBSD.org> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219184859.GA3844@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140219184859.GA3844@gmail.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Martin Matuska X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 20:02:53 -0000 On Wed, Feb 19, 2014 at 08:49:01PM +0200, Mikolaj Golub wrote: M> > -SLIST_HEAD(pf_overload_head, pf_overload_entry); M> > +struct pf_overload_head { M> > + SLIST_HEAD(, pf_overload_entry) head; M> > + struct vnet *vnet; M> > +}; M> > static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); M> > #define V_pf_overloadqueue VNET(pf_overloadqueue) M> M> ... M> M> > - SLIST_INIT(&V_pf_overloadqueue); M> > + SLIST_INIT(&V_pf_overloadqueue.head); M> > TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); M> > + V_pf_overloadqueue.vnet = curvnet; M> M> Why not pass vnet as a context to pf_overload_task instead of M> &V_pf_overloadqueue? Then you would not need this hack with storing a M> vnet inside a vnet variable. Yes, that would look much better. The pf_overloadqueue can be made global after that. Its lock is already global. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 21:31:05 2014 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 ESMTPS id 68D72DF3; Wed, 19 Feb 2014 21:31:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5115016D4; Wed, 19 Feb 2014 21:31:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JLV5ua076432; Wed, 19 Feb 2014 21:31:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JLV5QB076431; Wed, 19 Feb 2014 21:31:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402192131.s1JLV5QB076431@svn.freebsd.org> From: Christian Brueffer Date: Wed, 19 Feb 2014 21:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262233 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 21:31:05 -0000 Author: brueffer Date: Wed Feb 19 21:31:04 2014 New Revision: 262233 URL: http://svnweb.freebsd.org/changeset/base/262233 Log: Spelling, grammar and mdoc cleanup. MFC after: 1 week Modified: head/share/man/man4/gpio.4 Modified: head/share/man/man4/gpio.4 ============================================================================== --- head/share/man/man4/gpio.4 Wed Feb 19 19:47:08 2014 (r262232) +++ head/share/man/man4/gpio.4 Wed Feb 19 21:31:04 2014 (r262233) @@ -42,7 +42,7 @@ following lines in your kernel configura .Pp Additional device entries for the .Li ARM -architecure include: +architecture include: .Bd -ragged -offset indent .Cd "device a10_gpio" .Cd "device bcm_gpio" @@ -58,7 +58,7 @@ architecure include: .Pp Additional device entries for the .Li MIPS -architecure include: +architecture include: .Bd -ragged -offset indent .Cd "device ar71xxx_gpio" .Cd "device octeon_gpio" @@ -67,14 +67,14 @@ architecure include: .Pp Additional device entries for the .Li POWERPC -architecure include: +architecture include: .Bd -ragged -offset indent .Cd "device wiigpio" .Cd "device macgpio" .Ed .Sh DESCRIPTION The -.Em gpiobus +.Nm system provides a simple interface to the GPIO pins that are usually available on embedded architectures and can provide bit banging style devices to the system. @@ -89,7 +89,7 @@ for input/output, IRQ delivery, SDA/SCL .Em iicbus use, etc. .Pp -On some embedded architechtures (like MIPS), discovery of the bus and +On some embedded architectures (like MIPS), discovery of the bus and configuration of the pins is done via .Xr device.hints 5 in the platform's kernel @@ -101,28 +101,30 @@ On some others (like ARM), where is used to describe the device tree, the bus discovery is done via the DTS passed to the kernel, being either statically compiled in, or by a variety of ways where the boot loader (or Open Firmware enabled system) passes the -DTS blob to kernel at boot. +DTS blob to the kernel at boot. .Pp -The following are only provided by the +The following +.Xr device.hints 5 +are only provided by the .Cd ar71xx_gpio -driver. +driver: .Bl -tag -width ".Va hint.gpioiic.%d.atXXX" .It Va hint.gpio.%d.pinmask -This is a bitmask of pins on the gpio board that we would like to expose -for use to the host o/s. +This is a bitmask of pins on the GPIO board that we would like to expose +for use to the host operating system. To expose pin 0, 4 and 7, use the bitmask of 10010001 converted to the hexadecimal value 0x0091. .It Va hint.gpio.%d.pinon -This is a bitmask of pins on the gpio board that will be set to ON at host +This is a bitmask of pins on the GPIO board that will be set to ON at host start. To set pin 2, 5 and 13 to be set ON at boot, use the bitmask of 10000000010010 converted to the hexadecimal value 0x2012. .It Va hint.gpio.function_set .It Va hint.gpio.function_clear -These are a bitmask of pins that will remap a pin to handle a specific +These are bitmasks of pins that will remap a pin to handle a specific function (USB, UART TX/RX, etc) in the Atheros function registers. -This is mainly used to set/clear functions that we need when they are setup or -not setup by uBoot. +This is mainly used to set/clear functions that we need when they are set up or +not set up by uBoot. .El .Pp Simply put, each pin of the GPIO interface is connected to an input/output From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 23:09:25 2014 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 ESMTPS id 9DBF7EF4; Wed, 19 Feb 2014 23:09:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACC91E33; Wed, 19 Feb 2014 23:09:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JN9PDc014363; Wed, 19 Feb 2014 23:09:25 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JN9PnV014362; Wed, 19 Feb 2014 23:09:25 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402192309.s1JN9PnV014362@svn.freebsd.org> From: Robert Watson Date: Wed, 19 Feb 2014 23:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262235 - head/sys/boot/mips 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.17 Precedence: list List-Id: "SVN commit messages 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, 19 Feb 2014 23:09:25 -0000 Author: rwatson Date: Wed Feb 19 23:09:25 2014 New Revision: 262235 URL: http://svnweb.freebsd.org/changeset/base/262235 Log: Temporarily unhook BERI boot loader from the build until 32-bit MIPS properly excludes building our 64-bit only boot-loader adaptation. Modified: head/sys/boot/mips/Makefile Modified: head/sys/boot/mips/Makefile ============================================================================== --- head/sys/boot/mips/Makefile Wed Feb 19 22:02:15 2014 (r262234) +++ head/sys/boot/mips/Makefile Wed Feb 19 23:09:25 2014 (r262235) @@ -1,5 +1,7 @@ # $FreeBSD$ +.if 0 SUBDIR= beri +.endif .include From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 01:48:27 2014 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 ESMTPS id 506ABBA0; Thu, 20 Feb 2014 01:48:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3828D1B2D; Thu, 20 Feb 2014 01:48:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K1mRQn078169; Thu, 20 Feb 2014 01:48:27 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K1mPPE078159; Thu, 20 Feb 2014 01:48:25 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402200148.s1K1mPPE078159@svn.freebsd.org> From: Neel Natu Date: Thu, 20 Feb 2014 01:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262236 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 01:48:27 -0000 Author: neel Date: Thu Feb 20 01:48:25 2014 New Revision: 262236 URL: http://svnweb.freebsd.org/changeset/base/262236 Log: Simplify APIC mode switching from MMIO to x2APIC. In part this is done to simplify the implementation of the x2APIC virtualization assist in VT-x. Prior to this change the vlapic allowed the guest to change its mode from xAPIC to x2APIC. We don't allow that any more and the vlapic mode is locked when the virtual machine is created. This is not very constraining because operating systems already have to deal with BIOS setting up the APIC in x2APIC mode at boot. Fix a bug in the CPUID emulation where the x2APIC capability was leaking from the host to the guest. Ignore MMIO reads and writes to the vlapic in x2APIC mode. Similarly, ignore MSR accesses to the vlapic when it is in xAPIC mode. The default configuration of the vlapic is xAPIC. The "-x" option to bhyve(8) can be used to change the mode to x2APIC instead. Discussed with: grehan@ Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/x86.c head/usr.sbin/bhyve/bhyverun.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Feb 19 23:09:25 2014 (r262235) +++ head/sys/amd64/include/vmm.h Thu Feb 20 01:48:25 2014 (r262236) @@ -265,9 +265,8 @@ enum vm_cap_type { }; enum x2apic_state { - X2APIC_ENABLED, - X2APIC_AVAILABLE, X2APIC_DISABLED, + X2APIC_ENABLED, X2APIC_STATE_LAST }; Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Wed Feb 19 23:09:25 2014 (r262235) +++ head/sys/amd64/vmm/io/vlapic.c Thu Feb 20 01:48:25 2014 (r262236) @@ -1119,12 +1119,31 @@ vlapic_svr_write_handler(struct vlapic * } int -vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, bool *retu) +vlapic_read(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t *data, bool *retu) { struct LAPIC *lapic = vlapic->apic_page; uint32_t *reg; int i; + /* Ignore MMIO accesses in x2APIC mode */ + if (x2apic(vlapic) && mmio_access) { + VLAPIC_CTR1(vlapic, "MMIO read from offset %#lx in x2APIC mode", + offset); + *data = 0; + goto done; + } + + if (!x2apic(vlapic) && !mmio_access) { + /* + * XXX Generate GP fault for MSR accesses in xAPIC mode + */ + VLAPIC_CTR1(vlapic, "x2APIC MSR read from offset %#lx in " + "xAPIC mode", offset); + *data = 0; + goto done; + } + if (offset > sizeof(*lapic)) { *data = 0; goto done; @@ -1221,7 +1240,8 @@ done: } int -vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu) +vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t data, bool *retu) { struct LAPIC *lapic = vlapic->apic_page; uint32_t *regptr; @@ -1230,10 +1250,26 @@ vlapic_write(struct vlapic *vlapic, uint KASSERT((offset & 0xf) == 0 && offset < PAGE_SIZE, ("vlapic_write: invalid offset %#lx", offset)); - VLAPIC_CTR2(vlapic, "vlapic write offset %#x, data %#lx", offset, data); + VLAPIC_CTR2(vlapic, "vlapic write offset %#lx, data %#lx", + offset, data); - if (offset > sizeof(*lapic)) { - return 0; + if (offset > sizeof(*lapic)) + return (0); + + /* Ignore MMIO accesses in x2APIC mode */ + if (x2apic(vlapic) && mmio_access) { + VLAPIC_CTR2(vlapic, "MMIO write of %#lx to offset %#lx " + "in x2APIC mode", data, offset); + return (0); + } + + /* + * XXX Generate GP fault for MSR accesses in xAPIC mode + */ + if (!x2apic(vlapic) && !mmio_access) { + VLAPIC_CTR2(vlapic, "x2APIC MSR write of %#lx to offset %#lx " + "in xAPIC mode", data, offset); + return (0); } retval = 0; @@ -1380,50 +1416,47 @@ vlapic_get_apicbase(struct vlapic *vlapi return (vlapic->msr_apicbase); } -void +int vlapic_set_apicbase(struct vlapic *vlapic, uint64_t new) { - struct LAPIC *lapic; - enum x2apic_state state; - uint64_t old; - int err; - - err = vm_get_x2apic_state(vlapic->vm, vlapic->vcpuid, &state); - if (err) - panic("vlapic_set_apicbase: err %d fetching x2apic state", err); - - if (state == X2APIC_DISABLED) - new &= ~APICBASE_X2APIC; - - old = vlapic->msr_apicbase; - vlapic->msr_apicbase = new; - /* - * If the vlapic is switching between xAPIC and x2APIC modes then - * reset the mode-dependent registers. - */ - if ((old ^ new) & APICBASE_X2APIC) { - lapic = vlapic->apic_page; - lapic->id = vlapic_get_id(vlapic); - if (x2apic(vlapic)) { - lapic->ldr = x2apic_ldr(vlapic); - lapic->dfr = 0; - } else { - lapic->ldr = 0; - lapic->dfr = 0xffffffff; - } + if (vlapic->msr_apicbase != new) { + VLAPIC_CTR2(vlapic, "Changing APIC_BASE MSR from %#lx to %#lx " + "not supported", vlapic->msr_apicbase, new); + return (-1); } + + return (0); } void vlapic_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state) { struct vlapic *vlapic; + struct LAPIC *lapic; vlapic = vm_lapic(vm, vcpuid); if (state == X2APIC_DISABLED) vlapic->msr_apicbase &= ~APICBASE_X2APIC; + else + vlapic->msr_apicbase |= APICBASE_X2APIC; + + /* + * Reset the local APIC registers whose values are mode-dependent. + * + * XXX this works because the APIC mode can be changed only at vcpu + * initialization time. + */ + lapic = vlapic->apic_page; + lapic->id = vlapic_get_id(vlapic); + if (x2apic(vlapic)) { + lapic->ldr = x2apic_ldr(vlapic); + lapic->dfr = 0; + } else { + lapic->ldr = 0; + lapic->dfr = 0xffffffff; + } } void Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Wed Feb 19 23:09:25 2014 (r262235) +++ head/sys/amd64/vmm/io/vlapic.h Thu Feb 20 01:48:25 2014 (r262236) @@ -32,10 +32,10 @@ struct vm; enum x2apic_state; -int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, - bool *retu); -int vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, - bool *retu); +int vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t data, bool *retu); +int vlapic_read(struct vlapic *vlapic, int mmio_access, uint64_t offset, + uint64_t *data, bool *retu); /* * Returns 0 if there is no eligible vector that can be delivered to the @@ -74,7 +74,7 @@ void vlapic_fire_cmci(struct vlapic *vla int vlapic_trigger_lvt(struct vlapic *vlapic, int vector); uint64_t vlapic_get_apicbase(struct vlapic *vlapic); -void vlapic_set_apicbase(struct vlapic *vlapic, uint64_t val); +int vlapic_set_apicbase(struct vlapic *vlapic, uint64_t val); void vlapic_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state s); bool vlapic_enabled(struct vlapic *vlapic); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed Feb 19 23:09:25 2014 (r262235) +++ head/sys/amd64/vmm/vmm.c Thu Feb 20 01:48:25 2014 (r262236) @@ -206,7 +206,7 @@ vcpu_init(struct vm *vm, uint32_t vcpu_i vcpu->hostcpu = NOCPU; vcpu->vcpuid = vcpu_id; vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); - vm_set_x2apic_state(vm, vcpu_id, X2APIC_ENABLED); + vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; vcpu->guestfpu = fpu_save_area_alloc(); fpu_save_area_reset(vcpu->guestfpu); Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Wed Feb 19 23:09:25 2014 (r262235) +++ head/sys/amd64/vmm/vmm_lapic.c Thu Feb 20 01:48:25 2014 (r262236) @@ -172,7 +172,7 @@ lapic_rdmsr(struct vm *vm, int cpu, u_in error = 0; } else { offset = x2apic_msr_to_regoff(msr); - error = vlapic_read(vlapic, offset, rval, retu); + error = vlapic_read(vlapic, 0, offset, rval, retu); } return (error); @@ -188,11 +188,10 @@ lapic_wrmsr(struct vm *vm, int cpu, u_in vlapic = vm_lapic(vm, cpu); if (msr == MSR_APICBASE) { - vlapic_set_apicbase(vlapic, val); - error = 0; + error = vlapic_set_apicbase(vlapic, val); } else { offset = x2apic_msr_to_regoff(msr); - error = vlapic_write(vlapic, offset, val, retu); + error = vlapic_write(vlapic, 0, offset, val, retu); } return (error); @@ -216,7 +215,7 @@ lapic_mmio_write(void *vm, int cpu, uint return (EINVAL); vlapic = vm_lapic(vm, cpu); - error = vlapic_write(vlapic, off, wval, arg); + error = vlapic_write(vlapic, 1, off, wval, arg); return (error); } @@ -238,6 +237,6 @@ lapic_mmio_read(void *vm, int cpu, uint6 return (EINVAL); vlapic = vm_lapic(vm, cpu); - error = vlapic_read(vlapic, off, rval, arg); + error = vlapic_read(vlapic, 1, off, rval, arg); return (error); } Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Wed Feb 19 23:09:25 2014 (r262235) +++ head/sys/amd64/vmm/x86.c Thu Feb 20 01:48:25 2014 (r262236) @@ -149,6 +149,8 @@ x86_emulate_cpuid(struct vm *vm, int vcp if (x2apic_state != X2APIC_DISABLED) regs[2] |= CPUID2_X2APIC; + else + regs[2] &= ~CPUID2_X2APIC; /* * Only advertise CPUID2_XSAVE in the guest if Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Feb 19 23:09:25 2014 (r262235) +++ head/usr.sbin/bhyve/bhyverun.c Thu Feb 20 01:48:25 2014 (r262236) @@ -84,8 +84,9 @@ char *vmname; int guest_ncpus; static int pincpu = -1; -static int guest_vmexit_on_hlt, guest_vmexit_on_pause, disable_x2apic; +static int guest_vmexit_on_hlt, guest_vmexit_on_pause; static int virtio_msix = 1; +static int x2apic_mode = 0; /* default is xAPIC */ static int strictio; static int strictmsr = 1; @@ -126,7 +127,7 @@ usage(int code) fprintf(stderr, "Usage: %s [-aehwAHIPW] [-g ] [-s ]\n" " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" - " -a: local apic is in XAPIC mode (default is X2APIC)\n" + " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create an ACPI table\n" " -g: gdb port\n" " -c: # cpus (default 1)\n" @@ -139,7 +140,8 @@ usage(int code) " -s: PCI slot config\n" " -l: LPC device configuration\n" " -m: memory size in MB\n" - " -w: ignore unimplemented MSRs\n", + " -w: ignore unimplemented MSRs\n" + " -x: local apic is in x2APIC mode\n", progname, (int)strlen(progname), ""); exit(code); @@ -153,13 +155,6 @@ paddr_guest2host(struct vmctx *ctx, uint } int -fbsdrun_disable_x2apic(void) -{ - - return (disable_x2apic); -} - -int fbsdrun_vmexit_on_pause(void) { @@ -570,10 +565,10 @@ fbsdrun_set_capabilities(struct vmctx *c handler[VM_EXITCODE_PAUSE] = vmexit_pause; } - if (fbsdrun_disable_x2apic()) - err = vm_set_x2apic_state(ctx, cpu, X2APIC_DISABLED); - else + if (x2apic_mode) err = vm_set_x2apic_state(ctx, cpu, X2APIC_ENABLED); + else + err = vm_set_x2apic_state(ctx, cpu, X2APIC_DISABLED); if (err) { fprintf(stderr, "Unable to set x2apic state (%d)\n", err); @@ -598,10 +593,10 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:")) != -1) { switch (c) { case 'a': - disable_x2apic = 1; + x2apic_mode = 0; break; case 'A': acpi = 1; @@ -658,6 +653,9 @@ main(int argc, char *argv[]) case 'W': virtio_msix = 0; break; + case 'x': + x2apic_mode = 1; + break; case 'h': usage(0); default: From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 04:50:13 2014 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 ESMTPS id C34BB7F7; Thu, 20 Feb 2014 04:50:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACACE1FC7; Thu, 20 Feb 2014 04:50:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K4oDiK054861; Thu, 20 Feb 2014 04:50:13 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K4oDBC054860; Thu, 20 Feb 2014 04:50:13 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402200450.s1K4oDBC054860@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 20 Feb 2014 04:50: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: r262237 - stable/9/sys/dev/netmap 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 04:50:13 -0000 Author: luigi Date: Thu Feb 20 04:50:13 2014 New Revision: 262237 URL: http://svnweb.freebsd.org/changeset/base/262237 Log: make this code compile with NOINET Modified: stable/9/sys/dev/netmap/netmap_freebsd.c Modified: stable/9/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/9/sys/dev/netmap/netmap_freebsd.c Thu Feb 20 01:48:25 2014 (r262236) +++ stable/9/sys/dev/netmap/netmap_freebsd.c Thu Feb 20 04:50:13 2014 (r262237) @@ -101,6 +101,7 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { +#ifdef INET uint16_t pseudolen = datalen + iph->protocol; /* Compute and insert the pseudo-header cheksum. */ @@ -110,6 +111,13 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr * (includes the pseudo-header). */ *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet4 segmentation not supported"); + } +#endif } void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 04:56:55 2014 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 ESMTPS id D5E5CA24; Thu, 20 Feb 2014 04:56:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C17CC108C; Thu, 20 Feb 2014 04:56:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K4utCd058294; Thu, 20 Feb 2014 04:56:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K4utpx058293; Thu, 20 Feb 2014 04:56:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402200456.s1K4utpx058293@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 20 Feb 2014 04:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262238 - head/sys/dev/netmap 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 04:56:55 -0000 Author: luigi Date: Thu Feb 20 04:56:55 2014 New Revision: 262238 URL: http://svnweb.freebsd.org/changeset/base/262238 Log: compile with NOINET Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Thu Feb 20 04:50:13 2014 (r262237) +++ head/sys/dev/netmap/netmap_freebsd.c Thu Feb 20 04:56:55 2014 (r262238) @@ -101,6 +101,7 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { +#ifdef INET uint16_t pseudolen = datalen + iph->protocol; /* Compute and insert the pseudo-header cheksum. */ @@ -110,6 +111,13 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr * (includes the pseudo-header). */ *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet4 segmentation not supported"); + } +#endif } void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 08:56:00 2014 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 ESMTPS id 838D8B71; Thu, 20 Feb 2014 08:56:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D45F154E; Thu, 20 Feb 2014 08:56:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K8u0cF054975; Thu, 20 Feb 2014 08:56:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K8u0lf054974; Thu, 20 Feb 2014 08:56:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402200856.s1K8u0lf054974@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 08:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262239 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 08:56:00 -0000 Author: brueffer Date: Thu Feb 20 08:55:59 2014 New Revision: 262239 URL: http://svnweb.freebsd.org/changeset/base/262239 Log: MFC: r261858 Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(), probably due to copy+pasting le_uuid_dec(). PR: 146588 Submitted by: Erwin Rol Reviewed by: marcel Modified: stable/10/sys/kern/kern_uuid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_uuid.c ============================================================================== --- stable/10/sys/kern/kern_uuid.c Thu Feb 20 04:56:55 2014 (r262238) +++ stable/10/sys/kern/kern_uuid.c Thu Feb 20 08:55:59 2014 (r262239) @@ -371,7 +371,7 @@ be_uuid_dec(void const *buf, struct uuid p = buf; uuid->time_low = be32dec(p); - uuid->time_mid = le16dec(p + 4); + uuid->time_mid = be16dec(p + 4); uuid->time_hi_and_version = be16dec(p + 6); uuid->clock_seq_hi_and_reserved = p[8]; uuid->clock_seq_low = p[9]; From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 08:58:05 2014 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 ESMTPS id C4AEDCB7; Thu, 20 Feb 2014 08:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFF051567; Thu, 20 Feb 2014 08:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K8w55f055264; Thu, 20 Feb 2014 08:58:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K8w5wS055263; Thu, 20 Feb 2014 08:58:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402200858.s1K8w5wS055263@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 08:58:05 +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: r262240 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 08:58:05 -0000 Author: brueffer Date: Thu Feb 20 08:58:05 2014 New Revision: 262240 URL: http://svnweb.freebsd.org/changeset/base/262240 Log: MFC: r261858 Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(), probably due to copy+pasting le_uuid_dec(). PR: 146588 Submitted by: Erwin Rol Reviewed by: marcel Modified: stable/9/sys/kern/kern_uuid.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_uuid.c ============================================================================== --- stable/9/sys/kern/kern_uuid.c Thu Feb 20 08:55:59 2014 (r262239) +++ stable/9/sys/kern/kern_uuid.c Thu Feb 20 08:58:05 2014 (r262240) @@ -314,7 +314,7 @@ be_uuid_dec(void const *buf, struct uuid p = buf; uuid->time_low = be32dec(p); - uuid->time_mid = le16dec(p + 4); + uuid->time_mid = be16dec(p + 4); uuid->time_hi_and_version = be16dec(p + 6); uuid->clock_seq_hi_and_reserved = p[8]; uuid->clock_seq_low = p[9]; From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 09:00:14 2014 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 ESMTPS id 11C28E32; Thu, 20 Feb 2014 09:00:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1C671593; Thu, 20 Feb 2014 09:00:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K90DXB056208; Thu, 20 Feb 2014 09:00:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K90D2L056207; Thu, 20 Feb 2014 09:00:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402200900.s1K90D2L056207@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 09:00:13 +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: r262241 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 09:00:14 -0000 Author: brueffer Date: Thu Feb 20 09:00:13 2014 New Revision: 262241 URL: http://svnweb.freebsd.org/changeset/base/262241 Log: MFC: r261858 Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(), probably due to copy+pasting le_uuid_dec(). PR: 146588 Submitted by: Erwin Rol Reviewed by: marcel Modified: stable/8/sys/kern/kern_uuid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_uuid.c ============================================================================== --- stable/8/sys/kern/kern_uuid.c Thu Feb 20 08:58:05 2014 (r262240) +++ stable/8/sys/kern/kern_uuid.c Thu Feb 20 09:00:13 2014 (r262241) @@ -314,7 +314,7 @@ be_uuid_dec(void const *buf, struct uuid p = buf; uuid->time_low = be32dec(p); - uuid->time_mid = le16dec(p + 4); + uuid->time_mid = be16dec(p + 4); uuid->time_hi_and_version = be16dec(p + 6); uuid->clock_seq_hi_and_reserved = p[8]; uuid->clock_seq_low = p[9]; From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 13:09:09 2014 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 ESMTPS id 014A9B92; Thu, 20 Feb 2014 13:09:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD5E21DFA; Thu, 20 Feb 2014 13:09:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KD988p057494; Thu, 20 Feb 2014 13:09:08 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KD98KM057492; Thu, 20 Feb 2014 13:09:08 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402201309.s1KD98KM057492@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 20 Feb 2014 13:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262242 - head/sys/boot/fdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 13:09:09 -0000 Author: loos Date: Thu Feb 20 13:09:08 2014 New Revision: 262242 URL: http://svnweb.freebsd.org/changeset/base/262242 Log: Fix the boot on FDT-enabled systems after r261819. While here, don't overwrite the error message on interactive use and add the missing '\n' at end of error message for the non interactive use. Tested by: ian, myself Approved by: adrian (mentor, implicit) Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Thu Feb 20 09:00:13 2014 (r262241) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu Feb 20 13:09:08 2014 (r262242) @@ -230,7 +230,7 @@ fdt_load_dtb_addr(struct fdt_header *hea int err; fdtp_size = fdt_totalsize(header); - err = fdt_check_header(&header); + err = fdt_check_header(header); if (err < 0) { sprintf(command_errbuf, "error validating blob: %s", fdt_strerror(err)); @@ -667,7 +667,7 @@ fdt_fixup(void) { const char *env; char *ethstr; - int chosen, err, eth_no, len; + int chosen, eth_no, len; struct sys_info *si; env = NULL; @@ -675,13 +675,8 @@ fdt_fixup(void) ethstr = NULL; len = 0; - if (fdtp == NULL) { - err = fdt_setup_fdtp(); - if (err) { - sprintf(command_errbuf, "No valid device tree blob found!"); - return (0); - } - } + if (fdtp == NULL && fdt_setup_fdtp() != 0) + return (0); /* Create /chosen node (if not exists) */ if ((chosen = fdt_subnode_offset(fdtp, 0, "chosen")) == @@ -747,7 +742,7 @@ fdt_copy(vm_offset_t va) if (fdtp == NULL) { err = fdt_setup_fdtp(); if (err) { - printf("No valid device tree blob found!"); + printf("No valid device tree blob found!\n"); return (0); } } From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 13:33:18 2014 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 ESMTPS id C8E6651B; Thu, 20 Feb 2014 13:33:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B35A31191; Thu, 20 Feb 2014 13:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KDXINW068986; Thu, 20 Feb 2014 13:33:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KDXIQ0068985; Thu, 20 Feb 2014 13:33:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402201333.s1KDXIQ0068985@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 13:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262243 - head/share/man/man7 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 13:33:18 -0000 Author: brueffer Date: Thu Feb 20 13:33:18 2014 New Revision: 262243 URL: http://svnweb.freebsd.org/changeset/base/262243 Log: Fix a cross-reference. MFC after: 3 days Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Thu Feb 20 13:09:08 2014 (r262242) +++ head/share/man/man7/hier.7 Thu Feb 20 13:33:18 2014 (r262243) @@ -703,7 +703,9 @@ source code for files in The .Fx test suite. -See tests(7) for more details. +See +.Xr tests 7 +for more details. .El .It Pa /var/ multi-purpose log, temporary, transient, and spool files From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 14:29:59 2014 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 ESMTPS id D4CECF95; Thu, 20 Feb 2014 14:29:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C09A716C4; Thu, 20 Feb 2014 14:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KETxvp090248; Thu, 20 Feb 2014 14:29:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KETxk3090247; Thu, 20 Feb 2014 14:29:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402201429.s1KETxk3090247@svn.freebsd.org> From: Ian Lepore Date: Thu, 20 Feb 2014 14:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262244 - head/sys/arm/freescale/imx 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 14:29:59 -0000 Author: ian Date: Thu Feb 20 14:29:59 2014 New Revision: 262244 URL: http://svnweb.freebsd.org/changeset/base/262244 Log: Add early printf support, wrapped in #if 0 because it's only rarely needed. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Thu Feb 20 13:33:18 2014 (r262243) +++ head/sys/arm/freescale/imx/imx6_machdep.c Thu Feb 20 14:29:59 2014 (r262244) @@ -190,3 +190,27 @@ u_int imx_soc_type() return (IMXSOC_6Q); } +/* + * Early putc routine for EARLY_PRINTF support. To use, add to kernel config: + * option SOCDEV_PA=0x02000000 + * option SOCDEV_VA=0x02000000 + * option EARLY_PRINTF + * Resist the temptation to change the #if 0 to #ifdef EARLY_PRINTF here. It + * makes sense now, but if multiple SOCs do that it will make early_putc another + * duplicate symbol to be eliminated on the path to a generic kernel. + */ +#if 0 +static void +imx6_early_putc(int c) +{ + volatile uint32_t * UART_STAT_REG = (uint32_t *)0x02020098; + volatile uint32_t * UART_TX_REG = (uint32_t *)0x02020040; + const uint32_t UART_TXRDY = (1 << 3); + + while ((*UART_STAT_REG & UART_TXRDY) == 0) + continue; + *UART_TX_REG = c; +} +early_putc_t *early_putc = imx6_early_putc; +#endif + From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 14:39:13 2014 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 ESMTPS id 77D40776; Thu, 20 Feb 2014 14:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F32B1819; Thu, 20 Feb 2014 14:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KEdDlL094351; Thu, 20 Feb 2014 14:39:13 GMT (envelope-from skreuzer@svn.freebsd.org) Received: (from skreuzer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KEdDgF094350; Thu, 20 Feb 2014 14:39:13 GMT (envelope-from skreuzer@svn.freebsd.org) Message-Id: <201402201439.s1KEdDgF094350@svn.freebsd.org> From: Steven Kreuzer Date: Thu, 20 Feb 2014 14:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262245 - head/release/doc/en_US.ISO8859-1/relnotes 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 14:39:13 -0000 Author: skreuzer (doc,ports committer) Date: Thu Feb 20 14:39:12 2014 New Revision: 262245 URL: http://svnweb.freebsd.org/changeset/base/262245 Log: Document r261504 - FreeBSD/i386 guests can be run under bhyve. Document r261498 - ping uses the Capsicum framework to drop privileges Document r261344 - mdocml have been upgraded to version 1.12.3 Documetn r261991 - llvm/clang have been upgraded to version 3.4 Approved by: hrs (mentor) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Feb 20 14:29:59 2014 (r262244) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Feb 20 14:39:12 2014 (r262245) @@ -237,6 +237,13 @@ which provides access to functionality that is not available in the capability mode sandbox. + &man.ping.8; protects against malicious + network packets using the Capsicum framework to drop + privileges. + + &os;/&arch.i386; guests can be run under + bhyve. + <filename>/etc/rc.d</filename> Scripts @@ -273,6 +280,13 @@ libc++ has been updated to version 3.4. + + mdocml has been + updated to version 1.12.3. + + LLVM and + Clang have been updated to + version 3.4. From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 16:35:48 2014 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 ESMTPS id D714461D; Thu, 20 Feb 2014 16:35:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B580014A9; Thu, 20 Feb 2014 16:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KGZmW7043005; Thu, 20 Feb 2014 16:35:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KGZmnQ043003; Thu, 20 Feb 2014 16:35:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402201635.s1KGZmnQ043003@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 16:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262246 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 16:35:48 -0000 Author: brueffer Date: Thu Feb 20 16:35:48 2014 New Revision: 262246 URL: http://svnweb.freebsd.org/changeset/base/262246 Log: Spelling, grammar and mdoc cleanup. Modified: head/share/man/man4/gpioiic.4 head/share/man/man4/gpioled.4 Modified: head/share/man/man4/gpioiic.4 ============================================================================== --- head/share/man/man4/gpioiic.4 Thu Feb 20 14:39:12 2014 (r262245) +++ head/share/man/man4/gpioiic.4 Thu Feb 20 16:35:48 2014 (r262246) @@ -31,43 +31,53 @@ .Nm gpioiic .Nd GPIO I2C bit-banging device driver .Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device gpio" .Cd "device gpioiic" .Cd "device iic" .Cd "device iicbb" .Cd "device iicbus" +.Ed .Sh DESCRIPTION The -.Em gpioiic +.Nm driver provides an IIC bit-banging interface using two GPIO pins for the SCL and SDA on the -.Em gpiobus . +.Nm gpiobus . .Nm -implements an open colector kind of output, as recommended by the standard, +implements an open collector kind of output, as recommended by the standard, when driving the pins on the -.Em gpiobus , +.Nm gpiobus , i.e, they are never switched to the logical value of '1', or they are '0' or simply open (Hi-Z/tri-state). So the pullup resistors are required so .Nm can work. .Pp -On a hint based system, like -.Li MIPS , these values are configureable for the -.Nm gpioiic : +On a +.Xr device.hints 5 +based system, like +.Li MIPS , +these values are configurable for the +.Nm : .Bl -tag -width ".Va hint.gpioiic.%d.atXXX" .It Va hint.gpioiic.%d.at -The gpiobus you are attaching to. +The +.Nm gpiobus +you are attaching to. Normally just gpiobus0. .It Va hint.gpioiic.%d.pins This is a bitmask of the pins on the -.Em gpiobus +.Nm gpiobus that are to be used for SCLOCK and SDATA from the GPIO IIC bit-banging bus. To configure pin 0 and 7, use the bitmask of 0b10000001 and convert it to a hexadecimal value of 0x0081. Please note that this mask should only ever have two bits set -(any others bits - i.e., pins - will be ignored). +(any other bits - i.e., pins - will be ignored). .It Va hint.gpioiic.%d.scl Indicates which bit in the .Va hint.gpioiic.%d.pins @@ -85,7 +95,8 @@ Optional, defaults to 1. On a .Xr FDT 4 based system, like -.Li ARM , the dts part for a +.Li ARM , +the DTS part for a .Nm gpioiic device usually looks like: .Bd -literal Modified: head/share/man/man4/gpioled.4 ============================================================================== --- head/share/man/man4/gpioled.4 Thu Feb 20 14:39:12 2014 (r262245) +++ head/share/man/man4/gpioled.4 Thu Feb 20 16:35:48 2014 (r262246) @@ -29,30 +29,34 @@ .Os .Sh NAME .Nm gpioled -.Nd GPIO led generic device driver +.Nd GPIO LED generic device driver .Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device gpio" .Cd "device gpioled" -.Pp -This driver attaches a -.Xr led 4 -device to a GPIO pin. +.Ed .Sh DESCRIPTION The -.Em gpioled -driver provides a glue to attach a +.Nm +driver provides glue to attach a .Xr led 4 compatible device to a GPIO pin. -Each led on the system has a +Each LED in the system has a .Pa name -which is used to export a device in +which is used to export a device as .Pa /dev/led/ . The GPIO pin can then be controlled by writing to this device as described -on +in .Xr led 4 . .Pp -On a hint based system, like -.Li MIPS , these values are configureable for +On a +.Xr device.hints 5 +based system, like +.Li MIPS , +these values are configurable for .Nm : .Bl -tag -width ".Va hint.gpioiic.%d.atXXX" .It Va hint.gpioled.%d.at @@ -66,13 +70,14 @@ to create for .It Va hint.gpioled.%d.pins Which pin on the GPIO interface to map to this instance. Please note that this mask should only ever have one bit set -(any others bits - i.e., pins - will be ignored). +(any other bits - i.e., pins - will be ignored). .El .Pp On a .Xr FDT 4 based system, like -.Li ARM , the dts part for a +.Li ARM , +the DTS part for a .Nm gpioled device usually looks like: .Bd -literal @@ -95,7 +100,7 @@ gpio: gpio { }; .Ed .Pp -And optionally, you can choose combine all the leds under a single +Optionally, you can choose to combine all the LEDs under a single .Dq gpio-leds compatible node: .Bd -literal @@ -119,7 +124,7 @@ simplebus0 { }; .Ed .Pp -Both methods are equally supported and it is possible to have the leds +Both methods are equally supported and it is possible to have the LEDs defined with any sort of mix between the methods. The only restriction is that a GPIO pin cannot be mapped by two different (gpio)leds. @@ -131,15 +136,15 @@ property, please consult .Pp The property .Va name -is the arbitrary name of device in +is the arbitrary name of the device in .Pa /dev/led/ to create for .Xr led 4 . .Sh SEE ALSO .Xr fdt 4 , .Xr gpio 4 , -.Xr led 4 , -.Xr gpioiic 4 +.Xr gpioiic 4 , +.Xr led 4 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 17:10:53 2014 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 ESMTPS id 30AACFF9; Thu, 20 Feb 2014 17:10:53 +0000 (UTC) Received: from mail-oa0-x233.google.com (mail-oa0-x233.google.com [IPv6:2607:f8b0:4003:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2BF11846; Thu, 20 Feb 2014 17:10:52 +0000 (UTC) Received: by mail-oa0-f51.google.com with SMTP id h16so2462758oag.10 for ; Thu, 20 Feb 2014 09:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=d+QfTNrQxTuUZ4htWprqoCP7ES8k2xBVocCoFi9qhKo=; b=r8fjai1QM61bHsfYBiPEnVeZaS/2MYp80tkh389DiMmuKfRGMdPafxE9cMyPuTJn5+ 7fLMiZfFJMjRLB1Lbp8qiU25dqbZXAzeZfR/6q+XjkJSVk0+nEvAX65S89fmEfGyXeu8 hUl3XAK9ZYY+WyPuQSMTlkoDS7udq6OIWX6h/nhxonvXYL0Ar4aHe6J3C2r7t165q26m 4wc5qLUvIWcOENWk2n4ePKj5j1sZFZWivc4RoxLIroYVP7jLIv5wtrq6Lv+0wQXsUQDi fFuOVomNefIhoPg6cv0Tt1/qJD1lCTC8RydfFp44rd8RPu/VeDLRQNLQWsYXgeFZ+fV3 FIHA== MIME-Version: 1.0 X-Received: by 10.60.165.72 with SMTP id yw8mr2493301oeb.71.1392916252016; Thu, 20 Feb 2014 09:10:52 -0800 (PST) Received: by 10.182.92.36 with HTTP; Thu, 20 Feb 2014 09:10:51 -0800 (PST) In-Reply-To: <201402201635.s1KGZmnQ043003@svn.freebsd.org> References: <201402201635.s1KGZmnQ043003@svn.freebsd.org> Date: Thu, 20 Feb 2014 12:10:51 -0500 Message-ID: Subject: Re: svn commit: r262246 - head/share/man/man4 From: Benjamin Kaduk To: Christian Brueffer Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 17:10:53 -0000 On Thu, Feb 20, 2014 at 11:35 AM, Christian Brueffer wrote: > Author: brueffer > Date: Thu Feb 20 16:35:48 2014 > New Revision: 262246 > URL: http://svnweb.freebsd.org/changeset/base/262246 > > Modified: head/share/man/man4/gpioiic.4 > > ============================================================================== > --- head/share/man/man4/gpioiic.4 Thu Feb 20 14:39:12 2014 > (r262245) > +++ head/share/man/man4/gpioiic.4 Thu Feb 20 16:35:48 2014 > (r262246) > To configure pin 0 and 7, use the bitmask of > 0b10000001 and convert it to a hexadecimal value of 0x0081. > Please note that this mask should only ever have two bits set > -(any others bits - i.e., pins - will be ignored). > +(any other bits - i.e., pins - will be ignored). > .It Va hint.gpioiic.%d.scl > Indicates which bit in the > .Va hint.gpioiic.%d.pins > I feel like we should have a better answer than this for em dashes from mdoc sources. From looking at mdoc(7), though, it seems like that better answer may just be "two hyphens". Alas. -Ben From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 17:23:09 2014 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 ESMTPS id 020133D4; Thu, 20 Feb 2014 17:23:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E08971937; Thu, 20 Feb 2014 17:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KHN8AU062844; Thu, 20 Feb 2014 17:23:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KHN86o062843; Thu, 20 Feb 2014 17:23:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201402201723.s1KHN86o062843@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 20 Feb 2014 17:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262247 - head/usr.bin/iscsictl 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 17:23:09 -0000 Author: trasz Date: Thu Feb 20 17:23:08 2014 New Revision: 262247 URL: http://svnweb.freebsd.org/changeset/base/262247 Log: Make it clear that there are two ways to add a session using iscsictl(8), and some options require configuration file. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.8 Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Thu Feb 20 16:35:48 2014 (r262246) +++ head/usr.bin/iscsictl/iscsictl.8 Thu Feb 20 17:23:08 2014 (r262247) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2014 +.Dd February 20, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -98,6 +98,21 @@ CHAP login. Verbose mode. .El .Pp +Certain parameters are neccessary when adding a session. +One can specify these either via command line (using the +.Fl t , +.Fl p , +.Fl u , +and +.Fl s +options), or configuration file (using the +.Fl a +or +.Fl n +options). +Some functionality - for example mutual CHAP - is available only +via configuration file. +.Pp Since connecting to the target is performed in background, non-zero exit status does not mean that the session was successfully established. Use From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 19:26:16 2014 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 ESMTPS id 0BA0B77; Thu, 20 Feb 2014 19:26:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E691B15D0; Thu, 20 Feb 2014 19:26:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KJQFk2013322; Thu, 20 Feb 2014 19:26:15 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KJQBjr013292; Thu, 20 Feb 2014 19:26:11 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402201926.s1KJQBjr013292@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 19:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262248 - in vendor/subversion/dist: . subversion/include subversion/include/private subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_ra_serf subversion/libsvn_repos s... 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 19:26:16 -0000 Author: peter Date: Thu Feb 20 19:26:10 2014 New Revision: 262248 URL: http://svnweb.freebsd.org/changeset/base/262248 Log: Vendor import svn-1.8.8 Modified: vendor/subversion/dist/CHANGES vendor/subversion/dist/Makefile.in vendor/subversion/dist/NOTICE vendor/subversion/dist/build-outputs.mk vendor/subversion/dist/build.conf vendor/subversion/dist/configure vendor/subversion/dist/configure.ac vendor/subversion/dist/subversion/include/private/svn_auth_private.h vendor/subversion/dist/subversion/include/private/svn_diff_tree.h vendor/subversion/dist/subversion/include/private/svn_mutex.h vendor/subversion/dist/subversion/include/svn_auth.h vendor/subversion/dist/subversion/include/svn_client.h vendor/subversion/dist/subversion/include/svn_config.h vendor/subversion/dist/subversion/include/svn_diff.h vendor/subversion/dist/subversion/include/svn_dirent_uri.h vendor/subversion/dist/subversion/include/svn_io.h vendor/subversion/dist/subversion/include/svn_repos.h vendor/subversion/dist/subversion/include/svn_version.h vendor/subversion/dist/subversion/include/svn_wc.h vendor/subversion/dist/subversion/libsvn_client/copy.c vendor/subversion/dist/subversion/libsvn_client/log.c vendor/subversion/dist/subversion/libsvn_client/prop_commands.c vendor/subversion/dist/subversion/libsvn_client/update.c vendor/subversion/dist/subversion/libsvn_client/util.c vendor/subversion/dist/subversion/libsvn_fs_fs/fs_fs.c vendor/subversion/dist/subversion/libsvn_fs_fs/rep-cache-db.h vendor/subversion/dist/subversion/libsvn_fs_fs/rep-cache.c vendor/subversion/dist/subversion/libsvn_ra_serf/commit.c vendor/subversion/dist/subversion/libsvn_ra_serf/util.c vendor/subversion/dist/subversion/libsvn_repos/commit.c vendor/subversion/dist/subversion/libsvn_repos/reporter.c vendor/subversion/dist/subversion/libsvn_subr/auth.c vendor/subversion/dist/subversion/libsvn_subr/cache-membuffer.c vendor/subversion/dist/subversion/libsvn_subr/cmdline.c vendor/subversion/dist/subversion/libsvn_subr/internal_statements.h vendor/subversion/dist/subversion/libsvn_subr/io.c vendor/subversion/dist/subversion/libsvn_subr/sqlite.c vendor/subversion/dist/subversion/libsvn_subr/sqlite3wrapper.c vendor/subversion/dist/subversion/libsvn_subr/subst.c vendor/subversion/dist/subversion/libsvn_subr/sysinfo.c vendor/subversion/dist/subversion/libsvn_subr/win32_crypto.c vendor/subversion/dist/subversion/libsvn_wc/conflicts.h vendor/subversion/dist/subversion/libsvn_wc/diff_local.c vendor/subversion/dist/subversion/libsvn_wc/upgrade.c vendor/subversion/dist/subversion/libsvn_wc/wc-checks.h vendor/subversion/dist/subversion/libsvn_wc/wc-metadata.h vendor/subversion/dist/subversion/libsvn_wc/wc-metadata.sql vendor/subversion/dist/subversion/libsvn_wc/wc-queries.h vendor/subversion/dist/subversion/libsvn_wc/wc-queries.sql vendor/subversion/dist/subversion/libsvn_wc/wc.h vendor/subversion/dist/subversion/libsvn_wc/wc_db.c vendor/subversion/dist/subversion/libsvn_wc/wc_db.h vendor/subversion/dist/subversion/libsvn_wc/wc_db_util.c vendor/subversion/dist/subversion/svn/conflict-callbacks.c vendor/subversion/dist/subversion/svn/status-cmd.c vendor/subversion/dist/subversion/svn/svn.c vendor/subversion/dist/subversion/svnserve/svnserve.c Modified: vendor/subversion/dist/CHANGES ============================================================================== --- vendor/subversion/dist/CHANGES Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/CHANGES Thu Feb 20 19:26:10 2014 (r262248) @@ -1,3 +1,70 @@ +Version 1.8.8 +(19 Feb 2014, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.8 + + User-visible changes: + - Client-side bugfixes: + * use CryptoAPI to validate intermediary certificates on Windows (r1564623) + * fix automatic relocate for wcs not at repository root (r1541638 et al) + * diff: fix when target is a drive root on Windows (r1541635) + * wc: improve performance when used with SQLite 3.8 (r1542765) + * copy: fix some scenarios that broke the working copy (r1560690) + * move: fix errors when moving files between an external and the parent + working copy (r1551524, r1551579) + * log: resolve performance regression in certain scenarios (r1553101 et al) + * merge: decrease work to detect differences between 3 files (r1548486) + * checkout: don't require flush support for symlinks on Windows (r1547774) + * commit: don't change file permissions inappropriately (issue #4440) + * commit: fix assertion due to invalid pool lifetime (r1553376 et al) + * version: don't cut off the distribution version on Linux (r1544878 et al) + * flush stdout before exiting to avoid information being lost (r1499470) + * status: fix missing sentinel value on warning codes (r1543145) + * update/switch: improve some WC db queries that may return incorrect + results depending on how SQLite is built (r1567109) + + - Server-side bugfixes: + * reduce memory usage during checkout and export (r1564215) + * fsfs: create rep-cache.db with proper permissions (issue #3437) + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * mod_dav_svn: fix SVNAllowBulkUpdates directive merging (r1548105) + * mod_dav_svn: include requested property changes in reports (r1557522) + * svnserve: correct default cache size in help text (r1563110) + * svnadmin dump: reduce size of dump files with '--deltas' (r1554978) + * resolve integer underflow that resulted in infinite loops (r1567985) + + Developer-visible changes: + - General: + * fix ocassional failure of check_tests.py 12 (r1496127 et al) + * fix failure with SQLite 3.8.1-3.8.3 when built with + SQLITE_ENABLE_STAT3/4 due to bug in SQLite (r1567286, r1567392) + * specify SQLite defaults that can be changed when SQLite is built + to avoid unexpected behavior with Subversion (r1567064) + + - API changes: + * numerous documentation fixes + * svn_client_commit_item3_dup() fix pool lifetime issues (r1550803) + * ra_serf: properly ask multiple certificate validation providers for + acceptance of certificate failures (r1535532) + * release internal fs objects when closing commit editor (r1555499) + * svn_client_proplist4() don't call the callback multiple times for + the same path in order to deliver inherited properties (r1549858 et al) + + - Bindings: + * javahl: make test suite run without installing on OS X (r1535115) + * swig: fix building out of tarball on OS X (r1555654) + * swig-pl: fix with --enable-sqlite-compatibility-version (r1559009) + * swig: fix building bindings on OS X when APR has the -no-cpp-precomp + flag in the apr-config --cppflags output. (r1535610) + * swig: fix building from tarball with an out-of-tree build (r1543187) + + +Version 1.8.7 +(Not released, see changes for 1.8.8.) + +Version 1.8.6 +(Not released, see changes for 1.8.8.) + + Version 1.8.5 (25 November 2013, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.5 @@ -19,7 +86,7 @@ http://svn.apache.org/repos/asf/subversi Developer-visible changes: - General: * fix compilation with '--enable-optimize' with clang (r1534860) - * fix copmpilation with debug build of BDB on Windows (r1501656, r1501702) + * fix compilation with debug build of BDB on Windows (r1501656, r1501702) * fix '--with-openssl' option when building on Windows (r1535139) * add test to fail when built against broken ZLib (r1537193 et al) @@ -305,7 +372,7 @@ http://svn.apache.org/repos/asf/subversi * decreased default http timeout for ra_serf (issue #3968) * prevent ra_serf from corrupting the working copy (issue #3993) * ra_serf transmits property changes inline to reduce requests (r1378927) - * allow client to avoid SSL certificate prompts (issue #2410) + * by default avoid SSL certificate prompts in client (issue #2410) * improve interactive resolution of property conflicts (r1387678 et al) * make ra_serf raise an error upon delta-base mismatch (issue #4235) * tune ra_svn transmit buffer handling (r1391788) @@ -515,7 +582,7 @@ http://svn.apache.org/repos/asf/subversi * configure now script auto-detects GNOME keyring (r1387230) * allow configure to detect BDB on Debian-based Linux distros (r1390633) * auto-detect serf via pkg-config (r1391662) - * improve queries for compatability with SQLite 3.7.16 (r1455239) + * improve queries for compatibility with SQLite 3.7.16 (r1455239) * remove support for in-tree apr, apr-util and apr-memcache (r1456924) * FSFS caching supports prefixes now (r1462436) * maintainer mode now prints symbolic error codes (r1465157) @@ -553,6 +620,25 @@ http://svn.apache.org/repos/asf/subversi * fix some reference counting bugs in swig-py bindings (r1464899, r1466524) +Version 1.7.15 +(12 Feb 2014, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.15 + + User-visible changes: + - Client-side bugfixes: + * copy: fix some scenarios that broke the working copy (r1560690) + * diff: fix regressions due to fixes in 1.7.14 (issue #4460) + + - Server-side bugfixes: + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * reduce memory usage during checkout and export (r1564215) + + Developer-visible changes: + - General: + * fix failure in checkout_tests.py + * support compiling against Cyrus sasl 2.1.25 (r1404912, r1413402) + + Version 1.7.14 (25 Nov 2013, from /branches/1.7.x) http://svn.apache.org/repos/asf/subversion/tags/1.7.14 @@ -1326,7 +1412,7 @@ http://svn.apache.org/repos/asf/subversi http://subversion.apache.org/security/CVE-2011-1752-advisory.txt * fixed: write-through proxy could direcly commit to slave (r917523) * detect a particular corruption condition in FSFS (r1100213) - * improve error message when clients refer to unkown revisions (r939000) + * improve error message when clients refer to unknown revisions (r939000) * bugfixes and optimizations to the DAV mirroring code (r878607) * fixed: locked and deleted file causes tree conflict (issue #3525) * fixed: update touches locked file with svn:keywords property (issue #3471) @@ -1696,7 +1782,7 @@ http://svn.apache.org/repos/asf/subversi * improve performance of 'svn update' on large files (r36389, et. al.) * fixed: error leak and potential crash (r36860) * fixed: parent directory handling on Windows (r36049, -50, -51, -131) - * fixed: unintialized memory errors (r36252, -3) + * fixed: uninitialized memory errors (r36252, -3) * fixed: potential working copy corruption (r36714) * fixed: working copy upgrade error (r36302) * fixed: pointer dereference error (r36783) Modified: vendor/subversion/dist/Makefile.in ============================================================================== --- vendor/subversion/dist/Makefile.in Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/Makefile.in Thu Feb 20 19:26:10 2014 (r262248) @@ -177,6 +177,7 @@ CXXMAINTAINERFLAGS = @CXXMAINTAINERFLAGS CPPFLAGS = @CPPFLAGS@ $(EXTRA_CPPFLAGS) LDFLAGS = @LDFLAGS@ $(EXTRA_LDFLAGS) SWIG_LDFLAGS = @SWIG_LDFLAGS@ $(EXTRA_SWIG_LDFLAGS) +SWIG_CPPFLAGS = @SWIG_CPPFLAGS@ $(EXTRA_CPPFLAGS) COMPILE = $(CC) $(CMODEFLAGS) $(CPPFLAGS) $(CMAINTAINERFLAGS) $(CFLAGS) $(INCLUDES) COMPILE_CXX = $(CXX) $(CXXMODEFLAGS) $(CPPFLAGS) $(CXXMAINTAINERFLAGS) $(CXXFLAGS) $(INCLUDES) @@ -199,6 +200,19 @@ COMPILE_JAVAHL_CXX = $(LIBTOOL) $(LTCXXF COMPILE_JAVAHL_JAVAC = $(JAVAC) $(JAVAC_FLAGS) COMPILE_JAVAHL_JAVAH = $(JAVAH) +# export an env variable so that the tests can run without being installed +TEST_SHLIB_VAR_JAVAHL=\ + if [ "@SVN_APR_SHLIB_PATH_VAR@" = "DYLD_LIBRARY_PATH" ]; then \ + for d in $(abs_builddir)/subversion/libsvn_*; do \ + if [ -n "$$DYLD_LIBRARY_PATH" ]; then \ + @SVN_APR_SHLIB_PATH_VAR@="$$@SVN_APR_SHLIB_PATH_VAR@:$$d/.libs"; \ + else \ + @SVN_APR_SHLIB_PATH_VAR@="$$d/.libs"; \ + fi; \ + done; \ + export @SVN_APR_SHLIB_PATH_VAR@; \ + fi; + # special compilation for files destined for cxxhl COMPILE_CXXHL_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=compile $(COMPILE_CXX) $(LT_CFLAGS) $(CXXHL_INCLUDES) -o $@ -c @@ -465,11 +479,13 @@ clean-javahl: check-tigris-javahl: javahl-compat @FIX_JAVAHL_LIB@ - $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" -Djava.library.path=@JAVAHL_OBJDIR@:$(libdir) -classpath $(javahl_compat_tests_PATH):$(javahl_tests_CLASSPATH) "-Dtest.tests=$(JAVAHL_TESTS)" org.tigris.subversion.javahl.RunTests + $(TEST_SHLIB_VAR_JAVAHL) \ + $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" "-Djava.library.path=@JAVAHL_OBJDIR@:$(libdir)" -classpath "$(javahl_compat_tests_PATH):$(javahl_tests_CLASSPATH)" "-Dtest.tests=$(JAVAHL_TESTS)" org.tigris.subversion.javahl.RunTests check-apache-javahl: javahl @FIX_JAVAHL_LIB@ - $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" -Djava.library.path=@JAVAHL_OBJDIR@:$(libdir) -classpath $(javahl_tests_PATH):$(javahl_tests_CLASSPATH) "-Dtest.tests=$(JAVAHL_TESTS)" org.apache.subversion.javahl.RunTests + $(TEST_SHLIB_VAR_JAVAHL) \ + $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" "-Djava.library.path=@JAVAHL_OBJDIR@:$(libdir)" -classpath "$(javahl_tests_PATH):$(javahl_tests_CLASSPATH)" "-Dtest.tests=$(JAVAHL_TESTS)" org.apache.subversion.javahl.RunTests check-javahl: check-apache-javahl Modified: vendor/subversion/dist/NOTICE ============================================================================== --- vendor/subversion/dist/NOTICE Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/NOTICE Thu Feb 20 19:26:10 2014 (r262248) @@ -1,5 +1,5 @@ -Subversion -Copyright 2010 The Apache Software Foundation +Apache Subversion +Copyright 2013 The Apache Software Foundation This product includes software developed by many people, and distributed under Contributor License Agreements to The Apache Software Foundation Modified: vendor/subversion/dist/build-outputs.mk ============================================================================== --- vendor/subversion/dist/build-outputs.mk Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/build-outputs.mk Thu Feb 20 19:26:10 2014 (r262248) @@ -1870,82 +1870,82 @@ subversion/bindings/swig/perl/libsvn_swi $(COMPILE_SWIG_PL) $(canonicalized_srcdir)subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c subversion/bindings/swig/perl/native/core.lo: subversion/bindings/swig/perl/native/core.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/core.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/core.c subversion/bindings/swig/perl/native/svn_client.lo: subversion/bindings/swig/perl/native/svn_client.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_client.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_client.c subversion/bindings/swig/perl/native/svn_delta.lo: subversion/bindings/swig/perl/native/svn_delta.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_delta.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_delta.c subversion/bindings/swig/perl/native/svn_diff.lo: subversion/bindings/swig/perl/native/svn_diff.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_diff.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_diff.c subversion/bindings/swig/perl/native/svn_fs.lo: subversion/bindings/swig/perl/native/svn_fs.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_fs.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_fs.c subversion/bindings/swig/perl/native/svn_ra.lo: subversion/bindings/swig/perl/native/svn_ra.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_ra.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_ra.c subversion/bindings/swig/perl/native/svn_repos.lo: subversion/bindings/swig/perl/native/svn_repos.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_repos.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_repos.c subversion/bindings/swig/perl/native/svn_wc.lo: subversion/bindings/swig/perl/native/svn_wc.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_wc.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_wc.c subversion/bindings/swig/python/core.lo: subversion/bindings/swig/python/core.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/core.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/core.c subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.lo: subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c subversion/bindings/swig/proxy/swig_python_external_runtime.swg subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/svn_private_config.h $(COMPILE_SWIG_PY) $(canonicalized_srcdir)subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c subversion/bindings/swig/python/svn_client.lo: subversion/bindings/swig/python/svn_client.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_client.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_client.c subversion/bindings/swig/python/svn_delta.lo: subversion/bindings/swig/python/svn_delta.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_delta.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_delta.c subversion/bindings/swig/python/svn_diff.lo: subversion/bindings/swig/python/svn_diff.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_diff.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_diff.c subversion/bindings/swig/python/svn_fs.lo: subversion/bindings/swig/python/svn_fs.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_fs.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_fs.c subversion/bindings/swig/python/svn_ra.lo: subversion/bindings/swig/python/svn_ra.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_ra.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_ra.c subversion/bindings/swig/python/svn_repos.lo: subversion/bindings/swig/python/svn_repos.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_repos.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_repos.c subversion/bindings/swig/python/svn_wc.lo: subversion/bindings/swig/python/svn_wc.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_wc.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_wc.c subversion/bindings/swig/ruby/core.lo: subversion/bindings/swig/ruby/core.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/core.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/core.c subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.lo: subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c subversion/bindings/swig/proxy/swig_ruby_external_runtime.swg subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_nls.h subversion/include/svn_opt.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_wc.h subv ersion/svn_private_config.h $(COMPILE_SWIG_RB) $(canonicalized_srcdir)subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c subversion/bindings/swig/ruby/svn_client.lo: subversion/bindings/swig/ruby/svn_client.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_client.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_client.c subversion/bindings/swig/ruby/svn_delta.lo: subversion/bindings/swig/ruby/svn_delta.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_delta.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_delta.c subversion/bindings/swig/ruby/svn_diff.lo: subversion/bindings/swig/ruby/svn_diff.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_diff.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_diff.c subversion/bindings/swig/ruby/svn_fs.lo: subversion/bindings/swig/ruby/svn_fs.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_fs.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_fs.c subversion/bindings/swig/ruby/svn_ra.lo: subversion/bindings/swig/ruby/svn_ra.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_ra.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_ra.c subversion/bindings/swig/ruby/svn_repos.lo: subversion/bindings/swig/ruby/svn_repos.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_repos.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_repos.c subversion/bindings/swig/ruby/svn_wc.lo: subversion/bindings/swig/ruby/svn_wc.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_wc.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_wc.c subversion/libsvn_auth_gnome_keyring/gnome_keyring.lo: subversion/libsvn_auth_gnome_keyring/gnome_keyring.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/svn_private_config.h @@ -2231,7 +2231,7 @@ subversion/libsvn_ra_serf/serf.lo: subve subversion/libsvn_ra_serf/update.lo: subversion/libsvn_ra_serf/update.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion /include/svn_version.h subversion/include/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h subversion/svn_private_config.h -subversion/libsvn_ra_serf/util.lo: subversion/libsvn_ra_serf/util.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/include/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h subversion/svn_private_config.h +subversion/libsvn_ra_serf/util.lo: subversion/libsvn_ra_serf/util.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/incl ude/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h subversion/svn_private_config.h subversion/libsvn_ra_serf/util_error.lo: subversion/libsvn_ra_serf/util_error.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_error_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_version.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h @@ -2291,7 +2291,7 @@ subversion/libsvn_subr/adler32.lo: subve subversion/libsvn_subr/atomic.lo: subversion/libsvn_subr/atomic.c subversion/include/private/svn_atomic.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_types.h -subversion/libsvn_subr/auth.lo: subversion/libsvn_subr/auth.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_subr/auth.h subversion/svn_private_config.h +subversion/libsvn_subr/auth.lo: subversion/libsvn_subr/auth.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_subr/auth.h subversion/svn_private_config.h subversion/libsvn_subr/base64.lo: subversion/libsvn_subr/base64.c subversion/include/private/svn_debug.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h Modified: vendor/subversion/dist/build.conf ============================================================================== --- vendor/subversion/dist/build.conf Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/build.conf Thu Feb 20 19:26:10 2014 (r262248) @@ -71,9 +71,9 @@ test-scripts = bdb-test-scripts = -swig-python-opts = $(CPPFLAGS) -python -classic -swig-perl-opts = $(CPPFLAGS) -perl -nopm -noproxy -swig-ruby-opts = $(CPPFLAGS) -ruby +swig-python-opts = $(SWIG_CPPFLAGS) -python -classic +swig-perl-opts = $(SWIG_CPPFLAGS) -perl -nopm -noproxy +swig-ruby-opts = $(SWIG_CPPFLAGS) -ruby swig-languages = python perl ruby swig-dirs = subversion/bindings/swig/python Modified: vendor/subversion/dist/configure ============================================================================== --- vendor/subversion/dist/configure Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/configure Thu Feb 20 19:26:10 2014 (r262248) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.8.5. +# Generated by GNU Autoconf 2.69 for subversion 1.8.8. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.8.5' -PACKAGE_STRING='subversion 1.8.5' +PACKAGE_VERSION='1.8.8' +PACKAGE_STRING='subversion 1.8.8' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -635,6 +635,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS SVN_CONFIG_SCRIPT_FILES INCLUDE_OUTPUTS +SWIG_CPPFLAGS JAVAHL_COMPAT_TESTS_TARGET JAVAHL_TESTS_TARGET JAVA_CLASSPATH @@ -1456,7 +1457,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.8.5 to adapt to many kinds of systems. +\`configure' configures subversion 1.8.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1522,7 +1523,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.8.5:";; + short | recursive ) echo "Configuration of subversion 1.8.8:";; esac cat <<\_ACEOF @@ -1736,7 +1737,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.8.5 +subversion configure 1.8.8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2280,7 +2281,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.8.5, which was +It was created by subversion $as_me 1.8.8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2660,8 +2661,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.5" >&5 -$as_echo "$as_me: Configuring Subversion 1.8.5" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.8" >&5 +$as_echo "$as_me: Configuring Subversion 1.8.8" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -25073,6 +25074,13 @@ if test "$CC" = "clang"; then fi +# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. +SWIG_CPPFLAGS="$CPPFLAGS" + + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + + + cat >>confdefs.h <<_ACEOF #define SVN_PATH_LOCAL_SEPARATOR '/' @@ -25662,7 +25670,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.8.5, which was +This file was extended by subversion $as_me 1.8.8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25728,7 +25736,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.8.5 +subversion config.status 1.8.8 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/subversion/dist/configure.ac ============================================================================== --- vendor/subversion/dist/configure.ac Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/configure.ac Thu Feb 20 19:26:10 2014 (r262248) @@ -1443,6 +1443,11 @@ if test "$CC" = "clang"; then SVN_STRIP_FLAG(CPPFLAGS, [-no-cpp-precomp ]) fi +# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. +SWIG_CPPFLAGS="$CPPFLAGS" +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +AC_SUBST([SWIG_CPPFLAGS]) + dnl Since this is used only on Unix-y systems, define the path separator as '/' AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/', [Defined to be the path separator used on your local filesystem]) Modified: vendor/subversion/dist/subversion/include/private/svn_auth_private.h ============================================================================== --- vendor/subversion/dist/subversion/include/private/svn_auth_private.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/private/svn_auth_private.h Thu Feb 20 19:26:10 2014 (r262248) @@ -37,6 +37,24 @@ extern "C" { #endif /* __cplusplus */ +/** SSL server authority verification credential type. + * + * The followin auth parameters are available to the providers: + * + * - @c SVN_AUTH_PARAM_SSL_SERVER_FAILURES (@c apr_uint32_t*) + * - @c SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO + * (@c svn_auth_ssl_server_cert_info_t*) + * + * The following optional auth parameters are relevant to the providers: + * + * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) + * + * @since New in 1.9. + */ +#define SVN_AUTH_CRED_SSL_SERVER_AUTHORITY "svn.ssl.server.authority" + + + /* If you add a password type for a provider which stores * passwords on disk in encrypted form, remember to update * svn_auth__simple_save_creds_helper. Otherwise it will be @@ -213,6 +231,25 @@ svn_auth__ssl_client_cert_pw_set(svn_boo svn_boolean_t non_interactive, apr_pool_t *pool); +#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN) +/** + * Set @a *provider to an authentication provider that implements + * ssl authority verification via the Windows CryptoApi. + * + * This provider automatically validates authority certificates with + * the CryptoApi, like Internet Explorer and the Windows network API do. + * This allows the rollout of root certificates via Windows Domain + * policies, instead of Subversion specific configuration. + * + * @note This function is only available on Windows. + */ +void +svn_auth__get_windows_ssl_server_authority_provider( + svn_auth_provider_object_t **provider, + apr_pool_t *pool); +#endif + + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: vendor/subversion/dist/subversion/include/private/svn_diff_tree.h ============================================================================== --- vendor/subversion/dist/subversion/include/private/svn_diff_tree.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/private/svn_diff_tree.h Thu Feb 20 19:26:10 2014 (r262248) @@ -20,13 +20,13 @@ * ==================================================================== * @endcopyright * - * @file svn_wc.h + * @file svn_diff_tree.h * @brief Generic diff handler. Replacing the old svn_wc_diff_callbacks4_t * infrastructure */ -#ifndef SVN_DIFF_PROCESSOR_H -#define SVN_DIFF_PROCESSOR_H +#ifndef SVN_DIFF_TREE_H +#define SVN_DIFF_TREE_H #include "svn_types.h" @@ -353,5 +353,5 @@ svn_diff__source_create(svn_revnum_t rev } #endif /* __cplusplus */ -#endif /* SVN_DIFF_PROCESSOR_H */ +#endif /* SVN_DIFF_TREE_H */ Modified: vendor/subversion/dist/subversion/include/private/svn_mutex.h ============================================================================== --- vendor/subversion/dist/subversion/include/private/svn_mutex.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/private/svn_mutex.h Thu Feb 20 19:26:10 2014 (r262248) @@ -21,7 +21,7 @@ * @endcopyright * * @file svn_mutex.h - * @brief Strutures and functions for mutual exclusion + * @brief Structures and functions for mutual exclusion */ #ifndef SVN_MUTEX_H @@ -72,7 +72,7 @@ svn_mutex__init(svn_mutex__t **mutex, * thread to release the mutex again. Recursive locking are not supported. * * @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock - * aquisition and release. + * acquisition and release. */ svn_error_t * svn_mutex__lock(svn_mutex__t *mutex); @@ -88,19 +88,19 @@ svn_mutex__lock(svn_mutex__t *mutex); * reported in the return value. * * @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock - * aquisition and release. + * acquisition and release. */ svn_error_t * svn_mutex__unlock(svn_mutex__t *mutex, svn_error_t *err); -/** Aquires the @a mutex, executes the expression @a expr and finally +/** Acquires the @a mutex, executes the expression @a expr and finally * releases the @a mutex. If any of these steps fail, the function using * this macro will return an #svn_error_t. This macro guarantees that * the @a mutex will always be unlocked again if it got locked successfully * by the first step. * - * @note Prefer using this macro instead of explicit lock aquisition and + * @note Prefer using this macro instead of explicit lock acquisition and * release. */ #define SVN_MUTEX__WITH_LOCK(mutex, expr) \ Modified: vendor/subversion/dist/subversion/include/svn_auth.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_auth.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_auth.h Thu Feb 20 19:26:10 2014 (r262248) @@ -966,7 +966,10 @@ svn_auth_get_keychain_ssl_client_cert_pw apr_pool_t *pool); #endif /* DARWIN || DOXYGEN */ -#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN) +/* Note that the gnome keyring unlock prompt related items below must be + * declared for all platforms in order to allow SWIG interfaces to be + * used regardless of the platform. */ + /** A type of callback function for obtaining the GNOME Keyring password. * * In this callback, the client should ask the user for default keyring @@ -996,7 +999,7 @@ typedef svn_error_t *(*svn_auth_gnome_ke * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. */ #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON "gnome-keyring-unlock-prompt-baton" - +#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN) /** * Get libsvn_auth_gnome_keyring version information. * Modified: vendor/subversion/dist/subversion/include/svn_client.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_client.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_client.h Thu Feb 20 19:26:10 2014 (r262248) @@ -439,9 +439,17 @@ typedef struct svn_client_commit_info_t #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10 -/** @since New in 1.2. */ +/** One of the flags for a commit item. The node has a lock token that + * should be released after a successful commit and, if the node is also + * modified, transferred to the server as part of the commit process. + * + * @since New in 1.2. */ #define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN 0x20 -/** @since New in 1.8. */ +/** One of the flags for a commit item. The node is the 'moved here' + * side of a local move. This is used to check and enforce that the + * other side of the move is also included in the commit. + * + * @since New in 1.8. */ #define SVN_CLIENT_COMMIT_ITEM_MOVED_HERE 0x40 /** @} */ @@ -6449,7 +6457,7 @@ svn_client_open_ra_session2(svn_ra_sessi apr_pool_t *result_pool, apr_pool_t *scratch_pool); -/** Similar to svn_client_open_ra_session(), but with @ wri_abspath +/** Similar to svn_client_open_ra_session2(), but with @ wri_abspath * always passed as NULL, and with the same pool used as both @a * result_pool and @a scratch_pool. * Modified: vendor/subversion/dist/subversion/include/svn_config.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_config.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_config.h Thu Feb 20 19:26:10 2014 (r262248) @@ -98,8 +98,11 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_CATEGORY_CONFIG "config" #define SVN_CONFIG_SECTION_AUTH "auth" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" /** @since New in 1.8. */ #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt" @@ -123,7 +126,9 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock" #define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file" #define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts" +/** @since New in 1.7. */ #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" +/** @since New in 1.7. */ #define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size" #define SVN_CONFIG_SECTION_TUNNELS "tunnels" #define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props" @@ -168,10 +173,12 @@ typedef struct svn_config_t svn_config_t /* We want this to be printed on two lines in the generated config file, * but we don't want the # character to end up in the variable. */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \ "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__" #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \ "*.rej *~ #*# .#* .*.swp .DS_Store" +#endif #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \ Modified: vendor/subversion/dist/subversion/include/svn_diff.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_diff.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_diff.h Thu Feb 20 19:26:10 2014 (r262248) @@ -911,8 +911,8 @@ typedef struct svn_diff_hunk_t svn_diff_ /** * Allocate @a *stringbuf in @a result_pool, and read into it one line - * of the diff text of @a hunk. The first line returned is the hunk header. - * Any subsequent lines are unidiff data (starting with '+', '-', or ' '). + * of the diff text of @a hunk. The hunk header is not returned only the + * unidiff data lines (starting with '+', '-', or ' ') are returned. * If the @a hunk is being interpreted in reverse (i.e. the reverse * parameter of svn_diff_parse_next_patch() was @c TRUE), the diff * text will be returned in reversed form. @@ -922,6 +922,13 @@ typedef struct svn_diff_hunk_t svn_diff_ * hunk does not end with a newline character and @a eol is not NULL. * Temporary allocations will be performed in @a scratch_pool. * + * @note The hunk header information can be retrievied with the following + * functions: + * @see svn_diff_hunk_get_original_start() + * @see svn_diff_hunk_get_original_length() + * @see svn_diff_hunk_get_modified_start() + * @see svn_diff_hunk_get_modified_length() + * * @since New in 1.7. */ svn_error_t * Modified: vendor/subversion/dist/subversion/include/svn_dirent_uri.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_dirent_uri.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_dirent_uri.h Thu Feb 20 19:26:10 2014 (r262248) @@ -646,8 +646,8 @@ svn_dirent_skip_ancestor(const char *par /** Return the relative path part of @a child_relpath that is below * @a parent_relpath, or just "" if @a parent_relpath is equal to - * @a child_relpath. If @a child_relpath is not below or equal to - * @a parent_relpath, return NULL. + * @a child_relpath. If @a child_relpath is not below @a parent_relpath, + * return NULL. * * @since New in 1.7. */ @@ -657,7 +657,7 @@ svn_relpath_skip_ancestor(const char *pa /** Return the URI-decoded relative path of @a child_uri that is below * @a parent_uri, or just "" if @a parent_uri is equal to @a child_uri. If - * @a child_uri is not below or equal to @a parent_uri, return NULL. + * @a child_uri is not below @a parent_uri, return NULL. * * Allocate the result in @a result_pool. * Modified: vendor/subversion/dist/subversion/include/svn_io.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_io.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_io.h Thu Feb 20 19:26:10 2014 (r262248) @@ -182,9 +182,10 @@ svn_io_check_resolved_path(const char *p * may be @c NULL. If @a file is @c NULL, the file will be created but not * open. * - * If @a delete_when is #svn_io_file_del_on_close, then the @c APR_DELONCLOSE - * flag will be used when opening the file. The @c APR_BUFFERED flag will - * always be used. + * The file will be deleted according to @a delete_when. If that is + * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. + * + * The @c APR_BUFFERED flag will always be used when opening the file. * * The first attempt will just append @a suffix. If the result is not * a unique name, then subsequent attempts will append a dot, @@ -248,8 +249,9 @@ svn_io_open_uniquely_named(apr_file_t ** * be possible to atomically rename the resulting file due to cross-device * issues.) * - * The file will be deleted according to @a delete_when. If @a delete_when - * is @c svn_io_file_del_on_close and @a file is @c NULL, the file will be + * The file will be deleted according to @a delete_when. If that is + * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. If it + * is #svn_io_file_del_on_close and @a file is @c NULL, the file will be * deleted before this function returns. * * When passing @c svn_io_file_del_none please don't forget to eventually @@ -917,7 +919,7 @@ svn_stream_empty(apr_pool_t *pool); /** Return a stream allocated in @a pool which forwards all requests * to @a stream. Destruction is explicitly excluded from forwarding. * - * @see notes/destruction-of-stacked-resources + * @see http://subversion.apache.org/docs/community-guide/conventions.html#destruction-of-stacked-resources * * @since New in 1.4. */ @@ -972,7 +974,8 @@ svn_stream_open_writable(svn_stream_t ** * be possible to atomically rename the resulting file due to cross-device * issues.) * - * The file will be deleted according to @a delete_when. + * The file will be deleted according to @a delete_when. If that is + * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. * * Temporary allocations will be performed in @a scratch_pool. * @@ -1589,8 +1592,8 @@ svn_io_stat_dirent2(const svn_io_dirent2 apr_pool_t *scratch_pool); -/** Similar to svn_io_stat_dirent2, but always passes FALSE for - * verify_truename. +/** Similar to svn_io_stat_dirent2(), but always passes FALSE for + * @a verify_truename. * * @since New in 1.7. * @deprecated Provided for backwards compatibility with the 1.7 API. @@ -1681,7 +1684,7 @@ svn_io_dir_walk(const char *dirname, * * @note An APR bug affects Windows: passing a NULL @a env does not * guarantee the invoked program to run with an empty environment when - * @a inherits is FALSE, the program may inherit its parent's environment. + * @a inherit is FALSE, the program may inherit its parent's environment. * Explicitly pass an empty @a env to get an empty environment. * * @since New in 1.8. Modified: vendor/subversion/dist/subversion/include/svn_repos.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_repos.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_repos.h Thu Feb 20 19:26:10 2014 (r262248) @@ -298,8 +298,7 @@ typedef struct svn_repos_notify_t * the revision which just completed. */ svn_revnum_t revision; - /** For #svn_repos_notify_warning, the warning object. Must be cleared - by the consumer of the notification. */ + /** For #svn_repos_notify_warning, the warning object. */ const char *warning_str; svn_repos_notify_warning_t warning; Modified: vendor/subversion/dist/subversion/include/svn_version.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_version.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_version.h Thu Feb 20 19:26:10 2014 (r262248) @@ -72,7 +72,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 5 +#define SVN_VER_PATCH 8 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -95,7 +95,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1542147)" +#define SVN_VER_TAG " (r1568071)" /** Number tag: a string describing the version. @@ -121,7 +121,7 @@ extern "C" { * When rolling a tarball, we automatically replace it with what we * guess to be the correct revision number. */ -#define SVN_VER_REVISION 1542147 +#define SVN_VER_REVISION 1568071 /* Version strings composed from the above definitions. */ Modified: vendor/subversion/dist/subversion/include/svn_wc.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_wc.h Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/include/svn_wc.h Thu Feb 20 19:26:10 2014 (r262248) @@ -2109,9 +2109,8 @@ typedef struct svn_wc_conflict_result_t * Allocate an #svn_wc_conflict_result_t structure in @a pool, * initialize and return it. * - * Set the @c choice field of the structure to @a choice, and @c - * merged_file to @a merged_file. Set all other fields to their @c - * _unknown, @c NULL or invalid value, respectively. Make only a shallow + * Set the @c choice field of the structure to @a choice, @c merged_file + * to @a merged_file, and @c save_merged to false. Make only a shallow * copy of the pointer argument @a merged_file. * * @since New in 1.5. @@ -4078,6 +4077,9 @@ typedef void (*svn_wc_status_func_t)(voi * @a ignore_patterns is an array of file patterns matching * unversioned files to ignore for the purposes of status reporting, * or @c NULL if the default set of ignorable file patterns should be used. + * Patterns from #SVN_PROP_IGNORE (and, as of 1.8, + * #SVN_PROP_INHERITABLE_IGNORES) properties are always used, even if not + * specified in @a ignore_patterns. * * If @a cancel_func is non-NULL, call it with @a cancel_baton while walking * to determine if the client has canceled the operation. Modified: vendor/subversion/dist/subversion/libsvn_client/copy.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_client/copy.c Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/libsvn_client/copy.c Thu Feb 20 19:26:10 2014 (r262248) @@ -314,6 +314,8 @@ do_wc_to_wc_moves(svn_boolean_t *timesta { const char *src_parent_abspath; svn_boolean_t lock_src, lock_dst; + const char *src_wcroot_abspath; + const char *dst_wcroot_abspath; svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i, svn_client__copy_pair_t *); @@ -326,6 +328,13 @@ do_wc_to_wc_moves(svn_boolean_t *timesta src_parent_abspath = svn_dirent_dirname(pair->src_abspath_or_url, iterpool); + SVN_ERR(svn_wc__get_wcroot(&src_wcroot_abspath, + ctx->wc_ctx, src_parent_abspath, + iterpool, iterpool)); + SVN_ERR(svn_wc__get_wcroot(&dst_wcroot_abspath, + ctx->wc_ctx, pair->dst_parent_abspath, + iterpool, iterpool)); + /* We now need to lock the right combination of batons. Four cases: 1) src_parent == dst_parent @@ -334,15 +343,18 @@ do_wc_to_wc_moves(svn_boolean_t *timesta 4) src_parent and dst_parent are disjoint We can handle 1) as either 2) or 3) */ if (strcmp(src_parent_abspath, pair->dst_parent_abspath) == 0 - || svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath, - iterpool)) + || (svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath, + NULL) + && !svn_dirent_is_child(src_parent_abspath, dst_wcroot_abspath, + NULL))) { lock_src = TRUE; lock_dst = FALSE; } else if (svn_dirent_is_child(pair->dst_parent_abspath, - src_parent_abspath, - iterpool)) + src_parent_abspath, NULL) + && !svn_dirent_is_child(pair->dst_parent_abspath, + src_wcroot_abspath, NULL)) { lock_src = FALSE; lock_dst = TRUE; Modified: vendor/subversion/dist/subversion/libsvn_client/log.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_client/log.c Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/libsvn_client/log.c Thu Feb 20 19:26:10 2014 (r262248) @@ -861,17 +861,19 @@ svn_client_log5(const apr_array_header_t actual_loc->url, pool)); /* Save us an RA layer round trip if we are on the repository root and - know the result in advance. All the revision data has already been - validated. + know the result in advance, or if we don't need multiple ranges. + All the revision data has already been validated. */ - if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0) + if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0 + || opt_rev_ranges->nelts <= 1) { svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment)); log_segments = apr_array_make(pool, 1, sizeof(segment)); segment->range_start = oldest_rev; segment->range_end = actual_loc->rev; - segment->path = ""; + segment->path = svn_uri_skip_ancestor(actual_loc->repos_root_url, + actual_loc->url, pool); APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment; } else Modified: vendor/subversion/dist/subversion/libsvn_client/prop_commands.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_client/prop_commands.c Thu Feb 20 17:23:08 2014 (r262247) +++ vendor/subversion/dist/subversion/libsvn_client/prop_commands.c Thu Feb 20 19:26:10 2014 (r262248) @@ -1201,6 +1201,7 @@ struct recursive_proplist_receiver_baton svn_wc_context_t *wc_ctx; /* Working copy context. */ svn_proplist_receiver2_t wrapped_receiver; /* Proplist receiver to call. */ void *wrapped_receiver_baton; /* Baton for the proplist receiver. */ + apr_array_header_t *iprops; /* Anchor, anchor_abspath pair for converting to relative paths */ const char *anchor; @@ -1216,6 +1217,27 @@ recursive_proplist_receiver(void *baton, { struct recursive_proplist_receiver_baton *b = baton; const char *path; + apr_array_header_t *iprops = NULL; + + if (b->iprops + && ! strcmp(local_abspath, b->anchor_abspath)) + { + /* Report iprops with the properties for the anchor */ + iprops = b->iprops; + b->iprops = NULL; + } + else if (b->iprops) + { + /* No report for the root? + Report iprops anyway */ + + SVN_ERR(b->wrapped_receiver(b->wrapped_receiver_baton, + b->anchor ? b->anchor : local_abspath, + NULL /* prop_hash */, + b->iprops, + scratch_pool)); + b->iprops = NULL; + } /* Attempt to convert absolute paths to relative paths for * presentation purposes, if needed. */ @@ -1230,7 +1252,7 @@ recursive_proplist_receiver(void *baton, path = local_abspath; return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton, - path, props, NULL, + path, props, iprops, scratch_pool)); } @@ -1370,6 +1392,7 @@ get_local_props(const char *path_or_url, svn_node_kind_t kind; apr_hash_t *changelist_hash = NULL; const char *local_abspath; + apr_array_header_t *iprops = NULL; SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url, scratch_pool)); @@ -1392,7 +1415,6 @@ get_local_props(const char *path_or_url, if (get_target_inherited_props) { - apr_array_header_t *iprops; const char *repos_root_url; SVN_ERR(svn_wc__get_iprops(&iprops, ctx->wc_ctx, local_abspath, @@ -1402,8 +1424,6 @@ get_local_props(const char *path_or_url, SVN_ERR(svn_client__iprop_relpaths_to_urls(iprops, repos_root_url, scratch_pool, scratch_pool)); - SVN_ERR(call_receiver(path_or_url, NULL, iprops, receiver, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 19:26:49 2014 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 ESMTPS id 457181C3; Thu, 20 Feb 2014 19:26:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15B1B15DE; Thu, 20 Feb 2014 19:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KJQmph013401; Thu, 20 Feb 2014 19:26:48 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KJQmCs013400; Thu, 20 Feb 2014 19:26:48 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402201926.s1KJQmCs013400@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 19:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262249 - vendor/subversion/subversion-1.8.8 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 19:26:49 -0000 Author: peter Date: Thu Feb 20 19:26:48 2014 New Revision: 262249 URL: http://svnweb.freebsd.org/changeset/base/262249 Log: Tag subversion-1.8.8 Added: vendor/subversion/subversion-1.8.8/ - copied from r262248, vendor/subversion/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 19:48:52 2014 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 ESMTPS id 350F49A5; Thu, 20 Feb 2014 19:48:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19E6717B5; Thu, 20 Feb 2014 19:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KJmqbO021401; Thu, 20 Feb 2014 19:48:52 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KJmlBc021368; Thu, 20 Feb 2014 19:48:47 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402201948.s1KJmlBc021368@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 19:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262250 - in head: contrib/subversion contrib/subversion/subversion/include contrib/subversion/subversion/include/private contrib/subversion/subversion/libsvn_client contrib/subversion/... 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 19:48:52 -0000 Author: peter Date: Thu Feb 20 19:48:47 2014 New Revision: 262250 URL: http://svnweb.freebsd.org/changeset/base/262250 Log: Import svn-1.8.8. Highlights: * Security fix for apache server plugin that we don't build or use * sqlite performance improvements. * bug fixes for edge cases and some other less common operations. Modified: head/contrib/subversion/CHANGES head/contrib/subversion/Makefile.in head/contrib/subversion/NOTICE head/contrib/subversion/build-outputs.mk head/contrib/subversion/build.conf head/contrib/subversion/configure head/contrib/subversion/configure.ac head/contrib/subversion/subversion/include/private/svn_auth_private.h head/contrib/subversion/subversion/include/private/svn_diff_tree.h head/contrib/subversion/subversion/include/private/svn_mutex.h head/contrib/subversion/subversion/include/svn_auth.h head/contrib/subversion/subversion/include/svn_client.h head/contrib/subversion/subversion/include/svn_config.h head/contrib/subversion/subversion/include/svn_diff.h head/contrib/subversion/subversion/include/svn_dirent_uri.h head/contrib/subversion/subversion/include/svn_io.h head/contrib/subversion/subversion/include/svn_repos.h head/contrib/subversion/subversion/include/svn_version.h head/contrib/subversion/subversion/include/svn_wc.h head/contrib/subversion/subversion/libsvn_client/copy.c head/contrib/subversion/subversion/libsvn_client/log.c head/contrib/subversion/subversion/libsvn_client/prop_commands.c head/contrib/subversion/subversion/libsvn_client/update.c head/contrib/subversion/subversion/libsvn_client/util.c head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c head/contrib/subversion/subversion/libsvn_ra_serf/commit.c head/contrib/subversion/subversion/libsvn_ra_serf/util.c head/contrib/subversion/subversion/libsvn_repos/commit.c head/contrib/subversion/subversion/libsvn_repos/reporter.c head/contrib/subversion/subversion/libsvn_subr/auth.c head/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c head/contrib/subversion/subversion/libsvn_subr/cmdline.c head/contrib/subversion/subversion/libsvn_subr/internal_statements.h head/contrib/subversion/subversion/libsvn_subr/io.c head/contrib/subversion/subversion/libsvn_subr/sqlite.c head/contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c head/contrib/subversion/subversion/libsvn_subr/subst.c head/contrib/subversion/subversion/libsvn_subr/sysinfo.c head/contrib/subversion/subversion/libsvn_subr/win32_crypto.c head/contrib/subversion/subversion/libsvn_wc/conflicts.h head/contrib/subversion/subversion/libsvn_wc/diff_local.c head/contrib/subversion/subversion/libsvn_wc/upgrade.c head/contrib/subversion/subversion/libsvn_wc/wc-checks.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql head/contrib/subversion/subversion/libsvn_wc/wc-queries.h head/contrib/subversion/subversion/libsvn_wc/wc-queries.sql head/contrib/subversion/subversion/libsvn_wc/wc.h head/contrib/subversion/subversion/libsvn_wc/wc_db.c head/contrib/subversion/subversion/libsvn_wc/wc_db.h head/contrib/subversion/subversion/libsvn_wc/wc_db_util.c head/contrib/subversion/subversion/svn/conflict-callbacks.c head/contrib/subversion/subversion/svn/status-cmd.c head/contrib/subversion/subversion/svn/svn.c head/contrib/subversion/subversion/svnserve/svnserve.c head/usr.bin/svn/svn_private_config.h Directory Properties: head/contrib/subversion/ (props changed) Modified: head/contrib/subversion/CHANGES ============================================================================== --- head/contrib/subversion/CHANGES Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/CHANGES Thu Feb 20 19:48:47 2014 (r262250) @@ -1,3 +1,70 @@ +Version 1.8.8 +(19 Feb 2014, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.8 + + User-visible changes: + - Client-side bugfixes: + * use CryptoAPI to validate intermediary certificates on Windows (r1564623) + * fix automatic relocate for wcs not at repository root (r1541638 et al) + * diff: fix when target is a drive root on Windows (r1541635) + * wc: improve performance when used with SQLite 3.8 (r1542765) + * copy: fix some scenarios that broke the working copy (r1560690) + * move: fix errors when moving files between an external and the parent + working copy (r1551524, r1551579) + * log: resolve performance regression in certain scenarios (r1553101 et al) + * merge: decrease work to detect differences between 3 files (r1548486) + * checkout: don't require flush support for symlinks on Windows (r1547774) + * commit: don't change file permissions inappropriately (issue #4440) + * commit: fix assertion due to invalid pool lifetime (r1553376 et al) + * version: don't cut off the distribution version on Linux (r1544878 et al) + * flush stdout before exiting to avoid information being lost (r1499470) + * status: fix missing sentinel value on warning codes (r1543145) + * update/switch: improve some WC db queries that may return incorrect + results depending on how SQLite is built (r1567109) + + - Server-side bugfixes: + * reduce memory usage during checkout and export (r1564215) + * fsfs: create rep-cache.db with proper permissions (issue #3437) + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * mod_dav_svn: fix SVNAllowBulkUpdates directive merging (r1548105) + * mod_dav_svn: include requested property changes in reports (r1557522) + * svnserve: correct default cache size in help text (r1563110) + * svnadmin dump: reduce size of dump files with '--deltas' (r1554978) + * resolve integer underflow that resulted in infinite loops (r1567985) + + Developer-visible changes: + - General: + * fix ocassional failure of check_tests.py 12 (r1496127 et al) + * fix failure with SQLite 3.8.1-3.8.3 when built with + SQLITE_ENABLE_STAT3/4 due to bug in SQLite (r1567286, r1567392) + * specify SQLite defaults that can be changed when SQLite is built + to avoid unexpected behavior with Subversion (r1567064) + + - API changes: + * numerous documentation fixes + * svn_client_commit_item3_dup() fix pool lifetime issues (r1550803) + * ra_serf: properly ask multiple certificate validation providers for + acceptance of certificate failures (r1535532) + * release internal fs objects when closing commit editor (r1555499) + * svn_client_proplist4() don't call the callback multiple times for + the same path in order to deliver inherited properties (r1549858 et al) + + - Bindings: + * javahl: make test suite run without installing on OS X (r1535115) + * swig: fix building out of tarball on OS X (r1555654) + * swig-pl: fix with --enable-sqlite-compatibility-version (r1559009) + * swig: fix building bindings on OS X when APR has the -no-cpp-precomp + flag in the apr-config --cppflags output. (r1535610) + * swig: fix building from tarball with an out-of-tree build (r1543187) + + +Version 1.8.7 +(Not released, see changes for 1.8.8.) + +Version 1.8.6 +(Not released, see changes for 1.8.8.) + + Version 1.8.5 (25 November 2013, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.5 @@ -19,7 +86,7 @@ http://svn.apache.org/repos/asf/subversi Developer-visible changes: - General: * fix compilation with '--enable-optimize' with clang (r1534860) - * fix copmpilation with debug build of BDB on Windows (r1501656, r1501702) + * fix compilation with debug build of BDB on Windows (r1501656, r1501702) * fix '--with-openssl' option when building on Windows (r1535139) * add test to fail when built against broken ZLib (r1537193 et al) @@ -305,7 +372,7 @@ http://svn.apache.org/repos/asf/subversi * decreased default http timeout for ra_serf (issue #3968) * prevent ra_serf from corrupting the working copy (issue #3993) * ra_serf transmits property changes inline to reduce requests (r1378927) - * allow client to avoid SSL certificate prompts (issue #2410) + * by default avoid SSL certificate prompts in client (issue #2410) * improve interactive resolution of property conflicts (r1387678 et al) * make ra_serf raise an error upon delta-base mismatch (issue #4235) * tune ra_svn transmit buffer handling (r1391788) @@ -515,7 +582,7 @@ http://svn.apache.org/repos/asf/subversi * configure now script auto-detects GNOME keyring (r1387230) * allow configure to detect BDB on Debian-based Linux distros (r1390633) * auto-detect serf via pkg-config (r1391662) - * improve queries for compatability with SQLite 3.7.16 (r1455239) + * improve queries for compatibility with SQLite 3.7.16 (r1455239) * remove support for in-tree apr, apr-util and apr-memcache (r1456924) * FSFS caching supports prefixes now (r1462436) * maintainer mode now prints symbolic error codes (r1465157) @@ -553,6 +620,25 @@ http://svn.apache.org/repos/asf/subversi * fix some reference counting bugs in swig-py bindings (r1464899, r1466524) +Version 1.7.15 +(12 Feb 2014, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.15 + + User-visible changes: + - Client-side bugfixes: + * copy: fix some scenarios that broke the working copy (r1560690) + * diff: fix regressions due to fixes in 1.7.14 (issue #4460) + + - Server-side bugfixes: + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * reduce memory usage during checkout and export (r1564215) + + Developer-visible changes: + - General: + * fix failure in checkout_tests.py + * support compiling against Cyrus sasl 2.1.25 (r1404912, r1413402) + + Version 1.7.14 (25 Nov 2013, from /branches/1.7.x) http://svn.apache.org/repos/asf/subversion/tags/1.7.14 @@ -1326,7 +1412,7 @@ http://svn.apache.org/repos/asf/subversi http://subversion.apache.org/security/CVE-2011-1752-advisory.txt * fixed: write-through proxy could direcly commit to slave (r917523) * detect a particular corruption condition in FSFS (r1100213) - * improve error message when clients refer to unkown revisions (r939000) + * improve error message when clients refer to unknown revisions (r939000) * bugfixes and optimizations to the DAV mirroring code (r878607) * fixed: locked and deleted file causes tree conflict (issue #3525) * fixed: update touches locked file with svn:keywords property (issue #3471) @@ -1696,7 +1782,7 @@ http://svn.apache.org/repos/asf/subversi * improve performance of 'svn update' on large files (r36389, et. al.) * fixed: error leak and potential crash (r36860) * fixed: parent directory handling on Windows (r36049, -50, -51, -131) - * fixed: unintialized memory errors (r36252, -3) + * fixed: uninitialized memory errors (r36252, -3) * fixed: potential working copy corruption (r36714) * fixed: working copy upgrade error (r36302) * fixed: pointer dereference error (r36783) Modified: head/contrib/subversion/Makefile.in ============================================================================== --- head/contrib/subversion/Makefile.in Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/Makefile.in Thu Feb 20 19:48:47 2014 (r262250) @@ -177,6 +177,7 @@ CXXMAINTAINERFLAGS = @CXXMAINTAINERFLAGS CPPFLAGS = @CPPFLAGS@ $(EXTRA_CPPFLAGS) LDFLAGS = @LDFLAGS@ $(EXTRA_LDFLAGS) SWIG_LDFLAGS = @SWIG_LDFLAGS@ $(EXTRA_SWIG_LDFLAGS) +SWIG_CPPFLAGS = @SWIG_CPPFLAGS@ $(EXTRA_CPPFLAGS) COMPILE = $(CC) $(CMODEFLAGS) $(CPPFLAGS) $(CMAINTAINERFLAGS) $(CFLAGS) $(INCLUDES) COMPILE_CXX = $(CXX) $(CXXMODEFLAGS) $(CPPFLAGS) $(CXXMAINTAINERFLAGS) $(CXXFLAGS) $(INCLUDES) @@ -199,6 +200,19 @@ COMPILE_JAVAHL_CXX = $(LIBTOOL) $(LTCXXF COMPILE_JAVAHL_JAVAC = $(JAVAC) $(JAVAC_FLAGS) COMPILE_JAVAHL_JAVAH = $(JAVAH) +# export an env variable so that the tests can run without being installed +TEST_SHLIB_VAR_JAVAHL=\ + if [ "@SVN_APR_SHLIB_PATH_VAR@" = "DYLD_LIBRARY_PATH" ]; then \ + for d in $(abs_builddir)/subversion/libsvn_*; do \ + if [ -n "$$DYLD_LIBRARY_PATH" ]; then \ + @SVN_APR_SHLIB_PATH_VAR@="$$@SVN_APR_SHLIB_PATH_VAR@:$$d/.libs"; \ + else \ + @SVN_APR_SHLIB_PATH_VAR@="$$d/.libs"; \ + fi; \ + done; \ + export @SVN_APR_SHLIB_PATH_VAR@; \ + fi; + # special compilation for files destined for cxxhl COMPILE_CXXHL_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=compile $(COMPILE_CXX) $(LT_CFLAGS) $(CXXHL_INCLUDES) -o $@ -c @@ -465,11 +479,13 @@ clean-javahl: check-tigris-javahl: javahl-compat @FIX_JAVAHL_LIB@ - $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" -Djava.library.path=@JAVAHL_OBJDIR@:$(libdir) -classpath $(javahl_compat_tests_PATH):$(javahl_tests_CLASSPATH) "-Dtest.tests=$(JAVAHL_TESTS)" org.tigris.subversion.javahl.RunTests + $(TEST_SHLIB_VAR_JAVAHL) \ + $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" "-Djava.library.path=@JAVAHL_OBJDIR@:$(libdir)" -classpath "$(javahl_compat_tests_PATH):$(javahl_tests_CLASSPATH)" "-Dtest.tests=$(JAVAHL_TESTS)" org.tigris.subversion.javahl.RunTests check-apache-javahl: javahl @FIX_JAVAHL_LIB@ - $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" -Djava.library.path=@JAVAHL_OBJDIR@:$(libdir) -classpath $(javahl_tests_PATH):$(javahl_tests_CLASSPATH) "-Dtest.tests=$(JAVAHL_TESTS)" org.apache.subversion.javahl.RunTests + $(TEST_SHLIB_VAR_JAVAHL) \ + $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" "-Djava.library.path=@JAVAHL_OBJDIR@:$(libdir)" -classpath "$(javahl_tests_PATH):$(javahl_tests_CLASSPATH)" "-Dtest.tests=$(JAVAHL_TESTS)" org.apache.subversion.javahl.RunTests check-javahl: check-apache-javahl Modified: head/contrib/subversion/NOTICE ============================================================================== --- head/contrib/subversion/NOTICE Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/NOTICE Thu Feb 20 19:48:47 2014 (r262250) @@ -1,5 +1,5 @@ -Subversion -Copyright 2010 The Apache Software Foundation +Apache Subversion +Copyright 2013 The Apache Software Foundation This product includes software developed by many people, and distributed under Contributor License Agreements to The Apache Software Foundation Modified: head/contrib/subversion/build-outputs.mk ============================================================================== --- head/contrib/subversion/build-outputs.mk Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/build-outputs.mk Thu Feb 20 19:48:47 2014 (r262250) @@ -1870,82 +1870,82 @@ subversion/bindings/swig/perl/libsvn_swi $(COMPILE_SWIG_PL) $(canonicalized_srcdir)subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c subversion/bindings/swig/perl/native/core.lo: subversion/bindings/swig/perl/native/core.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/core.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/core.c subversion/bindings/swig/perl/native/svn_client.lo: subversion/bindings/swig/perl/native/svn_client.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_client.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_client.c subversion/bindings/swig/perl/native/svn_delta.lo: subversion/bindings/swig/perl/native/svn_delta.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_delta.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_delta.c subversion/bindings/swig/perl/native/svn_diff.lo: subversion/bindings/swig/perl/native/svn_diff.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_diff.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_diff.c subversion/bindings/swig/perl/native/svn_fs.lo: subversion/bindings/swig/perl/native/svn_fs.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_fs.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_fs.c subversion/bindings/swig/perl/native/svn_ra.lo: subversion/bindings/swig/perl/native/svn_ra.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_ra.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_ra.c subversion/bindings/swig/perl/native/svn_repos.lo: subversion/bindings/swig/perl/native/svn_repos.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_repos.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_repos.c subversion/bindings/swig/perl/native/svn_wc.lo: subversion/bindings/swig/perl/native/svn_wc.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PL_WRAPPER) subversion/bindings/swig/perl/native/svn_wc.c + $(COMPILE_PL_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/perl/native/svn_wc.c subversion/bindings/swig/python/core.lo: subversion/bindings/swig/python/core.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/core.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/core.c subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.lo: subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c subversion/bindings/swig/proxy/swig_python_external_runtime.swg subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/svn_private_config.h $(COMPILE_SWIG_PY) $(canonicalized_srcdir)subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c subversion/bindings/swig/python/svn_client.lo: subversion/bindings/swig/python/svn_client.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_client.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_client.c subversion/bindings/swig/python/svn_delta.lo: subversion/bindings/swig/python/svn_delta.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_delta.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_delta.c subversion/bindings/swig/python/svn_diff.lo: subversion/bindings/swig/python/svn_diff.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_diff.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_diff.c subversion/bindings/swig/python/svn_fs.lo: subversion/bindings/swig/python/svn_fs.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_fs.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_fs.c subversion/bindings/swig/python/svn_ra.lo: subversion/bindings/swig/python/svn_ra.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_ra.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_ra.c subversion/bindings/swig/python/svn_repos.lo: subversion/bindings/swig/python/svn_repos.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_repos.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_repos.c subversion/bindings/swig/python/svn_wc.lo: subversion/bindings/swig/python/svn_wc.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_PY_WRAPPER) subversion/bindings/swig/python/svn_wc.c + $(COMPILE_PY_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/python/svn_wc.c subversion/bindings/swig/ruby/core.lo: subversion/bindings/swig/ruby/core.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/core.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/core.c subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.lo: subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c subversion/bindings/swig/proxy/swig_ruby_external_runtime.swg subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_nls.h subversion/include/svn_opt.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_wc.h subv ersion/svn_private_config.h $(COMPILE_SWIG_RB) $(canonicalized_srcdir)subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c subversion/bindings/swig/ruby/svn_client.lo: subversion/bindings/swig/ruby/svn_client.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_client.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_client.c subversion/bindings/swig/ruby/svn_delta.lo: subversion/bindings/swig/ruby/svn_delta.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_delta.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_delta.c subversion/bindings/swig/ruby/svn_diff.lo: subversion/bindings/swig/ruby/svn_diff.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_delta.h subversion/include/svn_fs.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_diff.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_diff.c subversion/bindings/swig/ruby/svn_fs.lo: subversion/bindings/swig/ruby/svn_fs.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_fs.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_fs.c subversion/bindings/swig/ruby/svn_ra.lo: subversion/bindings/swig/ruby/svn_ra.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_ra.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_ra.c subversion/bindings/swig/ruby/svn_repos.lo: subversion/bindings/swig/ruby/svn_repos.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_ra.h subversion/include/svn_wc.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_repos.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_repos.c subversion/bindings/swig/ruby/svn_wc.lo: subversion/bindings/swig/ruby/svn_wc.c subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h subversion/include/svn_client.h subversion/include/svn_fs.h subversion/include/svn_repos.h subversion/svn_private_config.h - $(COMPILE_RB_WRAPPER) subversion/bindings/swig/ruby/svn_wc.c + $(COMPILE_RB_WRAPPER) $(canonicalized_srcdir)subversion/bindings/swig/ruby/svn_wc.c subversion/libsvn_auth_gnome_keyring/gnome_keyring.lo: subversion/libsvn_auth_gnome_keyring/gnome_keyring.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/svn_private_config.h @@ -2231,7 +2231,7 @@ subversion/libsvn_ra_serf/serf.lo: subve subversion/libsvn_ra_serf/update.lo: subversion/libsvn_ra_serf/update.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion /include/svn_version.h subversion/include/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h subversion/svn_private_config.h -subversion/libsvn_ra_serf/util.lo: subversion/libsvn_ra_serf/util.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/include/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h subversion/svn_private_config.h +subversion/libsvn_ra_serf/util.lo: subversion/libsvn_ra_serf/util.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_ra_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/incl ude/svn_xml.h subversion/libsvn_ra/ra_loader.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h subversion/svn_private_config.h subversion/libsvn_ra_serf/util_error.lo: subversion/libsvn_ra_serf/util_error.c subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_error_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/include/svn_version.h subversion/libsvn_ra_serf/blncache.h subversion/libsvn_ra_serf/ra_serf.h @@ -2291,7 +2291,7 @@ subversion/libsvn_subr/adler32.lo: subve subversion/libsvn_subr/atomic.lo: subversion/libsvn_subr/atomic.c subversion/include/private/svn_atomic.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_types.h -subversion/libsvn_subr/auth.lo: subversion/libsvn_subr/auth.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_subr/auth.h subversion/svn_private_config.h +subversion/libsvn_subr/auth.lo: subversion/libsvn_subr/auth.c subversion/include/private/svn_auth_private.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_subr_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_dso.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_subr/auth.h subversion/svn_private_config.h subversion/libsvn_subr/base64.lo: subversion/libsvn_subr/base64.c subversion/include/private/svn_debug.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h Modified: head/contrib/subversion/build.conf ============================================================================== --- head/contrib/subversion/build.conf Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/build.conf Thu Feb 20 19:48:47 2014 (r262250) @@ -71,9 +71,9 @@ test-scripts = bdb-test-scripts = -swig-python-opts = $(CPPFLAGS) -python -classic -swig-perl-opts = $(CPPFLAGS) -perl -nopm -noproxy -swig-ruby-opts = $(CPPFLAGS) -ruby +swig-python-opts = $(SWIG_CPPFLAGS) -python -classic +swig-perl-opts = $(SWIG_CPPFLAGS) -perl -nopm -noproxy +swig-ruby-opts = $(SWIG_CPPFLAGS) -ruby swig-languages = python perl ruby swig-dirs = subversion/bindings/swig/python Modified: head/contrib/subversion/configure ============================================================================== --- head/contrib/subversion/configure Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/configure Thu Feb 20 19:48:47 2014 (r262250) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.8.5. +# Generated by GNU Autoconf 2.69 for subversion 1.8.8. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.8.5' -PACKAGE_STRING='subversion 1.8.5' +PACKAGE_VERSION='1.8.8' +PACKAGE_STRING='subversion 1.8.8' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -635,6 +635,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS SVN_CONFIG_SCRIPT_FILES INCLUDE_OUTPUTS +SWIG_CPPFLAGS JAVAHL_COMPAT_TESTS_TARGET JAVAHL_TESTS_TARGET JAVA_CLASSPATH @@ -1456,7 +1457,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.8.5 to adapt to many kinds of systems. +\`configure' configures subversion 1.8.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1522,7 +1523,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.8.5:";; + short | recursive ) echo "Configuration of subversion 1.8.8:";; esac cat <<\_ACEOF @@ -1736,7 +1737,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.8.5 +subversion configure 1.8.8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2280,7 +2281,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.8.5, which was +It was created by subversion $as_me 1.8.8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2660,8 +2661,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.5" >&5 -$as_echo "$as_me: Configuring Subversion 1.8.5" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.8" >&5 +$as_echo "$as_me: Configuring Subversion 1.8.8" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -25073,6 +25074,13 @@ if test "$CC" = "clang"; then fi +# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. +SWIG_CPPFLAGS="$CPPFLAGS" + + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + + + cat >>confdefs.h <<_ACEOF #define SVN_PATH_LOCAL_SEPARATOR '/' @@ -25662,7 +25670,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.8.5, which was +This file was extended by subversion $as_me 1.8.8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -25728,7 +25736,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.8.5 +subversion config.status 1.8.8 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/subversion/configure.ac ============================================================================== --- head/contrib/subversion/configure.ac Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/configure.ac Thu Feb 20 19:48:47 2014 (r262250) @@ -1443,6 +1443,11 @@ if test "$CC" = "clang"; then SVN_STRIP_FLAG(CPPFLAGS, [-no-cpp-precomp ]) fi +# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. +SWIG_CPPFLAGS="$CPPFLAGS" +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +AC_SUBST([SWIG_CPPFLAGS]) + dnl Since this is used only on Unix-y systems, define the path separator as '/' AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/', [Defined to be the path separator used on your local filesystem]) Modified: head/contrib/subversion/subversion/include/private/svn_auth_private.h ============================================================================== --- head/contrib/subversion/subversion/include/private/svn_auth_private.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/private/svn_auth_private.h Thu Feb 20 19:48:47 2014 (r262250) @@ -37,6 +37,24 @@ extern "C" { #endif /* __cplusplus */ +/** SSL server authority verification credential type. + * + * The followin auth parameters are available to the providers: + * + * - @c SVN_AUTH_PARAM_SSL_SERVER_FAILURES (@c apr_uint32_t*) + * - @c SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO + * (@c svn_auth_ssl_server_cert_info_t*) + * + * The following optional auth parameters are relevant to the providers: + * + * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*) + * + * @since New in 1.9. + */ +#define SVN_AUTH_CRED_SSL_SERVER_AUTHORITY "svn.ssl.server.authority" + + + /* If you add a password type for a provider which stores * passwords on disk in encrypted form, remember to update * svn_auth__simple_save_creds_helper. Otherwise it will be @@ -213,6 +231,25 @@ svn_auth__ssl_client_cert_pw_set(svn_boo svn_boolean_t non_interactive, apr_pool_t *pool); +#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN) +/** + * Set @a *provider to an authentication provider that implements + * ssl authority verification via the Windows CryptoApi. + * + * This provider automatically validates authority certificates with + * the CryptoApi, like Internet Explorer and the Windows network API do. + * This allows the rollout of root certificates via Windows Domain + * policies, instead of Subversion specific configuration. + * + * @note This function is only available on Windows. + */ +void +svn_auth__get_windows_ssl_server_authority_provider( + svn_auth_provider_object_t **provider, + apr_pool_t *pool); +#endif + + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: head/contrib/subversion/subversion/include/private/svn_diff_tree.h ============================================================================== --- head/contrib/subversion/subversion/include/private/svn_diff_tree.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/private/svn_diff_tree.h Thu Feb 20 19:48:47 2014 (r262250) @@ -20,13 +20,13 @@ * ==================================================================== * @endcopyright * - * @file svn_wc.h + * @file svn_diff_tree.h * @brief Generic diff handler. Replacing the old svn_wc_diff_callbacks4_t * infrastructure */ -#ifndef SVN_DIFF_PROCESSOR_H -#define SVN_DIFF_PROCESSOR_H +#ifndef SVN_DIFF_TREE_H +#define SVN_DIFF_TREE_H #include "svn_types.h" @@ -353,5 +353,5 @@ svn_diff__source_create(svn_revnum_t rev } #endif /* __cplusplus */ -#endif /* SVN_DIFF_PROCESSOR_H */ +#endif /* SVN_DIFF_TREE_H */ Modified: head/contrib/subversion/subversion/include/private/svn_mutex.h ============================================================================== --- head/contrib/subversion/subversion/include/private/svn_mutex.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/private/svn_mutex.h Thu Feb 20 19:48:47 2014 (r262250) @@ -21,7 +21,7 @@ * @endcopyright * * @file svn_mutex.h - * @brief Strutures and functions for mutual exclusion + * @brief Structures and functions for mutual exclusion */ #ifndef SVN_MUTEX_H @@ -72,7 +72,7 @@ svn_mutex__init(svn_mutex__t **mutex, * thread to release the mutex again. Recursive locking are not supported. * * @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock - * aquisition and release. + * acquisition and release. */ svn_error_t * svn_mutex__lock(svn_mutex__t *mutex); @@ -88,19 +88,19 @@ svn_mutex__lock(svn_mutex__t *mutex); * reported in the return value. * * @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock - * aquisition and release. + * acquisition and release. */ svn_error_t * svn_mutex__unlock(svn_mutex__t *mutex, svn_error_t *err); -/** Aquires the @a mutex, executes the expression @a expr and finally +/** Acquires the @a mutex, executes the expression @a expr and finally * releases the @a mutex. If any of these steps fail, the function using * this macro will return an #svn_error_t. This macro guarantees that * the @a mutex will always be unlocked again if it got locked successfully * by the first step. * - * @note Prefer using this macro instead of explicit lock aquisition and + * @note Prefer using this macro instead of explicit lock acquisition and * release. */ #define SVN_MUTEX__WITH_LOCK(mutex, expr) \ Modified: head/contrib/subversion/subversion/include/svn_auth.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_auth.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_auth.h Thu Feb 20 19:48:47 2014 (r262250) @@ -966,7 +966,10 @@ svn_auth_get_keychain_ssl_client_cert_pw apr_pool_t *pool); #endif /* DARWIN || DOXYGEN */ -#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN) +/* Note that the gnome keyring unlock prompt related items below must be + * declared for all platforms in order to allow SWIG interfaces to be + * used regardless of the platform. */ + /** A type of callback function for obtaining the GNOME Keyring password. * * In this callback, the client should ask the user for default keyring @@ -996,7 +999,7 @@ typedef svn_error_t *(*svn_auth_gnome_ke * @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. */ #define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON "gnome-keyring-unlock-prompt-baton" - +#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN) /** * Get libsvn_auth_gnome_keyring version information. * Modified: head/contrib/subversion/subversion/include/svn_client.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_client.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_client.h Thu Feb 20 19:48:47 2014 (r262250) @@ -439,9 +439,17 @@ typedef struct svn_client_commit_info_t #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10 -/** @since New in 1.2. */ +/** One of the flags for a commit item. The node has a lock token that + * should be released after a successful commit and, if the node is also + * modified, transferred to the server as part of the commit process. + * + * @since New in 1.2. */ #define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN 0x20 -/** @since New in 1.8. */ +/** One of the flags for a commit item. The node is the 'moved here' + * side of a local move. This is used to check and enforce that the + * other side of the move is also included in the commit. + * + * @since New in 1.8. */ #define SVN_CLIENT_COMMIT_ITEM_MOVED_HERE 0x40 /** @} */ @@ -6449,7 +6457,7 @@ svn_client_open_ra_session2(svn_ra_sessi apr_pool_t *result_pool, apr_pool_t *scratch_pool); -/** Similar to svn_client_open_ra_session(), but with @ wri_abspath +/** Similar to svn_client_open_ra_session2(), but with @ wri_abspath * always passed as NULL, and with the same pool used as both @a * result_pool and @a scratch_pool. * Modified: head/contrib/subversion/subversion/include/svn_config.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_config.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_config.h Thu Feb 20 19:48:47 2014 (r262250) @@ -98,8 +98,11 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_CATEGORY_CONFIG "config" #define SVN_CONFIG_SECTION_AUTH "auth" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" /** @since New in 1.8. */ #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt" @@ -123,7 +126,9 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock" #define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file" #define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts" +/** @since New in 1.7. */ #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" +/** @since New in 1.7. */ #define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size" #define SVN_CONFIG_SECTION_TUNNELS "tunnels" #define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props" @@ -168,10 +173,12 @@ typedef struct svn_config_t svn_config_t /* We want this to be printed on two lines in the generated config file, * but we don't want the # character to end up in the variable. */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \ "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__" #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \ "*.rej *~ #*# .#* .*.swp .DS_Store" +#endif #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \ Modified: head/contrib/subversion/subversion/include/svn_diff.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_diff.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_diff.h Thu Feb 20 19:48:47 2014 (r262250) @@ -911,8 +911,8 @@ typedef struct svn_diff_hunk_t svn_diff_ /** * Allocate @a *stringbuf in @a result_pool, and read into it one line - * of the diff text of @a hunk. The first line returned is the hunk header. - * Any subsequent lines are unidiff data (starting with '+', '-', or ' '). + * of the diff text of @a hunk. The hunk header is not returned only the + * unidiff data lines (starting with '+', '-', or ' ') are returned. * If the @a hunk is being interpreted in reverse (i.e. the reverse * parameter of svn_diff_parse_next_patch() was @c TRUE), the diff * text will be returned in reversed form. @@ -922,6 +922,13 @@ typedef struct svn_diff_hunk_t svn_diff_ * hunk does not end with a newline character and @a eol is not NULL. * Temporary allocations will be performed in @a scratch_pool. * + * @note The hunk header information can be retrievied with the following + * functions: + * @see svn_diff_hunk_get_original_start() + * @see svn_diff_hunk_get_original_length() + * @see svn_diff_hunk_get_modified_start() + * @see svn_diff_hunk_get_modified_length() + * * @since New in 1.7. */ svn_error_t * Modified: head/contrib/subversion/subversion/include/svn_dirent_uri.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_dirent_uri.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_dirent_uri.h Thu Feb 20 19:48:47 2014 (r262250) @@ -646,8 +646,8 @@ svn_dirent_skip_ancestor(const char *par /** Return the relative path part of @a child_relpath that is below * @a parent_relpath, or just "" if @a parent_relpath is equal to - * @a child_relpath. If @a child_relpath is not below or equal to - * @a parent_relpath, return NULL. + * @a child_relpath. If @a child_relpath is not below @a parent_relpath, + * return NULL. * * @since New in 1.7. */ @@ -657,7 +657,7 @@ svn_relpath_skip_ancestor(const char *pa /** Return the URI-decoded relative path of @a child_uri that is below * @a parent_uri, or just "" if @a parent_uri is equal to @a child_uri. If - * @a child_uri is not below or equal to @a parent_uri, return NULL. + * @a child_uri is not below @a parent_uri, return NULL. * * Allocate the result in @a result_pool. * Modified: head/contrib/subversion/subversion/include/svn_io.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_io.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_io.h Thu Feb 20 19:48:47 2014 (r262250) @@ -182,9 +182,10 @@ svn_io_check_resolved_path(const char *p * may be @c NULL. If @a file is @c NULL, the file will be created but not * open. * - * If @a delete_when is #svn_io_file_del_on_close, then the @c APR_DELONCLOSE - * flag will be used when opening the file. The @c APR_BUFFERED flag will - * always be used. + * The file will be deleted according to @a delete_when. If that is + * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. + * + * The @c APR_BUFFERED flag will always be used when opening the file. * * The first attempt will just append @a suffix. If the result is not * a unique name, then subsequent attempts will append a dot, @@ -248,8 +249,9 @@ svn_io_open_uniquely_named(apr_file_t ** * be possible to atomically rename the resulting file due to cross-device * issues.) * - * The file will be deleted according to @a delete_when. If @a delete_when - * is @c svn_io_file_del_on_close and @a file is @c NULL, the file will be + * The file will be deleted according to @a delete_when. If that is + * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. If it + * is #svn_io_file_del_on_close and @a file is @c NULL, the file will be * deleted before this function returns. * * When passing @c svn_io_file_del_none please don't forget to eventually @@ -917,7 +919,7 @@ svn_stream_empty(apr_pool_t *pool); /** Return a stream allocated in @a pool which forwards all requests * to @a stream. Destruction is explicitly excluded from forwarding. * - * @see notes/destruction-of-stacked-resources + * @see http://subversion.apache.org/docs/community-guide/conventions.html#destruction-of-stacked-resources * * @since New in 1.4. */ @@ -972,7 +974,8 @@ svn_stream_open_writable(svn_stream_t ** * be possible to atomically rename the resulting file due to cross-device * issues.) * - * The file will be deleted according to @a delete_when. + * The file will be deleted according to @a delete_when. If that is + * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. * * Temporary allocations will be performed in @a scratch_pool. * @@ -1589,8 +1592,8 @@ svn_io_stat_dirent2(const svn_io_dirent2 apr_pool_t *scratch_pool); -/** Similar to svn_io_stat_dirent2, but always passes FALSE for - * verify_truename. +/** Similar to svn_io_stat_dirent2(), but always passes FALSE for + * @a verify_truename. * * @since New in 1.7. * @deprecated Provided for backwards compatibility with the 1.7 API. @@ -1681,7 +1684,7 @@ svn_io_dir_walk(const char *dirname, * * @note An APR bug affects Windows: passing a NULL @a env does not * guarantee the invoked program to run with an empty environment when - * @a inherits is FALSE, the program may inherit its parent's environment. + * @a inherit is FALSE, the program may inherit its parent's environment. * Explicitly pass an empty @a env to get an empty environment. * * @since New in 1.8. Modified: head/contrib/subversion/subversion/include/svn_repos.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_repos.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_repos.h Thu Feb 20 19:48:47 2014 (r262250) @@ -298,8 +298,7 @@ typedef struct svn_repos_notify_t * the revision which just completed. */ svn_revnum_t revision; - /** For #svn_repos_notify_warning, the warning object. Must be cleared - by the consumer of the notification. */ + /** For #svn_repos_notify_warning, the warning object. */ const char *warning_str; svn_repos_notify_warning_t warning; Modified: head/contrib/subversion/subversion/include/svn_version.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_version.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_version.h Thu Feb 20 19:48:47 2014 (r262250) @@ -72,7 +72,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 5 +#define SVN_VER_PATCH 8 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -95,7 +95,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1542147)" +#define SVN_VER_TAG " (r1568071)" /** Number tag: a string describing the version. @@ -121,7 +121,7 @@ extern "C" { * When rolling a tarball, we automatically replace it with what we * guess to be the correct revision number. */ -#define SVN_VER_REVISION 1542147 +#define SVN_VER_REVISION 1568071 /* Version strings composed from the above definitions. */ Modified: head/contrib/subversion/subversion/include/svn_wc.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_wc.h Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/include/svn_wc.h Thu Feb 20 19:48:47 2014 (r262250) @@ -2109,9 +2109,8 @@ typedef struct svn_wc_conflict_result_t * Allocate an #svn_wc_conflict_result_t structure in @a pool, * initialize and return it. * - * Set the @c choice field of the structure to @a choice, and @c - * merged_file to @a merged_file. Set all other fields to their @c - * _unknown, @c NULL or invalid value, respectively. Make only a shallow + * Set the @c choice field of the structure to @a choice, @c merged_file + * to @a merged_file, and @c save_merged to false. Make only a shallow * copy of the pointer argument @a merged_file. * * @since New in 1.5. @@ -4078,6 +4077,9 @@ typedef void (*svn_wc_status_func_t)(voi * @a ignore_patterns is an array of file patterns matching * unversioned files to ignore for the purposes of status reporting, * or @c NULL if the default set of ignorable file patterns should be used. + * Patterns from #SVN_PROP_IGNORE (and, as of 1.8, + * #SVN_PROP_INHERITABLE_IGNORES) properties are always used, even if not + * specified in @a ignore_patterns. * * If @a cancel_func is non-NULL, call it with @a cancel_baton while walking * to determine if the client has canceled the operation. Modified: head/contrib/subversion/subversion/libsvn_client/copy.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/copy.c Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/libsvn_client/copy.c Thu Feb 20 19:48:47 2014 (r262250) @@ -314,6 +314,8 @@ do_wc_to_wc_moves(svn_boolean_t *timesta { const char *src_parent_abspath; svn_boolean_t lock_src, lock_dst; + const char *src_wcroot_abspath; + const char *dst_wcroot_abspath; svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i, svn_client__copy_pair_t *); @@ -326,6 +328,13 @@ do_wc_to_wc_moves(svn_boolean_t *timesta src_parent_abspath = svn_dirent_dirname(pair->src_abspath_or_url, iterpool); + SVN_ERR(svn_wc__get_wcroot(&src_wcroot_abspath, + ctx->wc_ctx, src_parent_abspath, + iterpool, iterpool)); + SVN_ERR(svn_wc__get_wcroot(&dst_wcroot_abspath, + ctx->wc_ctx, pair->dst_parent_abspath, + iterpool, iterpool)); + /* We now need to lock the right combination of batons. Four cases: 1) src_parent == dst_parent @@ -334,15 +343,18 @@ do_wc_to_wc_moves(svn_boolean_t *timesta 4) src_parent and dst_parent are disjoint We can handle 1) as either 2) or 3) */ if (strcmp(src_parent_abspath, pair->dst_parent_abspath) == 0 - || svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath, - iterpool)) + || (svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath, + NULL) + && !svn_dirent_is_child(src_parent_abspath, dst_wcroot_abspath, + NULL))) { lock_src = TRUE; lock_dst = FALSE; } else if (svn_dirent_is_child(pair->dst_parent_abspath, - src_parent_abspath, - iterpool)) + src_parent_abspath, NULL) + && !svn_dirent_is_child(pair->dst_parent_abspath, + src_wcroot_abspath, NULL)) { lock_src = FALSE; lock_dst = TRUE; Modified: head/contrib/subversion/subversion/libsvn_client/log.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/log.c Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/libsvn_client/log.c Thu Feb 20 19:48:47 2014 (r262250) @@ -861,17 +861,19 @@ svn_client_log5(const apr_array_header_t actual_loc->url, pool)); /* Save us an RA layer round trip if we are on the repository root and - know the result in advance. All the revision data has already been - validated. + know the result in advance, or if we don't need multiple ranges. + All the revision data has already been validated. */ - if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0) + if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0 + || opt_rev_ranges->nelts <= 1) { svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment)); log_segments = apr_array_make(pool, 1, sizeof(segment)); segment->range_start = oldest_rev; segment->range_end = actual_loc->rev; - segment->path = ""; + segment->path = svn_uri_skip_ancestor(actual_loc->repos_root_url, + actual_loc->url, pool); APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment; } else Modified: head/contrib/subversion/subversion/libsvn_client/prop_commands.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/prop_commands.c Thu Feb 20 19:26:48 2014 (r262249) +++ head/contrib/subversion/subversion/libsvn_client/prop_commands.c Thu Feb 20 19:48:47 2014 (r262250) @@ -1201,6 +1201,7 @@ struct recursive_proplist_receiver_baton svn_wc_context_t *wc_ctx; /* Working copy context. */ svn_proplist_receiver2_t wrapped_receiver; /* Proplist receiver to call. */ void *wrapped_receiver_baton; /* Baton for the proplist receiver. */ + apr_array_header_t *iprops; /* Anchor, anchor_abspath pair for converting to relative paths */ const char *anchor; @@ -1216,6 +1217,27 @@ recursive_proplist_receiver(void *baton, { struct recursive_proplist_receiver_baton *b = baton; const char *path; + apr_array_header_t *iprops = NULL; + + if (b->iprops + && ! strcmp(local_abspath, b->anchor_abspath)) + { + /* Report iprops with the properties for the anchor */ + iprops = b->iprops; + b->iprops = NULL; + } + else if (b->iprops) + { + /* No report for the root? + Report iprops anyway */ + + SVN_ERR(b->wrapped_receiver(b->wrapped_receiver_baton, + b->anchor ? b->anchor : local_abspath, + NULL /* prop_hash */, + b->iprops, + scratch_pool)); + b->iprops = NULL; + } /* Attempt to convert absolute paths to relative paths for * presentation purposes, if needed. */ @@ -1230,7 +1252,7 @@ recursive_proplist_receiver(void *baton, path = local_abspath; return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton, - path, props, NULL, + path, props, iprops, scratch_pool)); } @@ -1370,6 +1392,7 @@ get_local_props(const char *path_or_url, svn_node_kind_t kind; apr_hash_t *changelist_hash = NULL; const char *local_abspath; + apr_array_header_t *iprops = NULL; SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url, scratch_pool)); @@ -1392,7 +1415,6 @@ get_local_props(const char *path_or_url, if (get_target_inherited_props) { - apr_array_header_t *iprops; const char *repos_root_url; SVN_ERR(svn_wc__get_iprops(&iprops, ctx->wc_ctx, local_abspath, @@ -1402,8 +1424,6 @@ get_local_props(const char *path_or_url, SVN_ERR(svn_client__iprop_relpaths_to_urls(iprops, repos_root_url, scratch_pool, scratch_pool)); - SVN_ERR(call_receiver(path_or_url, NULL, iprops, receiver, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 20:09:29 2014 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 ESMTPS id 6AE26FF; Thu, 20 Feb 2014 20:09:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 576A91996; Thu, 20 Feb 2014 20:09:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KK9T8q029802; Thu, 20 Feb 2014 20:09:29 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KK9TYc029801; Thu, 20 Feb 2014 20:09:29 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402202009.s1KK9TYc029801@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 20:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262251 - head/usr.bin/svn/lib/libapr_util 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 20:09:29 -0000 Author: peter Date: Thu Feb 20 20:09:28 2014 New Revision: 262251 URL: http://svnweb.freebsd.org/changeset/base/262251 Log: Match our implementation of iconv's inbuf argument. Modified: head/usr.bin/svn/lib/libapr_util/apu_config.h Modified: head/usr.bin/svn/lib/libapr_util/apu_config.h ============================================================================== --- head/usr.bin/svn/lib/libapr_util/apu_config.h Thu Feb 20 19:48:47 2014 (r262250) +++ head/usr.bin/svn/lib/libapr_util/apu_config.h Thu Feb 20 20:09:28 2014 (r262251) @@ -13,7 +13,7 @@ /* #undef APU_DSO_LIBDIR */ /* Define if the inbuf parm to iconv() is const char ** */ -/* #undef APU_ICONV_INBUF_CONST */ +#define APU_ICONV_INBUF_CONST 1 /* Define that OpenSSL uses const buffers */ #define CRYPTO_OPENSSL_CONST_BUFFERS 1 From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 20:14:44 2014 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 ESMTPS id 5DD7561E; Thu, 20 Feb 2014 20:14:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7331A3F; Thu, 20 Feb 2014 20:14:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KKEi6v033492; Thu, 20 Feb 2014 20:14:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KKEhXS033490; Thu, 20 Feb 2014 20:14:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201402202014.s1KKEhXS033490@svn.freebsd.org> From: Michael Tuexen Date: Thu, 20 Feb 2014 20:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262252 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 20:14:44 -0000 Author: tuexen Date: Thu Feb 20 20:14:43 2014 New Revision: 262252 URL: http://svnweb.freebsd.org/changeset/base/262252 Log: Remove redundant code and fix a style error. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Feb 20 20:09:28 2014 (r262251) +++ head/sys/netinet/sctp_input.c Thu Feb 20 20:14:43 2014 (r262252) @@ -439,7 +439,6 @@ sctp_process_init_ack(struct mbuf *m, in /* First verify that we have no illegal param's */ abort_flag = 0; - op_err = NULL; op_err = sctp_arethere_unrecognized_parameters(m, (offset + sizeof(struct sctp_init_chunk)), @@ -1553,8 +1552,7 @@ sctp_process_cookie_existing(struct mbuf return (NULL); } - switch SCTP_GET_STATE - (asoc) { + switch (SCTP_GET_STATE(asoc)) { case SCTP_STATE_COOKIE_WAIT: case SCTP_STATE_COOKIE_ECHOED: /* @@ -1644,7 +1642,7 @@ sctp_process_cookie_existing(struct mbuf * have simply lost the COOKIE-ACK */ break; - } /* end switch */ + } /* end switch */ sctp_stop_all_cookie_timers(stcb); /* * We ignore the return code here.. not sure if we should Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Feb 20 20:09:28 2014 (r262251) +++ head/sys/netinet/sctp_output.c Thu Feb 20 20:14:43 2014 (r262252) @@ -3671,7 +3671,6 @@ sctp_add_cookie(struct mbuf *init, int i int sig_offset; uint16_t cookie_sz; - mret = NULL; mret = sctp_get_mbuf_for_msg((sizeof(struct sctp_state_cookie) + sizeof(struct sctp_paramhdr)), 0, M_NOWAIT, 1, MT_DATA); @@ -8960,7 +8959,6 @@ sctp_send_cookie_ack(struct sctp_tcb *st struct sctp_chunkhdr *hdr; struct sctp_tmit_chunk *chk; - cookie_ack = NULL; SCTP_TCB_LOCK_ASSERT(stcb); cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 20:34:06 2014 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 ESMTPS id BF500EE6; Thu, 20 Feb 2014 20:34:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4EE41C3A; Thu, 20 Feb 2014 20:34:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KKY6JZ041403; Thu, 20 Feb 2014 20:34:06 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KKY2dZ041374; Thu, 20 Feb 2014 20:34:02 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402202034.s1KKY2dZ041374@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 20:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262253 - in stable/10: contrib/apr-util contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbm contrib/apr-util/include contrib/apr-util/memcache contrib/apr-util/misc contr... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 20:34:06 -0000 Author: peter Date: Thu Feb 20 20:34:01 2014 New Revision: 262253 URL: http://svnweb.freebsd.org/changeset/base/262253 Log: MFC r257129,257936,258084,258569,258602,262250,262251 svn-1.8.4, 1.8.5, 1.8.8 and self-contained private support libraries Deleted: stable/10/contrib/apr-util/test/testssl.c Modified: stable/10/contrib/apr-util/CHANGES stable/10/contrib/apr-util/apr-util.spec stable/10/contrib/apr-util/configure stable/10/contrib/apr-util/crypto/apr_crypto.c stable/10/contrib/apr-util/dbd/apr_dbd.c stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c stable/10/contrib/apr-util/dbm/apr_dbm.c stable/10/contrib/apr-util/include/apr_buckets.h stable/10/contrib/apr-util/include/apr_dbd.h stable/10/contrib/apr-util/include/apr_hooks.h stable/10/contrib/apr-util/include/apr_optional_hooks.h stable/10/contrib/apr-util/include/apr_queue.h stable/10/contrib/apr-util/include/apr_reslist.h stable/10/contrib/apr-util/include/apu.hw stable/10/contrib/apr-util/include/apu_version.h stable/10/contrib/apr-util/libaprutil.rc stable/10/contrib/apr-util/memcache/apr_memcache.c stable/10/contrib/apr-util/misc/apu_dso.c stable/10/contrib/apr-util/test/abts.c stable/10/contrib/apr-util/test/testpass.c stable/10/contrib/subversion/CHANGES stable/10/contrib/subversion/INSTALL stable/10/contrib/subversion/Makefile.in stable/10/contrib/subversion/NOTICE stable/10/contrib/subversion/build-outputs.mk stable/10/contrib/subversion/build.conf stable/10/contrib/subversion/configure stable/10/contrib/subversion/configure.ac stable/10/contrib/subversion/subversion/include/private/svn_auth_private.h stable/10/contrib/subversion/subversion/include/private/svn_client_private.h stable/10/contrib/subversion/subversion/include/private/svn_diff_tree.h stable/10/contrib/subversion/subversion/include/private/svn_mutex.h stable/10/contrib/subversion/subversion/include/private/svn_subr_private.h stable/10/contrib/subversion/subversion/include/svn_auth.h stable/10/contrib/subversion/subversion/include/svn_client.h stable/10/contrib/subversion/subversion/include/svn_config.h stable/10/contrib/subversion/subversion/include/svn_diff.h stable/10/contrib/subversion/subversion/include/svn_dirent_uri.h stable/10/contrib/subversion/subversion/include/svn_io.h stable/10/contrib/subversion/subversion/include/svn_repos.h stable/10/contrib/subversion/subversion/include/svn_types.h stable/10/contrib/subversion/subversion/include/svn_version.h stable/10/contrib/subversion/subversion/include/svn_wc.h stable/10/contrib/subversion/subversion/libsvn_client/commit.c stable/10/contrib/subversion/subversion/libsvn_client/copy.c stable/10/contrib/subversion/subversion/libsvn_client/externals.c stable/10/contrib/subversion/subversion/libsvn_client/log.c stable/10/contrib/subversion/subversion/libsvn_client/merge.c stable/10/contrib/subversion/subversion/libsvn_client/mergeinfo.c stable/10/contrib/subversion/subversion/libsvn_client/prop_commands.c stable/10/contrib/subversion/subversion/libsvn_client/update.c stable/10/contrib/subversion/subversion/libsvn_client/util.c stable/10/contrib/subversion/subversion/libsvn_diff/diff_file.c stable/10/contrib/subversion/subversion/libsvn_fs/fs-loader.c stable/10/contrib/subversion/subversion/libsvn_fs_base/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/10/contrib/subversion/subversion/libsvn_ra/ra_loader.c stable/10/contrib/subversion/subversion/libsvn_ra/ra_loader.h stable/10/contrib/subversion/subversion/libsvn_ra_local/ra_plugin.c stable/10/contrib/subversion/subversion/libsvn_ra_local/split_url.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/commit.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/replay.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/serf.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/util.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/client.c stable/10/contrib/subversion/subversion/libsvn_repos/commit.c stable/10/contrib/subversion/subversion/libsvn_repos/reporter.c stable/10/contrib/subversion/subversion/libsvn_subr/auth.c stable/10/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c stable/10/contrib/subversion/subversion/libsvn_subr/cache_config.c stable/10/contrib/subversion/subversion/libsvn_subr/cmdline.c stable/10/contrib/subversion/subversion/libsvn_subr/config_auth.c stable/10/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/10/contrib/subversion/subversion/libsvn_subr/dirent_uri.c stable/10/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/10/contrib/subversion/subversion/libsvn_subr/io.c stable/10/contrib/subversion/subversion/libsvn_subr/sqlite.c stable/10/contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c stable/10/contrib/subversion/subversion/libsvn_subr/subst.c stable/10/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/10/contrib/subversion/subversion/libsvn_subr/utf.c stable/10/contrib/subversion/subversion/libsvn_subr/version.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crypto.c stable/10/contrib/subversion/subversion/libsvn_wc/conflicts.h stable/10/contrib/subversion/subversion/libsvn_wc/diff.h stable/10/contrib/subversion/subversion/libsvn_wc/diff_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/diff_local.c stable/10/contrib/subversion/subversion/libsvn_wc/info.c stable/10/contrib/subversion/subversion/libsvn_wc/old-and-busted.c stable/10/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/upgrade.c stable/10/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_private.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_util.c stable/10/contrib/subversion/subversion/svn/cl.h stable/10/contrib/subversion/subversion/svn/conflict-callbacks.c stable/10/contrib/subversion/subversion/svn/status-cmd.c stable/10/contrib/subversion/subversion/svn/status.c stable/10/contrib/subversion/subversion/svn/svn.c stable/10/contrib/subversion/subversion/svnadmin/svnadmin.c stable/10/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c stable/10/contrib/subversion/subversion/svnlook/svnlook.c stable/10/contrib/subversion/subversion/svnmucc/svnmucc.c stable/10/contrib/subversion/subversion/svnserve/svnserve.c stable/10/contrib/subversion/subversion/svnsync/svnsync.c stable/10/contrib/subversion/subversion/svnversion/svnversion.c stable/10/usr.bin/svn/lib/libapr_util/apu_config.h stable/10/usr.bin/svn/svn/Makefile stable/10/usr.bin/svn/svn_private_config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/apr-util/CHANGES ============================================================================== --- stable/10/contrib/apr-util/CHANGES Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/CHANGES Thu Feb 20 20:34:01 2014 (r262253) @@ -1,4 +1,23 @@ -*- coding: utf-8 -*- +Changes with APR-util 1.5.3 + + *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. + [Carlo Bramini ] + + *) Add experimental cmake-based build system for Windows. Refer to + README.cmake for more information. [Jeff Trawick, Tom Donovan] + + *) Fix warnings in odbc driver on 64bit systems. + PR 55197 [Tom Donovan] + + *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi + Gacogne ] + + *) Add support for Berkeley DB 6.0. [Rainer Jung] + + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] + Changes with APR-util 1.5.2 *) Windows: Add command line makefiles. [Gregg Smith] Modified: stable/10/contrib/apr-util/apr-util.spec ============================================================================== --- stable/10/contrib/apr-util/apr-util.spec Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/apr-util.spec Thu Feb 20 20:34:01 2014 (r262253) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.2 +Version: 1.5.3 Release: 1 License: Apache Software License Group: System Environment/Libraries Modified: stable/10/contrib/apr-util/configure ============================================================================== --- stable/10/contrib/apr-util/configure Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/configure Thu Feb 20 20:34:01 2014 (r262253) @@ -1440,7 +1440,7 @@ Optional Packages: --with-ldap-lib=path path to ldap lib file --with-ldap=library ldap library to use --with-dbm=DBM choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X,db6X} for some X=0,...,9 --with-gdbm=DIR enable GDBM support --with-ndbm=PATH Find the NDBM header and library in `PATH/include' @@ -11218,8 +11218,10 @@ fi fi - test ${apu_has_ldap} != "1" && as_fn_error $? "could not find an LDAP library" "$LINENO" 5 - test ${apu_has_ldap} == "1" && + if test ${apu_has_ldap} != "1"; then + as_fn_error $? "could not find an LDAP library" "$LINENO" 5 + else + if test "x$LDADD_ldap" = "x"; then test "x$silent" != "xyes" && echo " setting LDADD_ldap to \"$LDADD_ldap_found\"" LDADD_ldap="$LDADD_ldap_found" @@ -11240,6 +11242,7 @@ fi done fi + fi as_ac_Lib=`$as_echo "ac_cv_lib_$apu_liblber_name''_ber_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_init in -l$apu_liblber_name" >&5 $as_echo_n "checking for ber_init in -l$apu_liblber_name... " >&6; } @@ -11617,6 +11620,7 @@ fi dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done + dbm_list="$dbm_list, db60" # Check whether --with-dbm was given. @@ -15708,7 +15712,7 @@ fi as_fn_error $? "Berkeley db3 not found" "$LINENO" 5 fi ;; - db[45][0-9]) + db[456][0-9]) db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` @@ -16113,7 +16117,7 @@ fi as_fn_error $? "Berkeley db$db_major not found" "$LINENO" 5 fi ;; - db[45]) + db[456]) db_major=`echo "$requested" | sed -e 's/db//'` # Start version search at version x.9 db_minor=9 @@ -18561,11 +18565,11 @@ fi eval "apu_use_$requested=1" apu_default_dbm=$requested ;; - db185 | db[12345]) + db185 | db[123456]) apu_use_db=1 apu_default_dbm=$requested ;; - db[45][0-9]) + db[456][0-9]) apu_use_db=1 apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; Modified: stable/10/contrib/apr-util/crypto/apr_crypto.c ============================================================================== --- stable/10/contrib/apr-util/crypto/apr_crypto.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/crypto/apr_crypto.c Thu Feb 20 20:34:01 2014 (r262253) @@ -100,7 +100,9 @@ APU_DECLARE(apr_status_t) apr_crypto_ini } /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) pool = parent; #if APU_DSO_BUILD /* deprecate in 2.0 - permit implicit initialization */ @@ -176,7 +178,7 @@ APU_DECLARE(apr_status_t) apr_crypto_get #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name); -#elif defined(WIN32) +#elif defined(WIN32) || defined(__CYGWIN__) apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); #else Modified: stable/10/contrib/apr-util/dbd/apr_dbd.c ============================================================================== --- stable/10/contrib/apr-util/dbd/apr_dbd.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/dbd/apr_dbd.c Thu Feb 20 20:34:01 2014 (r262253) @@ -102,8 +102,10 @@ APU_DECLARE(apr_status_t) apr_dbd_init(a } /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) - pool = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; #if APU_DSO_BUILD /* deprecate in 2.0 - permit implicit initialization */ apu_dso_init(pool); @@ -184,7 +186,7 @@ APU_DECLARE(apr_status_t) apr_dbd_get_dr #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name); -#elif defined(WIN32) +#elif defined(WIN32) || defined(__CYGWIN__) apr_snprintf(modname, sizeof(modname), "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); #else @@ -204,7 +206,7 @@ APU_DECLARE(apr_status_t) apr_dbd_get_dr } apu_dso_mutex_unlock(); -#else /* not builtin and !APR_HAS_DSO => not implemented */ +#else /* not builtin and !APU_DSO_BUILD => not implemented */ rv = APR_ENOTIMPL; #endif Modified: stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c ============================================================================== --- stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c Thu Feb 20 20:34:01 2014 (r262253) @@ -114,9 +114,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - int transaction_mode; - int dboptions; /* driver options re SQLGetData */ - int default_transaction_mode; + intptr_t transaction_mode; + intptr_t dboptions; /* driver options re SQLGetData */ + intptr_t default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +359,7 @@ static SQLRETURN odbc_set_result_column( SQLHANDLE stmt) { SQLRETURN rc; - int maxsize, textsize, realsize, type, isunsigned = 1; + intptr_t maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -409,7 +409,7 @@ static SQLRETURN odbc_set_result_column( type = SQL_C_CHAR; } - res->coltypes[icol] = type; + res->coltypes[icol] = (SQLSMALLINT)type; /* size if retrieved as text */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, @@ -441,12 +441,12 @@ static SQLRETURN odbc_set_result_column( res->colptrs[icol] = NULL; res->colstate[icol] = COL_AVAIL; - res->colsizes[icol] = maxsize; + res->colsizes[icol] = (SQLINTEGER)maxsize; rc = SQL_SUCCESS; } else { res->colptrs[icol] = apr_pcalloc(res->pool, maxsize); - res->colsizes[icol] = maxsize; + res->colsizes[icol] = (SQLINTEGER)maxsize; if (res->apr_dbd->dboptions & SQL_GD_BOUND) { /* we are allowed to call SQLGetData if we need to */ rc = SQLBindCol(stmt, icol + 1, res->coltypes[icol], @@ -747,7 +747,7 @@ static void *odbc_get(const apr_dbd_row_ SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - int options = row->res->apr_dbd->dboptions; + intptr_t options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +817,13 @@ static apr_status_t odbc_parse_params(ap int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, int **attrvals) + int **attrs, intptr_t **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(int)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1062,7 +1062,8 @@ static apr_dbd_t *odbc_open(apr_pool_t * SQLHANDLE err_h = NULL; SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; - int nattrs = 0, *attrs = NULL, *attrvals = NULL, connect = 0; + int nattrs = 0, *attrs = NULL, connect = 0; + intptr_t *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1116,10 +1117,10 @@ static apr_dbd_t *odbc_open(apr_pool_t * handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(int), NULL); + &(handle->default_transaction_mode), sizeof(intptr_t), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(int), NULL); + sizeof(intptr_t), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } Modified: stable/10/contrib/apr-util/dbm/apr_dbm.c ============================================================================== --- stable/10/contrib/apr-util/dbm/apr_dbm.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/dbm/apr_dbm.c Thu Feb 20 20:34:01 2014 (r262253) @@ -129,8 +129,10 @@ static apr_status_t dbm_open_type(apr_db apr_pool_t *parent; /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) - pool = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; /* deprecate in 2.0 - permit implicit initialization */ apu_dso_init(pool); @@ -162,7 +164,7 @@ static apr_status_t dbm_open_type(apr_db #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type); -#elif defined(WIN32) +#elif defined(WIN32) || defined (__CYGWIN__) apr_snprintf(modname, sizeof(modname), "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", type); #else Modified: stable/10/contrib/apr-util/include/apr_buckets.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_buckets.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_buckets.h Thu Feb 20 20:34:01 2014 (r262253) @@ -351,9 +351,9 @@ typedef apr_status_t (*apr_brigade_flush #define APR_BRIGADE_LAST(b) APR_RING_LAST(&(b)->list) /** - * Insert a list of buckets at the front of a brigade + * Insert a single bucket at the front of a brigade * @param b The brigade to add to - * @param e The first bucket in a list of buckets to insert + * @param e The bucket to insert */ #define APR_BRIGADE_INSERT_HEAD(b, e) do { \ apr_bucket *ap__b = (e); \ @@ -362,9 +362,9 @@ typedef apr_status_t (*apr_brigade_flush } while (0) /** - * Insert a list of buckets at the end of a brigade + * Insert a single bucket at the end of a brigade * @param b The brigade to add to - * @param e The first bucket in a list of buckets to insert + * @param e The bucket to insert */ #define APR_BRIGADE_INSERT_TAIL(b, e) do { \ apr_bucket *ap__b = (e); \ @@ -393,9 +393,9 @@ typedef apr_status_t (*apr_brigade_flush } while (0) /** - * Insert a list of buckets before a specified bucket + * Insert a single bucket before a specified bucket * @param a The bucket to insert before - * @param b The buckets to insert + * @param b The bucket to insert */ #define APR_BUCKET_INSERT_BEFORE(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ @@ -404,9 +404,9 @@ typedef apr_status_t (*apr_brigade_flush } while (0) /** - * Insert a list of buckets after a specified bucket + * Insert a single bucket after a specified bucket * @param a The bucket to insert after - * @param b The buckets to insert + * @param b The bucket to insert */ #define APR_BUCKET_INSERT_AFTER(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ Modified: stable/10/contrib/apr-util/include/apr_dbd.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_dbd.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_dbd.h Thu Feb 20 20:34:01 2014 (r262253) @@ -107,10 +107,10 @@ APU_DECLARE(apr_status_t) apr_dbd_get_dr /** apr_dbd_open_ex: open a connection to a backend * + * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return - * @param driver - driver struct. * @param error - descriptive error. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed @@ -147,10 +147,10 @@ APU_DECLARE(apr_status_t) apr_dbd_open_e /** apr_dbd_open: open a connection to a backend * + * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return - * @param driver - driver struct. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @see apr_dbd_open_ex @@ -161,8 +161,8 @@ APU_DECLARE(apr_status_t) apr_dbd_open(c /** apr_dbd_close: close a connection to a backend * - * @param handle - handle to close * @param driver - driver struct. + * @param handle - handle to close * @return APR_SUCCESS for success or error status */ APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, Modified: stable/10/contrib/apr-util/include/apr_hooks.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_hooks.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_hooks.h Thu Feb 20 20:34:01 2014 (r262253) @@ -313,24 +313,24 @@ APU_DECLARE_DATA extern apr_pool_t *apr_ /** * A global variable to determine if debugging information about the - * hooks functions should be printed + * hooks functions should be printed. */ APU_DECLARE_DATA extern int apr_hook_debug_enabled; /** - * The name of the module that is currently registering a function + * The name of the module that is currently registering a function. */ APU_DECLARE_DATA extern const char *apr_hook_debug_current; /** - * Register a hook function to be sorted + * Register a hook function to be sorted. * @param szHookName The name of the Hook the function is registered for * @param aHooks The array which stores all of the functions for this hook */ APU_DECLARE(void) apr_hook_sort_register(const char *szHookName, apr_array_header_t **aHooks); /** - * Sort all of the registerd functions for a given hook + * Sort all of the registered functions for a given hook. */ APU_DECLARE(void) apr_hook_sort_all(void); Modified: stable/10/contrib/apr-util/include/apr_optional_hooks.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_optional_hooks.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_optional_hooks.h Thu Feb 20 20:34:01 2014 (r262253) @@ -33,11 +33,11 @@ extern "C" { * @{ */ /** - * Function to implemnt the APR_OPTIONAL_HOOK Macro + * Function to implement the APR_OPTIONAL_HOOK Macro * @internal * @see APR_OPTIONAL_HOOK * - * @param name The name of the hook + * @param szName The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one Modified: stable/10/contrib/apr-util/include/apr_queue.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_queue.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_queue.h Thu Feb 20 20:34:01 2014 (r262253) @@ -22,7 +22,7 @@ * @brief Thread Safe FIFO bounded queue * @note Since most implementations of the queue are backed by a condition * variable implementation, it isn't available on systems without threads. - * Although condition variables are some times available without threads. + * Although condition variables are sometimes available without threads. */ #include "apu.h" Modified: stable/10/contrib/apr-util/include/apr_reslist.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_reslist.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_reslist.h Thu Feb 20 20:34:01 2014 (r262253) @@ -44,7 +44,7 @@ typedef struct apr_reslist_t apr_reslist /* Generic constructor called by resource list when it needs to create a * resource. * @param resource opaque resource - * @param param flags + * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, @@ -53,7 +53,7 @@ typedef apr_status_t (*apr_reslist_const /* Generic destructor called by resource list when it needs to destroy a * resource. * @param resource opaque resource - * @param param flags + * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params, @@ -111,12 +111,17 @@ APU_DECLARE(apr_status_t) apr_reslist_de * Retrieve a resource from the list, creating a new one if necessary. * If we have met our maximum number of resources, we will block * until one becomes available. + * @param reslist The resource list. + * @param resource An address where the pointer to the resource + * will be stored. */ APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, void **resource); /** * Return a resource back to the list of available resources. + * @param reslist The resource list. + * @param resource The resource to return to the list. */ APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource); @@ -140,6 +145,8 @@ APU_DECLARE(apr_uint32_t) apr_reslist_ac * Invalidate a resource in the pool - e.g. a database connection * that returns a "lost connection" error and can't be restored. * Use this instead of apr_reslist_release if the resource is bad. + * @param reslist The resource list. + * @param resource The resource to invalidate. */ APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, void *resource); Modified: stable/10/contrib/apr-util/include/apu.hw ============================================================================== --- stable/10/contrib/apr-util/include/apu.hw Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apu.hw Thu Feb 20 20:34:01 2014 (r262253) @@ -42,6 +42,12 @@ * conventions at compile time. */ +/* Make sure we have our platform identifier macro defined we ask for later. + */ +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 1 +#endif + #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may Modified: stable/10/contrib/apr-util/include/apu_version.h ============================================================================== --- stable/10/contrib/apr-util/include/apu_version.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apu_version.h Thu Feb 20 20:34:01 2014 (r262253) @@ -38,6 +38,9 @@ */ +#define APU_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ + "Foundation or its licensors, as applicable." + /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APU. */ @@ -59,7 +62,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APU_PATCH_VERSION 2 +#define APU_PATCH_VERSION 3 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, @@ -71,7 +74,9 @@ #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ +#ifndef APU_IS_DEV_STRING #define APU_IS_DEV_STRING "-dev" +#endif #else #define APU_IS_DEV_STRING "" #endif Modified: stable/10/contrib/apr-util/libaprutil.rc ============================================================================== --- stable/10/contrib/apr-util/libaprutil.rc Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/libaprutil.rc Thu Feb 20 20:34:01 2014 (r262253) @@ -1,8 +1,5 @@ #include "apu_version.h" -#define APU_COPYRIGHT "Copyright (c) 2011 The Apache Software " \ - "Foundation or its licensors, as applicable." - #define APU_LICENSE \ "Licensed to the Apache Software Foundation (ASF) under one or more " \ "contributor license agreements. See the NOTICE file distributed with " \ Modified: stable/10/contrib/apr-util/memcache/apr_memcache.c ============================================================================== --- stable/10/contrib/apr-util/memcache/apr_memcache.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/memcache/apr_memcache.c Thu Feb 20 20:34:01 2014 (r262253) @@ -181,7 +181,7 @@ apr_memcache_find_server_hash_default(vo #if APR_HAS_THREADS apr_thread_mutex_lock(ms->lock); #endif - /* Try the the dead server, every 5 seconds */ + /* Try the dead server, every 5 seconds */ if (curtime - ms->btime > apr_time_from_sec(5)) { ms->btime = curtime; if (mc_version_ping(ms) == APR_SUCCESS) { @@ -289,8 +289,13 @@ static apr_status_t conn_connect(apr_mem { apr_status_t rv = APR_SUCCESS; apr_sockaddr_t *sa; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif - rv = apr_sockaddr_info_get(&sa, conn->ms->host, APR_INET, conn->ms->port, 0, conn->p); + rv = apr_sockaddr_info_get(&sa, conn->ms->host, family, conn->ms->port, 0, conn->p); if (rv != APR_SUCCESS) { return rv; } @@ -322,6 +327,11 @@ mc_conn_construct(void **conn_, void *pa apr_pool_t *np; apr_pool_t *tp; apr_memcache_server_t *ms = params; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = ms->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif rv = apr_pool_create(&np, pool); if (rv != APR_SUCCESS) { @@ -339,7 +349,7 @@ mc_conn_construct(void **conn_, void *pa conn->p = np; conn->tp = tp; - rv = apr_socket_create(&conn->sock, APR_INET, SOCK_STREAM, 0, np); + rv = apr_socket_create(&conn->sock, family, SOCK_STREAM, 0, np); if (rv != APR_SUCCESS) { apr_pool_destroy(np); Modified: stable/10/contrib/apr-util/misc/apu_dso.c ============================================================================== --- stable/10/contrib/apr-util/misc/apu_dso.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/misc/apu_dso.c Thu Feb 20 20:34:01 2014 (r262253) @@ -75,7 +75,6 @@ static apr_status_t apu_dso_term(void *p apr_status_t apu_dso_init(apr_pool_t *pool) { apr_status_t ret = APR_SUCCESS; - apr_pool_t *global; apr_pool_t *parent; if (apr_atomic_inc32(&initialised)) { @@ -88,17 +87,19 @@ apr_status_t apu_dso_init(apr_pool_t *po } /* Top level pool scope, need process-scope lifetime */ - for (parent = global = pool; parent; parent = apr_pool_parent_get(global)) - global = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; - dsos = apr_hash_make(global); + dsos = apr_hash_make(pool); #if APR_HAS_THREADS - ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, global); + ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool); /* This already registers a pool cleanup */ #endif - apr_pool_cleanup_register(global, NULL, apu_dso_term, + apr_pool_cleanup_register(pool, NULL, apu_dso_term, apr_pool_cleanup_null); apr_atomic_dec32(&in_init); Modified: stable/10/contrib/apr-util/test/abts.c ============================================================================== --- stable/10/contrib/apr-util/test/abts.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/test/abts.c Thu Feb 20 20:34:01 2014 (r262253) @@ -106,6 +106,9 @@ abts_suite *abts_add_suite(abts_suite *s /* suite_name_full may be an absolute path depending on __FILE__ * expansion */ suite_name = strrchr(suite_name_full, '/'); + if (!suite_name) { + suite_name = strrchr(suite_name_full, '\\'); + } if (suite_name) { suite_name++; } else { @@ -247,7 +250,8 @@ void abts_int_nequal(abts_case *tc, cons tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual); + fprintf(stderr, "Line %d: expected something other than <%d>, but saw <%d>\n", + lineno, expected, actual); fflush(stderr); } } @@ -279,7 +283,8 @@ void abts_str_nequal(abts_case *tc, cons tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual); + fprintf(stderr, "Line %d: expected something other than <%s>, but saw <%s>\n", + lineno, expected, actual); fflush(stderr); } } Modified: stable/10/contrib/apr-util/test/testpass.c ============================================================================== --- stable/10/contrib/apr-util/test/testpass.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/test/testpass.c Thu Feb 20 20:34:01 2014 (r262253) @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include Modified: stable/10/contrib/subversion/CHANGES ============================================================================== --- stable/10/contrib/subversion/CHANGES Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/subversion/CHANGES Thu Feb 20 20:34:01 2014 (r262253) @@ -1,3 +1,195 @@ +Version 1.8.8 +(19 Feb 2014, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.8 + + User-visible changes: + - Client-side bugfixes: + * use CryptoAPI to validate intermediary certificates on Windows (r1564623) + * fix automatic relocate for wcs not at repository root (r1541638 et al) + * diff: fix when target is a drive root on Windows (r1541635) + * wc: improve performance when used with SQLite 3.8 (r1542765) + * copy: fix some scenarios that broke the working copy (r1560690) + * move: fix errors when moving files between an external and the parent + working copy (r1551524, r1551579) + * log: resolve performance regression in certain scenarios (r1553101 et al) + * merge: decrease work to detect differences between 3 files (r1548486) + * checkout: don't require flush support for symlinks on Windows (r1547774) + * commit: don't change file permissions inappropriately (issue #4440) + * commit: fix assertion due to invalid pool lifetime (r1553376 et al) + * version: don't cut off the distribution version on Linux (r1544878 et al) + * flush stdout before exiting to avoid information being lost (r1499470) + * status: fix missing sentinel value on warning codes (r1543145) + * update/switch: improve some WC db queries that may return incorrect + results depending on how SQLite is built (r1567109) + + - Server-side bugfixes: + * reduce memory usage during checkout and export (r1564215) + * fsfs: create rep-cache.db with proper permissions (issue #3437) + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * mod_dav_svn: fix SVNAllowBulkUpdates directive merging (r1548105) + * mod_dav_svn: include requested property changes in reports (r1557522) + * svnserve: correct default cache size in help text (r1563110) + * svnadmin dump: reduce size of dump files with '--deltas' (r1554978) + * resolve integer underflow that resulted in infinite loops (r1567985) + + Developer-visible changes: + - General: + * fix ocassional failure of check_tests.py 12 (r1496127 et al) + * fix failure with SQLite 3.8.1-3.8.3 when built with + SQLITE_ENABLE_STAT3/4 due to bug in SQLite (r1567286, r1567392) + * specify SQLite defaults that can be changed when SQLite is built + to avoid unexpected behavior with Subversion (r1567064) + + - API changes: + * numerous documentation fixes + * svn_client_commit_item3_dup() fix pool lifetime issues (r1550803) + * ra_serf: properly ask multiple certificate validation providers for + acceptance of certificate failures (r1535532) + * release internal fs objects when closing commit editor (r1555499) + * svn_client_proplist4() don't call the callback multiple times for + the same path in order to deliver inherited properties (r1549858 et al) + + - Bindings: + * javahl: make test suite run without installing on OS X (r1535115) + * swig: fix building out of tarball on OS X (r1555654) + * swig-pl: fix with --enable-sqlite-compatibility-version (r1559009) + * swig: fix building bindings on OS X when APR has the -no-cpp-precomp + flag in the apr-config --cppflags output. (r1535610) + * swig: fix building from tarball with an out-of-tree build (r1543187) + + +Version 1.8.7 +(Not released, see changes for 1.8.8.) + +Version 1.8.6 +(Not released, see changes for 1.8.8.) + + +Version 1.8.5 +(25 November 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.5 + + User-visible changes: + - Client-side bugfixes: + * fix externals that point at redirected locations (issues #4428, #4429) + * diff: fix assertion with move inside a copy (issue #4444) + + - Server-side bugfixes: + * mod_dav_svn: Prevent crashes with some 3rd party modules (r1537360 et al) + * mod_dav_svn: canonicalize paths properly (r1542071) + * mod_authz_svn: fix crash of mod_authz_svn with invalid config (r1541432) + * hotcopy: fix hotcopy losing revprop files in packed repos (issue #4448) + + - Other tool improvements and bugfixes: + * mod_dontdothat: Fix the uri parser (r1542069 et al) + + Developer-visible changes: + - General: + * fix compilation with '--enable-optimize' with clang (r1534860) + * fix compilation with debug build of BDB on Windows (r1501656, r1501702) + * fix '--with-openssl' option when building on Windows (r1535139) + * add test to fail when built against broken ZLib (r1537193 et al) + + - Bindings: + * swig-rb: fix tests to run without installing on OS X (r1535161) + * ctypes-python: build with compiler selected via configure (r1536537) + + +Version 1.8.4 +(29 October 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.4 + + User-visible changes: + - Client- and server-side bugfixes: + * fix assertion on urls of the form 'file://./' (r1516806) + * stop linking against psapi.dll on Windows (r1534102) + * translation updates for Swedish + + - Client-side bugfixes: + * revert: fix problems reverting moves (issue #4436) + * update: fix assertion when file external access is denied (issue #4422) + * merge: reduce network connections for automatic merge (r1468980 et al) + * merge: fix path corruption during reintegration (r1523666) + * mergeinfo: fix crash (r1519955) + * ra_serf: verify the result of xml parsing (r1501199 et al) + * ra_serf: improve error messages during commit (r1526439) + * ra_local: fix error with repository in Windows drive root (r1518184) + * fix crash on windows when piped command is interrupted (r1522892) + * fix crash in the crash handler on windows (r1532023) + * fix assertion when upgrading old working copies (r1520529) + + - Server-side bugfixes: + * hotcopy: cleanup unpacked revprops with '--incremental' (r1512300 et al) + * fix OOM on concurrent requests at threaded server start (r1527103 et al) + * fsfs: improve error message when unsupported fsfs format found (r1534158) + * fix memory problem in 3rd party FS module loader (r1519615 et al) + + Developer-visible changes: + - General: + * allow compiling against serf 1.3 and later on Windows (r1517123) + + - Bindings: + * javahl: canonicalize path for streamFileContent method (r1524869) + + +Version 1.8.3 +(29 August 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.3 + + User-visible changes: + - Client- and server-side bugfixes: + * translation updates for Swedish + * enforce strict version equality between tools and libraries (r1502267) + * consistently output revisions as "r%ld" in error messags (r1499044 et al) + + - Client-side bugfixes: + * status: always use absolute paths in XML output (issue #4398) + * ra_serf: 'svn log -v' fails with a 1.2.x server (issue #4044) + * ra_serf: fix crash when committing cp with deep deletion (issue #4400) + * diff: issue an error for files that can't fit in memory (r1513119 et al) + * svnmucc: generate proper error for mismatched URLs (r1511353) + * update: fix a crash when a temp file doesn't exist (r1513156) + * commit & update: improve sleep for timestamps performance (r1508438) + * diff: continue on missing or obstructing files (issue #4396) + * ra_serf: use runtime serf version for User-Agent (r1514315, r1514628) + * ra_serf: ignore case when checking certificate common names (r1514763) + * ra_serf: format distinguished names properly (r1514804) + * ra_serf: do not retry HTTP requests if we started to parse them (r1503318) + * ra_serf: output ssl cert verification failure reason (r1514785 et al) + * ra_serf: allow session reuse after SVN_ERR_CEASE_INVOCATION (r1502901) + * ra_serf: include library version in '--version' output (r1514295 et al) + * info: fix spurious error on wc root with child in conflict (r1515366) + + - Server-side bugfixes: + * svnserve: fix creation of pid files (r1516556) + * svnadmin: fix output encoding in non-UTF8 environments (r1506966) + * svnsync: fix high memory usage when running over ra_serf (r1515249 et al) + * mod_dav_svn: do not map requests to filesystem (r1512432 et al) + * svnauthz: improve help strings (r1511272) + * fsfs: fixed manifest file growth with revprop changes (r1513874) + * fsfs: fix packed revprops causing loss of revprops (r1513879 et al) + + - Other tool improvements and bugfixes: + * svnwcsub/irkerbridge: fix symlink attack via pid file (r175 from upstream) + + Developer-visible changes: + - General: + * describe APR unimplemented errors as coming from APR (r1503010 et al) + * mod_dav_svn: update INSTALL to reflect configure defaults (r1515141) + * davautocheck: use the correct apxs binary by default (r1507889, r1507891) + + - API changes: + * svn_config_walk_auth_data() config_dir arg: permit NULL (r1507382 et al) + + - Bindings: + * swig-pl: fix SVN::Client not honoring config file settings (r150744) + * swig-pl & swig-py: disable unusable svn_fs_set_warning_func (r1515119) + + +Version 1.8.2 +(Not released, see changes for 1.8.3.) + + Version 1.8.1 (23 July 2013, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.1 @@ -54,6 +246,8 @@ http://svn.apache.org/repos/asf/subversi * svnadmin create: deny '--fs-type=fsfs --compatible-version=1.0' (r1494223) * svnadmin upgrade: fix data loss when cancelling in last stage (r1494298) * mod_dav_svn: fix incorrect path canonicalization (r1503528) + See CVE-2013-4131, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-4131-advisory.txt - Other tool improvements and bugfixes: * fsfs-stats (tool): resolve segfault when passing invalid path (r1492164) @@ -178,7 +372,7 @@ http://svn.apache.org/repos/asf/subversi * decreased default http timeout for ra_serf (issue #3968) * prevent ra_serf from corrupting the working copy (issue #3993) * ra_serf transmits property changes inline to reduce requests (r1378927) - * allow client to avoid SSL certificate prompts (issue #2410) + * by default avoid SSL certificate prompts in client (issue #2410) * improve interactive resolution of property conflicts (r1387678 et al) * make ra_serf raise an error upon delta-base mismatch (issue #4235) * tune ra_svn transmit buffer handling (r1391788) @@ -361,7 +555,7 @@ http://svn.apache.org/repos/asf/subversi * support for Serf 2 (r1147538) * introduction of editor v2 (via private APIs only) (r1166332 et al) * improve SQLite setup for compatibility with OS X 10.7. (r1181666) - * rework switch statement to accomodate OWC compiler limitations (r1204407) + * rework switch statement to accommodate OWC compiler limitations (r1204407) * new --enable-sqlite-compatibility-version configure option (r1201421) * make test suite LD_LIBRARY_PATH include just-built auth plugins (r1200474) * packages/ directory removed, contents were outdated and unused (r1442167) @@ -388,7 +582,7 @@ http://svn.apache.org/repos/asf/subversi * configure now script auto-detects GNOME keyring (r1387230) * allow configure to detect BDB on Debian-based Linux distros (r1390633) * auto-detect serf via pkg-config (r1391662) - * improve queries for compatability with SQLite 3.7.16 (r1455239) + * improve queries for compatibility with SQLite 3.7.16 (r1455239) * remove support for in-tree apr, apr-util and apr-memcache (r1456924) * FSFS caching supports prefixes now (r1462436) * maintainer mode now prints symbolic error codes (r1465157) @@ -426,6 +620,84 @@ http://svn.apache.org/repos/asf/subversi * fix some reference counting bugs in swig-py bindings (r1464899, r1466524) +Version 1.7.15 +(12 Feb 2014, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.15 + + User-visible changes: + - Client-side bugfixes: + * copy: fix some scenarios that broke the working copy (r1560690) + * diff: fix regressions due to fixes in 1.7.14 (issue #4460) + + - Server-side bugfixes: + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * reduce memory usage during checkout and export (r1564215) + + Developer-visible changes: + - General: + * fix failure in checkout_tests.py + * support compiling against Cyrus sasl 2.1.25 (r1404912, r1413402) + + +Version 1.7.14 +(25 Nov 2013, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.14 + + User-visible changes: + - Client- and server-side bugfixes: + * fix assertion on urls of the form 'file://./' (r1516806) + + - Client-side bugfixes: + * upgrade: fix an assertion when used with pre-1.3 wcs (r1530849) + * ra_local: fix error with repository in Windows drive root (r1518184) + * fix crash on windows when piped command is interrupted (r1522892) + * fix externals that point at redirected locations (issues #4428, #4429) + * diff: fix incorrect calculation of changes in some cases (issue #4283) + * diff: fix errors with added/deleted targets (issues #4153, #4421) + + - Server-side bugfixes: + * mod_dav_svn: Prevent crashes with some 3rd party modules (r1537360 et al) + * fix OOM on concurrent requests at threaded server start (r1527103 et al) + * fsfs: limit commit time of files with deep change histories (r1536790) + * mod_dav_svn: canonicalize paths properly (r1542071) + + - Other tool improvements and bugfixes: + * mod_dontdothat: Fix the uri parser (r1542069 et al) + + Developer-visible changes: + - Bindings: + * javahl: canonicalize path for streamFileContent method (r1524869) + + +Version 1.7.13 +(29 Aug 2013, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.13 + + User-visible changes: + - General + * merge: fix bogus mergeinfo with conflicting file merges (issue #4306) + * diff: fix duplicated path component in '--summarize' output (issue #4408) + * ra_serf: ignore case when checking certificate common names (r1514763) + + - Server-side bugfixes: + * svnserve: fix creation of pid files (r1516556) + * mod_dav_svn: better status codes for commit failures (r1490684) + * mod_dav_svn: do not map requests to filesystem (r1512432 et al) + + Developer-visible changes: + - General: + * support linking against gssapi on Solaris 10 (r1515068) + * don't use uninitialized variable to produce an error code (r1482282) + + - Bindings: + * swig-pl: fix SVN::Client not honoring config file settings (r150744) + * swig-pl & swig-py: disable unusable svn_fs_set_warning_func (r1515119) + + +Version 1.7.12 +(Not released, see changes for 1.7.13.) + + Version 1.7.11 (23 Jul 2013, from /branches/1.7.x) http://svn.apache.org/repos/asf/subversion/tags/1.7.11 @@ -436,9 +708,13 @@ http://svn.apache.org/repos/asf/subversi - Server-side bugfixes: * mod_dav_svn: fix incorrect path canonicalization (r1503528) + See CVE-2013-4131, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-4131-advisory.txt - Other tool improvements and bugfixes: * fix argument processing in contrib hook scripts (r1485350) + See CVE-2013-2088, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-2088-advisory.txt Developer-visible changes: - Bindings: @@ -464,7 +740,11 @@ http://svn.apache.org/repos/asf/subversi - Server-side bugfixes: * fix FSFS repository corruption due to newline in filename (issue #4340) + See CVE-2013-1968, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-1968-advisory.txt * fix svnserve exiting when a client connection is aborted (r1482759) + See CVE-2013-2112, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-2112-advisory.txt * fix svnserve memory use after clear (issue #4365) * fix repository corruption on power/disk failure on Windows (r1483781) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 20:51:28 2014 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 ESMTPS id A7CAE651; Thu, 20 Feb 2014 20:51:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 914301DE5; Thu, 20 Feb 2014 20:51:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KKpSZ5048963; Thu, 20 Feb 2014 20:51:28 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KKpRWV048959; Thu, 20 Feb 2014 20:51:27 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402202051.s1KKpRWV048959@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 20:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262254 - in stable/10/kerberos5/lib: libasn1 libgssapi_spnego libhdb libhx509 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 20:51:28 -0000 Author: peter Date: Thu Feb 20 20:51:27 2014 New Revision: 262254 URL: http://svnweb.freebsd.org/changeset/base/262254 Log: MFC r262253: hack to prevent concurrent runs of asn1_compile in the Heimdal build with high -j concurrency. Modified: stable/10/kerberos5/lib/libasn1/Makefile stable/10/kerberos5/lib/libgssapi_spnego/Makefile stable/10/kerberos5/lib/libhdb/Makefile stable/10/kerberos5/lib/libhx509/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/lib/libasn1/Makefile ============================================================================== --- stable/10/kerberos5/lib/libasn1/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libasn1/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -56,10 +56,12 @@ INCS+= krb5_asn1.h \ digest_asn1.h \ kx509_asn1.h +.ORDER: ${GEN_CMS} ${GEN_CMS}: cms.asn1 cms.opt ${ASN1_COMPILE} --one-code-file \ --option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1 +.ORDER: ${GEN_RFC2459} ${GEN_RFC2459}: rfc2459.asn1 ${ASN1_COMPILE} \ --one-code-file \ @@ -70,32 +72,39 @@ ${GEN_RFC2459}: rfc2459.asn1 --sequence=Extensions \ --sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1 +.ORDER: ${GEN_K5} ${GEN_K5}: krb5.asn1 krb5.opt ${ASN1_COMPILE} \ --one-code-file \ --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} krb5_asn1 +.ORDER: ${GEN_PKINIT} ${GEN_PKINIT}: pkinit.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkinit_asn1 +.ORDER: ${GEN_PKCS8} ${GEN_PKCS8}: pkcs8.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs8_asn1 +.ORDER: ${GEN_PKCS9} ${GEN_PKCS9}: pkcs9.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs9_asn1 +.ORDER: ${GEN_PKCS12} ${GEN_PKCS12}: pkcs12.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs12_asn1 +.ORDER: ${GEN_DIGEST} ${GEN_DIGEST}: digest.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} digest_asn1 +.ORDER: ${GEN_KX509} ${GEN_KX509}: kx509.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} kx509_asn1 Modified: stable/10/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- stable/10/kerberos5/lib/libgssapi_spnego/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libgssapi_spnego/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -38,6 +38,7 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I. CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} \ spnego_asn1_files spnego_asn1-template.c +.ORDER: ${GEN} ${GEN}: spnego.asn1 spnego.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} spnego_asn1 Modified: stable/10/kerberos5/lib/libhdb/Makefile ============================================================================== --- stable/10/kerberos5/lib/libhdb/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libhdb/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -84,6 +84,7 @@ GEN= asn1_Salt.x \ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} hdb_asn1_files \ hdb_asn1-template.[ch]* +.ORDER: ${GEN} ${GEN}: hdb.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} hdb_asn1 Modified: stable/10/kerberos5/lib/libhx509/Makefile ============================================================================== --- stable/10/kerberos5/lib/libhx509/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libhx509/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -269,14 +269,17 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx INCS+= ocsp_asn1.h pkcs10_asn1.h crmf_asn1.h +.ORDER: ${GEN_OSCP} ${GEN_OCSP}: ocsp.asn1 ocsp.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} ocsp_asn1 +.ORDER: ${GEN_PKCS10} ${GEN_PKCS10}: pkcs10.asn1 pkcs10.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} pkcs10_asn1 +.ORDER: ${GEN_CRMF} ${GEN_CRMF}: crmf.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} crmf_asn1 From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 20:53:30 2014 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 ESMTPS id BEC1B7DA; Thu, 20 Feb 2014 20:53:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBC81E00; Thu, 20 Feb 2014 20:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KKrUrl049231; Thu, 20 Feb 2014 20:53:30 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KKrTgK049227; Thu, 20 Feb 2014 20:53:29 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402202053.s1KKrTgK049227@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 20:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262255 - in head/kerberos5/lib: libasn1 libgssapi_spnego libhdb libhx509 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 20:53:30 -0000 Author: peter Date: Thu Feb 20 20:53:29 2014 New Revision: 262255 URL: http://svnweb.freebsd.org/changeset/base/262255 Log: Revert my commit in r261253; the real problem was tackled in r262209. Modified: head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_spnego/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libhx509/Makefile Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Thu Feb 20 20:51:27 2014 (r262254) +++ head/kerberos5/lib/libasn1/Makefile Thu Feb 20 20:53:29 2014 (r262255) @@ -112,10 +112,10 @@ ${GEN_KX509}: kx509.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .include Modified: head/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_spnego/Makefile Thu Feb 20 20:51:27 2014 (r262254) +++ head/kerberos5/lib/libgssapi_spnego/Makefile Thu Feb 20 20:53:29 2014 (r262255) @@ -46,10 +46,10 @@ ${GEN}: spnego.asn1 spnego.opt .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .include Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Thu Feb 20 20:51:27 2014 (r262254) +++ head/kerberos5/lib/libhdb/Makefile Thu Feb 20 20:53:29 2014 (r262255) @@ -91,10 +91,10 @@ ${GEN}: hdb.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .include Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Thu Feb 20 20:51:27 2014 (r262254) +++ head/kerberos5/lib/libhx509/Makefile Thu Feb 20 20:53:29 2014 (r262255) @@ -286,10 +286,10 @@ ${GEN_CRMF}: crmf.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cat ${.IMPSRC} > ${.TARGET} + cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} .include From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 21:02:00 2014 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 ESMTPS id 60901F24; Thu, 20 Feb 2014 21:02:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 495A71030; Thu, 20 Feb 2014 21:02:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KL20oF053382; Thu, 20 Feb 2014 21:02:00 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KL20r0053381; Thu, 20 Feb 2014 21:02:00 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402202102.s1KL20r0053381@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 20 Feb 2014 21:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262256 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 21:02:00 -0000 Author: ae Date: Thu Feb 20 21:01:59 2014 New Revision: 262256 URL: http://svnweb.freebsd.org/changeset/base/262256 Log: MFC r261835: Drop packets to multicast address whose scop field contains the reserved value 0. Sponsored by: Yandex LLC Modified: stable/10/sys/netinet6/ip6_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_input.c ============================================================================== --- stable/10/sys/netinet6/ip6_input.c Thu Feb 20 20:53:29 2014 (r262255) +++ stable/10/sys/netinet6/ip6_input.c Thu Feb 20 21:01:59 2014 (r262256) @@ -571,7 +571,18 @@ ip6_input(struct mbuf *m) in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } - + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && + IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) { + /* + * RFC4291 2.7: + * Nodes must not originate a packet to a multicast address + * whose scop field contains the reserved value 0; if such + * a packet is received, it must be silently dropped. + */ + IP6STAT_INC(ip6s_badscope); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); + goto bad; + } #ifdef ALTQ if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) { /* packet is dropped by traffic conditioner */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 21:02:25 2014 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 ESMTPS id 1A62BE4; Thu, 20 Feb 2014 21:02:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 052991038; Thu, 20 Feb 2014 21:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KL2OYd053485; Thu, 20 Feb 2014 21:02:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KL2Of4053484; Thu, 20 Feb 2014 21:02:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402202102.s1KL2Of4053484@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 20 Feb 2014 21:02:24 +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: r262257 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 21:02:25 -0000 Author: ae Date: Thu Feb 20 21:02:24 2014 New Revision: 262257 URL: http://svnweb.freebsd.org/changeset/base/262257 Log: MFC r261835: Drop packets to multicast address whose scop field contains the reserved value 0. Sponsored by: Yandex LLC Modified: stable/9/sys/netinet6/ip6_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Thu Feb 20 21:01:59 2014 (r262256) +++ stable/9/sys/netinet6/ip6_input.c Thu Feb 20 21:02:24 2014 (r262257) @@ -558,7 +558,18 @@ ip6_input(struct mbuf *m) in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } - + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && + IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) { + /* + * RFC4291 2.7: + * Nodes must not originate a packet to a multicast address + * whose scop field contains the reserved value 0; if such + * a packet is received, it must be silently dropped. + */ + IP6STAT_INC(ip6s_badscope); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); + goto bad; + } #ifdef ALTQ if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) { /* packet is dropped by traffic conditioner */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 21:36:05 2014 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 ESMTPS id BFAA57E; Thu, 20 Feb 2014 21:36:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8D741348; Thu, 20 Feb 2014 21:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KLa5MT066524; Thu, 20 Feb 2014 21:36:05 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KLa5wH066523; Thu, 20 Feb 2014 21:36:05 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201402202136.s1KLa5wH066523@svn.freebsd.org> From: Mateusz Guzik Date: Thu, 20 Feb 2014 21:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262259 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 21:36:05 -0000 Author: mjg Date: Thu Feb 20 21:36:05 2014 New Revision: 262259 URL: http://svnweb.freebsd.org/changeset/base/262259 Log: MFC r260233: Plug a memory leak in dup2 when both old and new fd have ioctl caps. Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Thu Feb 20 21:32:24 2014 (r262258) +++ stable/10/sys/kern/kern_descrip.c Thu Feb 20 21:36:05 2014 (r262259) @@ -879,6 +879,7 @@ do_dup(struct thread *td, int flags, int /* * Duplicate the source descriptor. */ + filecaps_free(&newfde->fde_caps); *newfde = *oldfde; filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps); if ((flags & DUP_CLOEXEC) != 0) From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 21:52:40 2014 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 ESMTPS id A711F720; Thu, 20 Feb 2014 21:52:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77F101517; Thu, 20 Feb 2014 21:52:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KLqepq073894; Thu, 20 Feb 2014 21:52:40 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KLqe9s073893; Thu, 20 Feb 2014 21:52:40 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201402202152.s1KLqe9s073893@svn.freebsd.org> From: Mateusz Guzik Date: Thu, 20 Feb 2014 21:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262260 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 21:52:40 -0000 Author: mjg Date: Thu Feb 20 21:52:39 2014 New Revision: 262260 URL: http://svnweb.freebsd.org/changeset/base/262260 Log: MFC r259330,r259331: rlimit: add and utilize lim_shared rlimit: avoid unnecessary copying of rlimits If refcount is 1 just modify rlimits in place. Modified: stable/10/sys/kern/kern_resource.c Modified: stable/10/sys/kern/kern_resource.c ============================================================================== --- stable/10/sys/kern/kern_resource.c Thu Feb 20 21:36:05 2014 (r262259) +++ stable/10/sys/kern/kern_resource.c Thu Feb 20 21:52:39 2014 (r262260) @@ -80,6 +80,8 @@ static int donice(struct thread *td, str static struct uidinfo *uilookup(uid_t uid); static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); +static __inline int lim_shared(struct plimit *limp); + /* * Resource controls and accounting. */ @@ -677,21 +679,29 @@ kern_proc_setrlimit(struct thread *td, s limp->rlim_max = RLIM_INFINITY; oldssiz.rlim_cur = 0; - newlim = lim_alloc(); + newlim = NULL; PROC_LOCK(p); + if (lim_shared(p->p_limit)) { + PROC_UNLOCK(p); + newlim = lim_alloc(); + PROC_LOCK(p); + } oldlim = p->p_limit; alimp = &oldlim->pl_rlimit[which]; if (limp->rlim_cur > alimp->rlim_max || limp->rlim_max > alimp->rlim_max) if ((error = priv_check(td, PRIV_PROC_SETRLIMIT))) { PROC_UNLOCK(p); - lim_free(newlim); + if (newlim != NULL) + lim_free(newlim); return (error); } if (limp->rlim_cur > limp->rlim_max) limp->rlim_cur = limp->rlim_max; - lim_copy(newlim, oldlim); - alimp = &newlim->pl_rlimit[which]; + if (newlim != NULL) { + lim_copy(newlim, oldlim); + alimp = &newlim->pl_rlimit[which]; + } switch (which) { @@ -741,9 +751,11 @@ kern_proc_setrlimit(struct thread *td, s if (p->p_sysent->sv_fixlimit != NULL) p->p_sysent->sv_fixlimit(limp, which); *alimp = *limp; - p->p_limit = newlim; + if (newlim != NULL) + p->p_limit = newlim; PROC_UNLOCK(p); - lim_free(oldlim); + if (newlim != NULL) + lim_free(oldlim); if (which == RLIMIT_STACK) { /* @@ -1129,6 +1141,14 @@ lim_hold(limp) return (limp); } +static __inline int +lim_shared(limp) + struct plimit *limp; +{ + + return (limp->pl_refcnt > 1); +} + void lim_fork(struct proc *p1, struct proc *p2) { @@ -1162,7 +1182,7 @@ lim_copy(dst, src) struct plimit *dst, *src; { - KASSERT(dst->pl_refcnt == 1, ("lim_copy to shared limit")); + KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit)); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 22:39:58 2014 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 ESMTPS id A95AF9DF; Thu, 20 Feb 2014 22:39:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9027F18E8; Thu, 20 Feb 2014 22:39:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KMdw85091425; Thu, 20 Feb 2014 22:39:58 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KMdtfN091407; Thu, 20 Feb 2014 22:39:55 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402202239.s1KMdtfN091407@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 20 Feb 2014 22:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262266 - in vendor/dma: . dist dist/debian dist/debian/migrate dist/debian/source dist/test 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 22:39:58 -0000 Author: bapt Date: Thu Feb 20 22:39:55 2014 New Revision: 262266 URL: http://svnweb.freebsd.org/changeset/base/262266 Log: Import dma 89702b7f14 (2013-02-13) into vendors Added: vendor/dma/ vendor/dma/dist/ vendor/dma/dist/BSDmakefile vendor/dma/dist/INSTALL vendor/dma/dist/LICENSE vendor/dma/dist/Makefile (contents, props changed) vendor/dma/dist/Makefile.etc (contents, props changed) vendor/dma/dist/README.markdown vendor/dma/dist/TODO vendor/dma/dist/VERSION vendor/dma/dist/aliases_parse.y vendor/dma/dist/aliases_scan.l vendor/dma/dist/auth.conf (contents, props changed) vendor/dma/dist/base64.c (contents, props changed) vendor/dma/dist/conf.c (contents, props changed) vendor/dma/dist/crypto.c (contents, props changed) vendor/dma/dist/debian/ vendor/dma/dist/debian/NEWS vendor/dma/dist/debian/README.Debian vendor/dma/dist/debian/changelog vendor/dma/dist/debian/compat vendor/dma/dist/debian/control vendor/dma/dist/debian/copyright vendor/dma/dist/debian/dma-migrate.dirs vendor/dma/dist/debian/dma-migrate.install vendor/dma/dist/debian/dma-migrate.manpages vendor/dma/dist/debian/dma.dirs vendor/dma/dist/debian/dma.links vendor/dma/dist/debian/dma.lintian-overrides vendor/dma/dist/debian/migrate/ vendor/dma/dist/debian/migrate/Makefile (contents, props changed) vendor/dma/dist/debian/migrate/NEWS vendor/dma/dist/debian/migrate/dma-migrate.8 (contents, props changed) vendor/dma/dist/debian/migrate/dma-migrate.c (contents, props changed) vendor/dma/dist/debian/rules (contents, props changed) vendor/dma/dist/debian/source/ vendor/dma/dist/debian/source/format vendor/dma/dist/debian/source/options vendor/dma/dist/dfcompat.c (contents, props changed) vendor/dma/dist/dfcompat.h (contents, props changed) vendor/dma/dist/dma-mbox-create.c (contents, props changed) vendor/dma/dist/dma.8 (contents, props changed) vendor/dma/dist/dma.c (contents, props changed) vendor/dma/dist/dma.conf (contents, props changed) vendor/dma/dist/dma.h (contents, props changed) vendor/dma/dist/dns.c (contents, props changed) vendor/dma/dist/get-version.sh (contents, props changed) vendor/dma/dist/local.c (contents, props changed) vendor/dma/dist/mail.c (contents, props changed) vendor/dma/dist/net.c (contents, props changed) vendor/dma/dist/spool.c (contents, props changed) vendor/dma/dist/test/ vendor/dma/dist/test/quote.rfc2822 vendor/dma/dist/util.c (contents, props changed) Added: vendor/dma/dist/BSDmakefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/BSDmakefile Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,28 @@ +# $DragonFly: src/libexec/dma/Makefile,v 1.5 2008/09/19 00:36:57 corecode Exp $ +# + +version!= sh get-version.sh + +CFLAGS+= -I${.CURDIR} +CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME +CFLAGS+= -DLIBEXEC_PATH='"${LIBEXEC}"' -DDMA_VERSION='"${version}"' +CFLAGS+= -DCONF_PATH='"${CONFDIR}"' + +DPADD= ${LIBSSL} ${LIBCRYPTO} +LDADD= -lssl -lcrypto + +PROG= dma +SRCS= aliases_parse.y aliases_scan.l base64.c conf.c crypto.c +SRCS+= dma.c dns.c local.c mail.c net.c spool.c util.c +MAN= dma.8 + +PREFIX?= /usr/local +LIBEXEC?= ${PREFIX}/libexec +CONFDIR?= ${PREFIX}/etc/dma + +BINOWN= root +BINGRP= mail +BINMODE=2555 +WARNS?= 6 + +.include Added: vendor/dma/dist/INSTALL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/INSTALL Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,28 @@ +Installing DMA: +=============== + +On most systems (with a development environment installed) you should be able to compile DMA with: + make + +Once it have compiled it successfully, you can install it with: + make install sendmail-link mailq-link install-spool-dirs install-etc + +Troubleshooting: +---------------- +On systems that do not default to a compatible "make" version, try using "gmake" or "pmake" instead of "make". Some known examples of this: +* Solaris 9 +* Solaris 10 + +Check that you have the following commands installed: +* cc - gcc is known to work +* lex - flex is known to work +* yacc - bison is kjnown to work +* make - BSD make and GNU make is knwon to work +* sh - Need to be POSIX compliant, dash, bash known to work +* install - GNU and BSD versions known to work +* openssl - Add the header location to C_INCLUDE_PATH if you get errors about "err.h" + +If you have all of these tools installed, set the CC, YACC, INSTALL, LEX and SH variable to point to the relevant location and command. + +Example: + make CC=gcc YACC=bison LEX=/usr/bin/flex SH=/bin/bash INSTALL=/usr/bin/install Added: vendor/dma/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/LICENSE Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,109 @@ +Copyright (c) 2008 The DragonFly Project. +Copyright (c) 2008-2011, Simon Schubert <2@0x2c.org>. +All rights reserved. + +This code is derived from software contributed to The DragonFly Project +by Simon Schubert <2@0x2c.org>. + +This code is derived from software contributed to The DragonFly Project +by Matthias Schmidt , University of Marburg, +Germany. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +3. Neither the name of The DragonFly Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific, prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + +Copyright (c) 1995-2001 Kungliga Tekniska Högskolan +(Royal Institute of Technology, Stockholm, Sweden). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + +Copyright (c) 1998 Todd C. Miller + +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. + + +Copyright (c) 1998, M. Warner Losh +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY 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. Added: vendor/dma/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/Makefile Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,111 @@ +# +# Depending on your operating system, you might want to influence +# the conditional inclusion of some helper functions: +# +# Define HAVE_* (in caps) if your system already provides: +# reallocf +# strlcpy +# getprogname +# + +SH?= sh + +version= $(shell ${SH} get-version.sh) +debversion= $(shell ${SH} get-version.sh | sed -Ee 's/^v//;s/[.]([[:digit:]]+)[.](g[[:xdigit:]]+)$$/+\1+\2/') + +CC?= gcc +CFLAGS?= -O -pipe +LDADD?= -lssl -lcrypto -lresolv + +CFLAGS+= -Wall -DDMA_VERSION='"${version}"' -DLIBEXEC_PATH='"${LIBEXEC}"' -DCONF_PATH='"${CONFDIR}"' + +INSTALL?= install -p +CHGRP?= chgrp +CHMOD?= chmod + +PREFIX?= /usr/local +SBIN?= ${PREFIX}/sbin +LIBEXEC?= ${PREFIX}/lib +CONFDIR?= /etc/dma +MAN?= ${PREFIX}/share/man +VAR?= /var +DMASPOOL?= ${VAR}/spool/dma +VARMAIL?= ${VAR}/mail +SYMLINK?= -s # or empty to create hard link + +YACC?= yacc +LEX?= lex +LN?= ln + +OBJS= aliases_parse.o aliases_scan.o base64.o conf.o crypto.o +OBJS+= dma.o dns.o local.o mail.o net.o spool.o util.o +OBJS+= dfcompat.o + +all: dma dma-mbox-create + +clean: + -rm -f .depend dma dma-mbox-create *.[do] + -rm -f aliases_parse.[ch] aliases_scan.c + +install: all + ${INSTALL} -d ${DESTDIR}${SBIN} + ${INSTALL} -d ${DESTDIR}${MAN}/man8 ${DESTDIR}${LIBEXEC} + ${INSTALL} -m 2755 -o root -g mail dma ${DESTDIR}${SBIN} + ${INSTALL} -m 4754 -o root -g mail dma-mbox-create ${DESTDIR}${LIBEXEC} + ${INSTALL} -m 0644 dma.8 ${DESTDIR}${MAN}/man8/ + +sendmail-link: + cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma sendmail + +mailq-link: + cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma mailq + +install-spool-dirs: + ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${DMASPOOL} + ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${VARMAIL} + +permissions: + -${CHGRP} mail ${DESTDIR}${VARMAIL}/* + -${CHMOD} g+w ${DESTDIR}${VARMAIL}/* + -${CHMOD} 660 ${DESTDIR}${DMASPOOL}/flush + +install-etc: + ${INSTALL} -d ${DESTDIR}${CONFDIR} + @if [ -e ${DESTDIR}${CONFDIR}/dma.conf ]; then \ + echo "Not overwriting ${DESTDIR}${CONFDIR}/dma.conf."; \ + else \ + echo ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \ + ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \ + fi + @if [ -e ${DESTDIR}${CONFDIR}/auth.conf ]; then \ + echo "Not overwriting ${DESTDIR}${CONFDIR}/auth.conf."; \ + else \ + echo ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \ + ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \ + fi + +aliases_parse.c: aliases_parse.y + ${YACC} -d -o aliases_parse.c aliases_parse.y + +aliases_scan.c: aliases_scan.l + ${LEX} -t aliases_scan.l > aliases_scan.c + +.SUFFIXES: .c .o + +.c.o: + ${CC} ${CFLAGS} ${CPPFLAGS} -include dfcompat.h -o $@ -c $< + +dma: ${OBJS} + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} + + +dch: + dch --release-heuristic changelog -v ${debversion} + + +ppa: + @if [ -z '${DEB_DIST}' ]; then echo "please set DEB_DIST to build"; exit 1; fi + dch -v "${debversion}~${DEB_DIST}" -D ${DEB_DIST} "${DEB_DIST} build" -b + debuild -S -sa + ver=$$(dpkg-parsechangelog -n1 | awk '$$1 == "Version:" { print $$2 }'); \ + dput ppa:corecode/dma ../dma_$${ver}_source.changes Added: vendor/dma/dist/Makefile.etc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/Makefile.etc Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,15 @@ +# $DragonFly: src/etc/dma/Makefile,v 1.3 2008/02/12 22:10:20 matthias Exp $ + +FILESDIR= /etc/dma +SHAREOWN= root +SHAREGRP= mail +FILESMODE= 640 + +.if !exists(${DESTDIR}/etc/dma/auth.conf) +FILES+= auth.conf +.endif +.if !exists(${DESTDIR}/etc/dma/dma.conf) +FILES+= dma.conf +.endif + +.include Added: vendor/dma/dist/README.markdown ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/README.markdown Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,32 @@ +dma -- DragonFly Mail Agent +=========================== + +dma is a small Mail Transport Agent (MTA), designed for home and +office use. It accepts mails from locally installed Mail User Agents (MUA) +and delivers the mails either locally or to a remote destination. +Remote delivery includes several features like TLS/SSL support and +SMTP authentication. + +dma is not intended as a replacement for real, big MTAs like sendmail(8) +or postfix(1). Consequently, dma does not listen on port 25 for +incoming connections. + + +Building +-------- + + make + + +Installation +------------ + + make install sendmail-link mailq-link install-spool-dirs install-etc + +See INSTALL for requirements and configuration options. + + +Contact +------- + +Simon Schubert <2@0x2c.org> Added: vendor/dma/dist/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/TODO Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,5 @@ +- unquote/handle quoted local recipients +- use proper sysexit codes +- handle/use ESMTP extensions +- .forward support +- suggest way to run a queue flush on boot Added: vendor/dma/dist/VERSION ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/VERSION Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1 @@ +v0.9 Added: vendor/dma/dist/aliases_parse.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/aliases_parse.y Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,112 @@ +%{ + +#include +#include +#include +#include "dma.h" + +extern int yylineno; +static void yyerror(const char *); +int yywrap(void); +int yylex(void); + +static void +yyerror(const char *msg) +{ + /** + * Because we do error '\n' below, we need to report the error + * one line above of what yylineno points to. + */ + syslog(LOG_CRIT, "aliases line %d: %s", yylineno - 1, msg); + fprintf(stderr, "aliases line %d: %s\n", yylineno - 1, msg); +} + +int +yywrap(void) +{ + return (1); +} + +%} + +%union { + char *ident; + struct stritem *strit; + struct alias *alias; +} + +%token T_IDENT +%token T_ERROR +%token T_EOF 0 + +%type dests +%type alias aliases + +%% + +start : aliases T_EOF + { + LIST_FIRST(&aliases) = $1; + } + +aliases : /* EMPTY */ + { + $$ = NULL; + } + | alias aliases + { + if ($2 != NULL && $1 != NULL) + LIST_INSERT_AFTER($2, $1, next); + else if ($2 == NULL) + $2 = $1; + $$ = $2; + } + ; + +alias : T_IDENT ':' dests '\n' + { + struct alias *al; + + if ($1 == NULL) + YYABORT; + al = calloc(1, sizeof(*al)); + if (al == NULL) + YYABORT; + al->alias = $1; + SLIST_FIRST(&al->dests) = $3; + $$ = al; + } + | error '\n' + { + YYABORT; + } + ; + +dests : T_IDENT + { + struct stritem *it; + + if ($1 == NULL) + YYABORT; + it = calloc(1, sizeof(*it)); + if (it == NULL) + YYABORT; + it->str = $1; + $$ = it; + } + | T_IDENT ',' dests + { + struct stritem *it; + + if ($1 == NULL) + YYABORT; + it = calloc(1, sizeof(*it)); + if (it == NULL) + YYABORT; + it->str = $1; + SLIST_NEXT(it, next) = $3; + $$ = it; + } + ; + +%% Added: vendor/dma/dist/aliases_scan.l ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/aliases_scan.l Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,24 @@ +%{ + +#include +#include "aliases_parse.h" + +#define YY_NO_INPUT + +int yylex(void); +%} + +%option yylineno +%option nounput + +%% + +[^:,#[:space:][:cntrl:]]+ {yylval.ident = strdup(yytext); return T_IDENT;} +^([[:blank:]]*(#.*)?\n)+ ;/* ignore empty lines */ +[:,\n] return yytext[0]; +(\n?[[:blank:]]+|#.*)+ ;/* ignore whitespace and continuation */ +\\\n ;/* ignore continuation. not allowed in comments */ +. return T_ERROR; +<> return T_EOF; + +%% Added: vendor/dma/dist/auth.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/auth.conf Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,4 @@ +# $DragonFly: src/etc/dma/auth.conf,v 1.1 2008/02/02 18:24:00 matthias Exp $ +# +# SMTP authentication entries (currently AUTH LOGIN only) +# Format: user|my.smarthost.example.com:password Added: vendor/dma/dist/base64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/base64.c Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1995-2001 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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 "dma.h" + +static char base64_chars[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static int +pos(char c) +{ + char *p; + for (p = base64_chars; *p; p++) + if (*p == c) + return p - base64_chars; + return -1; +} + + +int +base64_encode(const void *data, int size, char **str) +{ + char *s, *p; + int i; + int c; + const unsigned char *q; + + p = s = (char *) malloc(size * 4 / 3 + 4); + if (p == NULL) + return -1; + q = (const unsigned char *) data; + i = 0; + for (i = 0; i < size;) { + c = q[i++]; + c *= 256; + if (i < size) + c += q[i]; + i++; + c *= 256; + if (i < size) + c += q[i]; + i++; + p[0] = base64_chars[(c & 0x00fc0000) >> 18]; + p[1] = base64_chars[(c & 0x0003f000) >> 12]; + p[2] = base64_chars[(c & 0x00000fc0) >> 6]; + p[3] = base64_chars[(c & 0x0000003f) >> 0]; + if (i > size) + p[3] = '='; + if (i > size + 1) + p[2] = '='; + p += 4; + } + *p = 0; + *str = s; + return strlen(s); +} + +#define DECODE_ERROR 0xffffffff + +static unsigned int +token_decode(const char *token) +{ + int i; + unsigned int val = 0; + int marker = 0; + if (strlen(token) < 4) + return DECODE_ERROR; + for (i = 0; i < 4; i++) { + val *= 64; + if (token[i] == '=') + marker++; + else if (marker > 0) + return DECODE_ERROR; + else + val += pos(token[i]); + } + if (marker > 2) + return DECODE_ERROR; + return (marker << 24) | val; +} + +int +base64_decode(const char *str, void *data) +{ + const char *p; + unsigned char *q; + + q = data; + for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) { + unsigned int val = token_decode(p); + unsigned int marker = (val >> 24) & 0xff; + if (val == DECODE_ERROR) + return -1; + *q++ = (val >> 16) & 0xff; + if (marker < 2) + *q++ = (val >> 8) & 0xff; + if (marker < 1) + *q++ = val & 0xff; + } + return q - (unsigned char *) data; +} + Added: vendor/dma/dist/conf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/conf.c Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Matthias Schmidt , University of Marburg, + * Germany. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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 +#include +#include +#include + +#include "dma.h" + +#define DP ": \t" +#define EQS " \t" + + +/* + * Remove trailing \n's + */ +void +trim_line(char *line) +{ + size_t linelen; + char *p; + + if ((p = strchr(line, '\n'))) + *p = (char)0; + + /* Escape leading dot in every case */ + linelen = strlen(line); + if (line[0] == '.') { + if ((linelen + 2) > 1000) { + syslog(LOG_CRIT, "Cannot escape leading dot. Buffer overflow"); + exit(1); + } + memmove((line + 1), line, (linelen + 1)); + line[0] = '.'; + } +} + +static void +chomp(char *str) +{ + size_t len = strlen(str); + + if (len == 0) + return; + if (str[len - 1] == '\n') + str[len - 1] = 0; +} + +/* + * Read the SMTP authentication config file + * + * file format is: + * user|host:password + * + * A line starting with # is treated as comment and ignored. + */ +void +parse_authfile(const char *path) +{ + char line[2048]; + struct authuser *au; + FILE *a; + char *data; + int lineno = 0; + + a = fopen(path, "r"); + if (a == NULL) { + errlog(1, "can not open auth file `%s'", path); + /* NOTREACHED */ + } + + while (!feof(a)) { + if (fgets(line, sizeof(line), a) == NULL) + break; + lineno++; + + chomp(line); + + /* We hit a comment */ + if (*line == '#') + continue; + /* Ignore empty lines */ + if (*line == 0) + continue; + + au = calloc(1, sizeof(*au)); + if (au == NULL) + errlog(1, NULL); + + data = strdup(line); + au->login = strsep(&data, "|"); + au->host = strsep(&data, DP); + au->password = data; + + if (au->login == NULL || + au->host == NULL || + au->password == NULL) { + errlogx(1, "syntax error in authfile %s:%d", + path, lineno); + /* NOTREACHED */ + } + + SLIST_INSERT_HEAD(&authusers, au, next); + } + + fclose(a); +} + +/* + * XXX TODO + * Check for bad things[TM] + */ +void +parse_conf(const char *config_path) +{ + char *word; + char *data; + FILE *conf; + char line[2048]; + int lineno = 0; + + conf = fopen(config_path, "r"); + if (conf == NULL) { + /* Don't treat a non-existing config file as error */ + if (errno == ENOENT) + return; + errlog(1, "can not open config `%s'", config_path); + /* NOTREACHED */ + } + + while (!feof(conf)) { + if (fgets(line, sizeof(line), conf) == NULL) + break; + lineno++; + + chomp(line); + + /* We hit a comment */ + if (strchr(line, '#')) + *strchr(line, '#') = 0; + + data = line; + word = strsep(&data, EQS); + + /* Ignore empty lines */ + if (word == NULL || *word == 0) + continue; + + if (data != NULL && *data != 0) + data = strdup(data); + else + data = NULL; + + if (strcmp(word, "SMARTHOST") == 0 && data != NULL) + config.smarthost = data; + else if (strcmp(word, "PORT") == 0 && data != NULL) + config.port = atoi(data); + else if (strcmp(word, "ALIASES") == 0 && data != NULL) + config.aliases = data; + else if (strcmp(word, "SPOOLDIR") == 0 && data != NULL) + config.spooldir = data; + else if (strcmp(word, "AUTHPATH") == 0 && data != NULL) + config.authpath= data; + else if (strcmp(word, "CERTFILE") == 0 && data != NULL) + config.certfile = data; + else if (strcmp(word, "MAILNAME") == 0 && data != NULL) + config.mailname = data; + else if (strcmp(word, "MASQUERADE") == 0 && data != NULL) { + char *user = NULL, *host = NULL; + if (strrchr(data, '@')) { + host = strrchr(data, '@'); + *host = 0; + host++; + user = data; + } else { + host = data; + } + if (host && *host == 0) + host = NULL; + if (user && *user == 0) + user = NULL; + config.masquerade_host = host; + config.masquerade_user = user; + } else if (strcmp(word, "STARTTLS") == 0 && data == NULL) + config.features |= STARTTLS; + else if (strcmp(word, "OPPORTUNISTIC_TLS") == 0 && data == NULL) + config.features |= TLS_OPP; + else if (strcmp(word, "SECURETRANSFER") == 0 && data == NULL) + config.features |= SECURETRANS; + else if (strcmp(word, "DEFER") == 0 && data == NULL) + config.features |= DEFER; + else if (strcmp(word, "INSECURE") == 0 && data == NULL) + config.features |= INSECURE; + else if (strcmp(word, "FULLBOUNCE") == 0 && data == NULL) + config.features |= FULLBOUNCE; + else if (strcmp(word, "NULLCLIENT") == 0 && data == NULL) + config.features |= NULLCLIENT; + else { + errlogx(1, "syntax error in %s:%d", config_path, lineno); + /* NOTREACHED */ + } + } + + if ((config.features & NULLCLIENT) && config.smarthost == NULL) { + errlogx(1, "%s: NULLCLIENT requires SMARTHOST", config_path); + /* NOTREACHED */ + } + + fclose(conf); +} Added: vendor/dma/dist/crypto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/dist/crypto.c Thu Feb 20 22:39:55 2014 (r262266) @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Matthias Schmidt , University of Marburg, + * Germany. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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 +#include +#include + +#include + +#include "dma.h" + +static int +init_cert_file(SSL_CTX *ctx, const char *path) +{ + int error; + + /* Load certificate into ctx */ + error = SSL_CTX_use_certificate_chain_file(ctx, path); + if (error < 1) { + syslog(LOG_ERR, "SSL: Cannot load certificate `%s': %s", path, ssl_errstr()); + return (-1); + } + + /* Add private key to ctx */ + error = SSL_CTX_use_PrivateKey_file(ctx, path, SSL_FILETYPE_PEM); + if (error < 1) { + syslog(LOG_ERR, "SSL: Cannot load private key `%s': %s", path, ssl_errstr()); + return (-1); + } + + /* + * Check the consistency of a private key with the corresponding + * certificate + */ + error = SSL_CTX_check_private_key(ctx); + if (error < 1) { + syslog(LOG_ERR, "SSL: Cannot check private key: %s", ssl_errstr()); + return (-1); + } + + return (0); +} + +int +smtp_init_crypto(int fd, int feature) +{ + SSL_CTX *ctx = NULL; +#if (OPENSSL_VERSION_NUMBER >= 0x00909000L) + const SSL_METHOD *meth = NULL; +#else + SSL_METHOD *meth = NULL; +#endif + X509 *cert; + int error; + + /* XXX clean up on error/close */ + /* Init SSL library */ + SSL_library_init(); + SSL_load_error_strings(); + + meth = TLSv1_client_method(); + + ctx = SSL_CTX_new(meth); + if (ctx == NULL) { + syslog(LOG_WARNING, "remote delivery deferred: SSL init failed: %s", ssl_errstr()); + return (1); + } + + /* User supplied a certificate */ + if (config.certfile != NULL) { + error = init_cert_file(ctx, config.certfile); + if (error) { + syslog(LOG_WARNING, "remote delivery deferred"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 22:41:07 2014 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 ESMTPS id 67E03BF2; Thu, 20 Feb 2014 22:41:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B55318F6; Thu, 20 Feb 2014 22:41:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KMf7Sx092496; Thu, 20 Feb 2014 22:41:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KMf79s092495; Thu, 20 Feb 2014 22:41:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402202241.s1KMf79s092495@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 20 Feb 2014 22:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262267 - vendor/dma/20140213 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 22:41:07 -0000 Author: bapt Date: Thu Feb 20 22:41:06 2014 New Revision: 262267 URL: http://svnweb.freebsd.org/changeset/base/262267 Log: Tag dma 20140213 Added: vendor/dma/20140213/ - copied from r262266, vendor/dma/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Feb 20 23:43:50 2014 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 ESMTPS id 3C6B8466; Thu, 20 Feb 2014 23:43:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28B2A1F8C; Thu, 20 Feb 2014 23:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KNhowY019120; Thu, 20 Feb 2014 23:43:50 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KNhoJR019119; Thu, 20 Feb 2014 23:43:50 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402202343.s1KNhoJR019119@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 23:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262273 - head/etc/periodic/security 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.17 Precedence: list List-Id: "SVN commit messages 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, 20 Feb 2014 23:43:50 -0000 Author: brueffer Date: Thu Feb 20 23:43:49 2014 New Revision: 262273 URL: http://svnweb.freebsd.org/changeset/base/262273 Log: Further refine the auth fail regex to catch more auth failures and reduce false positives. The committed patch was provided by Christian Marg. PR: 91732 Submitted by: Daniel O'Connor Skye Poier Alan Amesbury Christian Marg MFC after: 1 month Modified: head/etc/periodic/security/800.loginfail Modified: head/etc/periodic/security/800.loginfail ============================================================================== --- head/etc/periodic/security/800.loginfail Thu Feb 20 23:18:30 2014 (r262272) +++ head/etc/periodic/security/800.loginfail Thu Feb 20 23:43:49 2014 (r262273) @@ -64,7 +64,7 @@ if check_yesno_period security_status_lo then echo "" echo "${host} login failures:" - n=$(catmsgs | egrep -ia "^$yesterday.*: .*(fail|invalid|bad|illegal)" | + n=$(catmsgs | egrep -ia "^$yesterday.*: .*\b(fail(ures?|ed)?|invalid|bad|illegal|auth.*error)\b" | tee /dev/stderr | wc -l) [ $n -gt 0 ] && rc=1 || rc=0 fi From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 01:15:27 2014 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 ESMTPS id 2F555E5B; Fri, 21 Feb 2014 01:15:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B25B18BF; Fri, 21 Feb 2014 01:15:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L1FQMw056588; Fri, 21 Feb 2014 01:15:26 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L1FQ5n056587; Fri, 21 Feb 2014 01:15:26 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201402210115.s1L1FQ5n056587@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 21 Feb 2014 01:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262274 - head/usr.sbin/bhyve 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 01:15:27 -0000 Author: tychon Date: Fri Feb 21 01:15:26 2014 New Revision: 262274 URL: http://svnweb.freebsd.org/changeset/base/262274 Log: Avoid clobbering the counter mode when issuing a latch command. Approved by: grehan (co-mentor) Modified: head/usr.sbin/bhyve/pit_8254.c Modified: head/usr.sbin/bhyve/pit_8254.c ============================================================================== --- head/usr.sbin/bhyve/pit_8254.c Thu Feb 20 23:43:49 2014 (r262273) +++ head/usr.sbin/bhyve/pit_8254.c Fri Feb 21 01:15:26 2014 (r262274) @@ -216,11 +216,12 @@ pit_8254_handler(struct vmctx *ctx, int c = &counter[sel >> 6]; c->ctx = ctx; - c->mode = mode; if (rw == TIMER_LATCH) pit_update_counter(c, 1); - else + else { + c->mode = mode; c->olbyte = 0; /* reset latch after reprogramming */ + } return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 01:55:01 2014 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 ESMTPS id E2EF1D51; Fri, 21 Feb 2014 01:55:01 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6615A1B8D; Fri, 21 Feb 2014 01:55:01 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 99DCF14847; Thu, 20 Feb 2014 17:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1392947700; bh=IrDdKseFeAWCgSSrP4JExdaVt8VUxuXbLvLy8wVIMiE=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=gxjT1EH1IwydERmzuP2gMd0MswxrVwlKuAVbxaBkIB1YS0NxzlCjtZ2xUSGoJrtLJ UJOD4aeOz0HvVPsrjPQ6vU4jrFQ7+GPqbMoaKaIcmJLH0lhLBRuI+YMR9lKPJjtqQo ANbyeHVgcQBYlhJRoR9WdAgzFOQ6PIMviBJqix40= Message-ID: <5306B1F3.4060107@delphij.net> Date: Thu, 20 Feb 2014 17:54:59 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r262266 - in vendor/dma: . dist dist/debian dist/debian/migrate dist/debian/source dist/test References: <201402202239.s1KMdtfN091407@svn.freebsd.org> In-Reply-To: <201402202239.s1KMdtfN091407@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages 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, 21 Feb 2014 01:55:02 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 02/20/14 14:39, Baptiste Daroussin wrote: > Author: bapt Date: Thu Feb 20 22:39:55 2014 New Revision: 262266 > URL: http://svnweb.freebsd.org/changeset/base/262266 > > Log: Import dma 89702b7f14 (2013-02-13) into vendors Are we going to remove sendmail? Personally I don't think it's a good idea to have two different delivery agents. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCgAGBQJTBrHzAAoJEJW2GBstM+nswM4P/AkX9HyfaUHGryv3WKprE6ef b4A9uKPzxTruUdj8Pg198ZjJo+KCu70s6PTXcPtD37lVnp8fv01OrU2VfwdVTxDr JPoGijxpjAlp+t8wDAxJFMPhG+G0yMceDg+fevFVfJUwHNfTaxyZFy25NLqbbxBI NarbWlOCXCHBg07g1fR5vRyZTuWcpJOq+SFq81gyDpNpA17w/DZPCXznbB9BbZ8f 4K7AxrXI9rtiC5JYGc0WIkpymt3Xo0pXbIovtTrctHl5FtgoGPi1ck7s6NMhBqt3 tr5WUN+J5rZLOUXGnKfPG+5zi6gl22wuFcx0J3m6tE2o0iXMGxadEoHmeMmbhv9l HBtuh6rPRHJzSdPcfuaCB2gK20fjX1o+DJHia+vaQFvjbpuAOTKkbwGxAQVsYoxO Bmltg8wamjG7bfMEk48lJIkPqVdWnkvHde23VG428+AN9h2w5+fXKqoChbIROoIQ tQOMW2mRuxM57TJCyRGb+yOhNJsQ08XMN7K2VcOD5E6BiIOq+jJVJSFJvfhfdLtD uRYjGZTQ04w21VbdOWnFGD+P2PxZG1DJGNDzz64rAMcqW4oaxnyY1vBgl7Ori5zX +Ltu32ySsv3OwA4vx4X7rJX1+dGLWVZZlLgY3jFuOeWd3AJCyHP76+0GjwtT+3Gg quciD53LQUg5skHNJx+j =5VB2 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 03:36:17 2014 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 ESMTPS id 8E915667; Fri, 21 Feb 2014 03:36:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 74577180B; Fri, 21 Feb 2014 03:36:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L3aHPf016406; Fri, 21 Feb 2014 03:36:17 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L3aHBG016405; Fri, 21 Feb 2014 03:36:17 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201402210336.s1L3aHBG016405@svn.freebsd.org> From: David Xu Date: Fri, 21 Feb 2014 03:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262277 - head/libexec/rtld-elf 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 03:36:17 -0000 Author: davidxu Date: Fri Feb 21 03:36:16 2014 New Revision: 262277 URL: http://svnweb.freebsd.org/changeset/base/262277 Log: malloc_aligned() may not leave enough space for pointer to allocated memory, saving the pointer will overwrite bytes belongs to another memory block unexpectly, to fix the problem, use (allocated address + sizeof(void *)) as initial value, and slip to next aligned address, so maximum extra bytes is sizeof(void *) + align - 1. Tested by: Andre Albsmeier < mail at ma17 dot ata dot myota dot orgndre > Modified: head/libexec/rtld-elf/xmalloc.c Modified: head/libexec/rtld-elf/xmalloc.c ============================================================================== --- head/libexec/rtld-elf/xmalloc.c Fri Feb 21 03:35:43 2014 (r262276) +++ head/libexec/rtld-elf/xmalloc.c Fri Feb 21 03:36:16 2014 (r262277) @@ -72,14 +72,14 @@ void * malloc_aligned(size_t size, size_t align) { void *mem, *res; - uintptr_t x; - size_t asize, r; - r = round(sizeof(void *), align); - asize = round(size, align) + r; - mem = xmalloc(asize); - x = (uintptr_t)mem; - res = (void *)round(x, align); + if (align & (sizeof(void *) -1)) { + rtld_fdputstr(STDERR_FILENO, "Invalid alignment\n"); + _exit(1); + } + + mem = xmalloc(size + sizeof(void *) + align - 1); + res = (void *)round((uintptr_t)mem + sizeof(void *), align); *(void **)((uintptr_t)res - sizeof(void *)) = mem; return (res); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 05:17:30 2014 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 ESMTPS id A8DAA653; Fri, 21 Feb 2014 05:17:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9278D1134; Fri, 21 Feb 2014 05:17:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L5HUfP055863; Fri, 21 Feb 2014 05:17:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L5HUts055862; Fri, 21 Feb 2014 05:17:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402210517.s1L5HUts055862@svn.freebsd.org> From: Warner Losh Date: Fri, 21 Feb 2014 05:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262278 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 05:17:30 -0000 Author: imp Date: Fri Feb 21 05:17:30 2014 New Revision: 262278 URL: http://svnweb.freebsd.org/changeset/base/262278 Log: Remove bogus blank line. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Feb 21 03:36:16 2014 (r262277) +++ head/sys/arm/arm/machdep.c Fri Feb 21 05:17:30 2014 (r262278) @@ -1167,7 +1167,6 @@ initarm(struct arm_boot_params *abp) (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - /* Map L1 directory and allocated L2 page tables */ pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 06:00:07 2014 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 ESMTPS id 2A301298; Fri, 21 Feb 2014 06:00:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 148B01441; Fri, 21 Feb 2014 06:00:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L607mv072234; Fri, 21 Feb 2014 06:00:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L606A9072223; Fri, 21 Feb 2014 06:00:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402210600.s1L606A9072223@svn.freebsd.org> From: Ian Lepore Date: Fri, 21 Feb 2014 06:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262280 - in head/sys: arm/freescale/imx boot/fdt/dts 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 06:00:07 -0000 Author: ian Date: Fri Feb 21 06:00:06 2014 New Revision: 262280 URL: http://svnweb.freebsd.org/changeset/base/262280 Log: Add basic cpu frequency control and temperature monitoring to imx6_anatop. The temperature monitor device is enabled to sample the die temperature at 16hz. The temperature is published via sysctl. A callout routine at 10hz monitors the temperature and throttles back the cpu if the temperature goes over a user-settable throttle point (by default 10C less than the critical high-point temperature for the chip). The hardware is supposed to be able to deliver an interrupt when the temperature exceeds a settable limit, but the interrupt never arrives so for now a callout does the job. At attach time we read the maximum cpu frequency the chip is allowed to run at and the cpu is set to run at that speed. It's reported at attach time. A sysctl variable reports the current speed when queried. New sysctl values: dev.imx6_anatop.0.cpu_mhz: 984 dev.imx6_anatop.0.temperature: 37.9C dev.imx6_anatop.0.throttle_temperature: 95.0C Steven Lawrance did the initial heavy lifting on this, but I changed enough stuff that I'm the one to blame if anything breaks. Submitted by: Steven Lawrance Modified: head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/freescale/imx/imx6_anatopreg.h head/sys/arm/freescale/imx/imx6_anatopvar.h head/sys/boot/fdt/dts/imx6.dtsi Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Feb 21 05:31:34 2014 (r262279) +++ head/sys/arm/freescale/imx/imx6_anatop.c Fri Feb 21 06:00:06 2014 (r262280) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2014 Steven Lawrance * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,6 +30,8 @@ __FBSDID("$FreeBSD$"); /* * Analog PLL and power regulator driver for Freescale i.MX6 family of SoCs. + * Also, temperature montoring and cpu frequency control. It was Freescale who + * kitchen-sinked this device, not us. :) * * We don't really do anything with analog PLLs, but the registers for * controlling them belong to the same block as the power regulator registers. @@ -42,11 +45,19 @@ __FBSDID("$FreeBSD$"); * I have no idea where the "anatop" name comes from. It's in the standard DTS * source describing i.MX6 SoCs, and in the linux and u-boot code which comes * from Freescale, but it's not in the SoC manual. + * + * Note that temperature values throughout this code are handled in two types of + * units. Items with '_cnt' in the name use the hardware temperature count + * units (higher counts are lower temperatures). Items with '_val' in the name + * are deci-Celcius, which are converted to/from deci-Kelvins in the sysctl + * handlers (dK is the standard unit for temperature in sysctl). */ #include #include +#include #include +#include #include #include #include @@ -56,68 +67,410 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include +static struct resource_spec imx6_anatop_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; +#define MEMRES 0 +#define IRQRES 1 + struct imx6_anatop_softc { device_t dev; - struct resource *mem_res; + struct resource *res[2]; + uint32_t cpu_curhz; + uint32_t cpu_curmhz; + uint32_t cpu_minhz; + uint32_t cpu_maxhz; + uint32_t refosc_hz; + void *temp_intrhand; + uint32_t temp_high_val; + uint32_t temp_high_cnt; + uint32_t temp_last_cnt; + uint32_t temp_room_cnt; + struct callout temp_throttle_callout; + sbintime_t temp_throttle_delay; + uint32_t temp_throttle_reset_cnt; + uint32_t temp_throttle_trigger_cnt; + uint32_t temp_throttle_val; }; static struct imx6_anatop_softc *imx6_anatop_sc; +/* + * Table of CPU max frequencies. This is indexed by the max frequency value + * (0-3) from the ocotp CFG3 register. + */ +static uint32_t imx6_cpu_maxhz_tab[] = { + 792000000, 852000000, 996000000, 1200000000 +}; + +#define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ + uint32_t imx6_anatop_read_4(bus_size_t offset) { - return (bus_read_4(imx6_anatop_sc->mem_res, offset)); + KASSERT(imx6_anatop_sc != NULL, ("imx6_anatop_read_4 sc NULL")); + + return (bus_read_4(imx6_anatop_sc->res[MEMRES], offset)); } void imx6_anatop_write_4(bus_size_t offset, uint32_t value) { - bus_write_4(imx6_anatop_sc->mem_res, offset, value); + KASSERT(imx6_anatop_sc != NULL, ("imx6_anatop_write_4 sc NULL")); + + bus_write_4(imx6_anatop_sc->res[MEMRES], offset, value); +} + +static inline uint32_t +cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +{ + + return (sc->refosc_hz * (div / 2)); +} + +static inline uint32_t +cpufreq_hz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +{ + + return (cpu_hz / (sc->refosc_hz / 2)); +} + +static inline uint32_t +cpufreq_actual_hz(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +{ + + return (cpufreq_hz_from_div(sc, cpufreq_hz_to_div(sc, cpu_hz))); +} + +static void +cpufreq_set_clock(struct imx6_anatop_softc * sc, uint32_t cpu_newhz) +{ + uint32_t div, timeout, wrk32; + const uint32_t mindiv = 54; + const uint32_t maxdiv = 108; + + /* + * Clip the requested frequency to the configured max, then clip the + * resulting divisor to the documented min/max values. + */ + cpu_newhz = min(cpu_newhz, sc->cpu_maxhz); + div = cpufreq_hz_to_div(sc, cpu_newhz); + if (div < mindiv) + div = mindiv; + else if (div > maxdiv) + div = maxdiv; + sc->cpu_curhz = cpufreq_hz_from_div(sc, div); + sc->cpu_curmhz = sc->cpu_curhz / 1000000; + + /* + * I can't find a documented procedure for changing the ARM PLL divisor, + * but some trial and error came up with this: + * - Set the bypass clock source to REF_CLK_24M (source #0). + * - Set the PLL into bypass mode; cpu should now be running at 24mhz. + * - Change the divisor. + * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. + * - Turn off bypass mode; cpu should now be running at cpu_newhz. + */ + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, + IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_SET, + IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + + wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); + wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; + wrk32 |= div; + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); + + timeout = 10000; + while ((imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + IMX6_ANALOG_CCM_PLL_ARM_LOCK) == 0) + if (--timeout == 0) + panic("imx6_set_cpu_clock(): PLL never locked"); + + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, + IMX6_ANALOG_CCM_PLL_ARM_BYPASS); +} + +static void +cpufreq_initialize(struct imx6_anatop_softc *sc) +{ + uint32_t cfg3speed; + struct sysctl_ctx_list *ctx; + + ctx = device_get_sysctl_ctx(sc->dev); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0, + "CPU frequency in MHz"); + + /* + * XXX 24mhz shouldn't be hard-coded, should get this from imx6_ccm + * (even though in the real world it will always be 24mhz). Oh wait a + * sec, I never wrote imx6_ccm. + */ + sc->refosc_hz = 24000000; + + /* + * Get the maximum speed this cpu can be set to. The values in the + * OCOTP CFG3 register are not documented in the reference manual. + * The following info was in an archived email found via web search: + * - 2b'11: 1200000000Hz; + * - 2b'10: 996000000Hz; + * - 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. + * - 2b'00: 792000000Hz; + */ + cfg3speed = (fsl_ocotp_read_4(FSL_OCOTP_CFG3) & + FSL_OCOTP_CFG3_SPEED_MASK) >> FSL_OCOTP_CFG3_SPEED_SHIFT; + + sc->cpu_minhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[0]); + sc->cpu_maxhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[cfg3speed]); + + /* + * Set the CPU to maximum speed. + * + * We won't have thermal throttling until interrupts are enabled, but we + * want to run at full speed through all the device init stuff. This + * basically assumes that a single core can't overheat before interrupts + * are enabled; empirical testing shows that to be a safe assumption. + */ + cpufreq_set_clock(sc, sc->cpu_maxhz); + device_printf(sc->dev, "CPU frequency %uMHz\n", sc->cpu_curmhz); +} + +static inline uint32_t +temp_from_count(struct imx6_anatop_softc *sc, uint32_t count) +{ + + return (((sc->temp_high_val - (count - sc->temp_high_cnt) * + (sc->temp_high_val - 250) / + (sc->temp_room_cnt - sc->temp_high_cnt)))); +} + +static inline uint32_t +temp_to_count(struct imx6_anatop_softc *sc, uint32_t temp) +{ + + return ((sc->temp_room_cnt - sc->temp_high_cnt) * + (sc->temp_high_val - temp) / (sc->temp_high_val - 250) + + sc->temp_high_cnt); +} + +static void +temp_update_count(struct imx6_anatop_softc *sc) +{ + uint32_t val; + + val = imx6_anatop_read_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0); + if (!(val & IMX6_ANALOG_TEMPMON_TEMPSENSE0_VALID)) + return; + sc->temp_last_cnt = + (val & IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_MASK) >> + IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT; } static int -imx6_anatop_detach(device_t dev) +temp_sysctl_handler(SYSCTL_HANDLER_ARGS) { - struct imx6_anatop_softc *sc; + struct imx6_anatop_softc *sc = arg1; + uint32_t t; - sc = device_get_softc(dev); + temp_update_count(sc); - if (sc->mem_res != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + t = temp_from_count(sc, sc->temp_last_cnt) + TZ_ZEROC; - return (0); + return (sysctl_handle_int(oidp, &t, 0, req)); +} + +static int +temp_throttle_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + struct imx6_anatop_softc *sc = arg1; + int err; + uint32_t temp; + + temp = sc->temp_throttle_val + TZ_ZEROC; + err = sysctl_handle_int(oidp, &temp, 0, req); + if (temp < TZ_ZEROC) + return (ERANGE); + temp -= TZ_ZEROC; + if (err != 0 || req->newptr == NULL || temp == sc->temp_throttle_val) + return (err); + + /* Value changed, update counts in softc and hardware. */ + sc->temp_throttle_val = temp; + sc->temp_throttle_trigger_cnt = temp_to_count(sc, sc->temp_throttle_val); + sc->temp_throttle_reset_cnt = temp_to_count(sc, sc->temp_throttle_val - 100); + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0_CLR, + IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_MASK); + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0_SET, + (sc->temp_throttle_trigger_cnt << + IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT)); + return (err); +} + +static void +tempmon_gofast(struct imx6_anatop_softc *sc) +{ + + if (sc->cpu_curhz < sc->cpu_maxhz) { + cpufreq_set_clock(sc, sc->cpu_maxhz); + } +} + +static void +tempmon_goslow(struct imx6_anatop_softc *sc) +{ + + if (sc->cpu_curhz > sc->cpu_minhz) { + cpufreq_set_clock(sc, sc->cpu_minhz); + } +} + +static int +tempmon_intr(void *arg) +{ + struct imx6_anatop_softc *sc = arg; + + /* + * XXX Note that this code doesn't currently run (for some mysterious + * reason we just never get an interrupt), so the real monitoring is + * done by tempmon_throttle_check(). + */ + tempmon_goslow(sc); + /* XXX Schedule callout to speed back up eventually. */ + return (FILTER_HANDLED); +} + +static void +tempmon_throttle_check(void *arg) +{ + struct imx6_anatop_softc *sc = arg; + + /* Lower counts are higher temperatures. */ + if (sc->temp_last_cnt < sc->temp_throttle_trigger_cnt) + tempmon_goslow(sc); + else if (sc->temp_last_cnt > (sc->temp_throttle_reset_cnt)) + tempmon_gofast(sc); + + callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay, + 0, tempmon_throttle_check, sc, 0); + +} + +static void +initialize_tempmon(struct imx6_anatop_softc *sc) +{ + uint32_t cal; + struct sysctl_ctx_list *ctx; + + /* + * Fetch calibration data: a sensor count at room temperature (25C), + * a sensor count at a high temperature, and that temperature + */ + cal = fsl_ocotp_read_4(FSL_OCOTP_ANA1); + sc->temp_room_cnt = (cal & 0xFFF00000) >> 20; + sc->temp_high_cnt = (cal & 0x000FFF00) >> 8; + sc->temp_high_val = (cal & 0x000000FF) * 10; + + /* + * Throttle to a lower cpu freq at 10C below the "hot" temperature, and + * reset back to max cpu freq at 5C below the trigger. + */ + sc->temp_throttle_val = sc->temp_high_val - 100; + sc->temp_throttle_trigger_cnt = + temp_to_count(sc, sc->temp_throttle_val); + sc->temp_throttle_reset_cnt = + temp_to_count(sc, sc->temp_throttle_val - 50); + + /* + * Set the sensor to sample automatically at 16Hz (32.768KHz/0x800), set + * the throttle count, and begin making measurements. + */ + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE1, 0x0800); + imx6_anatop_write_4(IMX6_ANALOG_TEMPMON_TEMPSENSE0, + (sc->temp_throttle_trigger_cnt << + IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT) | + IMX6_ANALOG_TEMPMON_TEMPSENSE0_MEASURE); + + /* + * XXX Note that the alarm-interrupt feature isn't working yet, so + * we'll use a callout handler to check at 10Hz. Make sure we have an + * initial temperature reading before starting up the callouts so we + * don't get a bogus reading of zero. + */ + while (sc->temp_last_cnt == 0) + temp_update_count(sc); + sc->temp_throttle_delay = 100 * SBT_1MS; + callout_init(&sc->temp_throttle_callout, 0); + callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay, + 0, tempmon_throttle_check, sc, 0); + + ctx = device_get_sysctl_ctx(sc->dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + temp_sysctl_handler, "IK", "Current die temperature"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc, + 0, temp_throttle_sysctl_handler, "IK", + "Throttle CPU when exceeding this temperature"); +} + +static int +imx6_anatop_detach(device_t dev) +{ + + return (EBUSY); } static int imx6_anatop_attach(device_t dev) { struct imx6_anatop_softc *sc; - int err, rid; + int err; sc = device_get_softc(dev); + sc->dev = dev; /* Allocate bus_space resources. */ - rid = 0; - sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->mem_res == NULL) { - device_printf(dev, "Cannot allocate memory resources\n"); + if (bus_alloc_resources(dev, imx6_anatop_spec, sc->res)) { + device_printf(dev, "Cannot allocate resources\n"); err = ENXIO; goto out; } + err = bus_setup_intr(dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, + tempmon_intr, NULL, sc, &sc->temp_intrhand); + if (err != 0) + goto out; + imx6_anatop_sc = sc; + + /* + * Other code seen on the net sets this SELFBIASOFF flag around the same + * time the temperature sensor is set up, although it's unclear how the + * two are related (if at all). + */ + imx6_anatop_write_4(IMX6_ANALOG_PMU_MISC0_SET, + IMX6_ANALOG_PMU_MISC0_SELFBIASOFF); + + cpufreq_initialize(sc); + initialize_tempmon(sc); + err = 0; out: - if (err != 0) - imx6_anatop_detach(dev); + if (err != 0) { + bus_release_resources(dev, imx6_anatop_spec, sc->res); + } return (err); } @@ -129,7 +482,7 @@ imx6_anatop_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) + if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) return (ENXIO); device_set_desc(dev, "Freescale i.MX6 Analog PLLs and Power"); @@ -137,6 +490,16 @@ imx6_anatop_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +uint32_t +imx6_get_cpu_clock() +{ + uint32_t div; + + div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & + IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; + return (cpufreq_hz_from_div(imx6_anatop_sc, div)); +} + static device_method_t imx6_anatop_methods[] = { /* Device interface */ DEVMETHOD(device_probe, imx6_anatop_probe), Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatopreg.h Fri Feb 21 05:31:34 2014 (r262279) +++ head/sys/arm/freescale/imx/imx6_anatopreg.h Fri Feb 21 06:00:06 2014 (r262280) @@ -33,6 +33,10 @@ #define IMX6_ANALOG_CCM_PLL_ARM_SET 0x004 #define IMX6_ANALOG_CCM_PLL_ARM_CLR 0x008 #define IMX6_ANALOG_CCM_PLL_ARM_TOG 0x00C +#define IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK 0x7F +#define IMX6_ANALOG_CCM_PLL_ARM_LOCK (1U << 31) +#define IMX6_ANALOG_CCM_PLL_ARM_BYPASS (1 << 16) +#define IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK (0x03 << 16) #define IMX6_ANALOG_CCM_PLL_USB1 0x010 #define IMX6_ANALOG_CCM_PLL_USB1_SET 0x014 #define IMX6_ANALOG_CCM_PLL_USB1_CLR 0x018 @@ -81,6 +85,7 @@ #define IMX6_ANALOG_CCM_PFD_528_SET 0x104 #define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 #define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C + #define IMX6_ANALOG_PMU_REG_CORE 0x140 #define IMX6_ANALOG_PMU_REG2_TARG_SHIFT 18 #define IMX6_ANALOG_PMU_REG2_TARG_MASK \ @@ -92,14 +97,56 @@ #define IMX6_ANALOG_PMU_REG0_TARG_MASK \ (0x1f << IMX6_ANALOG_PMU_REG0_TARG_SHIFT) -#define IMX6_ANALOG_CCM_MISC0 0x150 -#define IMX6_ANALOG_CCM_MISC0_SET 0x154 -#define IMX6_ANALOG_CCM_MISC0_CLR 0x158 -#define IMX6_ANALOG_CCM_MISC0_TOG 0x15C -#define IMX6_ANALOG_CCM_MISC2 0x170 -#define IMX6_ANALOG_CCM_MISC2_SET 0x174 -#define IMX6_ANALOG_CCM_MISC2_CLR 0x178 -#define IMX6_ANALOG_CCM_MISC2_TOG 0x17C +#define IMX6_ANALOG_PMU_MISC0 0x150 +#define IMX6_ANALOG_PMU_MISC0_SET 0x154 +#define IMX6_ANALOG_PMU_MISC0_CLR 0x158 +#define IMX6_ANALOG_PMU_MISC0_TOG 0x15C +#define IMX6_ANALOG_PMU_MISC0_SELFBIASOFF (1 << 3) + +#define IMX6_ANALOG_PMU_MISC1 0x160 +#define IMX6_ANALOG_PMU_MISC1_SET 0x164 +#define IMX6_ANALOG_PMU_MISC1_CLR 0x168 +#define IMX6_ANALOG_PMU_MISC1_TOG 0x16C +#define IMX6_ANALOG_PMU_MISC1_IRQ_TEMPSENSE (1 << 29) + +#define IMX6_ANALOG_PMU_MISC2 0x170 +#define IMX6_ANALOG_PMU_MISC2_SET 0x174 +#define IMX6_ANALOG_PMU_MISC2_CLR 0x178 +#define IMX6_ANALOG_PMU_MISC2_TOG 0x17C + +/* + * Note that the ANALOG_CCM_MISCn registers are the same as the PMU_MISCn + * registers; some bits conceptually belong to the PMU and some to the CCM. + */ +#define IMX6_ANALOG_CCM_MISC0 IMX6_ANALOG_PMU_MISC0 +#define IMX6_ANALOG_CCM_MISC0_SET IMX6_ANALOG_PMU_MISC0_SET +#define IMX6_ANALOG_CCM_MISC0_CLR IMX6_ANALOG_PMU_MISC0_CLR +#define IMX6_ANALOG_CCM_MISC0_TOG IMX6_ANALOG_PMU_MISC0_TOG + +#define IMX6_ANALOG_CCM_MISC2 IMX6_ANALOG_PMU_MISC2 +#define IMX6_ANALOG_CCM_MISC2_SET IMX6_ANALOG_PMU_MISC2_SET +#define IMX6_ANALOG_CCM_MISC2_CLR IMX6_ANALOG_PMU_MISC2_CLR +#define IMX6_ANALOG_CCM_MISC2_TOG IMX6_ANALOG_PMU_MISC2_TOG + +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0 0x180 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_SET 0x184 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_CLR 0x188 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG 0x18C +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TOG 0x18C +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT 20 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_MASK \ + (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_ALARM_SHIFT) +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT 8 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_MASK \ + (0xfff << IMX6_ANALOG_TEMPMON_TEMPSENSE0_TEMP_CNT_SHIFT) +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_VALID 0x4 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_MEASURE 0x2 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE0_POWER_DOWN 0x1 + +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1 0x190 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1_SET 0x194 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1_CLR 0x198 +#define IMX6_ANALOG_TEMPMON_TEMPSENSE1_TOG 0x19C #define IMX6_ANALOG_USB1_VBUS_DETECT 0x1A0 #define IMX6_ANALOG_USB1_VBUS_DETECT_SET 0x1A4 Modified: head/sys/arm/freescale/imx/imx6_anatopvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatopvar.h Fri Feb 21 05:31:34 2014 (r262279) +++ head/sys/arm/freescale/imx/imx6_anatopvar.h Fri Feb 21 06:00:06 2014 (r262280) @@ -40,4 +40,6 @@ uint32_t imx6_anatop_read_4(bus_size_t _offset); void imx6_anatop_write_4(bus_size_t _offset, uint32_t _value); +uint32_t imx6_get_cpu_clock(void); + #endif Modified: head/sys/boot/fdt/dts/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/imx6.dtsi Fri Feb 21 05:31:34 2014 (r262279) +++ head/sys/boot/fdt/dts/imx6.dtsi Fri Feb 21 06:00:06 2014 (r262280) @@ -97,6 +97,8 @@ anatop: anatop@020c8000 { compatible = "fsl,imx6q-anatop"; reg = <0x020c8000 0x1000>; + interrupt-parent = <&gic>; + interrupts = <49>; } gpt: timer@02098000 { From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 06:03:55 2014 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 ESMTPS id BFAE3447; Fri, 21 Feb 2014 06:03:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9DAF14EC; Fri, 21 Feb 2014 06:03:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L63tqx075540; Fri, 21 Feb 2014 06:03:55 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L63sYg075536; Fri, 21 Feb 2014 06:03:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402210603.s1L63sYg075536@svn.freebsd.org> From: Neel Natu Date: Fri, 21 Feb 2014 06:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262281 - in head/sys/amd64/vmm: intel io 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 06:03:55 -0000 Author: neel Date: Fri Feb 21 06:03:54 2014 New Revision: 262281 URL: http://svnweb.freebsd.org/changeset/base/262281 Log: Add support for x2APIC virtualization assist in Intel VT-x. The vlapic.ops handler 'enable_x2apic_mode' is called when the vlapic mode is switched to x2APIC. The VT-x implementation of this handler turns off the APIC-access virtualization and enables the x2APIC virtualization in the VMCS. The x2APIC virtualization is done by allowing guest read access to a subset of MSRs in the x2APIC range. In non-root operation the processor will satisfy an 'rdmsr' access to these MSRs by reading from the virtual APIC page instead. The guest is also given write access to TPR, EOI and SELF_IPI MSRs which get special treatment in non-root operation. This is documented in the Intel SDM section titled "Virtualizing MSR-Based APIC Accesses". Enforce that APIC-write and APIC-access VM-exits are handled only if APIC-access virtualization is enabled. The one exception to this is SELF_IPI virtualization which may result in an APIC-write VM-exit. Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/io/vlapic_priv.h Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Feb 21 06:00:06 2014 (r262280) +++ head/sys/amd64/vmm/intel/vmx.c Fri Feb 21 06:03:54 2014 (r262281) @@ -113,6 +113,9 @@ __FBSDID("$FreeBSD$"); #define guest_msr_rw(vmx, msr) \ msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_RW) +#define guest_msr_ro(vmx, msr) \ + msr_bitmap_change_access((vmx)->msr_bitmap, (msr), MSR_BITMAP_ACCESS_READ) + #define HANDLED 1 #define UNHANDLED 0 @@ -301,6 +304,54 @@ exit_reason_to_str(int reason) } #endif /* KTR */ +static int +vmx_allow_x2apic_msrs(struct vmx *vmx) +{ + int i, error; + + error = 0; + + /* + * Allow readonly access to the following x2APIC MSRs from the guest. + */ + error += guest_msr_ro(vmx, MSR_APIC_ID); + error += guest_msr_ro(vmx, MSR_APIC_VERSION); + error += guest_msr_ro(vmx, MSR_APIC_LDR); + error += guest_msr_ro(vmx, MSR_APIC_SVR); + + for (i = 0; i < 8; i++) + error += guest_msr_ro(vmx, MSR_APIC_ISR0 + i); + + for (i = 0; i < 8; i++) + error += guest_msr_ro(vmx, MSR_APIC_TMR0 + i); + + for (i = 0; i < 8; i++) + error += guest_msr_ro(vmx, MSR_APIC_IRR0 + i); + + error += guest_msr_ro(vmx, MSR_APIC_ESR); + error += guest_msr_ro(vmx, MSR_APIC_LVT_TIMER); + error += guest_msr_ro(vmx, MSR_APIC_LVT_THERMAL); + error += guest_msr_ro(vmx, MSR_APIC_LVT_PCINT); + error += guest_msr_ro(vmx, MSR_APIC_LVT_LINT0); + error += guest_msr_ro(vmx, MSR_APIC_LVT_LINT1); + error += guest_msr_ro(vmx, MSR_APIC_LVT_ERROR); + error += guest_msr_ro(vmx, MSR_APIC_ICR_TIMER); + error += guest_msr_ro(vmx, MSR_APIC_DCR_TIMER); + error += guest_msr_ro(vmx, MSR_APIC_ICR); + + /* + * Allow TPR, EOI and SELF_IPI MSRs to be read and written by the guest. + * + * These registers get special treatment described in the section + * "Virtualizing MSR-Based APIC Accesses". + */ + error += guest_msr_rw(vmx, MSR_APIC_TPR); + error += guest_msr_rw(vmx, MSR_APIC_EOI); + error += guest_msr_rw(vmx, MSR_APIC_SELF_IPI); + + return (error); +} + u_long vmx_fix_cr0(u_long cr0) { @@ -1538,17 +1589,53 @@ ept_emulation_fault(uint64_t ept_qual) return (TRUE); } +static __inline int +apic_access_virtualization(struct vmx *vmx, int vcpuid) +{ + uint32_t proc_ctls2; + + proc_ctls2 = vmx->cap[vcpuid].proc_ctls2; + return ((proc_ctls2 & PROCBASED2_VIRTUALIZE_APIC_ACCESSES) ? 1 : 0); +} + +static __inline int +x2apic_virtualization(struct vmx *vmx, int vcpuid) +{ + uint32_t proc_ctls2; + + proc_ctls2 = vmx->cap[vcpuid].proc_ctls2; + return ((proc_ctls2 & PROCBASED2_VIRTUALIZE_X2APIC_MODE) ? 1 : 0); +} + static int -vmx_handle_apic_write(struct vlapic *vlapic, uint64_t qual) +vmx_handle_apic_write(struct vmx *vmx, int vcpuid, struct vlapic *vlapic, + uint64_t qual) { int error, handled, offset; + uint32_t *apic_regs, vector; bool retu; - if (!virtual_interrupt_delivery) - return (UNHANDLED); - handled = HANDLED; offset = APIC_WRITE_OFFSET(qual); + + if (!apic_access_virtualization(vmx, vcpuid)) { + /* + * In general there should not be any APIC write VM-exits + * unless APIC-access virtualization is enabled. + * + * However self-IPI virtualization can legitimately trigger + * an APIC-write VM-exit so treat it specially. + */ + if (x2apic_virtualization(vmx, vcpuid) && + offset == APIC_OFFSET_SELF_IPI) { + apic_regs = (uint32_t *)(vlapic->apic_page); + vector = apic_regs[APIC_OFFSET_SELF_IPI / 4]; + vlapic_self_ipi_handler(vlapic, vector); + return (HANDLED); + } else + return (UNHANDLED); + } + switch (offset) { case APIC_OFFSET_ID: vlapic_id_write_handler(vlapic); @@ -1589,10 +1676,10 @@ vmx_handle_apic_write(struct vlapic *vla } static bool -apic_access_fault(uint64_t gpa) +apic_access_fault(struct vmx *vmx, int vcpuid, uint64_t gpa) { - if (virtual_interrupt_delivery && + if (apic_access_virtualization(vmx, vcpuid) && (gpa >= DEFAULT_APIC_BASE && gpa < DEFAULT_APIC_BASE + PAGE_SIZE)) return (true); else @@ -1605,7 +1692,7 @@ vmx_handle_apic_access(struct vmx *vmx, uint64_t qual; int access_type, offset, allowed; - if (!virtual_interrupt_delivery) + if (!apic_access_virtualization(vmx, vcpuid)) return (UNHANDLED); qual = vmexit->u.vmx.exit_qualification; @@ -1864,7 +1951,8 @@ vmx_exit_process(struct vmx *vmx, int vc * this must be an instruction that accesses MMIO space. */ gpa = vmcs_gpa(); - if (vm_mem_allocated(vmx->vm, gpa) || apic_access_fault(gpa)) { + if (vm_mem_allocated(vmx->vm, gpa) || + apic_access_fault(vmx, vcpu, gpa)) { vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); @@ -1905,7 +1993,7 @@ vmx_exit_process(struct vmx *vmx, int vc */ vmexit->inst_length = 0; vlapic = vm_lapic(vmx->vm, vcpu); - handled = vmx_handle_apic_write(vlapic, qual); + handled = vmx_handle_apic_write(vmx, vcpu, vlapic, qual); break; case EXIT_REASON_XSETBV: handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); @@ -2151,7 +2239,7 @@ vmx_vmcleanup(void *arg) int i, error; struct vmx *vmx = arg; - if (virtual_interrupt_delivery) + if (apic_access_virtualization(vmx, 0)) vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); for (i = 0; i < VM_MAXCPU; i++) @@ -2635,6 +2723,49 @@ vmx_set_tmr(struct vlapic *vlapic, int v } static void +vmx_enable_x2apic_mode(struct vlapic *vlapic) +{ + struct vmx *vmx; + struct vmcs *vmcs; + uint32_t proc_ctls2; + int vcpuid, error; + + vcpuid = vlapic->vcpuid; + vmx = ((struct vlapic_vtx *)vlapic)->vmx; + vmcs = &vmx->vmcs[vcpuid]; + + proc_ctls2 = vmx->cap[vcpuid].proc_ctls2; + KASSERT((proc_ctls2 & PROCBASED2_VIRTUALIZE_APIC_ACCESSES) != 0, + ("%s: invalid proc_ctls2 %#x", __func__, proc_ctls2)); + + proc_ctls2 &= ~PROCBASED2_VIRTUALIZE_APIC_ACCESSES; + proc_ctls2 |= PROCBASED2_VIRTUALIZE_X2APIC_MODE; + vmx->cap[vcpuid].proc_ctls2 = proc_ctls2; + + VMPTRLD(vmcs); + vmcs_write(VMCS_SEC_PROC_BASED_CTLS, proc_ctls2); + VMCLEAR(vmcs); + + if (vlapic->vcpuid == 0) { + /* + * The nested page table mappings are shared by all vcpus + * so unmap the APIC access page just once. + */ + error = vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); + KASSERT(error == 0, ("%s: vm_unmap_mmio error %d", + __func__, error)); + + /* + * The MSR bitmap is shared by all vcpus so modify it only + * once in the context of vcpu 0. + */ + error = vmx_allow_x2apic_msrs(vmx); + KASSERT(error == 0, ("%s: vmx_allow_x2apic_msrs error %d", + __func__, error)); + } +} + +static void vmx_post_intr(struct vlapic *vlapic, int hostcpu) { @@ -2739,6 +2870,7 @@ vmx_vlapic_init(void *arg, int vcpuid) vlapic->ops.pending_intr = vmx_pending_intr; vlapic->ops.intr_accepted = vmx_intr_accepted; vlapic->ops.set_tmr = vmx_set_tmr; + vlapic->ops.enable_x2apic_mode = vmx_enable_x2apic_mode; } if (posted_interrupts) Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Fri Feb 21 06:00:06 2014 (r262280) +++ head/sys/amd64/vmm/io/vlapic.c Fri Feb 21 06:03:54 2014 (r262281) @@ -999,11 +999,13 @@ vlapic_icrlo_write_handler(struct vlapic return (1); } -static void +void vlapic_self_ipi_handler(struct vlapic *vlapic, uint64_t val) { int vec; + KASSERT(x2apic(vlapic), ("SELF_IPI does not exist in xAPIC mode")); + vec = val & 0xff; lapic_intr_edge(vlapic->vm, vlapic->vcpuid, vec); vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, IPIS_SENT, @@ -1457,6 +1459,11 @@ vlapic_set_x2apic_state(struct vm *vm, i lapic->ldr = 0; lapic->dfr = 0xffffffff; } + + if (state == X2APIC_ENABLED) { + if (vlapic->ops.enable_x2apic_mode) + (*vlapic->ops.enable_x2apic_mode)(vlapic); + } } void Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Fri Feb 21 06:00:06 2014 (r262280) +++ head/sys/amd64/vmm/io/vlapic.h Fri Feb 21 06:03:54 2014 (r262281) @@ -102,4 +102,5 @@ int vlapic_icrlo_write_handler(struct vl void vlapic_icrtmr_write_handler(struct vlapic *vlapic); void vlapic_dcr_write_handler(struct vlapic *vlapic); void vlapic_lvt_write_handler(struct vlapic *vlapic, uint32_t offset); +void vlapic_self_ipi_handler(struct vlapic *vlapic, uint64_t val); #endif /* _VLAPIC_H_ */ Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Fri Feb 21 06:00:06 2014 (r262280) +++ head/sys/amd64/vmm/io/vlapic_priv.h Fri Feb 21 06:03:54 2014 (r262281) @@ -144,6 +144,7 @@ struct vlapic_ops { void (*intr_accepted)(struct vlapic *vlapic, int vector); void (*post_intr)(struct vlapic *vlapic, int hostcpu); void (*set_tmr)(struct vlapic *vlapic, int vector, bool level); + void (*enable_x2apic_mode)(struct vlapic *vlapic); }; struct vlapic { From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 07:26:52 2014 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 ESMTPS id 98E9EEA4; Fri, 21 Feb 2014 07:26:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 800D51A44; Fri, 21 Feb 2014 07:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L7Qq0A007162; Fri, 21 Feb 2014 07:26:52 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L7QnBP007144; Fri, 21 Feb 2014 07:26:49 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402210726.s1L7QnBP007144@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 07:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 07:26:52 -0000 Author: bapt Date: Fri Feb 21 07:26:49 2014 New Revision: 262282 URL: http://svnweb.freebsd.org/changeset/base/262282 Log: Import Dragonfly Mail Agent into base system It is a small and lightweight Mail Transport Agent. It accepts mails from locally installed Mail User Agents (MUA) and delivers the mails either locally or to a remote destination. Remote delivery includes several features like TLS/SSL support, SMTP authentication and NULLCLIENT. Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL Reviewed by: peter Discussed with: emaste, bz, peter Added: head/contrib/dma/ - copied from r262281, vendor/dma/dist/ head/libexec/dma/ head/libexec/dma/Makefile (contents, props changed) head/tools/build/options/WITHOUT_DMA (contents, props changed) Replaced: head/contrib/dma/BSDmakefile - copied unchanged from r262281, vendor/dma/dist/BSDmakefile head/contrib/dma/INSTALL - copied unchanged from r262281, vendor/dma/dist/INSTALL head/contrib/dma/LICENSE - copied unchanged from r262281, vendor/dma/dist/LICENSE head/contrib/dma/Makefile - copied unchanged from r262281, vendor/dma/dist/Makefile head/contrib/dma/Makefile.etc - copied unchanged from r262281, vendor/dma/dist/Makefile.etc head/contrib/dma/README.markdown - copied unchanged from r262281, vendor/dma/dist/README.markdown head/contrib/dma/TODO - copied unchanged from r262281, vendor/dma/dist/TODO head/contrib/dma/VERSION - copied unchanged from r262281, vendor/dma/dist/VERSION head/contrib/dma/aliases_parse.y - copied unchanged from r262281, vendor/dma/dist/aliases_parse.y head/contrib/dma/aliases_scan.l - copied unchanged from r262281, vendor/dma/dist/aliases_scan.l head/contrib/dma/auth.conf - copied unchanged from r262281, vendor/dma/dist/auth.conf head/contrib/dma/base64.c - copied unchanged from r262281, vendor/dma/dist/base64.c head/contrib/dma/conf.c - copied unchanged from r262281, vendor/dma/dist/conf.c head/contrib/dma/crypto.c - copied unchanged from r262281, vendor/dma/dist/crypto.c head/contrib/dma/debian/ - copied from r262281, vendor/dma/dist/debian/ head/contrib/dma/debian/NEWS - copied unchanged from r262281, vendor/dma/dist/debian/NEWS head/contrib/dma/debian/README.Debian - copied unchanged from r262281, vendor/dma/dist/debian/README.Debian head/contrib/dma/debian/changelog - copied unchanged from r262281, vendor/dma/dist/debian/changelog head/contrib/dma/debian/compat - copied unchanged from r262281, vendor/dma/dist/debian/compat head/contrib/dma/debian/control - copied unchanged from r262281, vendor/dma/dist/debian/control head/contrib/dma/debian/copyright - copied unchanged from r262281, vendor/dma/dist/debian/copyright head/contrib/dma/debian/dma-migrate.dirs - copied unchanged from r262281, vendor/dma/dist/debian/dma-migrate.dirs head/contrib/dma/debian/dma-migrate.install - copied unchanged from r262281, vendor/dma/dist/debian/dma-migrate.install head/contrib/dma/debian/dma-migrate.manpages - copied unchanged from r262281, vendor/dma/dist/debian/dma-migrate.manpages head/contrib/dma/debian/dma.dirs - copied unchanged from r262281, vendor/dma/dist/debian/dma.dirs head/contrib/dma/debian/dma.links - copied unchanged from r262281, vendor/dma/dist/debian/dma.links head/contrib/dma/debian/dma.lintian-overrides - copied unchanged from r262281, vendor/dma/dist/debian/dma.lintian-overrides head/contrib/dma/debian/migrate/ - copied from r262281, vendor/dma/dist/debian/migrate/ head/contrib/dma/debian/migrate/Makefile - copied unchanged from r262281, vendor/dma/dist/debian/migrate/Makefile head/contrib/dma/debian/migrate/NEWS - copied unchanged from r262281, vendor/dma/dist/debian/migrate/NEWS head/contrib/dma/debian/migrate/dma-migrate.8 - copied unchanged from r262281, vendor/dma/dist/debian/migrate/dma-migrate.8 head/contrib/dma/debian/migrate/dma-migrate.c - copied unchanged from r262281, vendor/dma/dist/debian/migrate/dma-migrate.c head/contrib/dma/debian/rules - copied unchanged from r262281, vendor/dma/dist/debian/rules head/contrib/dma/debian/source/ - copied from r262281, vendor/dma/dist/debian/source/ head/contrib/dma/debian/source/format - copied unchanged from r262281, vendor/dma/dist/debian/source/format head/contrib/dma/debian/source/options - copied unchanged from r262281, vendor/dma/dist/debian/source/options head/contrib/dma/dfcompat.c - copied unchanged from r262281, vendor/dma/dist/dfcompat.c head/contrib/dma/dfcompat.h - copied unchanged from r262281, vendor/dma/dist/dfcompat.h head/contrib/dma/dma-mbox-create.c - copied unchanged from r262281, vendor/dma/dist/dma-mbox-create.c head/contrib/dma/dma.8 - copied unchanged from r262281, vendor/dma/dist/dma.8 head/contrib/dma/dma.c - copied unchanged from r262281, vendor/dma/dist/dma.c head/contrib/dma/dma.conf - copied unchanged from r262281, vendor/dma/dist/dma.conf head/contrib/dma/dma.h - copied unchanged from r262281, vendor/dma/dist/dma.h head/contrib/dma/dns.c - copied unchanged from r262281, vendor/dma/dist/dns.c head/contrib/dma/get-version.sh - copied unchanged from r262281, vendor/dma/dist/get-version.sh head/contrib/dma/local.c - copied unchanged from r262281, vendor/dma/dist/local.c head/contrib/dma/mail.c - copied unchanged from r262281, vendor/dma/dist/mail.c head/contrib/dma/net.c - copied unchanged from r262281, vendor/dma/dist/net.c head/contrib/dma/spool.c - copied unchanged from r262281, vendor/dma/dist/spool.c head/contrib/dma/test/ - copied from r262281, vendor/dma/dist/test/ head/contrib/dma/test/quote.rfc2822 - copied unchanged from r262281, vendor/dma/dist/test/quote.rfc2822 head/contrib/dma/util.c - copied unchanged from r262281, vendor/dma/dist/util.c Modified: head/etc/mtree/BSD.root.dist head/etc/mtree/BSD.var.dist head/libexec/Makefile head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc Copied: head/contrib/dma/BSDmakefile (from r262281, vendor/dma/dist/BSDmakefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/BSDmakefile Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/BSDmakefile) @@ -0,0 +1,28 @@ +# $DragonFly: src/libexec/dma/Makefile,v 1.5 2008/09/19 00:36:57 corecode Exp $ +# + +version!= sh get-version.sh + +CFLAGS+= -I${.CURDIR} +CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME +CFLAGS+= -DLIBEXEC_PATH='"${LIBEXEC}"' -DDMA_VERSION='"${version}"' +CFLAGS+= -DCONF_PATH='"${CONFDIR}"' + +DPADD= ${LIBSSL} ${LIBCRYPTO} +LDADD= -lssl -lcrypto + +PROG= dma +SRCS= aliases_parse.y aliases_scan.l base64.c conf.c crypto.c +SRCS+= dma.c dns.c local.c mail.c net.c spool.c util.c +MAN= dma.8 + +PREFIX?= /usr/local +LIBEXEC?= ${PREFIX}/libexec +CONFDIR?= ${PREFIX}/etc/dma + +BINOWN= root +BINGRP= mail +BINMODE=2555 +WARNS?= 6 + +.include Copied: head/contrib/dma/INSTALL (from r262281, vendor/dma/dist/INSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/INSTALL Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/INSTALL) @@ -0,0 +1,28 @@ +Installing DMA: +=============== + +On most systems (with a development environment installed) you should be able to compile DMA with: + make + +Once it have compiled it successfully, you can install it with: + make install sendmail-link mailq-link install-spool-dirs install-etc + +Troubleshooting: +---------------- +On systems that do not default to a compatible "make" version, try using "gmake" or "pmake" instead of "make". Some known examples of this: +* Solaris 9 +* Solaris 10 + +Check that you have the following commands installed: +* cc - gcc is known to work +* lex - flex is known to work +* yacc - bison is kjnown to work +* make - BSD make and GNU make is knwon to work +* sh - Need to be POSIX compliant, dash, bash known to work +* install - GNU and BSD versions known to work +* openssl - Add the header location to C_INCLUDE_PATH if you get errors about "err.h" + +If you have all of these tools installed, set the CC, YACC, INSTALL, LEX and SH variable to point to the relevant location and command. + +Example: + make CC=gcc YACC=bison LEX=/usr/bin/flex SH=/bin/bash INSTALL=/usr/bin/install Copied: head/contrib/dma/LICENSE (from r262281, vendor/dma/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/LICENSE Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/LICENSE) @@ -0,0 +1,109 @@ +Copyright (c) 2008 The DragonFly Project. +Copyright (c) 2008-2011, Simon Schubert <2@0x2c.org>. +All rights reserved. + +This code is derived from software contributed to The DragonFly Project +by Simon Schubert <2@0x2c.org>. + +This code is derived from software contributed to The DragonFly Project +by Matthias Schmidt , University of Marburg, +Germany. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +3. Neither the name of The DragonFly Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific, prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + +Copyright (c) 1995-2001 Kungliga Tekniska Högskolan +(Royal Institute of Technology, Stockholm, Sweden). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + + +Copyright (c) 1998 Todd C. Miller + +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. + + +Copyright (c) 1998, M. Warner Losh +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY 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. Copied: head/contrib/dma/Makefile (from r262281, vendor/dma/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/Makefile Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/Makefile) @@ -0,0 +1,111 @@ +# +# Depending on your operating system, you might want to influence +# the conditional inclusion of some helper functions: +# +# Define HAVE_* (in caps) if your system already provides: +# reallocf +# strlcpy +# getprogname +# + +SH?= sh + +version= $(shell ${SH} get-version.sh) +debversion= $(shell ${SH} get-version.sh | sed -Ee 's/^v//;s/[.]([[:digit:]]+)[.](g[[:xdigit:]]+)$$/+\1+\2/') + +CC?= gcc +CFLAGS?= -O -pipe +LDADD?= -lssl -lcrypto -lresolv + +CFLAGS+= -Wall -DDMA_VERSION='"${version}"' -DLIBEXEC_PATH='"${LIBEXEC}"' -DCONF_PATH='"${CONFDIR}"' + +INSTALL?= install -p +CHGRP?= chgrp +CHMOD?= chmod + +PREFIX?= /usr/local +SBIN?= ${PREFIX}/sbin +LIBEXEC?= ${PREFIX}/lib +CONFDIR?= /etc/dma +MAN?= ${PREFIX}/share/man +VAR?= /var +DMASPOOL?= ${VAR}/spool/dma +VARMAIL?= ${VAR}/mail +SYMLINK?= -s # or empty to create hard link + +YACC?= yacc +LEX?= lex +LN?= ln + +OBJS= aliases_parse.o aliases_scan.o base64.o conf.o crypto.o +OBJS+= dma.o dns.o local.o mail.o net.o spool.o util.o +OBJS+= dfcompat.o + +all: dma dma-mbox-create + +clean: + -rm -f .depend dma dma-mbox-create *.[do] + -rm -f aliases_parse.[ch] aliases_scan.c + +install: all + ${INSTALL} -d ${DESTDIR}${SBIN} + ${INSTALL} -d ${DESTDIR}${MAN}/man8 ${DESTDIR}${LIBEXEC} + ${INSTALL} -m 2755 -o root -g mail dma ${DESTDIR}${SBIN} + ${INSTALL} -m 4754 -o root -g mail dma-mbox-create ${DESTDIR}${LIBEXEC} + ${INSTALL} -m 0644 dma.8 ${DESTDIR}${MAN}/man8/ + +sendmail-link: + cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma sendmail + +mailq-link: + cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma mailq + +install-spool-dirs: + ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${DMASPOOL} + ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${VARMAIL} + +permissions: + -${CHGRP} mail ${DESTDIR}${VARMAIL}/* + -${CHMOD} g+w ${DESTDIR}${VARMAIL}/* + -${CHMOD} 660 ${DESTDIR}${DMASPOOL}/flush + +install-etc: + ${INSTALL} -d ${DESTDIR}${CONFDIR} + @if [ -e ${DESTDIR}${CONFDIR}/dma.conf ]; then \ + echo "Not overwriting ${DESTDIR}${CONFDIR}/dma.conf."; \ + else \ + echo ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \ + ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \ + fi + @if [ -e ${DESTDIR}${CONFDIR}/auth.conf ]; then \ + echo "Not overwriting ${DESTDIR}${CONFDIR}/auth.conf."; \ + else \ + echo ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \ + ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \ + fi + +aliases_parse.c: aliases_parse.y + ${YACC} -d -o aliases_parse.c aliases_parse.y + +aliases_scan.c: aliases_scan.l + ${LEX} -t aliases_scan.l > aliases_scan.c + +.SUFFIXES: .c .o + +.c.o: + ${CC} ${CFLAGS} ${CPPFLAGS} -include dfcompat.h -o $@ -c $< + +dma: ${OBJS} + ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD} + + +dch: + dch --release-heuristic changelog -v ${debversion} + + +ppa: + @if [ -z '${DEB_DIST}' ]; then echo "please set DEB_DIST to build"; exit 1; fi + dch -v "${debversion}~${DEB_DIST}" -D ${DEB_DIST} "${DEB_DIST} build" -b + debuild -S -sa + ver=$$(dpkg-parsechangelog -n1 | awk '$$1 == "Version:" { print $$2 }'); \ + dput ppa:corecode/dma ../dma_$${ver}_source.changes Copied: head/contrib/dma/Makefile.etc (from r262281, vendor/dma/dist/Makefile.etc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/Makefile.etc Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/Makefile.etc) @@ -0,0 +1,15 @@ +# $DragonFly: src/etc/dma/Makefile,v 1.3 2008/02/12 22:10:20 matthias Exp $ + +FILESDIR= /etc/dma +SHAREOWN= root +SHAREGRP= mail +FILESMODE= 640 + +.if !exists(${DESTDIR}/etc/dma/auth.conf) +FILES+= auth.conf +.endif +.if !exists(${DESTDIR}/etc/dma/dma.conf) +FILES+= dma.conf +.endif + +.include Copied: head/contrib/dma/README.markdown (from r262281, vendor/dma/dist/README.markdown) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/README.markdown Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/README.markdown) @@ -0,0 +1,32 @@ +dma -- DragonFly Mail Agent +=========================== + +dma is a small Mail Transport Agent (MTA), designed for home and +office use. It accepts mails from locally installed Mail User Agents (MUA) +and delivers the mails either locally or to a remote destination. +Remote delivery includes several features like TLS/SSL support and +SMTP authentication. + +dma is not intended as a replacement for real, big MTAs like sendmail(8) +or postfix(1). Consequently, dma does not listen on port 25 for +incoming connections. + + +Building +-------- + + make + + +Installation +------------ + + make install sendmail-link mailq-link install-spool-dirs install-etc + +See INSTALL for requirements and configuration options. + + +Contact +------- + +Simon Schubert <2@0x2c.org> Copied: head/contrib/dma/TODO (from r262281, vendor/dma/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/TODO Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/TODO) @@ -0,0 +1,5 @@ +- unquote/handle quoted local recipients +- use proper sysexit codes +- handle/use ESMTP extensions +- .forward support +- suggest way to run a queue flush on boot Copied: head/contrib/dma/VERSION (from r262281, vendor/dma/dist/VERSION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/VERSION Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/VERSION) @@ -0,0 +1 @@ +v0.9 Copied: head/contrib/dma/aliases_parse.y (from r262281, vendor/dma/dist/aliases_parse.y) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/aliases_parse.y Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/aliases_parse.y) @@ -0,0 +1,112 @@ +%{ + +#include +#include +#include +#include "dma.h" + +extern int yylineno; +static void yyerror(const char *); +int yywrap(void); +int yylex(void); + +static void +yyerror(const char *msg) +{ + /** + * Because we do error '\n' below, we need to report the error + * one line above of what yylineno points to. + */ + syslog(LOG_CRIT, "aliases line %d: %s", yylineno - 1, msg); + fprintf(stderr, "aliases line %d: %s\n", yylineno - 1, msg); +} + +int +yywrap(void) +{ + return (1); +} + +%} + +%union { + char *ident; + struct stritem *strit; + struct alias *alias; +} + +%token T_IDENT +%token T_ERROR +%token T_EOF 0 + +%type dests +%type alias aliases + +%% + +start : aliases T_EOF + { + LIST_FIRST(&aliases) = $1; + } + +aliases : /* EMPTY */ + { + $$ = NULL; + } + | alias aliases + { + if ($2 != NULL && $1 != NULL) + LIST_INSERT_AFTER($2, $1, next); + else if ($2 == NULL) + $2 = $1; + $$ = $2; + } + ; + +alias : T_IDENT ':' dests '\n' + { + struct alias *al; + + if ($1 == NULL) + YYABORT; + al = calloc(1, sizeof(*al)); + if (al == NULL) + YYABORT; + al->alias = $1; + SLIST_FIRST(&al->dests) = $3; + $$ = al; + } + | error '\n' + { + YYABORT; + } + ; + +dests : T_IDENT + { + struct stritem *it; + + if ($1 == NULL) + YYABORT; + it = calloc(1, sizeof(*it)); + if (it == NULL) + YYABORT; + it->str = $1; + $$ = it; + } + | T_IDENT ',' dests + { + struct stritem *it; + + if ($1 == NULL) + YYABORT; + it = calloc(1, sizeof(*it)); + if (it == NULL) + YYABORT; + it->str = $1; + SLIST_NEXT(it, next) = $3; + $$ = it; + } + ; + +%% Copied: head/contrib/dma/aliases_scan.l (from r262281, vendor/dma/dist/aliases_scan.l) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/aliases_scan.l Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/aliases_scan.l) @@ -0,0 +1,24 @@ +%{ + +#include +#include "aliases_parse.h" + +#define YY_NO_INPUT + +int yylex(void); +%} + +%option yylineno +%option nounput + +%% + +[^:,#[:space:][:cntrl:]]+ {yylval.ident = strdup(yytext); return T_IDENT;} +^([[:blank:]]*(#.*)?\n)+ ;/* ignore empty lines */ +[:,\n] return yytext[0]; +(\n?[[:blank:]]+|#.*)+ ;/* ignore whitespace and continuation */ +\\\n ;/* ignore continuation. not allowed in comments */ +. return T_ERROR; +<> return T_EOF; + +%% Copied: head/contrib/dma/auth.conf (from r262281, vendor/dma/dist/auth.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/auth.conf Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/auth.conf) @@ -0,0 +1,4 @@ +# $DragonFly: src/etc/dma/auth.conf,v 1.1 2008/02/02 18:24:00 matthias Exp $ +# +# SMTP authentication entries (currently AUTH LOGIN only) +# Format: user|my.smarthost.example.com:password Copied: head/contrib/dma/base64.c (from r262281, vendor/dma/dist/base64.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/base64.c Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/base64.c) @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1995-2001 Kungliga Tekniska Högskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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 "dma.h" + +static char base64_chars[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static int +pos(char c) +{ + char *p; + for (p = base64_chars; *p; p++) + if (*p == c) + return p - base64_chars; + return -1; +} + + +int +base64_encode(const void *data, int size, char **str) +{ + char *s, *p; + int i; + int c; + const unsigned char *q; + + p = s = (char *) malloc(size * 4 / 3 + 4); + if (p == NULL) + return -1; + q = (const unsigned char *) data; + i = 0; + for (i = 0; i < size;) { + c = q[i++]; + c *= 256; + if (i < size) + c += q[i]; + i++; + c *= 256; + if (i < size) + c += q[i]; + i++; + p[0] = base64_chars[(c & 0x00fc0000) >> 18]; + p[1] = base64_chars[(c & 0x0003f000) >> 12]; + p[2] = base64_chars[(c & 0x00000fc0) >> 6]; + p[3] = base64_chars[(c & 0x0000003f) >> 0]; + if (i > size) + p[3] = '='; + if (i > size + 1) + p[2] = '='; + p += 4; + } + *p = 0; + *str = s; + return strlen(s); +} + +#define DECODE_ERROR 0xffffffff + +static unsigned int +token_decode(const char *token) +{ + int i; + unsigned int val = 0; + int marker = 0; + if (strlen(token) < 4) + return DECODE_ERROR; + for (i = 0; i < 4; i++) { + val *= 64; + if (token[i] == '=') + marker++; + else if (marker > 0) + return DECODE_ERROR; + else + val += pos(token[i]); + } + if (marker > 2) + return DECODE_ERROR; + return (marker << 24) | val; +} + +int +base64_decode(const char *str, void *data) +{ + const char *p; + unsigned char *q; + + q = data; + for (p = str; *p && (*p == '=' || strchr(base64_chars, *p)); p += 4) { + unsigned int val = token_decode(p); + unsigned int marker = (val >> 24) & 0xff; + if (val == DECODE_ERROR) + return -1; + *q++ = (val >> 16) & 0xff; + if (marker < 2) + *q++ = (val >> 8) & 0xff; + if (marker < 1) + *q++ = val & 0xff; + } + return q - (unsigned char *) data; +} + Copied: head/contrib/dma/conf.c (from r262281, vendor/dma/dist/conf.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/conf.c Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/conf.c) @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Matthias Schmidt , University of Marburg, + * Germany. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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 +#include +#include +#include + +#include "dma.h" + +#define DP ": \t" +#define EQS " \t" + + +/* + * Remove trailing \n's + */ +void +trim_line(char *line) +{ + size_t linelen; + char *p; + + if ((p = strchr(line, '\n'))) + *p = (char)0; + + /* Escape leading dot in every case */ + linelen = strlen(line); + if (line[0] == '.') { + if ((linelen + 2) > 1000) { + syslog(LOG_CRIT, "Cannot escape leading dot. Buffer overflow"); + exit(1); + } + memmove((line + 1), line, (linelen + 1)); + line[0] = '.'; + } +} + +static void +chomp(char *str) +{ + size_t len = strlen(str); + + if (len == 0) + return; + if (str[len - 1] == '\n') + str[len - 1] = 0; +} + +/* + * Read the SMTP authentication config file + * + * file format is: + * user|host:password + * + * A line starting with # is treated as comment and ignored. + */ +void +parse_authfile(const char *path) +{ + char line[2048]; + struct authuser *au; + FILE *a; + char *data; + int lineno = 0; + + a = fopen(path, "r"); + if (a == NULL) { + errlog(1, "can not open auth file `%s'", path); + /* NOTREACHED */ + } + + while (!feof(a)) { + if (fgets(line, sizeof(line), a) == NULL) + break; + lineno++; + + chomp(line); + + /* We hit a comment */ + if (*line == '#') + continue; + /* Ignore empty lines */ + if (*line == 0) + continue; + + au = calloc(1, sizeof(*au)); + if (au == NULL) + errlog(1, NULL); + + data = strdup(line); + au->login = strsep(&data, "|"); + au->host = strsep(&data, DP); + au->password = data; + + if (au->login == NULL || + au->host == NULL || + au->password == NULL) { + errlogx(1, "syntax error in authfile %s:%d", + path, lineno); + /* NOTREACHED */ + } + + SLIST_INSERT_HEAD(&authusers, au, next); + } + + fclose(a); +} + +/* + * XXX TODO + * Check for bad things[TM] + */ +void +parse_conf(const char *config_path) +{ + char *word; + char *data; + FILE *conf; + char line[2048]; + int lineno = 0; + + conf = fopen(config_path, "r"); + if (conf == NULL) { + /* Don't treat a non-existing config file as error */ + if (errno == ENOENT) + return; + errlog(1, "can not open config `%s'", config_path); + /* NOTREACHED */ + } + + while (!feof(conf)) { + if (fgets(line, sizeof(line), conf) == NULL) + break; + lineno++; + + chomp(line); + + /* We hit a comment */ + if (strchr(line, '#')) + *strchr(line, '#') = 0; + + data = line; + word = strsep(&data, EQS); + + /* Ignore empty lines */ + if (word == NULL || *word == 0) + continue; + + if (data != NULL && *data != 0) + data = strdup(data); + else + data = NULL; + + if (strcmp(word, "SMARTHOST") == 0 && data != NULL) + config.smarthost = data; + else if (strcmp(word, "PORT") == 0 && data != NULL) + config.port = atoi(data); + else if (strcmp(word, "ALIASES") == 0 && data != NULL) + config.aliases = data; + else if (strcmp(word, "SPOOLDIR") == 0 && data != NULL) + config.spooldir = data; + else if (strcmp(word, "AUTHPATH") == 0 && data != NULL) + config.authpath= data; + else if (strcmp(word, "CERTFILE") == 0 && data != NULL) + config.certfile = data; + else if (strcmp(word, "MAILNAME") == 0 && data != NULL) + config.mailname = data; + else if (strcmp(word, "MASQUERADE") == 0 && data != NULL) { + char *user = NULL, *host = NULL; + if (strrchr(data, '@')) { + host = strrchr(data, '@'); + *host = 0; + host++; + user = data; + } else { + host = data; + } + if (host && *host == 0) + host = NULL; + if (user && *user == 0) + user = NULL; + config.masquerade_host = host; + config.masquerade_user = user; + } else if (strcmp(word, "STARTTLS") == 0 && data == NULL) + config.features |= STARTTLS; + else if (strcmp(word, "OPPORTUNISTIC_TLS") == 0 && data == NULL) + config.features |= TLS_OPP; + else if (strcmp(word, "SECURETRANSFER") == 0 && data == NULL) + config.features |= SECURETRANS; + else if (strcmp(word, "DEFER") == 0 && data == NULL) + config.features |= DEFER; + else if (strcmp(word, "INSECURE") == 0 && data == NULL) + config.features |= INSECURE; + else if (strcmp(word, "FULLBOUNCE") == 0 && data == NULL) + config.features |= FULLBOUNCE; + else if (strcmp(word, "NULLCLIENT") == 0 && data == NULL) + config.features |= NULLCLIENT; + else { + errlogx(1, "syntax error in %s:%d", config_path, lineno); + /* NOTREACHED */ + } + } + + if ((config.features & NULLCLIENT) && config.smarthost == NULL) { + errlogx(1, "%s: NULLCLIENT requires SMARTHOST", config_path); + /* NOTREACHED */ + } + + fclose(conf); +} Copied: head/contrib/dma/crypto.c (from r262281, vendor/dma/dist/crypto.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/dma/crypto.c Fri Feb 21 07:26:49 2014 (r262282, copy of r262281, vendor/dma/dist/crypto.c) @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Matthias Schmidt , University of Marburg, + * Germany. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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 +#include +#include + +#include + +#include "dma.h" + +static int +init_cert_file(SSL_CTX *ctx, const char *path) +{ + int error; + + /* Load certificate into ctx */ + error = SSL_CTX_use_certificate_chain_file(ctx, path); + if (error < 1) { + syslog(LOG_ERR, "SSL: Cannot load certificate `%s': %s", path, ssl_errstr()); + return (-1); + } + + /* Add private key to ctx */ + error = SSL_CTX_use_PrivateKey_file(ctx, path, SSL_FILETYPE_PEM); + if (error < 1) { + syslog(LOG_ERR, "SSL: Cannot load private key `%s': %s", path, ssl_errstr()); + return (-1); + } + + /* + * Check the consistency of a private key with the corresponding + * certificate + */ + error = SSL_CTX_check_private_key(ctx); + if (error < 1) { + syslog(LOG_ERR, "SSL: Cannot check private key: %s", ssl_errstr()); + return (-1); + } + + return (0); +} + +int +smtp_init_crypto(int fd, int feature) +{ + SSL_CTX *ctx = NULL; +#if (OPENSSL_VERSION_NUMBER >= 0x00909000L) + const SSL_METHOD *meth = NULL; +#else + SSL_METHOD *meth = NULL; +#endif + X509 *cert; + int error; + + /* XXX clean up on error/close */ + /* Init SSL library */ + SSL_library_init(); + SSL_load_error_strings(); + + meth = TLSv1_client_method(); + + ctx = SSL_CTX_new(meth); + if (ctx == NULL) { + syslog(LOG_WARNING, "remote delivery deferred: SSL init failed: %s", ssl_errstr()); + return (1); + } + + /* User supplied a certificate */ + if (config.certfile != NULL) { + error = init_cert_file(ctx, config.certfile); + if (error) { + syslog(LOG_WARNING, "remote delivery deferred"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 07:31:25 2014 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 ESMTPS id 2ABE9155; Fri, 21 Feb 2014 07:31:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16E361AEB; Fri, 21 Feb 2014 07:31:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L7VOIr010488; Fri, 21 Feb 2014 07:31:24 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L7VOJC010487; Fri, 21 Feb 2014 07:31:24 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402210731.s1L7VOJC010487@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 07:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262283 - head/share/man/man5 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 07:31:25 -0000 Author: bapt Date: Fri Feb 21 07:31:24 2014 New Revision: 262283 URL: http://svnweb.freebsd.org/changeset/base/262283 Log: Regen after addition of WITHOUT_DMA Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Feb 21 07:26:49 2014 (r262282) +++ head/share/man/man5/src.conf.5 Fri Feb 21 07:31:24 2014 (r262283) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd January 30, 2014 +.Dd February 21, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -326,6 +326,9 @@ and are located automatically by .It Va WITHOUT_DICT .\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. +.It Va WITHOUT_DMA +.\" from FreeBSD: head/tools/build/options/WITHOUT_DMA 262282 2014-02-21 07:26:49Z bapt +Set to not build dma Mail Transport Agent .It Va WITHOUT_DYNAMICROOT .\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link @@ -672,6 +675,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_DMA +.It .Va WITHOUT_MAILWRAPPER .It .Va WITHOUT_SENDMAIL From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 08:04:58 2014 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 ESMTPS id 51E54A1F; Fri, 21 Feb 2014 08:04:58 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F27A1D27; Fri, 21 Feb 2014 08:04:57 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id y10so2297392wgg.16 for ; Fri, 21 Feb 2014 00:04:55 -0800 (PST) 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=UqW+AbSnsbjsOP+s8Kl74/aXm2rCz0Kx8a7Wi29Y0nY=; b=AsyI1lJ3sreLHtjsCCvFXfZ197cHKM2p7AM3ClhzhvjBJ5+CRIEyrKJz+H524qflHZ sG3y+cE/95kP+hqHu0My8sub1ekXbhy6Lqt3AfDewtym11tz4kUBhbXN4lnKT5tInLSv abL2sCFdeauMDfMYbq/3Ur1nGssPl/9nrnBTLxjXGSfc00gB3aCVydacB7xI/cKUicq+ wch16VntxXlybih7Kb8N7XGByJHUdAMyB9JmSfVQrUE4r8/Dy0XjNnsGlnEd6Idi+i/d fnZXu1k84QqbWvJ87H2iQNN3Y36IXrAK4WVVbr4O/B88UlLMayppwu01PG3HXk3G5g3w Pt+g== X-Received: by 10.194.60.16 with SMTP id d16mr5729983wjr.46.1392969895081; Fri, 21 Feb 2014 00:04:55 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id u6sm5513252wif.6.2014.02.21.00.04.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 00:04:52 -0800 (PST) Sender: Baptiste Daroussin Date: Fri, 21 Feb 2014 09:04:50 +0100 From: Baptiste Daroussin To: d@delphij.net Subject: Re: svn commit: r262266 - in vendor/dma: . dist dist/debian dist/debian/migrate dist/debian/source dist/test Message-ID: <20140221080448.GG1699@ithaqua.etoilebsd.net> References: <201402202239.s1KMdtfN091407@svn.freebsd.org> <5306B1F3.4060107@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7lMq7vMTJT4tNk0a" Content-Disposition: inline In-Reply-To: <5306B1F3.4060107@delphij.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 08:04:58 -0000 --7lMq7vMTJT4tNk0a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 20, 2014 at 05:54:59PM -0800, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 >=20 > On 02/20/14 14:39, Baptiste Daroussin wrote: > > Author: bapt Date: Thu Feb 20 22:39:55 2014 New Revision: 262266=20 > > URL: http://svnweb.freebsd.org/changeset/base/262266 > >=20 > > Log: Import dma 89702b7f14 (2013-02-13) into vendors >=20 > Are we going to remove sendmail? Personally I don't think it's a good > idea to have two different delivery agents. >=20 That is not the initial goal, the initial goal is to be able do relay mail = or deliver them locally without anything listening on port 25, with something = easy to configure and with a very low footprint. That said, yes I do really think that we should remove sendmail from base, = if I remember correctly the discussion each time we talked about it the conclusi= on was we only need something able to relay mail to another mails server and be able to locally deliver mails, that is exactly the definition of dma. to be honnest dma needs a bit of work on how it handle its retry queue, but= that might not be long to improve. regards, Bapt --7lMq7vMTJT4tNk0a Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMHCKAACgkQ8kTtMUmk6ExE+ACfbtIDePo+UGt9AgyrBT/L4b0H SyYAoKmAYEQ7WdcfvE/2QdqQ9XeGpa8l =3/eV -----END PGP SIGNATURE----- --7lMq7vMTJT4tNk0a-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:19:17 2014 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 ESMTPS id 0DB1F74A; Fri, 21 Feb 2014 09:19:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED3A514C2; Fri, 21 Feb 2014 09:19:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9JGZM053257; Fri, 21 Feb 2014 09:19:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9JGDk053256; Fri, 21 Feb 2014 09:19:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210919.s1L9JGDk053256@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262284 - stable/10/libexec/ftpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:19:17 -0000 Author: brueffer Date: Fri Feb 21 09:19:16 2014 New Revision: 262284 URL: http://svnweb.freebsd.org/changeset/base/262284 Log: MFC: r261885 In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya Modified: stable/10/libexec/ftpd/ftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Fri Feb 21 07:31:24 2014 (r262283) +++ stable/10/libexec/ftpd/ftpd.c Fri Feb 21 09:19:16 2014 (r262284) @@ -965,6 +965,7 @@ sgetpwnam(char *name) if (save.pw_name) { free(save.pw_name); free(save.pw_passwd); + free(save.pw_class); free(save.pw_gecos); free(save.pw_dir); free(save.pw_shell); @@ -972,6 +973,7 @@ sgetpwnam(char *name) save = *p; save.pw_name = sgetsave(p->pw_name); save.pw_passwd = sgetsave(p->pw_passwd); + save.pw_class = sgetsave(p->pw_class); save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:21:03 2014 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 ESMTPS id 0BD6C936; Fri, 21 Feb 2014 09:21:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E54CE1539; Fri, 21 Feb 2014 09:21:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9L25I056274; Fri, 21 Feb 2014 09:21:02 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9L25N056273; Fri, 21 Feb 2014 09:21:02 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210921.s1L9L25N056273@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:21: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: r262285 - stable/9/libexec/ftpd 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:21:03 -0000 Author: brueffer Date: Fri Feb 21 09:21:02 2014 New Revision: 262285 URL: http://svnweb.freebsd.org/changeset/base/262285 Log: MFC: r261885 In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya Modified: stable/9/libexec/ftpd/ftpd.c Directory Properties: stable/9/libexec/ftpd/ (props changed) Modified: stable/9/libexec/ftpd/ftpd.c ============================================================================== --- stable/9/libexec/ftpd/ftpd.c Fri Feb 21 09:19:16 2014 (r262284) +++ stable/9/libexec/ftpd/ftpd.c Fri Feb 21 09:21:02 2014 (r262285) @@ -965,6 +965,7 @@ sgetpwnam(char *name) if (save.pw_name) { free(save.pw_name); free(save.pw_passwd); + free(save.pw_class); free(save.pw_gecos); free(save.pw_dir); free(save.pw_shell); @@ -972,6 +973,7 @@ sgetpwnam(char *name) save = *p; save.pw_name = sgetsave(p->pw_name); save.pw_passwd = sgetsave(p->pw_passwd); + save.pw_class = sgetsave(p->pw_class); save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:22:38 2014 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 ESMTPS id 2B6FAB94; Fri, 21 Feb 2014 09:22:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15D88156D; Fri, 21 Feb 2014 09:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9MbhJ056596; Fri, 21 Feb 2014 09:22:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9Mbl6056595; Fri, 21 Feb 2014 09:22:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210922.s1L9Mbl6056595@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:22:37 +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: r262286 - stable/8/libexec/ftpd 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:22:38 -0000 Author: brueffer Date: Fri Feb 21 09:22:37 2014 New Revision: 262286 URL: http://svnweb.freebsd.org/changeset/base/262286 Log: MFC: r261885 In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya Modified: stable/8/libexec/ftpd/ftpd.c Directory Properties: stable/8/libexec/ftpd/ (props changed) Modified: stable/8/libexec/ftpd/ftpd.c ============================================================================== --- stable/8/libexec/ftpd/ftpd.c Fri Feb 21 09:21:02 2014 (r262285) +++ stable/8/libexec/ftpd/ftpd.c Fri Feb 21 09:22:37 2014 (r262286) @@ -967,6 +967,7 @@ sgetpwnam(char *name) if (save.pw_name) { free(save.pw_name); free(save.pw_passwd); + free(save.pw_class); free(save.pw_gecos); free(save.pw_dir); free(save.pw_shell); @@ -974,6 +975,7 @@ sgetpwnam(char *name) save = *p; save.pw_name = sgetsave(p->pw_name); save.pw_passwd = sgetsave(p->pw_passwd); + save.pw_class = sgetsave(p->pw_class); save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:25:52 2014 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 ESMTPS id EE0B620F; Fri, 21 Feb 2014 09:25:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D961315B3; Fri, 21 Feb 2014 09:25:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9PquU057163; Fri, 21 Feb 2014 09:25:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9PqvT057162; Fri, 21 Feb 2014 09:25:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210925.s1L9PqvT057162@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262287 - stable/10/usr.sbin/ppp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:25:53 -0000 Author: brueffer Date: Fri Feb 21 09:25:52 2014 New Revision: 262287 URL: http://svnweb.freebsd.org/changeset/base/262287 Log: MFC: r261900 In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian Modified: stable/10/usr.sbin/ppp/chat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ppp/chat.c ============================================================================== --- stable/10/usr.sbin/ppp/chat.c Fri Feb 21 09:22:37 2014 (r262286) +++ stable/10/usr.sbin/ppp/chat.c Fri Feb 21 09:25:52 2014 (r262287) @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:26:52 2014 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 ESMTPS id 464BF4FA; Fri, 21 Feb 2014 09:26:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31F7415C3; Fri, 21 Feb 2014 09:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9Qqua057322; Fri, 21 Feb 2014 09:26:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9QqJf057321; Fri, 21 Feb 2014 09:26:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210926.s1L9QqJf057321@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:26: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: r262288 - stable/9/usr.sbin/ppp 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:26:52 -0000 Author: brueffer Date: Fri Feb 21 09:26:51 2014 New Revision: 262288 URL: http://svnweb.freebsd.org/changeset/base/262288 Log: MFC: r261900 In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian Modified: stable/9/usr.sbin/ppp/chat.c Directory Properties: stable/9/usr.sbin/ppp/ (props changed) Modified: stable/9/usr.sbin/ppp/chat.c ============================================================================== --- stable/9/usr.sbin/ppp/chat.c Fri Feb 21 09:25:52 2014 (r262287) +++ stable/9/usr.sbin/ppp/chat.c Fri Feb 21 09:26:51 2014 (r262288) @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:27:48 2014 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 ESMTPS id 9FD846E0; Fri, 21 Feb 2014 09:27:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8914815D8; Fri, 21 Feb 2014 09:27:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9Rmsw057473; Fri, 21 Feb 2014 09:27:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9Rmj1057472; Fri, 21 Feb 2014 09:27:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210927.s1L9Rmj1057472@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:27:48 +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: r262289 - stable/8/usr.sbin/ppp 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:27:48 -0000 Author: brueffer Date: Fri Feb 21 09:27:48 2014 New Revision: 262289 URL: http://svnweb.freebsd.org/changeset/base/262289 Log: MFC: r261900 In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian Modified: stable/8/usr.sbin/ppp/chat.c Directory Properties: stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/usr.sbin/ppp/chat.c ============================================================================== --- stable/8/usr.sbin/ppp/chat.c Fri Feb 21 09:26:51 2014 (r262288) +++ stable/8/usr.sbin/ppp/chat.c Fri Feb 21 09:27:48 2014 (r262289) @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:42:51 2014 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 ESMTPS id 9014723F; Fri, 21 Feb 2014 09:42:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A00A1757; Fri, 21 Feb 2014 09:42:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9gpKb065088; Fri, 21 Feb 2014 09:42:51 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9gp4j065087; Fri, 21 Feb 2014 09:42:51 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402210942.s1L9gp4j065087@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 09:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262290 - head/libexec/dma-mbox-create 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:42:51 -0000 Author: bapt Date: Fri Feb 21 09:42:50 2014 New Revision: 262290 URL: http://svnweb.freebsd.org/changeset/base/262290 Log: Add dma-mbox-create forgotten in the previous commit Added: head/libexec/dma-mbox-create/ head/libexec/dma-mbox-create/Makefile (contents, props changed) Added: head/libexec/dma-mbox-create/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/dma-mbox-create/Makefile Fri Feb 21 09:42:50 2014 (r262290) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../contrib/dma + +CFLAGS= -I${.CURDIR}/../../contrib/dma \ + -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME \ + -DCONF_PATH='"/etc/dma"' \ + -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.9+"' + +NO_MAN= + +WARNS= 2 + +PROG= dma-mbox-create +BINGRP= mail +BINMODE= 4554 + +.include From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 09:43:35 2014 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 ESMTPS id 065F538C; Fri, 21 Feb 2014 09:43:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E51C2175E; Fri, 21 Feb 2014 09:43:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9hYTv065221; Fri, 21 Feb 2014 09:43:34 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9hYC4065220; Fri, 21 Feb 2014 09:43:34 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201402210943.s1L9hYC4065220@svn.freebsd.org> From: Attilio Rao Date: Fri, 21 Feb 2014 09:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262291 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 09:43:35 -0000 Author: attilio Date: Fri Feb 21 09:43:34 2014 New Revision: 262291 URL: http://svnweb.freebsd.org/changeset/base/262291 Log: MFC r261867: Use the right index to free swapspace after vm_page_rename(). Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Fri Feb 21 09:42:50 2014 (r262290) +++ stable/10/sys/vm/vm_object.c Fri Feb 21 09:43:34 2014 (r262291) @@ -1628,9 +1628,11 @@ vm_object_backing_scan(vm_object_t objec p = TAILQ_FIRST(&backing_object->memq); continue; } + + /* Use the old pindex to free the right page. */ if (backing_object->type == OBJT_SWAP) - swap_pager_freespace(backing_object, p->pindex, - 1); + swap_pager_freespace(backing_object, + new_pindex + backing_offset_index, 1); #if VM_NRESERVLEVEL > 0 /* From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 10:35:00 2014 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 ESMTPS id 55251F67; Fri, 21 Feb 2014 10:35:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41FBB1B8F; Fri, 21 Feb 2014 10:35:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LAZ0I1087121; Fri, 21 Feb 2014 10:35:00 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LAZ0GN087120; Fri, 21 Feb 2014 10:35:00 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402211035.s1LAZ0GN087120@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 10:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262292 - head/etc/mtree 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 10:35:00 -0000 Author: bapt Date: Fri Feb 21 10:34:59 2014 New Revision: 262292 URL: http://svnweb.freebsd.org/changeset/base/262292 Log: Fix typo Modified: head/etc/mtree/BSD.var.dist Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Fri Feb 21 09:43:34 2014 (r262291) +++ head/etc/mtree/BSD.var.dist Fri Feb 21 10:34:59 2014 (r262292) @@ -74,7 +74,7 @@ rwho gname=daemon mode=0775 .. spool - dma name=root gname=mail mode=0770 + dma uname=root gname=mail mode=0770 .. lock uname=uucp gname=dialer mode=0775 .. From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 11:06:23 2014 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 ESMTPS id 28E77D17; Fri, 21 Feb 2014 11:06:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1458A1F6C; Fri, 21 Feb 2014 11:06:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LB6MZZ099588; Fri, 21 Feb 2014 11:06:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LB6MA7099587; Fri, 21 Feb 2014 11:06:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402211106.s1LB6MA7099587@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 11:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262293 - head/libexec/dma 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 11:06:23 -0000 Author: bapt Date: Fri Feb 21 11:06:22 2014 New Revision: 262293 URL: http://svnweb.freebsd.org/changeset/base/262293 Log: Enforce mail user and group Modified: head/libexec/dma/Makefile Modified: head/libexec/dma/Makefile ============================================================================== --- head/libexec/dma/Makefile Fri Feb 21 10:34:59 2014 (r262292) +++ head/libexec/dma/Makefile Fri Feb 21 11:06:22 2014 (r262293) @@ -5,7 +5,9 @@ CFLAGS= -I${.CURDIR}/../../contrib/dma \ -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME \ -DCONF_PATH='"/etc/dma"' \ - -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.9+"' + -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.9+"' \ + -DDMA_ROOT_USER='"mailnull"' \ + -DDMA_GROUP='"mail"' DPADD= ${LIBSSL} ${LIBCRYPTO} LDADD= -lssl -lcrypto From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 12:17:28 2014 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 ESMTPS id 2C5B36E2; Fri, 21 Feb 2014 12:17:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17E8C161E; Fri, 21 Feb 2014 12:17:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LCHRpq028645; Fri, 21 Feb 2014 12:17:27 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LCHRDK028644; Fri, 21 Feb 2014 12:17:27 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201402211217.s1LCHRDK028644@svn.freebsd.org> From: Ivan Voras Date: Fri, 21 Feb 2014 12:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262294 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 12:17:28 -0000 Author: ivoras Date: Fri Feb 21 12:17:27 2014 New Revision: 262294 URL: http://svnweb.freebsd.org/changeset/base/262294 Log: Explain how and where kern.cam.ada.write_cache can be set in practical situations. Reviewed by: hrs Approved by: mav Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Fri Feb 21 11:06:22 2014 (r262293) +++ head/share/man/man4/ada.4 Fri Feb 21 12:17:27 2014 (r262294) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 21, 2014 .Dt ADA 4 .Os .Sh NAME @@ -129,8 +129,13 @@ The default is currently enabled. These variables determines whether device write cache should be enabled globally or per-device or disabled. Set to 1 to enable write cache, 0 to disable, -1 to leave it as-is. -Values modified in runtime take effect only after device reset. -The global default is currently enabled. +Values modified at runtime take effect only after device reset +.Pq using the reset subcommand of Xr camcontrol 8 . +Because of that, this setting should be changed in +.Pa /boot/loader.conf +instead of +.Pa /etc/sysctl.conf . +The global default is currently 1. The per-device default is to leave it as-is (follow global setting). .El .Sh FILES From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 13:17:11 2014 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 ESMTPS id EE4CF369; Fri, 21 Feb 2014 13:17:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFE4E1B89; Fri, 21 Feb 2014 13:17:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LDHBM1053426; Fri, 21 Feb 2014 13:17:11 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LDHBF7053421; Fri, 21 Feb 2014 13:17:11 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402211317.s1LDHBF7053421@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 13:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262295 - head/contrib/dma 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 13:17:12 -0000 Author: bapt Date: Fri Feb 21 13:17:10 2014 New Revision: 262295 URL: http://svnweb.freebsd.org/changeset/base/262295 Log: Fix build with gcc Modified: head/contrib/dma/conf.c head/contrib/dma/dma.c head/contrib/dma/mail.c Modified: head/contrib/dma/conf.c ============================================================================== --- head/contrib/dma/conf.c Fri Feb 21 12:17:27 2014 (r262294) +++ head/contrib/dma/conf.c Fri Feb 21 13:17:10 2014 (r262295) @@ -121,7 +121,7 @@ parse_authfile(const char *path) au = calloc(1, sizeof(*au)); if (au == NULL) - errlog(1, NULL); + errlog(1, "calloc failed"); data = strdup(line); au->login = strsep(&data, "|"); Modified: head/contrib/dma/dma.c ============================================================================== --- head/contrib/dma/dma.c Fri Feb 21 12:17:27 2014 (r262294) +++ head/contrib/dma/dma.c Fri Feb 21 13:17:10 2014 (r262295) @@ -464,7 +464,7 @@ main(int argc, char **argv) goto skipopts; } else if (strcmp(argv[0], "newaliases") == 0) { logident_base = "dma"; - setlogident(NULL); + setlogident("%s", logident_base); if (read_aliases() != 0) errx(1, "could not parse aliases file `%s'", config.aliases); @@ -563,7 +563,7 @@ main(int argc, char **argv) skipopts: if (logident_base == NULL) logident_base = "dma"; - setlogident(NULL); + setlogident("%s", logident_base); act.sa_handler = sighup_handler; act.sa_flags = 0; @@ -595,7 +595,7 @@ skipopts: errlog(1, "could not parse aliases file `%s'", config.aliases); if ((sender = set_from(&queue, sender)) == NULL) - errlog(1, NULL); + errlog(1, "set_from failed"); if (newspoolf(&queue) != 0) errlog(1, "can not create temp file in `%s'", config.spooldir); Modified: head/contrib/dma/mail.c ============================================================================== --- head/contrib/dma/mail.c Fri Feb 21 12:17:27 2014 (r262294) +++ head/contrib/dma/mail.c Fri Feb 21 13:17:10 2014 (r262295) @@ -332,7 +332,7 @@ newaddr: ps->pos = 0; addr = strdup(ps->addr); if (addr == NULL) - errlog(1, NULL); + errlog(1, "strdup failed"); if (add_recp(queue, addr, EXPAND_WILDCARD) != 0) errlogx(1, "invalid recipient `%s'", addr); From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 13:53:41 2014 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 ESMTPS id EFC321F0; Fri, 21 Feb 2014 13:53:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB5F810C2; Fri, 21 Feb 2014 13:53:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LDrfqM079595; Fri, 21 Feb 2014 13:53:41 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LDrfOj079594; Fri, 21 Feb 2014 13:53:41 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402211353.s1LDrfOj079594@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 13:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262296 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 13:53:42 -0000 Author: brueffer Date: Fri Feb 21 13:53:41 2014 New Revision: 262296 URL: http://svnweb.freebsd.org/changeset/base/262296 Log: Match the correct variable to the variable description. PR: 121173 Submitted by: Thomas Mueller MFC after: 1 week Modified: head/lib/libc/sys/mq_getattr.2 Modified: head/lib/libc/sys/mq_getattr.2 ============================================================================== --- head/lib/libc/sys/mq_getattr.2 Fri Feb 21 13:17:10 2014 (r262295) +++ head/lib/libc/sys/mq_getattr.2 Fri Feb 21 13:53:41 2014 (r262296) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd February 21, 2014 .Dt MQ_GETATTR 2 .Os .Sh NAME @@ -83,8 +83,8 @@ structure referenced by the .Fa mqstat argument will be set to the current state of the message queue: -.Bl -tag -width ".Va mq_flags" -.It Va mq_flags +.Bl -tag -width ".Va mq_curmsgs" +.It Va mq_curmsgs The number of messages currently on the queue. .El .Sh RETURN VALUES From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 14:14:48 2014 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 ESMTPS id EDCAACB2; Fri, 21 Feb 2014 14:14:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9AF612E0; Fri, 21 Feb 2014 14:14:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LEEmdq089598; Fri, 21 Feb 2014 14:14:48 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LEEm9Y089596; Fri, 21 Feb 2014 14:14:48 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402211414.s1LEEm9Y089596@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 14:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262297 - head/libexec/dma 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 14:14:49 -0000 Author: bapt Date: Fri Feb 21 14:14:48 2014 New Revision: 262297 URL: http://svnweb.freebsd.org/changeset/base/262297 Log: Lower warning level when built with gcc Modified: head/libexec/dma/Makefile Modified: head/libexec/dma/Makefile ============================================================================== --- head/libexec/dma/Makefile Fri Feb 21 13:53:41 2014 (r262296) +++ head/libexec/dma/Makefile Fri Feb 21 14:14:48 2014 (r262297) @@ -31,4 +31,10 @@ CLEANFILES= aliases_parse.i BINGRP= mail BINMODE= 2555 +.include + +.if ${COMPILER_TYPE} == gcc +WARNS= 5 +.endif + .include From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 16:01:50 2014 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 ESMTPS id 78E712AF; Fri, 21 Feb 2014 16:01:50 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 506DA1F55; Fri, 21 Feb 2014 16:01:50 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s1LG1ieX061666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 Feb 2014 08:01:44 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s1LG1ivM061665; Fri, 21 Feb 2014 08:01:44 -0800 (PST) (envelope-from sgk) Date: Fri, 21 Feb 2014 08:01:44 -0800 From: Steve Kargl To: Baptiste Daroussin Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221160144.GA61609@troutmask.apl.washington.edu> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402210726.s1L7QnBP007144@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 16:01:50 -0000 On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Fri Feb 21 07:26:49 2014 > New Revision: 262282 > URL: http://svnweb.freebsd.org/changeset/base/262282 > > Log: > Import Dragonfly Mail Agent into base system > > It is a small and lightweight Mail Transport Agent. > It accepts mails from locally installed Mail User Agents (MUA) and delivers the > mails either locally or to a remote destination. Remote delivery includes > several features like TLS/SSL support, SMTP authentication and NULLCLIENT. > > Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL > > Reviewed by: peter > Discussed with: emaste, bz, peter Why? There is /usr/ports/mail/dma. -- steve From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 16:14:41 2014 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 ESMTPS id 8355E827; Fri, 21 Feb 2014 16:14:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA1A108E; Fri, 21 Feb 2014 16:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LGEfRa041231; Fri, 21 Feb 2014 16:14:41 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LGEfs4041230; Fri, 21 Feb 2014 16:14:41 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402211614.s1LGEfs4041230@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 16:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262298 - head/contrib/dma 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 16:14:41 -0000 Author: bapt Date: Fri Feb 21 16:14:40 2014 New Revision: 262298 URL: http://svnweb.freebsd.org/changeset/base/262298 Log: Fix build on i386 Modified: head/contrib/dma/spool.c Modified: head/contrib/dma/spool.c ============================================================================== --- head/contrib/dma/spool.c Fri Feb 21 14:14:48 2014 (r262297) +++ head/contrib/dma/spool.c Fri Feb 21 16:14:40 2014 (r262298) @@ -415,7 +415,7 @@ flushqueue_since(unsigned int period) return (0); /* Did the flush file get touched within the last period seconds? */ - if (st.st_mtim.tv_sec + period >= now.tv_sec) + if (st.st_mtim.tv_sec + (int)period >= now.tv_sec) return (1); else return (0); From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 16:32:26 2014 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 ESMTPS id CF82CCDD; Fri, 21 Feb 2014 16:32:26 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 153151224; Fri, 21 Feb 2014 16:32:25 +0000 (UTC) Received: by mail-wg0-f41.google.com with SMTP id l18so948709wgh.2 for ; Fri, 21 Feb 2014 08:32:24 -0800 (PST) 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=wL8VFrJaoArm7+K+YKvCCygDKfgMYnRaiNlBnOc1XZw=; b=MpvWoUyFugVrc1NUJlstbYATD95Wf5T04fxyybgmL0Io0OYglOvOWT+4KQ7LrciJTv oJO8gpbE+VajwdPoFoqTBDYpHzuOD3ud4jpggSTcqMumjjbdi/tKxURG+KAVc/1Wj6iz SRs4DRIhe0w41GyYBTylQCFRDxpV8NTXHh+FBamSeOhPTeQVEnnsoFh3RZv882nAEhWs mAAIto9qETlvhL28SDr9ZgvQToOZyhKKI7RCtj/B3aFWyQ/D196qznQkrpZUQWLJKf7G XLrorZ51vMWhUN7qoGEnnAZ5vujMxVRkLNpPtqoLfw6R/uKGNRtlyRX9zHzS8TBSDHNa HQJg== X-Received: by 10.194.170.167 with SMTP id an7mr7978558wjc.39.1393000344218; Fri, 21 Feb 2014 08:32:24 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id jw4sm18181823wjc.20.2014.02.21.08.32.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 08:32:20 -0800 (PST) Sender: Baptiste Daroussin Date: Fri, 21 Feb 2014 17:32:18 +0100 From: Baptiste Daroussin To: Steve Kargl Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221163217.GJ1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CxDuMX1Cv2n9FQfo" Content-Disposition: inline In-Reply-To: <20140221160144.GA61609@troutmask.apl.washington.edu> 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 16:32:26 -0000 --CxDuMX1Cv2n9FQfo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: > > Author: bapt > > Date: Fri Feb 21 07:26:49 2014 > > New Revision: 262282 > > URL: http://svnweb.freebsd.org/changeset/base/262282 > >=20 > > Log: > > Import Dragonfly Mail Agent into base system > > =20 > > It is a small and lightweight Mail Transport Agent. > > It accepts mails from locally installed Mail User Agents (MUA) and de= livers the > > mails either locally or to a remote destination. Remote delivery incl= udes > > several features like TLS/SSL support, SMTP authentication and NULLCL= IENT. > > =20 > > Make dma conditional to new WITHOUT_DMA option and make it respect WI= THOUT_MAIL > > =20 > > Reviewed by: peter > > Discussed with: emaste, bz, peter >=20 > Why? There is /usr/ports/mail/dma. >=20 Because there are lot of case where you do not need a full smtp server in b= ase but just be able to deliver locally and/or relay mails outside, dma is very good for= that purpose. regards, Bapt --CxDuMX1Cv2n9FQfo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMHf5EACgkQ8kTtMUmk6EycVwCgwHFBl93fd0eJGIt1/p3lPDRn kjIAnj1SxEmpRR6xUney2XeOQn6C3LHO =fe06 -----END PGP SIGNATURE----- --CxDuMX1Cv2n9FQfo-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:07:25 2014 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 ESMTPS id 65157E8F; Fri, 21 Feb 2014 17:07:25 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 400F0158D; Fri, 21 Feb 2014 17:07:25 +0000 (UTC) Received: from [10.0.1.3] (c-24-6-115-18.hsd1.ca.comcast.net [24.6.115.18]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 88CB939852; Fri, 21 Feb 2014 09:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1393002444; bh=X698Ls1f9x4UIIJO8Qik05wnD6TBaHTE132nGsMhfTI=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=B1WhzbxdtXG6QSfyBA72ww0MwpN1W4dvZojXi1DLnEs8QZvmn+hmjsqA0KbmQ2Hqy EJV+ftBjpdc6ADQM3U9L8mAR84o+TDaXPBOVeb0H4WcCd19ueJ/BdBRIPTP/eL0uQO e8QeqVtz/kfiEsnleMT11YkwBGEk7a/+aqkMG5Hk= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... From: Rui Paulo In-Reply-To: <20140221163217.GJ1699@ithaqua.etoilebsd.net> Date: Fri, 21 Feb 2014 09:07:23 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:07:25 -0000 On 21 Feb 2014, at 08:32, Baptiste Daroussin wrote: > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: >> On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: >>> Author: bapt >>> Date: Fri Feb 21 07:26:49 2014 >>> New Revision: 262282 >>> URL: http://svnweb.freebsd.org/changeset/base/262282 >>>=20 >>> Log: >>> Import Dragonfly Mail Agent into base system >>>=20 >>> It is a small and lightweight Mail Transport Agent. >>> It accepts mails from locally installed Mail User Agents (MUA) and = delivers the >>> mails either locally or to a remote destination. Remote delivery = includes >>> several features like TLS/SSL support, SMTP authentication and = NULLCLIENT. >>>=20 >>> Make dma conditional to new WITHOUT_DMA option and make it respect = WITHOUT_MAIL >>>=20 >>> Reviewed by: peter >>> Discussed with: emaste, bz, peter >>=20 >> Why? There is /usr/ports/mail/dma. >>=20 > Because there are lot of case where you do not need a full smtp server = in base but just > be able to deliver locally and/or relay mails outside, dma is very = good for that > purpose. I agree with this notion and to be honest the next step should be to = remove sendmail from the base system. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:31:11 2014 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 ESMTPS id 21444ADC; Fri, 21 Feb 2014 17:31:11 +0000 (UTC) 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 E4A241863; Fri, 21 Feb 2014 17:31:10 +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 1WGtwL-000ErZ-Ru; Fri, 21 Feb 2014 17:31:09 +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 s1LHV7nB033030; Fri, 21 Feb 2014 10:31:07 -0700 (MST) (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: U2FsdGVkX194WsXGmtVn+oKJ0NUrdU9/ Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... From: Ian Lepore To: Baptiste Daroussin In-Reply-To: <201402210726.s1L7QnBP007144@svn.freebsd.org> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 21 Feb 2014 10:31:07 -0700 Message-ID: <1393003867.1145.114.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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:31:11 -0000 On Fri, 2014-02-21 at 07:26 +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Fri Feb 21 07:26:49 2014 > New Revision: 262282 > URL: http://svnweb.freebsd.org/changeset/base/262282 > > Log: > Import Dragonfly Mail Agent into base system > > It is a small and lightweight Mail Transport Agent. > It accepts mails from locally installed Mail User Agents (MUA) and delivers the > mails either locally or to a remote destination. Remote delivery includes > several features like TLS/SSL support, SMTP authentication and NULLCLIENT. > > Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL > > Reviewed by: peter > Discussed with: emaste, bz, peter > This seems to be causing "redundant redeclaration of yylval" tinderbox failures. Also, IMO, "WITHOUT_DMA" is a horrible build option name. DMA has a pretty universally understood meaning in computing, and anyone seeing that as a build option is likely to assume that meaning (and freak out a bit) rather than looking in a manpage for an alternative meaning. How about "WITHOUT_DMAGENT"? -- Ian From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:32:05 2014 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 ESMTPS id 2AAA5D7A; Fri, 21 Feb 2014 17:32:05 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE904187A; Fri, 21 Feb 2014 17:32:04 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s1LHW40U062103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 Feb 2014 09:32:04 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s1LHW42n062102; Fri, 21 Feb 2014 09:32:04 -0800 (PST) (envelope-from sgk) Date: Fri, 21 Feb 2014 09:32:04 -0800 From: Steve Kargl To: Baptiste Daroussin Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221173204.GA62009@troutmask.apl.washington.edu> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140221163217.GJ1699@ithaqua.etoilebsd.net> User-Agent: Mutt/1.5.22 (2013-10-16) 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:32:05 -0000 On Fri, Feb 21, 2014 at 05:32:18PM +0100, Baptiste Daroussin wrote: > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > > On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: > > > Author: bapt > > > Date: Fri Feb 21 07:26:49 2014 > > > New Revision: 262282 > > > URL: http://svnweb.freebsd.org/changeset/base/262282 > > > > > > Log: > > > Import Dragonfly Mail Agent into base system > > > > > > > Why? There is /usr/ports/mail/dma. > > > Because there are lot of case where you do not need a full smtp > server in base but just be able to deliver locally and/or relay > mails outside, dma is very good for that purpose. As there is already a full stmp server in base, your argument is fairly weak. Yes, I know there is now going to be a small, but vocal group of people, demanding the removal of sendmail. So, let's remove both sendmail and dma, and then let the user choose an agent from ports/mail. -- steve From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:38:48 2014 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 ESMTPS id 65305F9B; Fri, 21 Feb 2014 17:38:48 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6DF18D6; Fri, 21 Feb 2014 17:38:47 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hm4so1087941wib.7 for ; Fri, 21 Feb 2014 09:38:46 -0800 (PST) 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=5YRN4o+EGIIFxy5EzeVCsOlXKe0i3P4vA4oWnD6nQOY=; b=rkIPn0NvwdVgM0+Ddf+iLoYJnP4g9hJzphC0UJGrbIO875d1tc09tN+FRVk0zekZuM MRufmk1023avN+nHWWoHmyqSwsagrPL9Cot59gf7sJWBEgI+LhBXcs9ba8W38PZEsgLG OHShZ4VVSXGUXx7/fZijgfsc0BAtCZSz24HNbhb/v8cVtgqup1XIv7H33i7QzoFEwrce 5cQvOyHhVO4VUkongndAL+hh6F8feJnXawG8sFmqdAioZmqyWBEfcE4aNq+lF6TfDsha ADEvipzHmqLgcbzRvKF4SOJmWA4FmrmygrfaBJfNmj8PMwgsEFhCzGwhjjCpBc5jCX8u +0Pg== X-Received: by 10.180.80.103 with SMTP id q7mr4344186wix.14.1393004326065; Fri, 21 Feb 2014 09:38:46 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id f3sm9617615wiv.2.2014.02.21.09.38.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 09:38:44 -0800 (PST) Sender: Baptiste Daroussin Date: Fri, 21 Feb 2014 18:38:41 +0100 From: Baptiste Daroussin To: Rui Paulo Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221173841.GK1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yr6OvWOSyJed8q4v" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:38:48 -0000 --yr6OvWOSyJed8q4v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 21, 2014 at 09:07:23AM -0800, Rui Paulo wrote: > On 21 Feb 2014, at 08:32, Baptiste Daroussin wrote: >=20 > > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > >> On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: > >>> Author: bapt > >>> Date: Fri Feb 21 07:26:49 2014 > >>> New Revision: 262282 > >>> URL: http://svnweb.freebsd.org/changeset/base/262282 > >>>=20 > >>> Log: > >>> Import Dragonfly Mail Agent into base system > >>>=20 > >>> It is a small and lightweight Mail Transport Agent. > >>> It accepts mails from locally installed Mail User Agents (MUA) and d= elivers the > >>> mails either locally or to a remote destination. Remote delivery inc= ludes > >>> several features like TLS/SSL support, SMTP authentication and NULLC= LIENT. > >>>=20 > >>> Make dma conditional to new WITHOUT_DMA option and make it respect W= ITHOUT_MAIL > >>>=20 > >>> Reviewed by: peter > >>> Discussed with: emaste, bz, peter > >>=20 > >> Why? There is /usr/ports/mail/dma. > >>=20 > > Because there are lot of case where you do not need a full smtp server = in base but just > > be able to deliver locally and/or relay mails outside, dma is very good= for that > > purpose. >=20 > I agree with this notion and to be honest the next step should be to remo= ve sendmail from the base system. >=20 I'm strongly support that idea. regards, Bapt --yr6OvWOSyJed8q4v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMHjyEACgkQ8kTtMUmk6Ew8+wCfVs8pAcMtohktzHe1ZY6lJQOU VJ0AoJ7vP+LUnMotz4fRqehCeWqH/hWg =DM3m -----END PGP SIGNATURE----- --yr6OvWOSyJed8q4v-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:41:58 2014 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 ESMTPS id 084203C1; Fri, 21 Feb 2014 17:41:58 +0000 (UTC) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [IPv6:2a00:1450:400c:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4161D196D; Fri, 21 Feb 2014 17:41:57 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id x12so2827348wgg.32 for ; Fri, 21 Feb 2014 09:41:55 -0800 (PST) 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=8dUuDWIW61ld0dyLBKeZC3uo8brvGL8Pq6jS5dJ/+ew=; b=BRqv4NmFXnHXnC4KhGCDMDUCVM5soLESBb62trcJsTCKmkD09XYSkQ59BBaZWfkiiU 2+IREsCr1e2AEK6RZIL3z1iFr6TLpQwO+qTNcJ82pWaiUn5o5fj64K1QtyA6kcqhMQKa j9sfpUWcYgideVoCqeZCvKFF/uLHfo4sDy6JGE1DpK052L9VlHotFaLB6LTbYLHrTZG2 2Kdx0DpvAzbzlQVAWMrGH3KRmf/xTKsXcRgplMvTKuQXpjuJUAHCohWqL/sLW1GFee/f MY2I7jdsdBHrOyWp/RTcJwzhIbmEawaeWuLq9sNi7ebtjCUzWi1ysb2rgqxRO93GS7qR JG/w== X-Received: by 10.195.12.200 with SMTP id es8mr8153490wjd.77.1393004515640; Fri, 21 Feb 2014 09:41:55 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id bj3sm18617077wjb.14.2014.02.21.09.41.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 09:41:53 -0800 (PST) Sender: Baptiste Daroussin Date: Fri, 21 Feb 2014 18:41:51 +0100 From: Baptiste Daroussin To: Steve Kargl Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221174151.GL1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> <20140221173204.GA62009@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+svXpSx+RSEd8UhP" Content-Disposition: inline In-Reply-To: <20140221173204.GA62009@troutmask.apl.washington.edu> 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:41:58 -0000 --+svXpSx+RSEd8UhP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 21, 2014 at 09:32:04AM -0800, Steve Kargl wrote: > On Fri, Feb 21, 2014 at 05:32:18PM +0100, Baptiste Daroussin wrote: > > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > > > On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: > > > > Author: bapt > > > > Date: Fri Feb 21 07:26:49 2014 > > > > New Revision: 262282 > > > > URL: http://svnweb.freebsd.org/changeset/base/262282 > > > >=20 > > > > Log: > > > > Import Dragonfly Mail Agent into base system > > > > =20 > > >=20 > > > Why? There is /usr/ports/mail/dma. > > >=20 > > Because there are lot of case where you do not need a full smtp > > server in base but just be able to deliver locally and/or relay > > mails outside, dma is very good for that purpose. >=20 > As there is already a full stmp server in base, your argument is > fairly weak. Yes, I know there is now going to be a small, but > vocal group of people, demanding the removal of sendmail. So, > let's remove both sendmail and dma, and then let the user choose > an agent from ports/mail. >=20 Some tools in the base system like cron do expect a working sendmail(1), so= we need a working sendmail(1) in base regards, Bapt --+svXpSx+RSEd8UhP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMHj98ACgkQ8kTtMUmk6EzzwwCfffUu87Smbiic2w5/BJCoAE3T dgoAni+ZYkiPwFeepsNqVdNFVQ1jKtkZ =q7oc -----END PGP SIGNATURE----- --+svXpSx+RSEd8UhP-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:53:27 2014 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 ESMTPS id D3D477E5; Fri, 21 Feb 2014 17:53:27 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A90231A48; Fri, 21 Feb 2014 17:53:27 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s1LHrRC0062355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 21 Feb 2014 09:53:27 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s1LHrRos062354; Fri, 21 Feb 2014 09:53:27 -0800 (PST) (envelope-from sgk) Date: Fri, 21 Feb 2014 09:53:27 -0800 From: Steve Kargl To: Baptiste Daroussin Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221175327.GA62135@troutmask.apl.washington.edu> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> <20140221173204.GA62009@troutmask.apl.washington.edu> <20140221174151.GL1699@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140221174151.GL1699@ithaqua.etoilebsd.net> User-Agent: Mutt/1.5.22 (2013-10-16) 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:53:27 -0000 On Fri, Feb 21, 2014 at 06:41:51PM +0100, Baptiste Daroussin wrote: > On Fri, Feb 21, 2014 at 09:32:04AM -0800, Steve Kargl wrote: > > On Fri, Feb 21, 2014 at 05:32:18PM +0100, Baptiste Daroussin wrote: > > > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > > > > On Fri, Feb 21, 2014 at 07:26:49AM +0000, Baptiste Daroussin wrote: > > > > > Author: bapt > > > > > Date: Fri Feb 21 07:26:49 2014 > > > > > New Revision: 262282 > > > > > URL: http://svnweb.freebsd.org/changeset/base/262282 > > > > > > > > > > Log: > > > > > Import Dragonfly Mail Agent into base system > > > > > > > > Why? There is /usr/ports/mail/dma. > > > > > > > Because there are lot of case where you do not need a full smtp > > > server in base but just be able to deliver locally and/or relay > > > mails outside, dma is very good for that purpose. > > > > As there is already a full stmp server in base, your argument is > > fairly weak. Yes, I know there is now going to be a small, but > > vocal group of people, demanding the removal of sendmail. So, > > let's remove both sendmail and dma, and then let the user choose > > an agent from ports/mail. > > > Some tools in the base system like cron do expect a working > sendmail(1), so we need a working sendmail(1) in base > That's easily fixed by adding MAILTO="" to /etc/crontab. -- Steve From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 17:56:30 2014 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 ESMTPS id 649F796E; Fri, 21 Feb 2014 17:56:30 +0000 (UTC) Received: from mail-oa0-x22b.google.com (mail-oa0-x22b.google.com [IPv6:2607:f8b0:4003:c02::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFA1C1A5F; Fri, 21 Feb 2014 17:56:29 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id i7so1410342oag.16 for ; Fri, 21 Feb 2014 09:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GMlonR0DGAD7d3f/+f6JuykB3sRiuz6OQrUwjukypt0=; b=lysClStRkeyEuHlWpOj4CPsq8OnfzT7Xk2wCAdABb679IgrecXWTVtHWxmkH38iwQp 8H9APbgFRCteKxes6JVyhgml4qMZou1gGmDxSLEeqkj9wPCgBrGj1pU1ZCWfnu1lqIyA CmXf27drdLY4/1YmR6Hu2YauA7azS/g6tqduPvmCGNRODT8j+0+AA05Ysap8tYEtz95C pTfpgMYhtkn10FyHqgdaMXIG7uxN9RNB1fZv0NQkIzJeQUM8GcLKWjcmTy8J3yQ4F5qZ 2A6YJU7qev5qFa+ngWLgdHwQ+w9UNOUfTP1fuQVCz2LP1R9v1wN0Wa9lsNQgvSKw2HKh BQvA== MIME-Version: 1.0 X-Received: by 10.60.228.197 with SMTP id sk5mr11150211oec.9.1393005389326; Fri, 21 Feb 2014 09:56:29 -0800 (PST) Received: by 10.182.92.36 with HTTP; Fri, 21 Feb 2014 09:56:29 -0800 (PST) In-Reply-To: <20140221173841.GK1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> <20140221173841.GK1699@ithaqua.etoilebsd.net> Date: Fri, 21 Feb 2014 12:56:29 -0500 Message-ID: Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... From: Benjamin Kaduk To: Baptiste Daroussin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo , Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 17:56:30 -0000 On Fri, Feb 21, 2014 at 12:38 PM, Baptiste Daroussin wrote: > On Fri, Feb 21, 2014 at 09:07:23AM -0800, Rui Paulo wrote: > > On 21 Feb 2014, at 08:32, Baptiste Daroussin wrote: > > > > > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > > >> Why? There is /usr/ports/mail/dma. > > >> > > > Because there are lot of case where you do not need a full smtp server > in base but just > > > be able to deliver locally and/or relay mails outside, dma is very > good for that > > > purpose. > > > > I agree with this notion and to be honest the next step should be to > remove sendmail from the base system. > > > I'm strongly support that idea. > Baptiste, I appreciate that you've put a lot of thought and effort into this work, and indeed you put in Herculean amounts of effort for the project for which we should all be grateful. In particular, the addition of dma is listed as having been discussed with three other committers, and represents the potential for a very significant change in the base system that we present to our users. As such, I think that it would be beneficial for all parties, if a summary of the reasoning behind this decision could be presented to us. A quick, single-sentence reply does *not* serve this purpose; in fact it is actively working against this purpose, by seeming to brush off the concerns of others without proper consideration. I understand that your time is precious. So is the time of everyone on this list, and a small investment in a well-written description of the reasoning for this change should be able to prevent a long email thread that would waste a lot of many peoples' time. It would probably be best for this description to go to -current, instead of the svn commit lists. Thank you, Ben From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 18:03:50 2014 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 ESMTPS id 3196898; Fri, 21 Feb 2014 18:03:50 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD3A1B39; Fri, 21 Feb 2014 18:03:49 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1WGuRw-000KD9-Eh; Fri, 21 Feb 2014 22:03:48 +0400 Date: Fri, 21 Feb 2014 22:03:48 +0400 From: Slawa Olhovchenkov To: Baptiste Daroussin Subject: Re: svn commit: r262266 - in vendor/dma: . dist dist/debian dist/debian/migrate dist/debian/source dist/test Message-ID: <20140221180348.GA77368@zxy.spb.ru> References: <201402202239.s1KMdtfN091407@svn.freebsd.org> <5306B1F3.4060107@delphij.net> <20140221080448.GG1699@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140221080448.GG1699@ithaqua.etoilebsd.net> 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-all@freebsd.org, src-committers@freebsd.org, d@delphij.net, svn-src-vendor@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 18:03:50 -0000 On Fri, Feb 21, 2014 at 09:04:50AM +0100, Baptiste Daroussin wrote: > On Thu, Feb 20, 2014 at 05:54:59PM -0800, Xin Li wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA512 > > > > On 02/20/14 14:39, Baptiste Daroussin wrote: > > > Author: bapt Date: Thu Feb 20 22:39:55 2014 New Revision: 262266 > > > URL: http://svnweb.freebsd.org/changeset/base/262266 > > > > > > Log: Import dma 89702b7f14 (2013-02-13) into vendors > > > > Are we going to remove sendmail? Personally I don't think it's a good > > idea to have two different delivery agents. > > > That is not the initial goal, the initial goal is to be able do relay mail or > deliver them locally without anything listening on port 25, with something easy > to configure and with a very low footprint. This is may be done by specific submit.cf and settings in rc.conf > That said, yes I do really think that we should remove sendmail from base, if I > remember correctly the discussion each time we talked about it the conclusion > was we only need something able to relay mail to another mails server and be > able to locally deliver mails, that is exactly the definition of dma. > > to be honnest dma needs a bit of work on how it handle its retry queue, but that > might not be long to improve. > > regards, > Bapt From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 18:32:45 2014 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 ESMTPS id E4B60B1A; Fri, 21 Feb 2014 18:32:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D068E1DB9; Fri, 21 Feb 2014 18:32:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LIWjo4097439; Fri, 21 Feb 2014 18:32:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LIWjh0097438; Fri, 21 Feb 2014 18:32:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402211832.s1LIWjh0097438@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Feb 2014 18:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262299 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 18:32:46 -0000 Author: mav Date: Fri Feb 21 18:32:45 2014 New Revision: 262299 URL: http://svnweb.freebsd.org/changeset/base/262299 Log: MFC r261538: Make CTL block backend return proper error code for operations unsupposed by the underlying device. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 16:14:40 2014 (r262298) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 18:32:45 2014 (r262299) @@ -512,6 +512,7 @@ ctl_be_block_biodone(struct bio *bio) struct ctl_be_block_io *beio; struct ctl_be_block_lun *be_lun; union ctl_io *io; + int error; beio = bio->bio_caller1; be_lun = beio->lun; @@ -519,8 +520,9 @@ ctl_be_block_biodone(struct bio *bio) DPRINTF("entered\n"); + error = bio->bio_error; mtx_lock(&be_lun->lock); - if (bio->bio_error != 0) + if (error != 0) beio->num_errors++; beio->num_bios_done++; @@ -552,7 +554,9 @@ ctl_be_block_biodone(struct bio *bio) * entire I/O with a medium error. */ if (beio->num_errors > 0) { - if (beio->bio_cmd == BIO_FLUSH) { + if (error == EOPNOTSUPP) { + ctl_set_invalid_opcode(&io->scsiio); + } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 18:33:55 2014 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 ESMTPS id 6D793C6E; Fri, 21 Feb 2014 18:33:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58BA01DC5; Fri, 21 Feb 2014 18:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LIXtWf097644; Fri, 21 Feb 2014 18:33:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LIXt97097643; Fri, 21 Feb 2014 18:33:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402211833.s1LIXt97097643@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Feb 2014 18:33:55 +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: r262300 - stable/9/sys/cam/ctl 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 18:33:55 -0000 Author: mav Date: Fri Feb 21 18:33:54 2014 New Revision: 262300 URL: http://svnweb.freebsd.org/changeset/base/262300 Log: MFC r261538: Make CTL block backend return proper error code for operations unsupposed by the underlying device. Modified: stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 18:32:45 2014 (r262299) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 18:33:54 2014 (r262300) @@ -512,6 +512,7 @@ ctl_be_block_biodone(struct bio *bio) struct ctl_be_block_io *beio; struct ctl_be_block_lun *be_lun; union ctl_io *io; + int error; beio = bio->bio_caller1; be_lun = beio->lun; @@ -519,8 +520,9 @@ ctl_be_block_biodone(struct bio *bio) DPRINTF("entered\n"); + error = bio->bio_error; mtx_lock(&be_lun->lock); - if (bio->bio_error != 0) + if (error != 0) beio->num_errors++; beio->num_bios_done++; @@ -552,7 +554,9 @@ ctl_be_block_biodone(struct bio *bio) * entire I/O with a medium error. */ if (beio->num_errors > 0) { - if (beio->bio_cmd == BIO_FLUSH) { + if (error == EOPNOTSUPP) { + ctl_set_invalid_opcode(&io->scsiio); + } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 19:31:52 2014 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 ESMTPS id AB78D9C5; Fri, 21 Feb 2014 19:31:52 +0000 (UTC) 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 E0A4D1468; Fri, 21 Feb 2014 19:31:51 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id k14so2806395wgh.26 for ; Fri, 21 Feb 2014 11:31:50 -0800 (PST) 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=mBk6qtmyIz7Yi5smNRfDOKObgeH9jK3cTszJ0g+QqGw=; b=OPerRAdLCiX9jrELo0rGtBWHE5PWw+7KkQajsfV/2p7/qeZSGD2m++CXmSr9uNB4zk wDGzIQuVuBlGB0ig8V6+9yrHEPJivPj+OEOT3i0DrO/9uXNU+oVWpKzgogYKyua3WZ3/ E9kRbrPsKXzLEHl6bqANhGV+VG03ui9oy65zXB+WbkWkugdnqwPghkQnsAtbWhxXvhh3 V8cEqS0ENhJ2/ebVUuKjHo6UmPtLF8SdeFdduS6d3+Ab1Tcg4JXsjq6q5FIhd81C7xQ7 HXK6By4G6/vkQxVHRoGWpNJ9gBzLbSdDfjA3tPil6qLBG1F9HTE+zokL1URWXhKeBRfx FvSg== X-Received: by 10.194.77.7 with SMTP id o7mr8631391wjw.35.1393011110105; Fri, 21 Feb 2014 11:31:50 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id de3sm19273904wjb.8.2014.02.21.11.31.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 11:31:48 -0800 (PST) Sender: Baptiste Daroussin Date: Fri, 21 Feb 2014 20:31:46 +0100 From: Baptiste Daroussin To: Benjamin Kaduk Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140221193145.GN1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140221160144.GA61609@troutmask.apl.washington.edu> <20140221163217.GJ1699@ithaqua.etoilebsd.net> <20140221173841.GK1699@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l3ej7W/Jb2pB3qL2" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo , Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 19:31:52 -0000 --l3ej7W/Jb2pB3qL2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 21, 2014 at 12:56:29PM -0500, Benjamin Kaduk wrote: > On Fri, Feb 21, 2014 at 12:38 PM, Baptiste Daroussin wr= ote: >=20 > > On Fri, Feb 21, 2014 at 09:07:23AM -0800, Rui Paulo wrote: > > > On 21 Feb 2014, at 08:32, Baptiste Daroussin wrote: > > > > > > > On Fri, Feb 21, 2014 at 08:01:44AM -0800, Steve Kargl wrote: > > > >> Why? There is /usr/ports/mail/dma. > > > >> > > > > Because there are lot of case where you do not need a full smtp ser= ver > > in base but just > > > > be able to deliver locally and/or relay mails outside, dma is very > > good for that > > > > purpose. > > > > > > I agree with this notion and to be honest the next step should be to > > remove sendmail from the base system. > > > > > I'm strongly support that idea. > > >=20 > Baptiste, >=20 > I appreciate that you've put a lot of thought and effort into this work, > and indeed you put in Herculean amounts of effort for the project for whi= ch > we should all be grateful. > In particular, the addition of dma is listed as having been discussed with > three other committers, and represents the potential for a very significa= nt > change in the base system that we present to our users. As such, I think > that it would be beneficial for all parties, if a summary of the reasoning > behind this decision could be presented to us. A quick, single-sentence > reply does *not* serve this purpose; in fact it is actively working again= st > this purpose, by seeming to brush off the concerns of others without prop= er > consideration. >=20 > I understand that your time is precious. So is the time of everyone on > this list, and a small investment in a well-written description of the > reasoning for this change should be able to prevent a long email thread > that would waste a lot of many peoples' time. It would probably be best > for this description to go to -current, instead of the svn commit lists. >=20 You are right I ll prepare a mail describing all that to current@. regards, Bapt --l3ej7W/Jb2pB3qL2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMHqaEACgkQ8kTtMUmk6Eyr+wCgnbEQOJwY6cgvQEz4q+8i9ha6 VFEAn1BKbu9i0KohF7XYzk5a2RduJeIy =Jx7c -----END PGP SIGNATURE----- --l3ej7W/Jb2pB3qL2-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 20:55:34 2014 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 ESMTPS id AD2792E3; Fri, 21 Feb 2014 20:55:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96BBF1B3E; Fri, 21 Feb 2014 20:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LKtYGZ055448; Fri, 21 Feb 2014 20:55:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LKtYlE055447; Fri, 21 Feb 2014 20:55:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402212055.s1LKtYlE055447@svn.freebsd.org> From: Dimitry Andric Date: Fri, 21 Feb 2014 20:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262303 - head/contrib/llvm/tools/clang/lib/Driver 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 20:55:34 -0000 Author: dim Date: Fri Feb 21 20:55:34 2014 New Revision: 262303 URL: http://svnweb.freebsd.org/changeset/base/262303 Log: Pull in r197521 from upstream clang trunk (by rdivacky): Use the integrated assembler by default on FreeBSD/ppc and ppc64. Requested by: jhibbits MFC after: 1 month X-MFC-With: r261991 Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Fri Feb 21 19:58:45 2014 (r262302) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Fri Feb 21 20:55:34 2014 (r262303) @@ -512,7 +512,12 @@ public: virtual void AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const; - + virtual bool IsIntegratedAssemblerDefault() const { + if (getTriple().getArch() == llvm::Triple::ppc || + getTriple().getArch() == llvm::Triple::ppc64) + return true; + return Generic_ELF::IsIntegratedAssemblerDefault(); + } virtual bool UseSjLjExceptions() const; protected: From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 21:02:20 2014 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 ESMTPS id BD34F4CC; Fri, 21 Feb 2014 21:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A64401C09; Fri, 21 Feb 2014 21:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LL2KiA059264; Fri, 21 Feb 2014 21:02:20 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LL2KYB059260; Fri, 21 Feb 2014 21:02:20 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402212102.s1LL2KYB059260@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 21 Feb 2014 21:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262304 - in head/etc: . dma 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 21:02:20 -0000 Author: bapt Date: Fri Feb 21 21:02:19 2014 New Revision: 262304 URL: http://svnweb.freebsd.org/changeset/base/262304 Log: Install a default configuration file for dma Suggested by: flo Added: head/etc/dma/ head/etc/dma/Makefile (contents, props changed) head/etc/dma/dma.conf (contents, props changed) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Feb 21 20:55:34 2014 (r262303) +++ head/etc/Makefile Fri Feb 21 21:02:19 2014 (r262304) @@ -226,6 +226,9 @@ distribution: .endif ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install +.if ${MK_DMA} != "no" + ${_+_}cd ${.CURDIR}/dma; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" Added: head/etc/dma/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/dma/Makefile Fri Feb 21 21:02:19 2014 (r262304) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +FILES= dma.conf + +NO_OBJ= +FILESDIR= /etc/dma + +.include Added: head/etc/dma/dma.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/dma/dma.conf Fri Feb 21 21:02:19 2014 (r262304) @@ -0,0 +1,64 @@ +# $FreeBSD$ +# +# Your smarthost (also called relayhost). Leave blank if you don't want +# smarthost support. +#SMARTHOST + +# Use this SMTP port. Most users will be fine with the default (25) +#PORT 25 + +# Path to your alias file. Just stay with the default. +#ALIASES /etc/aliases + +# Path to your spooldir. Just stay with the default. +#SPOOLDIR /var/spool/dma + +# SMTP authentication +#AUTHPATH /etc/dma/auth.conf + +# Uncomment if yout want TLS/SSL support +#SECURETRANSFER + +# Uncomment if you want STARTTLS support (only used in combination with +# SECURETRANSFER) +#STARTTLS + +# Uncomment if you have specified STARTTLS above and it should be allowed +# to fail ("opportunistic TLS", use an encrypted connection when available +# but allow an unencrypted one to servers that do not support it) +#OPPORTUNISTIC_TLS + +# Path to your local SSL certificate +#CERTFILE + +# If you want to use plain text SMTP login without using encryption, change +# the SECURE entry below to INSECURE. Otherwise plain login will only work +# over a secure connection. Use this option with caution. +#SECURE + +# Uncomment if you want to defer your mails. This is useful if you are +# behind a dialup line. You have to submit your mails manually with dma -q +#DEFER + +# Uncomment if you want the bounce message to include the complete original +# message, not just the headers. +#FULLBOUNCE + +# The internet hostname dma uses to identify the host. +# If not set or empty, the result of gethostname(2) is used. +# If MAILNAME is an absolute path to a file, the first line of this file +# will be used as the hostname. +#MAILNAME mail.example.net + +# Masquerade envelope from addresses with this address/hostname. +# Use this if mails are not accepted by destination mail servers because +# your sender domain is invalid. +# By default, MASQUERADE is not set. +# Format: MASQUERADE [user@][host] +# Examples: +# MASQUERADE john@ on host "hamlet" will send all mails as john@hamlet +# MASQUERADE percolator will send mails as $username@percolator, e.g. fish@percolator +# MASQUERADE herb@ert will send all mails as herb@ert + +# Directly forward the mail to the SMARTHOST bypassing aliases and local delivery +#NULLCLIENT From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 22:29:09 2014 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 ESMTPS id EB70E2D5; Fri, 21 Feb 2014 22:29:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D7EE613DE; Fri, 21 Feb 2014 22:29:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LMT9BL093588; Fri, 21 Feb 2014 22:29:09 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LMT9BF093587; Fri, 21 Feb 2014 22:29:09 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201402212229.s1LMT9BF093587@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 21 Feb 2014 22:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262309 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 22:29:10 -0000 Author: mjg Date: Fri Feb 21 22:29:09 2014 New Revision: 262309 URL: http://svnweb.freebsd.org/changeset/base/262309 Log: Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading to use-after-free. fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but kern_proc_{o,}filedesc_out only checked for hold count. MFC after: 3 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Feb 21 21:54:36 2014 (r262308) +++ head/sys/kern/kern_descrip.c Fri Feb 21 22:29:09 2014 (r262309) @@ -3056,7 +3056,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE if (fdp->fd_jdir != NULL) export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif, fdp, req); - for (i = 0; i < fdp->fd_nfiles; i++) { + for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; bzero(kif, sizeof(*kif)); @@ -3424,7 +3424,7 @@ kern_proc_filedesc_out(struct proc *p, export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, FREAD, -1, -1, NULL, efbuf); } - for (i = 0; i < fdp->fd_nfiles; i++) { + for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; data = NULL; From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 22:38:26 2014 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 ESMTPS id 0656F612; Fri, 21 Feb 2014 22:38:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCA3E1529; Fri, 21 Feb 2014 22:38:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LMcPLG097562; Fri, 21 Feb 2014 22:38:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LMcPnY097559; Fri, 21 Feb 2014 22:38:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402212238.s1LMcPnY097559@svn.freebsd.org> From: Dimitry Andric Date: Fri, 21 Feb 2014 22:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262310 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 22:38:26 -0000 Author: dim Date: Fri Feb 21 22:38:25 2014 New Revision: 262310 URL: http://svnweb.freebsd.org/changeset/base/262310 Log: Move the part in bsd.own.mk that sets -Wno-c++11-extensions for clang to bsd.sys.mk, where it really belongs. This also causes the flag to get added when clang is *not* the default system compiler, but is still used, e.g. by setting WITH_CLANG_IS_CC manually. MFC after: 3 days Modified: head/share/mk/bsd.own.mk head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Feb 21 22:29:09 2014 (r262309) +++ head/share/mk/bsd.own.mk Fri Feb 21 22:38:25 2014 (r262310) @@ -420,15 +420,6 @@ __DEFAULT_YES_OPTIONS+=GCC .else __DEFAULT_NO_OPTIONS+=GCC GNUCXX .endif -# The libc++ headers use c++11 extensions. These are normally silenced because -# they are treated as system headers, but we explicitly disable that warning -# suppression when building the base system to catch bugs in our headers. -# Eventually we'll want to start building the base system C++ code as C++11, -# but not yet. -_COMPVERSION!= ${CC} --version -.if ${_COMPVERSION:Mclang} -CXXFLAGS+= -Wno-c++11-extensions -.endif .else # If clang is not cc, then build gcc by default __DEFAULT_NO_OPTIONS+=CLANG_IS_CC Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Feb 21 22:29:09 2014 (r262309) +++ head/share/mk/bsd.sys.mk Fri Feb 21 22:38:25 2014 (r262310) @@ -120,6 +120,12 @@ CLANG_NO_IAS= -no-integrated-as CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret CFLAGS+= -Qunused-arguments +# The libc++ headers use c++11 extensions. These are normally silenced because +# they are treated as system headers, but we explicitly disable that warning +# suppression when building the base system to catch bugs in our headers. +# Eventually we'll want to start building the base system C++ code as C++11, +# but not yet. +CXXFLAGS+= -Wno-c++11-extensions CFLAGS+= ${CFLAGS.clang} CXXFLAGS+= ${CXXFLAGS.clang} .else # !CLANG From owner-svn-src-all@FreeBSD.ORG Fri Feb 21 22:45:35 2014 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 ESMTPS id 9F1E58DC; Fri, 21 Feb 2014 22:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8833015F7; Fri, 21 Feb 2014 22:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LMjZ2u001439; Fri, 21 Feb 2014 22:45:35 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LMjZTO001438; Fri, 21 Feb 2014 22:45:35 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201402212245.s1LMjZTO001438@svn.freebsd.org> From: Peter Grehan Date: Fri, 21 Feb 2014 22:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262311 - head/usr.sbin/bhyve 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.17 Precedence: list List-Id: "SVN commit messages 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, 21 Feb 2014 22:45:35 -0000 Author: grehan Date: Fri Feb 21 22:45:35 2014 New Revision: 262311 URL: http://svnweb.freebsd.org/changeset/base/262311 Log: Fix virtio spec URL. Submitted by: lwhsu MFC after: 1 week Modified: head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Fri Feb 21 22:38:25 2014 (r262310) +++ head/usr.sbin/bhyve/virtio.h Fri Feb 21 22:45:35 2014 (r262311) @@ -33,7 +33,7 @@ * These are derived from several virtio specifications. * * Some useful links: - * https://github.com/rustyrussel/virtio-spec + * https://github.com/rustyrussell/virtio-spec * http://people.redhat.com/pbonzini/virtio-spec.pdf */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 00:30:33 2014 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 ESMTPS id A5639FC1; Sat, 22 Feb 2014 00:30:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F14D1DC5; Sat, 22 Feb 2014 00:30:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0UXa9044249; Sat, 22 Feb 2014 00:30:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0UX3T044248; Sat, 22 Feb 2014 00:30:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220030.s1M0UX3T044248@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262318 - stable/10/sys/geom/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 00:30:33 -0000 Author: delphij Date: Sat Feb 22 00:30:33 2014 New Revision: 262318 URL: http://svnweb.freebsd.org/changeset/base/262318 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/10/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/10/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:16:27 2014 (r262317) +++ stable/10/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 00:41:04 2014 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 ESMTPS id 97DAD1F6; Sat, 22 Feb 2014 00:41:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0541FE6; Sat, 22 Feb 2014 00:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0f46I047907; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0f4To047906; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220041.s1M0f4To047906@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:41:04 +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: r262319 - in stable: 7/sys/geom/eli 8/sys/geom/eli 9/sys/geom/eli 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 00:41:04 -0000 Author: delphij Date: Sat Feb 22 00:41:03 2014 New Revision: 262319 URL: http://svnweb.freebsd.org/changeset/base/262319 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/9/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/geom/eli/g_eli_crypto.c stable/8/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/7/sys/ (props changed) stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/9/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/9/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) +++ stable/9/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:41:03 2014 (r262319) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 00:41:04 2014 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 ESMTPS id E6D181F7; Sat, 22 Feb 2014 00:41:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D27781FE7; Sat, 22 Feb 2014 00:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0f4i0047913; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0f4oc047912; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220041.s1M0f4oc047912@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:41: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: r262319 - in stable: 7/sys/geom/eli 8/sys/geom/eli 9/sys/geom/eli 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 00:41:05 -0000 Author: delphij Date: Sat Feb 22 00:41:03 2014 New Revision: 262319 URL: http://svnweb.freebsd.org/changeset/base/262319 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/8/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/geom/eli/g_eli_crypto.c stable/9/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/7/sys/ (props changed) stable/9/sys/ (props changed) Modified: stable/8/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/8/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) +++ stable/8/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:41:03 2014 (r262319) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 00:41:05 2014 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 ESMTPS id 4AE261F8; Sat, 22 Feb 2014 00:41:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 370FB1FE8; Sat, 22 Feb 2014 00:41:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0f5rG047919; Sat, 22 Feb 2014 00:41:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0f5bU047918; Sat, 22 Feb 2014 00:41:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220041.s1M0f5bU047918@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r262319 - in stable: 7/sys/geom/eli 8/sys/geom/eli 9/sys/geom/eli X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 00:41:05 -0000 Author: delphij Date: Sat Feb 22 00:41:03 2014 New Revision: 262319 URL: http://svnweb.freebsd.org/changeset/base/262319 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/7/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/7/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/geom/eli/g_eli_crypto.c stable/9/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) stable/9/sys/ (props changed) Modified: stable/7/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/7/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) +++ stable/7/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:41:03 2014 (r262319) @@ -250,6 +250,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 00:57:56 2014 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 ESMTPS id 5DCF4695; Sat, 22 Feb 2014 00:57:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46FDC10F3; Sat, 22 Feb 2014 00:57:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0vuTb054885; Sat, 22 Feb 2014 00:57:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0vubs054884; Sat, 22 Feb 2014 00:57:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220057.s1M0vubs054884@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262320 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 00:57:56 -0000 Author: delphij Date: Sat Feb 22 00:57:55 2014 New Revision: 262320 URL: http://svnweb.freebsd.org/changeset/base/262320 Log: MFC r261620: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 00:41:03 2014 (r262319) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 00:57:55 2014 (r262320) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1415,7 +1416,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 01:09:14 2014 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 ESMTPS id 8E246A12; Sat, 22 Feb 2014 01:09:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7714311CA; Sat, 22 Feb 2014 01:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M19E3u059557; Sat, 22 Feb 2014 01:09:14 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M19C5w059539; Sat, 22 Feb 2014 01:09:12 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402220109.s1M19C5w059539@svn.freebsd.org> From: Peter Wemm Date: Sat, 22 Feb 2014 01:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262321 - in vendor/serf/dist: . auth buckets build 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 01:09:14 -0000 Author: peter Date: Sat Feb 22 01:09:12 2014 New Revision: 262321 URL: http://svnweb.freebsd.org/changeset/base/262321 Log: Vendor import serf-1.3.4 Modified: vendor/serf/dist/CHANGES vendor/serf/dist/README vendor/serf/dist/SConstruct vendor/serf/dist/auth/auth.c vendor/serf/dist/auth/auth.h vendor/serf/dist/auth/auth_basic.c vendor/serf/dist/auth/auth_digest.c vendor/serf/dist/auth/auth_spnego.c vendor/serf/dist/auth/auth_spnego.h vendor/serf/dist/auth/auth_spnego_gss.c vendor/serf/dist/auth/auth_spnego_sspi.c vendor/serf/dist/buckets/headers_buckets.c vendor/serf/dist/buckets/response_buckets.c vendor/serf/dist/buckets/socket_buckets.c vendor/serf/dist/buckets/ssl_buckets.c vendor/serf/dist/build/check.py vendor/serf/dist/build/gen_def.py vendor/serf/dist/build/serf.pc.in vendor/serf/dist/context.c vendor/serf/dist/outgoing.c vendor/serf/dist/serf.h vendor/serf/dist/serf_private.h vendor/serf/dist/ssltunnel.c Modified: vendor/serf/dist/CHANGES ============================================================================== --- vendor/serf/dist/CHANGES Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/CHANGES Sat Feb 22 01:09:12 2014 (r262321) @@ -1,4 +1,59 @@ -Serf 1.3.0 [2013-07-23, from /tags/1.3.0] +Serf 1.3.4 [2014-02-08, from /tags/1.3.4, rxxxx] + Fix issue #119: Endless loop during ssl tunnel setup with Negotiate authn + Fix issue #123: Can't setup ssl tunnel which sends Connection close header + Fix a race condition when initializing OpenSSL from multiple threads (r2263) + Fix issue #138: Incorrect pkg-config file when GSSAPI isn't configured + + +Serf 1.3.3 [2013-12-09, from /tags/1.3.3, r2242] + Fix issue 129: Try more addresses of multihomed servers + Handle X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE correctly (r2225) + Return APR_TIMEUP from poll() to enable detecting connection timeouts (r2183) + + +Serf 1.3.2 [2013-10-04, from /tags/1.3.2, r2195] + Fix issue 130: HTTP headers should be treated case-insensitively + Fix issue 126: Compilation breaks with Codewarrior compiler + Fix crash during cleanup of SSL buckets in apr_terminate() (r2145) + Fix Windows build: Also export functions with capital letters in .def file + Fix host header when url contains a username or password (r2170) + Ensure less TCP package fragmentation on Windows (r2145) + Handle authentication for responses to HEAD requests (r2178,-9) + Improve serf_get: add option to add request headers, allow url with query, + allow HEAD requests (r2143,r2175,-6) + Improve RFC conformance: don't expect body for certain responses (r2011,-2) + Do not invoke progress callback when no data was received (r2144) + And more test suite fixes and build warning cleanups + SCons-related fixes: + Fix build when GSSAPI not in default include path (2155) + Fix OpenBSD build: always map all LIBPATH entries into RPATH (r2156) + Checksum generation in Windows shared libraries for release builds (2162) + Mac OS X: Use MAJOR version only in dylib install name (r2161) + Use both MAJOR and MINOR version for the shared library name (2163) + Fix the .pc file when installing serf in a non-default LIBDIR (r2191) + + +Serf 1.3.1 [2013-08-15, from /tags/1.3.1, r2138] + Fix issue 77: Endless loop if server doesn't accept Negotiate authentication. + Fix issue 114: ssl/tls renegotiation fails + Fix issue 120: error with ssl tunnel over proxy with KeepAlive off and + Basic authentication. + Fixed bugs with authentication (r2057,2115,2118) + SCons-related fixes: + Fix issue 111: add flag to set custom library path + Fix issue 112: add soname + Fix issue 113: add gssapi libs in the serf pc file + Fix issue 115: Setting RPATH on Solaris broken in SConstruct + Fix issue 116: scons check should return non-zero exit staths + Fix issue 121: make CFLAGS, LIBS, LINKFLAGS and CPPFLAGS take a space- + separated list of flags. + Fix issue 122: make scons PREFIX create the folder if it doesn't exist + Mac OS X: Fix scons --install-sandbox + Solaris: Fix build with cc, don't use unsupported compiler flags + Require SCons version 2.3.0 or higher now (for the soname support). + + +Serf 1.3.0 [2013-07-23, from /tags/1.3.0, r2074] Fix issue 83: use PATH rather than URI within an ssltunnel (r1952) Fix issue 108: improved error reporting from the underlying socket (r1951) NEW: Switch to the SCons build system; retire serfmake, serf.mak, autotools Modified: vendor/serf/dist/README ============================================================================== --- vendor/serf/dist/README Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/README Sat Feb 22 01:09:12 2014 (r262321) @@ -18,14 +18,14 @@ kept to a minimum to provide high perfor 1.1. SCons build system -serf uses SCons 2.x for its build system. If it is not installed on +serf uses SCons 2.3 for its build system. If it is not installed on your system, then you can install it onto your system. If you do not have permissions, then you can download and install the "local" version into your home directory. When installed privately, simply create a symlink for 'scons' in your PATH to /path/to/scons/scons.py. Fetch the scons-local package: - http://prdownloads.sourceforge.net/scons/scons-local-2.0.1.tar.gz + http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz 1.2 Building serf @@ -54,6 +54,12 @@ distinct directory from the source), you $ scons -Y /path/to/serf/source +If you plan to install the library on a system that uses different +paths for architecture dependent files, specify LIBDIR. LIBDIR defaults +to /usr/local/lib otherwise. Example for a 64 bit GNU/Linux system: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 + At any point, the current settings can be examined: $ scons --help @@ -74,6 +80,13 @@ specified on the install command line: $ scons PREFIX=/some/path install +Distribution package maintainers regulary install to a buildroot, and +would normally use something like below in their build systems, with +placeholders for the specific paths: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 +$ scons install --install-sandbox=/path/to/buildroot + 1.4 Cleaning up the build Modified: vendor/serf/dist/SConstruct ============================================================================== --- vendor/serf/dist/SConstruct Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/SConstruct Sat Feb 22 01:09:12 2014 (r262321) @@ -19,6 +19,8 @@ import sys import os import re +EnsureSConsVersion(2,3,0) + HEADER_FILES = ['serf.h', 'serf_bucket_types.h', 'serf_bucket_util.h', @@ -34,23 +36,35 @@ def _converter(val): if val == 'none': val = [] else: - val = val.split(',') + val = val.split(' ') return val def RawListVariable(key, help, default): """ The input parameters describe a 'raw string list' option. This class - accepts a comma separated list and converts it to a space separated - list. + accepts a space-separated string and converts it to a list. """ return (key, '%s' % (help), default, None, lambda val: _converter(val)) +# Custom path validator, creates directory when a specified option is set. +# To be used to ensure a PREFIX directory is only created when installing. +def createPathIsDirCreateWithTarget(target): + def my_validator(key, val, env): + build_targets = (map(str, BUILD_TARGETS)) + if target in build_targets: + return PathVariable.PathIsDirCreate(key, val, env) + else: + return PathVariable.PathAccept(key, val, env) + return my_validator + # default directories if sys.platform == 'win32': + default_incdir='..' default_libdir='..' default_prefix='Debug' else: - default_libdir='/usr' + default_incdir='/usr' + default_libdir='$PREFIX/lib' default_prefix='/usr/local' opts = Variables(files=[SAVED_CONFIG]) @@ -58,22 +72,26 @@ opts.AddVariables( PathVariable('PREFIX', 'Directory to install under', default_prefix, - PathVariable.PathIsDir), + createPathIsDirCreateWithTarget('install')), + PathVariable('LIBDIR', + 'Directory to install architecture dependent libraries under', + default_libdir, + createPathIsDirCreateWithTarget('install')), PathVariable('APR', "Path to apr-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('APU', "Path to apu-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('OPENSSL', "Path to OpenSSL's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('ZLIB', "Path to zlib's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('GSSAPI', "Path to GSSAPI's install area", @@ -86,14 +104,14 @@ opts.AddVariables( "Enable using a static compiled APR", False), RawListVariable('CC', "Command name or path of the C compiler", None), - RawListVariable('CFLAGS', "Extra flags for the C compiler (comma separated)", + RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)", None), RawListVariable('LIBS', "Extra libraries passed to the linker, " - "e.g. -l (comma separated)", None), - RawListVariable('LINKFLAGS', "Extra flags for the linker (comma separated)", + "e.g. \"-l -l\" (space separated)", None), + RawListVariable('LINKFLAGS', "Extra flags for the linker (space-separated)", None), RawListVariable('CPPFLAGS', "Extra flags for the C preprocessor " - "(comma separated)", None), + "(space separated)", None), ) if sys.platform == 'win32': @@ -146,6 +164,8 @@ match = re.search('SERF_MAJOR_VERSION ([ re.DOTALL) MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] env.Append(MAJOR=str(MAJOR)) +env.Append(MINOR=str(MINOR)) +env.Append(PATCH=str(PATCH)) # Calling external programs is okay if we're not cleaning or printing help. # (cleaning: no sense in fetching information; help: we may not know where @@ -181,10 +201,18 @@ opts.Save(SAVED_CONFIG, env) # PLATFORM-SPECIFIC BUILD TWEAKS thisdir = os.getcwd() -libdir = '$PREFIX/lib' +libdir = '$LIBDIR' incdir = '$PREFIX/include/serf-$MAJOR' -LIBNAME = 'libserf-${MAJOR}' +# This version string is used in the dynamic library name, and for Mac OS X also +# for the current_version and compatibility_version options in the .dylib +# +# Unfortunately we can't set the .dylib compatibility_version option separately +# from current_version, so don't use the PATCH level to avoid that build and +# runtime patch levels have to be identical. +env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0) + +LIBNAME = 'libserf-%d' % (MAJOR,) if sys.platform != 'win32': LIBNAMESTATIC = LIBNAME else: @@ -196,23 +224,17 @@ env.Append(RPATH=libdir, if sys.platform == 'darwin': # linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,)) env.Append(LINKFLAGS='-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)) - # 'man ld' says positive non-zero for the first number, so we add one. - # Mac's interpretation of compatibility is the same as our MINOR version. - env.Append(LINKFLAGS='-Wl,-compatibility_version,%d' % (MINOR+1,)) - env.Append(LINKFLAGS='-Wl,-current_version,%d.%d' % (MINOR+1, PATCH,)) if sys.platform != 'win32': ### gcc only. figure out appropriate test / better way to check these ### flags, and check for gcc. env.Append(CFLAGS='-std=c89') - env.Append(CCFLAGS=[ - '-Wdeclaration-after-statement', - '-Wmissing-prototypes', - ]) - ### -Wall is not available on Solaris + ### These warnings are not available on Solaris if sys.platform != 'sunos5': - env.Append(CCFLAGS='-Wall') + env.Append(CCFLAGS=['-Wdeclaration-after-statement', + '-Wmissing-prototypes', + '-Wall']) if debug: env.Append(CCFLAGS='-g') @@ -239,6 +261,7 @@ else: # Optimize for speed, use DLL runtime env.Append(CCFLAGS=['/O2', '/MD']) env.Append(CPPDEFINES='NDEBUG') + env.Append(LINKFLAGS='/RELEASE') # PLAN THE BUILD SHARED_SOURCES = [] @@ -334,28 +357,32 @@ else: # If build with gssapi, get its information and define SERF_HAVE_GSSAPI if gssapi and CALLOUT_OKAY: - env.ParseConfig('$GSSAPI --libs gssapi') + env.ParseConfig('$GSSAPI --cflags gssapi') + def parse_libs(env, cmd, unique=1): + env['GSSAPI_LIBS'] = cmd.strip() + return env.MergeFlags(cmd, unique) + env.ParseConfig('$GSSAPI --libs gssapi', parse_libs) env.Append(CPPDEFINES='SERF_HAVE_GSSAPI') if sys.platform == 'win32': env.Append(CPPDEFINES=['SERF_HAVE_SSPI']) -# On Solaris, the -R values that APR describes never make it into actual +# On some systems, the -R values that APR describes never make it into actual # RPATH flags. We'll manually map all directories in LIBPATH into new # flags to set RPATH values. -if sys.platform == 'sunos5': - for d in env['LIBPATH']: - env.Append(RPATH=d) +for d in env['LIBPATH']: + env.Append(RPATH=':'+d) # Set up the construction of serf-*.pc -# TODO: add gssapi libs pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,), env.File('build/serf.pc.in'), SUBST_DICT = { '@MAJOR@': str(MAJOR), '@PREFIX@': '$PREFIX', + '@LIBDIR@': '$LIBDIR', '@INCLUDE_SUBDIR@': 'serf-%d' % (MAJOR,), '@VERSION@': '%d.%d.%d' % (MAJOR, MINOR, PATCH), - '@LIBS@': '%s %s -lz' % (apu_libs, apr_libs), + '@LIBS@': '%s %s %s -lz' % (apu_libs, apr_libs, + env.get('GSSAPI_LIBS', '')), }) env.Default(lib_static, lib_shared, pkgconfig) @@ -371,16 +398,22 @@ if CALLOUT_OKAY: # INSTALLATION STUFF install_static = env.Install(libdir, lib_static) -install_shared = env.Install(libdir, lib_shared) +install_shared = env.InstallVersionedLib(libdir, lib_shared) if sys.platform == 'darwin': + # Change the shared library install name (id) to its final name and location. + # Notes: + # If --install-sandbox= is specified, install_shared_path will point + # to a path in the sandbox. We can't use that path because the sandbox is + # only a temporary location. The id should be the final target path. + # Also, we shouldn't use the complete version number for id, as that'll + # make applications depend on the exact major.minor.patch version of serf. + install_shared_path = install_shared[0].abspath + target_install_shared_path = os.path.join(libdir, '%s.dylib' % LIBNAME) env.AddPostAction(install_shared, ('install_name_tool -id %s %s' - % (install_shared_path, + % (target_install_shared_path, install_shared_path))) - ### construct shared lib symlinks. this also means install the lib - ### as libserf-2.1.0.0.dylib, then add the symlinks. - ### note: see InstallAs env.Alias('install-lib', [install_static, install_shared, ]) Modified: vendor/serf/dist/auth/auth.c ============================================================================== --- vendor/serf/dist/auth/auth.c Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth.c Sat Feb 22 01:09:12 2014 (r262321) @@ -23,7 +23,8 @@ #include static apr_status_t -default_auth_response_handler(peer_t peer, +default_auth_response_handler(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -151,6 +152,17 @@ static int handle_auth_headers(int code, if (!auth_hdr) continue; + if (code == 401) { + authn_info = serf__get_authn_info_for_server(conn); + } else { + authn_info = &ctx->proxy_authn_info; + } + + if (authn_info->failed_authn_types & scheme->type) { + /* Skip this authn type since we already tried it before. */ + continue; + } + /* Found a matching scheme */ status = APR_SUCCESS; @@ -159,11 +171,6 @@ static int handle_auth_headers(int code, serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "... matched: %s\n", scheme->name); - if (code == 401) { - authn_info = serf__get_authn_info_for_server(conn); - } else { - authn_info = &ctx->proxy_authn_info; - } /* If this is the first time we use this scheme on this context and/or this connection, make sure to initialize the authentication handler first. */ @@ -198,6 +205,12 @@ static int handle_auth_headers(int code, */ serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "%s authentication failed.\n", scheme->name); + + /* Clear per-request auth_baton when switching to next auth scheme. */ + request->auth_baton = NULL; + + /* Remember failed auth types to skip in future. */ + authn_info->failed_authn_types |= scheme->type; } return status; @@ -221,7 +234,7 @@ static int store_header_in_dict(void *ba char *auth_name, *c; /* We're only interested in xxxx-Authenticate headers. */ - if (strcmp(key, ab->header) != 0) + if (strcasecmp(key, ab->header) != 0) return 0; /* Extract the authentication scheme name. */ @@ -378,16 +391,16 @@ apr_status_t serf__handle_auth_response( authn_info = serf__get_authn_info_for_server(conn); if (authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(HOST, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, HOST, sl.code, + conn, request, response, pool); } /* Validate the response proxy authn headers. */ authn_info = &ctx->proxy_authn_info; if (!resp_status && authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(PROXY, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, PROXY, sl.code, + conn, request, response, pool); } if (resp_status) { Modified: vendor/serf/dist/auth/auth.h ============================================================================== --- vendor/serf/dist/auth/auth.h Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth.h Sat Feb 22 01:09:12 2014 (r262321) @@ -78,7 +78,8 @@ apr_status_t serf__setup_request_digest_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_digest_auth(peer_t peer, +apr_status_t serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -108,7 +109,8 @@ apr_status_t serf__setup_request_spnego_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_spnego_auth(peer_t peer, +apr_status_t serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, Modified: vendor/serf/dist/auth/auth_basic.c ============================================================================== --- vendor/serf/dist/auth/auth_basic.c Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth_basic.c Sat Feb 22 01:09:12 2014 (r262321) @@ -48,7 +48,7 @@ serf__handle_basic_auth(int code, apr_status_t status; apr_pool_t *cred_pool; char *username, *password, *realm_name; - const char *eq, *realm; + const char *eq, *realm = NULL; /* Can't do Basic authentication if there's no callback to get username & password. */ Modified: vendor/serf/dist/auth/auth_digest.c ============================================================================== --- vendor/serf/dist/auth/auth_digest.c Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth_digest.c Sat Feb 22 01:09:12 2014 (r262321) @@ -96,8 +96,9 @@ random_cnonce(apr_pool_t *pool) return hex_encode((unsigned char*)buf, pool); } -static const char * -build_digest_ha1(const char *username, +static apr_status_t +build_digest_ha1(const char **out_ha1, + const char *username, const char *password, const char *realm_name, apr_pool_t *pool) @@ -113,12 +114,17 @@ build_digest_ha1(const char *username, realm_name, password); status = apr_md5(ha1, tmp, strlen(tmp)); + if (status) + return status; + + *out_ha1 = hex_encode(ha1, pool); - return hex_encode(ha1, pool); + return APR_SUCCESS; } -static const char * -build_digest_ha2(const char *uri, +static apr_status_t +build_digest_ha2(const char **out_ha2, + const char *uri, const char *method, const char *qop, apr_pool_t *pool) @@ -134,17 +140,21 @@ build_digest_ha2(const char *uri, method, uri); status = apr_md5(ha2, tmp, strlen(tmp)); + if (status) + return status; - return hex_encode(ha2, pool); + *out_ha2 = hex_encode(ha2, pool); + + return APR_SUCCESS; } else { /* TODO: auth-int isn't supported! */ + return APR_ENOTIMPL; } - - return NULL; } -static const char * -build_auth_header(digest_authn_info_t *digest_info, +static apr_status_t +build_auth_header(const char **out_header, + digest_authn_info_t *digest_info, const char *path, const char *method, apr_pool_t *pool) @@ -156,7 +166,9 @@ build_auth_header(digest_authn_info_t *d const char *response_hdr_hex; apr_status_t status; - ha2 = build_digest_ha2(path, method, digest_info->qop, pool); + status = build_digest_ha2(&ha2, path, method, digest_info->qop, pool); + if (status) + return status; hdr = apr_psprintf(pool, "Digest realm=\"%s\"," @@ -194,6 +206,9 @@ build_auth_header(digest_authn_info_t *d } status = apr_md5(response_hdr, response, strlen(response)); + if (status) + return status; + response_hdr_hex = hex_encode(response_hdr, pool); hdr = apr_psprintf(pool, "%s, response=\"%s\"", hdr, response_hdr_hex); @@ -207,7 +222,9 @@ build_auth_header(digest_authn_info_t *d digest_info->algorithm); } - return hdr; + *out_header = hdr; + + return APR_SUCCESS; } apr_status_t @@ -330,8 +347,8 @@ serf__handle_digest_auth(int code, digest_info->username = apr_pstrdup(digest_info->pool, username); digest_info->digest_nc++; - digest_info->ha1 = build_digest_ha1(username, password, digest_info->realm, - digest_info->pool); + status = build_digest_ha1(&digest_info->ha1, username, password, + digest_info->realm, digest_info->pool); apr_pool_destroy(cred_pool); @@ -339,7 +356,7 @@ serf__handle_digest_auth(int code, likes. */ serf_connection_set_max_outstanding_requests(conn, 0); - return APR_SUCCESS; + return status; } apr_status_t @@ -387,7 +404,7 @@ serf__setup_request_digest_auth(peer_t p serf_context_t *ctx = conn->ctx; serf__authn_info_t *authn_info; digest_authn_info_t *digest_info; - apr_status_t status = APR_SUCCESS; + apr_status_t status; if (peer == HOST) { authn_info = serf__get_authn_info_for_server(conn); @@ -421,8 +438,10 @@ serf__setup_request_digest_auth(peer_t p /* Build a new Authorization header. */ digest_info->header = (peer == HOST) ? "Authorization" : "Proxy-Authorization"; - value = build_auth_header(digest_info, path, method, - conn->pool); + status = build_auth_header(&value, digest_info, path, method, + conn->pool); + if (status) + return status; serf_bucket_headers_setn(hdrs_bkt, digest_info->header, value); @@ -431,14 +450,15 @@ serf__setup_request_digest_auth(peer_t p /* Store the uri of this request on the serf_request_t object, to make it available when validating the Authentication-Info header of the matching response. */ - request->auth_baton = path; + request->auth_baton = (void *)path; } - return status; + return APR_SUCCESS; } apr_status_t -serf__validate_response_digest_auth(peer_t peer, +serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -453,6 +473,7 @@ serf__validate_response_digest_auth(peer const char *nc_str = NULL; serf_bucket_t *hdrs; serf_context_t *ctx = conn->ctx; + apr_status_t status; hdrs = serf_bucket_response_get_headers(response); @@ -516,7 +537,10 @@ serf__validate_response_digest_auth(peer } digest_info = authn_info->baton; - ha2 = build_digest_ha2(req_uri, "", qop, pool); + status = build_digest_ha2(&ha2, req_uri, "", qop, pool); + if (status) + return status; + tmp = apr_psprintf(pool, "%s:%s:%s:%s:%s:%s", digest_info->ha1, digest_info->nonce, nc_str, digest_info->cnonce, digest_info->qop, ha2); Modified: vendor/serf/dist/auth/auth_spnego.c ============================================================================== --- vendor/serf/dist/auth/auth_spnego.c Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth_spnego.c Sat Feb 22 01:09:12 2014 (r262321) @@ -181,7 +181,8 @@ typedef struct claim to be. The session key can only be used with the HTTP service on the target host. */ static apr_status_t -gss_api_get_credentials(char *token, apr_size_t token_len, +gss_api_get_credentials(serf_connection_t *conn, + char *token, apr_size_t token_len, const char *hostname, const char **buf, apr_size_t *buf_len, gss_authn_info_t *gss_info) @@ -202,6 +203,7 @@ gss_api_get_credentials(char *token, apr /* Establish a security context to the server. */ status = serf__spnego_init_sec_context( + conn, gss_info->gss_ctx, KRB_HTTP_SERVICE, hostname, &input_buf, @@ -212,7 +214,11 @@ gss_api_get_credentials(char *token, apr switch(status) { case APR_SUCCESS: - gss_info->state = gss_api_auth_completed; + if (output_buf.length == 0) { + gss_info->state = gss_api_auth_completed; + } else { + gss_info->state = gss_api_auth_in_progress; + } break; case APR_EAGAIN: gss_info->state = gss_api_auth_in_progress; @@ -242,6 +248,7 @@ do_auth(peer_t peer, int code, gss_authn_info_t *gss_info, serf_connection_t *conn, + serf_request_t *request, const char *auth_hdr, apr_pool_t *pool) { @@ -306,6 +313,14 @@ do_auth(peer_t peer, break; } + if (request->auth_baton && !token) { + /* We provided token with this request, but server responded with empty + authentication header. This means server rejected our credentials. + XXX: Probably we need separate error code for this case like + SERF_ERROR_AUTHN_CREDS_REJECTED? */ + return SERF_ERROR_AUTHN_FAILED; + } + /* If the server didn't provide us with a token, start with a new initial step in the SPNEGO authentication. */ if (!token) { @@ -314,14 +329,16 @@ do_auth(peer_t peer, } if (peer == HOST) { - status = gss_api_get_credentials(token, token_len, + status = gss_api_get_credentials(conn, + token, token_len, conn->host_info.hostname, &tmp, &tmp_len, gss_info); } else { char *proxy_host; apr_getnameinfo(&proxy_host, conn->ctx->proxy_address, 0); - status = gss_api_get_credentials(token, token_len, proxy_host, + status = gss_api_get_credentials(conn, + token, token_len, proxy_host, &tmp, &tmp_len, gss_info); } @@ -357,24 +374,32 @@ serf__init_spnego_connection(const serf_ serf_connection_t *conn, apr_pool_t *pool) { - gss_authn_info_t *gss_info; - apr_status_t status; - - gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); - gss_info->pool = conn->pool; - gss_info->state = gss_api_auth_not_started; - gss_info->pstate = pstate_init; - status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, - gss_info->pool, pool); - - if (status) { - return status; - } + serf_context_t *ctx = conn->ctx; + serf__authn_info_t *authn_info; + gss_authn_info_t *gss_info = NULL; + /* For proxy authentication, reuse the gss context for all connections. + For server authentication, create a new gss context per connection. */ if (code == 401) { - conn->authn_baton = gss_info; + authn_info = &conn->authn_info; } else { - conn->proxy_authn_baton = gss_info; + authn_info = &ctx->proxy_authn_info; + } + gss_info = authn_info->baton; + + if (!gss_info) { + apr_status_t status; + + gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); + gss_info->pool = conn->pool; + gss_info->state = gss_api_auth_not_started; + gss_info->pstate = pstate_init; + status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, + gss_info->pool, pool); + if (status) { + return status; + } + authn_info->baton = gss_info; } /* Make serf send the initial requests one by one */ @@ -397,13 +422,15 @@ serf__handle_spnego_auth(int code, apr_pool_t *pool) { serf_connection_t *conn = request->conn; - gss_authn_info_t *gss_info = (code == 401) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (code == 401) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; return do_auth(code == 401 ? HOST : PROXY, code, gss_info, request->conn, + request, auth_hdr, pool); } @@ -418,8 +445,9 @@ serf__setup_request_spnego_auth(peer_t p const char *uri, serf_bucket_t *hdrs_bkt) { - gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; /* If we have an ongoing authentication handshake, the handler of the previous response will have created the authn headers for this request @@ -431,6 +459,10 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -469,6 +501,7 @@ serf__setup_request_spnego_auth(peer_t p code, gss_info, conn, + request, 0l, /* no response authn header */ conn->pool); if (status) @@ -476,6 +509,11 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -486,19 +524,70 @@ serf__setup_request_spnego_auth(peer_t p return APR_SUCCESS; } +/** + * Baton passed to the get_auth_header callback function. + */ +typedef struct { + const char *hdr_name; + const char *auth_name; + const char *hdr_value; + apr_pool_t *pool; +} get_auth_header_baton_t; + +static int +get_auth_header_cb(void *baton, + const char *key, + const char *header) +{ + get_auth_header_baton_t *b = baton; + + /* We're only interested in xxxx-Authenticate headers. */ + if (strcasecmp(key, b->hdr_name) != 0) + return 0; + + /* Check if header value starts with interesting auth name. */ + if (strncmp(header, b->auth_name, strlen(b->auth_name)) == 0) { + /* Save interesting header value and stop iteration. */ + b->hdr_value = apr_pstrdup(b->pool, header); + return 1; + } + + return 0; +} + +static const char * +get_auth_header(serf_bucket_t *hdrs, + const char *hdr_name, + const char *auth_name, + apr_pool_t *pool) +{ + get_auth_header_baton_t b; + + b.auth_name = hdr_name; + b.hdr_name = auth_name; + b.hdr_value = NULL; + b.pool = pool; + + serf_bucket_headers_do(hdrs, get_auth_header_cb, &b); + + return b.hdr_value; +} + /* Function is called when 2xx responses are received. Normally we don't * have to do anything, except for the first response after the * authentication handshake. This specific response includes authentication * data which should be validated by the client (mutual authentication). */ apr_status_t -serf__validate_response_spnego_auth(peer_t peer, +serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, serf_bucket_t *response, apr_pool_t *pool) { + serf_context_t *ctx = conn->ctx; gss_authn_info_t *gss_info; const char *auth_hdr_name; @@ -511,10 +600,10 @@ serf__validate_response_spnego_auth(peer "Validate Negotiate response header.\n"); if (peer == HOST) { - gss_info = conn->authn_baton; + gss_info = conn->authn_info.baton; auth_hdr_name = "WWW-Authenticate"; } else { - gss_info = conn->proxy_authn_baton; + gss_info = ctx->proxy_authn_info.baton; auth_hdr_name = "Proxy-Authenticate"; } @@ -524,11 +613,23 @@ serf__validate_response_spnego_auth(peer apr_status_t status; hdrs = serf_bucket_response_get_headers(response); - auth_hdr_val = serf_bucket_headers_get(hdrs, auth_hdr_name); + auth_hdr_val = get_auth_header(hdrs, auth_hdr_name, scheme->name, + pool); - status = do_auth(peer, code, gss_info, conn, auth_hdr_val, pool); - if (status) - return status; + if (auth_hdr_val) { + status = do_auth(peer, code, gss_info, conn, request, auth_hdr_val, + pool); + if (status) { + return status; + } + } else { + /* No Authenticate headers, nothing to validate: authentication + completed.*/ + gss_info->state = gss_api_auth_completed; + + serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, + "SPNEGO handshake completed.\n"); + } } if (gss_info->state == gss_api_auth_completed) { Modified: vendor/serf/dist/auth/auth_spnego.h ============================================================================== --- vendor/serf/dist/auth/auth_spnego.h Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth_spnego.h Sat Feb 22 01:09:12 2014 (r262321) @@ -88,14 +88,15 @@ serf__spnego_create_sec_context(serf__sp * Other returns values indicates error. */ apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, - const char *service, - const char *hostname, - serf__spnego_buffer_t *input_buf, - serf__spnego_buffer_t *output_buf, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool - ); +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, + const char *service, + const char *hostname, + serf__spnego_buffer_t *input_buf, + serf__spnego_buffer_t *output_buf, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool + ); /* * Reset a previously created security context so we can start with a new one. Modified: vendor/serf/dist/auth/auth_spnego_gss.c ============================================================================== --- vendor/serf/dist/auth/auth_spnego_gss.c Sat Feb 22 00:57:55 2014 (r262320) +++ vendor/serf/dist/auth/auth_spnego_gss.c Sat Feb 22 01:09:12 2014 (r262321) @@ -43,7 +43,7 @@ struct serf__spnego_context_t }; static void -log_error(int verbose_flag, const char *filename, +log_error(int verbose_flag, apr_socket_t *skt, serf__spnego_context_t *ctx, OM_uint32 err_maj_stat, OM_uint32 err_min_stat, @@ -70,7 +70,7 @@ log_error(int verbose_flag, const char * &stat_buff); } - serf__log(verbose_flag, filename, + serf__log_skt(verbose_flag, __FILE__, skt, "%s (%x,%d): %s\n", msg, err_maj_stat, err_min_stat, stat_buff.value); } @@ -89,7 +89,7 @@ cleanup_ctx(void *data) gss_maj_stat = gss_delete_sec_context(&gss_min_stat, &ctx->gss_ctx, GSS_C_NO_BUFFER); if(GSS_ERROR(gss_maj_stat)) { - log_error(AUTH_VERBOSE, __FILE__, ctx, + log_error(AUTH_VERBOSE, NULL, ctx, gss_maj_stat, gss_min_stat, "Error cleaning up GSS security context"); return SERF_ERROR_AUTHN_FAILED; @@ -146,7 +146,8 @@ serf__spnego_reset_sec_context(serf__spn } apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, const char *service, const char *hostname, serf__spnego_buffer_t *input_buf, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 01:09:51 2014 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 ESMTPS id 9E5D3B47; Sat, 22 Feb 2014 01:09:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2CE11D3; Sat, 22 Feb 2014 01:09:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M19pBE059673; Sat, 22 Feb 2014 01:09:51 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M19prT059672; Sat, 22 Feb 2014 01:09:51 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402220109.s1M19prT059672@svn.freebsd.org> From: Peter Wemm Date: Sat, 22 Feb 2014 01:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262322 - vendor/serf/serf-1.3.4 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 01:09:51 -0000 Author: peter Date: Sat Feb 22 01:09:50 2014 New Revision: 262322 URL: http://svnweb.freebsd.org/changeset/base/262322 Log: Tag import of serf-1.3.4 Added: vendor/serf/serf-1.3.4/ - copied from r262321, vendor/serf/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 01:13:49 2014 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 ESMTPS id 34C95D53; Sat, 22 Feb 2014 01:13:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3C1B126B; Sat, 22 Feb 2014 01:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M1DmSI063067; Sat, 22 Feb 2014 01:13:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M1Dm4n063066; Sat, 22 Feb 2014 01:13:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220113.s1M1Dm4n063066@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 01:13:48 +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: r262323 - in stable: 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 01:13:49 -0000 Author: delphij Date: Sat Feb 22 01:13:48 2014 New Revision: 262323 URL: http://svnweb.freebsd.org/changeset/base/262323 Log: MFC r261620: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:09:50 2014 (r262322) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:13:48 2014 (r262323) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1415,7 +1416,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 01:13:49 2014 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 ESMTPS id 77736D54; Sat, 22 Feb 2014 01:13:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46817126C; Sat, 22 Feb 2014 01:13:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M1Dn8B063113; Sat, 22 Feb 2014 01:13:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M1DndZ063106; Sat, 22 Feb 2014 01:13:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220113.s1M1DndZ063106@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 01:13: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: r262323 - in stable: 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 01:13:49 -0000 Author: delphij Date: Sat Feb 22 01:13:48 2014 New Revision: 262323 URL: http://svnweb.freebsd.org/changeset/base/262323 Log: MFC r261620: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:09:50 2014 (r262322) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:13:48 2014 (r262323) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1415,7 +1416,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 01:19:49 2014 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 ESMTPS id 8C6B31BB; Sat, 22 Feb 2014 01:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75A4612B0; Sat, 22 Feb 2014 01:19:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M1Jncr063843; Sat, 22 Feb 2014 01:19:49 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M1Jllx063831; Sat, 22 Feb 2014 01:19:47 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402220119.s1M1Jllx063831@svn.freebsd.org> From: Peter Wemm Date: Sat, 22 Feb 2014 01:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262324 - in head/contrib/serf: . auth buckets build 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 01:19:49 -0000 Author: peter Date: Sat Feb 22 01:19:47 2014 New Revision: 262324 URL: http://svnweb.freebsd.org/changeset/base/262324 Log: Update serf-1.3.0 -> 1.3.4 - fixes multiple issues (see the CHANGES file) including an SSL issue that turned up in the cluster with svn-1.8.8. Modified: head/contrib/serf/CHANGES head/contrib/serf/README head/contrib/serf/SConstruct head/contrib/serf/auth/auth.c head/contrib/serf/auth/auth.h head/contrib/serf/auth/auth_basic.c head/contrib/serf/auth/auth_digest.c head/contrib/serf/auth/auth_spnego.c head/contrib/serf/auth/auth_spnego.h head/contrib/serf/auth/auth_spnego_gss.c head/contrib/serf/auth/auth_spnego_sspi.c head/contrib/serf/buckets/headers_buckets.c head/contrib/serf/buckets/response_buckets.c head/contrib/serf/buckets/socket_buckets.c head/contrib/serf/buckets/ssl_buckets.c head/contrib/serf/build/check.py head/contrib/serf/build/gen_def.py head/contrib/serf/build/serf.pc.in head/contrib/serf/context.c head/contrib/serf/outgoing.c head/contrib/serf/serf.h head/contrib/serf/serf_private.h head/contrib/serf/ssltunnel.c Directory Properties: head/contrib/serf/ (props changed) Modified: head/contrib/serf/CHANGES ============================================================================== --- head/contrib/serf/CHANGES Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/CHANGES Sat Feb 22 01:19:47 2014 (r262324) @@ -1,4 +1,59 @@ -Serf 1.3.0 [2013-07-23, from /tags/1.3.0] +Serf 1.3.4 [2014-02-08, from /tags/1.3.4, rxxxx] + Fix issue #119: Endless loop during ssl tunnel setup with Negotiate authn + Fix issue #123: Can't setup ssl tunnel which sends Connection close header + Fix a race condition when initializing OpenSSL from multiple threads (r2263) + Fix issue #138: Incorrect pkg-config file when GSSAPI isn't configured + + +Serf 1.3.3 [2013-12-09, from /tags/1.3.3, r2242] + Fix issue 129: Try more addresses of multihomed servers + Handle X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE correctly (r2225) + Return APR_TIMEUP from poll() to enable detecting connection timeouts (r2183) + + +Serf 1.3.2 [2013-10-04, from /tags/1.3.2, r2195] + Fix issue 130: HTTP headers should be treated case-insensitively + Fix issue 126: Compilation breaks with Codewarrior compiler + Fix crash during cleanup of SSL buckets in apr_terminate() (r2145) + Fix Windows build: Also export functions with capital letters in .def file + Fix host header when url contains a username or password (r2170) + Ensure less TCP package fragmentation on Windows (r2145) + Handle authentication for responses to HEAD requests (r2178,-9) + Improve serf_get: add option to add request headers, allow url with query, + allow HEAD requests (r2143,r2175,-6) + Improve RFC conformance: don't expect body for certain responses (r2011,-2) + Do not invoke progress callback when no data was received (r2144) + And more test suite fixes and build warning cleanups + SCons-related fixes: + Fix build when GSSAPI not in default include path (2155) + Fix OpenBSD build: always map all LIBPATH entries into RPATH (r2156) + Checksum generation in Windows shared libraries for release builds (2162) + Mac OS X: Use MAJOR version only in dylib install name (r2161) + Use both MAJOR and MINOR version for the shared library name (2163) + Fix the .pc file when installing serf in a non-default LIBDIR (r2191) + + +Serf 1.3.1 [2013-08-15, from /tags/1.3.1, r2138] + Fix issue 77: Endless loop if server doesn't accept Negotiate authentication. + Fix issue 114: ssl/tls renegotiation fails + Fix issue 120: error with ssl tunnel over proxy with KeepAlive off and + Basic authentication. + Fixed bugs with authentication (r2057,2115,2118) + SCons-related fixes: + Fix issue 111: add flag to set custom library path + Fix issue 112: add soname + Fix issue 113: add gssapi libs in the serf pc file + Fix issue 115: Setting RPATH on Solaris broken in SConstruct + Fix issue 116: scons check should return non-zero exit staths + Fix issue 121: make CFLAGS, LIBS, LINKFLAGS and CPPFLAGS take a space- + separated list of flags. + Fix issue 122: make scons PREFIX create the folder if it doesn't exist + Mac OS X: Fix scons --install-sandbox + Solaris: Fix build with cc, don't use unsupported compiler flags + Require SCons version 2.3.0 or higher now (for the soname support). + + +Serf 1.3.0 [2013-07-23, from /tags/1.3.0, r2074] Fix issue 83: use PATH rather than URI within an ssltunnel (r1952) Fix issue 108: improved error reporting from the underlying socket (r1951) NEW: Switch to the SCons build system; retire serfmake, serf.mak, autotools Modified: head/contrib/serf/README ============================================================================== --- head/contrib/serf/README Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/README Sat Feb 22 01:19:47 2014 (r262324) @@ -18,14 +18,14 @@ kept to a minimum to provide high perfor 1.1. SCons build system -serf uses SCons 2.x for its build system. If it is not installed on +serf uses SCons 2.3 for its build system. If it is not installed on your system, then you can install it onto your system. If you do not have permissions, then you can download and install the "local" version into your home directory. When installed privately, simply create a symlink for 'scons' in your PATH to /path/to/scons/scons.py. Fetch the scons-local package: - http://prdownloads.sourceforge.net/scons/scons-local-2.0.1.tar.gz + http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz 1.2 Building serf @@ -54,6 +54,12 @@ distinct directory from the source), you $ scons -Y /path/to/serf/source +If you plan to install the library on a system that uses different +paths for architecture dependent files, specify LIBDIR. LIBDIR defaults +to /usr/local/lib otherwise. Example for a 64 bit GNU/Linux system: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 + At any point, the current settings can be examined: $ scons --help @@ -74,6 +80,13 @@ specified on the install command line: $ scons PREFIX=/some/path install +Distribution package maintainers regulary install to a buildroot, and +would normally use something like below in their build systems, with +placeholders for the specific paths: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 +$ scons install --install-sandbox=/path/to/buildroot + 1.4 Cleaning up the build Modified: head/contrib/serf/SConstruct ============================================================================== --- head/contrib/serf/SConstruct Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/SConstruct Sat Feb 22 01:19:47 2014 (r262324) @@ -19,6 +19,8 @@ import sys import os import re +EnsureSConsVersion(2,3,0) + HEADER_FILES = ['serf.h', 'serf_bucket_types.h', 'serf_bucket_util.h', @@ -34,23 +36,35 @@ def _converter(val): if val == 'none': val = [] else: - val = val.split(',') + val = val.split(' ') return val def RawListVariable(key, help, default): """ The input parameters describe a 'raw string list' option. This class - accepts a comma separated list and converts it to a space separated - list. + accepts a space-separated string and converts it to a list. """ return (key, '%s' % (help), default, None, lambda val: _converter(val)) +# Custom path validator, creates directory when a specified option is set. +# To be used to ensure a PREFIX directory is only created when installing. +def createPathIsDirCreateWithTarget(target): + def my_validator(key, val, env): + build_targets = (map(str, BUILD_TARGETS)) + if target in build_targets: + return PathVariable.PathIsDirCreate(key, val, env) + else: + return PathVariable.PathAccept(key, val, env) + return my_validator + # default directories if sys.platform == 'win32': + default_incdir='..' default_libdir='..' default_prefix='Debug' else: - default_libdir='/usr' + default_incdir='/usr' + default_libdir='$PREFIX/lib' default_prefix='/usr/local' opts = Variables(files=[SAVED_CONFIG]) @@ -58,22 +72,26 @@ opts.AddVariables( PathVariable('PREFIX', 'Directory to install under', default_prefix, - PathVariable.PathIsDir), + createPathIsDirCreateWithTarget('install')), + PathVariable('LIBDIR', + 'Directory to install architecture dependent libraries under', + default_libdir, + createPathIsDirCreateWithTarget('install')), PathVariable('APR', "Path to apr-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('APU', "Path to apu-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('OPENSSL', "Path to OpenSSL's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('ZLIB', "Path to zlib's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('GSSAPI', "Path to GSSAPI's install area", @@ -86,14 +104,14 @@ opts.AddVariables( "Enable using a static compiled APR", False), RawListVariable('CC', "Command name or path of the C compiler", None), - RawListVariable('CFLAGS', "Extra flags for the C compiler (comma separated)", + RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)", None), RawListVariable('LIBS', "Extra libraries passed to the linker, " - "e.g. -l (comma separated)", None), - RawListVariable('LINKFLAGS', "Extra flags for the linker (comma separated)", + "e.g. \"-l -l\" (space separated)", None), + RawListVariable('LINKFLAGS', "Extra flags for the linker (space-separated)", None), RawListVariable('CPPFLAGS', "Extra flags for the C preprocessor " - "(comma separated)", None), + "(space separated)", None), ) if sys.platform == 'win32': @@ -146,6 +164,8 @@ match = re.search('SERF_MAJOR_VERSION ([ re.DOTALL) MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] env.Append(MAJOR=str(MAJOR)) +env.Append(MINOR=str(MINOR)) +env.Append(PATCH=str(PATCH)) # Calling external programs is okay if we're not cleaning or printing help. # (cleaning: no sense in fetching information; help: we may not know where @@ -181,10 +201,18 @@ opts.Save(SAVED_CONFIG, env) # PLATFORM-SPECIFIC BUILD TWEAKS thisdir = os.getcwd() -libdir = '$PREFIX/lib' +libdir = '$LIBDIR' incdir = '$PREFIX/include/serf-$MAJOR' -LIBNAME = 'libserf-${MAJOR}' +# This version string is used in the dynamic library name, and for Mac OS X also +# for the current_version and compatibility_version options in the .dylib +# +# Unfortunately we can't set the .dylib compatibility_version option separately +# from current_version, so don't use the PATCH level to avoid that build and +# runtime patch levels have to be identical. +env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0) + +LIBNAME = 'libserf-%d' % (MAJOR,) if sys.platform != 'win32': LIBNAMESTATIC = LIBNAME else: @@ -196,23 +224,17 @@ env.Append(RPATH=libdir, if sys.platform == 'darwin': # linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,)) env.Append(LINKFLAGS='-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)) - # 'man ld' says positive non-zero for the first number, so we add one. - # Mac's interpretation of compatibility is the same as our MINOR version. - env.Append(LINKFLAGS='-Wl,-compatibility_version,%d' % (MINOR+1,)) - env.Append(LINKFLAGS='-Wl,-current_version,%d.%d' % (MINOR+1, PATCH,)) if sys.platform != 'win32': ### gcc only. figure out appropriate test / better way to check these ### flags, and check for gcc. env.Append(CFLAGS='-std=c89') - env.Append(CCFLAGS=[ - '-Wdeclaration-after-statement', - '-Wmissing-prototypes', - ]) - ### -Wall is not available on Solaris + ### These warnings are not available on Solaris if sys.platform != 'sunos5': - env.Append(CCFLAGS='-Wall') + env.Append(CCFLAGS=['-Wdeclaration-after-statement', + '-Wmissing-prototypes', + '-Wall']) if debug: env.Append(CCFLAGS='-g') @@ -239,6 +261,7 @@ else: # Optimize for speed, use DLL runtime env.Append(CCFLAGS=['/O2', '/MD']) env.Append(CPPDEFINES='NDEBUG') + env.Append(LINKFLAGS='/RELEASE') # PLAN THE BUILD SHARED_SOURCES = [] @@ -334,28 +357,32 @@ else: # If build with gssapi, get its information and define SERF_HAVE_GSSAPI if gssapi and CALLOUT_OKAY: - env.ParseConfig('$GSSAPI --libs gssapi') + env.ParseConfig('$GSSAPI --cflags gssapi') + def parse_libs(env, cmd, unique=1): + env['GSSAPI_LIBS'] = cmd.strip() + return env.MergeFlags(cmd, unique) + env.ParseConfig('$GSSAPI --libs gssapi', parse_libs) env.Append(CPPDEFINES='SERF_HAVE_GSSAPI') if sys.platform == 'win32': env.Append(CPPDEFINES=['SERF_HAVE_SSPI']) -# On Solaris, the -R values that APR describes never make it into actual +# On some systems, the -R values that APR describes never make it into actual # RPATH flags. We'll manually map all directories in LIBPATH into new # flags to set RPATH values. -if sys.platform == 'sunos5': - for d in env['LIBPATH']: - env.Append(RPATH=d) +for d in env['LIBPATH']: + env.Append(RPATH=':'+d) # Set up the construction of serf-*.pc -# TODO: add gssapi libs pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,), env.File('build/serf.pc.in'), SUBST_DICT = { '@MAJOR@': str(MAJOR), '@PREFIX@': '$PREFIX', + '@LIBDIR@': '$LIBDIR', '@INCLUDE_SUBDIR@': 'serf-%d' % (MAJOR,), '@VERSION@': '%d.%d.%d' % (MAJOR, MINOR, PATCH), - '@LIBS@': '%s %s -lz' % (apu_libs, apr_libs), + '@LIBS@': '%s %s %s -lz' % (apu_libs, apr_libs, + env.get('GSSAPI_LIBS', '')), }) env.Default(lib_static, lib_shared, pkgconfig) @@ -371,16 +398,22 @@ if CALLOUT_OKAY: # INSTALLATION STUFF install_static = env.Install(libdir, lib_static) -install_shared = env.Install(libdir, lib_shared) +install_shared = env.InstallVersionedLib(libdir, lib_shared) if sys.platform == 'darwin': + # Change the shared library install name (id) to its final name and location. + # Notes: + # If --install-sandbox= is specified, install_shared_path will point + # to a path in the sandbox. We can't use that path because the sandbox is + # only a temporary location. The id should be the final target path. + # Also, we shouldn't use the complete version number for id, as that'll + # make applications depend on the exact major.minor.patch version of serf. + install_shared_path = install_shared[0].abspath + target_install_shared_path = os.path.join(libdir, '%s.dylib' % LIBNAME) env.AddPostAction(install_shared, ('install_name_tool -id %s %s' - % (install_shared_path, + % (target_install_shared_path, install_shared_path))) - ### construct shared lib symlinks. this also means install the lib - ### as libserf-2.1.0.0.dylib, then add the symlinks. - ### note: see InstallAs env.Alias('install-lib', [install_static, install_shared, ]) Modified: head/contrib/serf/auth/auth.c ============================================================================== --- head/contrib/serf/auth/auth.c Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth.c Sat Feb 22 01:19:47 2014 (r262324) @@ -23,7 +23,8 @@ #include static apr_status_t -default_auth_response_handler(peer_t peer, +default_auth_response_handler(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -151,6 +152,17 @@ static int handle_auth_headers(int code, if (!auth_hdr) continue; + if (code == 401) { + authn_info = serf__get_authn_info_for_server(conn); + } else { + authn_info = &ctx->proxy_authn_info; + } + + if (authn_info->failed_authn_types & scheme->type) { + /* Skip this authn type since we already tried it before. */ + continue; + } + /* Found a matching scheme */ status = APR_SUCCESS; @@ -159,11 +171,6 @@ static int handle_auth_headers(int code, serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "... matched: %s\n", scheme->name); - if (code == 401) { - authn_info = serf__get_authn_info_for_server(conn); - } else { - authn_info = &ctx->proxy_authn_info; - } /* If this is the first time we use this scheme on this context and/or this connection, make sure to initialize the authentication handler first. */ @@ -198,6 +205,12 @@ static int handle_auth_headers(int code, */ serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "%s authentication failed.\n", scheme->name); + + /* Clear per-request auth_baton when switching to next auth scheme. */ + request->auth_baton = NULL; + + /* Remember failed auth types to skip in future. */ + authn_info->failed_authn_types |= scheme->type; } return status; @@ -221,7 +234,7 @@ static int store_header_in_dict(void *ba char *auth_name, *c; /* We're only interested in xxxx-Authenticate headers. */ - if (strcmp(key, ab->header) != 0) + if (strcasecmp(key, ab->header) != 0) return 0; /* Extract the authentication scheme name. */ @@ -378,16 +391,16 @@ apr_status_t serf__handle_auth_response( authn_info = serf__get_authn_info_for_server(conn); if (authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(HOST, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, HOST, sl.code, + conn, request, response, pool); } /* Validate the response proxy authn headers. */ authn_info = &ctx->proxy_authn_info; if (!resp_status && authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(PROXY, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, PROXY, sl.code, + conn, request, response, pool); } if (resp_status) { Modified: head/contrib/serf/auth/auth.h ============================================================================== --- head/contrib/serf/auth/auth.h Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth.h Sat Feb 22 01:19:47 2014 (r262324) @@ -78,7 +78,8 @@ apr_status_t serf__setup_request_digest_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_digest_auth(peer_t peer, +apr_status_t serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -108,7 +109,8 @@ apr_status_t serf__setup_request_spnego_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_spnego_auth(peer_t peer, +apr_status_t serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, Modified: head/contrib/serf/auth/auth_basic.c ============================================================================== --- head/contrib/serf/auth/auth_basic.c Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth_basic.c Sat Feb 22 01:19:47 2014 (r262324) @@ -48,7 +48,7 @@ serf__handle_basic_auth(int code, apr_status_t status; apr_pool_t *cred_pool; char *username, *password, *realm_name; - const char *eq, *realm; + const char *eq, *realm = NULL; /* Can't do Basic authentication if there's no callback to get username & password. */ Modified: head/contrib/serf/auth/auth_digest.c ============================================================================== --- head/contrib/serf/auth/auth_digest.c Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth_digest.c Sat Feb 22 01:19:47 2014 (r262324) @@ -96,8 +96,9 @@ random_cnonce(apr_pool_t *pool) return hex_encode((unsigned char*)buf, pool); } -static const char * -build_digest_ha1(const char *username, +static apr_status_t +build_digest_ha1(const char **out_ha1, + const char *username, const char *password, const char *realm_name, apr_pool_t *pool) @@ -113,12 +114,17 @@ build_digest_ha1(const char *username, realm_name, password); status = apr_md5(ha1, tmp, strlen(tmp)); + if (status) + return status; + + *out_ha1 = hex_encode(ha1, pool); - return hex_encode(ha1, pool); + return APR_SUCCESS; } -static const char * -build_digest_ha2(const char *uri, +static apr_status_t +build_digest_ha2(const char **out_ha2, + const char *uri, const char *method, const char *qop, apr_pool_t *pool) @@ -134,17 +140,21 @@ build_digest_ha2(const char *uri, method, uri); status = apr_md5(ha2, tmp, strlen(tmp)); + if (status) + return status; - return hex_encode(ha2, pool); + *out_ha2 = hex_encode(ha2, pool); + + return APR_SUCCESS; } else { /* TODO: auth-int isn't supported! */ + return APR_ENOTIMPL; } - - return NULL; } -static const char * -build_auth_header(digest_authn_info_t *digest_info, +static apr_status_t +build_auth_header(const char **out_header, + digest_authn_info_t *digest_info, const char *path, const char *method, apr_pool_t *pool) @@ -156,7 +166,9 @@ build_auth_header(digest_authn_info_t *d const char *response_hdr_hex; apr_status_t status; - ha2 = build_digest_ha2(path, method, digest_info->qop, pool); + status = build_digest_ha2(&ha2, path, method, digest_info->qop, pool); + if (status) + return status; hdr = apr_psprintf(pool, "Digest realm=\"%s\"," @@ -194,6 +206,9 @@ build_auth_header(digest_authn_info_t *d } status = apr_md5(response_hdr, response, strlen(response)); + if (status) + return status; + response_hdr_hex = hex_encode(response_hdr, pool); hdr = apr_psprintf(pool, "%s, response=\"%s\"", hdr, response_hdr_hex); @@ -207,7 +222,9 @@ build_auth_header(digest_authn_info_t *d digest_info->algorithm); } - return hdr; + *out_header = hdr; + + return APR_SUCCESS; } apr_status_t @@ -330,8 +347,8 @@ serf__handle_digest_auth(int code, digest_info->username = apr_pstrdup(digest_info->pool, username); digest_info->digest_nc++; - digest_info->ha1 = build_digest_ha1(username, password, digest_info->realm, - digest_info->pool); + status = build_digest_ha1(&digest_info->ha1, username, password, + digest_info->realm, digest_info->pool); apr_pool_destroy(cred_pool); @@ -339,7 +356,7 @@ serf__handle_digest_auth(int code, likes. */ serf_connection_set_max_outstanding_requests(conn, 0); - return APR_SUCCESS; + return status; } apr_status_t @@ -387,7 +404,7 @@ serf__setup_request_digest_auth(peer_t p serf_context_t *ctx = conn->ctx; serf__authn_info_t *authn_info; digest_authn_info_t *digest_info; - apr_status_t status = APR_SUCCESS; + apr_status_t status; if (peer == HOST) { authn_info = serf__get_authn_info_for_server(conn); @@ -421,8 +438,10 @@ serf__setup_request_digest_auth(peer_t p /* Build a new Authorization header. */ digest_info->header = (peer == HOST) ? "Authorization" : "Proxy-Authorization"; - value = build_auth_header(digest_info, path, method, - conn->pool); + status = build_auth_header(&value, digest_info, path, method, + conn->pool); + if (status) + return status; serf_bucket_headers_setn(hdrs_bkt, digest_info->header, value); @@ -431,14 +450,15 @@ serf__setup_request_digest_auth(peer_t p /* Store the uri of this request on the serf_request_t object, to make it available when validating the Authentication-Info header of the matching response. */ - request->auth_baton = path; + request->auth_baton = (void *)path; } - return status; + return APR_SUCCESS; } apr_status_t -serf__validate_response_digest_auth(peer_t peer, +serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -453,6 +473,7 @@ serf__validate_response_digest_auth(peer const char *nc_str = NULL; serf_bucket_t *hdrs; serf_context_t *ctx = conn->ctx; + apr_status_t status; hdrs = serf_bucket_response_get_headers(response); @@ -516,7 +537,10 @@ serf__validate_response_digest_auth(peer } digest_info = authn_info->baton; - ha2 = build_digest_ha2(req_uri, "", qop, pool); + status = build_digest_ha2(&ha2, req_uri, "", qop, pool); + if (status) + return status; + tmp = apr_psprintf(pool, "%s:%s:%s:%s:%s:%s", digest_info->ha1, digest_info->nonce, nc_str, digest_info->cnonce, digest_info->qop, ha2); Modified: head/contrib/serf/auth/auth_spnego.c ============================================================================== --- head/contrib/serf/auth/auth_spnego.c Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth_spnego.c Sat Feb 22 01:19:47 2014 (r262324) @@ -181,7 +181,8 @@ typedef struct claim to be. The session key can only be used with the HTTP service on the target host. */ static apr_status_t -gss_api_get_credentials(char *token, apr_size_t token_len, +gss_api_get_credentials(serf_connection_t *conn, + char *token, apr_size_t token_len, const char *hostname, const char **buf, apr_size_t *buf_len, gss_authn_info_t *gss_info) @@ -202,6 +203,7 @@ gss_api_get_credentials(char *token, apr /* Establish a security context to the server. */ status = serf__spnego_init_sec_context( + conn, gss_info->gss_ctx, KRB_HTTP_SERVICE, hostname, &input_buf, @@ -212,7 +214,11 @@ gss_api_get_credentials(char *token, apr switch(status) { case APR_SUCCESS: - gss_info->state = gss_api_auth_completed; + if (output_buf.length == 0) { + gss_info->state = gss_api_auth_completed; + } else { + gss_info->state = gss_api_auth_in_progress; + } break; case APR_EAGAIN: gss_info->state = gss_api_auth_in_progress; @@ -242,6 +248,7 @@ do_auth(peer_t peer, int code, gss_authn_info_t *gss_info, serf_connection_t *conn, + serf_request_t *request, const char *auth_hdr, apr_pool_t *pool) { @@ -306,6 +313,14 @@ do_auth(peer_t peer, break; } + if (request->auth_baton && !token) { + /* We provided token with this request, but server responded with empty + authentication header. This means server rejected our credentials. + XXX: Probably we need separate error code for this case like + SERF_ERROR_AUTHN_CREDS_REJECTED? */ + return SERF_ERROR_AUTHN_FAILED; + } + /* If the server didn't provide us with a token, start with a new initial step in the SPNEGO authentication. */ if (!token) { @@ -314,14 +329,16 @@ do_auth(peer_t peer, } if (peer == HOST) { - status = gss_api_get_credentials(token, token_len, + status = gss_api_get_credentials(conn, + token, token_len, conn->host_info.hostname, &tmp, &tmp_len, gss_info); } else { char *proxy_host; apr_getnameinfo(&proxy_host, conn->ctx->proxy_address, 0); - status = gss_api_get_credentials(token, token_len, proxy_host, + status = gss_api_get_credentials(conn, + token, token_len, proxy_host, &tmp, &tmp_len, gss_info); } @@ -357,24 +374,32 @@ serf__init_spnego_connection(const serf_ serf_connection_t *conn, apr_pool_t *pool) { - gss_authn_info_t *gss_info; - apr_status_t status; - - gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); - gss_info->pool = conn->pool; - gss_info->state = gss_api_auth_not_started; - gss_info->pstate = pstate_init; - status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, - gss_info->pool, pool); - - if (status) { - return status; - } + serf_context_t *ctx = conn->ctx; + serf__authn_info_t *authn_info; + gss_authn_info_t *gss_info = NULL; + /* For proxy authentication, reuse the gss context for all connections. + For server authentication, create a new gss context per connection. */ if (code == 401) { - conn->authn_baton = gss_info; + authn_info = &conn->authn_info; } else { - conn->proxy_authn_baton = gss_info; + authn_info = &ctx->proxy_authn_info; + } + gss_info = authn_info->baton; + + if (!gss_info) { + apr_status_t status; + + gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); + gss_info->pool = conn->pool; + gss_info->state = gss_api_auth_not_started; + gss_info->pstate = pstate_init; + status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, + gss_info->pool, pool); + if (status) { + return status; + } + authn_info->baton = gss_info; } /* Make serf send the initial requests one by one */ @@ -397,13 +422,15 @@ serf__handle_spnego_auth(int code, apr_pool_t *pool) { serf_connection_t *conn = request->conn; - gss_authn_info_t *gss_info = (code == 401) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (code == 401) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; return do_auth(code == 401 ? HOST : PROXY, code, gss_info, request->conn, + request, auth_hdr, pool); } @@ -418,8 +445,9 @@ serf__setup_request_spnego_auth(peer_t p const char *uri, serf_bucket_t *hdrs_bkt) { - gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; /* If we have an ongoing authentication handshake, the handler of the previous response will have created the authn headers for this request @@ -431,6 +459,10 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -469,6 +501,7 @@ serf__setup_request_spnego_auth(peer_t p code, gss_info, conn, + request, 0l, /* no response authn header */ conn->pool); if (status) @@ -476,6 +509,11 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -486,19 +524,70 @@ serf__setup_request_spnego_auth(peer_t p return APR_SUCCESS; } +/** + * Baton passed to the get_auth_header callback function. + */ +typedef struct { + const char *hdr_name; + const char *auth_name; + const char *hdr_value; + apr_pool_t *pool; +} get_auth_header_baton_t; + +static int +get_auth_header_cb(void *baton, + const char *key, + const char *header) +{ + get_auth_header_baton_t *b = baton; + + /* We're only interested in xxxx-Authenticate headers. */ + if (strcasecmp(key, b->hdr_name) != 0) + return 0; + + /* Check if header value starts with interesting auth name. */ + if (strncmp(header, b->auth_name, strlen(b->auth_name)) == 0) { + /* Save interesting header value and stop iteration. */ + b->hdr_value = apr_pstrdup(b->pool, header); + return 1; + } + + return 0; +} + +static const char * +get_auth_header(serf_bucket_t *hdrs, + const char *hdr_name, + const char *auth_name, + apr_pool_t *pool) +{ + get_auth_header_baton_t b; + + b.auth_name = hdr_name; + b.hdr_name = auth_name; + b.hdr_value = NULL; + b.pool = pool; + + serf_bucket_headers_do(hdrs, get_auth_header_cb, &b); + + return b.hdr_value; +} + /* Function is called when 2xx responses are received. Normally we don't * have to do anything, except for the first response after the * authentication handshake. This specific response includes authentication * data which should be validated by the client (mutual authentication). */ apr_status_t -serf__validate_response_spnego_auth(peer_t peer, +serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, serf_bucket_t *response, apr_pool_t *pool) { + serf_context_t *ctx = conn->ctx; gss_authn_info_t *gss_info; const char *auth_hdr_name; @@ -511,10 +600,10 @@ serf__validate_response_spnego_auth(peer "Validate Negotiate response header.\n"); if (peer == HOST) { - gss_info = conn->authn_baton; + gss_info = conn->authn_info.baton; auth_hdr_name = "WWW-Authenticate"; } else { - gss_info = conn->proxy_authn_baton; + gss_info = ctx->proxy_authn_info.baton; auth_hdr_name = "Proxy-Authenticate"; } @@ -524,11 +613,23 @@ serf__validate_response_spnego_auth(peer apr_status_t status; hdrs = serf_bucket_response_get_headers(response); - auth_hdr_val = serf_bucket_headers_get(hdrs, auth_hdr_name); + auth_hdr_val = get_auth_header(hdrs, auth_hdr_name, scheme->name, + pool); - status = do_auth(peer, code, gss_info, conn, auth_hdr_val, pool); - if (status) - return status; + if (auth_hdr_val) { + status = do_auth(peer, code, gss_info, conn, request, auth_hdr_val, + pool); + if (status) { + return status; + } + } else { + /* No Authenticate headers, nothing to validate: authentication + completed.*/ + gss_info->state = gss_api_auth_completed; + + serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, + "SPNEGO handshake completed.\n"); + } } if (gss_info->state == gss_api_auth_completed) { Modified: head/contrib/serf/auth/auth_spnego.h ============================================================================== --- head/contrib/serf/auth/auth_spnego.h Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth_spnego.h Sat Feb 22 01:19:47 2014 (r262324) @@ -88,14 +88,15 @@ serf__spnego_create_sec_context(serf__sp * Other returns values indicates error. */ apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, - const char *service, - const char *hostname, - serf__spnego_buffer_t *input_buf, - serf__spnego_buffer_t *output_buf, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool - ); +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, + const char *service, + const char *hostname, + serf__spnego_buffer_t *input_buf, + serf__spnego_buffer_t *output_buf, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool + ); /* * Reset a previously created security context so we can start with a new one. Modified: head/contrib/serf/auth/auth_spnego_gss.c ============================================================================== --- head/contrib/serf/auth/auth_spnego_gss.c Sat Feb 22 01:13:48 2014 (r262323) +++ head/contrib/serf/auth/auth_spnego_gss.c Sat Feb 22 01:19:47 2014 (r262324) @@ -43,7 +43,7 @@ struct serf__spnego_context_t }; static void -log_error(int verbose_flag, const char *filename, +log_error(int verbose_flag, apr_socket_t *skt, serf__spnego_context_t *ctx, OM_uint32 err_maj_stat, OM_uint32 err_min_stat, @@ -70,7 +70,7 @@ log_error(int verbose_flag, const char * &stat_buff); } - serf__log(verbose_flag, filename, + serf__log_skt(verbose_flag, __FILE__, skt, "%s (%x,%d): %s\n", msg, err_maj_stat, err_min_stat, stat_buff.value); } @@ -89,7 +89,7 @@ cleanup_ctx(void *data) gss_maj_stat = gss_delete_sec_context(&gss_min_stat, &ctx->gss_ctx, GSS_C_NO_BUFFER); if(GSS_ERROR(gss_maj_stat)) { - log_error(AUTH_VERBOSE, __FILE__, ctx, + log_error(AUTH_VERBOSE, NULL, ctx, gss_maj_stat, gss_min_stat, "Error cleaning up GSS security context"); return SERF_ERROR_AUTHN_FAILED; @@ -146,7 +146,8 @@ serf__spnego_reset_sec_context(serf__spn } apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, const char *service, const char *hostname, serf__spnego_buffer_t *input_buf, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 01:41:45 2014 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 ESMTPS id F00FF597; Sat, 22 Feb 2014 01:41:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D89EE1546; Sat, 22 Feb 2014 01:41:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M1fjpc074612; Sat, 22 Feb 2014 01:41:45 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M1fjFi074611; Sat, 22 Feb 2014 01:41:45 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402220141.s1M1fjFi074611@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Feb 2014 01:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262325 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 01:41:46 -0000 Author: markj Date: Sat Feb 22 01:41:45 2014 New Revision: 262325 URL: http://svnweb.freebsd.org/changeset/base/262325 Log: Print a backtrace if the SDT(9) stub gets called so that there's at least some hope of figuring out how it happened. Suggested by: rstone MFC after: 1 week Modified: head/sys/kern/kern_sdt.c Modified: head/sys/kern/kern_sdt.c ============================================================================== --- head/sys/kern/kern_sdt.c Sat Feb 22 01:19:47 2014 (r262324) +++ head/sys/kern/kern_sdt.c Sat Feb 22 01:41:45 2014 (r262325) @@ -27,6 +27,7 @@ #include #include +#include #include SDT_PROVIDER_DEFINE(sdt); @@ -47,5 +48,6 @@ sdt_probe_stub(uint32_t id, uintptr_t ar uintptr_t arg2, uintptr_t arg3, uintptr_t arg4) { - printf("sdt_probe_stub: Why did this get called?\n"); + printf("sdt_probe_stub: unexpectedly called\n"); + kdb_backtrace(); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 03:29:53 2014 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 ESMTPS id D047CACB; Sat, 22 Feb 2014 03:29:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A03311135; Sat, 22 Feb 2014 03:29:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M3TrfP017337; Sat, 22 Feb 2014 03:29:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M3TraD017336; Sat, 22 Feb 2014 03:29:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402220329.s1M3TraD017336@svn.freebsd.org> From: Ian Lepore Date: Sat, 22 Feb 2014 03:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262326 - head/sys/boot/fdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 03:29:53 -0000 Author: ian Date: Sat Feb 22 03:29:53 2014 New Revision: 262326 URL: http://svnweb.freebsd.org/changeset/base/262326 Log: Fix the strange 2-space indentation that appears only in this one function. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 01:41:45 2014 (r262325) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 03:29:53 2014 (r262326) @@ -250,39 +250,42 @@ fdt_load_dtb_addr(struct fdt_header *hea static int fdt_setup_fdtp() { - struct preloaded_file *bfp; - struct fdt_header *hdr; - const char *s; - char *p; - vm_offset_t va; - - if ((bfp = file_findfile(NULL, "dtb")) != NULL) { - printf("Using DTB from loaded file.\n"); - return fdt_load_dtb(bfp->f_addr); - } - - if (fdt_to_load != NULL) { - printf("Using DTB from memory address 0x%08X.\n", - (unsigned int)fdt_to_load); - return fdt_load_dtb_addr(fdt_to_load); - } - - s = ub_env_get("fdtaddr"); - if (s != NULL && *s != '\0') { - hdr = (struct fdt_header *)strtoul(s, &p, 16); - if (*p == '\0') { - printf("Using DTB provided by U-Boot.\n"); - return fdt_load_dtb_addr(hdr); - } - } - - if ((va = fdt_find_static_dtb()) != 0) { - printf("Using DTB compiled into kernel.\n"); - return (fdt_load_dtb(va)); - } - - command_errmsg = "no device tree blob found!"; - return (1); + struct preloaded_file *bfp; + struct fdt_header *hdr; + const char *s; + char *p; + vm_offset_t va; + + if ((bfp = file_findfile(NULL, "dtb")) != NULL) { + printf("Using DTB from loaded file.\n"); + return fdt_load_dtb(bfp->f_addr); + } + + if (fdt_to_load != NULL) { + printf("Using DTB from memory address 0x%08X.\n", + (unsigned int)fdt_to_load); + return fdt_load_dtb_addr(fdt_to_load); + } + + /* Board vendors use both fdtaddr and fdt_addr. Grrrr. */ + s = ub_env_get("fdtaddr"); + if (s == NULL) + s = ub_env_get("fdt_addr"); + if (s != NULL && *s != '\0') { + hdr = (struct fdt_header *)strtoul(s, &p, 16); + if (*p == '\0') { + printf("Using DTB provided by U-Boot.\n"); + return fdt_load_dtb_addr(hdr); + } + } + + if ((va = fdt_find_static_dtb()) != 0) { + printf("Using DTB compiled into kernel.\n"); + return (fdt_load_dtb(va)); + } + + command_errmsg = "no device tree blob found!"; + return (1); } #define fdt_strtovect(str, cellbuf, lim, cellsize) _fdt_strtovect((str), \ From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 03:36:46 2014 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 ESMTPS id 9417CC75; Sat, 22 Feb 2014 03:36:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C0A011BF; Sat, 22 Feb 2014 03:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M3akFA020946; Sat, 22 Feb 2014 03:36:46 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M3ak1n020945; Sat, 22 Feb 2014 03:36:46 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402220336.s1M3ak1n020945@svn.freebsd.org> From: Ian Lepore Date: Sat, 22 Feb 2014 03:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262327 - head/sys/boot/fdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 03:36:46 -0000 Author: ian Date: Sat Feb 22 03:36:45 2014 New Revision: 262327 URL: http://svnweb.freebsd.org/changeset/base/262327 Log: Look for both fdtaddr and fdt_addr env var names. Grepping the u-boot source shows that board vendors seem to be about evenly split on this. This commit is a trivial change to note that while the previous change was supposed to be whitespace only, this functional change also crept in. The added lines were: /* Board vendors use both fdtaddr and fdt_addr names. Grrrr. */ if (s == NULL) s = ub_env_get("fdt_addr"); Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 03:29:53 2014 (r262326) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 03:36:45 2014 (r262327) @@ -267,7 +267,7 @@ fdt_setup_fdtp() return fdt_load_dtb_addr(fdt_to_load); } - /* Board vendors use both fdtaddr and fdt_addr. Grrrr. */ + /* Board vendors use both fdtaddr and fdt_addr names. Grrrr. */ s = ub_env_get("fdtaddr"); if (s == NULL) s = ub_env_get("fdt_addr"); From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 04:28:49 2014 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 ESMTPS id CF570B46; Sat, 22 Feb 2014 04:28:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA7E01C8E; Sat, 22 Feb 2014 04:28:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M4Sn6w041894; Sat, 22 Feb 2014 04:28:49 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M4SnAO041893; Sat, 22 Feb 2014 04:28:49 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402220428.s1M4SnAO041893@svn.freebsd.org> From: Bryan Drewery Date: Sat, 22 Feb 2014 04:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262328 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 04:28:49 -0000 Author: bdrewery Date: Sat Feb 22 04:28:49 2014 New Revision: 262328 URL: http://svnweb.freebsd.org/changeset/base/262328 Log: Fix style of comment blocks. Reported by: peter Approved by: bapt (mentor, implicit) X-MFC with: r262006 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Feb 22 03:36:45 2014 (r262327) +++ head/sys/kern/kern_descrip.c Sat Feb 22 04:28:49 2014 (r262328) @@ -1533,9 +1533,11 @@ fdgrowtable(struct filedesc *fdp, int nf memcpy(ntable, otable, onfiles * sizeof(*otable)); fdp->fd_ofiles = ntable; - /* Allocate a new map only if the old is not large enough. It will + /* + * Allocate a new map only if the old is not large enough. It will * grow at a slower rate than the table as it can map more - * entries than the table can hold. */ + * entries than the table can hold. + */ if (NDSLOTS(nnfiles) > NDSLOTS(onfiles)) { nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, M_ZERO | M_WAITOK); @@ -1568,9 +1570,11 @@ fdgrowtable(struct filedesc *fdp, int nf ft->ft_table = otable; SLIST_INSERT_HEAD(&fdp0->fd_free, ft, ft_next); } - /* The map does not have the same possibility of threads still + /* + * The map does not have the same possibility of threads still * holding references to it. So always free it as long as it - * does not reference the original static allocation. */ + * does not reference the original static allocation. + */ if (NDSLOTS(onfiles) > NDSLOTS(NDFILE)) free(omap, M_FILEDESC); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 05:13:36 2014 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 ESMTPS id 22BB31F9; Sat, 22 Feb 2014 05:13:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C12A117F; Sat, 22 Feb 2014 05:13:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M5DZJ8061114; Sat, 22 Feb 2014 05:13:35 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M5DZG9061113; Sat, 22 Feb 2014 05:13:35 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402220513.s1M5DZG9061113@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Feb 2014 05:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262329 - head/sys/cddl/compat/opensolaris/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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 05:13:36 -0000 Author: markj Date: Sat Feb 22 05:13:35 2014 New Revision: 262329 URL: http://svnweb.freebsd.org/changeset/base/262329 Log: Define the KM_NORMALPRI flag for kmem_alloc(), as it is used in some upstream DTrace code. It indicates that the kernel memory allocator need not attempt to satisfy non-blocking allocations in low-memory conditions. This has no direct equivalent in the malloc(9) flags, so it is just defined to 0 for now. Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Feb 22 04:28:49 2014 (r262328) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Feb 22 05:13:35 2014 (r262329) @@ -47,6 +47,7 @@ MALLOC_DECLARE(M_SOLARIS); #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT #define KM_NODEBUG M_NODUMP +#define KM_NORMALPRI 0 #define KMC_NODEBUG UMA_ZONE_NODUMP #define KMC_NOTOUCH 0 From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 05:18:56 2014 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 ESMTPS id 99307490; Sat, 22 Feb 2014 05:18:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 815C011A1; Sat, 22 Feb 2014 05:18:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M5Iu7i061767; Sat, 22 Feb 2014 05:18:56 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M5It2d061762; Sat, 22 Feb 2014 05:18:55 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402220518.s1M5It2d061762@svn.freebsd.org> From: Mark Johnston Date: Sat, 22 Feb 2014 05:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262330 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 05:18:56 -0000 Author: markj Date: Sat Feb 22 05:18:55 2014 New Revision: 262330 URL: http://svnweb.freebsd.org/changeset/base/262330 Log: 1452 DTrace buffer autoscaling should be less violent illumos/illumos-gate@6fb4854bed54ce82bd8610896b64ddebcd4af706 This fixes the tst.resize1.d and tst.resize2.d DTrace tests, which have been failing since r261122 since they were causing dtrace(1) to attempt to allocate and use large amounts of memory, and get killed by the OOM killer as a result. MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Sat Feb 22 05:13:35 2014 (r262329) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d Sat Feb 22 05:18:55 2014 (r262330) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/bufsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option bufsize=100t Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Sat Feb 22 05:13:35 2014 (r262329) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d Sat Feb 22 05:18:55 2014 (r262330) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: * Checks that setting "bufresize" to "auto" will cause buffer @@ -34,14 +32,8 @@ * SECTION: Buffers and Buffering/Buffer Resizing Policy; * Options and Tunables/aggsize; * Options and Tunables/bufresize - * - * NOTES: - * We use the undocumented "preallocate" option to make sure dtrace(1M) - * has enough space in its heap to allocate a buffer as large as the - * kernel's trace buffer. */ -#pragma D option preallocate=100t #pragma D option bufresize=auto #pragma D option aggsize=100t Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Sat Feb 22 05:13:35 2014 (r262329) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Sat Feb 22 05:18:55 2014 (r262330) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -906,30 +904,6 @@ dt_options_load(dtrace_hdl_t *dtp) return (0); } -/*ARGSUSED*/ -static int -dt_opt_preallocate(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) -{ - dtrace_optval_t size; - void *p; - - if (arg == NULL || dt_optval_parse(arg, &size) != 0) - return (dt_set_errno(dtp, EDT_BADOPTVAL)); - - if (size > SIZE_MAX) - size = SIZE_MAX; - - if ((p = dt_zalloc(dtp, size)) == NULL) { - do { - size /= 2; - } while ((p = dt_zalloc(dtp, size)) == NULL); - } - - dt_free(dtp, p); - - return (0); -} - typedef struct dt_option { const char *o_name; int (*o_func)(dtrace_hdl_t *, const char *, uintptr_t); @@ -968,7 +942,6 @@ static const dt_option_t _dtrace_ctoptio { "linktype", dt_opt_linktype }, { "nolibs", dt_opt_cflags, DTRACE_C_NOLIBS }, { "pgmax", dt_opt_pgmax }, - { "preallocate", dt_opt_preallocate }, { "pspec", dt_opt_cflags, DTRACE_C_PSPEC }, { "setenv", dt_opt_setenv, 1 }, { "stdc", dt_opt_stdc }, Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Feb 22 05:13:35 2014 (r262329) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Feb 22 05:18:55 2014 (r262330) @@ -10853,17 +10853,20 @@ dtrace_buffer_activate(dtrace_state_t *s static int dtrace_buffer_alloc(dtrace_buffer_t *bufs, size_t size, int flags, - processorid_t cpu) + processorid_t cpu, int *factor) { #if defined(sun) cpu_t *cp; #endif dtrace_buffer_t *buf; + int allocated = 0, desired = 0; #if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); ASSERT(MUTEX_HELD(&dtrace_lock)); + *factor = 1; + if (size > dtrace_nonroot_maxsize && !PRIV_POLICY_CHOICE(CRED(), PRIV_ALL, B_FALSE)) return (EFBIG); @@ -10887,7 +10890,8 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf ASSERT(buf->dtb_xamot == NULL); - if ((buf->dtb_tomax = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_tomax = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; buf->dtb_size = size; @@ -10898,7 +10902,8 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf if (flags & DTRACEBUF_NOSWITCH) continue; - if ((buf->dtb_xamot = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_xamot = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; } while ((cp = cp->cpu_next) != cpu_list); @@ -10912,27 +10917,29 @@ err: continue; buf = &bufs[cp->cpu_id]; + desired += 2; if (buf->dtb_xamot != NULL) { ASSERT(buf->dtb_tomax != NULL); ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_xamot, size); + allocated++; } if (buf->dtb_tomax != NULL) { ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_tomax, size); + allocated++; } buf->dtb_tomax = NULL; buf->dtb_xamot = NULL; buf->dtb_size = 0; } while ((cp = cp->cpu_next) != cpu_list); - - return (ENOMEM); #else int i; + *factor = 1; #if defined(__amd64__) || defined(__mips__) || defined(__powerpc__) /* * FreeBSD isn't good at limiting the amount of memory we @@ -10940,7 +10947,7 @@ err: * to do something that might well end in tears at bedtime. */ if (size > physmem * PAGE_SIZE / (128 * (mp_maxid + 1))) - return(ENOMEM); + return (ENOMEM); #endif ASSERT(MUTEX_HELD(&dtrace_lock)); @@ -10962,7 +10969,8 @@ err: ASSERT(buf->dtb_xamot == NULL); - if ((buf->dtb_tomax = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_tomax = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; buf->dtb_size = size; @@ -10973,7 +10981,8 @@ err: if (flags & DTRACEBUF_NOSWITCH) continue; - if ((buf->dtb_xamot = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((buf->dtb_xamot = kmem_zalloc(size, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) goto err; } @@ -10989,16 +10998,19 @@ err: continue; buf = &bufs[i]; + desired += 2; if (buf->dtb_xamot != NULL) { ASSERT(buf->dtb_tomax != NULL); ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_xamot, size); + allocated++; } if (buf->dtb_tomax != NULL) { ASSERT(buf->dtb_size == size); kmem_free(buf->dtb_tomax, size); + allocated++; } buf->dtb_tomax = NULL; @@ -11006,9 +11018,10 @@ err: buf->dtb_size = 0; } +#endif + *factor = desired / (allocated > 0 ? allocated : 1); return (ENOMEM); -#endif } /* @@ -12961,7 +12974,7 @@ dtrace_dstate_init(dtrace_dstate_t *dsta if (size < (min = dstate->dtds_chunksize + sizeof (dtrace_dynhash_t))) size = min; - if ((base = kmem_zalloc(size, KM_NOSLEEP)) == NULL) + if ((base = kmem_zalloc(size, KM_NOSLEEP | KM_NORMALPRI)) == NULL) return (ENOMEM); dstate->dtds_size = size; @@ -13413,7 +13426,7 @@ dtrace_state_buffer(dtrace_state_t *stat { dtrace_optval_t *opt = state->dts_options, size; processorid_t cpu = 0;; - int flags = 0, rval; + int flags = 0, rval, factor, divisor = 1; ASSERT(MUTEX_HELD(&dtrace_lock)); ASSERT(MUTEX_HELD(&cpu_lock)); @@ -13443,7 +13456,7 @@ dtrace_state_buffer(dtrace_state_t *stat flags |= DTRACEBUF_INACTIVE; } - for (size = opt[which]; size >= sizeof (uint64_t); size >>= 1) { + for (size = opt[which]; size >= sizeof (uint64_t); size /= divisor) { /* * The size must be 8-byte aligned. If the size is not 8-byte * aligned, drop it down by the difference. @@ -13461,7 +13474,7 @@ dtrace_state_buffer(dtrace_state_t *stat return (E2BIG); } - rval = dtrace_buffer_alloc(buf, size, flags, cpu); + rval = dtrace_buffer_alloc(buf, size, flags, cpu, &factor); if (rval != ENOMEM) { opt[which] = size; @@ -13470,6 +13483,9 @@ dtrace_state_buffer(dtrace_state_t *stat if (opt[DTRACEOPT_BUFRESIZE] == DTRACEOPT_BUFRESIZE_MANUAL) return (rval); + + for (divisor = 2; divisor < factor; divisor <<= 1) + continue; } return (ENOMEM); @@ -13571,7 +13587,8 @@ dtrace_state_go(dtrace_state_t *state, p goto out; } - spec = kmem_zalloc(nspec * sizeof (dtrace_speculation_t), KM_NOSLEEP); + spec = kmem_zalloc(nspec * sizeof (dtrace_speculation_t), + KM_NOSLEEP | KM_NORMALPRI); if (spec == NULL) { rval = ENOMEM; @@ -13582,7 +13599,8 @@ dtrace_state_go(dtrace_state_t *state, p state->dts_nspeculations = (int)nspec; for (i = 0; i < nspec; i++) { - if ((buf = kmem_zalloc(bufsize, KM_NOSLEEP)) == NULL) { + if ((buf = kmem_zalloc(bufsize, + KM_NOSLEEP | KM_NORMALPRI)) == NULL) { rval = ENOMEM; goto err; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 07:18:08 2014 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 ESMTPS id 87E034F2; Sat, 22 Feb 2014 07:18:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F93419E2; Sat, 22 Feb 2014 07:18:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M7I81K009010; Sat, 22 Feb 2014 07:18:08 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M7I73P009003; Sat, 22 Feb 2014 07:18:07 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201402220718.s1M7I73P009003@svn.freebsd.org> From: Peter Grehan Date: Sat, 22 Feb 2014 07:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262331 - in head: sys/boot/userboot sys/boot/userboot/userboot sys/boot/userboot/zfs usr.sbin/bhyveload 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 07:18:08 -0000 Author: grehan Date: Sat Feb 22 07:18:06 2014 New Revision: 262331 URL: http://svnweb.freebsd.org/changeset/base/262331 Log: ZFS boot support for bhyveload. Modelled after the i386 zfsloader. However, with no 2nd stage zfsboot to search for a bootable dataset, attempt a ZFS boot if there is more than one ZFS dataset found during the disk probe. sys/boot/userboot/zfs - build the ZFS boot library sys/boot/userboot/userboot/ conf.c - Add the ZFS pool and filesystem tables devicename.c - correctly format ZFS devices main.c - increase the size of the libstand malloc pool to account for the increased usage from ZFS buffers - probe for a ZFS dataset, and if one is found, attempt to boot from it. usr.sbin/bhyveload/bhyveload.c - allow multiple invocations of the '-d' option to specify multiple disks e.g. a raidz set. Up to 32 disks are supported. Tested with various combinations of GPT, MBR, single and multiple disks, RAID-Z, mirrors. Reviewed by: neel Discussed with: avg Tested by: Michael Dexter and others MFC after: 3 weeks Added: head/sys/boot/userboot/zfs/ head/sys/boot/userboot/zfs/Makefile (contents, props changed) Modified: head/sys/boot/userboot/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/userboot/conf.c head/sys/boot/userboot/userboot/devicename.c head/sys/boot/userboot/userboot/main.c head/usr.sbin/bhyveload/bhyveload.c Modified: head/sys/boot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/Makefile Sat Feb 22 05:18:55 2014 (r262330) +++ head/sys/boot/userboot/Makefile Sat Feb 22 07:18:06 2014 (r262331) @@ -2,7 +2,7 @@ .include -SUBDIR= ficl libstand test userboot +SUBDIR= ficl libstand test zfs userboot .include Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Sat Feb 22 05:18:55 2014 (r262330) +++ head/sys/boot/userboot/userboot/Makefile Sat Feb 22 07:18:06 2014 (r262331) @@ -51,12 +51,17 @@ LIBFICL= ${.OBJDIR}/../ficl/libficl.a LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif +.if ${MK_ZFS} != "no" +CFLAGS+= -DUSERBOOT_ZFS_SUPPORT +LIBZFS= ${.OBJDIR}/../zfs/libzfsboot.a +.endif + # Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD= ${LIBFICL} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBZFS} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBZFS} ${LIBSTAND} .include Modified: head/sys/boot/userboot/userboot/conf.c ============================================================================== --- head/sys/boot/userboot/userboot/conf.c Sat Feb 22 05:18:55 2014 (r262330) +++ head/sys/boot/userboot/userboot/conf.c Sat Feb 22 07:18:06 2014 (r262331) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "libuserboot.h" +#if defined(USERBOOT_ZFS_SUPPORT) +#include "../zfs/libzfs.h" +#endif + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into @@ -51,6 +55,9 @@ __FBSDID("$FreeBSD$"); struct devsw *devsw[] = { &host_dev, &userboot_disk, +#if defined(USERBOOT_ZFS_SUPPORT) + &zfs_dev, +#endif NULL }; @@ -59,6 +66,9 @@ struct fs_ops *file_system[] = { &ufs_fsops, &cd9660_fsops, &gzipfs_fsops, +#if defined(USERBOOT_ZFS_SUPPORT) + &zfs_fsops, +#endif NULL }; Modified: head/sys/boot/userboot/userboot/devicename.c ============================================================================== --- head/sys/boot/userboot/userboot/devicename.c Sat Feb 22 05:18:55 2014 (r262330) +++ head/sys/boot/userboot/userboot/devicename.c Sat Feb 22 07:18:06 2014 (r262331) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libuserboot.h" +#if defined(USERBOOT_ZFS_SUPPORT) +#include "../zfs/libzfs.h" +#endif + static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path); /* @@ -119,7 +123,6 @@ userboot_parsedev(struct disk_devdesc ** case DEVT_CD: case DEVT_NET: - case DEVT_ZFS: unit = 0; if (*np && (*np != ':')) { @@ -141,6 +144,16 @@ userboot_parsedev(struct disk_devdesc ** *path = (*cp == 0) ? cp : cp + 1; break; + case DEVT_ZFS: +#if defined(USERBOOT_ZFS_SUPPORT) + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; +#else + /* FALLTHROUGH */ +#endif + default: err = EINVAL; goto fail; @@ -179,8 +192,15 @@ userboot_fmtdev(void *vdev) return (disk_fmtdev(vdev)); case DEVT_NET: + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + break; + case DEVT_ZFS: +#if defined(USERBOOT_ZFS_SUPPORT) + return (zfs_fmtdev(vdev)); +#else sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); +#endif break; } return(buf); Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Sat Feb 22 05:18:55 2014 (r262330) +++ head/sys/boot/userboot/userboot/main.c Sat Feb 22 07:18:06 2014 (r262331) @@ -36,8 +36,17 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libuserboot.h" +#if defined(USERBOOT_ZFS_SUPPORT) +#include "../zfs/libzfs.h" + +static void userboot_zfs_probe(void); +static int userboot_zfs_found; +#endif + #define USERBOOT_VERSION USERBOOT_VERSION_3 +#define MALLOCSZ (10*1024*1024) + struct loader_callbacks *callbacks; void *callbacks_arg; @@ -69,7 +78,7 @@ exit(int v) void loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) { - static char malloc[1024*1024]; + static char mallocbuf[MALLOCSZ]; const char *var; int i; @@ -82,23 +91,15 @@ loader_main(struct loader_callbacks *cb, /* * initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is - * safe. + * alloc() is usable. */ - setheap((void *)malloc, (void *)(malloc + 1024*1024)); + setheap((void *)mallocbuf, (void *)(mallocbuf + sizeof(mallocbuf))); /* * Hook up the console */ cons_probe(); - /* - * March through the device switch probing for things. - */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); @@ -124,6 +125,16 @@ loader_main(struct loader_callbacks *cb, archsw.arch_copyin = userboot_copyin; archsw.arch_copyout = userboot_copyout; archsw.arch_readin = userboot_readin; +#if defined(USERBOOT_ZFS_SUPPORT) + archsw.arch_zfs_probe = userboot_zfs_probe; +#endif + + /* + * March through the device switch probing for things. + */ + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); extract_currdev(); @@ -146,6 +157,19 @@ extract_currdev(void) //bzero(&dev, sizeof(dev)); +#if defined(USERBOOT_ZFS_SUPPORT) + if (userboot_zfs_found) { + struct zfs_devdesc zdev; + + /* Leave the pool/root guid's unassigned */ + bzero(&zdev, sizeof(zdev)); + zdev.d_dev = &zfs_dev; + zdev.d_type = zdev.d_dev->dv_type; + + dev = *(struct disk_devdesc *)&zdev; + } else +#endif + if (userboot_disk_maxunit > 0) { dev.d_dev = &userboot_disk; dev.d_type = dev.d_dev->dv_type; @@ -172,6 +196,49 @@ extract_currdev(void) env_noset, env_nounset); } +#if defined(USERBOOT_ZFS_SUPPORT) +static void +userboot_zfs_probe(void) +{ + char devname[32]; + uint64_t pool_guid; + int unit; + + /* + * Open all the disks we can find and see if we can reconstruct + * ZFS pools from them. Record if any were found. + */ + for (unit = 0; unit < userboot_disk_maxunit; unit++) { + sprintf(devname, "disk%d:", unit); + pool_guid = 0; + zfs_probe_dev(devname, &pool_guid); + if (pool_guid != 0) + userboot_zfs_found = 1; + } +} + +COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", + command_lszfs); + +static int +command_lszfs(int argc, char *argv[]) +{ + int err; + + if (argc != 2) { + command_errmsg = "a single dataset must be supplied"; + return (CMD_ERROR); + } + + err = zfs_list(argv[1]); + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + return (CMD_OK); +} +#endif /* USERBOOT_ZFS_SUPPORT */ + COMMAND_SET(quit, "quit", "exit the loader", command_quit); static int Added: head/sys/boot/userboot/zfs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/userboot/zfs/Makefile Sat Feb 22 07:18:06 2014 (r262331) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +S= ${.CURDIR}/../../zfs + +.PATH: ${S} +LIB= zfsboot +INTERNALLIB= + +SRCS+= zfs.c + +CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. +CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs + +CFLAGS+= -ffreestanding -fPIC +CFLAGS+= -Wformat -Wall + +.include Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Sat Feb 22 05:18:55 2014 (r262330) +++ head/usr.sbin/bhyveload/bhyveload.c Sat Feb 22 07:18:06 2014 (r262331) @@ -88,9 +88,12 @@ __FBSDID("$FreeBSD$"); #define GB (1024 * 1024 * 1024UL) #define BSP 0 +#define NDISKS 32 + static char *host_base; static struct termios term, oldterm; -static int disk_fd = -1; +static int disk_fd[NDISKS]; +static int ndisks; static int consin_fd, consout_fd; static char *vmname, *progname; @@ -287,9 +290,9 @@ cb_diskread(void *arg, int unit, uint64_ { ssize_t n; - if (unit != 0 || disk_fd == -1) + if (unit < 0 || unit >= ndisks ) return (EIO); - n = pread(disk_fd, to, size, from); + n = pread(disk_fd[unit], to, size, from); if (n < 0) return (errno); *resid = size - n; @@ -301,7 +304,7 @@ cb_diskioctl(void *arg, int unit, u_long { struct stat sb; - if (unit != 0 || disk_fd == -1) + if (unit < 0 || unit >= ndisks) return (EBADF); switch (cmd) { @@ -309,7 +312,7 @@ cb_diskioctl(void *arg, int unit, u_long *(u_int *)data = 512; break; case DIOCGMEDIASIZE: - if (fstat(disk_fd, &sb) == 0) + if (fstat(disk_fd[unit], &sb) == 0) *(off_t *)data = sb.st_size; else return (ENOTTY); @@ -601,6 +604,26 @@ altcons_open(char *path) return (err); } +static int +disk_open(char *path) +{ + int err, fd; + + if (ndisks > NDISKS) + return (ERANGE); + + err = 0; + fd = open(path, O_RDONLY); + + if (fd > 0) { + disk_fd[ndisks] = fd; + ndisks++; + } else + err = errno; + + return (err); +} + static void usage(void) { @@ -620,12 +643,10 @@ main(int argc, char** argv) void (*func)(struct loader_callbacks *, void *, int, int); uint64_t mem_size; int opt, error; - char *disk_image; progname = basename(argv[0]); mem_size = 256 * MB; - disk_image = NULL; consin_fd = STDIN_FILENO; consout_fd = STDOUT_FILENO; @@ -637,8 +658,11 @@ main(int argc, char** argv) if (error != 0) errx(EX_USAGE, "Could not open '%s'", optarg); break; + case 'd': - disk_image = optarg; + error = disk_open(optarg); + if (error != 0) + errx(EX_USAGE, "Could not open '%s'", optarg); break; case 'e': @@ -704,12 +728,8 @@ main(int argc, char** argv) return (1); } - if (disk_image) { - disk_fd = open(disk_image, O_RDONLY); - } - addenv("smbios.bios.vendor=BHYVE"); addenv("boot_serial=1"); - func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0); + func(&cb, NULL, USERBOOT_VERSION_3, ndisks); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 08:48:47 2014 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 ESMTPS id 738CEEE3; Sat, 22 Feb 2014 08:48:47 +0000 (UTC) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D8C310CB; Sat, 22 Feb 2014 08:48:46 +0000 (UTC) Received: from server.rulingia.com (c220-239-232-212.belrs5.nsw.optusnet.com.au [220.239.232.212]) by vps.rulingia.com (8.14.7/8.14.7) with ESMTP id s1M8Nuxi058296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 22 Feb 2014 19:23:56 +1100 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.7/8.14.7) with ESMTP id s1M8NoNP002938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 22 Feb 2014 19:23:51 +1100 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.7/8.14.7/Submit) id s1M8NosP002937; Sat, 22 Feb 2014 19:23:50 +1100 (EST) (envelope-from peter) Date: Sat, 22 Feb 2014 19:23:50 +1100 From: Peter Jeremy To: Baptiste Daroussin Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140222082350.GA2705@server.rulingia.com> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <201402210726.s1L7QnBP007144@svn.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.22 (2013-10-16) 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 08:48:47 -0000 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-Feb-21 07:26:49 +0000, Baptiste Daroussin wrote: >Log: > Import Dragonfly Mail Agent into base system I would like to suggest that 'dma' is a _really_ bad name for any utility. As has been mentioned, 'DMA' has had a well-entrenched meaning for decades and overloading to also refer to a MTA is not going to end well. I'd also query the reason for including Debian-specific code in the FreeBSD base. --=20 Peter Jeremy --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iKYEARECAGYFAlMIXpZfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDBCRjc3QTcyNTg5NEVCRTY0RjREN0VFRUZF OEE0N0JGRjAwRkI4ODcACgkQ/opHv/APuId60QCggd2vnqXHgtgfpomFyRiyZIdn B3gAmwQu1RmaqRemp4X0hBdfrQM2XcuR =Nm6I -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 09:53:17 2014 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 ESMTPS id B0B08C0B; Sat, 22 Feb 2014 09:53:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C16015B9; Sat, 22 Feb 2014 09:53:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M9rHR6072279; Sat, 22 Feb 2014 09:53:17 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M9rHSO072278; Sat, 22 Feb 2014 09:53:17 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201402220953.s1M9rHSO072278@svn.freebsd.org> From: Ivan Voras Date: Sat, 22 Feb 2014 09:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262332 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 09:53:17 -0000 Author: ivoras Date: Sat Feb 22 09:53:17 2014 New Revision: 262332 URL: http://svnweb.freebsd.org/changeset/base/262332 Log: Grammar fix Submitted by: Warren Block wblock AT wonkity.com Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Sat Feb 22 07:18:06 2014 (r262331) +++ head/share/man/man4/ada.4 Sat Feb 22 09:53:17 2014 (r262332) @@ -126,7 +126,7 @@ The default is currently enabled. .It Va kern.cam.ada.write_cache .It Va kern.cam.ada. Ns Ar X Ns Va .write_cache .Pp -These variables determines whether device write cache should be enabled +These variables determine whether device write cache should be enabled globally or per-device or disabled. Set to 1 to enable write cache, 0 to disable, -1 to leave it as-is. Values modified at runtime take effect only after device reset From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 10:15:28 2014 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 ESMTPS id 080A865D; Sat, 22 Feb 2014 10:15:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6EDB180B; Sat, 22 Feb 2014 10:15:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MAFRvO081596; Sat, 22 Feb 2014 10:15:27 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MAFRUC081595; Sat, 22 Feb 2014 10:15:27 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402221015.s1MAFRUC081595@svn.freebsd.org> From: Christian Brueffer Date: Sat, 22 Feb 2014 10:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262333 - head/usr.bin/hexdump 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 10:15:28 -0000 Author: brueffer Date: Sat Feb 22 10:15:27 2014 New Revision: 262333 URL: http://svnweb.freebsd.org/changeset/base/262333 Log: Simplify the way the end of a singly linked list is followed (for adding items), so it is more obvious that we aren't going to indirect through a NULL pointer. PR: 144723 Submitted by: Garrett Cooper Obtained from: NetBSD r1.19 MFC after: 2 weeks Modified: head/usr.bin/hexdump/parse.c Modified: head/usr.bin/hexdump/parse.c ============================================================================== --- head/usr.bin/hexdump/parse.c Sat Feb 22 09:53:17 2014 (r262332) +++ head/usr.bin/hexdump/parse.c Sat Feb 22 10:15:27 2014 (r262333) @@ -210,7 +210,6 @@ rewrite(FS *fs) int nconv, prec; size_t len; - nextpr = NULL; prec = 0; for (fu = fs->nextfu; fu; fu = fu->nextfu) { @@ -218,13 +217,11 @@ rewrite(FS *fs) * Break each format unit into print units; each conversion * character gets its own. */ + nextpr = &fu->nextpr; for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) { if ((pr = calloc(1, sizeof(PR))) == NULL) err(1, NULL); - if (!fu->nextpr) - fu->nextpr = pr; - else - *nextpr = pr; + *nextpr = pr; /* Skip preceding text and up to the next % sign. */ for (p1 = fmtp; *p1 && *p1 != '%'; ++p1); From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 11:06:48 2014 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 ESMTPS id F10B82F5; Sat, 22 Feb 2014 11:06:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9A811BDF; Sat, 22 Feb 2014 11:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MB6meD005350; Sat, 22 Feb 2014 11:06:48 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MB6mSe005349; Sat, 22 Feb 2014 11:06:48 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201402221106.s1MB6mSe005349@svn.freebsd.org> From: David Xu Date: Sat, 22 Feb 2014 11:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262334 - head/libexec/rtld-elf 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 11:06:49 -0000 Author: davidxu Date: Sat Feb 22 11:06:48 2014 New Revision: 262334 URL: http://svnweb.freebsd.org/changeset/base/262334 Log: Increase alignment to size of pointer if the alignment is too small. Some modules do not align data at least to size of pointer, they uses a smaller alignment, but our pointer should be aligned to its native boundary, otherwise on some platforms, hardware alignment checking will cause bus error. Modified: head/libexec/rtld-elf/xmalloc.c Modified: head/libexec/rtld-elf/xmalloc.c ============================================================================== --- head/libexec/rtld-elf/xmalloc.c Sat Feb 22 10:15:27 2014 (r262333) +++ head/libexec/rtld-elf/xmalloc.c Sat Feb 22 11:06:48 2014 (r262334) @@ -73,10 +73,8 @@ malloc_aligned(size_t size, size_t align { void *mem, *res; - if (align & (sizeof(void *) -1)) { - rtld_fdputstr(STDERR_FILENO, "Invalid alignment\n"); - _exit(1); - } + if (align < sizeof(void *)) + align = sizeof(void *); mem = xmalloc(size + sizeof(void *) + align - 1); res = (void *)round((uintptr_t)mem + sizeof(void *), align); From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 12:14:45 2014 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 ESMTPS id 6D673BBE; Sat, 22 Feb 2014 12:14:45 +0000 (UTC) Received: from mail-we0-x229.google.com (mail-we0-x229.google.com [IPv6:2a00:1450: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 A6ED4120D; Sat, 22 Feb 2014 12:14:44 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id t61so3377015wes.28 for ; Sat, 22 Feb 2014 04:14:42 -0800 (PST) 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=DATAr22QTfKLG7kKZxLON1vFQBKgzLflT9FVG/PvOv4=; b=mZQ5TMmyVBzTUIKpHr3yBSGxgKc1W7KD+luHnhG6Cv+2lxEWlAo2VjTQNAJ6gepLlB D17UeD3uhxvd7VFGuk/RFdU5ttw0AMVlhP4mnUtlRbzkR7q1GtdZMzTC1rJyWqau5stT iYMPgj2s8iler/Yd0y3TZB91snu0MmHNpUzHEyZPuHEdnc2PgraOBq+8qeAeAG61ijNS JtIvdn6BztGlfafiDDO+h3Ia7yPKHQn4g9nn7vaQn8eOM1KKoLsRmG5+IPAGDKN4GIuo YtcAfazKKh5AqdRBfaQQK+KX75zP9sh1eWRXfBrnIpop5miYyU7gUUTfc+YohU5UJM7C fjhA== X-Received: by 10.180.98.199 with SMTP id ek7mr6766036wib.21.1393071282874; Sat, 22 Feb 2014 04:14:42 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id f3sm4343467wiv.2.2014.02.22.04.14.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 22 Feb 2014 04:14:41 -0800 (PST) Sender: Baptiste Daroussin Date: Sat, 22 Feb 2014 13:14:38 +0100 From: Baptiste Daroussin To: Peter Jeremy Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140222121438.GO1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tqN4RWvJTb9VNux/" Content-Disposition: inline In-Reply-To: <20140222082350.GA2705@server.rulingia.com> 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 12:14:45 -0000 --tqN4RWvJTb9VNux/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote: > On 2014-Feb-21 07:26:49 +0000, Baptiste Daroussin wrot= e: > >Log: > > Import Dragonfly Mail Agent into base system >=20 > I would like to suggest that 'dma' is a _really_ bad name for any > utility. As has been mentioned, 'DMA' has had a well-entrenched > meaning for decades and overloading to also refer to a MTA is not > going to end well. >=20 > I'd also query the reason for including Debian-specific code in the > FreeBSD base. >=20 > --=20 > Peter Jeremy Where have you seen debian specific code? regards, Bapt --tqN4RWvJTb9VNux/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMIlK4ACgkQ8kTtMUmk6EyjOwCePWxYI/yrgerAXZsIov5phJRr pu0AoJwPDT6LEDOFSXD0THZ3OtFBvQbn =3Q4d -----END PGP SIGNATURE----- --tqN4RWvJTb9VNux/-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 13:05:25 2014 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 ESMTPS id 102A36B4; Sat, 22 Feb 2014 13:05:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E46D715DC; Sat, 22 Feb 2014 13:05:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MD5Osd053170; Sat, 22 Feb 2014 13:05:24 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MD5Nlm053165; Sat, 22 Feb 2014 13:05:23 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402221305.s1MD5Nlm053165@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 22 Feb 2014 13:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262335 - in head: etc libexec share/mk tools/build/mk tools/build/options 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 13:05:25 -0000 Author: bapt Date: Sat Feb 22 13:05:23 2014 New Revision: 262335 URL: http://svnweb.freebsd.org/changeset/base/262335 Log: Rename WITHOUT_DMA into WITHOUT_DMAGENT to avoid confusion Requested by: ian Added: head/tools/build/options/WITHOUT_DMAGENT - copied unchanged from r262334, head/tools/build/options/WITHOUT_DMA Deleted: head/tools/build/options/WITHOUT_DMA Modified: head/etc/Makefile head/libexec/Makefile head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Feb 22 11:06:48 2014 (r262334) +++ head/etc/Makefile Sat Feb 22 13:05:23 2014 (r262335) @@ -226,7 +226,7 @@ distribution: .endif ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install -.if ${MK_DMA} != "no" +.if ${MK_DMAGENT} != "no" ${_+_}cd ${.CURDIR}/dma; ${MAKE} install .endif ${_+_}cd ${.CURDIR}/gss; ${MAKE} install Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Sat Feb 22 11:06:48 2014 (r262334) +++ head/libexec/Makefile Sat Feb 22 13:05:23 2014 (r262335) @@ -49,7 +49,7 @@ _casper= casper _comsat= comsat .endif -.if ${MK_DMA} != "no" +.if ${MK_DMAGENT} != "no" _dma= dma _dma-mbox-create= dma-mbox-create .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Feb 22 11:06:48 2014 (r262334) +++ head/share/mk/bsd.own.mk Sat Feb 22 13:05:23 2014 (r262335) @@ -271,7 +271,7 @@ __DEFAULT_YES_OPTIONS = \ CTM \ CXX \ DICT \ - DMA \ + DMAGENT \ DYNAMICROOT \ ED_CRYPTO \ EXAMPLES \ @@ -512,7 +512,7 @@ MK_GROFF:= no .if ${MK_MAIL} == "no" MK_MAILWRAPPER:= no MK_SENDMAIL:= no -MK_DMA:= no +MK_DMAGENT:= no .endif .if ${MK_NETGRAPH} == "no" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 22 11:06:48 2014 (r262334) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 22 13:05:23 2014 (r262335) @@ -4307,7 +4307,7 @@ OLD_FILES+=usr/bin/svnsync OLD_FILES+=usr/bin/svnversion .endif -.if ${MK_DMA} == no +.if ${MK_DMAGENT} == no OLD_FILES+=usr/libexec/dma OLD_FILES+=usr/libexec/dma-mbox-create OLD_FILES+=usr/share/man/man8/dma.8.gz Copied: head/tools/build/options/WITHOUT_DMAGENT (from r262334, head/tools/build/options/WITHOUT_DMA) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_DMAGENT Sat Feb 22 13:05:23 2014 (r262335, copy of r262334, head/tools/build/options/WITHOUT_DMA) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build dma Mail Transport Agent From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 13:07:03 2014 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 ESMTPS id 800DF9AE; Sat, 22 Feb 2014 13:07:03 +0000 (UTC) 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 94DE215F2; Sat, 22 Feb 2014 13:07:02 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id f8so1663956wiw.15 for ; Sat, 22 Feb 2014 05:07:01 -0800 (PST) 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=x/ZAiKL5Po29pRX5s7/Oo9cOdGzkfN619EYG/blxXsI=; b=EsluA+ZrZ0Najhp1CBbnIiFBlFE6OO/46iTqxRu+PrZ/3asLzBiSfcbs5dGZXo0cgo c4H63gAsqmJz4iu52Bek6XJV6hQFBnruRqlsXHUuCWaXjwOVj28Zmn5SwsX2cOf7YqQW pnrDE6sSn8+Dpo49DRw6rW9vtzTMfnZd3kX/uN3vpB1quFrStIUfNE0JUrhA3Z0sb6jq nHRU/7CA9ImUmhRpCdHlUqTpHWCbVdpJnWstwQeVI6XySXMa9OYROnCM/az23hYMSSee jGkZSjuYrJ0/eIt1ugX5kIUNNHqR/DeJUnJep7KUvZZglBzQeHyg4q1rtOTO1AwkZefy SqaQ== X-Received: by 10.194.216.68 with SMTP id oo4mr11060336wjc.79.1393074421000; Sat, 22 Feb 2014 05:07:01 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id n3sm4636885wix.10.2014.02.22.05.06.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 22 Feb 2014 05:06:59 -0800 (PST) Sender: Baptiste Daroussin Date: Sat, 22 Feb 2014 14:06:57 +0100 From: Baptiste Daroussin To: Ian Lepore Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140222130656.GP1699@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <1393003867.1145.114.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s2lX4GznBIrto1wi" Content-Disposition: inline In-Reply-To: <1393003867.1145.114.camel@revolution.hippie.lan> 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 13:07:03 -0000 --s2lX4GznBIrto1wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 21, 2014 at 10:31:07AM -0700, Ian Lepore wrote: > On Fri, 2014-02-21 at 07:26 +0000, Baptiste Daroussin wrote: > > Author: bapt > > Date: Fri Feb 21 07:26:49 2014 > > New Revision: 262282 > > URL: http://svnweb.freebsd.org/changeset/base/262282 > >=20 > > Log: > > Import Dragonfly Mail Agent into base system > > =20 > > It is a small and lightweight Mail Transport Agent. > > It accepts mails from locally installed Mail User Agents (MUA) and de= livers the > > mails either locally or to a remote destination. Remote delivery incl= udes > > several features like TLS/SSL support, SMTP authentication and NULLCL= IENT. > > =20 > > Make dma conditional to new WITHOUT_DMA option and make it respect WI= THOUT_MAIL > > =20 > > Reviewed by: peter > > Discussed with: emaste, bz, peter > >=20 >=20 > This seems to be causing "redundant redeclaration of yylval" tinderbox > failures. Already fixed, few hours after the import >=20 > Also, IMO, "WITHOUT_DMA" is a horrible build option name. DMA has a > pretty universally understood meaning in computing, and anyone seeing > that as a build option is likely to assume that meaning (and freak out a > bit) rather than looking in a manpage for an alternative meaning. How > about "WITHOUT_DMAGENT"? >=20 Good idea, done regards, Bapt --s2lX4GznBIrto1wi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMIoPAACgkQ8kTtMUmk6ExbgwCgj0KuLJEK/VfQV8ARrS+XnNa1 W7sAnipghynccOX4V+ke5mTT8IEKB0QF =Bdi2 -----END PGP SIGNATURE----- --s2lX4GznBIrto1wi-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 13:07:39 2014 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 ESMTPS id 62679AF8; Sat, 22 Feb 2014 13:07:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E72B15FB; Sat, 22 Feb 2014 13:07:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MD7dDE053630; Sat, 22 Feb 2014 13:07:39 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MD7dA0053629; Sat, 22 Feb 2014 13:07:39 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402221307.s1MD7dA0053629@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 22 Feb 2014 13:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262336 - head/share/man/man5 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 13:07:39 -0000 Author: bapt Date: Sat Feb 22 13:07:38 2014 New Revision: 262336 URL: http://svnweb.freebsd.org/changeset/base/262336 Log: Regen after WITHOUT_DMA -> WITHOUT_DMAGENT renaming Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Feb 22 13:05:23 2014 (r262335) +++ head/share/man/man5/src.conf.5 Sat Feb 22 13:07:38 2014 (r262336) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd February 21, 2014 +.Dd February 22, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -326,8 +326,8 @@ and are located automatically by .It Va WITHOUT_DICT .\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. -.It Va WITHOUT_DMA -.\" from FreeBSD: head/tools/build/options/WITHOUT_DMA 262282 2014-02-21 07:26:49Z bapt +.It Va WITHOUT_DMAGENT +.\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 262335 2014-02-22 13:05:23Z bapt Set to not build dma Mail Transport Agent .It Va WITHOUT_DYNAMICROOT .\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru @@ -675,7 +675,7 @@ When set, it also enforces the following .Pp .Bl -item -compact .It -.Va WITHOUT_DMA +.Va WITHOUT_DMAGENT .It .Va WITHOUT_MAILWRAPPER .It From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 17:51:10 2014 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 ESMTPS id BAF0FE90; Sat, 22 Feb 2014 17:51:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B8311C53; Sat, 22 Feb 2014 17:51:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MHpAcf070499; Sat, 22 Feb 2014 17:51:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MHpAn8070498; Sat, 22 Feb 2014 17:51:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402221751.s1MHpAn8070498@svn.freebsd.org> From: Ian Lepore Date: Sat, 22 Feb 2014 17:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262337 - head/sys/boot/uboot/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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 17:51:10 -0000 Author: ian Date: Sat Feb 22 17:51:10 2014 New Revision: 262337 URL: http://svnweb.freebsd.org/changeset/base/262337 Log: Allow the ubldr boot device to be choosen by a u-boot environment variable. If a "loaderdev=" env variable is set and the named device exists, it is used. If the device doesn't exist, fall back to the historic "probe" loop that prefers disk devices over network devices. If the env var is not set, preserve the historic behavior of using the first working disk device provided by u-boot, or a network device if no functional disk device is found and a network device exists. The old probe loop is reworked so that it checks all bootable devices provided by u-boot rather than taking an early-out on the first device found. This results in the cosmetic change of listing all potential boot devices for the user, but the behavior of which device it chooses is the same as it has always been. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sat Feb 22 13:07:38 2014 (r262336) +++ head/sys/boot/uboot/common/main.c Sat Feb 22 17:51:10 2014 (r262337) @@ -120,8 +120,9 @@ int main(void) { struct api_signature *sig = NULL; - int i; + int diskdev, i, netdev, usedev; struct open_file f; + const char * loaderdev; if (!api_search_sig(&sig)) return (-1); @@ -167,8 +168,49 @@ main(void) meminfo(); /* - * March through the device switch probing for things. + * March through the device switch probing for things -- sort of. + * + * The devsw array will have one or two items in it. If + * LOADER_DISK_SUPPORT is defined the first item will be a disk (which + * may not actually work if u-boot didn't supply one). If + * LOADER_NET_SUPPORT is defined the next item will be a network + * interface. Again it may not actually work at the u-boot level. + * + * The original logic was to always use a disk if it could be + * successfully opened, otherwise use the network interface. Now that + * logic is amended to first check whether the u-boot environment + * contains a loaderdev variable which tells us which device to use. If + * it does, we use it and skip the original (second) loop which "probes" + * for a device. We still loop over the devsw just in case it ever gets + * expanded to hold more than 2 devices (but then unit numbers, which + * don't currently exist, may come into play). If the device named by + * loaderdev isn't found, fall back using to the old "probe" loop. + * + * The original probe loop still effectively behaves as it always has: + * the first usable disk device is choosen, and a network device is used + * only if no disk device is found. The logic has been reworked so that + * it examines (and thus lists) every potential device along the way + * instead of breaking out of the loop when the first device is found. */ + loaderdev = ub_env_get("loaderdev"); + usedev = -1; + if (loaderdev != NULL) { + for (i = 0; devsw[i] != NULL; i++) { + if (strcmp(loaderdev, devsw[i]->dv_name) == 0) { + if (devsw[i]->dv_init == NULL) + continue; + if ((devsw[i]->dv_init)() != 0) + continue; + usedev = i; + goto have_device; + } + } + printf("U-Boot env contains 'loaderdev=%s', " + "device not found.\n", loaderdev); + } + printf("Probing for bootable devices...\n"); + diskdev = -1; + netdev = -1; for (i = 0; devsw[i] != NULL; i++) { if (devsw[i]->dv_init == NULL) @@ -176,27 +218,43 @@ main(void) if ((devsw[i]->dv_init)() != 0) continue; - printf("\nDevice: %s\n", devsw[i]->dv_name); - - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; + printf("Bootable device: %s\n", devsw[i]->dv_name); if (strncmp(devsw[i]->dv_name, "disk", strlen(devsw[i]->dv_name)) == 0) { f.f_devdata = &currdev; + currdev.d_dev = devsw[i]; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = 0; currdev.d_disk.slice = 0; - if (devsw[i]->dv_open(&f,&currdev) == 0) - break; + if (devsw[i]->dv_open(&f, &currdev) == 0) { + devsw[i]->dv_close(&f); + if (diskdev == -1) + diskdev = i; + } + } else if (strncmp(devsw[i]->dv_name, "net", + strlen(devsw[i]->dv_name)) == 0) { + if (netdev == -1) + netdev = i; } - - if (strncmp(devsw[i]->dv_name, "net", - strlen(devsw[i]->dv_name)) == 0) - break; } - if (devsw[i] == NULL) - panic("No boot device found!"); + if (diskdev != -1) + usedev = diskdev; + else if (netdev != -1) + usedev = netdev; + else + panic("No bootable devices found!\n"); + +have_device: + + currdev.d_dev = devsw[usedev]; + currdev.d_type = devsw[usedev]->dv_type; + currdev.d_unit = 0; + if (currdev.d_type == DEV_TYP_STOR) + currdev.d_disk.slice = 0; + + printf("Current device: %s\n", currdev.d_dev->dv_name); env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), uboot_setcurrdev, env_nounset); From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 18:53:43 2014 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 ESMTPS id D0319E42; Sat, 22 Feb 2014 18:53:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8BB012D8; Sat, 22 Feb 2014 18:53:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MIrhKV096877; Sat, 22 Feb 2014 18:53:43 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MIrh5S096875; Sat, 22 Feb 2014 18:53:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201402221853.s1MIrh5S096875@svn.freebsd.org> From: Alan Cox Date: Sat, 22 Feb 2014 18:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262338 - in head/sys: amd64/amd64 i386/i386 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 18:53:44 -0000 Author: alc Date: Sat Feb 22 18:53:42 2014 New Revision: 262338 URL: http://svnweb.freebsd.org/changeset/base/262338 Log: When the kernel is running in a virtual machine, it cannot rely upon the processor family to determine if the workaround for AMD Family 10h Erratum 383 should be enabled. To enable virtual machine migration among a heterogeneous collection of physical machines, the hypervisor may have been configured to report an older processor family with a reduced feature set. Effectively, the reported processor family and its features are like a "least common denominator" for the collection of machines. Therefore, when the kernel is running in a virtual machine, instead of relying upon the processor family, we now test for features that prove that the underlying processor is not affected by the erratum. (The features that we test for are unlikely to ever be emulated in software on an affected physical processor.) PR: 186061 Tested by: Simon Matter Discussed with: jhb, neel MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Feb 22 17:51:10 2014 (r262337) +++ head/sys/amd64/amd64/pmap.c Sat Feb 22 18:53:42 2014 (r262338) @@ -1005,12 +1005,18 @@ pmap_init(void) } /* - * If the kernel is running in a virtual machine on an AMD Family 10h - * processor, then it must assume that MCA is enabled by the virtual - * machine monitor. - */ - if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) == 0x10) + * If the kernel is running on a virtual machine, then it must assume + * that MCA is enabled by the hypervisor. Moreover, the kernel must + * be prepared for the hypervisor changing the vendor and family that + * are reported by CPUID. Consequently, the workaround for AMD Family + * 10h Erratum 383 is enabled if the processor's feature set does not + * include at least one feature that is only supported by older Intel + * or newer AMD processors. + */ + if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | + CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | + AMDID2_FMA4)) == 0) workaround_erratum383 = 1; /* Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Feb 22 17:51:10 2014 (r262337) +++ head/sys/i386/i386/pmap.c Sat Feb 22 18:53:42 2014 (r262338) @@ -750,12 +750,18 @@ pmap_init(void) pv_entry_high_water = 9 * (pv_entry_max / 10); /* - * If the kernel is running in a virtual machine on an AMD Family 10h - * processor, then it must assume that MCA is enabled by the virtual - * machine monitor. - */ - if (vm_guest == VM_GUEST_VM && cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) == 0x10) + * If the kernel is running on a virtual machine, then it must assume + * that MCA is enabled by the hypervisor. Moreover, the kernel must + * be prepared for the hypervisor changing the vendor and family that + * are reported by CPUID. Consequently, the workaround for AMD Family + * 10h Erratum 383 is enabled if the processor's feature set does not + * include at least one feature that is only supported by older Intel + * or newer AMD processors. + */ + if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | + CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | + AMDID2_FMA4)) == 0) workaround_erratum383 = 1; /* From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 18:55:52 2014 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 ESMTPS id 2F14AFAB; Sat, 22 Feb 2014 18:55:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18BAF12EF; Sat, 22 Feb 2014 18:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MItqrU097365; Sat, 22 Feb 2014 18:55:52 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MIto4x097347; Sat, 22 Feb 2014 18:55:50 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402221855.s1MIto4x097347@svn.freebsd.org> From: Peter Wemm Date: Sat, 22 Feb 2014 18:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262339 - in stable/10/contrib/serf: . auth buckets build X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 18:55:52 -0000 Author: peter Date: Sat Feb 22 18:55:49 2014 New Revision: 262339 URL: http://svnweb.freebsd.org/changeset/base/262339 Log: MFC r262324: serf 1.3.4 - improve SSL handling with svn-1.8.8 and other speedups and quality of life fixes. Modified: stable/10/contrib/serf/CHANGES stable/10/contrib/serf/README stable/10/contrib/serf/SConstruct stable/10/contrib/serf/auth/auth.c stable/10/contrib/serf/auth/auth.h stable/10/contrib/serf/auth/auth_basic.c stable/10/contrib/serf/auth/auth_digest.c stable/10/contrib/serf/auth/auth_spnego.c stable/10/contrib/serf/auth/auth_spnego.h stable/10/contrib/serf/auth/auth_spnego_gss.c stable/10/contrib/serf/auth/auth_spnego_sspi.c stable/10/contrib/serf/buckets/headers_buckets.c stable/10/contrib/serf/buckets/response_buckets.c stable/10/contrib/serf/buckets/socket_buckets.c stable/10/contrib/serf/buckets/ssl_buckets.c stable/10/contrib/serf/build/check.py stable/10/contrib/serf/build/gen_def.py stable/10/contrib/serf/build/serf.pc.in stable/10/contrib/serf/context.c stable/10/contrib/serf/outgoing.c stable/10/contrib/serf/serf.h stable/10/contrib/serf/serf_private.h stable/10/contrib/serf/ssltunnel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/serf/CHANGES ============================================================================== --- stable/10/contrib/serf/CHANGES Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/CHANGES Sat Feb 22 18:55:49 2014 (r262339) @@ -1,4 +1,59 @@ -Serf 1.3.0 [2013-07-23, from /tags/1.3.0] +Serf 1.3.4 [2014-02-08, from /tags/1.3.4, rxxxx] + Fix issue #119: Endless loop during ssl tunnel setup with Negotiate authn + Fix issue #123: Can't setup ssl tunnel which sends Connection close header + Fix a race condition when initializing OpenSSL from multiple threads (r2263) + Fix issue #138: Incorrect pkg-config file when GSSAPI isn't configured + + +Serf 1.3.3 [2013-12-09, from /tags/1.3.3, r2242] + Fix issue 129: Try more addresses of multihomed servers + Handle X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE correctly (r2225) + Return APR_TIMEUP from poll() to enable detecting connection timeouts (r2183) + + +Serf 1.3.2 [2013-10-04, from /tags/1.3.2, r2195] + Fix issue 130: HTTP headers should be treated case-insensitively + Fix issue 126: Compilation breaks with Codewarrior compiler + Fix crash during cleanup of SSL buckets in apr_terminate() (r2145) + Fix Windows build: Also export functions with capital letters in .def file + Fix host header when url contains a username or password (r2170) + Ensure less TCP package fragmentation on Windows (r2145) + Handle authentication for responses to HEAD requests (r2178,-9) + Improve serf_get: add option to add request headers, allow url with query, + allow HEAD requests (r2143,r2175,-6) + Improve RFC conformance: don't expect body for certain responses (r2011,-2) + Do not invoke progress callback when no data was received (r2144) + And more test suite fixes and build warning cleanups + SCons-related fixes: + Fix build when GSSAPI not in default include path (2155) + Fix OpenBSD build: always map all LIBPATH entries into RPATH (r2156) + Checksum generation in Windows shared libraries for release builds (2162) + Mac OS X: Use MAJOR version only in dylib install name (r2161) + Use both MAJOR and MINOR version for the shared library name (2163) + Fix the .pc file when installing serf in a non-default LIBDIR (r2191) + + +Serf 1.3.1 [2013-08-15, from /tags/1.3.1, r2138] + Fix issue 77: Endless loop if server doesn't accept Negotiate authentication. + Fix issue 114: ssl/tls renegotiation fails + Fix issue 120: error with ssl tunnel over proxy with KeepAlive off and + Basic authentication. + Fixed bugs with authentication (r2057,2115,2118) + SCons-related fixes: + Fix issue 111: add flag to set custom library path + Fix issue 112: add soname + Fix issue 113: add gssapi libs in the serf pc file + Fix issue 115: Setting RPATH on Solaris broken in SConstruct + Fix issue 116: scons check should return non-zero exit staths + Fix issue 121: make CFLAGS, LIBS, LINKFLAGS and CPPFLAGS take a space- + separated list of flags. + Fix issue 122: make scons PREFIX create the folder if it doesn't exist + Mac OS X: Fix scons --install-sandbox + Solaris: Fix build with cc, don't use unsupported compiler flags + Require SCons version 2.3.0 or higher now (for the soname support). + + +Serf 1.3.0 [2013-07-23, from /tags/1.3.0, r2074] Fix issue 83: use PATH rather than URI within an ssltunnel (r1952) Fix issue 108: improved error reporting from the underlying socket (r1951) NEW: Switch to the SCons build system; retire serfmake, serf.mak, autotools Modified: stable/10/contrib/serf/README ============================================================================== --- stable/10/contrib/serf/README Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/README Sat Feb 22 18:55:49 2014 (r262339) @@ -18,14 +18,14 @@ kept to a minimum to provide high perfor 1.1. SCons build system -serf uses SCons 2.x for its build system. If it is not installed on +serf uses SCons 2.3 for its build system. If it is not installed on your system, then you can install it onto your system. If you do not have permissions, then you can download and install the "local" version into your home directory. When installed privately, simply create a symlink for 'scons' in your PATH to /path/to/scons/scons.py. Fetch the scons-local package: - http://prdownloads.sourceforge.net/scons/scons-local-2.0.1.tar.gz + http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz 1.2 Building serf @@ -54,6 +54,12 @@ distinct directory from the source), you $ scons -Y /path/to/serf/source +If you plan to install the library on a system that uses different +paths for architecture dependent files, specify LIBDIR. LIBDIR defaults +to /usr/local/lib otherwise. Example for a 64 bit GNU/Linux system: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 + At any point, the current settings can be examined: $ scons --help @@ -74,6 +80,13 @@ specified on the install command line: $ scons PREFIX=/some/path install +Distribution package maintainers regulary install to a buildroot, and +would normally use something like below in their build systems, with +placeholders for the specific paths: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 +$ scons install --install-sandbox=/path/to/buildroot + 1.4 Cleaning up the build Modified: stable/10/contrib/serf/SConstruct ============================================================================== --- stable/10/contrib/serf/SConstruct Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/SConstruct Sat Feb 22 18:55:49 2014 (r262339) @@ -19,6 +19,8 @@ import sys import os import re +EnsureSConsVersion(2,3,0) + HEADER_FILES = ['serf.h', 'serf_bucket_types.h', 'serf_bucket_util.h', @@ -34,23 +36,35 @@ def _converter(val): if val == 'none': val = [] else: - val = val.split(',') + val = val.split(' ') return val def RawListVariable(key, help, default): """ The input parameters describe a 'raw string list' option. This class - accepts a comma separated list and converts it to a space separated - list. + accepts a space-separated string and converts it to a list. """ return (key, '%s' % (help), default, None, lambda val: _converter(val)) +# Custom path validator, creates directory when a specified option is set. +# To be used to ensure a PREFIX directory is only created when installing. +def createPathIsDirCreateWithTarget(target): + def my_validator(key, val, env): + build_targets = (map(str, BUILD_TARGETS)) + if target in build_targets: + return PathVariable.PathIsDirCreate(key, val, env) + else: + return PathVariable.PathAccept(key, val, env) + return my_validator + # default directories if sys.platform == 'win32': + default_incdir='..' default_libdir='..' default_prefix='Debug' else: - default_libdir='/usr' + default_incdir='/usr' + default_libdir='$PREFIX/lib' default_prefix='/usr/local' opts = Variables(files=[SAVED_CONFIG]) @@ -58,22 +72,26 @@ opts.AddVariables( PathVariable('PREFIX', 'Directory to install under', default_prefix, - PathVariable.PathIsDir), + createPathIsDirCreateWithTarget('install')), + PathVariable('LIBDIR', + 'Directory to install architecture dependent libraries under', + default_libdir, + createPathIsDirCreateWithTarget('install')), PathVariable('APR', "Path to apr-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('APU', "Path to apu-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('OPENSSL', "Path to OpenSSL's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('ZLIB', "Path to zlib's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('GSSAPI', "Path to GSSAPI's install area", @@ -86,14 +104,14 @@ opts.AddVariables( "Enable using a static compiled APR", False), RawListVariable('CC', "Command name or path of the C compiler", None), - RawListVariable('CFLAGS', "Extra flags for the C compiler (comma separated)", + RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)", None), RawListVariable('LIBS', "Extra libraries passed to the linker, " - "e.g. -l (comma separated)", None), - RawListVariable('LINKFLAGS', "Extra flags for the linker (comma separated)", + "e.g. \"-l -l\" (space separated)", None), + RawListVariable('LINKFLAGS', "Extra flags for the linker (space-separated)", None), RawListVariable('CPPFLAGS', "Extra flags for the C preprocessor " - "(comma separated)", None), + "(space separated)", None), ) if sys.platform == 'win32': @@ -146,6 +164,8 @@ match = re.search('SERF_MAJOR_VERSION ([ re.DOTALL) MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] env.Append(MAJOR=str(MAJOR)) +env.Append(MINOR=str(MINOR)) +env.Append(PATCH=str(PATCH)) # Calling external programs is okay if we're not cleaning or printing help. # (cleaning: no sense in fetching information; help: we may not know where @@ -181,10 +201,18 @@ opts.Save(SAVED_CONFIG, env) # PLATFORM-SPECIFIC BUILD TWEAKS thisdir = os.getcwd() -libdir = '$PREFIX/lib' +libdir = '$LIBDIR' incdir = '$PREFIX/include/serf-$MAJOR' -LIBNAME = 'libserf-${MAJOR}' +# This version string is used in the dynamic library name, and for Mac OS X also +# for the current_version and compatibility_version options in the .dylib +# +# Unfortunately we can't set the .dylib compatibility_version option separately +# from current_version, so don't use the PATCH level to avoid that build and +# runtime patch levels have to be identical. +env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0) + +LIBNAME = 'libserf-%d' % (MAJOR,) if sys.platform != 'win32': LIBNAMESTATIC = LIBNAME else: @@ -196,23 +224,17 @@ env.Append(RPATH=libdir, if sys.platform == 'darwin': # linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,)) env.Append(LINKFLAGS='-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)) - # 'man ld' says positive non-zero for the first number, so we add one. - # Mac's interpretation of compatibility is the same as our MINOR version. - env.Append(LINKFLAGS='-Wl,-compatibility_version,%d' % (MINOR+1,)) - env.Append(LINKFLAGS='-Wl,-current_version,%d.%d' % (MINOR+1, PATCH,)) if sys.platform != 'win32': ### gcc only. figure out appropriate test / better way to check these ### flags, and check for gcc. env.Append(CFLAGS='-std=c89') - env.Append(CCFLAGS=[ - '-Wdeclaration-after-statement', - '-Wmissing-prototypes', - ]) - ### -Wall is not available on Solaris + ### These warnings are not available on Solaris if sys.platform != 'sunos5': - env.Append(CCFLAGS='-Wall') + env.Append(CCFLAGS=['-Wdeclaration-after-statement', + '-Wmissing-prototypes', + '-Wall']) if debug: env.Append(CCFLAGS='-g') @@ -239,6 +261,7 @@ else: # Optimize for speed, use DLL runtime env.Append(CCFLAGS=['/O2', '/MD']) env.Append(CPPDEFINES='NDEBUG') + env.Append(LINKFLAGS='/RELEASE') # PLAN THE BUILD SHARED_SOURCES = [] @@ -334,28 +357,32 @@ else: # If build with gssapi, get its information and define SERF_HAVE_GSSAPI if gssapi and CALLOUT_OKAY: - env.ParseConfig('$GSSAPI --libs gssapi') + env.ParseConfig('$GSSAPI --cflags gssapi') + def parse_libs(env, cmd, unique=1): + env['GSSAPI_LIBS'] = cmd.strip() + return env.MergeFlags(cmd, unique) + env.ParseConfig('$GSSAPI --libs gssapi', parse_libs) env.Append(CPPDEFINES='SERF_HAVE_GSSAPI') if sys.platform == 'win32': env.Append(CPPDEFINES=['SERF_HAVE_SSPI']) -# On Solaris, the -R values that APR describes never make it into actual +# On some systems, the -R values that APR describes never make it into actual # RPATH flags. We'll manually map all directories in LIBPATH into new # flags to set RPATH values. -if sys.platform == 'sunos5': - for d in env['LIBPATH']: - env.Append(RPATH=d) +for d in env['LIBPATH']: + env.Append(RPATH=':'+d) # Set up the construction of serf-*.pc -# TODO: add gssapi libs pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,), env.File('build/serf.pc.in'), SUBST_DICT = { '@MAJOR@': str(MAJOR), '@PREFIX@': '$PREFIX', + '@LIBDIR@': '$LIBDIR', '@INCLUDE_SUBDIR@': 'serf-%d' % (MAJOR,), '@VERSION@': '%d.%d.%d' % (MAJOR, MINOR, PATCH), - '@LIBS@': '%s %s -lz' % (apu_libs, apr_libs), + '@LIBS@': '%s %s %s -lz' % (apu_libs, apr_libs, + env.get('GSSAPI_LIBS', '')), }) env.Default(lib_static, lib_shared, pkgconfig) @@ -371,16 +398,22 @@ if CALLOUT_OKAY: # INSTALLATION STUFF install_static = env.Install(libdir, lib_static) -install_shared = env.Install(libdir, lib_shared) +install_shared = env.InstallVersionedLib(libdir, lib_shared) if sys.platform == 'darwin': + # Change the shared library install name (id) to its final name and location. + # Notes: + # If --install-sandbox= is specified, install_shared_path will point + # to a path in the sandbox. We can't use that path because the sandbox is + # only a temporary location. The id should be the final target path. + # Also, we shouldn't use the complete version number for id, as that'll + # make applications depend on the exact major.minor.patch version of serf. + install_shared_path = install_shared[0].abspath + target_install_shared_path = os.path.join(libdir, '%s.dylib' % LIBNAME) env.AddPostAction(install_shared, ('install_name_tool -id %s %s' - % (install_shared_path, + % (target_install_shared_path, install_shared_path))) - ### construct shared lib symlinks. this also means install the lib - ### as libserf-2.1.0.0.dylib, then add the symlinks. - ### note: see InstallAs env.Alias('install-lib', [install_static, install_shared, ]) Modified: stable/10/contrib/serf/auth/auth.c ============================================================================== --- stable/10/contrib/serf/auth/auth.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth.c Sat Feb 22 18:55:49 2014 (r262339) @@ -23,7 +23,8 @@ #include static apr_status_t -default_auth_response_handler(peer_t peer, +default_auth_response_handler(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -151,6 +152,17 @@ static int handle_auth_headers(int code, if (!auth_hdr) continue; + if (code == 401) { + authn_info = serf__get_authn_info_for_server(conn); + } else { + authn_info = &ctx->proxy_authn_info; + } + + if (authn_info->failed_authn_types & scheme->type) { + /* Skip this authn type since we already tried it before. */ + continue; + } + /* Found a matching scheme */ status = APR_SUCCESS; @@ -159,11 +171,6 @@ static int handle_auth_headers(int code, serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "... matched: %s\n", scheme->name); - if (code == 401) { - authn_info = serf__get_authn_info_for_server(conn); - } else { - authn_info = &ctx->proxy_authn_info; - } /* If this is the first time we use this scheme on this context and/or this connection, make sure to initialize the authentication handler first. */ @@ -198,6 +205,12 @@ static int handle_auth_headers(int code, */ serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "%s authentication failed.\n", scheme->name); + + /* Clear per-request auth_baton when switching to next auth scheme. */ + request->auth_baton = NULL; + + /* Remember failed auth types to skip in future. */ + authn_info->failed_authn_types |= scheme->type; } return status; @@ -221,7 +234,7 @@ static int store_header_in_dict(void *ba char *auth_name, *c; /* We're only interested in xxxx-Authenticate headers. */ - if (strcmp(key, ab->header) != 0) + if (strcasecmp(key, ab->header) != 0) return 0; /* Extract the authentication scheme name. */ @@ -378,16 +391,16 @@ apr_status_t serf__handle_auth_response( authn_info = serf__get_authn_info_for_server(conn); if (authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(HOST, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, HOST, sl.code, + conn, request, response, pool); } /* Validate the response proxy authn headers. */ authn_info = &ctx->proxy_authn_info; if (!resp_status && authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(PROXY, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, PROXY, sl.code, + conn, request, response, pool); } if (resp_status) { Modified: stable/10/contrib/serf/auth/auth.h ============================================================================== --- stable/10/contrib/serf/auth/auth.h Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth.h Sat Feb 22 18:55:49 2014 (r262339) @@ -78,7 +78,8 @@ apr_status_t serf__setup_request_digest_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_digest_auth(peer_t peer, +apr_status_t serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -108,7 +109,8 @@ apr_status_t serf__setup_request_spnego_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_spnego_auth(peer_t peer, +apr_status_t serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, Modified: stable/10/contrib/serf/auth/auth_basic.c ============================================================================== --- stable/10/contrib/serf/auth/auth_basic.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_basic.c Sat Feb 22 18:55:49 2014 (r262339) @@ -48,7 +48,7 @@ serf__handle_basic_auth(int code, apr_status_t status; apr_pool_t *cred_pool; char *username, *password, *realm_name; - const char *eq, *realm; + const char *eq, *realm = NULL; /* Can't do Basic authentication if there's no callback to get username & password. */ Modified: stable/10/contrib/serf/auth/auth_digest.c ============================================================================== --- stable/10/contrib/serf/auth/auth_digest.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_digest.c Sat Feb 22 18:55:49 2014 (r262339) @@ -96,8 +96,9 @@ random_cnonce(apr_pool_t *pool) return hex_encode((unsigned char*)buf, pool); } -static const char * -build_digest_ha1(const char *username, +static apr_status_t +build_digest_ha1(const char **out_ha1, + const char *username, const char *password, const char *realm_name, apr_pool_t *pool) @@ -113,12 +114,17 @@ build_digest_ha1(const char *username, realm_name, password); status = apr_md5(ha1, tmp, strlen(tmp)); + if (status) + return status; + + *out_ha1 = hex_encode(ha1, pool); - return hex_encode(ha1, pool); + return APR_SUCCESS; } -static const char * -build_digest_ha2(const char *uri, +static apr_status_t +build_digest_ha2(const char **out_ha2, + const char *uri, const char *method, const char *qop, apr_pool_t *pool) @@ -134,17 +140,21 @@ build_digest_ha2(const char *uri, method, uri); status = apr_md5(ha2, tmp, strlen(tmp)); + if (status) + return status; - return hex_encode(ha2, pool); + *out_ha2 = hex_encode(ha2, pool); + + return APR_SUCCESS; } else { /* TODO: auth-int isn't supported! */ + return APR_ENOTIMPL; } - - return NULL; } -static const char * -build_auth_header(digest_authn_info_t *digest_info, +static apr_status_t +build_auth_header(const char **out_header, + digest_authn_info_t *digest_info, const char *path, const char *method, apr_pool_t *pool) @@ -156,7 +166,9 @@ build_auth_header(digest_authn_info_t *d const char *response_hdr_hex; apr_status_t status; - ha2 = build_digest_ha2(path, method, digest_info->qop, pool); + status = build_digest_ha2(&ha2, path, method, digest_info->qop, pool); + if (status) + return status; hdr = apr_psprintf(pool, "Digest realm=\"%s\"," @@ -194,6 +206,9 @@ build_auth_header(digest_authn_info_t *d } status = apr_md5(response_hdr, response, strlen(response)); + if (status) + return status; + response_hdr_hex = hex_encode(response_hdr, pool); hdr = apr_psprintf(pool, "%s, response=\"%s\"", hdr, response_hdr_hex); @@ -207,7 +222,9 @@ build_auth_header(digest_authn_info_t *d digest_info->algorithm); } - return hdr; + *out_header = hdr; + + return APR_SUCCESS; } apr_status_t @@ -330,8 +347,8 @@ serf__handle_digest_auth(int code, digest_info->username = apr_pstrdup(digest_info->pool, username); digest_info->digest_nc++; - digest_info->ha1 = build_digest_ha1(username, password, digest_info->realm, - digest_info->pool); + status = build_digest_ha1(&digest_info->ha1, username, password, + digest_info->realm, digest_info->pool); apr_pool_destroy(cred_pool); @@ -339,7 +356,7 @@ serf__handle_digest_auth(int code, likes. */ serf_connection_set_max_outstanding_requests(conn, 0); - return APR_SUCCESS; + return status; } apr_status_t @@ -387,7 +404,7 @@ serf__setup_request_digest_auth(peer_t p serf_context_t *ctx = conn->ctx; serf__authn_info_t *authn_info; digest_authn_info_t *digest_info; - apr_status_t status = APR_SUCCESS; + apr_status_t status; if (peer == HOST) { authn_info = serf__get_authn_info_for_server(conn); @@ -421,8 +438,10 @@ serf__setup_request_digest_auth(peer_t p /* Build a new Authorization header. */ digest_info->header = (peer == HOST) ? "Authorization" : "Proxy-Authorization"; - value = build_auth_header(digest_info, path, method, - conn->pool); + status = build_auth_header(&value, digest_info, path, method, + conn->pool); + if (status) + return status; serf_bucket_headers_setn(hdrs_bkt, digest_info->header, value); @@ -431,14 +450,15 @@ serf__setup_request_digest_auth(peer_t p /* Store the uri of this request on the serf_request_t object, to make it available when validating the Authentication-Info header of the matching response. */ - request->auth_baton = path; + request->auth_baton = (void *)path; } - return status; + return APR_SUCCESS; } apr_status_t -serf__validate_response_digest_auth(peer_t peer, +serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -453,6 +473,7 @@ serf__validate_response_digest_auth(peer const char *nc_str = NULL; serf_bucket_t *hdrs; serf_context_t *ctx = conn->ctx; + apr_status_t status; hdrs = serf_bucket_response_get_headers(response); @@ -516,7 +537,10 @@ serf__validate_response_digest_auth(peer } digest_info = authn_info->baton; - ha2 = build_digest_ha2(req_uri, "", qop, pool); + status = build_digest_ha2(&ha2, req_uri, "", qop, pool); + if (status) + return status; + tmp = apr_psprintf(pool, "%s:%s:%s:%s:%s:%s", digest_info->ha1, digest_info->nonce, nc_str, digest_info->cnonce, digest_info->qop, ha2); Modified: stable/10/contrib/serf/auth/auth_spnego.c ============================================================================== --- stable/10/contrib/serf/auth/auth_spnego.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_spnego.c Sat Feb 22 18:55:49 2014 (r262339) @@ -181,7 +181,8 @@ typedef struct claim to be. The session key can only be used with the HTTP service on the target host. */ static apr_status_t -gss_api_get_credentials(char *token, apr_size_t token_len, +gss_api_get_credentials(serf_connection_t *conn, + char *token, apr_size_t token_len, const char *hostname, const char **buf, apr_size_t *buf_len, gss_authn_info_t *gss_info) @@ -202,6 +203,7 @@ gss_api_get_credentials(char *token, apr /* Establish a security context to the server. */ status = serf__spnego_init_sec_context( + conn, gss_info->gss_ctx, KRB_HTTP_SERVICE, hostname, &input_buf, @@ -212,7 +214,11 @@ gss_api_get_credentials(char *token, apr switch(status) { case APR_SUCCESS: - gss_info->state = gss_api_auth_completed; + if (output_buf.length == 0) { + gss_info->state = gss_api_auth_completed; + } else { + gss_info->state = gss_api_auth_in_progress; + } break; case APR_EAGAIN: gss_info->state = gss_api_auth_in_progress; @@ -242,6 +248,7 @@ do_auth(peer_t peer, int code, gss_authn_info_t *gss_info, serf_connection_t *conn, + serf_request_t *request, const char *auth_hdr, apr_pool_t *pool) { @@ -306,6 +313,14 @@ do_auth(peer_t peer, break; } + if (request->auth_baton && !token) { + /* We provided token with this request, but server responded with empty + authentication header. This means server rejected our credentials. + XXX: Probably we need separate error code for this case like + SERF_ERROR_AUTHN_CREDS_REJECTED? */ + return SERF_ERROR_AUTHN_FAILED; + } + /* If the server didn't provide us with a token, start with a new initial step in the SPNEGO authentication. */ if (!token) { @@ -314,14 +329,16 @@ do_auth(peer_t peer, } if (peer == HOST) { - status = gss_api_get_credentials(token, token_len, + status = gss_api_get_credentials(conn, + token, token_len, conn->host_info.hostname, &tmp, &tmp_len, gss_info); } else { char *proxy_host; apr_getnameinfo(&proxy_host, conn->ctx->proxy_address, 0); - status = gss_api_get_credentials(token, token_len, proxy_host, + status = gss_api_get_credentials(conn, + token, token_len, proxy_host, &tmp, &tmp_len, gss_info); } @@ -357,24 +374,32 @@ serf__init_spnego_connection(const serf_ serf_connection_t *conn, apr_pool_t *pool) { - gss_authn_info_t *gss_info; - apr_status_t status; - - gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); - gss_info->pool = conn->pool; - gss_info->state = gss_api_auth_not_started; - gss_info->pstate = pstate_init; - status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, - gss_info->pool, pool); - - if (status) { - return status; - } + serf_context_t *ctx = conn->ctx; + serf__authn_info_t *authn_info; + gss_authn_info_t *gss_info = NULL; + /* For proxy authentication, reuse the gss context for all connections. + For server authentication, create a new gss context per connection. */ if (code == 401) { - conn->authn_baton = gss_info; + authn_info = &conn->authn_info; } else { - conn->proxy_authn_baton = gss_info; + authn_info = &ctx->proxy_authn_info; + } + gss_info = authn_info->baton; + + if (!gss_info) { + apr_status_t status; + + gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); + gss_info->pool = conn->pool; + gss_info->state = gss_api_auth_not_started; + gss_info->pstate = pstate_init; + status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, + gss_info->pool, pool); + if (status) { + return status; + } + authn_info->baton = gss_info; } /* Make serf send the initial requests one by one */ @@ -397,13 +422,15 @@ serf__handle_spnego_auth(int code, apr_pool_t *pool) { serf_connection_t *conn = request->conn; - gss_authn_info_t *gss_info = (code == 401) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (code == 401) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; return do_auth(code == 401 ? HOST : PROXY, code, gss_info, request->conn, + request, auth_hdr, pool); } @@ -418,8 +445,9 @@ serf__setup_request_spnego_auth(peer_t p const char *uri, serf_bucket_t *hdrs_bkt) { - gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; /* If we have an ongoing authentication handshake, the handler of the previous response will have created the authn headers for this request @@ -431,6 +459,10 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -469,6 +501,7 @@ serf__setup_request_spnego_auth(peer_t p code, gss_info, conn, + request, 0l, /* no response authn header */ conn->pool); if (status) @@ -476,6 +509,11 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -486,19 +524,70 @@ serf__setup_request_spnego_auth(peer_t p return APR_SUCCESS; } +/** + * Baton passed to the get_auth_header callback function. + */ +typedef struct { + const char *hdr_name; + const char *auth_name; + const char *hdr_value; + apr_pool_t *pool; +} get_auth_header_baton_t; + +static int +get_auth_header_cb(void *baton, + const char *key, + const char *header) +{ + get_auth_header_baton_t *b = baton; + + /* We're only interested in xxxx-Authenticate headers. */ + if (strcasecmp(key, b->hdr_name) != 0) + return 0; + + /* Check if header value starts with interesting auth name. */ + if (strncmp(header, b->auth_name, strlen(b->auth_name)) == 0) { + /* Save interesting header value and stop iteration. */ + b->hdr_value = apr_pstrdup(b->pool, header); + return 1; + } + + return 0; +} + +static const char * +get_auth_header(serf_bucket_t *hdrs, + const char *hdr_name, + const char *auth_name, + apr_pool_t *pool) +{ + get_auth_header_baton_t b; + + b.auth_name = hdr_name; + b.hdr_name = auth_name; + b.hdr_value = NULL; + b.pool = pool; + + serf_bucket_headers_do(hdrs, get_auth_header_cb, &b); + + return b.hdr_value; +} + /* Function is called when 2xx responses are received. Normally we don't * have to do anything, except for the first response after the * authentication handshake. This specific response includes authentication * data which should be validated by the client (mutual authentication). */ apr_status_t -serf__validate_response_spnego_auth(peer_t peer, +serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, serf_bucket_t *response, apr_pool_t *pool) { + serf_context_t *ctx = conn->ctx; gss_authn_info_t *gss_info; const char *auth_hdr_name; @@ -511,10 +600,10 @@ serf__validate_response_spnego_auth(peer "Validate Negotiate response header.\n"); if (peer == HOST) { - gss_info = conn->authn_baton; + gss_info = conn->authn_info.baton; auth_hdr_name = "WWW-Authenticate"; } else { - gss_info = conn->proxy_authn_baton; + gss_info = ctx->proxy_authn_info.baton; auth_hdr_name = "Proxy-Authenticate"; } @@ -524,11 +613,23 @@ serf__validate_response_spnego_auth(peer apr_status_t status; hdrs = serf_bucket_response_get_headers(response); - auth_hdr_val = serf_bucket_headers_get(hdrs, auth_hdr_name); + auth_hdr_val = get_auth_header(hdrs, auth_hdr_name, scheme->name, + pool); - status = do_auth(peer, code, gss_info, conn, auth_hdr_val, pool); - if (status) - return status; + if (auth_hdr_val) { + status = do_auth(peer, code, gss_info, conn, request, auth_hdr_val, + pool); + if (status) { + return status; + } + } else { + /* No Authenticate headers, nothing to validate: authentication + completed.*/ + gss_info->state = gss_api_auth_completed; + + serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, + "SPNEGO handshake completed.\n"); + } } if (gss_info->state == gss_api_auth_completed) { Modified: stable/10/contrib/serf/auth/auth_spnego.h ============================================================================== --- stable/10/contrib/serf/auth/auth_spnego.h Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_spnego.h Sat Feb 22 18:55:49 2014 (r262339) @@ -88,14 +88,15 @@ serf__spnego_create_sec_context(serf__sp * Other returns values indicates error. */ apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, - const char *service, - const char *hostname, - serf__spnego_buffer_t *input_buf, - serf__spnego_buffer_t *output_buf, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool - ); +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, + const char *service, + const char *hostname, + serf__spnego_buffer_t *input_buf, + serf__spnego_buffer_t *output_buf, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool + ); /* * Reset a previously created security context so we can start with a new one. Modified: stable/10/contrib/serf/auth/auth_spnego_gss.c ============================================================================== --- stable/10/contrib/serf/auth/auth_spnego_gss.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_spnego_gss.c Sat Feb 22 18:55:49 2014 (r262339) @@ -43,7 +43,7 @@ struct serf__spnego_context_t }; static void -log_error(int verbose_flag, const char *filename, +log_error(int verbose_flag, apr_socket_t *skt, serf__spnego_context_t *ctx, OM_uint32 err_maj_stat, OM_uint32 err_min_stat, @@ -70,7 +70,7 @@ log_error(int verbose_flag, const char * &stat_buff); } - serf__log(verbose_flag, filename, + serf__log_skt(verbose_flag, __FILE__, skt, "%s (%x,%d): %s\n", msg, err_maj_stat, err_min_stat, stat_buff.value); } @@ -89,7 +89,7 @@ cleanup_ctx(void *data) gss_maj_stat = gss_delete_sec_context(&gss_min_stat, &ctx->gss_ctx, GSS_C_NO_BUFFER); if(GSS_ERROR(gss_maj_stat)) { - log_error(AUTH_VERBOSE, __FILE__, ctx, + log_error(AUTH_VERBOSE, NULL, ctx, gss_maj_stat, gss_min_stat, "Error cleaning up GSS security context"); return SERF_ERROR_AUTHN_FAILED; @@ -146,7 +146,8 @@ serf__spnego_reset_sec_context(serf__spn } apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, const char *service, const char *hostname, serf__spnego_buffer_t *input_buf, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 19:10:59 2014 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 ESMTPS id 8BC933FE; Sat, 22 Feb 2014 19:10:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7851714A0; Sat, 22 Feb 2014 19:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MJAx9J003249; Sat, 22 Feb 2014 19:10:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MJAx1G003248; Sat, 22 Feb 2014 19:10:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402221910.s1MJAx1G003248@svn.freebsd.org> From: Ian Lepore Date: Sat, 22 Feb 2014 19:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262340 - head/sys/boot/fdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 19:10:59 -0000 Author: ian Date: Sat Feb 22 19:10:58 2014 New Revision: 262340 URL: http://svnweb.freebsd.org/changeset/base/262340 Log: Change fdt_setup_fdtp() from "guess then fail" to more probe-like behavior. The old code basically said it was going to use some particular blob without knowing whether it could successfully do so, then it would invoke the function to do that and return its status. If it failed, you were done, even if other blobs might be available. Now the code attempts to use some particular blob and if that succeeds it says so and returns success, otherwise it moves on to try another potential blob. One specific problem this solves is when u-boot sets an fdtaddr variable to point to some memory address, then doesn't actually load a blob at that address. Now the header check will fail, and the code will move on to the fallback dtb compiled into the kernel (if any). Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 18:55:49 2014 (r262339) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 19:10:58 2014 (r262340) @@ -128,6 +128,8 @@ fdt_find_static_dtb() char *strp; int i, sym_count; + debugf("fdt_find_static_dtb()\n"); + sym_count = symtab = strtab = 0; strp = NULL; @@ -189,6 +191,8 @@ fdt_load_dtb(vm_offset_t va) struct fdt_header header; int err; + debugf("fdt_load_dtb(0x%08jx)\n", (uintmax_t)va); + COPYOUT(va, &header, sizeof(header)); err = fdt_check_header(&header); if (err < 0) { @@ -229,6 +233,8 @@ fdt_load_dtb_addr(struct fdt_header *hea { int err; + debugf("fdt_load_dtb_addr(0x%p)\n", header); + fdtp_size = fdt_totalsize(header); err = fdt_check_header(header); if (err < 0) { @@ -252,39 +258,58 @@ fdt_setup_fdtp() { struct preloaded_file *bfp; struct fdt_header *hdr; + int err; const char *s; char *p; vm_offset_t va; + debugf("fdt_setup_fdtp()\n"); + + /* If we already loaded a file, use it. */ if ((bfp = file_findfile(NULL, "dtb")) != NULL) { - printf("Using DTB from loaded file.\n"); - return fdt_load_dtb(bfp->f_addr); + if (fdt_load_dtb(bfp->f_addr) == 0) { + printf("Using DTB from loaded file.\n"); + return (0); + } } - + + /* If we were given the address of a valid blob in memory, use it. */ if (fdt_to_load != NULL) { - printf("Using DTB from memory address 0x%08X.\n", - (unsigned int)fdt_to_load); - return fdt_load_dtb_addr(fdt_to_load); + if (fdt_load_dtb_addr(fdt_to_load) == 0) { + printf("Using DTB from memory address 0x%08X.\n", + (unsigned int)fdt_to_load); + return (0); + } } - /* Board vendors use both fdtaddr and fdt_addr names. Grrrr. */ + /* + * If the U-boot environment contains a variable giving the address of a + * valid blob in memory, use it. Board vendors use both fdtaddr and + * fdt_addr names. + */ s = ub_env_get("fdtaddr"); if (s == NULL) s = ub_env_get("fdt_addr"); if (s != NULL && *s != '\0') { hdr = (struct fdt_header *)strtoul(s, &p, 16); if (*p == '\0') { - printf("Using DTB provided by U-Boot.\n"); - return fdt_load_dtb_addr(hdr); + if (fdt_load_dtb_addr(hdr) == 0) { + printf("Using DTB provided by U-Boot at " + "address 0x%08X.\n", hdr); + return (0); + } } } - + + /* If there is a dtb compiled into the kernel, use it. */ if ((va = fdt_find_static_dtb()) != 0) { - printf("Using DTB compiled into kernel.\n"); - return (fdt_load_dtb(va)); + if (fdt_load_dtb(va) == 0) { + printf("Using DTB compiled into kernel.\n"); + return (0); + } } - command_errmsg = "no device tree blob found!"; + command_errmsg = "No device tree blob found!\n"; return (1); } @@ -678,6 +703,8 @@ fdt_fixup(void) ethstr = NULL; len = 0; + debugf("fdt_fixup()\n"); + if (fdtp == NULL && fdt_setup_fdtp() != 0) return (0); @@ -741,7 +768,7 @@ int fdt_copy(vm_offset_t va) { int err; - + debugf("fdt_copy va 0x%08x\n", va); if (fdtp == NULL) { err = fdt_setup_fdtp(); if (err) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 19:20:41 2014 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 ESMTPS id 3D415634; Sat, 22 Feb 2014 19:20:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B80C158C; Sat, 22 Feb 2014 19:20:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MJKeah007646; Sat, 22 Feb 2014 19:20:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MJKeGr007645; Sat, 22 Feb 2014 19:20:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201402221920.s1MJKeGr007645@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Feb 2014 19:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262341 - 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 19:20:41 -0000 Author: glebius Date: Sat Feb 22 19:20:40 2014 New Revision: 262341 URL: http://svnweb.freebsd.org/changeset/base/262341 Log: Improve logging of send errors, reporting error code and interface. Reduce code duplication between INET and INET6. Tested by: Lytochkin Boris Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Sat Feb 22 19:10:58 2014 (r262340) +++ head/sys/netinet/ip_carp.c Sat Feb 22 19:20:40 2014 (r262341) @@ -764,6 +764,35 @@ carp_send_ad(void *v) } static void +carp_send_ad_error(struct carp_softc *sc, int error) +{ + + if (error) { + if (sc->sc_sendad_errors < INT_MAX) + sc->sc_sendad_errors++; + if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) { + static const char fmt[] = "send error %d on %s"; + char msg[sizeof(fmt) + IFNAMSIZ]; + + sprintf(msg, fmt, error, sc->sc_carpdev->if_xname); + carp_demote_adj(V_carp_senderr_adj, msg); + } + sc->sc_sendad_success = 0; + } else { + if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS && + ++sc->sc_sendad_success >= CARP_SENDAD_MIN_SUCCESS) { + static const char fmt[] = "send ok on %s"; + char msg[sizeof(fmt) + IFNAMSIZ]; + + sprintf(msg, fmt, sc->sc_carpdev->if_xname); + carp_demote_adj(-V_carp_senderr_adj, msg); + sc->sc_sendad_errors = 0; + } else + sc->sc_sendad_errors = 0; + } +} + +static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; @@ -839,25 +868,8 @@ carp_send_ad_locked(struct carp_softc *s CARPSTATS_INC(carps_opackets); - if (ip_output(m, NULL, NULL, IP_RAWOUTPUT, - &sc->sc_carpdev->if_carp->cif_imo, NULL)) { - if (sc->sc_sendad_errors < INT_MAX) - sc->sc_sendad_errors++; - if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(V_carp_senderr_adj, - "send error"); - sc->sc_sendad_success = 0; - } else { - if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { - if (++sc->sc_sendad_success >= - CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-V_carp_senderr_adj, - "send ok"); - sc->sc_sendad_errors = 0; - } - } else - sc->sc_sendad_errors = 0; - } + carp_send_ad_error(sc, ip_output(m, NULL, NULL, IP_RAWOUTPUT, + &sc->sc_carpdev->if_carp->cif_imo, NULL)); } #endif /* INET */ #ifdef INET6 @@ -913,25 +925,8 @@ carp_send_ad_locked(struct carp_softc *s CARPSTATS_INC(carps_opackets6); - if (ip6_output(m, NULL, NULL, 0, - &sc->sc_carpdev->if_carp->cif_im6o, NULL, NULL)) { - if (sc->sc_sendad_errors < INT_MAX) - sc->sc_sendad_errors++; - if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(V_carp_senderr_adj, - "send6 error"); - sc->sc_sendad_success = 0; - } else { - if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { - if (++sc->sc_sendad_success >= - CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-V_carp_senderr_adj, - "send6 ok"); - sc->sc_sendad_errors = 0; - } - } else - sc->sc_sendad_errors = 0; - } + carp_send_ad_error(sc, ip6_output(m, NULL, NULL, 0, + &sc->sc_carpdev->if_carp->cif_im6o, NULL, NULL)); } #endif /* INET6 */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 20:12:11 2014 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 ESMTPS id F282E1B0; Sat, 22 Feb 2014 20:12:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9434F191A; Sat, 22 Feb 2014 20:12:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MKCA8F028460; Sat, 22 Feb 2014 20:12:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MKCAW7028459; Sat, 22 Feb 2014 20:12:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402222012.s1MKCAW7028459@svn.freebsd.org> From: John Baldwin Date: Sat, 22 Feb 2014 20:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262342 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 20:12:11 -0000 Author: jhb Date: Sat Feb 22 20:12:10 2014 New Revision: 262342 URL: http://svnweb.freebsd.org/changeset/base/262342 Log: Record earlier merge of 257018. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 21:34:28 2014 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 ESMTPS id BEB78E1; Sat, 22 Feb 2014 21:34:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAA611FAA; Sat, 22 Feb 2014 21:34:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MLYSDu059209; Sat, 22 Feb 2014 21:34:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MLYSPd059208; Sat, 22 Feb 2014 21:34:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402222134.s1MLYSPd059208@svn.freebsd.org> From: Eitan Adler Date: Sat, 22 Feb 2014 21:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262343 - head/share/misc 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 21:34:28 -0000 Author: eadler Date: Sat Feb 22 21:34:28 2014 New Revision: 262343 URL: http://svnweb.freebsd.org/changeset/base/262343 Log: bsd-family-tree: Add DragonFly 3.6.1 to the tree. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Feb 22 20:12:10 2014 (r262342) +++ head/share/misc/bsd-family-tree Sat Feb 22 21:34:28 2014 (r262343) @@ -290,9 +290,9 @@ FreeBSD 5.2 | | | | | | | | *--FreeBSD | | NetBSD 6.1.3 | | | 10.0 | | | | + | | | | DragonFly 3.6.1 | | | | | - | | | | | -FreeBSD 11 -current | NetBSD -current OpenBSD -current | +FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -611,6 +611,7 @@ OpenBSD 5.4 2013-11-01 [OBD] DragonFly 3.6.0 2013-11-25 [DFB] FreeBSD 10.0 2014-01-20 [FBD] NetBSD 6.1.3 2014-01-27 [NBD] +DragonFly 3.6.0 2014-02-22 [DFB] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 21:35:40 2014 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 ESMTPS id B184A220; Sat, 22 Feb 2014 21:35:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BFF61FAD; Sat, 22 Feb 2014 21:35:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MLZeNR059392; Sat, 22 Feb 2014 21:35:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MLZe1V059391; Sat, 22 Feb 2014 21:35:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402222135.s1MLZe1V059391@svn.freebsd.org> From: Eitan Adler Date: Sat, 22 Feb 2014 21:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262344 - head/share/misc 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 21:35:40 -0000 Author: eadler Date: Sat Feb 22 21:35:40 2014 New Revision: 262344 URL: http://svnweb.freebsd.org/changeset/base/262344 Log: bsd-family-tree: Add DragonFly 3.6.1 to the tree. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Feb 22 21:34:28 2014 (r262343) +++ head/share/misc/bsd-family-tree Sat Feb 22 21:35:40 2014 (r262344) @@ -611,7 +611,7 @@ OpenBSD 5.4 2013-11-01 [OBD] DragonFly 3.6.0 2013-11-25 [DFB] FreeBSD 10.0 2014-01-20 [FBD] NetBSD 6.1.3 2014-01-27 [NBD] -DragonFly 3.6.0 2014-02-22 [DFB] +DragonFly 3.6.1 2014-02-22 [DFB] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 22:03:27 2014 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 ESMTPS id A1B687AD; Sat, 22 Feb 2014 22:03:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8EB11CD; Sat, 22 Feb 2014 22:03:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MM3RgC070956; Sat, 22 Feb 2014 22:03:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MM3RIu070952; Sat, 22 Feb 2014 22:03:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402222203.s1MM3RIu070952@svn.freebsd.org> From: Ian Lepore Date: Sat, 22 Feb 2014 22:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262345 - head/sys/boot/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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 22:03:27 -0000 Author: ian Date: Sat Feb 22 22:03:26 2014 New Revision: 262345 URL: http://svnweb.freebsd.org/changeset/base/262345 Log: Change file_loadraw() from static to public. Change the order of its arguments from type,filename to filename,type to be consistant with other public file_whatever() functions, and change it to return a pointer to the preloaded_file struct describing the file. Adjust existing callers. Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Sat Feb 22 21:35:40 2014 (r262344) +++ head/sys/boot/common/bootstrap.h Sat Feb 22 22:03:26 2014 (r262345) @@ -233,6 +233,7 @@ int mod_loadkld(const char *name, int struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(char *name, char *type); struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type); +struct preloaded_file *file_loadraw(char *name, char *type); void file_discard(struct preloaded_file *fp); void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Sat Feb 22 21:35:40 2014 (r262344) +++ head/sys/boot/common/module.c Sat Feb 22 22:03:26 2014 (r262345) @@ -52,7 +52,6 @@ struct moduledir { }; static int file_load(char *filename, vm_offset_t dest, struct preloaded_file **result); -static int file_loadraw(char *type, char *name); static int file_load_dependencies(struct preloaded_file *base_mod); static char * file_search(const char *name, char **extlist); static struct kernel_module * file_findmodule(struct preloaded_file *fp, char *modname, struct mod_depend *verinfo); @@ -134,7 +133,7 @@ command_load(int argc, char *argv[]) command_errmsg = "invalid load type"; return(CMD_ERROR); } - return(file_loadraw(typestr, argv[1])); + return(file_loadraw(argv[1], typestr) ? CMD_OK : CMD_ERROR); } /* * Do we have explicit KLD load ? @@ -189,7 +188,7 @@ command_load_geli(int argc, char *argv[] argv += (optind - 1); argc -= (optind - 1); sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); - return(file_loadraw(typestr, argv[2])); + return(file_loadraw(argv[2], typestr) ? CMD_OK : CMD_ERROR); } COMMAND_SET(unload, "unload", "unload all modules", command_unload); @@ -357,8 +356,8 @@ file_load_dependencies(struct preloaded_ * We've been asked to load (name) as (type), so just suck it in, * no arguments or anything. */ -int -file_loadraw(char *type, char *name) +struct preloaded_file * +file_loadraw(char *name, char *type) { struct preloaded_file *fp; char *cp; @@ -368,21 +367,21 @@ file_loadraw(char *type, char *name) /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { command_errmsg = "can't load file before kernel"; - return(CMD_ERROR); + return(NULL); } /* locate the file on the load path */ cp = file_search(name, NULL); if (cp == NULL) { sprintf(command_errbuf, "can't find '%s'", name); - return(CMD_ERROR); + return(NULL); } name = cp; if ((fd = open(name, O_RDONLY)) < 0) { sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); free(name); - return(CMD_ERROR); + return(NULL); } if (archsw.arch_loadaddr != NULL) @@ -398,7 +397,7 @@ file_loadraw(char *type, char *name) sprintf(command_errbuf, "error reading '%s': %s", name, strerror(errno)); free(name); close(fd); - return(CMD_ERROR); + return(NULL); } laddr += got; } @@ -419,7 +418,7 @@ file_loadraw(char *type, char *name) /* Add to the list of loaded files */ file_insert_tail(fp); close(fd); - return(CMD_OK); + return(fp); } /* From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 22:07:17 2014 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 ESMTPS id 34B4F91E; Sat, 22 Feb 2014 22:07:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04E5A11ED; Sat, 22 Feb 2014 22:07:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MM7GMJ071557; Sat, 22 Feb 2014 22:07:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MM7GJc071554; Sat, 22 Feb 2014 22:07:16 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201402222207.s1MM7GJc071554@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 22 Feb 2014 22:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262346 - head/sys/fs/ext2fs 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 22:07:17 -0000 Author: pfg Date: Sat Feb 22 22:07:16 2014 New Revision: 262346 URL: http://svnweb.freebsd.org/changeset/base/262346 Log: ext2fs: fully enable ext4 read-only support. The ext4 developers tend to tag Ext4-specific flags as "incompatible" even when such features are not relevant for read-only support. This is a consequence of the process though which this filesystem is implemented without design and the fact that some new features are not extensible to ext2/3. Organize the features according to what we support and sort them so that we can now read-only mount filesystems with some features that may be found in newly formatted ext4 fs. Submitted by: Zheng Liu Reviewed by: pfg MFC after: 5 days Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sat Feb 22 22:03:26 2014 (r262345) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sat Feb 22 22:07:16 2014 (r262346) @@ -290,7 +290,8 @@ ext2_check_sb_compat(struct ext2fs *es, return (1); } if (es->e2fs_rev > E2FS_REV0) { - if (es->e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP) { + if (es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP | + EXT4F_RO_INCOMPAT_SUPP)) { printf( "WARNING: mount of %s denied due to unsupported optional features\n", devtoname(dev)); Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Sat Feb 22 22:03:26 2014 (r262345) +++ head/sys/fs/ext2fs/ext2fs.h Sat Feb 22 22:07:16 2014 (r262346) @@ -200,19 +200,26 @@ struct csum { * We support the following REV1 features: * - EXT2F_ROCOMPAT_SPARSESUPER * - EXT2F_ROCOMPAT_LARGEFILE + * - EXT2F_ROCOMPAT_EXTRA_ISIZE * - EXT2F_INCOMPAT_FTYPE * * We partially (read-only) support the following EXT4 features: * - EXT2F_ROCOMPAT_HUGE_FILE - * - EXT2F_ROCOMPAT_EXTRA_ISIZE * - EXT2F_INCOMPAT_EXTENTS + * + * We do not support these EXT4 features but they are irrelevant + * for read-only support: + * - EXT2F_INCOMPAT_FLEX_BG + * - EXT2F_INCOMPAT_META_BG */ -#define EXT2F_COMPAT_SUPP 0x0000 +#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) -#define EXT2F_INCOMPAT_SUPP (EXT2F_INCOMPAT_FTYPE | \ - EXT2F_INCOMPAT_EXTENTS) +#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE +#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ + EXT2F_INCOMPAT_FLEX_BG | \ + EXT2F_INCOMPAT_META_BG ) /* Assume that user mode programs are passing in an ext2fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 22:18:20 2014 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 ESMTPS id ACDE9AE9; Sat, 22 Feb 2014 22:18:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 893EF128F; Sat, 22 Feb 2014 22:18:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MMIKYD075901; Sat, 22 Feb 2014 22:18:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MMIKaf075900; Sat, 22 Feb 2014 22:18:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402222218.s1MMIKaf075900@svn.freebsd.org> From: Ian Lepore Date: Sat, 22 Feb 2014 22:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262347 - head/sys/boot/fdt 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.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 22:18:20 -0000 Author: ian Date: Sat Feb 22 22:18:20 2014 New Revision: 262347 URL: http://svnweb.freebsd.org/changeset/base/262347 Log: Add a feature for automatically finding and loading a dtb file by name. The name is taken from the u-boot env vars fdtfile or fdt_file. If the name isn't fully-qualified a search is done in module_path locations. The search order for a usable dtb in fdt_setup_fdtp() is now - A dtb loaded with an explicit "load -t dtb" command. - A dtb already loaded into memory somehow[*] and pointed to by fdt_to_load. - A dtb in the memory pointed to by the u-boot env vars fdtaddr or fdt_addr. - A file named by the u-boot env vars fdtfile or fdt_file. - A static dtb compiled into the kernel. * Presumably by some arch-specific command or code. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 22:07:16 2014 (r262346) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Feb 22 22:18:20 2014 (r262347) @@ -254,11 +254,36 @@ fdt_load_dtb_addr(struct fdt_header *hea } static int +fdt_load_dtb_file(const char * filename) +{ + struct preloaded_file *bfp, *oldbfp; + int err; + + debugf("fdt_load_dtb_file(%s)\n", filename); + + oldbfp = file_findfile(NULL, "dtb"); + + /* Attempt to load and validate a new dtb from a file. */ + if ((bfp = file_loadraw(filename, "dtb")) == NULL) { + sprintf(command_errbuf, "failed to load file '%s'", filename); + return (1); + } + if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { + file_discard(bfp); + return (err); + } + + /* A new dtb was validated, discard any previous file. */ + if (oldbfp) + file_discard(oldbfp); + return (0); +} + +static int fdt_setup_fdtp() { struct preloaded_file *bfp; struct fdt_header *hdr; - int err; const char *s; char *p; vm_offset_t va; @@ -268,7 +293,8 @@ fdt_setup_fdtp() /* If we already loaded a file, use it. */ if ((bfp = file_findfile(NULL, "dtb")) != NULL) { if (fdt_load_dtb(bfp->f_addr) == 0) { - printf("Using DTB from loaded file.\n"); + printf("Using DTB from loaded file '%s'.\n", + bfp->f_name); return (0); } } @@ -295,12 +321,26 @@ fdt_setup_fdtp() if (*p == '\0') { if (fdt_load_dtb_addr(hdr) == 0) { printf("Using DTB provided by U-Boot at " - "address 0x%08X.\n", hdr); + "address 0x%p.\n", hdr); return (0); } } } + /* + * If the U-boot environment contains a variable giving the name of a + * file, use it if we can load and validate it. + */ + s = ub_env_get("fdtfile"); + if (s == NULL) + s = ub_env_get("fdt_file"); + if (s != NULL && *s != '\0') { + if (fdt_load_dtb_file(s) == 0) { + printf("Loaded DTB from file '%s'.\n", s); + return (0); + } + } + /* If there is a dtb compiled into the kernel, use it. */ if ((va = fdt_find_static_dtb()) != 0) { if (fdt_load_dtb(va) == 0) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 23:28:43 2014 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 ESMTPS id 5C40E866; Sat, 22 Feb 2014 23:28:43 +0000 (UTC) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F67617E3; Sat, 22 Feb 2014 23:28:41 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id hr17so3826482lab.6 for ; Sat, 22 Feb 2014 15:28:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=SJA039sWmFl9/veQuFWMZEyR7Pp4FJu1NJ+tfBEJqOo=; b=JBejyudRUF/74gnrcI7VVjwszZxW6dVYkiWp+RFDQj5QwICjIWXRAH2nxrT3GWyxQv jMjgWaoeivSbrDwrFeXo6jaHAiJIq0aKRWrnWTcHUx2H4HNxCjwuLIQD8ApOoLnEjKrx xVylD8VZlktXwrYsETSccS6SPU6CChl+JSXdZonBSrHzG+2QhDZDnN/mIDqhR3Yt5iQ5 2sajlqwbYEGl/Q6TF8TnbwOnrh8memCkl7TT84Elgd7BakYAvlyuZQfxXPgEoWtNZP9g 4NfFeAKRrF+vHKyRUAgtuR0XPwfYafydFOY/+O3u4if8lH6ZGepbaeNW5xOPKVNGRKF6 NJCA== MIME-Version: 1.0 X-Received: by 10.152.143.231 with SMTP id sh7mr8104633lab.26.1393111718918; Sat, 22 Feb 2014 15:28:38 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.30.211 with HTTP; Sat, 22 Feb 2014 15:28:38 -0800 (PST) In-Reply-To: <20140219153215.GD63039@FreeBSD.org> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219101736.GX63039@glebius.int.ru> <20140219140123.Horde.zrXx5GqkiiaAfGIetc98KQ1@mail.vx.sk> <20140219153215.GD63039@FreeBSD.org> Date: Sat, 22 Feb 2014 15:28:38 -0800 X-Google-Sender-Auth: UJQjzTwjm2OAcL6YUrsDjRKonik Message-ID: Subject: Re: svn commit: r262196 - head/sys/netpfil/pf From: Craig Rodrigues To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis , src-committers@freebsd.org, Martin Matuska X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 23:28:43 -0000 On Wed, Feb 19, 2014 at 7:32 AM, Gleb Smirnoff wrote: > Third. As you already know, there is projects/pf branch, where Nicos > is getting things right wrt pf+VIMAGE. The patches should first go > to this branch and tested in it. Committing to head (even a good > code), you are creating conflicts for Nicos. You are fixing two > particular problems that hurt you, while Nicos tries to get things > right in general, for everyones sake. My approach on taskqueue > context (that was rejected by Marko), was also an attempt to > create a good and generic way of dealing with the problem. Unfortunately, > Marko didn't suggest good alternatives. > > Gleb, Much thanks to you and Nicos for working on pf + VIMAGE. I work on FreeNAS at iXsystems, and in FreeNAS we enable VIMAGE, because we use jails quiet heavily. I encouraged Martin to go with his patch, because it seemed to solve some problems we had with pf + VIMAGE kernel panics such as this one: https://bugs.freenas.org/issues/4153 Do you have a rough idea when you and Nicos will be ready to merge your projects/pf branch to HEAD? Would you be open to forking the https://github.com/trueos repository on github and putting your pf + VIMAGE patches in there? We could make special builds of FreeNAS and aggressively test your VIMAGE patches. FreeNAS isn't based on FreeBSD CURRENT/FreeBSD 10 yet..... we have some work to do to get up to there. Thanks. -- Craig From owner-svn-src-all@FreeBSD.ORG Sat Feb 22 23:34:41 2014 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 ESMTPS id ED438AB7; Sat, 22 Feb 2014 23:34:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5AA3187E; Sat, 22 Feb 2014 23:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MNYeJB007254; Sat, 22 Feb 2014 23:34:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MNYdmD007244; Sat, 22 Feb 2014 23:34:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402222334.s1MNYdmD007244@svn.freebsd.org> From: John Baldwin Date: Sat, 22 Feb 2014 23:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r262349 - in stable/10/sys/amd64/vmm: . intel X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages 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, 22 Feb 2014 23:34:41 -0000 Author: jhb Date: Sat Feb 22 23:34:39 2014 New Revision: 262349 URL: http://svnweb.freebsd.org/changeset/base/262349 Log: MFC 257297: Remove unnecessary includes of Modified: stable/10/sys/amd64/vmm/intel/vmcs.c stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx_genassym.c stable/10/sys/amd64/vmm/intel/vtd.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vmcs.c Sat Feb 22 23:34:39 2014 (r262349) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include "vmm_host.h" #include "vmcs.h" Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sat Feb 22 23:34:39 2014 (r262349) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/10/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_genassym.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vmx_genassym.c Sat Feb 22 23:34:39 2014 (r262349) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include "vmx.h" #include "vmx_cpufunc.h" Modified: stable/10/sys/amd64/vmm/intel/vtd.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vtd.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vtd.c Sat Feb 22 23:34:39 2014 (r262349) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/vmm.c Sat Feb 22 23:34:39 2014 (r262349) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/vmm_dev.c Sat Feb 22 23:34:39 2014 (r262349) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Sat Feb 22 23:34:39 2014 (r262349) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #else /* !_KERNEL */